/* =====================================================================
   JEWELLERY CRM — ADMIN PANEL DESIGN SYSTEM v3
   Typography: Plus Jakarta Sans (display/headings) + Inter (UI/body)
                + JetBrains Mono (numbers/data)
   Signature: whole app floats as one rounded frame on a soft canvas.
   ===================================================================== */

:root {
    --navy: #1B2D50;
    --navy-light: #2B3E64;
    --navy-soft: #EEF1F8;
    --teal: #0099CC;
    --teal-soft: #E4F6FC;
    --gold: #C8A84B;
    --gold-soft: #FBF3E1;

    --ink: #14161F;
    --muted: #667085;
    --muted-light: #98A2B3;
    --border: #E9EAF2;
    --border-strong: #D8DAE8;

    --canvas: #E9ECF3;       /* outer page canvas — cool, premium neutral */
    --frame: #FFFFFF;        /* sidebar surface */
    --content-bg: #F7F8FC;   /* inner content surface, subtle contrast to white cards */
    --surface: #FFFFFF;

    --success: #16A34A; --success-soft: #E4F9EC; --success-text: #12793D;
    --warning: #D97706; --warning-soft: #FDF0DC; --warning-text: #A85F04;
    --danger:  #DC3545; --danger-soft: #FCEAEC;  --danger-text: #A8202F;

    --radius-sm: 8px;
    --radius: 14px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    --shadow-frame: 0 24px 64px rgba(20,20,45,.09);
    --shadow-card: 0 1px 2px rgba(20,20,45,.03), 0 6px 18px rgba(20,20,45,.045);
    --shadow-pop: 0 12px 32px rgba(20,20,45,.15);

    --font-display: 'Plus Jakarta Sans', 'Inter', sans-serif;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', 'Roboto Mono', monospace;
}

body {
    background: var(--canvas);
    color: var(--ink);
    font-family: var(--font-sans);
    font-size: 14px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

html { scroll-behavior: smooth; }

/* ---------------------------------------------------------------------
   MOTION — subtle, consistent interaction feedback across the panel
   --------------------------------------------------------------------- */
@keyframes fadeInUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
.app-content { animation: fadeInUp .32s cubic-bezier(.22,1,.36,1); }

.card-flat, .card-dashed, .table-panel, .form-card, .stat-card {
    transition: transform .18s cubic-bezier(.22,1,.36,1), box-shadow .18s ease, border-color .18s ease;
}
.card-dashed:hover, .card-flat:hover { transform: translateY(-2px); box-shadow: var(--shadow-pop); }

.btn-navy, .btn-outline-soft, .btn-fab, .guide-btn, .segmented button {
    transition: transform .12s ease, background-color .15s ease, box-shadow .15s ease, opacity .15s ease;
}
.btn-navy:hover { transform: translateY(-1px); box-shadow: var(--shadow-pop); }
.btn-navy:active, .btn-outline-soft:active, .btn-fab:active { transform: scale(.96); }
.icon-btn { transition: transform .15s ease, background-color .15s ease; }
.icon-btn:active { transform: scale(.92); }

.app-sidebar .nav-link { transition: background-color .15s ease, color .15s ease, transform .12s ease; }
.app-sidebar .nav-link:active { transform: scale(.98); }

table.data-table tbody tr { transition: background-color .12s ease; }
.form-control, .form-select { transition: border-color .15s ease, box-shadow .15s ease; }

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

h1, h2, h3, .font-display, .app-sidebar .brand .name, .stat-number, .card-promo .amt {
    font-family: var(--font-display);
}
.font-mono, .stat-number, .table td.num, .amount, .data-table td.num { font-family: var(--font-mono); font-weight: 600; }

/* ---------------------------------------------------------------------
   APP FRAME
   --------------------------------------------------------------------- */
.app-frame { margin: 18px; border-radius: var(--radius-xl); box-shadow: var(--shadow-frame); overflow: hidden; display: flex; height: calc(100vh - 36px); background: var(--frame); }
@media (max-width: 991px) { .app-frame { margin: 0; border-radius: 0; min-height: 100vh; } }

.app-sidebar { width: 254px; flex-shrink: 0; background: var(--frame); display: flex; flex-direction: column; border-right: 1px solid var(--border); position: relative; z-index: 20; }
.app-sidebar .brand { display: flex; align-items: center; gap: 10px; padding: 26px 22px 18px; }
.app-sidebar .brand .mark { width: 36px; height: 36px; border-radius: 10px; background: var(--teal); display: flex; align-items: center; justify-content: center; font-weight: 700; color: #fff; font-size: 14px; font-family: var(--font-display); }
.app-sidebar .brand .name { font-weight: 700; color: var(--navy); font-size: 16px; line-height: 1.2; }
.app-sidebar .brand .sub { font-size: 11px; color: var(--muted-light); font-family: var(--font-sans); }

.app-sidebar nav { flex: 1; overflow-y: auto; padding: 6px 14px; scrollbar-width: none; } .app-sidebar nav::-webkit-scrollbar { display: none; }
.app-sidebar .nav-heading { font-size: 10.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted-light); padding: 16px 10px 6px; font-weight: 700; border-left: 3px solid var(--teal-soft); margin-left: -3px; padding-left: 13px; }
.app-sidebar .nav-link { display: flex; align-items: center; gap: 11px; padding: 9px 12px; margin: 2px 0; border-radius: 10px; color: var(--muted); font-size: 13.5px; font-weight: 500; text-decoration: none; }
.app-sidebar .nav-link i { font-size: 16px; width: 18px; text-align: center; }
.app-sidebar .nav-link:hover { background: var(--navy-soft); color: var(--navy); }
.app-sidebar .nav-link.active { background: var(--navy); color: #fff; }
.app-sidebar .nav-link .badge-count { margin-left: auto; background: var(--danger); color: #fff; font-size: 10px; padding: 1px 6px; border-radius: 20px; }
.app-sidebar .super-only-tag { font-size: 9px; color: var(--gold); border: 1px solid var(--gold); padding: 0 5px; border-radius: 4px; margin-left: auto; opacity: .85; }
.app-sidebar .nav-link.active .super-only-tag { color: #fff; border-color: rgba(255,255,255,.5); }

.app-main { flex: 1; display: flex; flex-direction: column; background: var(--content-bg); min-width: 0; overflow-y: auto;
    background-image: radial-gradient(circle, #DCE1EC 1px, transparent 1px);
    background-size: 22px 22px;
    background-position: 0 0;
}

.app-topbar { display: flex; align-items: center; gap: 16px; padding: 22px 30px 0; }
.app-topbar .sidebar-toggle { display: none; }
.app-topbar .search-box { position: relative; max-width: 340px; flex: 1; }
.app-topbar .search-box input { width: 100%; border: 1px solid var(--border); background: var(--surface); border-radius: 999px; padding: 9px 16px 9px 38px; font-size: 13px; box-shadow: var(--shadow-card); font-family: var(--font-sans); }
.app-topbar .search-box i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted-light); }
.app-topbar .topbar-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.app-topbar .icon-btn { width: 40px; height: 40px; border-radius: 50%; background: var(--surface); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; color: var(--muted); position: relative; cursor: pointer; }
.app-topbar .icon-btn .dot { position: absolute; top: 8px; right: 9px; width: 7px; height: 7px; border-radius: 50%; background: var(--danger); border: 1.5px solid var(--surface); }
.role-badge { font-size: 10.5px; font-weight: 700; padding: 3px 10px; border-radius: 20px; text-transform: uppercase; letter-spacing: .03em; font-family: var(--font-sans); }
.role-badge.superadmin { background: var(--gold-soft); color: #8A6D1F; }
.role-badge.admin { background: var(--teal-soft); color: #056A8C; }
.user-menu { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.user-menu .avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--navy); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 14px; font-family: var(--font-display); }
.user-menu .name { font-size: 13px; font-weight: 600; line-height: 1.2; }

.app-content { padding: 20px 30px 56px; flex: 1; }
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; gap: 12px; flex-wrap: wrap; }
.page-header h1 { font-size: 25px; font-weight: 700; margin: 0; color: var(--navy); letter-spacing: -.01em; }
.breadcrumb-lite { font-size: 12px; color: var(--muted-light); margin-bottom: 3px; font-family: var(--font-sans); }
.breadcrumb-lite a { color: var(--muted-light); text-decoration: none; }

.segmented { display: inline-flex; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 3px; box-shadow: var(--shadow-card); }
.segmented button { border: none; background: transparent; font-size: 12.5px; font-weight: 600; padding: 7px 16px; border-radius: 999px; color: var(--muted); font-family: var(--font-sans); }
.segmented button.active { background: var(--navy); color: #fff; }

.btn-fab { width: 42px; height: 42px; border-radius: 50%; background: var(--navy); color: #fff; border: none; display: flex; align-items: center; justify-content: center; font-size: 18px; }
.btn-navy { background: var(--navy); color: #fff; border: none; border-radius: var(--radius-sm); font-weight: 600; font-size: 13px; padding: 9px 18px; }
.btn-navy:hover { background: var(--navy-light); color:#fff; }
.btn-outline-soft { background: var(--surface); border: 1px solid var(--border); color: var(--ink); border-radius: var(--radius-sm); font-weight: 600; font-size: 13px; padding: 8px 16px; }

/* ---------------------------------------------------------------------
   CARDS / STATS
   --------------------------------------------------------------------- */
.card-flat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-card); }
.card-dashed { background: var(--surface); border: 1.5px dashed var(--border-strong); border-radius: var(--radius-lg); }
.stat-card { padding: 18px 20px; border-top: 3px solid transparent; }
.stat-card:nth-of-type(4n+1) { border-top-color: var(--teal); }
.stat-card:nth-of-type(4n+2) { border-top-color: var(--gold); }
.stat-card:nth-of-type(4n+3) { border-top-color: var(--success); }
.stat-card:nth-of-type(4n+4) { border-top-color: #8B5CF6; }
.stat-card .stat-icon { width: 34px; height: 34px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 16px; margin-bottom: 12px; }
/* Standalone version for use outside .stat-card (e.g. list-item icons in
   dashboard widgets) — .stat-icon alone does nothing without that parent. */
.icon-chip { width: 28px; height: 28px; border-radius: 8px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.stat-card .stat-label { font-size: 12.5px; color: var(--muted); font-weight: 500; margin-bottom: 6px; font-family: var(--font-sans); }
.stat-card .stat-number { font-size: 28px; font-weight: 700; color: var(--navy); }
.stat-card .stat-delta { font-size: 12px; margin-top: 4px; display: inline-flex; align-items: center; gap: 3px; padding: 2px 8px; border-radius: 20px; font-family: var(--font-sans); }
.stat-delta.up { color: var(--success-text); background: var(--success-soft); }
.stat-delta.down { color: var(--danger-text); background: var(--danger-soft); }

.page-header h1 { position: relative; padding-bottom: 10px; }
.page-header h1::after { content: ''; position: absolute; left: 0; bottom: 0; width: 46px; height: 4px; border-radius: 4px; background: linear-gradient(90deg, var(--teal), var(--gold)); }

.app-topbar { background: linear-gradient(180deg, rgba(0,153,204,.03), transparent); }

.avatar-stack { display: flex; align-items: center; }
.avatar-stack .av { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--surface); margin-left: -8px; background: var(--navy-soft); color: var(--navy); font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; font-family: var(--font-display); }
.avatar-stack .av:first-child { margin-left: 0; }
.avatar-stack .more { background: var(--ink); color: #fff; }

.card-promo { background: var(--navy); color: #fff; border-radius: var(--radius-lg); padding: 20px; }
.card-promo .amt { font-size: 26px; font-weight: 700; }
.card-promo .btn-light-outline { border: 1px solid rgba(255,255,255,.35); color: #fff; background: transparent; border-radius: 999px; padding: 6px 16px; font-size: 12.5px; font-weight: 600; }
.card-promo .btn-solid { background: #fff; color: var(--navy); border-radius: 999px; padding: 6px 16px; font-size: 12.5px; font-weight: 700; border: none; }

/* ---------------------------------------------------------------------
   TABLES
   --------------------------------------------------------------------- */
.table-panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-card); }
.table-panel .table-toolbar { padding: 16px 20px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; background: var(--content-bg); border-bottom: 1px solid var(--border); }
table.data-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.data-table thead th { text-align: left; padding: 11px 20px; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted-light); font-weight: 700; white-space: nowrap; font-family: var(--font-sans); background: #FAFBFD; border-bottom: 2px solid var(--border); }
table.data-table tbody tr { border-left: 3px solid transparent; transition: background-color .12s ease, border-color .12s ease; }
table.data-table tbody tr:nth-child(even) { background: #FCFCFE; }
table.data-table tbody td { padding: 13px 20px; border-top: 1px solid var(--border); vertical-align: middle; }
table.data-table tbody tr:hover { background: var(--teal-soft); border-left-color: var(--teal); }
table.data-table tbody td.actions { text-align: right; white-space: nowrap; }
table.data-table tbody td.actions a, table.data-table tbody td.actions button { background: none; border: none; padding: 5px 7px; border-radius: 6px; transition: background-color .15s ease, color .15s ease, transform .12s ease; }
table.data-table tbody td.actions .icon-edit { color: var(--teal); }
table.data-table tbody td.actions .icon-edit:hover { background: var(--teal-soft); transform: scale(1.08); }
table.data-table tbody td.actions .icon-view { color: #8B5CF6; }
table.data-table tbody td.actions .icon-view:hover { background: #F1EBFE; transform: scale(1.08); }
table.data-table tbody td.actions .icon-delete { color: var(--danger); }
table.data-table tbody td.actions .icon-delete:hover { background: var(--danger-soft); transform: scale(1.08); }
table.data-table tbody td.actions .icon-qr { color: var(--gold); }
table.data-table tbody td.actions .icon-qr:hover { background: var(--gold-soft); transform: scale(1.08); }

/* Custom tooltip (lighter than native browser tooltip, matches design system) */
[data-tip] { position: relative; }
[data-tip]:hover::after {
    content: attr(data-tip); position: absolute; bottom: 130%; left: 50%; transform: translateX(-50%);
    background: var(--ink); color: #fff; font-size: 11px; font-weight: 600; padding: 4px 9px; border-radius: 6px;
    white-space: nowrap; z-index: 100; box-shadow: var(--shadow-pop); pointer-events: none;
}
[data-tip]:hover::before {
    content: ''; position: absolute; bottom: 118%; left: 50%; transform: translateX(-50%);
    border: 5px solid transparent; border-top-color: var(--ink); z-index: 100; pointer-events: none;
}
/* Inside table action columns, tooltips are right-anchored instead of centered —
   centering caused the rightmost icon's tooltip to overflow past the table's
   edge and get clipped by .table-panel's overflow:hidden. Right-anchoring keeps
   the tooltip growing leftward into the row, which always has room. */
td.actions [data-tip]:hover::after { left: auto; right: 0; transform: none; }
td.actions [data-tip]:hover::before { left: auto; right: 8px; transform: none; }

/* Sidebar section color coding */
.app-sidebar .nav-heading.c-teal { border-left-color: var(--teal-soft); }
.app-sidebar .nav-heading.c-gold { border-left-color: var(--gold-soft); }
.app-sidebar .nav-heading.c-purple { border-left-color: #E9E1FC; }
.app-sidebar .nav-heading.c-green { border-left-color: var(--success-soft); }
.app-sidebar .nav-heading.c-red { border-left-color: var(--danger-soft); }

th.th-icon i { margin-right: 5px; color: var(--muted-light); font-size: 11px; }

.btn-outline-soft:hover { background: var(--content-bg); border-color: var(--teal); color: var(--teal); }

/* Row avatar (name-initial circles for people-oriented tables) */
.row-avatar { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 50%; background: var(--navy-soft); color: var(--navy); font-size: 11.5px; font-weight: 700; font-family: var(--font-display); margin-right: 10px; vertical-align: middle; flex-shrink: 0; }
.row-name-wrap { display: flex; align-items: center; }

/* Row category icon (product-oriented tables) */
.row-cat-icon { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 8px; background: var(--gold-soft); color: #8A6D1F; font-size: 13px; margin-right: 10px; vertical-align: middle; flex-shrink: 0; }

@media (max-width: 768px) {
    table.data-table.responsive-cards thead { display: none; }
    table.data-table.responsive-cards, table.data-table.responsive-cards tbody, table.data-table.responsive-cards tr, table.data-table.responsive-cards td { display: block; width: 100%; }
    table.data-table.responsive-cards tr { border: 1px solid var(--border); border-radius: var(--radius); margin: 10px; padding: 6px 4px; }
    table.data-table.responsive-cards td { border: none; display: flex; justify-content: space-between; gap: 10px; }
    table.data-table.responsive-cards td::before { content: attr(data-label); font-weight: 600; color: var(--muted); font-size: 12px; }
}

.pill { font-size: 11.5px; font-weight: 600; padding: 4px 11px; border-radius: 20px; display: inline-block; font-family: var(--font-sans); }
.pill-draft, .pill-pending_reset { background: #EEF0F4; color: #4B5563; }
.pill-shared, .pill-active { background: var(--teal-soft); color: #056A8C; }
.pill-converted, .pill-done, .pill-success { background: var(--success-soft); color: var(--success-text); }
.pill-cancelled, .pill-inactive, .pill-failed { background: var(--danger-soft); color: var(--danger-text); }
.pill-pending { background: var(--warning-soft); color: var(--warning-text); }
.pill-vip { background: var(--gold-soft); color: #8A6D1F; }

/* ---------------------------------------------------------------------
   FORMS + GUIDE BUTTON
   --------------------------------------------------------------------- */
.form-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 26px; box-shadow: var(--shadow-card); }
.form-card .form-card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 20px; }
.form-card .form-card-header h2 { font-size: 17px; font-weight: 700; margin: 0; color: var(--navy); }
.guide-btn { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--teal); background: var(--teal-soft); border: none; padding: 6px 12px; border-radius: 20px; cursor: pointer; font-family: var(--font-sans); }
.form-steps { display: flex; align-items: center; margin-bottom: 24px; }
.form-steps .step { display: flex; align-items: center; gap: 8px; flex: 1; }
.form-steps .step .circle { width: 26px; height: 26px; border-radius: 50%; background: var(--content-bg); border: 2px solid var(--border); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; color: var(--muted); }
.form-steps .step.active .circle, .form-steps .step.done .circle { background: var(--teal); border-color: var(--teal); color: #fff; }
.form-steps .step .label { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.form-steps .step.active .label { color: var(--navy); }
.form-steps .line { flex: 1; height: 2px; background: var(--border); margin: 0 8px; }
label.form-label { font-size: 13px; font-weight: 600; color: var(--ink); margin-bottom: 6px; }
.form-label-req::after { content: ' *'; color: var(--danger); }
.form-control, .form-select { border-radius: var(--radius-sm); border-color: var(--border); font-size: 13.5px; padding: 9px 12px; font-family: var(--font-sans); }
.form-control:focus, .form-select:focus { border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-soft); }
.form-hint { font-size: 12px; color: var(--muted-light); margin-top: 4px; }

.skeleton { background: linear-gradient(90deg, #EEF0F3 25%, #F6F7F9 37%, #EEF0F3 63%); background-size: 400% 100%; animation: skeleton-wave 1.4s ease infinite; border-radius: var(--radius-sm); }
@keyframes skeleton-wave { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

.empty-state { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty-state i { font-size: 40px; color: var(--border-strong); margin-bottom: 14px; display: block; }
.empty-state h3 { font-size: 15px; color: var(--ink); margin-bottom: 4px; font-family: var(--font-sans); }

.toast-stack { position: fixed; top: 18px; right: 18px; z-index: 2000; display: flex; flex-direction: column; gap: 10px; }
.toast-item { background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--success); border-radius: var(--radius-sm); box-shadow: var(--shadow-pop); padding: 12px 16px; min-width: 280px; font-size: 13px; }
.toast-item.error { border-left-color: var(--danger); }

.timeline-item { display: flex; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.timeline-item .t-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--teal); margin-top: 6px; flex-shrink:0; }
.timeline-item .t-body { flex:1; }
.timeline-item .t-meta { font-size: 12px; color: var(--muted-light); margin-top: 2px; }
.diff-box { background: var(--content-bg); border-radius: var(--radius-sm); padding: 10px 12px; font-family: var(--font-mono); font-size: 12px; margin-top: 8px; }
.diff-box .removed { color: var(--danger-text); text-decoration: line-through; }
.diff-box .added { color: var(--success-text); }

@media (max-width: 991px) {
    .app-sidebar { position: fixed; top: 0; bottom: 0; left: 0; transform: translateX(-100%); transition: transform .25s ease; z-index: 1030; box-shadow: var(--shadow-pop); }
    .app-sidebar.open { transform: translateX(0); }
    .app-topbar .sidebar-toggle { display: flex; }
    .sidebar-backdrop { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 1025; }
    .sidebar-backdrop.show { display: block; }
    /* Tablet: keep the app-frame full-bleed but preserve card spacing */
    .app-frame { margin: 0; border-radius: 0; }
    .app-content { padding: 18px 20px 50px; }
    .page-header h1 { font-size: 21px; }
    .stat-card .stat-number { font-size: 24px; }
}
@media (max-width: 576px) {
    .app-content { padding: 14px 14px 50px; }
    .app-topbar { padding: 16px 14px 0; }
    .app-topbar .search-box { display: none; }
}

/* ---------------------------------------------------------------------
   ROW CHECKBOXES + BULK ACTION BAR
   --------------------------------------------------------------------- */
.row-checkbox, .select-all-checkbox { width: 16px; height: 16px; cursor: pointer; }
td.sr-no, th.sr-no { text-align: center; color: var(--muted-light); font-family: var(--font-mono); width: 50px; }
.bulk-action-bar {
    position: sticky; top: 8px; z-index: 50; display: none; align-items: center; gap: 12px;
    background: var(--navy); color: #fff; border-radius: var(--radius); padding: 10px 16px; margin-bottom: 12px;
    box-shadow: var(--shadow-pop);
}
.bulk-action-bar.show { display: flex; }
.bulk-action-bar .count { font-size: 13px; font-weight: 600; }
.bulk-action-bar button { margin-left: auto; }
.export-dropdown .dropdown-item i { color: var(--teal); }

/* ---------------------------------------------------------------------
   ALERT BANNERS (list-page contextual warnings)
   --------------------------------------------------------------------- */
.alert-banner { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: var(--radius); font-size: 13px; margin-bottom: 16px; }
.alert-banner.warning { background: var(--warning-soft); color: var(--warning-text); border: 1px solid #F5DEB3; }
.alert-banner.danger { background: var(--danger-soft); color: var(--danger-text); border: 1px solid #f5c6cb; }
.alert-banner i { font-size: 16px; }
.alert-banner a { color: inherit; font-weight: 700; text-decoration: underline; margin-left: auto; }

/* ---------------------------------------------------------------------
   QUICK ACCESS SHORTCUTS (dashboard)
   --------------------------------------------------------------------- */
.quick-access { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-bottom: 20px; }
.quick-access-card {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
    padding: 16px; text-decoration: none; display: flex; align-items: center; gap: 12px;
    transition: transform .15s cubic-bezier(.22,1,.36,1), box-shadow .15s ease, border-color .15s ease;
}
.quick-access-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-pop); border-color: var(--teal); }
.quick-access-card .qa-icon { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; }
.quick-access-card .qa-count { font-size: 20px; font-weight: 700; color: var(--navy); font-family: var(--font-display); line-height: 1; }
.quick-access-card .qa-label { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
@media (max-width: 991px) { .quick-access { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 576px) { .quick-access { grid-template-columns: repeat(2, 1fr); } }

/* ---------------------------------------------------------------------
   DROPDOWN MENUS (profile, notifications) — Bootstrap defaults were
   plain and didn't match the rest of the design system
   --------------------------------------------------------------------- */
.dropdown-menu { border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-pop); padding: 6px; font-family: var(--font-sans); }
.dropdown-menu .dropdown-item { border-radius: 8px; padding: 9px 12px; font-size: 13px; color: var(--ink); transition: background-color .12s ease; }
.dropdown-menu .dropdown-item:hover, .dropdown-menu .dropdown-item:focus { background: var(--content-bg); color: var(--ink); }
.dropdown-menu .dropdown-item.text-danger:hover { background: var(--danger-soft); color: var(--danger-text); }
.dropdown-menu .dropdown-divider { margin: 6px 4px; border-color: var(--border); }
.dropdown-menu .dropdown-item i { width: 18px; color: var(--muted-light); }

/* ---------------------------------------------------------------------
   PAGINATION
   --------------------------------------------------------------------- */
.pagination { display: flex; gap: 4px; align-items: center; margin: 0; }
.pagination .page-item .page-link {
    border: 1px solid var(--border); border-radius: 8px; color: var(--ink);
    font-size: 13px; padding: 7px 12px; font-family: var(--font-sans);
    transition: background-color .15s ease, border-color .15s ease;
}
.pagination .page-item .page-link:hover { background: var(--content-bg); border-color: var(--border-strong); }
.pagination .page-item.active .page-link { background: var(--navy); border-color: var(--navy); color: #fff; font-weight: 600; }
.pagination .page-item.disabled .page-link { color: var(--muted-light); background: transparent; border-color: var(--border); }

/* ---------------------------------------------------------------------
   FORM LABEL ICONS
   --------------------------------------------------------------------- */
label.form-label i { color: var(--teal); margin-right: 5px; font-size: 12.5px; }

/* ---------------------------------------------------------------------
   HEALTH GAUGE (dashboard)
   --------------------------------------------------------------------- */
.health-gauge-wrap { display: flex; align-items: center; gap: 20px; }
.health-gauge { position: relative; width: 96px; height: 96px; flex-shrink: 0; }
.health-gauge svg { transform: rotate(-90deg); }
.health-gauge .center-label { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.health-gauge .center-label .pct { font-size: 20px; font-weight: 800; color: var(--navy); font-family: var(--font-display); }
.health-gauge .center-label .grade { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.chart-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; box-shadow: var(--shadow-card); }
.chart-card .chart-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.chart-card .chart-card-header strong { font-size: 13.5px; color: var(--navy); font-family: var(--font-display); }
.chart-card canvas { max-width: 100%; }
/* CRITICAL: Chart.js with maintainAspectRatio:false requires the canvas's
   parent to have a fixed height, or the chart grows unbounded on every
   resize — this was causing the page to keep getting taller. */
.chart-canvas-wrap { position: relative; height: 260px; width: 100%; }
.chart-canvas-wrap.tall { height: 320px; }
.chart-canvas-wrap.short { height: 200px; }
.chart-canvas-wrap canvas { position: absolute; top: 0; left: 0; width: 100% !important; height: 100% !important; }
.legend-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; margin-right: 6px; }
