﻿/* ========= THEME TOKENS =========
   These read from your layout if present; otherwise they fall back.
   Override any of these in :root (layout) or [data-theme="dark"] etc.
*/
:root {
    /* Brand */
    --brand-1: var(--brand-start, #3c7fbe);
    --brand-2: var(--brand-end, #2f6aa3);
    /* Neutrals */
    --ink: var(--color-ink, #1f2328);
    --muted: var(--color-muted, #6b7280);
    /* Surfaces */
    --bg-app: var(--color-app, #f6f7fb);
    --bg-panel: var(--color-panel, #ffffff);
    --surface-1: var(--color-surface-1, #f9f9f9);
    --surface-2: var(--color-surface-2, #f8f9fa);
    /* Borders & shadows */
    --border-1: var(--color-border, #e5e7eb);
    --shadow-1: 0 10px 30px rgba(0,0,0,.12);
    /* Status */
    --danger: var(--color-danger, #f44336);
    --success: var(--color-success, #16a34a);
    --warning: var(--color-warn, #f59e0b);
    --info: var(--color-info, #2e62e9);
    /* Radii & motion */
    --radius: 14px;
    --radius-sm: 10px;
    --transition: 220ms cubic-bezier(.2,.7,.2,1);
}

/* ========= HEADERS & TOOLBAR ========= */
.table-header {
    font-size: 1.5rem;
    color: var(--ink);
    margin-bottom: 10px;
    border-bottom: 2px solid var(--brand-2);
    padding-bottom: 5px;
    width: 100%;
}

.toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    background-color: var(--surface-1);
    padding: 3px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    margin-bottom: 0;
}

.toolbar-left, .toolbar-right {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

/* ========= BUTTONS ========= */

/* Base button */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 6px 14px;
    font-size: .95rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    cursor: pointer;
    transition: background-color .2s, border-color .2s, color .2s, box-shadow .2s, filter .2s;
    color: var(--ink);
    background: var(--surface-1, #f5f7fa);
}

    /* --- Primary (brand filled) --- */
    .btn.primary,
    .btn.add-new,
    .btn-primary-icon {
        background: var(--brand-1);
        color: #fff;
        border: 1px solid var(--brand-1);
        box-shadow: 0 3px 6px rgba(0,0,0,.1);
    }

        .btn.primary:hover,
        .btn.add-new:hover,
        .btn-primary-icon:hover {
            filter: brightness(.95);
        }

    /* --- Secondary (brand outlined) --- */
    .btn.secondary,
    .btn.sort {
        background: transparent;
        color: var(--brand-1);
        border: 1px solid var(--brand-1);
    }

        .btn.secondary:hover,
        .btn.sort:hover {
            background: color-mix(in srgb, var(--brand-1) 10%, transparent);
        }

    /* --- Success --- */
    .btn.success {
        background: var(--success);
        color: #fff;
        border: 1px solid var(--success);
    }

        .btn.success:hover {
            filter: brightness(.95);
        }

    /* --- Danger --- */
    .btn.danger,
    .btn.delete {
        background: var(--danger);
        color: #fff;
        border: 1px solid var(--danger);
    }

        .btn.danger:hover,
        .btn.delete:hover {
            filter: brightness(.95);
        }

    /* --- Warning --- */
    .btn.warning {
        background: var(--warning);
        color: #fff;
        border: 1px solid var(--warning);
    }

        .btn.warning:hover {
            filter: brightness(.95);
        }

    /* --- Neutral actions (print/filter/export/import) --- */
    .btn.print,
    .btn.filter,
    .btn.export,
    .btn.import {
        background: var(--surface-2);
        border: 1px solid var(--border-1);
        color: var(--ink);
        box-shadow: 0 2px 4px rgba(0,0,0,.08);
    }

        .btn.print:hover,
        .btn.filter:hover,
        .btn.export:hover,
        .btn.import:hover {
            background: #e7eef6;
        }

    /* --- Ghost (text-only) --- */
    .btn.ghost {
        background: transparent;
        border: none;
        color: var(--muted);
    }

        .btn.ghost:hover {
            background: rgba(0,0,0,.05);
        }

/* --- Special full-width action (Generate) --- */
.btn-generate {
    background: var(--info);
    color: #fff;
    border: 1px solid var(--info);
    width: 100%;
    padding: 8px;
    border-radius: var(--radius-sm);
    cursor: pointer;
}

    .btn-generate:hover {
        filter: brightness(.95);
    }

/* --- Disabled --- */
.btn:disabled {
    opacity: .55;
    cursor: not-allowed;
    pointer-events: none;
    box-shadow: none;
}

/* --- Icon-only --- */
.icon-btn.close {
    background: transparent;
    border: none;
    font-size: 1.1rem;
    color: var(--muted);
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}

/* ========= SEARCH ========= */
.search-box {
    display: flex;
    align-items: center;
    gap: .5rem;
    background-color: #fff;
    border: 1px solid var(--border-1);
    padding: .3rem .3rem;
    border-radius: 14px;
    max-width: 500px;
}

    .search-box input {
        border: none;
        outline: none;
        margin-left: 5px;
        width: 150px;
        font-size: .95rem;
        background: transparent;
        color: var(--ink);
    }

.search-icon {
    font-size: 1.2rem;
    color: var(--muted);
    padding-left: 13px;
}

.search-count {
    font-size: .9rem;
    color: var(--muted);
}

/* Upload result */
.upload-result {
    margin-top: 10px;
    font-weight: 600;
    color: var(--success);
}

    .upload-result:before {
        content: "✔️ ";
    }

    .upload-result.error {
        color: var(--danger);
    }

/* ========= CARDS / GROUPS ========= */
.card.text-center small {
    font-size: .85rem;
    color: #6c757d;
}

.card.text-center h5 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-top: .25rem;
}

.btn-group .btn {
    font-size: .9rem;
    padding: .4rem 1rem;
}

.d-flex.gap-2 .btn {
    font-size: .85rem;
    padding: .45rem .9rem;
}

.action-buttons {
    display: flex;
    gap: .5rem;
    justify-content: flex-end;
    align-items: center;
}

/* Outlined utility button */
.btn-outline-icon {
    border: 1px solid #d0d5dd;
    background: #2b3f69;
    color: #344054;
    font-size: .875rem;
    font-weight: 500;
    padding: .5rem 1rem;
    border-radius: .5rem;
    display: flex;
    align-items: center;
    gap: .4rem;
    transition: all .2s ease-in-out;
}

    .btn-outline-icon:hover {
        background: #f1f1f1;
    }

/* Filled utility */
.btn-primary-icon {
    background: var(--info);
    color: #fff;
    font-size: .875rem;
    font-weight: 500;
    padding: .5rem 1.1rem;
    border-radius: .5rem;
    border: none;
    display: flex;
    align-items: center;
    gap: .4rem;
    transition: filter .2s;
}

    .btn-primary-icon:hover {
        filter: brightness(.95);
    }

/* ========= TABLES ========= */
.table thead th {
    font-size: .875rem;
    font-weight: 600;
    text-transform: uppercase;
    background-color: var(--surface-2);
}

.table tbody td {
    font-size: .88rem;
    vertical-align: middle;
}

.table-hover tbody tr:hover {
    background-color: #f1f1f1;
    cursor: pointer;
}

/* Badges */
.badge {
    font-size: .75rem;
    padding: .4em .7em;
    color: black;
    border-radius: .5rem;
}

/* Pagination */
.pagination .page-item .page-link {
    font-size: .85rem;
    padding: .4rem .75rem;
}

/* ========= MODALS ========= */
.actions-right > .btn + .btn {
    margin-left: .5rem;
}

.step-badge {
    display: inline-grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--brand-1);
    color: #fff;
    font-size: .9rem;
    margin-right: .5rem;
}

/* ========= FORM GRID ========= */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0,1fr));
    gap: 14px;
}

    .form-grid .span-2 {
        grid-column: 1 / -1;
    }

label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: .9rem;
    color: var(--ink);
}

input, select, textarea {
    border: 1px solid var(--border-1);
    border-radius: 10px;
    padding: .6rem .7rem;
    font-size: .95rem;
    outline: none;
    transition: border var(--transition), box-shadow var(--transition);
    background: #fff;
    color: var(--ink);
}

    input:focus, select:focus, textarea:focus {
        border-color: var(--brand-1);
        box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-1) 25%, transparent);
    }

/* ========= WAREHOUSE LIST & PROMPT ========= */
.warehouse-list {
    list-style: none;
    padding: 0;
    margin: 0 0 12px;
    display: grid;
    gap: 10px;
}

    .warehouse-list li {
        border: 1px solid var(--border-1);
        border-radius: 12px;
        padding: 10px 12px;
        background: #fff;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

.wh-name {
    font-weight: 700;
    color: var(--ink);
}

.wh-meta {
    color: var(--muted);
    font-size: .9rem;
}

.prompt-add {
    margin-top: 12px;
    padding: 12px;
    background: #f7fafc;
    border: 1px dashed var(--border-1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.prompt-text {
    color: var(--ink);
    font-weight: 500;
}

.prompt-actions .btn {
    padding: .45rem .75rem;
}

/* ========= COLLAPSE ========= */
.collapse {
    height: 0;
    overflow: hidden;
    opacity: 0;
    transform: translateY(-6px);
    transition: height var(--transition), opacity var(--transition), transform var(--transition);
}

    .collapse.show {
        height: auto;
        opacity: 1;
        transform: translateY(0);
    }

/* ========= RESPONSIVE ========= */
@media (max-width:640px) {
    .form-grid {
        grid-template-columns: 1fr;
    }

    .modal-content, .modal-content.large {
        width: 96vw;
    }
}
/* Base label style */
label {
    display: inline-flex;
    /*align-items: center;*/
    cursor: pointer;
    font-size: 0.65rem;
    font-weight: 500;
    padding: 10px;
    color: #2e3c52;
    gap: 0.5rem;
    user-select: none;
}
    /* ===== Text-like Inputs ===== */
    label input[type="text"],
    label input[type="number"],
    label input[type="password"],
    label input[type="email"],
    label input[type="date"],
    label input[type="time"],
    label input[type="datetime-local"],
    label input[type="url"],
    label input[type="tel"],
    label select,
    label textarea,
    .form-control,
    .form-select {
        width: 100%;
        padding: 8px 10px;
        border: 1px solid #ccc;
        border-radius: 6px;
        font-size: 0.95rem;
        transition: border-color 0.2s ease, box-shadow 0.2s ease;
        background-color: #fff;
    }

        label input:focus,
        label select:focus,
        label textarea:focus {
            outline: none;
            border-color: #2f6aa3;
            box-shadow: 0 0 0 2px rgba(47, 106, 163, 0.2);
        }

    /* ===== Textarea specific ===== */
    label textarea {
        min-height: 80px;
        resize: vertical;
    }

    /* ===== File Input ===== */
    label input[type="file"] {
        padding: 6px;
        font-size: 0.9rem;
        border: 1px dashed #bbb;
        background: #fafafa;
        cursor: pointer;
    }

        label input[type="file"]:hover {
            border-color: #2f6aa3;
            background: #f0f7ff;
        }

    /* ===== Checkbox ===== */
    label input[type="checkbox"] {
        appearance: none;
        -webkit-appearance: none;
        -moz-appearance: none;
        width: 20px;
        height: 20px;
        border: 2px solid #3c7fbe;
        border-radius: 4px;
        display: inline-block;
        position: relative;
        cursor: pointer;
        transition: all 0.25s ease;
        background-color: #fff;
        margin-right: 8px;
    }

        label input[type="checkbox"]:hover {
            border-color: #2f6aa3;
            box-shadow: 0 0 4px rgba(60, 127, 190, 0.4);
        }

        label input[type="checkbox"]:checked {
            background-color: #3c7fbe;
            border-color: #3c7fbe;
        }

            label input[type="checkbox"]:checked::after {
                content: "";
                position: absolute;
                top: 50%;
                left: 50%;
                width: 6px;
                height: 12px;
                border: solid #fff;
                border-width: 0 3px 3px 0;
                transform: translate(-50%, -60%) rotate(45deg);
            }

    /* Wrap checkbox + text inline */
    label:has(input[type="checkbox"]) {
        flex-direction: row;
        align-items: center;
        gap: 8px;
    }

    /* ===== Radio Buttons ===== */
    label input[type="radio"] {
        appearance: none;
        -webkit-appearance: none;
        -moz-appearance: none;
        width: 20px;
        height: 20px;
        border: 2px solid #3c7fbe;
        border-radius: 50%;
        display: inline-block;
        position: relative;
        cursor: pointer;
        transition: all 0.25s ease;
        background-color: #fff;
        margin-right: 8px;
    }

        label input[type="radio"]:checked {
            border-color: #2f6aa3;
            background: #fff;
        }

            label input[type="radio"]:checked::after {
                content: "";
                width: 10px;
                height: 10px;
                background: #2f6aa3;
                border-radius: 50%;
                position: absolute;
                top: 50%;
                left: 50%;
                transform: translate(-50%, -50%);
            }

    /* Wrap radio + text inline */
    label:has(input[type="radio"]) {
        flex-direction: row;
        align-items: center;
        gap: 8px;
    }

 /*Hide the default checkbox */
/*label input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    width: 20px;
    height: 20px;
  
    border: 2px solid #3c7fbe;
    border-radius: 4px;
    display: inline-block;
    position: relative;
    cursor: pointer;
    transition: all 0.25s ease;
    background-color: #fff;
}*/

     /*Hover effect */
    /*label input[type="checkbox"]:hover {
        border-color: #2f6aa3;
        box-shadow: 0 0 4px rgba(60, 127, 190, 0.4);
    }*/

    /* Checked state */
    /*label input[type="checkbox"]:checked {
        background-color: #3c7fbe;
        border-color: #3c7fbe;
    }

         Thicker centered checkmark 
        label input[type="checkbox"]:checked::after {
            content: "";
            position: absolute;
            top: 50%;
            left: 50%;
            width: 6px;  
            height: 12px;  
            border: solid #fff;
            border-width: 0 3px 3px 0; 
            transform: translate(-50%, -60%) rotate(45deg); 
            transition: all 0.2s ease;
        }
_diff {
    display: inline-flex;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    padding: 10px;
    color: #2e3c52;
    gap: 0.5rem;
    user-select: none;
}*/
/* ===== General Icon Button Style ===== */
/* ===== Base icon style ===== */
._iconsect {
    border: none;
    background: none;
    cursor: pointer;
    font-size: 16px;
    padding: 2px 4px;
    margin: 0 6px;
    color: #555;
    transition: color 0.2s ease-in-out;
    vertical-align: middle;
}

/* ===== Delete (red tone) ===== */
.icon-cross {
    color: #dc3545; /* soft red */
}

    .icon-cross:hover {
        color: #b02a37;
    }

/* ===== Edit (blue tone) ===== */
.icon-filter-list {
    color: #0078d7; /* soft blue */
}

    .icon-filter-list:hover {
        color: #005ea6;
    }

/* ===== Tooltip (optional, uses title="...") ===== */
._iconsect[title] {
    position: relative;
}

    ._iconsect[title]:hover::after {
        content: attr(title);
        position: absolute;
        bottom: 125%;
        left: 50%;
        transform: translateX(-50%);
        background: rgba(0, 0, 0, 0.8);
        color: #fff;
        padding: 3px 8px;
        border-radius: 3px;
        font-size: 12px;
        white-space: nowrap;
        opacity: 0.9;
        z-index: 10;
    }
