/* ============================================================
  file name -victory.css 
  VICTORY theme. Palette: #054166 deep ocean, #4B95C1 ocean,
   #25224B navy, white, black, greys.
   ============================================================ */

:root {
    --ocean-deep:  #054166;
    --ocean:       #4B95C1;
    --navy:        #25224B;
    --grey-50:     #f4f6f8;
    --grey-100:    #e9edf1;
    --grey-600:    #5b6773;
    --ink:         #1b2430;
    --line:        #d9dee3;
    --grey:        #f3f5f7;
    --ocean-light: #e3eef6;
    --ocean-hover: #f0f6fb;
    --accent:      #4B95C1;
    --sidebar-w:   270px;
    --topbar-h:    72px;
    --radius:      10px;
    --shadow-sm:   0 1px 2px rgba(5, 65, 102, 0.05);
    --shadow-md:   0 4px 12px rgba(5, 65, 102, 0.08);
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: Calibri, Arial, sans-serif;
    font-size: 13.5pt;
    line-height: 1.5;
    background: var(--grey-50);
    color: var(--ink);
}

a { color: var(--ocean-deep); text-decoration: none; }
a:hover { color: var(--navy); }

h1, h2, h3, h4, h5, h6 { color: var(--navy); }

/* ============================================================
   SIDEBAR
   ============================================================ */
.side {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-w);
    height: 100vh;
    background: linear-gradient(180deg, var(--navy) 0%, #1a1838 100%);
    color: #cbd5e1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 2px 0 16px rgba(0, 0, 0, 0.12);
    transition: transform 0.25s ease;
}

.side::-webkit-scrollbar { width: 6px; }
.side::-webkit-scrollbar-track { background: transparent; }
.side::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.18); border-radius: 3px; }
.side::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.3); }

/* ---------- Brand / Logo (directly on navy) ---------- */
.side .brand {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px 18px 22px;
    margin-bottom: 8px;
    border-bottom: 1px solid rgba(255,255,255,.08);
    background: transparent;
    min-height: 120px;
    flex-shrink: 0;
}
.side .brand img.brand-img {
    width: auto;
    max-width: 78%;
    max-height: 84px;
    background: none;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
    object-fit: contain;
}
/* default blue logo -> white. Delete this rule if you use a white PNG */
.side .brand img.brand-img-default { filter: brightness(0) invert(1); }

/* ---------- Sidebar nav wrapper ---------- */
.nav-heading {
    padding: 16px 16px 4px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: #7f8bb0;
}
.side-nav {
    display: flex;
    flex-direction: column;
    padding: 6px 10px 20px;   /* horizontal padding so pills don't touch edges */
    flex: 1;
    gap: 4px;                  /* spacing between items */
}

/* ---------- Nav links ---------- */
.side a {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    color: #cbd5e1;                       /* light grey, readable */
    text-decoration: none;
    font-size: 15px;                      /* bold & visible */
    font-weight: 600;                     /* bolder */
    letter-spacing: 0.2px;
    border-radius: 10px;                  /* pill shape */
    border-left: 3px solid transparent;
    transition: background 0.18s ease,
                color 0.18s ease,
                border-color 0.18s ease,
                transform 0.12s ease;
    position: relative;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.side a span {
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ============================================================
   HOVER — WHITE accent (clean, high contrast)
   ============================================================ */
.side a:hover {
    background: rgba(255, 255, 255, 0.12);     /* soft white tint */
    color: #ffffff;                            /* pure white text */
    border-left-color: #ffffff;                /* white left bar */
    transform: translateX(3px);                /* subtle slide */
}

.side a:hover .bi {
    color: #ffffff;                            /* white icon */
    opacity: 1;
    transform: scale(1.15);
}

/* ============================================================
   ACTIVE — WHITE ELEVATED PILL + OCEAN LEFT BAR + BOLD TEXT
   ============================================================ */
.side a.active {
    background: #ffffff;                       /* white card */
    color: var(--ocean-deep);                  /* deep ocean text */
    font-weight: 800;                          /* extra bold */
    border-left-color: var(--ocean);           /* ocean blue bar */
    box-shadow:
        0 4px 14px rgba(0, 0, 0, 0.25),        /* elevation */
        inset 0 0 0 1px rgba(5, 65, 102, 0.08);
}

.side a.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 20%;
    bottom: 20%;
    width: 4px;
    border-radius: 0 4px 4px 0;
    background: var(--ocean);
    box-shadow: 0 0 10px rgba(75, 149, 193, 0.6);
}

.side a.active .bi {
    color: var(--ocean-deep);
    opacity: 1;
    transform: scale(1.1);
}

/* ============================================================
   Sidebar icons — bigger, bolder, high contrast
   ============================================================ */
.side a .bi {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    min-width: 24px;
    margin-right: 14px;
    font-size: 19px;                           /* bigger */
    font-weight: 700;
    color: #b6c2d1;                            /* brighter default */
    opacity: 0.95;                             /* always visible */
    transition: all 0.18s ease;
}

/* ============================================================
   MAIN AREA
   ============================================================ */
.main {
    margin-left: var(--sidebar-w);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--grey-50);
}

/* ============================================================
   TOP BAR
   ============================================================ */
.top {
    position: sticky;
    top: 0;
    z-index: 900;
    min-height: var(--topbar-h);
    background: #ffffff;
    border-bottom: 1px solid var(--line);
    box-shadow: 0 1px 3px rgba(5, 65, 102, 0.06);
    padding: 12px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.top-left,
.top-right {
    display: flex;
    align-items: center;       /* ← centers all items vertically */
    gap: 12px;
    flex-wrap: wrap;
}

/* Role badge */
.top .role-badge {
    display: inline-flex;
    align-items: center;
    padding: 5px 14px;
    background: var(--ocean-light);
    color: var(--ocean-deep);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    white-space: nowrap;
}

/* Branch chip */
.top .branch-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    background: #f8fafc;
    border: 1px solid var(--line);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--ink);
    transition: all 0.15s ease;
}

.top .branch-chip:hover {
    background: var(--ocean-hover);
    border-color: var(--ocean);
}

.top .branch-chip .bi {
    color: var(--ocean-deep);
    font-size: 16px;
}

/* Switch branch */
.top .switch-branch {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    background: transparent;
    border: 1px dashed var(--line);
    border-radius: 8px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--ocean-deep);
    text-decoration: none;
    transition: all 0.15s ease;
}

.top .switch-branch:hover {
    background: var(--ocean-light);
    border-color: var(--ocean);
    border-style: solid;
    color: var(--navy);
}

/* User name chip */
.top .user-name {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    background: #f8fafc;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--ink);
    white-space: nowrap;
}

.top .user-name .bi {
    color: var(--ocean-deep);
    font-size: 16px;
}

/* Logout */
.top .logout-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: #fdecea;
    color: #b42318;
    border-radius: 8px;
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 700;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.top .logout-link:hover {
    background: #b42318;
    color: #ffffff;
}

.top .logout-link:hover .bi {
    color: #ffffff;
}

/* Icons in topbar */
.ti {
    margin-right: .4rem;
    color: var(--ocean-deep);
    vertical-align: -.1em;
    font-size: 14px;
}

.top a .ti { color: inherit; }



/* ============================================================
   LAST LOGIN CHIP
   ============================================================ */
.top .last-login {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    background: #f0f6fb;                       /* soft ocean tint */
    border: 1px solid #cfe3f2;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--grey-600);
    white-space: nowrap;
    transition: all 0.15s ease;
}

.top .last-login:hover {
    background: var(--ocean-light);
    border-color: var(--ocean);
}

.top .last-login .bi {
    color: var(--ocean);
    font-size: 15px;
}

.top .last-login .ll-label {
    color: var(--grey-600);
    font-weight: 500;
}

.top .last-login strong {
    color: var(--ocean-deep);
    font-weight: 700;
}

/* Hide on small screens */
@media (max-width: 992px) {
    .top .last-login .ll-label { display: none; }
}

@media (max-width: 576px) {
    .top .last-login { display: none; }
}






/* ============================================================
   CONTENT AREA
   ============================================================ */
.content {
    padding: 28px;
    flex: 1;
}

/* ============================================================
   COMPONENTS
   ============================================================ */
.card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    background: #fff;
}

.card-h {
    font-size: .9rem;
    color: var(--grey-600);
}

.btn-primary {
    background: var(--ocean-deep);
    border-color: var(--ocean-deep);
}

.btn-primary:hover,
.btn-primary:focus {
    background: var(--navy);
    border-color: var(--navy);
}

.btn-outline-primary {
    color: var(--ocean-deep);
    border-color: var(--ocean-deep);
}

.btn-outline-primary:hover {
    background: var(--ocean-deep);
    border-color: var(--ocean-deep);
    color: #fff;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--ocean);
    box-shadow: 0 0 0 .2rem rgba(75, 149, 193, .25);
}

.form-check-input:checked {
    background-color: var(--ocean-deep);
    border-color: var(--ocean-deep);
}

.table { --bs-table-hover-bg: #eef4f9; }

th {
    background: var(--ocean-deep);
    color: #fff;
    font-weight: 600;
}

.big {
    font-size: 2rem;
    color: var(--ocean-deep);
    font-weight: 700;
}

.drop {
    border: 2px dashed var(--ocean);
    background: #fff;
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
}

/* ============================================================
   ALERTS
   ============================================================ */
.alert {
    border-radius: var(--radius);
    border: 1px solid transparent;
    padding: 12px 16px;
    font-size: 13.5px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
}

.alert-info    { background: #eff6ff; border-color: #bfdbfe; color: #1e40af; }
.alert-danger  { background: #fdecea; border-color: #f5c2bd; color: #b42318; }
.alert-success { background: #f0fdf4; border-color: #bbf7d0; color: #166534; }
.alert-warning { background: #fffbeb; border-color: #fde68a; color: #92400e; }


/* ============================================================
   AUTH PAGES (login, select branch)
   ============================================================ */
.auth { display: grid; grid-template-columns: 1.1fr 1fr; min-height: 100vh; }
.auth-hero {
    position: relative; overflow: hidden; color: #fff;
    padding: 3rem 3.5rem; display: flex; flex-direction: column;
    justify-content: center;
    background: linear-gradient(155deg, var(--ocean-deep) 0%, var(--navy) 100%);
}
.auth-hero:after {
    content: ""; position: absolute; left: 0; right: 0; bottom: 0;
    height: 40%; opacity: .16;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 900 200'%3E%3Cpath fill='%234B95C1' d='M0 100 Q112 40 225 100T450 100T675 100T900 100V200H0Z'/%3E%3C/svg%3E") repeat-x bottom/900px 100%;
}
.auth-hero > * { position: relative; z-index: 1; }
.logo-chip {
    align-self: flex-start; background: #fff; border-radius: 10px;
    padding: .6rem 1.1rem; margin-bottom: 2rem;
    display: inline-flex; align-items: center;
}
.logo-chip img { max-height: 46px; max-width: 220px; }
.logo-chip .wordmark {
    color: var(--ocean-deep); font-weight: 700;
    letter-spacing: .18em; font-size: 1.3rem;
}
.auth-hero h1 { color: #fff; font-size: 2rem; font-weight: 700; line-height: 1.25; }
.auth-hero p  { color: #dbe7ef; max-width: 30rem; }
.auth-points  { list-style: none; padding: 0; margin: 1.2rem 0 0; }
.auth-points li { padding: .2rem 0; color: #e9f1f7; }
.auth-points li:before {
    content: "\2713"; color: var(--ocean); font-weight: 700; margin-right: .6rem;
}
.auth-panel {
    display: flex; align-items: center; justify-content: center;
    padding: 2rem; background: var(--grey-50);
}
.auth-form {
    width: 100%; max-width: 390px; background: #fff;
    border: 1px solid var(--line); border-radius: 12px;
    padding: 2rem; box-shadow: 0 8px 24px rgba(5, 65, 102, .08);
}
.auth-form h2 { font-size: 1.4rem; color: var(--ocean-deep); margin-bottom: .2rem; }
.auth-form .sub { color: var(--grey-600); font-size: .9rem; margin-bottom: 1.3rem; }
.auth-form .form-label { font-size: .9rem; font-weight: 600; color: var(--navy); }
.pw { position: relative; }
.pw .form-control { padding-right: 4.2rem; }
.pw-toggle {
    position: absolute; right: .6rem; top: 50%; transform: translateY(-50%);
    border: 0; background: none; color: var(--ocean-deep);
    font-size: .85rem; cursor: pointer;
}
.auth-foot { margin-top: 1.2rem; text-align: center; color: var(--grey-600); font-size: .8rem; }
.auth-single {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    padding: 2rem;
    background: linear-gradient(155deg, var(--ocean-deep), var(--navy));
}
.select-panel {
    background: #fff; border-radius: 14px; width: 100%; max-width: 900px;
    padding: 2rem 2.25rem; box-shadow: 0 16px 40px rgba(0, 0, 0, .25);
}
.select-panel .logo-chip { padding: 0; margin: 0 0 1rem; border-radius: 0; }
.select-panel h2 { font-size: 1.5rem; color: var(--ocean-deep); }
.select-panel .sub { color: var(--grey-600); margin-bottom: 1.2rem; }
.branch-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: .9rem;
}
.branch-card {
    text-align: left; background: #fff; border: 1.5px solid var(--line);
    border-radius: 10px; padding: 1rem 1.1rem;
    display: flex; flex-direction: column; gap: .15rem;
    cursor: pointer; font: inherit; color: inherit;
    transition: border-color .15s, box-shadow .15s, transform .15s;
}
.branch-card:hover,
.branch-card:focus-visible {
    border-color: var(--ocean);
    box-shadow: 0 6px 16px rgba(5, 65, 102, .12);
    transform: translateY(-2px); outline: none;
}
.branch-card .code {
    align-self: flex-start; background: var(--ocean-deep); color: #fff;
    border-radius: 6px; padding: .05rem .55rem;
    font-size: .8rem; font-weight: 700; letter-spacing: .06em;
}
.branch-card .bname { font-weight: 700; color: var(--ocean-deep); margin-top: .4rem; }
.branch-card .bmeta { color: var(--grey-600); font-size: .85rem; }
.empty {
    border: 1.5px dashed var(--ocean); border-radius: 10px;
    padding: 1.5rem; text-align: center;
    color: var(--grey-600); grid-column: 1/-1;
}
.select-foot {
    margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid var(--line);
    display: flex; justify-content: space-between; font-size: .9rem;
}

@media (max-width: 860px) {
    .auth { grid-template-columns: 1fr; }
    .auth-hero { padding: 1.5rem; }
    .auth-points, .auth-hero p { display: none; }
    .auth-hero h1 { font-size: 1.3rem; }
    .logo-chip { margin-bottom: 1rem; }
}
/* ============================================================
   DASHBOARD
   ============================================================ */
.page-head{display:flex;align-items:flex-end;justify-content:space-between;gap:16px;flex-wrap:wrap;margin-bottom:20px}
.page-title{font-size:1.6rem;font-weight:700;margin:0 0 2px}
.page-sub{margin:0;color:var(--grey-600);font-size:.95rem}
.page-sub strong{color:var(--ink)}
.page-actions{display:flex;gap:10px;flex-wrap:wrap}
.page-actions .btn{display:inline-flex;align-items:center;gap:8px;font-weight:600}

/* Attention strip */
.attn{display:flex;gap:12px;flex-wrap:wrap;margin-bottom:20px}
.attn-item{flex:1 1 280px;display:flex;align-items:center;gap:12px;padding:12px 16px;border:1px solid;border-radius:var(--radius);font-size:.95rem;transition:box-shadow .15s}
.attn-item span{flex:1}
.attn-item:hover{box-shadow:var(--shadow-md)}
.attn-warn,.attn-warn:hover{background:#fffbeb;border-color:#fde68a;color:#92400e}
.attn-danger,.attn-danger:hover{background:#fdecea;border-color:#f5c2bd;color:#b42318}

/* KPI cards */
.kpi-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:16px;margin-bottom:20px}
.kpi{display:flex;align-items:center;gap:16px;padding:18px 20px;background:#fff;border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow-sm);color:var(--ink);transition:box-shadow .15s,border-color .15s}
a.kpi:hover{box-shadow:var(--shadow-md);border-color:var(--ocean);color:var(--ink)}
.kpi-ico{width:48px;height:48px;flex:none;display:grid;place-items:center;border-radius:10px;font-size:1.4rem;background:var(--ocean-light);color:var(--ocean-deep)}
.kpi-body{display:flex;flex-direction:column;min-width:0}
.kpi-label{font-size:.85rem;font-weight:600;color:var(--grey-600)}
.kpi-value{font-size:1.9rem;font-weight:700;line-height:1.15;color:var(--ocean-deep)}
.kpi-warn .kpi-ico{background:#fef3c7;color:#b45309}.kpi-warn .kpi-value{color:#b45309}
.kpi-danger .kpi-ico{background:#fdecea;color:#b42318}.kpi-danger .kpi-value{color:#b42318}

/* Panels */
.dash-grid{display:grid;grid-template-columns:minmax(0,2fr) minmax(0,1fr);gap:16px;align-items:start}
.panel{background:#fff;border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow-sm);overflow:hidden}
.panel-head{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:14px 20px;border-bottom:1px solid var(--line)}
.panel-title{display:flex;align-items:center;gap:8px;margin:0;font-size:1.05rem;font-weight:700}
.panel-title .bi{color:var(--ocean-deep)}
.panel-link{display:inline-flex;align-items:center;gap:4px;font-size:.9rem;font-weight:600}
.panel-meta{font-size:.85rem;color:var(--grey-600)}
.panel-body{padding:16px 20px}
.panel .table{margin:0}
.panel .table thead th{background:#f7f9fb;color:var(--grey-600);font-size:.8rem;font-weight:700;text-transform:uppercase;letter-spacing:.04em;padding:10px 20px;border-bottom:1px solid var(--line)}
.panel .table td{padding:12px 20px;border-color:#eef2f5}
.cell-subject{max-width:340px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

/* Status badges (table) */
.badge-status{display:inline-block;padding:3px 10px;border-radius:999px;font-size:.8rem;font-weight:700;white-space:nowrap;--c:#64748b;background:color-mix(in srgb,var(--c) 14%,#fff);color:color-mix(in srgb,var(--c) 75%,#000)}
.st-new{--c:#3b82f6}.st-processing{--c:#6366f1}.st-extracted{--c:#0891b2}
.st-review-required{--c:#d97706}.st-ready-for-quotation{--c:#16a34a}
.st-failed{--c:#dc2626}.st-cancelled{--c:#64748b}.st-closed{--c:#475569}

/* By-status list */
.status-row{padding:10px 0;border-bottom:1px solid #eef2f5}
.status-row:first-child{padding-top:0}
.status-row:last-child{padding-bottom:0;border-bottom:0}
.status-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:6px;font-size:.95rem}
.status-label{display:inline-flex;align-items:center;gap:8px;font-weight:600}
.status-dot{width:10px;height:10px;border-radius:50%;background:var(--c,#64748b)}
.status-count{font-weight:700;color:var(--ocean-deep)}
.status-bar{height:6px;background:#eef2f5;border-radius:999px;overflow:hidden}
.status-bar-fill{height:100%;border-radius:999px;background:var(--c,#64748b)}

/* Empty state */
.empty-row{text-align:center;padding:36px 12px !important;color:var(--grey-600)}
.empty-row .bi{display:block;font-size:2rem;color:var(--ocean);margin-bottom:6px}
.empty-row p{margin:0 0 6px}

@media(max-width:992px){.dash-grid{grid-template-columns:1fr}}
@media(max-width:576px){.page-title{font-size:1.35rem}.kpi-value{font-size:1.6rem}.cell-subject{max-width:160px}}
/* ============================================================
   LOGIN SLIDESHOW
   ============================================================ */
.auth.la-auth { grid-template-columns: 7fr 4fr; }
.la-hero { padding: 3rem 4.5rem; }
.la-hero:after { display: none; }
.auth-hero > .la-slides { position: absolute; inset: 0; z-index: 0; background: #0b111b; }
.la-slides:after {
    content: ""; position: absolute; inset: 0;
    background:
        linear-gradient(90deg, rgba(6,10,18,.86) 0%, rgba(6,10,18,.62) 55%, rgba(6,10,18,.38) 100%),
        linear-gradient(0deg, rgba(6,10,18,.55) 0%, rgba(6,10,18,0) 45%);
}
.la-slide {
    position: absolute; inset: 0; background-size: cover;
    background-position: center; opacity: 0;
    animation: la-fade 18s infinite;
}
.la-slide:nth-child(2) { animation-delay: 6s; }
.la-slide:nth-child(3) { animation-delay: 12s; }
@keyframes la-fade {
    0%   { opacity: 0; transform: scale(1); }
    6%   { opacity: 1; }
    33%  { opacity: 1; }
    39%  { opacity: 0; transform: scale(1.08); }
    100% { opacity: 0; transform: scale(1.08); }
}
.la-hero .la-brand {
    color: #fff; font-size: 3.4rem; font-weight: 700;
    letter-spacing: .22em; line-height: 1.1; margin: 0;
    text-shadow: 0 2px 14px rgba(0,0,0,.45);
}
.la-brand-sub {
    color: #cfe6f5; font-size: 1rem; font-weight: 600;
    letter-spacing: .14em; text-transform: uppercase;
    margin: .7rem 0 1.8rem; padding-top: .8rem;
    position: relative; text-shadow: 0 1px 8px rgba(0,0,0,.5);
}
.la-brand-sub:before {
    content: ""; position: absolute; top: 0; left: 0;
    width: 56px; height: 3px; border-radius: 2px; background: var(--ocean);
}
.la-hero .la-tag { color: #fff; font-size: 1.5rem; font-weight: 600; margin: 0 0 .6rem; text-shadow: 0 1px 8px rgba(0,0,0,.5); }
.la-hero p { color: #e6eef5; text-shadow: 0 1px 8px rgba(0,0,0,.5); }
.la-hero .auth-points li { text-shadow: 0 1px 8px rgba(0,0,0,.5); }
.la-form-logo { text-align: center; margin-bottom: 1.1rem; }
.la-form-logo img { max-height: 56px; max-width: 220px; }
.la-form-logo .wordmark { color: var(--ocean-deep); font-weight: 700; letter-spacing: .18em; font-size: 1.4rem; }
.la-form h2, .la-form .sub { text-align: center; }
.la-rise { animation: la-rise .7s ease both; }
.la-d1 { animation-delay: .12s; }
.la-d2 { animation-delay: .24s; }
.la-d3 { animation-delay: .36s; }
@keyframes la-rise {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: none; }
}
@media (max-width: 860px) {
    .auth.la-auth { grid-template-columns: 1fr; }
    .la-hero { padding: 1.5rem 1.5rem 2rem; }
    .la-hero .la-brand { font-size: 1.9rem; }
    .la-brand-sub { margin-bottom: 0; font-size: .8rem; }
    .la-hero .la-tag { display: none; }
}

/* ============================================================
   SELECT BRANCH PAGE
   ============================================================ */
.sb {
    position: relative; min-height: 100vh; display: flex;
    align-items: center; justify-content: center;
    padding: 2rem; background: #0b111b; overflow: hidden;
}
.sb-bg { position: absolute; inset: 0; z-index: 0; overflow: hidden; }
.sb-bg:after {
    content: ""; position: absolute; inset: 0;
    background: linear-gradient(180deg, rgba(6,10,18,.72) 0%, rgba(6,10,18,.55) 50%, rgba(6,10,18,.80) 100%);
}
.sb-wrap { position: relative; z-index: 1; width: 100%; max-width: 960px; }
.sb-panel {
    background: #fff; border-radius: 14px; overflow: hidden;
    box-shadow: 0 16px 40px rgba(0,0,0,.35);
}
.sb-head {
    display: flex; align-items: center; justify-content: space-between;
    gap: 1rem; flex-wrap: wrap; padding: 1.1rem 2rem;
    border-bottom: 1px solid var(--line);
}
.sb-logo img { max-height: 44px; max-width: 200px; }
.sb-logo .wordmark { color: var(--ocean-deep); font-weight: 700; letter-spacing: .18em; font-size: 1.2rem; }
.sb-user {
    display: inline-flex; align-items: center; gap: .6rem;
    background: var(--grey-50); border: 1px solid var(--line);
    border-radius: 999px; padding: .25rem .9rem .25rem .3rem;
    font-size: .9rem; color: var(--navy);
}
.sb-avatar {
    width: 28px; height: 28px; border-radius: 50%;
    background: var(--ocean-deep); color: #fff;
    display: grid; place-items: center;
    font-weight: 700; font-size: .85rem;
}
.sb-body { padding: 1.8rem 2rem 1.6rem; }
.sb-body h2 { font-size: 1.6rem; font-weight: 700; color: var(--ocean-deep); margin: 0 0 .3rem; }
.sb-sub { color: var(--grey-600); font-size: .95rem; margin: 0 0 1.4rem; }
.sb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1rem; }
.sb-card {
    position: relative; text-align: left;
    display: flex; flex-direction: column; gap: .15rem;
    background: #fff; color: var(--ink); font: inherit; cursor: pointer;
    padding: 1.1rem 1.2rem 1rem;
    border: 1.5px solid var(--line); border-top: 4px solid var(--ocean);
    border-radius: 10px;
    animation: la-rise .5s ease backwards;
    transition: background-color .18s, color .18s, border-color .18s, box-shadow .18s, transform .18s;
}
.sb-card-top {
    display: flex; align-items: center; justify-content: space-between;
    gap: .5rem; margin-bottom: .9rem;
}
.sb-code {
    font-size: 1.6rem; font-weight: 700; line-height: 1;
    letter-spacing: .04em; color: var(--ocean-deep); transition: color .18s;
}
.sb-cur {
    font-size: .75rem; font-weight: 700; letter-spacing: .05em;
    color: var(--ocean-deep); background: #e3eef6;
    padding: .2rem .65rem; border-radius: 999px;
    transition: background-color .18s, color .18s;
}
.sb-bname { font-weight: 700; font-size: 1.05rem; }
.sb-bmeta { color: var(--grey-600); font-size: .88rem; transition: color .18s; }
.sb-go { margin-top: .9rem; font-size: .85rem; font-weight: 600; color: var(--ocean); transition: color .18s, transform .18s; }
.sb-card:hover, .sb-card:focus-visible {
    background: var(--ocean-deep); color: #fff;
    border-color: var(--ocean-deep); border-top-color: var(--ocean);
    transform: translateY(-3px);
    box-shadow: 0 10px 24px rgba(5,65,102,.28); outline: none;
}
.sb-card:hover .sb-code, .sb-card:focus-visible .sb-code { color: #fff; }
.sb-card:hover .sb-bmeta, .sb-card:focus-visible .sb-bmeta { color: rgba(255,255,255,.78); }
.sb-card:hover .sb-cur, .sb-card:focus-visible .sb-cur { background: rgba(255,255,255,.18); color: #fff; }
.sb-card:hover .sb-go, .sb-card:focus-visible .sb-go { color: #fff; transform: translateX(4px); }
.sb-empty {
    grid-column: 1/-1; border: 1.5px dashed var(--ocean);
    border-radius: 10px; padding: 1.6rem; text-align: center;
    color: var(--grey-600); line-height: 1.7;
}
.sb-empty a { font-weight: 600; }
.sb-foot {
    display: flex; justify-content: space-between; align-items: center;
    gap: 1rem; flex-wrap: wrap;
    padding: .8rem 2rem; background: var(--grey-50);
    border-top: 1px solid var(--line); font-size: .9rem;
}
.sb-foot a {
    text-decoration: none; font-weight: 600;
    padding: .4rem .7rem; border-radius: 8px;
    transition: background-color .15s;
}
.sb-manage { color: var(--ocean-deep); }
.sb-manage:hover { background: #e3eef6; }
.sb-logout { color: #b42318; }
.sb-logout:hover { background: #fdecea; color: #b42318; }
.sb-caption {
    margin-top: 1.1rem; text-align: center; color: #cfe6f5;
    font-size: .8rem; letter-spacing: .14em; text-transform: uppercase;
    text-shadow: 0 1px 8px rgba(0,0,0,.6);
}
@media (max-width: 560px) {
    .sb { padding: 1rem; }
    .sb-head, .sb-body, .sb-foot { padding-left: 1.1rem; padding-right: 1.1rem; }
    .sb-body h2 { font-size: 1.35rem; }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 992px) {
    .side { transform: translateX(-100%); }
    .side.open { transform: translateX(0); }
    .main { margin-left: 0; }
    .top { padding: 12px 16px; }
}

@media (max-width: 576px) {
    :root { --sidebar-w: 100%; }
    .top-left, .top-right { font-size: 12.5px; gap: 8px; }
    .top .role-badge,
    .top .branch-chip,
    .top .user-name { padding: 5px 10px; font-size: 12px; }
    .content { padding: 16px; }
}

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; }
    .la-slide { animation: none; }
    .la-slide:first-child { opacity: 1; }
    .la-rise { animation: none; }
    .sb-card { animation: none; }
    .sb-card:hover { transform: none; }
}/* ===== RFQ form ===== */
.rfq-form .panel{margin-bottom:16px}
.rfq-form .form-label{font-size:.9rem;font-weight:600;color:var(--navy);margin-bottom:4px}
.opt{font-weight:500;color:var(--grey-600);font-size:.8rem;margin-left:4px}
.rfq-form .hint{font-size:.85rem;color:var(--grey-600);margin-top:4px}
.up-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:14px}
.up-box{display:flex;flex-direction:column;gap:10px;padding:16px;background:#fff;border:1.5px dashed var(--ocean);border-radius:var(--radius)}
.up-head{display:flex;align-items:center;gap:10px}
.up-ico{width:40px;height:40px;flex:none;display:grid;place-items:center;border-radius:10px;font-size:1.25rem;background:var(--ocean-light);color:var(--ocean-deep)}
.up-title{font-weight:700;color:var(--navy);line-height:1.2}
.up-types{font-size:.8rem;color:var(--grey-600)}
.up-list{font-size:.85rem;word-break:break-word}
.form-actions{display:flex;justify-content:flex-end;align-items:center;gap:10px;flex-wrap:wrap}
.form-actions .btn{display:inline-flex;align-items:center;gap:8px;font-weight:600}



/* ===== Branch Master ===== */
.bm-code{display:inline-block;min-width:64px;text-align:center;background:var(--ocean-deep);color:#fff;border-radius:6px;padding:3px 10px;font-size:.8rem;font-weight:700;letter-spacing:.06em}
.bm-name{font-weight:700;color:var(--navy);line-height:1.2}
.bm-meta{font-size:.8rem;color:var(--grey-600)}
.bm-count{display:inline-block;min-width:34px;text-align:center;padding:2px 10px;border-radius:999px;background:var(--ocean-light);color:var(--ocean-deep);font-weight:700;font-size:.9rem}
a.bm-count:hover{background:var(--ocean);color:#fff}
.bm-off td:not(:last-child){opacity:.6}
.st-active{--c:#16a34a}.st-inactive{--c:#64748b}
.bm-table .btn-sm{display:inline-flex;align-items:center;gap:5px;font-weight:600}
.bm-table td{padding-top:14px;padding-bottom:14px}

/* ============================================================
   BRANCH MASTER — Table & Cells
   ============================================================ */

/* Branch cell (code + name) */
.branch-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.branch-code {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 48px;
    height: 42px;
    padding: 0 10px;
    background: linear-gradient(135deg, var(--ocean-deep) 0%, var(--navy) 100%);
    color: #fff;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.5px;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(5, 65, 102, 0.25);
}

.branch-detail {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.branch-name {
    font-weight: 700;
    color: var(--ink);
    font-size: 14px;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.branch-meta {
    font-size: 11.5px;
    color: var(--grey-600);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* Location cell */
.loc-line {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    color: var(--ink);
    font-size: 13.5px;
}

.loc-line .bi {
    color: var(--ocean-deep);
    font-size: 13px;
}

.loc-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--grey-600);
    margin-top: 2px;
}

.loc-meta .bi {
    color: var(--ocean);
    font-size: 11px;
}

/* Currency tag */
.currency-tag {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    background: var(--ocean-light);
    color: var(--ocean-deep);
    border-radius: 6px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.5px;
}

/* VAT value */
.vat-value {
    font-weight: 700;
    color: var(--ink);
    font-size: 13.5px;
}

/* Count badges (users / RFQs) */
.count-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    background: var(--ocean-light);
    color: var(--ocean-deep);
    border-radius: 20px;
    font-size: 12.5px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.count-badge .bi {
    font-size: 12px;
    opacity: 0.8;
}

.count-badge:hover {
    background: var(--ocean);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(75, 149, 193, 0.3);
}

.count-badge-muted {
    background: #f1f5f9;
    color: #475569;
}

.count-badge-muted:hover {
    background: var(--grey-600);
    color: #fff;
}

/* Active / Inactive badges */
.badge-active {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 11px;
    background: #dcfce7;
    color: #15803d;
    border-radius: 20px;
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    white-space: nowrap;
}

.badge-inactive {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 11px;
    background: #f1f5f9;
    color: #64748b;
    border-radius: 20px;
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    white-space: nowrap;
}

/* Muted row (inactive branch) */
.row-muted {
    background: #fafbfc;
    opacity: 0.75;
}

.row-muted:hover {
    opacity: 1;
}

/* ============================================================
   ACTION BUTTONS
   ============================================================ */
.action-group {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 11px;
    border-radius: 7px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid transparent;
    background: transparent;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
    font-family: inherit;
    line-height: 1.2;
}

.action-btn .bi {
    font-size: 13px;
}

/* Edit */
.action-edit {
    background: var(--ocean-light);
    color: var(--ocean-deep);
    border-color: transparent;
}

.action-edit:hover {
    background: var(--ocean-deep);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(5, 65, 102, 0.25);
}

/* Admin */
.action-admin {
    background: #f3e8ff;
    color: #7e22ce;
    border-color: transparent;
}

.action-admin:hover {
    background: #7e22ce;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(126, 34, 206, 0.25);
}

/* Danger (deactivate) */
.action-danger {
    background: #fdecea;
    color: #b42318;
    border-color: transparent;
}

.action-danger:hover {
    background: #b42318;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(180, 35, 24, 0.25);
}

/* Success (activate) */
.action-success {
    background: #dcfce7;
    color: #15803d;
    border-color: transparent;
}

.action-success:hover {
    background: #15803d;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(21, 128, 61, 0.25);
}

/* ============================================================
   RESPONSIVE — Branch Master
   ============================================================ */
@media (max-width: 992px) {
    .action-btn span {
        display: none;               /* icon-only on tablet */
    }

    .action-btn {
        padding: 7px 10px;
    }

    .action-btn .bi {
        font-size: 15px;
    }
}

@media (max-width: 768px) {
    .stat-grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }

    .branch-code {
        min-width: 42px;
        height: 38px;
        font-size: 12px;
    }

    .branch-name {
        font-size: 13px;
    }
}

@media (max-width: 576px) {
    .stat-grid-4 {
        grid-template-columns: 1fr;
    }
}

/* ============================================================
   USER MASTER — Table & Cells
   ============================================================ */

.user-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--ocean-deep) 0%, var(--navy) 100%);
    color: #fff;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0.5px;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(5, 65, 102, 0.25);
}

.user-detail {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.user-name {
    font-weight: 700;
    color: var(--ink);
    font-size: 14px;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-meta {
    font-size: 11px;
    color: var(--grey-600);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    font-weight: 600;
}

.user-meta-super { color: #7e22ce; }

.username-pill {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    background: #f8fafc;
    border: 1px solid var(--line);
    border-radius: 6px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--ink);
    font-family: 'Consolas', 'Monaco', monospace;
}

/* Role badges */
.role-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 11px;
    border-radius: 20px;
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    white-space: nowrap;
    background: var(--ocean-light);
    color: var(--ocean-deep);
}

.role-super         { background: #f3e8ff; color: #7e22ce; }
.role-admin         { background: #dbeafe; color: #1e40af; }
.role-branch_admin  { background: #cffafe; color: #0e7490; }
.role-sales_manager { background: #dcfce7; color: #15803d; }
.role-sales_exec    { background: #d1fae5; color: #047857; }
.role-proc_manager  { background: #fed7aa; color: #9a3412; }
.role-proc_exec     { background: #fef3c7; color: #92400e; }
.role-finance       { background: #fce7f3; color: #9d174d; }
.role-auditor       { background: #e0e7ff; color: #3730a3; }

/* Branch pill */
.branch-pill {
    display: inline-flex;
    align-items: center;
    padding: 3px 9px;
    background: var(--navy);
    color: #fff;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

/* Email link */
.email-link {
    color: var(--ocean-deep);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.15s ease;
}

.email-link:hover {
    color: var(--navy);
    text-decoration: underline;
}

/* Login time */
.login-time {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12.5px;
    color: var(--grey-600);
    font-weight: 500;
    white-space: nowrap;
}

.login-time .bi {
    color: var(--ocean);
    font-size: 12px;
}
/* ============================================================
   FILTER BAR (used on RFQ list, User list, Supplier list, etc.)
   ============================================================ */
.filter-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filter-field {
    position: relative;
    display: flex;
    align-items: center;
    min-width: 200px;
}

.filter-field-lg {
    flex: 1;
    min-width: 260px;
}

/* Icon positioned INSIDE the input on the left */
.filter-ico {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--grey-600);
    font-size: 15px;
    pointer-events: none;
    z-index: 2;
}

/* Input/select styled to make room for the icon */
.filter-input {
    padding-left: 42px !important;
    height: 44px;
    border-radius: 8px;
    border: 1px solid var(--line);
    font-size: 14px;
    background: #fafbfc;
    transition: all 0.15s ease;
    width: 100%;
}

.filter-input:focus {
    background: #fff;
    border-color: var(--ocean);
    box-shadow: 0 0 0 3px rgba(75, 149, 193, 0.12);
}

/* Filter button */
.filter-btn {
    height: 44px;
    padding: 0 20px;
    font-weight: 600;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

/* Clear button */
.filter-clear {
    height: 44px;
    padding: 0 12px;
    color: var(--grey-600);
    font-size: 13.5px;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: 8px;
    transition: all 0.15s ease;
}

.filter-clear:hover {
    background: #fdecea;
    color: #b42318;
}

/* Responsive — stack on mobile */
@media (max-width: 768px) {
    .filter-bar {
        padding: 12px;
        gap: 8px;
    }

    .filter-field,
    .filter-field-lg {
        min-width: 100%;
        width: 100%;
    }

    .filter-btn,
    .filter-clear {
        width: 100%;
        justify-content: center;
    }
}
/* ============================================================
   SIDEBAR — COLLAPSIBLE GROUPS (DROPDOWN)
   ============================================================ */

/* Group wrapper */
.nav-group {
    display: flex;
    flex-direction: column;
    margin: 2px 0;
}

/* Group toggle button */
.nav-group-toggle {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 12px 16px;
    background: transparent;
    border: 0;
    color: #cbd5e1;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.2px;
    text-align: left;
    border-radius: 10px;
    border-left: 3px solid transparent;
    cursor: pointer;
    transition: background 0.18s ease,
                color 0.18s ease,
                border-color 0.18s ease;
    position: relative;
}

.nav-group-toggle:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    border-left-color: #ffffff;
}

.nav-group-toggle .bi:first-child {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    min-width: 24px;
    margin-right: 14px;
    font-size: 19px;
    color: #b6c2d1;
    transition: color 0.18s ease;
}

.nav-group-toggle:hover .bi:first-child {
    color: #ffffff;
}

.nav-group-toggle > span {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Caret icon */
.nav-group-caret {
    font-size: 12px !important;
    color: #93a5b8 !important;
    width: auto !important;
    min-width: 0 !important;
    margin-right: 0 !important;
    transition: transform 0.25s ease, color 0.18s ease;
}

.nav-group.open .nav-group-caret {
    transform: rotate(180deg);
    color: #ffffff !important;
}

/* Group items container */
.nav-group-items {
    display: none;
    flex-direction: column;
    margin: 4px 0 4px 18px;
    padding-left: 10px;
    border-left: 1px solid rgba(255, 255, 255, 0.12);
    gap: 2px;
    animation: navGroupOpen 0.25s ease;
}

.nav-group.open .nav-group-items {
    display: flex;
}

@keyframes navGroupOpen {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: none; }
}

/* Sub-item links */
.nav-group-items a {
    display: flex;
    align-items: center;
    padding: 9px 14px;
    color: #cbd5e1;
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 500;
    border-radius: 8px;
    border-left: 3px solid transparent;
    transition: background 0.15s ease,
                color 0.15s ease,
                border-color 0.15s ease,
                transform 0.12s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-group-items a .bi {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    min-width: 20px;
    margin-right: 11px;
    font-size: 15px;
    color: #93a5b8;
    transition: all 0.15s ease;
}

.nav-group-items a:hover {
    background: rgba(255, 255, 255, 0.10);
    color: #ffffff;
    border-left-color: rgba(255, 255, 255, 0.4);
    transform: translateX(2px);
}

.nav-group-items a:hover .bi {
    color: #ffffff;
    transform: scale(1.1);
}

/* Active sub-item */
.nav-group-items a.active {
    background: #ffffff;
    color: var(--ocean-deep);
    font-weight: 700;
    border-left-color: var(--ocean);
    box-shadow:
        0 3px 10px rgba(0, 0, 0, 0.2),
        inset 0 0 0 1px rgba(5, 65, 102, 0.08);
}

.nav-group-items a.active .bi {
    color: var(--ocean-deep);
    opacity: 1;
    transform: scale(1.05);
}

/* When a group contains an active item, keep the toggle highlighted */
.nav-group.has-active > .nav-group-toggle {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    border-left-color: var(--ocean);
}

.nav-group.has-active > .nav-group-toggle .bi:first-child {
    color: #ffffff;
}

/* Mobile — larger tap targets */
@media (max-width: 992px) {
    .nav-group-toggle { padding: 14px 18px; font-size: 15.5px; }
    .nav-group-items a { padding: 11px 16px; font-size: 14px; }
}
/* ============================================================
   STAT GRID — Icon beside value (compact horizontal layout)
   ============================================================ */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.stat-grid-4 {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

/* Compact horizontal stat card */
.stat {
    display: flex;
    align-items: center;
    gap: 16px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px 22px;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

/* Top accent bar */
.stat::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--ocean);
}

.stat-primary::before { background: var(--ocean); }
.stat-warn::before    { background: #f39c12; }
.stat-danger::before  { background: #dc2626; }
.stat-success::before { background: #16a34a; }

.stat:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    border-color: var(--ocean-light);
}

.stat-ico {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    background: var(--ocean-light);
    color: var(--ocean-deep);
    display: grid;
    place-items: center;
    font-size: 1.5rem;
    flex: none;
    transition: transform 0.2s ease;
}

.stat:hover .stat-ico {
    transform: scale(1.06);
}

.stat-warn    .stat-ico { background: #fef3c7; color: #b45309; }
.stat-danger  .stat-ico { background: #fdecea; color: #b42318; }
.stat-success .stat-ico { background: #dcfce7; color: #15803d; }

.stat-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.stat-value {
    font-size: 1.9rem;
    font-weight: 800;
    color: var(--ocean-deep);
    line-height: 1.1;
    letter-spacing: -0.5px;
}

.stat-warn    .stat-value { color: #b45309; }
.stat-danger  .stat-value { color: #b42318; }
.stat-success .stat-value { color: #15803d; }

.stat-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--grey-600);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Responsive */
@media (max-width: 768px) {
    .stat-grid-4 { grid-template-columns: repeat(2, 1fr); }
    .stat { padding: 14px 16px; gap: 12px; }
    .stat-value { font-size: 1.5rem; }
    .stat-ico { width: 44px; height: 44px; font-size: 1.25rem; }
}

@media (max-width: 480px) {
    .stat-grid-4 { grid-template-columns: 1fr; }
}
.user-name-row {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.user-name-row .user-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.status-dot-inline {
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    flex-shrink: 0;
    position: relative;
}

.status-dot-active {
    background: #16a34a;
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.15);
}

.status-dot-inactive {
    background: #94a3b8;
    box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.15);
}





/* ===== Processed RFQ ===== */
.proc-grid{display:grid;grid-template-columns:minmax(0,3fr) minmax(0,2fr);gap:16px;align-items:start}
.px-row{cursor:pointer}
.px-row.row-sel td{background:var(--ocean-hover)}
.px-row.row-incomplete td{background:#fffbeb}
.px-row.row-sel.row-incomplete td{background:#fef3c7}
.ty-oem{--c:#25224B}.ty-generic{--c:#0891b2}.ty-legacy{--c:#d97706}
.cf-hi{--c:#16a34a}.cf-mid{--c:#d97706}.cf-low{--c:#dc2626}
.src-group{font-size:.8rem;font-weight:700;text-transform:uppercase;letter-spacing:.04em;color:var(--grey-600);margin:14px 0 6px}
.src{display:flex;justify-content:space-between;align-items:center;gap:10px;padding:10px 12px;border:1px solid var(--line);border-radius:8px;margin-bottom:8px;background:#fff}
.src-pin{border-left:4px solid var(--ocean-deep)}
@media(max-width:992px){.proc-grid{grid-template-columns:1fr}}




/* ============================================================
   QUOTATION PREVIEW — COMPACT CONTEXT BAR
   ============================================================ */
.context-bar {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    margin-bottom: 20px;
    overflow: hidden;
}

.context-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 20px;
    cursor: pointer;
    list-style: none;
    flex-wrap: wrap;
    transition: background 0.15s ease;
}

.context-summary::-webkit-details-marker { display: none; }

.context-summary:hover {
    background: var(--ocean-hover);
}

.context-summary-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.context-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

.context-chip .bi { font-size: 13px; opacity: 0.85; }
.context-chip strong { font-weight: 800; }

.context-chip-primary { background: var(--ocean-light); color: var(--ocean-deep); }
.context-chip-success { background: #dcfce7; color: #15803d; }
.context-chip-warn    { background: #fef3c7; color: #92400e; }
.context-chip-muted   { background: #f1f5f9; color: #475569; }

.context-toggle-hint {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--grey-600);
    font-weight: 500;
}

.context-bar[open] .context-toggle-hint .bi {
    transform: rotate(180deg);
    transition: transform 0.2s ease;
}

.context-toggle-hint .bi {
    transition: transform 0.2s ease;
}

.context-body {
    padding: 18px 20px 20px;
    border-top: 1px solid var(--line);
    background: #fafbfc;
}

.context-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px 24px;
    margin-bottom: 18px;
}

.context-field {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.context-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--grey-600);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.context-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--ink);
}

.context-section {
    margin-top: 16px;
}

.context-section .context-label {
    margin-bottom: 8px;
    display: block;
}

.context-attachments {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.context-attachment {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    font-size: 13px;
    color: var(--ink);
    text-decoration: none;
    transition: all 0.15s ease;
}

.context-attachment:hover {
    border-color: var(--ocean);
    box-shadow: var(--shadow-sm);
}

/* ============================================================
   QUOTATION LAYOUT — 2 COLUMNS
   ============================================================ */
.quote-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 20px;
    align-items: start;
}

@media (max-width: 1200px) {
    .quote-layout {
        grid-template-columns: 1fr;
    }
}

.quote-main {
    min-width: 0;
}

.quote-side {
    position: sticky;
    top: 92px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

@media (max-width: 1200px) {
    .quote-side {
        position: static;
    }
}

/* ============================================================
   QUOTATION PAPER
   ============================================================ */
.quote-paper {
    padding: 32px 36px;
}

@media (max-width: 768px) {
    .quote-paper { padding: 20px; }
}

/* HEADER */
.quote-header {
    display: flex;
    align-items: center;
    gap: 20px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--ocean-deep);
    margin-bottom: 20px;
}

.quote-brand img {
    max-height: 56px;
    max-width: 180px;
    object-fit: contain;
}

.quote-wordmark {
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: 0.2em;
    color: var(--ocean-deep);
}

.quote-brand-info { flex: 1; }

.quote-brand-name {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--ocean-deep);
    margin-bottom: 2px;
}

.quote-brand-meta {
    font-size: 12.5px;
    color: var(--grey-600);
    line-height: 1.5;
}

.quote-title {
    font-size: 1.9rem;
    font-weight: 800;
    letter-spacing: 0.15em;
    color: var(--ocean-deep);
    text-align: center;
    margin: 0 0 24px;
}

/* CUSTOMER + META BLOCKS */
.quote-blocks {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

@media (max-width: 768px) {
    .quote-blocks { grid-template-columns: 1fr; }
}

.quote-block {
    background: #fafbfc;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.quote-block-title {
    font-size: 11px;
    font-weight: 800;
    color: var(--ocean-deep);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.quote-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.quote-row label {
    min-width: 100px;
    font-size: 12px;
    font-weight: 600;
    color: var(--grey-600);
}

/* INPUT STYLE (used across the paper) */
.qt-in {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    font-family: inherit;
    font-size: 13px;
    color: var(--ink);
    transition: all 0.15s ease;
    resize: vertical;
}

.qt-in:hover {
    background: #fff;
    border-color: var(--line);
}

.qt-in:focus {
    outline: none;
    background: #fff;
    border-color: var(--ocean);
    box-shadow: 0 0 0 3px rgba(75, 149, 193, 0.12);
}

.qt-in-bold {
    font-weight: 700;
    color: var(--ink);
}

.qt-in-desc {
    font-size: 13px;
    line-height: 1.4;
}

/* GREETING */
.quote-greeting {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--ink);
    margin-bottom: 16px;
}

/* ITEMS TABLE */
.quote-table {
    margin-bottom: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
}

.quote-table thead th {
    background: var(--ocean-deep);
    color: #fff;
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    padding: 10px 12px;
    border: none;
}

.quote-table tbody td {
    padding: 12px;
    vertical-align: top;
    border-bottom: 1px solid #eef2f5;
    font-size: 13px;
}

.quote-table tbody tr:last-child td {
    border-bottom: none;
}

.quote-table tbody tr:hover {
    background: #fafbfc;
}

.qt-line-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    margin-top: 6px;
    padding-left: 10px;
}

.qt-meta-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    background: #f1f5f9;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    color: #475569;
    white-space: nowrap;
}

.qt-meta-chip .bi { font-size: 10px; opacity: 0.8; }

.qt-meta-cost {
    background: #fef3c7;
    color: #92400e;
}

.qt-meta-text {
    font-size: 11px;
    color: var(--grey-600);
    font-weight: 500;
}

/* Delete button */
.qt-del {
    background: transparent;
    border: 0;
    color: #b42318;
    font-size: 14px;
    padding: 4px 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    opacity: 0.6;
}

.qt-del:hover {
    background: #fdecea;
    opacity: 1;
}

/* Highlight rows without price */
.qt-missing {
    background: #fffbeb;
}

/* TOTALS */
.quote-totals {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 24px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid var(--ocean-deep);
}

@media (max-width: 768px) {
    .quote-totals {
        grid-template-columns: 1fr;
    }
}

.quote-totals-terms {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.quote-totals-summary {
    background: #fafbfc;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    height: fit-content;
}

.quote-trow {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13.5px;
    gap: 12px;
}

.quote-trow span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--grey-600);
    font-weight: 500;
}

.quote-trow strong {
    font-weight: 700;
    color: var(--ink);
}

.quote-trow .qt-vat {
    width: 60px;
    display: inline-block;
    padding: 2px 6px;
    font-size: 13px;
    text-align: center;
    background: #fff;
    border: 1px solid var(--line);
}

.quote-trow-grand {
    border-top: 2px solid var(--ocean-deep);
    padding-top: 10px;
    margin-top: 4px;
    font-size: 1.05rem;
}

.quote-trow-grand span,
.quote-trow-grand span:first-child {
    color: var(--ocean-deep);
    font-weight: 800;
}

.quote-trow-grand span:last-child {
    color: var(--ocean-deep);
    font-weight: 800;
    font-size: 1.15rem;
}

/* SIGNATURE */
.quote-signature {
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-width: 320px;
}

.quote-signature-label {
    font-weight: 800;
    color: var(--ocean-deep);
    font-size: 13px;
    margin-bottom: 4px;
}

/* ============================================================
   QUOTATION SIDEBAR
   ============================================================ */
.quote-side-panel {
    border-radius: var(--radius);
}

.quote-side-grand-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--grey-600);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 4px;
}

.quote-side-grand {
    font-size: 2rem;
    font-weight: 800;
    color: var(--ocean-deep);
    letter-spacing: -1px;
    line-height: 1.1;
}

.quote-side-note {
    font-size: 12.5px;
    color: var(--grey-600);
    line-height: 1.5;
}

.quote-side-actions .panel-body {
    padding: 14px;
}

/* PRE for original email */
.qt-pre {
    white-space: pre-wrap;
    word-break: break-word;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 12.5px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 12px;
    max-height: 220px;
    overflow-y: auto;
    color: var(--ink);
    margin: 0;
}



/* ============================================================
   QUOTATION SUMMARY BAR (compact chips)
   ============================================================ */
.summary-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    padding: 14px 20px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    margin-bottom: 16px;
}

.summary-group {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.summary-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    background: #f1f5f9;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    white-space: nowrap;
}

.summary-chip .bi { font-size: 13px; opacity: 0.85; }
.summary-chip strong { font-weight: 800; color: inherit; }

.summary-chip-primary { background: var(--ocean-light); color: var(--ocean-deep); }
.summary-chip-success { background: #dcfce7; color: #15803d; }
.summary-chip-warn    { background: #fef3c7; color: #92400e; }
.summary-chip-muted   { background: #f1f5f9; color: #475569; }

/* ============================================================
   BULK ACTION BAR
   ============================================================ */
.bulk-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 20px;
    background: linear-gradient(90deg, var(--ocean-deep) 0%, var(--navy) 100%);
    color: #fff;
    border-radius: var(--radius);
    box-shadow: 0 4px 14px rgba(5, 65, 102, 0.25);
    margin-bottom: 16px;
    animation: bulkBarSlide 0.25s ease;
}

@keyframes bulkBarSlide {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: none; }
}

.bulk-bar-left {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}

.bulk-bar-left .bi { font-size: 18px; opacity: 0.9; }
.bulk-bar-left strong { font-weight: 800; }

.bulk-bar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.bulk-bar-actions .btn-outline-primary {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.4);
    background: transparent;
}

.bulk-bar-actions .btn-outline-primary:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: #fff;
    color: #fff;
}

.bulk-bar-actions .btn-primary {
    background: #fff;
    border-color: #fff;
    color: var(--ocean-deep);
    font-weight: 700;
}

.bulk-bar-actions .btn-primary:hover {
    background: var(--ocean-light);
    border-color: var(--ocean-light);
    color: var(--ocean-deep);
}

/* ============================================================
   OEM TABLE
   ============================================================ */
.oem-table thead th {
    background: #f8fafc;
    color: var(--grey-600);
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--line);
    padding: 12px 16px;
    white-space: nowrap;
}

.oem-table tbody td {
    padding: 16px;
    border-bottom: 1px solid #f0f3f6;
    vertical-align: middle;
    font-size: 13.5px;
}

.oem-table tbody tr:last-child td {
    border-bottom: none;
}

.oem-table tbody tr:hover {
    background: #f8fbfd;
}

/* Highlight row needing review */
.oem-row-warn {
    background: #fffbeb;
}

.oem-row-warn:hover {
    background: #fef9e0;
}

/* Line number */
.oem-no {
    font-weight: 700;
    color: var(--grey-600);
    font-size: 13px;
}

/* Description cell */
.oem-desc {
    font-weight: 600;
    color: var(--ink);
    font-size: 13.5px;
    line-height: 1.4;
    margin-bottom: 4px;
}

.oem-desc-meta {
    font-size: 12px;
    color: var(--grey-600);
    line-height: 1.4;
}

/* IMPA code */
.oem-code {
    display: inline-flex;
    align-items: center;
    padding: 3px 9px;
    background: var(--navy);
    color: #fff;
    border-radius: 6px;
    font-size: 11.5px;
    font-weight: 800;
    letter-spacing: 0.5px;
}

/* Matched OEM */
.oem-match {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-weight: 600;
    color: var(--ink);
    font-size: 13.5px;
    line-height: 1.35;
    margin-bottom: 4px;
}

.oem-match-icon {
    color: #16a34a;
    font-size: 14px;
    flex-shrink: 0;
    margin-top: 2px;
}

.oem-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 600;
    color: var(--ocean-deep);
    text-decoration: none;
    padding: 2px 6px;
    border-radius: 4px;
    transition: all 0.15s ease;
}

.oem-link:hover {
    background: var(--ocean-light);
    color: var(--navy);
}

.oem-no-match {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #94a3b8;
    font-weight: 500;
}

/* Confidence chip */
.oem-confidence {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 56px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.3px;
}

.oem-confidence-exact {
    background: #dcfce7;
    color: #15803d;
}

.oem-confidence-possible {
    background: #fef3c7;
    color: #92400e;
}

.oem-confidence-no_match,
.oem-confidence-unmatched {
    background: #fdecea;
    color: #b42318;
}

.oem-confidence-human_confirmed {
    background: var(--ocean-light);
    color: var(--ocean-deep);
}

/* Send button — subtle but clear */
.oem-send {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    font-size: 12.5px;
    padding: 6px 12px;
    border-radius: 7px;
    white-space: nowrap;
}

.oem-send .bi { font-size: 13px; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
    .summary-bar {
        padding: 12px;
        gap: 10px;
    }

    .summary-group {
        gap: 6px;
    }

    .summary-chip {
        padding: 4px 10px;
        font-size: 12px;
    }

    .oem-table thead th,
    .oem-table tbody td {
        padding: 12px 10px;
    }

    .oem-send span {
        display: none;   /* icon-only on mobile */
    }
}

/* ============================================================
   SUMMARY BAR
   ============================================================ */
.summary-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    padding: 14px 20px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    margin-bottom: 16px;
}

.summary-group {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.summary-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    background: #f1f5f9;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    white-space: nowrap;
}

.summary-chip .bi { font-size: 13px; opacity: 0.85; }
.summary-chip strong { font-weight: 800; }
.summary-chip-primary { background: var(--ocean-light); color: var(--ocean-deep); }
.summary-chip-success { background: #dcfce7; color: #15803d; }
.summary-chip-warn    { background: #fef3c7; color: #92400e; }
.summary-chip-muted   { background: #f1f5f9; color: #475569; }

/* ============================================================
   BULK BAR
   ============================================================ */
.bulk-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 20px;
    background: linear-gradient(90deg, var(--ocean-deep) 0%, var(--navy) 100%);
    color: #fff;
    border-radius: var(--radius);
    box-shadow: 0 4px 14px rgba(5, 65, 102, 0.25);
    margin-bottom: 16px;
    animation: bulkBarSlide 0.25s ease;
}

@keyframes bulkBarSlide {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: none; }
}

.bulk-bar-left {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}

.bulk-bar-left .bi { font-size: 18px; opacity: 0.9; }
.bulk-bar-left strong { font-weight: 800; }

.bulk-bar-lines {
    font-size: 12.5px;
    color: rgba(255, 255, 255, 0.75);
    padding-left: 10px;
    border-left: 1px solid rgba(255, 255, 255, 0.25);
}

.bulk-bar-actions { display: flex; gap: 8px; }

.bulk-bar-actions .btn-outline-primary {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.5);
    background: transparent;
}

.bulk-bar-actions .btn-outline-primary:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: #fff;
    color: #fff;
}

.bulk-bar-actions .btn-primary {
    background: #fff;
    border-color: #fff;
    color: var(--ocean-deep);
    font-weight: 700;
}

.bulk-bar-actions .btn-primary:hover {
    background: var(--ocean-light);
    border-color: var(--ocean-light);
}

/* ============================================================
   OEM TABLE
   ============================================================ */
.oem-table thead th {
    background: #f8fafc;
    color: var(--grey-600);
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--line);
    padding: 12px 16px;
    white-space: nowrap;
}

.oem-table tbody td {
    padding: 16px;
    border-bottom: 1px solid #f0f3f6;
    vertical-align: top;
    font-size: 13.5px;
}

.oem-table tbody tr:last-child td { border-bottom: none; }
.oem-table tbody tr:hover { background: #f8fbfd; }

.oem-row-warn { background: #fffbeb; }
.oem-row-warn:hover { background: #fef9e0; }

.oem-no { font-weight: 700; color: var(--grey-600); }

.oem-desc {
    font-weight: 600;
    color: var(--ink);
    font-size: 13.5px;
    line-height: 1.45;
}

.oem-code {
    display: inline-flex;
    padding: 3px 9px;
    background: var(--navy);
    color: #fff;
    border-radius: 6px;
    font-size: 11.5px;
    font-weight: 800;
    letter-spacing: 0.5px;
}

/* ============================================================
   OEM LIST (multiple matched OEMs per line)
   ============================================================ */
.oem-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.oem-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 12px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
    margin: 0;
}

.oem-item:hover {
    border-color: var(--ocean);
    box-shadow: 0 2px 8px rgba(75, 149, 193, 0.12);
}

/* When checkbox is checked — highlight the whole item */
.oem-item:has(.oem-select:checked) {
    background: var(--ocean-light);
    border-color: var(--ocean);
}

.oem-item .form-check-input {
    margin-top: 3px;
    flex-shrink: 0;
    cursor: pointer;
}

.oem-item-body {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
    flex: 1;
}

/* The actual OEM link */
.oem-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-weight: 700;
    font-size: 13.5px;
    color: var(--ocean-deep);
    text-decoration: none;
    transition: color 0.15s ease;
    line-height: 1.3;
}

.oem-link:hover {
    color: var(--navy);
    text-decoration: underline;
}

.oem-link .bi-link-45deg {
    font-size: 15px;
    color: var(--ocean);
}

.oem-link .oem-name {
    overflow: hidden;
    text-overflow: ellipsis;
}

.oem-link .oem-ext {
    font-size: 11px;
    opacity: 0.6;
}

.oem-item-meta {
    font-size: 11.5px;
    color: var(--grey-600);
    line-height: 1.4;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.oem-item-meta .bi {
    font-size: 11px;
    opacity: 0.75;
}

/* No match state */
.oem-no-match {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #94a3b8;
    font-weight: 500;
    padding: 6px 0;
}

/* Confidence chip */
.oem-confidence {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 56px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.3px;
}

.oem-confidence-exact { background: #dcfce7; color: #15803d; }
.oem-confidence-possible { background: #fef3c7; color: #92400e; }
.oem-confidence-no_match,
.oem-confidence-unmatched { background: #fdecea; color: #b42318; }
.oem-confidence-human_confirmed { background: var(--ocean-light); color: var(--ocean-deep); }

/* Send button */
.line-send {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    font-size: 12.5px;
    padding: 6px 12px;
    border-radius: 7px;
    white-space: nowrap;
}

.line-send .bi { font-size: 13px; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
    .summary-bar { padding: 12px; }
    .summary-chip { font-size: 12px; padding: 4px 10px; }

    .oem-table thead th,
    .oem-table tbody td { padding: 12px 10px; }

    .line-send span { display: none; }
    .bulk-bar { flex-direction: column; align-items: stretch; gap: 10px; }
    .bulk-bar-actions { justify-content: stretch; }
    .bulk-bar-actions .btn { flex: 1; }
}
/* ============================================================
   USER BOX — name in rectangle, role as round badge below
   ============================================================ */
.top .user-box {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 4px;
    align-self: center;         /* ← keeps it vertically centered with siblings */
    line-height: 1;
}

/* Name row — the rectangle box */
.top .user-box-name-row {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    background: #ffffff;
    border: 1.5px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(5, 65, 102, 0.06);
    transition: all 0.15s ease;
}

.top .user-box-name-row:hover {
    border-color: var(--ocean);
    box-shadow: 0 3px 8px rgba(5, 65, 102, 0.12);
}

.top .user-box-name-row .bi {
    color: var(--ocean-deep);
    font-size: 20px;
    flex-shrink: 0;
}

.top .user-box-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--ink);
    line-height: 1.2;
    white-space: nowrap;
}

/* Role badge — small round pill */
.top .user-box-role {
    display: inline-flex;
    align-items: center;
    padding: 3px 12px;
    background: var(--ocean-light);
    color: var(--ocean-deep);
    border-radius: 999px;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    line-height: 1.5;
    white-space: nowrap;
    margin-left: 30px;           /* ← aligns badge under the name, past the icon */
}


/* ---------- Matched OEM: original vs other suppliers ---------- */
.oem-section-label {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  margin: 0 0 6px; padding: 0 0 4px;
  border-bottom: 1px solid var(--bs-border-color, #e5e7eb);
}
.oem-section-original {
    background: #dcfce7;
    color: #15803d;
    padding: 4px 10px;
    border-radius: 6px;
    border-bottom: none;
    margin-bottom: 8px;
}
.oem-section-others   { color: #6b7280; margin-top: 14px; }
.oem-section-count {
  background: #f3f4f6; color: #6b7280; border-radius: 999px;
  padding: 0 7px; font-size: 10px; font-weight: 600;
}

.oem-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 8px 10px; margin-bottom: 4px;
  border: 1px solid transparent; border-radius: 8px; cursor: pointer;
}
.oem-item:hover { background: #f9fafb; }
.oem-item-original { background: #f0fdf4; border-color: #bbf7d0; }
.oem-item-original:hover { background: #ecfdf3; }

.oem-item-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.oem-link { font-weight: 600; font-size: 13px; text-decoration: none; }
.oem-link:hover .oem-name { text-decoration: underline; }
.oem-ext { font-size: 10px; margin-left: 4px; opacity: .6; }
.oem-item-meta { font-size: 12px; color: #6b7280; }
.oem-none-inline { font-size: 12px; color: #9ca3af; font-style: italic; padding: 4px 10px; }



/* ============================================================
   PERIOD FILTER BAR
   ============================================================ */
.period-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    padding: 12px 18px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    margin-bottom: 20px;
}

.period-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--grey-600);
}

.period-label .bi { color: var(--ocean-deep); font-size: 15px; }

.period-tabs {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px;
    background: #f1f5f9;
    border-radius: 10px;
}

.period-tab {
    display: inline-flex;
    align-items: center;
    padding: 7px 16px;
    font-size: 13px;
    font-weight: 600;
    color: var(--grey-600);
    text-decoration: none;
    border-radius: 7px;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.period-tab:hover {
    color: var(--ocean-deep);
    background: rgba(255, 255, 255, 0.6);
}

.period-tab.active {
    background: #fff;
    color: var(--ocean-deep);
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(5, 65, 102, 0.12);
}

.period-range {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
    font-size: 12.5px;
    color: var(--grey-600);
    font-weight: 500;
    padding: 4px 12px;
    background: var(--ocean-light);
    border-radius: 20px;
}

.period-range .bi { color: var(--ocean); font-size: 12px; }

/* ============================================================
   INSIGHTS GRID (6 KPI cards)
   ============================================================ */
.insights-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

.insight-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
    transition: all 0.2s ease;
}

.insight-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; bottom: 0;
    width: 4px;
    background: var(--ocean);
}

.insight-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    border-color: var(--ocean-light);
}

.insight-ico {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    border-radius: 12px;
    background: var(--ocean-light);
    color: var(--ocean-deep);
    font-size: 1.4rem;
    transition: transform 0.2s ease;
}

.insight-card:hover .insight-ico { transform: scale(1.06); }

.insight-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.insight-value {
    font-size: 1.65rem;
    font-weight: 800;
    color: var(--ocean-deep);
    line-height: 1.05;
    letter-spacing: -0.5px;
}

.insight-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--grey-600);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Color variants */
.insight-received::before { background: #3b82f6; }
.insight-received .insight-ico { background: #dbeafe; color: #1e40af; }
.insight-received .insight-value { color: #1e40af; }

.insight-processed::before { background: #8b5cf6; }
.insight-processed .insight-ico { background: #ede9fe; color: #6d28d9; }
.insight-processed .insight-value { color: #6d28d9; }

.insight-sent::before { background: #f39c12; }
.insight-sent .insight-ico { background: #fef3c7; color: #b45309; }
.insight-sent .insight-value { color: #b45309; }

.insight-quotes::before { background: #0891b2; }
.insight-quotes .insight-ico { background: #cffafe; color: #0e7490; }
.insight-quotes .insight-value { color: #0e7490; }

.insight-po::before { background: #16a34a; }
.insight-po .insight-ico { background: #dcfce7; color: #15803d; }
.insight-po .insight-value { color: #15803d; }

.insight-clients::before { background: var(--navy); }
.insight-clients .insight-ico { background: #e0e7ff; color: var(--navy); }
.insight-clients .insight-value { color: var(--navy); }

/* ============================================================
   RESPONSIVE — Dashboard
   ============================================================ */
@media (max-width: 1400px) {
    .insights-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 900px) {
    .insights-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .insight-card { padding: 12px; gap: 10px; }
    .insight-value { font-size: 1.4rem; }
    .insight-ico { width: 40px; height: 40px; font-size: 1.2rem; }
}

@media (max-width: 560px) {
    .insights-grid { grid-template-columns: 1fr; }
    .period-bar { padding: 10px; gap: 10px; }
    .period-tabs { width: 100%; overflow-x: auto; }
    .period-tab { padding: 6px 12px; font-size: 12px; }
    .period-range { margin-left: 0; }
}




/* ============================================================
   DASHBOARD — AI WORKFLOW PANEL
   ============================================================ */
.ai-panel { margin-bottom: 20px; }
.ai-panel .panel-title .bi { color: var(--ocean); }

.flow { display: flex; align-items: stretch; gap: 10px; margin-bottom: 20px; }
.flow-step {
    flex: 1 1 0; display: flex; flex-direction: column; gap: 2px;
    padding: 14px; background: #fff;
    border: 1px solid var(--line); border-radius: var(--radius);
}
.flow-step strong { color: var(--ink); font-size: 14px; }
.flow-step small  { color: var(--grey-600); font-size: 12px; line-height: 1.3; }
.flow-ico {
    width: 36px; height: 36px; border-radius: 10px; margin-bottom: 8px;
    display: grid; place-items: center; font-size: 17px;
    background: var(--ocean-light); color: var(--ocean-deep);
}
.flow-ai { background: var(--ocean-hover); border-color: #bcd9ec; }
.flow-ai .flow-ico { background: var(--ocean-deep); color: #fff; }
.flow-arrow { align-self: center; flex: 0 0 auto; color: #a9b8c5; font-size: 13px; }

.ai-stats { display: grid; grid-template-columns: 1fr 1fr 1.2fr; gap: 14px; }
.ai-tile {
    display: flex; align-items: center; gap: 14px; padding: 14px 16px;
    background: var(--grey-50); border: 1px solid var(--line); border-radius: var(--radius);
}
.ai-tile-title { font-weight: 700; color: var(--ink); }
.ai-tile-sub   { font-size: 12.5px; color: var(--grey-600); margin-top: 2px; }
.ai-tile-list  { flex-direction: column; align-items: stretch; justify-content: center; gap: 8px; }

.ring {
    --p: 0; --rc: var(--ocean-deep);
    flex: 0 0 68px; height: 68px; border-radius: 50%;
    background: conic-gradient(var(--rc) calc(var(--p) * 1%), #dbe5ec 0);
    display: grid; place-items: center;
}
.ring span {
    width: 52px; height: 52px; border-radius: 50%; background: #fff;
    display: grid; place-items: center; font-weight: 800; color: var(--ink);
}
.ring-teal { --rc: var(--ocean); }

@media (max-width: 992px) {
    .flow { flex-wrap: wrap; }
    .flow-arrow { display: none; }
    .flow-step { flex: 1 1 45%; }
    .ai-stats { grid-template-columns: 1fr; }
}
@media (max-width: 560px) { .flow-step { flex: 1 1 100%; } }

/* ============================================================
   HEADER — PROFESSIONAL REDESIGN
   ============================================================ */

/* User identity block */
.top .user-id {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 4px 12px 4px 4px;
    background: #f8fafc;
    border-radius: 999px;
    border: 1px solid var(--line);
    transition: all 0.15s ease;
}

.top .user-id:hover {
    background: var(--ocean-hover);
    border-color: var(--ocean);
}

.top .user-id-avatar {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--ocean-deep) 0%, var(--navy) 100%);
    color: #fff;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

.top .user-id-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
    line-height: 1.15;
}

.top .user-id-name {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--ink);
    white-space: nowrap;
}

.top .user-id-role {
    font-size: 10.5px;
    font-weight: 600;
    color: var(--grey-600);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    white-space: nowrap;
}

/* Logout — compact */
.top .logout-link {
    padding: 7px 14px;
    font-size: 13px;
}

.top .logout-link span {
    display: inline;
}

@media (max-width: 768px) {
    .top .logout-link span { display: none; }
    .top .user-id-info { display: none; }
    .top .user-id { padding: 4px; }
}

/* ============================================================
   DASHBOARD — KPI ROW (single-theme, no color variants)
   ============================================================ */
.kpi-row {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

.kpi-tile {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 20px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
}

.kpi-tile:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    border-color: var(--ocean-light);
}

.kpi-tile-ico {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    flex-shrink: 0;
    border-radius: 10px;
    background: var(--ocean-light);
    color: var(--ocean-deep);
    font-size: 1.3rem;
    transition: transform 0.2s ease;
}

.kpi-tile:hover .kpi-tile-ico {
    transform: scale(1.06);
}

.kpi-tile-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.kpi-tile-value {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--ocean-deep);
    line-height: 1.05;
    letter-spacing: -0.4px;
}

.kpi-tile-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--grey-600);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 1400px) {
    .kpi-row { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 768px) {
    .kpi-row { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .kpi-tile { padding: 14px; gap: 10px; }
    .kpi-tile-value { font-size: 1.35rem; }
    .kpi-tile-ico { width: 40px; height: 40px; font-size: 1.1rem; }
}
@media (max-width: 480px) {
    .kpi-row { grid-template-columns: 1fr; }
}

/* ============================================================
   AI EXTRACTION SUMMARY
   ============================================================ */
.ai-summary {
    margin-bottom: 20px;
}

.ai-extract-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-bottom: 16px;
}

.extract-block {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 16px;
    background: #fafbfc;
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.extract-head {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--ocean-deep);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--line);
}

.extract-head .bi {
    font-size: 15px;
    color: var(--ocean);
}

.extract-stats {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.extract-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 13px;
    color: var(--grey-600);
}

.extract-row strong {
    font-size: 15px;
    font-weight: 800;
    color: var(--ink);
}

.extract-bar {
    height: 5px;
    background: #eef2f5;
    border-radius: 999px;
    overflow: hidden;
    margin: 4px 0;
}

.extract-bar-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--ocean) 0%, var(--ocean-deep) 100%);
}

.extract-hint {
    font-size: 11.5px;
    color: var(--grey-600);
    line-height: 1.4;
}

/* Footer chips */
.extract-footer {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding-top: 14px;
    border-top: 1px solid var(--line);
}

.extract-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    background: #f1f5f9;
    border-radius: 20px;
    font-size: 12.5px;
    font-weight: 600;
    color: #475569;
}

.extract-chip .bi { font-size: 12px; opacity: 0.85; }
.extract-chip strong { font-weight: 800; color: inherit; }
.extract-chip-warn { background: #fef3c7; color: #92400e; }

.extract-link {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    font-weight: 600;
    color: var(--ocean-deep);
    text-decoration: none;
    transition: all 0.15s ease;
}

.extract-link:hover {
    color: var(--navy);
    gap: 8px;
}

@media (max-width: 992px) {
    .ai-extract-grid { grid-template-columns: 1fr; }
}
/* ============================================================
   SAVE ALL BAR
   ============================================================ */
.save-all-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 20px;
    background: linear-gradient(90deg, #dcfce7 0%, #bbf7d0 100%);
    border: 1px solid #86efac;
    border-left: 4px solid #16a34a;
    border-radius: var(--radius);
    margin-bottom: 16px;
    color: #166534;
    animation: slideDown 0.25s ease;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: none; }
}

.save-all-left {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13.5px;
    font-weight: 600;
}

.save-all-left .bi {
    font-size: 18px;
    color: #16a34a;
}

.save-all-left strong {
    font-weight: 800;
    color: #15803d;
}

.save-all-actions {
    display: flex;
    gap: 8px;
}

.save-all-actions .btn-success {
    background: #16a34a;
    border-color: #16a34a;
    color: #fff;
    font-weight: 700;
}

.save-all-actions .btn-success:hover {
    background: #15803d;
    border-color: #15803d;
}

@media (max-width: 768px) {
    .save-all-bar {
        flex-direction: column;
        align-items: stretch;
        padding: 12px;
        gap: 10px;
    }
    .save-all-actions { width: 100%; }
    .save-all-actions .btn { flex: 1; }
}

/* ============================================================
   PER-ROW EDIT / SAVE / UNDO BUTTONS
   ============================================================ */
.row-edit-btn,
.row-save-btn,
.row-undo-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-width: 34px;
    height: 32px;
    padding: 0 10px;
    border-radius: 7px;
    font-size: 12.5px;
    font-weight: 600;
    white-space: nowrap;
    transition: all 0.15s ease;
}

.row-edit-btn i,
.row-save-btn i,
.row-undo-btn i {
    font-size: 13px;
}

/* Icon-only (square) when text is hidden */
.row-edit-btn span,
.row-save-btn span,
.row-undo-btn span {
    display: inline;
}

/* Hover states */
.row-edit-btn:hover {
    background: var(--ocean-deep);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(5, 65, 102, 0.25);
}

.row-save-btn:hover {
    background: #15803d;
    border-color: #15803d;
    color: #fff;
    transform: translateY(-1px);
}

.row-undo-btn:hover {
    background: #64748b;
    border-color: #64748b;
    color: #fff;
    transform: translateY(-1px);
}

/* Hide text on mobile — icon-only */
@media (max-width: 768px) {
    .row-edit-btn span,
    .row-save-btn span,
    .row-undo-btn span {
        display: none;
    }
    .row-edit-btn,
    .row-save-btn,
    .row-undo-btn {
        padding: 0;
        width: 34px;
    }
}

/* Highlight row when editing */
.oem-table tbody tr.row-editing {
    background: #fafbfc;
    box-shadow: inset 3px 0 0 var(--ocean);
}

/* Editable fields */
.oem-table textarea.form-control,
.oem-table input.form-control {
    font-size: 13px;
    padding: 6px 10px;
    border: 1px solid var(--ocean);
    border-radius: 6px;
    background: #fff;
    color: var(--ink);
    width: 100%;
}

.oem-table textarea.form-control:focus,
.oem-table input.form-control:focus {
    outline: none;
    border-color: var(--ocean-deep);
    box-shadow: 0 0 0 3px rgba(75, 149, 193, 0.15);
}

/* Qty input in edit mode — narrow */
.oem-table input[data-field="qty"] {
    max-width: 80px;
    margin: 0 auto;
}

/* Unit input in edit mode */
.oem-table input[data-field="unit"] {
    max-width: 80px;
}

/* ============================================================
   TOAST
   ============================================================ */
.demo-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 14px 22px;
    background: var(--ocean-deep);
    color: #fff;
    border-radius: 10px;
    font-size: 13.5px;
    font-weight: 600;
    box-shadow: 0 8px 24px rgba(5, 65, 102, 0.3);
    opacity: 0;
    transform: translateY(12px);
    transition: all 0.25s ease;
    pointer-events: none;
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: 380px;
}

.demo-toast .bi { font-size: 16px; }
.demo-toast.show { opacity: 1; transform: translateY(0); }

/* ============================================================
   INLINE CONFIDENCE BADGE (in description cell)
   ============================================================ */
.oem-desc-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    flex-wrap: wrap;
}

.oem-desc-row .oem-desc {
    flex: 1;
    min-width: 0;
}

.oem-conf-inline {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: 0.3px;
    white-space: nowrap;
    flex-shrink: 0;
    margin-top: 2px;
}

.oem-conf-inline .bi {
    font-size: 10px;
    opacity: 0.85;
}

.oem-conf-exact,
.oem-conf-human_confirmed {
    background: #dcfce7;
    color: #15803d;
}

.oem-conf-possible {
    background: #fef3c7;
    color: #92400e;
}

.oem-conf-no_match,
.oem-conf-unmatched {
    background: #fdecea;
    color: #b42318;
}

/* ============================================================
   SUPPLIER RFQ PREVIEW MODAL
   ============================================================ */
.modal-backdrop-custom {
    position: fixed;
    inset: 0;
    background: rgba(5, 65, 102, 0.55);
    backdrop-filter: blur(4px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    animation: modalFade 0.2s ease;
}

.modal-backdrop-custom[hidden] {
    display: none;
}

@keyframes modalFade {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.supplier-modal {
    background: #fff;
    border-radius: 14px;
    width: 100%;
    max-width: 720px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 24px 64px rgba(5, 65, 102, 0.35);
    animation: modalRise 0.25s ease;
    overflow: hidden;
}

@keyframes modalRise {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: none; }
}

/* Modal header */
.supplier-modal-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 24px;
    background: linear-gradient(90deg, var(--ocean-deep) 0%, var(--navy) 100%);
    color: #fff;
}

.supplier-modal-title {
    font-size: 17px;
    font-weight: 800;
    color: #fff;
    margin: 0 0 2px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.supplier-modal-title .bi {
    color: #fff;
    font-size: 18px;
}

.supplier-modal-sub {
    font-size: 12.5px;
    color: rgba(255, 255, 255, 0.75);
    margin: 0;
}

.modal-close {
    background: rgba(255, 255, 255, 0.12);
    border: 0;
    color: #fff;
    font-size: 14px;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: background 0.15s ease;
    flex-shrink: 0;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.22);
}

/* Modal body */
.supplier-modal-body {
    padding: 20px 24px;
    overflow-y: auto;
    flex: 1;
}

/* Meta grid */
.supplier-preview-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding: 12px 14px;
    background: #fafbfc;
    border: 1px solid var(--line);
    border-radius: 10px;
    margin-bottom: 18px;
}

.preview-meta-item {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.preview-meta-label {
    font-size: 10.5px;
    font-weight: 700;
    color: var(--grey-600);
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.preview-meta-value {
    font-size: 13px;
    font-weight: 700;
    color: var(--ink);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Letter body */
.supplier-preview-letter {
    font-size: 13.5px;
    line-height: 1.7;
    color: var(--ink);
}

.supplier-preview-letter p {
    margin: 0 0 12px;
}

.supplier-preview-item {
    background: var(--ocean-hover);
    border: 1px solid var(--ocean-light);
    border-left: 4px solid var(--ocean);
    border-radius: 8px;
    padding: 14px 16px;
    margin: 14px 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.supplier-preview-row {
    display: grid;
    grid-template-columns: 130px 1fr;
    gap: 10px;
    font-size: 13px;
    align-items: baseline;
}

.supplier-preview-label {
    font-weight: 700;
    color: var(--ocean-deep);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.supplier-preview-value {
    color: var(--ink);
    font-weight: 500;
    word-break: break-word;
}

.supplier-preview-value code {
    background: var(--navy);
    color: #fff;
    padding: 2px 8px;
    border-radius: 5px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

/* Requirements list */
.supplier-preview-requirements {
    margin: 8px 0 14px;
    padding-left: 20px;
    color: var(--ink);
}

.supplier-preview-requirements li {
    margin-bottom: 4px;
    font-size: 13px;
}

.supplier-preview-sign {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px dashed var(--line);
    color: var(--grey-600);
    font-size: 13px;
}

.supplier-preview-sign strong {
    color: var(--ink);
    font-weight: 700;
}

/* Recipients block */
.supplier-preview-recipients {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
}

.supplier-preview-recipients-title {
    font-size: 12px;
    font-weight: 800;
    color: var(--ocean-deep);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.supplier-oem-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.supplier-oem-list-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    background: #fafbfc;
    border: 1px solid var(--line);
    border-radius: 8px;
    font-size: 13px;
}

.supplier-oem-list-item .bi {
    color: #16a34a;
    font-size: 15px;
    margin-top: 2px;
    flex-shrink: 0;
}

.supplier-oem-list-item strong {
    color: var(--ink);
    font-weight: 700;
    display: block;
}

.supplier-oem-meta {
    font-size: 11.5px;
    color: var(--grey-600);
    margin-top: 2px;
}

/* Modal footer */
.supplier-modal-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 24px;
    background: #fafbfc;
    border-top: 1px solid var(--line);
    flex-wrap: wrap;
}

.supplier-modal-count {
    font-size: 12.5px;
    color: var(--grey-600);
    font-weight: 600;
}

.supplier-modal-actions {
    display: flex;
    gap: 8px;
}

.supplier-modal-actions .btn {
    font-weight: 600;
}

/* Responsive */
@media (max-width: 640px) {
    .modal-backdrop-custom { padding: 12px; }
    .supplier-modal { max-height: 95vh; }
    .supplier-preview-meta { grid-template-columns: 1fr; }
    .supplier-preview-row { grid-template-columns: 1fr; gap: 2px; }
    .supplier-modal-head,
    .supplier-modal-body,
    .supplier-modal-foot {
        padding-left: 16px;
        padding-right: 16px;
    }
    .supplier-modal-foot { flex-direction: column; align-items: stretch; }
    .supplier-modal-actions { justify-content: stretch; }
    .supplier-modal-actions .btn { flex: 1; }
}

.oem-badge-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.oem-badge-icon svg {
    display: block;
}



/* ============================================================
   MASTER SPLIT LAYOUT (Categories, Brands): form left, list right
   ============================================================ */
.master-split { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 20px; align-items: start; }
.master-split.no-form { grid-template-columns: 1fr; }
.master-split .mform { position: sticky; top: 92px; }
.panel-head.edit-mode { background: var(--ocean-light); }
.master-table tr.row-editing td { background: var(--ocean-hover); }
@media (max-width: 992px) {
    .master-split { grid-template-columns: 1fr; }
    .master-split .mform { position: static; }
}



/* ===== ENABLE / DISABLE SWITCH ===== */
.sw-form { margin: 0; display: inline-block; }
.sw { position: relative; display: inline-block; width: 44px; height: 24px; margin: 0; cursor: pointer; vertical-align: middle; }
.sw input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; z-index: 2; }
.sw-track { position: absolute; inset: 0; background: #cbd5e1; border-radius: 999px; transition: background .18s ease; }
.sw-track:after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .18s ease; }
.sw input:checked ~ .sw-track { background: #16a34a; }
.sw input:checked ~ .sw-track:after { transform: translateX(20px); }
.sw input:focus-visible ~ .sw-track { box-shadow: 0 0 0 3px rgba(75,149,193,.35); }
.sw-disabled { opacity: .5; cursor: not-allowed; }
.sw-disabled input { cursor: not-allowed; }
.sw-cell { display: inline-flex; align-items: center; gap: 8px; }
.sw-text { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; color: #15803d; }
.sw-text.off { color: #64748b; }

/* ===== TAB COUNTS ===== */
.seg-n { margin-left: 6px; padding: 1px 7px; border-radius: 999px; background: rgba(5,65,102,.1); font-size: 11px; font-weight: 800; }
.period-tab.active .seg-n { background: var(--ocean-light); }

/* ===== MASTER LIST TABLES ===== */
.master-table td { padding-top: 12px; padding-bottom: 12px; vertical-align: middle; font-size: 13.5px; }
.master-table .m-name { font-weight: 700; color: var(--ink); line-height: 1.25; }
.master-table .m-sub { font-size: 12px; color: var(--grey-600); }
.master-table tr.row-off td:not(.keep) { opacity: .55; }
.m-code { display: inline-block; padding: 3px 9px; background: var(--navy); color: #fff; border-radius: 6px; font-size: 11.5px; font-weight: 800; letter-spacing: .5px; }
.m-del-form { display: inline; margin: 0; }

/* ===== FORM FIELD HELPERS ===== */
.form-label { font-size: 12px; font-weight: 700; color: var(--navy); margin-bottom: 3px; }
.req { color: #dc2626; margin-left: 2px; }
.fld-err { color: #b42318; font-size: 12px; margin-top: 3px; }

/* ===== Pagination: numbered buttons ===== */
.pagination-controls {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.page-btn-ellipsis {
  cursor: default;
  opacity: .6;
  min-width: 32px;
  text-align: center;
}

.page-btn-active {
  background: var(--brand, #0d6efd);
  color: #fff !important;
  border-color: var(--brand, #0d6efd);
  font-weight: 600;
  cursor: default;
}

.page-btn-active:hover {
  background: var(--brand, #0d6efd);
  color: #fff !important;
}

/* On narrow screens, wrap nicely */
@media (max-width: 640px) {
  .pagination-bar { flex-direction: column; gap: 8px; align-items: stretch; }
  .pagination-controls { justify-content: center; }
}

/* ============================================================
   PAGINATION DESIGN FIX
   ============================================================ */
.pagination-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    padding: 16px 20px;
    background: #fff;
    border: 1px solid var(--line);
    border-top: none;
    border-bottom-left-radius: var(--radius);
    border-bottom-right-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

/* The base button style */
.page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    border-radius: 8px;
    background: #fff;
    border: 1px solid var(--line);
    color: var(--ink);
    font-size: 13.5px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.15s ease;
    cursor: pointer;
}

/* Hover state */
.page-btn:hover:not(.disabled):not(.active) {
    border-color: var(--ocean);
    background: var(--ocean-hover);
    color: var(--ocean-deep);
}

/* Disabled (Prev/Next limits) */
.page-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f8fafc;
    border-color: var(--line);
    color: var(--grey-600);
}

/* Ellipsis (...) */
.page-btn.ellipsis {
    border: none;
    background: transparent;
    cursor: default;
}

/* Active page */
.page-btn.active {
    background: var(--ocean-deep);
    border-color: var(--ocean-deep);
    color: #fff;
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(5, 65, 102, 0.25);
}

/* ===== TOPBAR: search / filters / date ===== */
.top-center { display:flex; align-items:center; gap:10px; flex:1; justify-content:center; min-width:0; }
.top-search { position:relative; flex:1; max-width:420px; min-width:180px; }
.top-search .bi { position:absolute; left:12px; top:50%; transform:translateY(-50%); color:var(--grey-600); font-size:14px; }
.top-search input {
    width:100%; height:40px; padding:0 14px 0 36px;
    border:1px solid var(--line); border-radius:8px;
    background:#f8fafc; font-size:14px; transition:all .15s ease;
}
.top-search input:focus { outline:none; background:#fff; border-color:var(--ocean); box-shadow:0 0 0 3px rgba(75,149,193,.12); }
.top-btn {
    display:inline-flex; align-items:center; gap:8px; height:40px; padding:0 14px;
    background:#fff; border:1px solid var(--line); border-radius:8px;
    font:inherit; font-size:13.5px; font-weight:600; color:var(--ocean-deep);
    white-space:nowrap; cursor:pointer; transition:all .15s ease;
}
.top-btn:hover { border-color:var(--ocean); background:var(--ocean-hover); }
.top-filter-menu { min-width:260px; }
.dropdown-menu .dropdown-item.active { background:var(--ocean-deep); }
@media (max-width:1500px) { .top .last-login { display:none; } }
@media (max-width:992px)  { .top-center { order:3; flex-basis:100%; } }

.company-line { display:flex; align-items:center; gap:12px; margin-bottom:6px; flex-wrap:wrap; }
.company-name { font-size:1.15rem; font-weight:800; color:var(--navy); display:inline-flex; align-items:center; gap:8px; }
.company-name .bi { color:var(--ocean-deep); }
.company-sep { width:1px; height:20px; background:var(--line); }
.company-branch { font-size:1.05rem; font-weight:700; color:var(--ocean-deep); display:inline-flex; align-items:center; gap:6px; }
.company-branch .bi { color:var(--ocean); }


/* ===== KPI SUMMARY CARD ===== */
.kpi-card {
    display:grid; grid-template-columns:290px minmax(0,1fr);
    background:#fff; border:1px solid var(--line); border-radius:var(--radius);
    box-shadow:var(--shadow-sm); margin-bottom:20px; overflow:hidden;
}
.kpi-hero {
    display:flex; align-items:center; gap:18px; padding:24px 28px;
    background:linear-gradient(135deg,var(--ocean-light) 0%,#fff 100%);
    border-right:1px solid var(--line);
}
.kpi-hero-ico {
    width:72px; height:72px; flex:none; display:grid; place-items:center;
    border-radius:16px; background:var(--ocean-deep); color:#fff; font-size:2rem;
}
.kpi-hero-label { font-size:12.5px; font-weight:700; color:var(--grey-600); text-transform:uppercase; letter-spacing:.5px; }
.kpi-hero-value { font-size:3.2rem; font-weight:800; color:var(--ocean-deep); line-height:1.05; }
.kpi-cols { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); }
.kpi-col { padding:22px 18px; display:flex; flex-direction:column; align-items:flex-start; gap:4px; }
.kpi-col + .kpi-col { border-left:1px solid #eef2f5; }
.kpi-col-head { font-size:12.5px; font-weight:600; color:var(--grey-600); display:flex; align-items:center; gap:6px; }
.kpi-col-head .bi { color:var(--ocean); font-size:14px; }
.kpi-col-value { font-size:2rem; font-weight:800; color:var(--ink); line-height:1.1; }
.kpi-pill { display:inline-block; margin-top:6px; padding:3px 11px; border-radius:999px; font-size:11.5px; font-weight:700; white-space:nowrap; }
.pill-completed  { background:#dcfce7; color:#15803d; }
.pill-progress   { background:#dbeafe; color:#1e40af; }
.pill-pending    { background:#fef3c7; color:#92400e; }
.pill-notstarted { background:#f1f5f9; color:#64748b; }

@media (max-width:1200px) {
    .kpi-card { grid-template-columns:1fr; }
    .kpi-hero { border-right:0; border-bottom:1px solid var(--line); }
    .kpi-cols { grid-template-columns:repeat(3,minmax(0,1fr)); }
    .kpi-col { border-top:1px solid #eef2f5; }
}
@media (max-width:560px) { .kpi-cols { grid-template-columns:repeat(2,minmax(0,1fr)); } }

/* ===== Custom date range (inside the period tabs group) ===== */
.period-tabs { position: relative; }

.period-pop {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    z-index: 50;
    display: flex;
    align-items: flex-end;
    gap: 12px;
    padding: 14px 16px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 10px 28px rgba(5, 65, 102, 0.18);
    animation: bulkBarSlide 0.18s ease;
}
.period-pop[hidden] { display: none; }

.period-pop .pop-field { display: flex; flex-direction: column; gap: 4px; }
.period-pop label {
    margin: 0;
    font-size: 11px;
    font-weight: 700;
    color: var(--grey-600);
    text-transform: uppercase;
    letter-spacing: .4px;
}
.period-pop input[type="date"] {
    height: 38px;
    min-width: 150px;
    padding: 0 10px;
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--ink);
    background: #fafbfc;
    border: 1px solid var(--line);
    border-radius: 8px;
    color-scheme: light;
    cursor: pointer;
}
.period-pop input[type="date"]:focus {
    outline: none;
    background: #fff;
    border-color: var(--ocean);
    box-shadow: 0 0 0 3px rgba(75, 149, 193, .15);
}
.period-pop .pop-actions { display: flex; gap: 8px; }
.period-pop .btn { height: 38px; font-weight: 600; padding: 0 16px; }

@media (max-width: 560px) {
    .period-pop { flex-direction: column; align-items: stretch; width: 100%; }
}