/* ==========================================================================
   ABNA Inventory — "Midnight" admin theme
   Plain CSS, no build step. Libraries load separately from public/vendor.
   ========================================================================== */

/* ------------------------------------------------------------------ tokens */
:root {
    --primary: #3b5bfd;                                   /* overridden from Settings > Appearance */
    --primary-soft: color-mix(in srgb, var(--primary) 12%, white);
    --primary-ink: #fff;

    --canvas: #f3f5fa;
    --surface: #ffffff;
    --ink: #172033;
    --ink-soft: #5f6b85;
    --ink-faint: #97a1b8;
    --line: #e5e9f2;
    --line-strong: #d5dbe8;

    /* the logo's shield colours */
    --shield-teal: #5dbf9f;
    --shield-sky: #35a7e0;
    --shield-pink: #e2498a;
    --shield-orange: #f5a227;
    --shield-green: #4cae4c;

    --ok: #12a46b;
    --warn: #e59a00;
    --danger: #e0444f;
    --info: #1593cf;

    /* sidebar (midnight) */
    --sb-bg: #0d1428;
    --sb-bg-2: #131c38;
    --sb-text: #c9d1e6;
    --sb-muted: #75809f;
    --sb-hover: rgba(255, 255, 255, .06);
    --sb-line: rgba(255, 255, 255, .07);
    --sb-w: 268px;
    --sb-w-collapsed: 84px;

    --radius-xs: 8px;
    --radius-sm: 10px;
    --radius: 16px;
    --radius-lg: 22px;
    --shadow-sm: 0 1px 2px rgba(23, 32, 51, .05);
    --shadow: 0 1px 2px rgba(23, 32, 51, .04), 0 8px 24px -12px rgba(23, 32, 51, .14);
    --shadow-lg: 0 24px 60px -24px rgba(13, 20, 40, .45);
    --ease: cubic-bezier(.2, .8, .2, 1);

    --bs-body-font-family: 'Manrope', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --bs-body-color: var(--ink);
    --bs-body-bg: var(--canvas);
    --bs-border-color: var(--line);
    --bs-primary: var(--primary);
    --bs-link-color: var(--primary);
    --bs-link-color-rgb: 59, 91, 253;
    --bs-link-hover-color: var(--ink);
    --bs-font-monospace: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

body { font-size: .935rem; line-height: 1.55; -webkit-font-smoothing: antialiased; }
h1, .h1 { font-size: 1.6rem; font-weight: 800; letter-spacing: -.02em; }
h2, .h2 { font-size: 1.08rem; font-weight: 700; letter-spacing: -.01em; }
h3, .h3 { font-size: .98rem; font-weight: 700; }
a { text-decoration: none; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--primary) 45%, transparent); outline-offset: 2px; }
::selection { background: color-mix(in srgb, var(--primary) 22%, transparent); }

/* ------------------------------------------------------------------ shell */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--sb-w); flex-shrink: 0; position: fixed; inset: 0 auto 0 0; z-index: 1040;
    display: flex; flex-direction: column;
    background:
        radial-gradient(120% 50% at 0% 0%, rgba(93, 191, 159, .10), transparent 60%),
        radial-gradient(90% 40% at 100% 100%, rgba(226, 73, 138, .10), transparent 60%),
        linear-gradient(180deg, var(--sb-bg) 0%, var(--sb-bg-2) 100%);
    color: var(--sb-text);
    transition: width .28s var(--ease), transform .28s var(--ease);
}
.sidebar-head { display: flex; align-items: center; gap: 8px; padding: 18px 16px 14px 20px; min-height: 92px; }
.sidebar-brand { flex: 1; min-width: 0; display: block; }
.sidebar-brand img { display: block; max-width: 100%; max-height: 58px; width: auto; height: auto; object-fit: contain; transition: opacity .2s; }
.sidebar-brand .brand-mark { display: none; width: 44px; height: 44px; object-fit: contain; margin: 0 auto; }
.sidebar-toggle {
    border: 0; background: var(--sb-hover); color: var(--sb-text); width: 34px; height: 34px; border-radius: 10px;
    display: grid; place-items: center; flex-shrink: 0; transition: background .2s, transform .28s var(--ease);
}
.sidebar-toggle:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.shield-band { height: 3px; background: linear-gradient(90deg, var(--shield-teal) 0 25%, var(--shield-sky) 25% 50%, var(--shield-pink) 50% 75%, var(--shield-orange) 75% 100%); }
.sidebar .shield-band { margin: 0 20px; border-radius: 3px; opacity: .9; }

.sidebar-nav { overflow-y: auto; overflow-x: hidden; padding: 14px 12px 20px; flex: 1; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.15) transparent; }
.nav-group { margin-top: 6px; }
.nav-group-toggle {
    width: 100%; border: 0; background: none; color: var(--sb-muted); display: flex; align-items: center; justify-content: space-between;
    font-size: .74rem; font-weight: 700; letter-spacing: .04em; padding: 12px 12px 6px; white-space: nowrap;
}
.nav-group-toggle:hover { color: var(--sb-text); }
.nav-group-toggle .bi { transition: transform .25s var(--ease); font-size: .7rem; }
.nav-group.closed .nav-group-toggle .bi { transform: rotate(-90deg); }
.nav-group-items { display: grid; grid-template-rows: 1fr; transition: grid-template-rows .3s var(--ease); }
.nav-group-items > div { overflow: hidden; }
.nav-group.closed .nav-group-items { grid-template-rows: 0fr; }

.sidebar-nav .nav-link {
    position: relative; color: var(--sb-text); border-radius: 12px; padding: 9px 12px; margin: 2px 0;
    display: flex; align-items: center; gap: 12px; font-size: .9rem; font-weight: 500; white-space: nowrap;
    transition: background .2s, color .2s;
}
.sidebar-nav .nav-link i { font-size: 1.08rem; width: 22px; text-align: center; color: var(--sb-muted); transition: color .2s; flex-shrink: 0; }
.sidebar-nav .nav-link:hover { background: var(--sb-hover); color: #fff; }
.sidebar-nav .nav-link:hover i { color: #fff; }
.sidebar-nav .nav-link.active {
    color: #fff; font-weight: 700;
    background: linear-gradient(135deg, var(--primary), color-mix(in srgb, var(--primary) 70%, #7c3aed));
    box-shadow: 0 8px 22px -10px color-mix(in srgb, var(--primary) 85%, transparent), inset 0 1px 0 rgba(255,255,255,.18);
}
.sidebar-nav .nav-link.active i { color: #fff; }

.sidebar-user { border-top: 1px solid var(--sb-line); padding: 14px 16px; display: flex; align-items: center; gap: 12px; }
.avatar {
    width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; flex-shrink: 0;
    font-weight: 800; font-size: .85rem; color: #fff;
    background: linear-gradient(135deg, var(--shield-pink), var(--shield-orange));
}
.sidebar-user .who { min-width: 0; flex: 1; line-height: 1.25; }
.sidebar-user .who strong { display: block; color: #fff; font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user .who span { color: var(--sb-muted); font-size: .76rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.sidebar-user .icon-btn { color: var(--sb-muted); background: var(--sb-hover); border: 0; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; }
.sidebar-user .icon-btn:hover { color: #fff; background: rgba(224, 68, 79, .35); }

/* collapsed (icon-only) sidebar — desktop */
@media (min-width: 992px) {
    .sb-collapsed .sidebar { width: var(--sb-w-collapsed); }
    .sb-collapsed .main { margin-left: var(--sb-w-collapsed); }
    .sb-collapsed .sidebar-brand img.full { display: none; }
    .sb-collapsed .sidebar-brand .brand-mark { display: block; }
    .sb-collapsed .sidebar-head { flex-direction: column; padding: 16px 10px 12px; gap: 10px; }
    .sb-collapsed .sidebar-toggle { transform: rotate(180deg); }
    .sb-collapsed .sidebar .shield-band { margin: 0 14px; }
    .sb-collapsed .nav-group-toggle { justify-content: center; padding: 10px 0 4px; font-size: 0; }
    .sb-collapsed .nav-group-toggle::before { content: ''; width: 18px; height: 1px; background: var(--sb-line); }
    .sb-collapsed .nav-group-toggle .bi { display: none; }
    .sb-collapsed .nav-group.closed .nav-group-items { grid-template-rows: 1fr; }
    .sb-collapsed .sidebar-nav .nav-link { justify-content: center; padding: 11px 0; }
    .sb-collapsed .sidebar-nav .nav-link span { display: none; }
    /* hover label flyout */
    .sb-collapsed .sidebar-nav { overflow: visible; }
    .sb-collapsed .sidebar-nav .nav-link:hover::after {
        content: attr(data-label); position: absolute; left: calc(100% + 12px); top: 50%; transform: translateY(-50%);
        background: var(--ink); color: #fff; padding: 6px 10px; border-radius: 8px; font-size: .8rem; font-weight: 600;
        white-space: nowrap; box-shadow: var(--shadow-lg); z-index: 10; pointer-events: none;
    }
    .sb-collapsed .sidebar-user { flex-direction: column; padding: 12px 8px; }
    .sb-collapsed .sidebar-user .who { display: none; }
}

/* light sidebar variant (Settings > Appearance) */
[data-sidebar="light"] {
    --sb-bg: #ffffff; --sb-bg-2: #fbfcfe; --sb-text: #2a3550; --sb-muted: #8a94ab;
    --sb-hover: #f1f4fa; --sb-line: #e8ecf4;
}
[data-sidebar="light"] .sidebar { border-right: 1px solid var(--line); }
[data-sidebar="light"] .sidebar-nav .nav-link:hover, [data-sidebar="light"] .sidebar-toggle:hover { color: var(--ink); }
[data-sidebar="light"] .sidebar-nav .nav-link:hover i { color: var(--primary); }
[data-sidebar="light"] .sidebar-user .who strong { color: var(--ink); }

.main { margin-left: var(--sb-w); flex: 1; min-width: 0; display: flex; flex-direction: column; transition: margin-left .28s var(--ease); }

.topbar {
    position: sticky; top: 0; z-index: 1030; display: flex; gap: 14px; align-items: center; padding: 12px 28px;
    background: color-mix(in srgb, var(--canvas) 78%, transparent);
    backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
    border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}
.quick-search { max-width: 380px; flex: 1; position: relative; }
.quick-search .bi { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--ink-faint); }
.quick-search input {
    width: 100%; border: 1px solid var(--line); background: var(--surface); border-radius: 12px; padding: 9px 14px 9px 40px;
    font-family: var(--bs-font-monospace); font-size: .88rem; letter-spacing: .02em; box-shadow: var(--shadow-sm); transition: border-color .2s, box-shadow .2s;
}
.quick-search input:focus { outline: 0; border-color: var(--primary); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 15%, transparent); }
.quick-search kbd { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); background: var(--canvas); color: var(--ink-soft); border: 1px solid var(--line); font-size: .7rem; padding: 2px 6px; border-radius: 6px; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.branch-switch .form-select { border-radius: 12px; min-width: 210px; font-weight: 600; box-shadow: var(--shadow-sm); }
.branch-chip { display: inline-flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 7px 14px; font-weight: 600; box-shadow: var(--shadow-sm); }
.branch-chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ok) 18%, transparent); }
.user-menu-btn { border: 1px solid var(--line); background: var(--surface); border-radius: 14px; padding: 4px 10px 4px 4px; display: flex; align-items: center; gap: 8px; box-shadow: var(--shadow-sm); }
.user-menu-btn .avatar { width: 32px; height: 32px; border-radius: 10px; font-size: .78rem; }
.dropdown-menu { border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 6px; }
.dropdown-item { border-radius: 10px; padding: 8px 12px; font-weight: 500; }
.dropdown-item:active { background: var(--primary); }

.content { padding: 26px 28px 40px; max-width: 1560px; width: 100%; }

@media (max-width: 991.98px) {
    .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
    .sidebar.open { transform: none; }
    .main { margin-left: 0 !important; }
    .content { padding: 18px 16px 32px; }
    .topbar { padding: 10px 16px; flex-wrap: wrap; }
    .quick-search { order: 3; max-width: none; flex-basis: 100%; }
    .quick-search kbd { display: none; }
    .user-menu-btn .name { display: none; }
}
.sidebar-backdrop { display: none; }
.sidebar.open + .sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(13, 20, 40, .45); backdrop-filter: blur(2px); z-index: 1035; }

.page-head { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; justify-content: space-between; margin-bottom: 22px; }
.page-head p { color: var(--ink-soft); margin: 4px 0 0; }

/* page entrance (one gentle motion; dashboard has its own sequence) */
/* kept short so pages feel instant: content is readable within ~0.2s */
[data-animate="1"] .content > * { animation: rise .22s var(--ease) both; }
[data-animate="1"] .content > *:nth-child(2) { animation-delay: .02s; }
[data-animate="1"] .content > *:nth-child(3) { animation-delay: .04s; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ------------------------------------------------------------------ surfaces */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.panel-head { padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.panel-head h2 { margin: 0; }
.panel-head .sub { color: var(--ink-soft); font-size: .82rem; }
.panel-body { padding: 20px; }

.stat-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.stat-strip .stat { padding: 18px 20px; border-right: 1px solid var(--line); }
.stat-strip .stat:last-child { border-right: 0; }
.stat .value { font-size: 1.65rem; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.stat .label { color: var(--ink-soft); font-size: .84rem; margin-top: 4px; }
.stat.primary .value { color: var(--primary); }
@media (max-width: 575.98px) { .stat-strip .stat { border-right: 0; border-bottom: 1px solid var(--line); } }

/* ------------------------------------------------------------------ tables */
.table { --bs-table-bg: transparent; margin: 0; }
.table > thead th { font-size: .76rem; font-weight: 700; color: var(--ink-soft); border-bottom: 1px solid var(--line); white-space: nowrap; background: #f8f9fc; letter-spacing: .01em; }
.table > :not(caption) > * > * { padding: .72rem .9rem; vertical-align: middle; border-bottom-color: var(--line); }
[data-density="compact"] .table > :not(caption) > * > * { padding: .42rem .7rem; }
[data-density="compact"] body, [data-density="compact"] { font-size: .9rem; }
.table-hover > tbody > tr { transition: background .15s; }
.table-hover > tbody > tr:hover > * { --bs-table-bg-state: color-mix(in srgb, var(--primary) 4%, white); }
.panel .table-responsive { border-radius: 0 0 var(--radius) var(--radius); }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.filter-bar { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px 20px; border-bottom: 1px solid var(--line); background: #fafbfd; border-radius: var(--radius) var(--radius) 0 0; }
.filter-bar .form-control, .filter-bar .form-select { width: auto; min-width: 140px; }
.filter-bar .grow { flex: 1; min-width: 200px; }
.empty-state { padding: 52px 16px; text-align: center; color: var(--ink-soft); }
.empty-state i { font-size: 2.2rem; display: block; margin-bottom: 10px; color: #c2c9d8; }
.pagination { --bs-pagination-border-radius: 10px; --bs-pagination-active-bg: var(--primary); --bs-pagination-active-border-color: var(--primary); --bs-pagination-color: var(--ink); margin: 0; }

/* ------------------------------------------------------------------ IMEI (signature element) */
.imei { font-family: var(--bs-font-monospace); font-size: .92em; white-space: nowrap; font-variant-numeric: tabular-nums; letter-spacing: .01em; }
.imei-tac { color: var(--ink); }
.imei-sn { color: var(--ink); font-weight: 600; margin-left: .32em; }
.imei-cd { color: var(--ink-faint); margin-left: .32em; }
.imei-lg { font-size: 1.35rem; }
.imei-input { font-family: var(--bs-font-monospace); letter-spacing: .06em; }
.imei-feedback { font-size: .82rem; margin-top: 4px; min-height: 1.2em; }
.imei-feedback.ok { color: var(--ok); }
.imei-feedback.bad { color: var(--danger); }

/* ------------------------------------------------------------------ badges, buttons, forms */
.badge { font-weight: 700; font-size: .74rem; padding: .38em .66em; border-radius: 7px; letter-spacing: .01em; }
.badge-soft-success { background: #e2f6ed; color: #0c7c51; }
.badge-soft-warning { background: #fff1d6; color: #8a5a00; }
.badge-soft-primary { background: color-mix(in srgb, var(--primary) 12%, white); color: color-mix(in srgb, var(--primary) 85%, black); }
.badge-soft-danger { background: #fde6e8; color: #b0222c; }
.badge-soft-info { background: #e0f2fb; color: #0c6a97; }
.badge-soft-secondary { background: #edf0f5; color: #4a5470; }

.btn { font-weight: 600; border-radius: var(--radius-sm); padding: .5rem 1rem; transition: transform .15s var(--ease), box-shadow .2s, background .2s; }
.btn-sm { border-radius: var(--radius-xs); padding: .3rem .65rem; }
.btn-lg { border-radius: 12px; padding: .7rem 1.3rem; }
.btn-primary {
    --bs-btn-bg: var(--primary); --bs-btn-border-color: var(--primary);
    --bs-btn-hover-bg: color-mix(in srgb, var(--primary) 88%, black); --bs-btn-hover-border-color: color-mix(in srgb, var(--primary) 88%, black);
    --bs-btn-active-bg: color-mix(in srgb, var(--primary) 78%, black); --bs-btn-disabled-bg: var(--primary); --bs-btn-disabled-border-color: var(--primary);
    box-shadow: 0 8px 20px -10px color-mix(in srgb, var(--primary) 80%, transparent);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 12px 24px -10px color-mix(in srgb, var(--primary) 85%, transparent); }
.btn-outline-primary { --bs-btn-color: var(--primary); --bs-btn-border-color: color-mix(in srgb, var(--primary) 45%, white); --bs-btn-hover-bg: var(--primary); --bs-btn-hover-border-color: var(--primary); background: var(--surface); }
.btn-light { --bs-btn-bg: #f1f4f9; --bs-btn-border-color: #f1f4f9; --bs-btn-hover-bg: #e6eaf2; --bs-btn-hover-border-color: #e6eaf2; }
.btn-icon { padding: .3rem .55rem; }
.form-label { font-size: .84rem; font-weight: 600; margin-bottom: 5px; color: #2c3752; }
.form-label .req { color: var(--danger); }
.form-control, .form-select { border-radius: var(--radius-sm); border-color: var(--line-strong); padding: .55rem .8rem; }
.form-control-lg, .form-select-lg { border-radius: 12px; }
.form-control:focus, .form-select:focus { border-color: var(--primary); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 15%, transparent); }
.form-check-input:checked { background-color: var(--primary); border-color: var(--primary); }
.form-switch .form-check-input { width: 2.4em; height: 1.3em; cursor: pointer; }
.form-section { font-size: .95rem; font-weight: 700; margin: 8px 0 14px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.alert { border-radius: 14px; border: 0; box-shadow: var(--shadow-sm); }
.alert-success { background: #e2f6ed; color: #0b6143; }
.alert-danger { background: #fde6e8; color: #8f1b24; }
.alert-warning { background: #fff1d6; color: #7a4f00; }

/* history timeline */
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { position: relative; padding: 0 0 18px 24px; border-left: 2px solid var(--line); margin-left: 6px; }
.timeline li:last-child { border-left-color: transparent; padding-bottom: 0; }
.timeline li::before { content: ''; position: absolute; left: -7px; top: 3px; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 3px solid var(--primary); }
.timeline li.ev-transferred::before { border-color: var(--shield-sky); }
.timeline li.ev-status_changed::before { border-color: var(--shield-orange); }
.timeline li.ev-imported::before, .timeline li.ev-synced::before { border-color: var(--shield-teal); }
.timeline li.ev-deleted::before { border-color: var(--danger); }
.timeline .when { font-size: .78rem; color: var(--ink-faint); }

dl.facts { display: grid; grid-template-columns: minmax(130px, 38%) 1fr; gap: 10px 16px; margin: 0; }
dl.facts dt { font-weight: 600; color: var(--ink-soft); font-size: .86rem; }
dl.facts dd { margin: 0; }

/* ==========================================================================
   Dashboard
   ========================================================================== */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; margin-bottom: 22px; }
.kpi {
    position: relative; overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 18px 16px;
    box-shadow: var(--shadow); transition: transform .25s var(--ease), box-shadow .25s;
}
.kpi:hover { transform: translateY(-3px); box-shadow: 0 18px 36px -18px rgba(23,32,51,.28); }
.kpi::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--kpi, var(--primary)); }
.kpi .ico { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-size: 1.2rem; color: var(--kpi, var(--primary)); background: color-mix(in srgb, var(--kpi, var(--primary)) 13%, white); margin-bottom: 14px; }
.kpi .value { font-size: 1.85rem; font-weight: 800; letter-spacing: -.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.kpi .label { color: var(--ink-soft); font-size: .86rem; font-weight: 600; margin-top: 6px; }
.kpi .foot { margin-top: 12px; font-size: .78rem; color: var(--ink-faint); }
.kpi .meter { height: 6px; border-radius: 6px; background: #eef1f7; overflow: hidden; margin-top: 12px; }
.kpi .meter i { display: block; height: 100%; width: var(--w, 0%); background: var(--kpi, var(--primary)); border-radius: 6px; transition: width 1.1s var(--ease); }

/* donut */
.donut-wrap { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.donut { width: 190px; height: 190px; position: relative; flex-shrink: 0; }
.donut svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.donut circle { fill: none; stroke-width: 18; }
.donut .track { stroke: #eef1f7; }
.donut .seg { stroke-linecap: butt; transition: stroke-dashoffset 1.2s var(--ease); }
.donut .center { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.donut .center strong { display: block; font-size: 1.9rem; font-weight: 800; letter-spacing: -.03em; line-height: 1; }
.donut .center span { font-size: .78rem; color: var(--ink-soft); font-weight: 600; }
.legend { list-style: none; padding: 0; margin: 0; flex: 1; min-width: 180px; display: grid; gap: 8px; }
.legend li { display: flex; align-items: center; gap: 10px; font-size: .88rem; }
.legend .sw { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.legend .n { margin-left: auto; font-weight: 700; font-variant-numeric: tabular-nums; }
.legend .pct { color: var(--ink-faint); width: 44px; text-align: right; font-size: .8rem; }

/* branch bars */
.branch-bars { display: grid; gap: 18px; }
.branch-bar .top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 7px; }
.branch-bar .name { font-weight: 700; }
.branch-bar .figs { font-size: .82rem; color: var(--ink-soft); white-space: nowrap; }
.branch-bar .figs b { color: var(--ink); }
.stack { display: flex; height: 12px; border-radius: 8px; overflow: hidden; background: #eef1f7; }
.stack i { display: block; height: 100%; width: 0; transition: width 1.1s var(--ease); }
.stack .s-available { background: linear-gradient(90deg, var(--shield-teal), #2fb38a); }
.stack .s-reserved { background: var(--shield-orange); }
.stack .s-sold { background: var(--primary); }
.stack .s-other { background: #c3cad8; }
.bar-legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: .78rem; color: var(--ink-soft); }
.bar-legend span::before { content: ''; display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 6px; background: var(--c); vertical-align: middle; }

/* ranked lists */
.rank { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.rank li { display: grid; grid-template-columns: 30px 1fr auto; gap: 12px; align-items: center; }
.rank .pos { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; font-weight: 800; font-size: .8rem; background: #f1f4f9; color: var(--ink-soft); }
.rank li:first-child .pos { background: linear-gradient(135deg, var(--shield-orange), var(--shield-pink)); color: #fff; }
.rank .nm { font-weight: 600; font-size: .9rem; line-height: 1.25; }
.rank .nm small { display: block; color: var(--ink-faint); font-weight: 500; }
.rank .bar { height: 5px; border-radius: 5px; background: #eef1f7; margin-top: 6px; overflow: hidden; }
.rank .bar i { display: block; height: 100%; width: 0; background: var(--primary); border-radius: 5px; transition: width 1s var(--ease); }
.rank .qty { font-weight: 800; font-variant-numeric: tabular-nums; }
.low-item { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.low-item:last-child { border-bottom: 0; }
.low-item .chip { min-width: 38px; height: 30px; border-radius: 9px; display: grid; place-items: center; font-weight: 800; background: #fde6e8; color: #b0222c; }
.low-item .chip.zero { background: var(--danger); color: #fff; }

/* dashboard entrance sequence */
[data-animate="1"] .dash > * { animation: rise .3s var(--ease) both; }
[data-animate="1"] .dash > *:nth-child(2) { animation-delay: .04s; }
[data-animate="1"] .dash > *:nth-child(3) { animation-delay: .08s; }
[data-animate="1"] .dash > *:nth-child(4) { animation-delay: .12s; }
[data-animate="1"] .kpi-grid .kpi { animation: rise .3s var(--ease) both; }
[data-animate="1"] .kpi-grid .kpi:nth-child(2) { animation-delay: .03s; }
[data-animate="1"] .kpi-grid .kpi:nth-child(3) { animation-delay: .06s; }
[data-animate="1"] .kpi-grid .kpi:nth-child(4) { animation-delay: .09s; }
[data-animate="1"] .kpi-grid .kpi:nth-child(5) { animation-delay: .12s; }
[data-animate="1"] .kpi-grid .kpi:nth-child(6) { animation-delay: .15s; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--shield-teal); display: inline-block; margin-right: 6px; box-shadow: 0 0 0 0 rgba(93,191,159,.7); }
[data-animate="1"] .live-dot { animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(93,191,159,.6); } 70% { box-shadow: 0 0 0 9px rgba(93,191,159,0); } 100% { box-shadow: 0 0 0 0 rgba(93,191,159,0); } }

/* ==========================================================================
   Settings
   ========================================================================== */
.settings-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 22px; align-items: start; }
.settings-nav { position: sticky; top: 86px; padding: 8px; }
.settings-nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; color: var(--ink); font-weight: 600; font-size: .9rem; }
.settings-nav a i { color: var(--ink-faint); font-size: 1.05rem; width: 20px; text-align: center; }
.settings-nav a:hover { background: #f3f5fa; }
.settings-nav a.active { background: var(--primary-soft); color: var(--primary); }
.settings-nav a.active i { color: var(--primary); }
.setting-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 20px; padding: 16px 0; border-bottom: 1px solid var(--line); align-items: center; }
.setting-row:last-child { border-bottom: 0; }
.setting-row .lbl { font-weight: 700; font-size: .9rem; }
.setting-row .hint { color: var(--ink-soft); font-size: .8rem; margin-top: 2px; }
.setting-row.wide { grid-template-columns: 1fr; gap: 8px; }
.color-field { display: flex; gap: 10px; align-items: center; }
.color-field input[type=color] { width: 54px; height: 42px; padding: 4px; border-radius: 10px; }
.logo-card { border: 1px dashed var(--line-strong); border-radius: 14px; padding: 16px; display: grid; gap: 12px; }
.logo-preview { height: 110px; border-radius: 12px; display: grid; place-items: center; padding: 14px; }
.logo-preview img { max-width: 100%; max-height: 80px; width: auto; height: auto; object-fit: contain; }
.logo-preview.on-light { background: #fff; border: 1px solid var(--line); }
.logo-preview.on-dark { background: linear-gradient(135deg, #0d1428, #1a2550); }
.check-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.check-pill input { display: none; }
.check-pill span { display: inline-block; border: 1px solid var(--line-strong); border-radius: 999px; padding: 6px 14px; font-weight: 600; font-size: .85rem; cursor: pointer; transition: all .15s; }
.check-pill input:checked + span { background: var(--primary); border-color: var(--primary); color: #fff; }
@media (max-width: 991.98px) { .settings-layout { grid-template-columns: 1fr; } .settings-nav { position: static; display: flex; overflow-x: auto; gap: 4px; } .settings-nav a { white-space: nowrap; } .setting-row { grid-template-columns: 1fr; gap: 8px; } }

/* ==========================================================================
   Auth
   ========================================================================== */
.auth-body { background: #0b1226; }
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(400px, 540px); }

/* ---- brand panel */
.auth-aside {
    position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center; padding: 48px 56px; color: #fff;
    background:
        radial-gradient(55% 60% at 100% 0%, rgba(226, 73, 138, .32), transparent 62%),
        radial-gradient(50% 60% at 85% 105%, rgba(245, 162, 39, .26), transparent 60%),
        radial-gradient(50% 60% at 0% 100%, rgba(93, 191, 159, .30), transparent 60%),
        linear-gradient(135deg, #0a1124 0%, #16224d 55%, #22205c 100%);
    isolation: isolate;
}
.auth-aside::before { /* dotted texture */
    content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: .35;
    background-image: radial-gradient(rgba(255,255,255,.18) 1px, transparent 1.2px); background-size: 20px 20px;
    mask-image: radial-gradient(75% 75% at 50% 45%, #000 25%, transparent 80%);
}
.auth-orb { position: absolute; border-radius: 50%; filter: blur(60px); z-index: -1; opacity: .55; }
.auth-orb.o1 { width: 340px; height: 340px; background: #35a7e0; top: -120px; left: -80px; }
.auth-orb.o2 { width: 300px; height: 300px; background: #e2498a; bottom: -120px; right: -60px; opacity: .4; }
.auth-orb.o3 { width: 220px; height: 220px; background: #5dbf9f; bottom: 20%; left: 35%; opacity: .25; }
[data-animate="1"] .auth-orb.o1 { animation: orb-drift 14s ease-in-out infinite alternate; }
[data-animate="1"] .auth-orb.o2 { animation: orb-drift 18s ease-in-out infinite alternate-reverse; }
@keyframes orb-drift { from { transform: translate(0, 0); } to { transform: translate(60px, 40px); } }

.auth-aside-inner { width: 100%; max-width: 640px; }
.auth-brand img { max-width: 300px; width: 100%; height: auto; object-fit: contain; display: block; }
.auth-brand .shield-band { max-width: 300px; margin-top: 16px; border-radius: 3px; }
.auth-headline { font-size: clamp(1.7rem, 2.6vw, 2.5rem); font-weight: 800; letter-spacing: -.03em; line-height: 1.12; margin: 28px 0 10px; color: #fff; }
.auth-lead { color: rgba(255,255,255,.72); font-size: 1.02rem; max-width: 520px; margin: 0 0 8px; }

.auth-scene { margin: 18px 0 4px; }
.auth-svg { width: 100%; height: auto; display: block; overflow: visible; filter: drop-shadow(0 24px 40px rgba(0,0,0,.35)); }
.auth-network { margin-top: 4px; }
.auth-net-svg { width: 100%; height: auto; display: block; overflow: visible; }
.net-line { stroke: rgba(255,255,255,.3); stroke-width: 2; stroke-dasharray: 6 8; fill: none; }
.net-dot { fill: #fff; filter: drop-shadow(0 0 6px rgba(255,255,255,.9)); }
.net-dot.d2 { fill: #f5a227; }
.net-pulse { opacity: 0; transform-box: fill-box; transform-origin: center; }
.auth-net-caption { text-align: center; color: rgba(255,255,255,.6); font-size: .82rem; margin-top: 6px; }
.auth-features { list-style: none; padding: 0; margin: 22px 0 0; display: flex; flex-wrap: wrap; gap: 10px; }
.auth-features li {
    display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; font-size: .84rem; font-weight: 600;
    background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14); color: rgba(255,255,255,.9);
}
.auth-features i { color: var(--shield-teal); }

/* scene motion */
[data-animate="1"] .scan-beam { animation: auth-scan 2.6s ease-in-out infinite; }
[data-animate="1"] .hero-device { animation: auth-bob 6s ease-in-out infinite; }
[data-animate="1"] .badge-float.b1 { animation: auth-bob 5s ease-in-out infinite; }
[data-animate="1"] .badge-float.b2 { animation: auth-bob 5.6s ease-in-out .9s infinite; }
[data-animate="1"] .sp { animation: auth-pop .6s cubic-bezier(.2,.8,.2,1.3) both; }
[data-animate="1"] .sp.p2 { animation-delay: .1s; } [data-animate="1"] .sp.p3 { animation-delay: .2s; }
[data-animate="1"] .sp.p4 { animation-delay: .3s; } [data-animate="1"] .sp.p5 { animation-delay: .4s; } [data-animate="1"] .sp.p6 { animation-delay: .5s; }
[data-animate="1"] .awning { animation: auth-drop .7s cubic-bezier(.2,.8,.2,1) both; }
[data-animate="1"] .net-pulse { animation: net-pulse 2.4s ease-out infinite; }
[data-animate="1"] .net-node:nth-of-type(2) .net-pulse { animation-delay: .8s; }
[data-animate="1"] .net-node:nth-of-type(3) .net-pulse { animation-delay: 1.6s; }
[data-animate="0"] .net-dot { display: none; }
@keyframes auth-scan { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(48px); } }
@keyframes auth-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
@keyframes auth-pop { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes auth-drop { from { opacity: 0; transform: translateY(-18px); } to { opacity: 1; transform: none; } }
@keyframes net-pulse { 0% { opacity: .8; transform: scale(1); } 100% { opacity: 0; transform: scale(1.7); } }

/* panel entrance */
[data-animate="1"] .auth-brand, [data-animate="1"] .auth-headline, [data-animate="1"] .auth-lead,
[data-animate="1"] .auth-scene, [data-animate="1"] .auth-network, [data-animate="1"] .auth-features { animation: rise .7s var(--ease) both; }
[data-animate="1"] .auth-headline { animation-delay: .08s; }
[data-animate="1"] .auth-lead { animation-delay: .14s; }
[data-animate="1"] .auth-scene { animation-delay: .2s; }
[data-animate="1"] .auth-network { animation-delay: .32s; }
[data-animate="1"] .auth-features { animation-delay: .42s; }

/* ---- form panel */
.auth-form {
    display: flex; flex-direction: column; justify-content: center; padding: 48px 56px; position: relative;
    background:
        radial-gradient(60% 40% at 100% 0%, color-mix(in srgb, var(--primary) 8%, transparent), transparent 70%),
        var(--surface);
}
.auth-card { width: 100%; max-width: 400px; margin: 0 auto; }
[data-animate="1"] .auth-card { animation: rise .6s var(--ease) .15s both; }
.auth-card-logo { display: none; max-width: 180px; height: auto; object-fit: contain; margin: 0 auto 22px; }
.auth-title h1 { font-size: 1.9rem; margin: 0 0 6px; letter-spacing: -.03em; }
.auth-title p { color: var(--ink-soft); margin: 0 0 28px; }
.auth-card .form-control-lg { font-size: 1rem; padding-top: .75rem; padding-bottom: .75rem; background: #f6f8fc; border-color: var(--line); }
.auth-card .form-control-lg:focus { background: #fff; }
.input-icon { position: relative; }
.input-icon > i { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: var(--ink-faint); font-size: 1.05rem; pointer-events: none; transition: color .2s; }
.input-icon > .form-control { padding-left: 44px; }
.input-icon:focus-within > i { color: var(--primary); }
.pw-toggle { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: var(--ink-faint); width: 36px; height: 36px; border-radius: 9px; }
.pw-toggle:hover { color: var(--primary); background: color-mix(in srgb, var(--primary) 8%, transparent); }
.input-icon:has(.pw-toggle) > .form-control { padding-right: 48px; }
.auth-submit {
    display: flex; align-items: center; justify-content: center; gap: 10px; padding: .85rem 1rem; font-weight: 700; border-radius: 12px;
    background: linear-gradient(135deg, var(--primary), color-mix(in srgb, var(--primary) 65%, #7c3aed)); border: 0;
}
.auth-submit i { transition: transform .2s var(--ease); }
.auth-submit:hover i { transform: translateX(4px); }
.auth-foot { margin: 26px 0 0; text-align: center; color: var(--ink-faint); font-size: .8rem; }
.auth-foot i { color: var(--ok); margin-right: 4px; }

@media (max-width: 1199.98px) {
    .auth-aside { padding: 40px 36px; }
    .auth-network, .auth-features { display: none; }
}
@media (max-width: 991.98px) {
    .auth-wrap { grid-template-columns: 1fr; }
    .auth-aside { display: none; }
    .auth-form { min-height: 100vh; padding: 36px 22px; }
    .auth-card-logo { display: block; }
}

/* tom-select alignment */
.ts-wrapper.form-select, .ts-wrapper.form-control { padding: 0; }
.ts-control { border-radius: var(--radius-sm); min-height: 40px; border-color: var(--line-strong); padding: .5rem .8rem; }
.ts-dropdown { border-radius: 12px; box-shadow: var(--shadow-lg); border-color: var(--line); }

/* ------------------------------------------------------------------ print */
.print-only { display: none; }
@media print {
    .sidebar, .topbar, .no-print, .filter-bar, .pagination, .btn { display: none !important; }
    .main { margin: 0 !important; }
    .content { padding: 0; max-width: none; }
    .panel { border: 0; box-shadow: none; }
    .print-only { display: block; }
    body { background: #fff; font-size: 11pt; }
    .content > * { animation: none !important; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ==========================================================================
   Sidebar menu search
   ========================================================================== */
.sidebar-search { position: relative; margin: 14px 16px 4px; }
.sidebar-search > i { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--sb-muted); font-size: .9rem; pointer-events: none; transition: color .2s; }
.sidebar-search input {
    width: 100%; border: 1px solid var(--sb-line); background: var(--sb-hover); color: var(--sb-text);
    border-radius: 12px; padding: 9px 58px 9px 36px; font-size: .86rem; font-weight: 500; transition: border-color .2s, background .2s, box-shadow .2s;
}
.sidebar-search input::placeholder { color: var(--sb-muted); }
.sidebar-search input:focus { outline: 0; border-color: color-mix(in srgb, var(--primary) 70%, transparent); background: rgba(255, 255, 255, .1); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 25%, transparent); }
[data-sidebar="light"] .sidebar-search input:focus { background: #fff; }
.sidebar-search:focus-within > i { color: var(--primary); }
.sidebar-search input::-webkit-search-cancel-button { filter: invert(.6); cursor: pointer; }
.sidebar-search kbd {
    position: absolute; right: 9px; top: 50%; transform: translateY(-50%); pointer-events: none;
    background: transparent; border: 1px solid var(--sb-line); color: var(--sb-muted); font-size: .66rem; font-weight: 600; padding: 2px 6px; border-radius: 6px;
}
.sidebar-search input:focus + kbd, .sidebar-search input:not(:placeholder-shown) + kbd { display: none; }

/* items hidden by the filter (overrides .nav-link display:flex) */
.sidebar-nav [hidden] { display: none !important; }
/* while searching, every group is open and the chevrons are hidden */
.sidebar-nav.searching .nav-group.closed .nav-group-items { grid-template-rows: 1fr; }
.sidebar-nav.searching .nav-group-toggle .bi { visibility: hidden; }
.sidebar-nav mark { background: color-mix(in srgb, var(--shield-orange) 45%, transparent); color: inherit; padding: 0 1px; border-radius: 3px; }
.nav-empty { padding: 18px 12px; text-align: center; color: var(--sb-muted); font-size: .84rem; }
.nav-empty i { display: block; font-size: 1.3rem; margin-bottom: 6px; opacity: .6; }

/* compact (icon-only) sidebar: show just a search icon button */
@media (min-width: 992px) {
    .sb-collapsed .sidebar-search { margin: 12px auto 4px; width: 46px; height: 40px; cursor: pointer; }
    .sb-collapsed .sidebar-search input { padding: 0; height: 40px; color: transparent; cursor: pointer; }
    .sb-collapsed .sidebar-search input::placeholder { color: transparent; }
    .sb-collapsed .sidebar-search kbd { display: none; }
    .sb-collapsed .sidebar-search > i { left: 50%; transform: translate(-50%, -50%); font-size: 1rem; }
}

/* ==========================================================================
   Login: fit exactly one screen (no page scroll), smaller logo & text
   ========================================================================== */
@media (min-width: 992px) {
    .auth-body { overflow: hidden; }
    .auth-wrap { height: 100vh; height: 100dvh; min-height: 0; overflow: hidden; }

    .auth-aside { padding: 4vh 48px; align-items: stretch; }
    .auth-aside-inner { height: 100%; max-width: 600px; margin: 0 auto; display: flex; flex-direction: column; justify-content: center; min-height: 0; }

    .auth-brand img { max-width: 170px; max-height: 8vh; width: auto; }
    .auth-brand .shield-band { max-width: 170px; margin-top: 10px; }
    .auth-headline { font-size: clamp(1.25rem, 3.4vh, 1.9rem); margin: 2.6vh 0 .8vh; }
    .auth-lead { font-size: .9rem; margin: 0; }

    /* the scene takes whatever height is left and scales down with the screen */
    .auth-scene { flex: 1 1 auto; min-height: 0; max-height: 38vh; margin: 2.2vh 0 0; display: flex; justify-content: center; }
    .auth-svg { height: 100%; width: auto; max-width: 100%; }
    .auth-network { margin-top: 1vh; flex-shrink: 0; }
    .auth-net-svg { height: 6vh; width: auto; max-width: 100%; margin: 0 auto; }
    .auth-net-caption { font-size: .76rem; margin-top: 2px; }
    .auth-features { margin-top: 1.6vh; gap: 8px; flex-shrink: 0; }
    .auth-features li { padding: 6px 12px; font-size: .78rem; }

    /* form side never makes the page scroll */
    .auth-form { height: 100%; overflow-y: auto; padding: 4vh 48px; }
    .auth-title h1 { font-size: 1.65rem; }
    .auth-title p { margin-bottom: 3vh; }
    .auth-card .form-control-lg { padding-top: .62rem; padding-bottom: .62rem; }
    .auth-card .mb-3 { margin-bottom: 2vh !important; }
    .auth-card .mb-4 { margin-bottom: 2.6vh !important; }
    .auth-card .alert { padding: .65rem 1rem; margin-bottom: 2vh; }
    .auth-foot { margin-top: 2.6vh; }
}

/* shorter laptop screens: drop extras first, keep everything inside the screen */
@media (min-width: 992px) and (max-height: 780px) {
    .auth-network, .auth-features { display: none; }
    .auth-scene { max-height: 44vh; }
}
@media (min-width: 992px) and (max-height: 600px) {
    .auth-scene { display: none; }
}

/* ==========================================================================
   Sales: EMI box + printable invoice
   ========================================================================== */
.emi-box { background: color-mix(in srgb, var(--primary) 6%, white); border: 1px dashed color-mix(in srgb, var(--primary) 35%, white); border-radius: 12px; padding: 12px; }

.invoice { padding: 28px 32px; }
.invoice-head { display: flex; justify-content: space-between; gap: 24px; padding-bottom: 18px; border-bottom: 2px solid var(--ink); }
.invoice-logo { max-height: 64px; max-width: 220px; width: auto; height: auto; object-fit: contain; display: block; }
.invoice-title { font-size: 1.5rem; font-weight: 800; letter-spacing: -.02em; margin-bottom: 8px; }
.invoice-meta { display: grid; grid-template-columns: auto auto; gap: 2px 14px; margin: 0; justify-content: end; font-size: .88rem; }
.invoice-meta dt { color: var(--ink-soft); font-weight: 600; }
.invoice-meta dd { margin: 0; font-weight: 700; }
.invoice-party { display: flex; justify-content: space-between; gap: 24px; padding: 18px 0; font-size: .92rem; }
.invoice-party .label { font-size: .74rem; font-weight: 700; color: var(--ink-soft); letter-spacing: .04em; margin-bottom: 4px; }
.invoice-table > thead th { background: #f3f5fa; }
.invoice-totals { display: flex; justify-content: space-between; gap: 24px; padding-top: 16px; }
.invoice-totals dl { display: grid; grid-template-columns: auto 160px; gap: 6px 20px; margin: 0; min-width: 300px; }
.invoice-totals dt { color: var(--ink-soft); font-weight: 600; text-align: right; }
.invoice-totals dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.invoice-totals .grand { font-size: 1.15rem; font-weight: 800; color: var(--ink); border-top: 2px solid var(--ink); padding-top: 8px; margin-top: 4px; }
.invoice-foot { display: flex; justify-content: space-between; align-items: flex-end; margin-top: 36px; }
.invoice-foot .sign { border-top: 1px solid var(--ink-soft); padding-top: 6px; min-width: 200px; text-align: center; font-size: .84rem; color: var(--ink-soft); }
@media (max-width: 767.98px) {
    .invoice { padding: 18px; }
    .invoice-head, .invoice-party, .invoice-totals { flex-direction: column; }
    .invoice-head .text-end, .invoice-party .text-end { text-align: left !important; }
    .invoice-meta { justify-content: start; }
    .invoice-totals dl { min-width: 0; grid-template-columns: 1fr auto; }
}
@media print {
    .invoice { padding: 0; box-shadow: none; border: 0; }
    .invoice a { color: inherit; text-decoration: none; }
    .invoice-table > thead th { background: #eee !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ---------- IMEI journey ---------- */
.journey-summary { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1.5fr) auto; gap: 20px; align-items: center; padding: 20px 22px; }
.js-main { display: flex; gap: 14px; align-items: flex-start; }
.js-icon { width: 52px; height: 52px; flex: none; border-radius: 16px; display: grid; place-items: center; font-size: 1.5rem; color: #fff; background: linear-gradient(135deg, var(--shield-sky), var(--primary)); box-shadow: 0 8px 20px color-mix(in srgb, var(--primary) 30%, transparent); }
.js-title { font-weight: 800; font-size: 1.1rem; letter-spacing: -.01em; }
.js-imeis { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: .84rem; color: var(--ink-soft); margin-top: 2px; }
.js-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; margin: 0; }
.js-facts > div { background: var(--canvas); border-radius: 12px; padding: 8px 12px; }
.js-facts dt { font-size: .72rem; font-weight: 700; color: var(--ink-soft); letter-spacing: .03em; }
.js-facts dd { margin: 0; font-weight: 800; font-variant-numeric: tabular-nums; }
.js-actions { display: flex; flex-direction: column; gap: 6px; }

.journey-map { list-style: none; margin: 0; padding: 8px 0 4px; display: flex; overflow-x: auto; }
.jm-node { position: relative; flex: 1 0 150px; display: flex; flex-direction: column; align-items: center; text-align: center; padding: 0 8px; }
.jm-node::before { content: ''; position: absolute; top: 25px; left: -50%; width: 100%; height: 3px; background: linear-gradient(90deg, var(--line-strong), var(--primary)); z-index: 0; }
.jm-node:first-child::before { display: none; }
.jm-dot { position: relative; z-index: 1; width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; font-size: 1.25rem; background: var(--surface); border: 3px solid var(--line-strong); color: var(--ink-soft); }
.jm-source .jm-dot { border-color: var(--shield-orange); color: var(--shield-orange); }
.jm-branch .jm-dot { border-color: var(--primary); color: var(--primary); }
.jm-customer .jm-dot { border-color: var(--ok); color: var(--ok); }
.jm-node.is-current .jm-dot { color: #fff; background: var(--primary); border-color: var(--primary); box-shadow: 0 0 0 6px color-mix(in srgb, var(--primary) 18%, transparent); }
.jm-customer.is-current .jm-dot { background: var(--ok); border-color: var(--ok); box-shadow: 0 0 0 6px color-mix(in srgb, var(--ok) 18%, transparent); }
.jm-label { margin-top: 10px; font-weight: 700; line-height: 1.2; word-break: break-word; }
.jm-sub { font-size: .76rem; color: var(--ink-soft); margin-top: 2px; }
.jm-here { margin-top: 6px; font-size: .7rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--primary); background: var(--primary-soft); border-radius: 999px; padding: 2px 10px; }
.jm-customer .jm-here { color: #0c7c51; background: #e2f6ed; }
[data-animate="1"] .jm-node { animation: rise .5s var(--ease) both; animation-delay: calc(var(--i) * .12s); }
[data-animate="1"] .jm-node::before { transform-origin: left; animation: jm-line .5s var(--ease) both; animation-delay: calc(var(--i) * .12s); }
[data-animate="1"] .jm-node.is-current .jm-dot { animation: jm-pulse 2.2s ease-out infinite; }
@keyframes jm-line { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes jm-pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--primary) 45%, transparent); } 70%, 100% { box-shadow: 0 0 0 12px transparent; } }

.journey-steps { list-style: none; margin: 0; padding: 0; position: relative; }
.journey-steps::before { content: ''; position: absolute; left: 19px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.js-step { position: relative; display: flex; gap: 14px; padding: 0 0 18px; }
.js-step:last-child { padding-bottom: 0; }
.js-step-icon { position: relative; z-index: 1; flex: none; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: #edf0f5; color: #4a5470; }
.k-in .js-step-icon { background: #fff1d6; color: #8a5a00; }
.k-move .js-step-icon { background: var(--primary-soft); color: var(--primary); }
.k-out .js-step-icon { background: #e2f6ed; color: #0c7c51; }
.k-warn .js-step-icon { background: #fde6e8; color: #b0222c; }
.js-step-title { font-weight: 700; padding-top: 2px; }
.js-step-detail { font-size: .88rem; color: var(--ink-soft); }
.js-step-meta { font-size: .78rem; color: var(--ink-faint); margin-top: 3px; }
@media (max-width: 991.98px) {
    .journey-summary { grid-template-columns: 1fr; }
    .js-actions { flex-direction: row; flex-wrap: wrap; }
}
@media (max-width: 575.98px) {
    .journey-map { flex-direction: column; overflow: visible; }
    .jm-node { flex: none; flex-direction: row; text-align: left; gap: 12px; padding: 0 0 18px; flex-wrap: wrap; }
    .jm-node::before { top: -50%; left: 24px; width: 3px; height: 100%; background: linear-gradient(180deg, var(--line-strong), var(--primary)); }
    .jm-label { margin-top: 0; }
    [data-animate="1"] .jm-node::before { animation: none; }
}
@media (prefers-reduced-motion: reduce) { .jm-node, .jm-node::before, .jm-node .jm-dot { animation: none !important; } }

/* ---------- AI insights ---------- */
.ai-panel { position: relative; overflow: hidden; }
.ai-panel::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 3px; background: linear-gradient(90deg, var(--shield-sky), var(--primary), var(--shield-pink), var(--shield-orange)); background-size: 200% 100%; }
[data-animate="1"] .ai-panel::before { animation: ai-flow 6s linear infinite; }
@keyframes ai-flow { from { background-position: 0 0; } to { background-position: 200% 0; } }
.ai-spark { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 9px; margin-right: 6px; color: #fff; background: linear-gradient(135deg, var(--primary), var(--shield-pink)); font-size: .9rem; vertical-align: middle; }
.ai-text { font-size: .95rem; line-height: 1.6; }
.ai-text p { margin-bottom: .6rem; }
.ai-text ul { margin: 0 0 .4rem; padding-left: 1.2rem; }
.ai-text li { margin-bottom: .3rem; }

.insight-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.insight { display: flex; gap: 12px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); border-left: 4px solid var(--info); }
.insight .ins-ico { flex: none; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: #e0f2fb; color: #0c6a97; }
.insight.is-good { border-left-color: var(--ok); } .insight.is-good .ins-ico { background: #e2f6ed; color: #0c7c51; }
.insight.is-warn { border-left-color: var(--warn); } .insight.is-warn .ins-ico { background: #fff1d6; color: #8a5a00; }
.insight.is-bad { border-left-color: var(--danger); } .insight.is-bad .ins-ico { background: #fde6e8; color: #b0222c; }
.ins-title { font-weight: 700; }
.ins-text { font-size: .87rem; color: var(--ink-soft); }
[data-animate="1"] .insight { animation: rise .45s var(--ease) both; }
[data-animate="1"] .insight:nth-child(2) { animation-delay: .06s; }
[data-animate="1"] .insight:nth-child(3) { animation-delay: .12s; }
[data-animate="1"] .insight:nth-child(4) { animation-delay: .18s; }
[data-animate="1"] .insight:nth-child(n+5) { animation-delay: .24s; }

.mix-row { display: grid; grid-template-columns: 110px 1fr 52px; gap: 10px; align-items: center; font-size: .88rem; margin-bottom: 10px; }
.mix-row:last-child { margin-bottom: 0; }
.mix-row b { text-align: right; font-variant-numeric: tabular-nums; }
.mix-row .bar { height: 8px; border-radius: 8px; background: #eef1f7; overflow: hidden; }
.mix-row .bar i { display: block; height: 100%; width: 0; border-radius: 8px; background: linear-gradient(90deg, var(--shield-sky), var(--primary)); transition: width 1s var(--ease); }
@media (prefers-reduced-motion: reduce) { .ai-panel::before, .insight { animation: none !important; } }

/* AI report (written from database figures) */
.ai-headline { font-size: 1.02rem; font-weight: 600; line-height: 1.55; margin-bottom: 14px; }
.ai-sections { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; margin-bottom: 14px; }
.ai-section { background: var(--canvas); border-radius: 12px; padding: 12px 14px; }
.ai-sec-title { font-size: .76rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-soft); margin-bottom: 4px; }
.ai-sec-title i { color: var(--primary); margin-right: 2px; }
.ai-sec-text { font-size: .9rem; line-height: 1.55; }
.ai-actions { border: 1px dashed var(--line-strong); border-radius: 12px; padding: 12px 14px; }
.ai-actions ol { margin: 4px 0 0; padding-left: 1.2rem; font-size: .92rem; }
.ai-actions li { margin-bottom: 4px; }
.ai-written { border-top: 1px solid var(--line); padding-top: 12px; }
[data-animate="1"] .ai-section { animation: rise .45s var(--ease) both; }
[data-animate="1"] .ai-section:nth-child(2) { animation-delay: .06s; }
[data-animate="1"] .ai-section:nth-child(3) { animation-delay: .12s; }
[data-animate="1"] .ai-section:nth-child(n+4) { animation-delay: .18s; }
@media print { .ai-panel::before { display: none; } }

/* navigation progress bar (app.js initFastNav) */
.nav-progress { position: fixed; top: 0; left: 0; height: 3px; width: 0; z-index: 2000; pointer-events: none; opacity: 0;
    background: linear-gradient(90deg, var(--shield-sky), var(--primary), var(--shield-pink)); box-shadow: 0 0 8px color-mix(in srgb, var(--primary) 50%, transparent); }
.nav-progress.run { opacity: 1; animation: nav-progress 8s cubic-bezier(.1, .7, .2, 1) forwards; }
@keyframes nav-progress { 0% { width: 0; } 10% { width: 35%; } 40% { width: 70%; } 100% { width: 92%; } }
@media (prefers-reduced-motion: reduce) { .nav-progress.run { animation-duration: .01s; width: 92%; } }

/* ==========================================================================
   Royal dashboard: sapphire, gold leaf and jewel tones
   One memorable element (the engraved medallion); everything around it stays quiet.
   ========================================================================== */
.royal {
    --r-night: #0d1634;
    --r-sapphire: #1b2f6e;
    --r-gold: #c9a255;
    --r-gold-hi: #f1dfa6;
    --r-gold-lo: #94702d;
    --r-ivory: #f8f2e2;
    --r-champagne: #e6d3a0;
    --r-hair: #e7dcc2;
    --r-serif: 'Cormorant Garamond', 'Iowan Old Style', Georgia, serif;
}

/* ---- hero */
.royal-hero {
    position: relative; overflow: hidden; isolation: isolate;
    display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr) 250px; gap: 30px; align-items: center;
    padding: 30px 34px; margin-bottom: 24px; border-radius: 22px; color: var(--r-ivory);
    background:
        radial-gradient(60% 120% at 88% 40%, rgba(201, 162, 85, .16), transparent 60%),
        radial-gradient(50% 90% at 0% 0%, rgba(43, 79, 176, .45), transparent 65%),
        linear-gradient(135deg, var(--r-night) 0%, #14224c 55%, #1a1f45 100%);
    box-shadow: 0 30px 60px -32px rgba(13, 22, 52, .75), inset 0 0 0 1px rgba(201, 162, 85, .28);
}
/* inner gold frame, like the border of a certificate */
.royal-hero::before {
    content: ''; position: absolute; inset: 9px; border-radius: 16px; pointer-events: none; z-index: -1;
    border: 1px solid rgba(201, 162, 85, .22);
}
.rh-intro { min-width: 0; }
.rh-hello { color: var(--r-champagne); font-weight: 600; font-size: .92rem; display: flex; align-items: center; }
.royal-hero h1 {
    font-family: var(--r-serif); font-weight: 600; font-size: 2.9rem; line-height: 1.02; letter-spacing: -.01em;
    margin: 6px 0 10px; color: #fff;
}
.rh-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: .84rem; color: rgba(248, 242, 226, .7); }
.rh-meta i { color: var(--r-gold); margin-right: 6px; }

.rh-seals { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.rh-seal {
    display: inline-flex; align-items: center; gap: 8px; padding: 5px 6px 5px 12px; border-radius: 999px; font-size: .84rem; font-weight: 600;
    background: rgba(255, 255, 255, .05); border: 1px solid rgba(201, 162, 85, .35); color: var(--r-ivory);
}
.rh-seal i { color: var(--r-gold); }
.rh-seal b {
    min-width: 28px; text-align: center; padding: 1px 9px; border-radius: 999px; font-variant-numeric: tabular-nums;
    background: linear-gradient(135deg, var(--r-gold-hi), var(--r-gold)); color: #2a1f08;
}
.rh-seal.quiet { padding-right: 12px; border-style: dashed; color: rgba(248, 242, 226, .62); background: transparent; }

.rh-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.rh-actions .btn { display: inline-flex; align-items: center; gap: 7px; padding: .55rem 1rem; font-size: .88rem; border-radius: 12px; font-weight: 700; }
.btn-gold {
    color: #24190a; border: 0;
    background: linear-gradient(135deg, var(--r-gold-hi, #f1dfa6) 0%, var(--r-gold, #c9a255) 55%, var(--r-gold-lo, #94702d) 100%);
    box-shadow: 0 10px 22px -12px rgba(201, 162, 85, .9), inset 0 1px 0 rgba(255, 255, 255, .5);
}
.btn-gold:hover, .btn-gold:focus-visible { color: #24190a; filter: brightness(1.06); transform: translateY(-1px); }
.btn-royal-ghost { color: var(--r-ivory); background: rgba(255, 255, 255, .06); border: 1px solid rgba(201, 162, 85, .4); }
.btn-royal-ghost:hover, .btn-royal-ghost:focus-visible { color: #fff; background: rgba(201, 162, 85, .16); border-color: var(--r-gold); }
.rh-actions .rh-round { width: 40px; height: 40px; padding: 0; justify-content: center; border-radius: 50%; }

/* ---- ledger */
.rh-ledger {
    min-width: 0; padding: 20px 22px; border-radius: 16px;
    background: linear-gradient(180deg, rgba(255, 255, 255, .07), rgba(255, 255, 255, .02));
    border: 1px solid rgba(201, 162, 85, .3);
    box-shadow: inset 0 0 0 4px rgba(13, 22, 52, .35), inset 0 0 0 5px rgba(201, 162, 85, .14);
}
.rh-ledger-label { font-size: .84rem; font-weight: 600; color: var(--r-champagne); }
.rh-value {
    font-family: var(--r-serif); font-weight: 700; font-size: 3rem; line-height: 1.05; margin: 2px 0 2px;
    font-variant-numeric: lining-nums tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    background: linear-gradient(180deg, #fff6d8 0%, var(--r-gold-hi) 35%, var(--r-gold) 75%, #b08a3e 100%);
    -webkit-background-clip: text; background-clip: text; color: transparent;
}
.rh-ledger-sub { font-size: .78rem; color: rgba(248, 242, 226, .6); }
.rh-lines { margin: 14px 0 0; display: grid; gap: 7px; }
.rh-lines > div { display: flex; align-items: baseline; gap: 8px; font-size: .9rem; }
/* dotted leader between label and amount, as in a ledger */
.rh-lines dt { font-weight: 500; color: rgba(248, 242, 226, .82); display: flex; align-items: center; gap: 7px; white-space: nowrap; order: 1; }
.rh-lines dt i { color: var(--r-gold); }
.rh-lines > div::before { content: ''; order: 2; flex: 1; border-bottom: 1px dotted rgba(201, 162, 85, .45); transform: translateY(-4px); min-width: 16px; }
.rh-lines dd { order: 3; margin: 0; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; color: #fff; }

/* ---- medallion (the memorable element) */
.rh-medallion { position: relative; width: 250px; aspect-ratio: 1; justify-self: end; }
.rh-medallion img { position: absolute; inset: 0; width: 100%; height: 100%; filter: drop-shadow(0 18px 30px rgba(0, 0, 0, .45)); }
.rh-gauge { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.rh-gauge circle { fill: none; stroke-width: 3.2; }
.rh-gauge .track { stroke: rgba(255, 255, 255, .08); }
.rh-gauge .seg { stroke-linecap: round; transition: stroke-dashoffset 1.3s var(--ease); filter: drop-shadow(0 0 3px rgba(241, 223, 166, .55)); }
.rh-medal-center {
    position: absolute; inset: 31%; border-radius: 50%; display: grid; place-content: center; text-align: center;
    background: radial-gradient(circle at 50% 35%, #1d2c63, var(--r-night) 75%);
    box-shadow: inset 0 0 0 1px rgba(201, 162, 85, .45), 0 0 0 5px rgba(13, 22, 52, .6);
}
.rh-medal-center strong {
    font-family: var(--r-serif); font-weight: 700; font-size: 2.3rem; line-height: 1; font-variant-numeric: lining-nums;
    background: linear-gradient(180deg, #fff6d8, var(--r-gold)); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.rh-medal-center span { font-size: .66rem; font-weight: 600; color: var(--r-champagne); margin-top: 2px; }

/* the single orchestrated moment: the medallion settles in while the gold arc draws */
/* settles in, then keeps turning very slowly; a glint of light circles the rim */
[data-animate="1"] .rh-medallion img { animation: rh-turn 1.1s var(--ease) both, rh-spin 160s linear 1.1s infinite; }
@keyframes rh-turn { from { opacity: 0; transform: rotate(-24deg) scale(.94); } to { opacity: 1; transform: none; } }
@keyframes rh-spin { to { transform: rotate(360deg); } }
.rh-medallion::before {
    content: ''; position: absolute; inset: 1%; border-radius: 50%; z-index: 1; pointer-events: none; opacity: 0;
    background: conic-gradient(from 0deg, transparent 0 70%, rgba(255, 244, 205, .0) 72%, rgba(255, 244, 205, .9) 78%, rgba(255, 244, 205, 0) 84%, transparent 100%);
    -webkit-mask: radial-gradient(circle, transparent 90%, #000 91%, #000 97%, transparent 98%);
            mask: radial-gradient(circle, transparent 90%, #000 91%, #000 97%, transparent 98%);
}
[data-animate="1"] .rh-medallion::before { opacity: 1; animation: rh-spin 7s linear infinite; }

/* hero background: a slow wash of gold light and rising gold dust */
.royal-hero::after {
    content: ''; position: absolute; z-index: -2; pointer-events: none; width: 70%; aspect-ratio: 1; left: -10%; top: -60%;
    background: radial-gradient(circle, rgba(201, 162, 85, .16), transparent 60%);
}
[data-animate="1"] .royal-hero::after { animation: rh-drift 22s ease-in-out infinite alternate; }
@keyframes rh-drift { from { transform: translate(0, 0); } to { transform: translate(85%, 70%); } }
.rh-dust { position: absolute; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; border-radius: inherit; }
.rh-dust i {
    position: absolute; left: var(--x); bottom: -6px; width: 3px; height: 3px; border-radius: 50%; opacity: 0;
    background: #f1dfa6; box-shadow: 0 0 6px 1px rgba(241, 223, 166, .7);
}
[data-animate="1"] .rh-dust i { animation: rh-rise var(--t) linear var(--d) infinite; }
.rh-dust i:nth-child(3n) { width: 2px; height: 2px; }
.rh-dust i:nth-child(4n) { width: 4px; height: 4px; box-shadow: 0 0 8px 2px rgba(241, 223, 166, .5); }
@keyframes rh-rise {
    0% { transform: translate(0, 0); opacity: 0; }
    15% { opacity: .85; }
    50% { transform: translate(14px, -170px); }
    85% { opacity: .5; }
    100% { transform: translate(-8px, -340px); opacity: 0; }
}


@media (max-width: 1399.98px) {
    .royal-hero { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 200px; gap: 22px; }
    .rh-medallion { width: 200px; }
    .royal-hero h1 { font-size: 2.5rem; }
    .rh-value { font-size: 2.5rem; }
}
@media (max-width: 1199.98px) {
    .royal-hero { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .rh-medallion { display: none; }
}
@media (max-width: 767.98px) {
    .royal-hero { grid-template-columns: 1fr; padding: 24px 20px; }
    .royal-hero h1 { font-size: 2.2rem; }
    .rh-value { font-size: 2.3rem; }
}

/* ---- quiet surfaces below the hero */
/* compact KPI tiles: icon beside the figure, one thin line underneath */
.royal .kpi-grid { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 20px; }
.royal .kpi {
    display: grid; grid-template-columns: 38px minmax(0, 1fr); grid-template-areas: "ico value" "ico label" "foot foot";
    column-gap: 12px; row-gap: 0; align-items: center; padding: 14px 16px 12px; border-radius: 14px;
    border-color: var(--r-hair); box-shadow: 0 1px 0 rgba(201, 162, 85, .12), 0 6px 16px -12px rgba(13, 22, 52, .25);
}
.royal .kpi:hover { transform: translateY(-2px); box-shadow: 0 12px 24px -16px rgba(13, 22, 52, .35); }
.royal .kpi::before { height: 2px; background: linear-gradient(90deg, transparent, var(--r-gold) 30%, var(--r-gold) 70%, transparent); }
.royal .kpi .ico {
    grid-area: ico; width: 38px; height: 38px; margin: 0; font-size: 1rem; border-radius: 50%;
    background: #fbf7ec; box-shadow: inset 0 0 0 1px var(--r-hair);
}
.royal .kpi .value { grid-area: value; font-family: var(--r-serif); font-weight: 700; font-size: 1.75rem; line-height: 1; letter-spacing: 0; font-variant-numeric: lining-nums tabular-nums; }
.royal .kpi .label { grid-area: label; margin-top: 2px; font-size: .8rem; }
.royal .kpi .foot, .royal .kpi .meter { grid-area: foot; }
.royal .kpi .foot { margin-top: 9px; font-size: .72rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.royal .kpi .meter { height: 4px; margin-top: 11px; background: #f3eee2; }

.royal .panel { border-color: var(--r-hair); }
.royal .panel-head h2 { font-family: var(--r-serif); font-weight: 700; font-size: 1.4rem; letter-spacing: 0; }
.royal .donut .center strong { font-family: var(--r-serif); font-size: 2.3rem; font-variant-numeric: lining-nums; }
.royal .donut .track, .royal .stack, .royal .rank .bar { background: #f3eee2; stroke: #f3eee2; }
.royal .stack .s-available { background: #1f8a63; }
.royal .stack .s-reserved { background: #c98b1e; }
.royal .stack .s-sold { background: #a23a5c; }
.royal .stack .s-other { background: #c9c2b3; }
.royal .rank .bar i { background: linear-gradient(90deg, var(--r-sapphire), #2b4fb0); }
.royal .rank li:first-child .pos { background: linear-gradient(135deg, var(--r-gold-hi), var(--r-gold) 60%, var(--r-gold-lo)); color: #2a1f08; }
.royal .rank .qty { font-family: var(--r-serif); font-size: 1.35rem; font-variant-numeric: lining-nums; }
.royal .live-dot { background: var(--r-gold); box-shadow: none; }
[data-animate="1"] .royal .live-dot { animation: rh-glint 2.4s infinite; }
@keyframes rh-glint { 0% { box-shadow: 0 0 0 0 rgba(201, 162, 85, .7); } 70% { box-shadow: 0 0 0 9px rgba(201, 162, 85, 0); } 100% { box-shadow: 0 0 0 0 rgba(201, 162, 85, 0); } }
@media (prefers-reduced-motion: reduce) { .rh-medallion img, .rh-medallion::before, .royal-hero::after, .rh-dust i, .royal .live-dot { animation: none !important; } .rh-medallion::before, .rh-dust { display: none; } }

/* ==========================================================================
   Grand dashboard: richer finish on top of the royal theme
   (animated gold frame, corner ornaments, jewel KPI tiles, ornate panels, medal ranks)
   ========================================================================== */
.royal-hero {
    padding: 36px 40px; border-radius: 26px;
    background:
        radial-gradient(55% 110% at 86% 38%, rgba(214, 177, 96, .22), transparent 62%),
        radial-gradient(45% 80% at 4% 0%, rgba(58, 98, 214, .55), transparent 66%),
        radial-gradient(40% 70% at 40% 120%, rgba(120, 60, 160, .30), transparent 70%),
        linear-gradient(135deg, #0a1230 0%, #13214f 50%, #1c1c4a 100%);
    box-shadow:
        0 40px 80px -36px rgba(10, 18, 48, .85),
        0 0 0 1px rgba(214, 177, 96, .35),
        inset 0 1px 0 rgba(255, 240, 200, .18);
}
.royal-hero::before { inset: 12px; border-radius: 18px; border-color: rgba(214, 177, 96, .30); }

/* a ribbon of light that travels round the gold frame */
.rh-border {
    position: absolute; inset: 0; border-radius: inherit; padding: 1.5px; pointer-events: none; z-index: 1;
    background: conic-gradient(from var(--rh-a, 0deg), transparent 0 62%, rgba(241, 223, 166, .0) 66%, #f6e7b4 74%, #c9a255 80%, transparent 88%);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor; mask-composite: exclude;
    opacity: .9;
}
@property --rh-a { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
[data-animate="1"] .rh-border { animation: rh-orbit 9s linear infinite; }
@keyframes rh-orbit { to { --rh-a: 360deg; } }

/* filigree corners of the certificate frame */
.rh-corner { position: absolute; width: 34px; height: 34px; pointer-events: none; z-index: 1; border: 2px solid rgba(214, 177, 96, .75); }
.rh-corner::after { content: ''; position: absolute; width: 6px; height: 6px; transform: rotate(45deg); background: #e8cf8a; box-shadow: 0 0 8px rgba(241, 223, 166, .8); }
.rh-corner.tl { top: 20px; left: 20px; border-right: 0; border-bottom: 0; border-top-left-radius: 10px; }
.rh-corner.tr { top: 20px; right: 20px; border-left: 0; border-bottom: 0; border-top-right-radius: 10px; }
.rh-corner.bl { bottom: 20px; left: 20px; border-right: 0; border-top: 0; border-bottom-left-radius: 10px; }
.rh-corner.br { bottom: 20px; right: 20px; border-left: 0; border-top: 0; border-bottom-right-radius: 10px; }
.rh-corner.tl::after { top: -4px; left: -4px; } .rh-corner.tr::after { top: -4px; right: -4px; }
.rh-corner.bl::after { bottom: -4px; left: -4px; } .rh-corner.br::after { bottom: -4px; right: -4px; }

.royal-hero h1 {
    font-size: 3.4rem; font-weight: 700; margin: 8px 0 4px;
    background: linear-gradient(180deg, #ffffff 0%, #fff4d6 55%, #e7c97c 100%);
    -webkit-background-clip: text; background-clip: text; color: transparent;
    text-shadow: 0 2px 30px rgba(241, 223, 166, .18);
}
.rh-hello { font-size: .95rem; letter-spacing: .02em; }
.rh-flourish { display: flex; align-items: center; gap: 10px; max-width: 320px; margin: 2px 0 14px; color: #e8cf8a; font-size: .8rem; }
.rh-flourish span { flex: 1; height: 1px; background: linear-gradient(90deg, transparent, rgba(214, 177, 96, .9)); }
.rh-flourish span:last-child { background: linear-gradient(90deg, rgba(214, 177, 96, .9), transparent); }
.rh-flourish i { filter: drop-shadow(0 0 6px rgba(241, 223, 166, .8)); }
.rh-meta span {
    display: inline-flex; align-items: center; padding: 4px 11px; border-radius: 999px;
    background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .08);
}
.rh-meta i { margin-right: 7px; }

.rh-seal {
    padding: 6px 7px 6px 13px; backdrop-filter: blur(6px);
    background: linear-gradient(180deg, rgba(255, 255, 255, .09), rgba(255, 255, 255, .03));
    border-color: rgba(214, 177, 96, .45);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), 0 8px 18px -14px rgba(0, 0, 0, .8);
    transition: transform .2s var(--ease), border-color .2s, box-shadow .2s;
}
.rh-seal:hover { transform: translateY(-2px); border-color: #e8cf8a; box-shadow: 0 0 0 3px rgba(214, 177, 96, .12), 0 12px 22px -14px rgba(0, 0, 0, .9); }
.rh-seal b { box-shadow: 0 0 12px -2px rgba(241, 223, 166, .7); }

.rh-actions .btn { padding: .62rem 1.15rem; border-radius: 14px; transition: transform .2s var(--ease), box-shadow .2s, filter .2s, background .2s; }
.btn-gold { position: relative; overflow: hidden; }
.btn-gold::after {
    content: ''; position: absolute; top: 0; bottom: 0; width: 40%; left: -60%; pointer-events: none;
    background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .65), transparent); transform: skewX(-18deg);
}
[data-animate="1"] .btn-gold::after { animation: rh-shine 4.5s ease-in-out 1.5s infinite; }
@keyframes rh-shine { 0%, 70% { left: -60%; } 100% { left: 130%; } }

/* the ledger: glass card with a living gold figure */
.rh-ledger {
    position: relative; padding: 24px 26px; border-radius: 20px;
    background:
        radial-gradient(120% 90% at 100% 0%, rgba(214, 177, 96, .14), transparent 60%),
        linear-gradient(180deg, rgba(255, 255, 255, .10), rgba(255, 255, 255, .03));
    border-color: rgba(214, 177, 96, .45);
    box-shadow: inset 0 1px 0 rgba(255, 240, 200, .18), inset 0 0 0 5px rgba(10, 18, 48, .35), inset 0 0 0 6px rgba(214, 177, 96, .16), 0 24px 44px -26px rgba(0, 0, 0, .8);
    backdrop-filter: blur(8px);
}
.rh-ledger-label { text-transform: uppercase; letter-spacing: .14em; font-size: .72rem; font-weight: 700; }
.rh-value {
    font-size: 3.3rem;
    background: linear-gradient(100deg, #b08a3e 0%, #f1dfa6 20%, #fffaf0 30%, #f1dfa6 40%, #c9a255 60%, #f6e7b4 80%, #b08a3e 100%);
    background-size: 250% 100%; background-position: 100% 0;
    -webkit-background-clip: text; background-clip: text; color: transparent;
    filter: drop-shadow(0 4px 18px rgba(214, 177, 96, .25));
}
[data-animate="1"] .rh-value { animation: rh-gleam 6s ease-in-out 1s infinite; }
@keyframes rh-gleam { 0% { background-position: 100% 0; } 45%, 100% { background-position: -50% 0; } }
.rh-lines { gap: 9px; margin-top: 16px; }
.rh-lines > div { font-size: .92rem; }
.rh-lines dt i {
    width: 24px; height: 24px; border-radius: 8px; display: inline-grid; place-items: center; font-size: .8rem;
    background: rgba(214, 177, 96, .14); box-shadow: inset 0 0 0 1px rgba(214, 177, 96, .35);
}

.rh-medallion { filter: drop-shadow(0 0 40px rgba(214, 177, 96, .18)); }
.rh-medal-center { box-shadow: inset 0 0 0 1px rgba(214, 177, 96, .6), 0 0 0 5px rgba(10, 18, 48, .6), 0 0 30px rgba(214, 177, 96, .25); }

/* ---- KPI tiles: jewel badge, serif figure, watermark icon */
.royal .kpi-grid { gap: 16px; margin-bottom: 24px; }
.royal .kpi {
    padding: 18px 18px 15px; border-radius: 18px; border: 1px solid color-mix(in srgb, var(--kpi) 18%, #ece3cc);
    background:
        radial-gradient(120% 120% at 100% 0%, color-mix(in srgb, var(--kpi) 9%, transparent), transparent 55%),
        linear-gradient(180deg, #ffffff, #fffdf8);
    box-shadow: 0 1px 0 rgba(214, 177, 96, .18), 0 14px 30px -22px color-mix(in srgb, var(--kpi) 60%, rgba(13, 22, 52, .6));
}
.royal .kpi::before { height: 3px; background: linear-gradient(90deg, transparent, var(--kpi) 20%, #d6b160 50%, var(--kpi) 80%, transparent); }
.royal .kpi:hover {
    transform: translateY(-4px);
    box-shadow: 0 0 0 1px rgba(214, 177, 96, .45), 0 24px 40px -22px color-mix(in srgb, var(--kpi) 70%, rgba(13, 22, 52, .7));
}
.royal .kpi .ico {
    width: 44px; height: 44px; font-size: 1.1rem; color: #fff;
    background: linear-gradient(140deg, color-mix(in srgb, var(--kpi) 80%, white), var(--kpi) 55%, color-mix(in srgb, var(--kpi) 70%, black));
    box-shadow: 0 0 0 3px #fff, 0 0 0 4.5px rgba(214, 177, 96, .7), 0 10px 20px -8px color-mix(in srgb, var(--kpi) 80%, transparent);
}
.royal .kpi { grid-template-columns: 44px minmax(0, 1fr); column-gap: 14px; }
.royal .kpi .value { font-size: 2.1rem; color: color-mix(in srgb, var(--kpi) 55%, #141a2e); }
.royal .kpi .label { font-weight: 700; text-transform: uppercase; letter-spacing: .08em; font-size: .7rem; color: var(--ink-soft); margin-top: 4px; }
.royal .kpi .meter { height: 6px; background: #f3eee2; }
.royal .kpi .meter i { background: linear-gradient(90deg, color-mix(in srgb, var(--kpi) 70%, white), var(--kpi)); box-shadow: 0 0 10px color-mix(in srgb, var(--kpi) 50%, transparent); }
.kpi-wm {
    position: absolute; right: -10px; bottom: -18px; font-size: 5.2rem; line-height: 1; pointer-events: none;
    color: var(--kpi); opacity: .06; transform: rotate(-12deg); transition: transform .4s var(--ease), opacity .3s;
}
.royal .kpi:hover .kpi-wm { transform: rotate(0deg) scale(1.08); opacity: .1; }

/* ---- panels: ivory card, gold rule, jewel icon in the heading */
.royal .panel {
    position: relative; border-radius: 20px; border-color: #ece3cc; overflow: hidden;
    background: linear-gradient(180deg, #fffdf7 0, #ffffff 140px);
    box-shadow: 0 1px 0 rgba(214, 177, 96, .2), 0 18px 40px -30px rgba(13, 22, 52, .45);
}
.royal .panel::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, #1b2f6e, #c9a255 35%, #f1dfa6 50%, #c9a255 65%, #1b2f6e);
}
.royal .panel-head { padding: 18px 22px 16px; border-bottom: 0; position: relative; }
.royal .panel-head::after {
    content: ''; position: absolute; left: 22px; right: 22px; bottom: 0; height: 1px;
    background: linear-gradient(90deg, rgba(214, 177, 96, .7), rgba(214, 177, 96, .15) 60%, transparent);
}
.royal .panel-head h2 { font-size: 1.5rem; color: #16204a; }
.ph-title { display: flex; align-items: center; gap: 12px; min-width: 0; }
.ph-ico {
    flex: 0 0 36px; width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; font-size: .95rem;
    color: #f6e7b4; background: linear-gradient(140deg, #24397f, #0f1a40);
    box-shadow: 0 0 0 1px rgba(214, 177, 96, .55), 0 8px 16px -8px rgba(13, 22, 52, .7);
}
.ph-ico.warn { color: #fff; background: linear-gradient(140deg, #e8696f, #b3242f); box-shadow: 0 0 0 1px rgba(214, 177, 96, .55), 0 8px 16px -8px rgba(179, 36, 47, .7); }
.royal .panel-head .sub { font-size: .75rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: #f7f0de; color: #7a5c1e; border: 1px solid #ecdcae; }

/* donut + legend */
.royal .donut { filter: drop-shadow(0 10px 18px rgba(13, 22, 52, .12)); }
.royal .donut .center > div {
    width: 112px; height: 112px; border-radius: 50%; display: grid; place-content: center;
    background: radial-gradient(circle at 50% 30%, #ffffff, #fbf6e9); box-shadow: inset 0 0 0 1px #ecdcae, 0 6px 16px -8px rgba(13, 22, 52, .25);
}
.royal .donut .center strong { color: #16204a; }
.royal .legend li { padding: 7px 10px; border-radius: 10px; transition: background .2s; }
.royal .legend li:hover { background: #faf5e8; }
.royal .legend .sw { width: 12px; height: 12px; border-radius: 50%; box-shadow: 0 0 0 2px #fff, 0 0 0 3px #ecdcae; }

/* branch bars: glossy, rounded */
.royal .branch-bars { gap: 16px; }
.royal .branch-bar { padding: 12px 14px; border-radius: 14px; border: 1px solid #f1e9d6; background: #fffdf8; transition: border-color .2s, box-shadow .2s; }
.royal .branch-bar:hover { border-color: #e6d3a0; box-shadow: 0 10px 22px -18px rgba(13, 22, 52, .5); }
.royal .branch-bar .name { color: #16204a; }
.royal .stack { height: 14px; border-radius: 999px; box-shadow: inset 0 1px 2px rgba(13, 22, 52, .12); }
.royal .stack i { position: relative; }
.royal .stack i::after { content: ''; position: absolute; inset: 0 0 50% 0; background: linear-gradient(180deg, rgba(255, 255, 255, .45), transparent); }
.royal .stack .s-available { background: linear-gradient(90deg, #2bb383, #1f8a63); }
.royal .stack .s-reserved { background: linear-gradient(90deg, #e8b04a, #c98b1e); }
.royal .stack .s-sold { background: linear-gradient(90deg, #c4547a, #a23a5c); }

/* ranked list: gold, silver and bronze medals */
.royal .rank { gap: 10px; }
.royal .rank li { padding: 9px 10px; border-radius: 14px; transition: background .2s; }
.royal .rank li:hover { background: #faf5e8; }
.royal .rank .pos { width: 32px; height: 32px; border-radius: 50%; background: #f3eee2; color: #7a5c1e; box-shadow: inset 0 0 0 1px #e6d3a0; }
.royal .rank li:nth-child(2) .pos { background: linear-gradient(135deg, #f4f6fa, #c3cad6 60%, #8e98aa); color: #2a3142; box-shadow: 0 4px 10px -4px rgba(80, 90, 110, .6); }
.royal .rank li:nth-child(3) .pos { background: linear-gradient(135deg, #f3c9a0, #c9864a 60%, #8d5426); color: #2b1606; box-shadow: 0 4px 10px -4px rgba(141, 84, 38, .6); }
.royal .rank li:first-child .pos { box-shadow: 0 0 0 3px rgba(214, 177, 96, .25), 0 6px 14px -4px rgba(201, 162, 85, .8); }
.royal .rank .bar { height: 6px; }
.royal .rank .bar i { background: linear-gradient(90deg, #2b4fb0, #c9a255); }
.royal .rank .qty { color: #16204a; }

/* low stock + timeline */
.royal .low-item { padding: 11px 10px; border-radius: 12px; border-bottom: 0; margin-bottom: 6px; background: #fffaf9; border: 1px solid #f8e3e5; }
.royal .low-item .chip { border-radius: 50%; width: 38px; min-width: 38px; height: 38px; }
.royal .low-item .chip.zero { background: linear-gradient(140deg, #e8696f, #b3242f); box-shadow: 0 6px 14px -6px rgba(179, 36, 47, .8); }
.royal .timeline li { border-left-color: #ecdcae; }
.royal .timeline li::before { box-shadow: 0 0 0 3px #fff, 0 0 0 4px #ecdcae; }

/* entrance: KPI tiles and panels rise in one after another */
[data-animate="1"] .royal .panel { animation: rise .45s var(--ease) both; }
[data-animate="1"] .royal .row .col-xl-7 .panel, [data-animate="1"] .royal .row .col-lg-6:nth-child(2) .panel { animation-delay: .08s; }
[data-animate="1"] .royal .row .col-lg-12 .panel { animation-delay: .16s; }

@media (max-width: 1399.98px) { .royal-hero h1 { font-size: 2.8rem; } .rh-value { font-size: 2.7rem; } }
@media (max-width: 767.98px) {
    .royal-hero { padding: 28px 22px; }
    .royal-hero h1 { font-size: 2.3rem; }
    .rh-value { font-size: 2.3rem; }
    .rh-corner { width: 22px; height: 22px; }
    .rh-corner.tl, .rh-corner.tr { top: 14px; } .rh-corner.bl, .rh-corner.br { bottom: 14px; }
    .rh-corner.tl, .rh-corner.bl { left: 14px; } .rh-corner.tr, .rh-corner.br { right: 14px; }
}
@media (prefers-reduced-motion: reduce) {
    .rh-border, .rh-value, .btn-gold::after, .royal .panel { animation: none !important; }
}

/* ---- compact hero: three columns, branch chips in one row along the bottom */
.royal-hero {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr) 210px; gap: 18px 30px; align-items: center;
    padding: 30px 38px 26px;
}
.royal-hero h1 { font-size: 3rem; }
.rh-flourish { margin-bottom: 12px; }
.rh-actions { margin-top: 18px; gap: 7px; }
.rh-actions .btn { padding: .55rem .9rem; font-size: .86rem; }
.rh-actions .rh-round { padding: 0; }
.rh-ledger { padding: 20px 24px; }
.rh-value { font-size: 2.9rem; }
.rh-medallion { width: 210px; justify-self: center; }
.rh-seals-row {
    grid-column: 1 / -1; margin-top: 0; padding-top: 16px; gap: 10px;
    border-top: 1px solid rgba(214, 177, 96, .22);
}
@media (max-width: 1399.98px) {
    .royal-hero { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr) 170px; gap: 18px 22px; padding: 26px 30px 22px; }
    .royal-hero h1 { font-size: 2.6rem; }
    .rh-value { font-size: 2.4rem; }
    .rh-medallion { width: 170px; }
}
@media (max-width: 1199.98px) { .royal-hero { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
@media (max-width: 767.98px) { .royal-hero { grid-template-columns: 1fr; padding: 26px 22px 20px; } }

/* ==========================================================================
   Branch sales page (royal theme)
   ========================================================================== */
.bs-hero {
    position: relative; overflow: hidden; isolation: isolate; margin-bottom: 24px; padding: 28px 34px 26px; border-radius: 26px; color: #f8f2e2;
    background:
        radial-gradient(55% 110% at 90% 10%, rgba(214, 177, 96, .22), transparent 62%),
        radial-gradient(45% 80% at 0% 0%, rgba(58, 98, 214, .55), transparent 66%),
        linear-gradient(135deg, #0a1230 0%, #13214f 55%, #1c1c4a 100%);
    box-shadow: 0 34px 70px -36px rgba(10, 18, 48, .85), 0 0 0 1px rgba(214, 177, 96, .35), inset 0 1px 0 rgba(255, 240, 200, .16);
}
.bs-hero::before { content: ''; position: absolute; inset: 12px; border-radius: 18px; border: 1px solid rgba(214, 177, 96, .26); pointer-events: none; z-index: -1; }
.bs-hero-top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px; }
.bs-back { display: inline-flex; align-items: center; gap: 6px; font-size: .82rem; font-weight: 600; color: #e6d3a0; }
.bs-back:hover { color: #fff; }
.bs-hero h1 {
    font-family: 'Cormorant Garamond', Georgia, serif; font-weight: 700; font-size: 2.9rem; line-height: 1.05; margin: 4px 0 6px;
    background: linear-gradient(180deg, #fff, #fff4d6 55%, #e7c97c); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.bs-range { font-size: .88rem; color: rgba(248, 242, 226, .75); }
.bs-range i { color: #d6b160; margin-right: 7px; }
.bs-custom { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px; border-radius: 14px; background: rgba(255, 255, 255, .06); border: 1px solid rgba(214, 177, 96, .3); }
.bs-custom span { font-size: .8rem; color: rgba(248, 242, 226, .7); }
.bs-custom .form-control { width: auto; min-width: 140px; height: 36px; border-radius: 10px; background: rgba(255, 255, 255, .95); }
.bs-custom .btn { height: 36px; border-radius: 10px; font-weight: 700; display: inline-flex; align-items: center; gap: 6px; }

.bs-periods { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 20px; }
.bs-periods a {
    padding: 7px 15px; border-radius: 999px; font-size: .84rem; font-weight: 700; color: #f8f2e2;
    background: rgba(255, 255, 255, .06); border: 1px solid rgba(214, 177, 96, .35); transition: background .2s, border-color .2s, transform .2s;
}
.bs-periods a:hover { background: rgba(214, 177, 96, .16); border-color: #d6b160; color: #fff; transform: translateY(-1px); }
.bs-periods a.active { color: #24190a; border-color: transparent; background: linear-gradient(135deg, #f1dfa6, #c9a255 60%, #94702d); box-shadow: 0 8px 18px -10px rgba(214, 177, 96, .9); }

.bs-totals { display: grid; grid-template-columns: minmax(260px, 1.6fr) repeat(4, minmax(150px, 1fr)); gap: 12px; }
.bs-total {
    padding: 14px 18px; border-radius: 16px; min-width: 0;
    background: linear-gradient(180deg, rgba(255, 255, 255, .09), rgba(255, 255, 255, .03));
    border: 1px solid rgba(214, 177, 96, .3); box-shadow: inset 0 1px 0 rgba(255, 240, 200, .12);
}
.bs-total .lbl { font-size: .72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: #e6d3a0; }
.bs-total .lbl i { color: #d6b160; margin-right: 4px; }
.bs-total .val { font-family: 'Cormorant Garamond', Georgia, serif; font-weight: 700; font-size: 2rem; line-height: 1.1; color: #fff; font-variant-numeric: lining-nums tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bs-total .val.gold {
    font-size: 2.6rem;
    background: linear-gradient(180deg, #fff6d8, #f1dfa6 40%, #c9a255 80%); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.bs-total .sub { font-size: .76rem; color: rgba(248, 242, 226, .62); margin-top: 2px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.bs-total.bs-total-main { background: radial-gradient(120% 120% at 0% 0%, rgba(214, 177, 96, .18), transparent 60%), linear-gradient(180deg, rgba(255, 255, 255, .1), rgba(255, 255, 255, .03)); border-color: rgba(214, 177, 96, .5); }

.bs-growth { display: inline-flex; align-items: center; gap: 3px; padding: 2px 9px; border-radius: 999px; font-size: .75rem; font-weight: 800; white-space: nowrap; }
.bs-growth.up { color: #0f7a52; background: #dff5ea; }
.bs-growth.down { color: #b3242f; background: #fde7e9; }
.bs-growth.none { color: #8a7a55; background: #f5efe0; }
.bs-hero .bs-growth.up { color: #7ef0bd; background: rgba(31, 138, 99, .25); }
.bs-hero .bs-growth.down { color: #ffb3b8; background: rgba(224, 68, 79, .22); }

/* daily trend */
.bs-trend { display: flex; align-items: flex-end; gap: 3px; height: 150px; padding: 0 2px; border-bottom: 1px solid #ecdcae; }
.bs-trend .bar { flex: 1; height: 100%; display: flex; align-items: flex-end; min-width: 2px; cursor: default; }
.bs-trend .bar i {
    display: block; width: 100%; min-height: 2px; border-radius: 6px 6px 2px 2px; transform-origin: bottom;
    background: linear-gradient(180deg, #e8cf8a, #c9a255 40%, #1b2f6e); opacity: .9; transition: opacity .2s, filter .2s;
}
.bs-trend .bar:hover i { opacity: 1; filter: brightness(1.12) drop-shadow(0 0 6px rgba(214, 177, 96, .6)); }
.bs-trend .bar.today i { background: linear-gradient(180deg, #7ef0bd, #1f8a63); }
[data-animate="1"] .bs-trend .bar i { animation: bs-grow .7s var(--ease) both; }
@keyframes bs-grow { from { transform: scaleY(0); } to { transform: none; } }
.bs-trend-axis { display: flex; justify-content: space-between; margin-top: 8px; font-size: .76rem; color: var(--ink-faint); }
.bs-trend-axis b { color: #16204a; }

/* branch cards */
.bs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 18px; }
.bs-card {
    position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 14px; padding: 20px 20px 16px; border-radius: 20px;
    background: radial-gradient(120% 80% at 100% 0%, rgba(214, 177, 96, .10), transparent 55%), linear-gradient(180deg, #fffdf7, #fff 160px);
    border: 1px solid #ece3cc; box-shadow: 0 1px 0 rgba(214, 177, 96, .2), 0 18px 40px -30px rgba(13, 22, 52, .45);
    transition: transform .25s var(--ease), box-shadow .25s;
}
.bs-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: linear-gradient(90deg, #1b2f6e, #c9a255 35%, #f1dfa6 50%, #c9a255 65%, #1b2f6e); }
.bs-card:hover { transform: translateY(-4px); box-shadow: 0 0 0 1px rgba(214, 177, 96, .45), 0 26px 46px -28px rgba(13, 22, 52, .55); }
.bs-card.idle { opacity: .72; }
.bs-card header { display: flex; align-items: center; gap: 12px; }
.bs-rank {
    flex: 0 0 38px; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: .9rem;
    background: #f3eee2; color: #7a5c1e; box-shadow: inset 0 0 0 1px #e6d3a0;
}
.bs-rank.r1 { background: linear-gradient(135deg, #f6e7b4, #c9a255 60%, #94702d); color: #2a1f08; box-shadow: 0 0 0 3px rgba(214, 177, 96, .25), 0 6px 14px -4px rgba(201, 162, 85, .8); }
.bs-rank.r2 { background: linear-gradient(135deg, #f4f6fa, #c3cad6 60%, #8e98aa); color: #2a3142; }
.bs-rank.r3 { background: linear-gradient(135deg, #f3c9a0, #c9864a 60%, #8d5426); color: #2b1606; }
.bs-name { min-width: 0; flex: 1; }
.bs-name h3 { margin: 0; font-size: 1rem; font-weight: 800; line-height: 1.25; color: #16204a; overflow-wrap: anywhere; }
.bs-name small { font-size: .74rem; color: var(--ink-faint); }
.bs-amount { font-family: 'Cormorant Garamond', Georgia, serif; font-weight: 700; font-size: 2.3rem; line-height: 1; color: #16204a; font-variant-numeric: lining-nums tabular-nums; }
.bs-share { display: flex; align-items: center; gap: 10px; margin-top: -4px; }
.bs-share .track { flex: 1; height: 8px; border-radius: 999px; background: #f3eee2; overflow: hidden; box-shadow: inset 0 1px 2px rgba(13, 22, 52, .1); }
.bs-share .track i { display: block; height: 100%; width: 0; border-radius: 999px; background: linear-gradient(90deg, #2b4fb0, #c9a255); transition: width 1.1s var(--ease); }
.bs-share span { font-size: .76rem; font-weight: 700; color: #7a5c1e; white-space: nowrap; }
.bs-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 0; }
.bs-stats > div { padding: 9px 8px; border-radius: 12px; background: #fbf7ec; border: 1px solid #f1e6c8; min-width: 0; text-align: center; }
.bs-stats dt { font-size: .62rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-faint); white-space: nowrap; }
.bs-stats dd { margin: 2px 0 0; font-weight: 800; font-size: .92rem; color: #16204a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.bs-pay-bar { display: flex; height: 10px; border-radius: 999px; overflow: hidden; background: #f3eee2; }
.bs-pay-bar i { display: block; height: 100%; }
.bs-pay ul { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 5px; }
.bs-pay li { display: flex; align-items: center; gap: 8px; font-size: .82rem; color: var(--ink-soft); }
.bs-pay .dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.bs-pay li b { margin-left: auto; color: #16204a; font-variant-numeric: tabular-nums; }
.bs-pay li em { font-style: normal; font-size: .72rem; color: var(--ink-faint); min-width: 56px; text-align: right; }
.bs-card footer { margin-top: auto; padding-top: 12px; border-top: 1px dashed #ecdcae; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.bs-foot-info { display: flex; flex-direction: column; gap: 3px; min-width: 0; font-size: .76rem; color: var(--ink-soft); }
.bs-foot-info span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bs-foot-info i { color: #c9a255; margin-right: 6px; }
.bs-view {
    flex-shrink: 0; display: inline-flex; align-items: center; padding: 7px 12px 7px 14px; border-radius: 12px; font-size: .8rem; font-weight: 800;
    color: #f6e7b4; background: linear-gradient(140deg, #24397f, #0f1a40); box-shadow: 0 0 0 1px rgba(214, 177, 96, .5), 0 8px 16px -10px rgba(13, 22, 52, .8);
}
.bs-view:hover { color: #fff; filter: brightness(1.15); }
[data-animate="1"] .bs-card { animation: rise .45s var(--ease) both; }
[data-animate="1"] .bs-card:nth-child(2) { animation-delay: .05s; } [data-animate="1"] .bs-card:nth-child(3) { animation-delay: .1s; }
[data-animate="1"] .bs-card:nth-child(4) { animation-delay: .15s; } [data-animate="1"] .bs-card:nth-child(n+5) { animation-delay: .2s; }

@media (max-width: 1399.98px) { .bs-totals { grid-template-columns: repeat(3, minmax(0, 1fr)); } .bs-total.bs-total-main { grid-column: 1 / -1; } }
@media (max-width: 767.98px) {
    .bs-hero { padding: 24px 20px; } .bs-hero h1 { font-size: 2.3rem; }
    .bs-totals { grid-template-columns: 1fr 1fr; } .bs-grid { grid-template-columns: 1fr; }
    .bs-stats { grid-template-columns: 1fr 1fr; }
}
@media (prefers-reduced-motion: reduce) { .bs-trend .bar i, .bs-card { animation: none !important; } }

/* ==========================================================================
   Opening stock page (royal theme)
   ========================================================================== */
.min-w-0 { min-width: 0; }
.os-steps { list-style: none; display: flex; flex-wrap: wrap; gap: 10px; margin: 22px 0 0; padding: 0; counter-reset: s; }
.os-steps li {
    display: flex; align-items: center; gap: 10px; padding: 7px 16px 7px 7px; border-radius: 999px; font-size: .86rem; font-weight: 700;
    color: rgba(248, 242, 226, .65); background: rgba(255, 255, 255, .05); border: 1px solid rgba(214, 177, 96, .25);
}
.os-steps li span {
    width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: .82rem;
    background: rgba(255, 255, 255, .08); box-shadow: inset 0 0 0 1px rgba(214, 177, 96, .45); color: #e6d3a0;
}
.os-steps li.active { color: #fff; border-color: rgba(214, 177, 96, .7); background: rgba(214, 177, 96, .14); }
.os-steps li.active span { color: #24190a; background: linear-gradient(135deg, #f1dfa6, #c9a255 60%, #94702d); box-shadow: 0 0 0 3px rgba(214, 177, 96, .25); }
.os-steps li.done { color: #bdf3d9; }
.os-steps li.done span { color: #fff; background: #1f8a63; box-shadow: none; }
.os-steps li.ready { color: #bdf3d9; border-color: rgba(126, 240, 189, .5); }
.os-steps li.ready span { color: #fff; background: linear-gradient(135deg, #2bb383, #1f8a63); }

.os-drop {
    position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center;
    padding: 34px 20px; border-radius: 18px; cursor: pointer;
    border: 2px dashed #dcc996; background: radial-gradient(120% 120% at 50% 0%, #fffaf0, #fffdf8 70%);
    transition: border-color .2s, background .2s, box-shadow .2s;
}
.os-drop input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.os-drop:hover, .os-drop.drag { border-color: #c9a255; background: #fff7e3; box-shadow: 0 0 0 5px rgba(214, 177, 96, .14); }
.os-drop.has-file { border-style: solid; border-color: #1f8a63; background: #f1fbf6; }
.os-drop.is-invalid { border-color: var(--danger); background: #fff6f6; }
.os-drop-ico {
    width: 60px; height: 60px; border-radius: 18px; display: grid; place-items: center; font-size: 1.7rem; color: #f6e7b4;
    background: linear-gradient(140deg, #24397f, #0f1a40); box-shadow: 0 0 0 1px rgba(214, 177, 96, .55), 0 12px 24px -12px rgba(13, 22, 52, .7);
}
.os-drop.has-file .os-drop-ico { background: linear-gradient(140deg, #2bb383, #1f8a63); color: #fff; }
.os-drop-title { font-weight: 800; color: #16204a; margin-top: 6px; overflow-wrap: anywhere; }
.os-drop-sub { font-size: .8rem; color: var(--ink-faint); }

.os-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.os-mode {
    position: relative; display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 14px; cursor: pointer;
    border: 1px solid #ece3cc; background: #fff; transition: border-color .2s, box-shadow .2s, background .2s;
}
.os-mode input { position: absolute; opacity: 0; }
.os-mode-ico { flex: 0 0 36px; width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; background: #f6f0e1; color: #94702d; font-size: 1rem; }
.os-mode b { display: block; color: #16204a; font-size: .92rem; }
.os-mode small { display: block; color: var(--ink-soft); font-size: .78rem; line-height: 1.4; margin-top: 2px; }
.os-mode:hover { border-color: #e6d3a0; }
.os-mode:has(input:checked) { border-color: #c9a255; background: #fffaf0; box-shadow: 0 0 0 4px rgba(214, 177, 96, .16); }
.os-mode:has(input:checked) .os-mode-ico { color: #24190a; background: linear-gradient(135deg, #f1dfa6, #c9a255 60%, #94702d); }
.os-mode:has(input:focus-visible) { outline: 2px solid var(--primary); outline-offset: 2px; }
.os-go { border-radius: 14px; font-weight: 800; padding: .7rem 1.4rem; display: inline-flex; align-items: center; gap: 8px; }

.os-how { margin: 0; padding-left: 1.1rem; display: grid; gap: 10px; font-size: .86rem; color: var(--ink-soft); }
.os-how li::marker { color: #c9a255; font-weight: 800; }
.os-how b { color: #16204a; }
.os-recent { display: grid; gap: 12px; }
.os-recent-item { display: flex; gap: 10px; align-items: flex-start; }
.os-recent-item .dot { flex: 0 0 10px; width: 10px; height: 10px; border-radius: 50%; margin-top: 6px; background: linear-gradient(135deg, #f1dfa6, #c9a255); box-shadow: 0 0 0 3px rgba(214, 177, 96, .18); }

.os-file { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.os-file-info { display: flex; gap: 14px; align-items: center; min-width: 0; flex: 1; }
.os-file-ico { flex: 0 0 52px; width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; font-size: 1.5rem; color: #fff; background: linear-gradient(140deg, #2bb383, #1f8a63); box-shadow: 0 10px 20px -10px rgba(31, 138, 99, .8); }
.os-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.os-chips span { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: .76rem; font-weight: 700; background: #f7f0de; color: #7a5c1e; border: 1px solid #ecdcae; }
.royal .kpi .value.os-money { font-size: 1.6rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.os-submit { border-radius: 12px; font-weight: 800; padding: .55rem 1.1rem; box-shadow: 0 10px 20px -12px rgba(31, 138, 99, .9); }

.os-alert { display: flex; gap: 12px; align-items: flex-start; padding: 14px 18px; border-radius: 16px; margin-bottom: 20px; font-size: .9rem; }
.os-alert > i { flex: 0 0 34px; width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; color: #fff; font-size: 1rem; }
.os-alert.ok { background: radial-gradient(120% 160% at 0% 0%, #dcf5e9, #f4fcf8 60%); border: 1px solid #bfe8d4; color: #0f5c3e; }
.os-alert.ok > i { background: linear-gradient(140deg, #2bb383, #1f8a63); }
.os-alert.bad { background: radial-gradient(120% 160% at 0% 0%, #fde3e5, #fff6f6 60%); border: 1px solid #f5c6ca; color: #8f1d26; }
.os-alert.bad > i { background: linear-gradient(140deg, #e8696f, #b3242f); }
.os-alert > div { padding-top: 6px; }

.os-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.os-seg { display: inline-flex; padding: 3px; border-radius: 12px; background: #f6f0e1; border: 1px solid #ecdcae; }
.os-seg button { border: 0; background: transparent; padding: 5px 12px; border-radius: 9px; font-size: .8rem; font-weight: 700; color: #7a5c1e; }
.os-seg button b { font-weight: 800; margin-left: 3px; }
.os-seg button.active { background: #fff; color: #16204a; box-shadow: 0 2px 6px rgba(13, 22, 52, .1); }
.os-search { position: relative; }
.os-search i { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--ink-faint); font-size: .85rem; }
.os-search .form-control { padding-left: 32px; min-width: 240px; height: 36px; border-radius: 11px; }
.os-table-wrap { max-height: 70vh; overflow: auto; }
.os-table { margin: 0; }
.os-table thead th {
    position: sticky; top: 0; z-index: 1; background: #fbf7ec; color: #7a5c1e; font-size: .7rem; font-weight: 800; letter-spacing: .08em;
    text-transform: uppercase; border-bottom: 1px solid #ecdcae; white-space: nowrap; padding: 11px 12px;
}
.os-table td { padding: 10px 12px; vertical-align: middle; border-color: #f3ecda; }
.os-table tbody tr:hover td { background: #fffaf0; }
.os-table tr.is-error td { background: #fff7f7; }
.os-table tr.is-error td:first-child { box-shadow: inset 3px 0 0 var(--danger); }
.os-pill { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; font-size: .72rem; font-weight: 800; white-space: nowrap; }
.os-pill.ok { background: #dff5ea; color: #0f7a52; }
.os-pill.warn { background: #fff1d6; color: #9a6a00; }
.os-pill.info { background: #e1f2fb; color: #0c6e9e; }
.os-pill.muted { background: #f1f3f8; color: #5f6b85; }
.os-err { display: flex; gap: 6px; align-items: flex-start; color: #b3242f; font-weight: 600; line-height: 1.35; }
.os-err + .os-err { margin-top: 4px; }
.os-err i { margin-top: 2px; }
@media (max-width: 767.98px) { .os-modes { grid-template-columns: 1fr; } .os-search .form-control { min-width: 0; width: 100%; } }

/* ==========================================================================
   Database cleanup page (Super Admin)
   ========================================================================== */
.dbc-hero { background:
        radial-gradient(55% 110% at 90% 10%, rgba(224, 68, 79, .22), transparent 62%),
        radial-gradient(45% 80% at 0% 0%, rgba(58, 98, 214, .5), transparent 66%),
        linear-gradient(135deg, #0a1230 0%, #13214f 55%, #2a1838 100%); }
.dbc-badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 11px; border-radius: 999px; font-size: .74rem; font-weight: 800; color: #24190a; background: linear-gradient(135deg, #f1dfa6, #c9a255); }
.dbc-warn { display: flex; gap: 12px; align-items: flex-start; max-width: 430px; padding: 12px 16px; border-radius: 14px; font-size: .84rem; color: #ffe1e3; background: rgba(224, 68, 79, .16); border: 1px solid rgba(255, 140, 148, .45); }
.dbc-warn i { font-size: 1.4rem; color: #ff8c94; }
.dbc-toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 16px; }
.dbc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 10px; }
.dbc-table {
    display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; cursor: pointer;
    border: 1px solid #ece3cc; background: #fff; transition: border-color .15s, background .15s, box-shadow .15s;
}
.dbc-table:hover { border-color: #e6d3a0; box-shadow: 0 8px 18px -14px rgba(13, 22, 52, .5); }
.dbc-table .dbc-check { flex-shrink: 0; width: 1.15rem; height: 1.15rem; margin: 0; }
.dbc-table.on { border-color: #e0444f; background: #fff6f6; box-shadow: 0 0 0 3px rgba(224, 68, 79, .12); }
.dbc-table.on .dbc-check:checked { background-color: #e0444f; border-color: #e0444f; }
.dbc-table.auto.on::after { content: 'auto'; font-size: .62rem; font-weight: 800; text-transform: uppercase; color: #b3242f; background: #fde7e9; padding: 1px 6px; border-radius: 6px; }
.dbc-table.locked { cursor: not-allowed; background: #f8f9fc; opacity: .8; }
.dbc-table.locked .dbc-check { color: var(--ink-faint); text-align: center; }
.dbc-table.empty .dbc-count b { color: var(--ink-faint); }
.dbc-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.dbc-name { font-weight: 800; color: #16204a; font-size: .9rem; line-height: 1.25; }
.dbc-body code { font-size: .72rem; color: var(--ink-faint); background: none; padding: 0; }
.dbc-needs { font-size: .7rem; color: #9a6a00; margin-top: 2px; overflow-wrap: anywhere; }
.dbc-needs i { margin-right: 3px; }
.dbc-count { text-align: right; flex-shrink: 0; }
.dbc-count b { display: block; font-family: 'Cormorant Garamond', Georgia, serif; font-size: 1.35rem; line-height: 1; color: #16204a; font-variant-numeric: lining-nums tabular-nums; }
.dbc-count small { font-size: .68rem; color: var(--ink-faint); }
.dbc-confirm {
    position: sticky; bottom: 12px; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px;
    padding: 14px 18px; border-radius: 18px; color: #f8f2e2;
    background: linear-gradient(135deg, #0a1230, #2a1838); box-shadow: 0 20px 40px -20px rgba(10, 18, 48, .8), 0 0 0 1px rgba(214, 177, 96, .35);
}
.dbc-sum div { font-weight: 800; font-size: 1rem; }
.dbc-sum span { color: #f1dfa6; }
.dbc-sum small { color: rgba(248, 242, 226, .7); }
.dbc-fields { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-start; }
.dbc-fields .form-control { width: 170px; height: 42px; border-radius: 12px; }
.dbc-unlocked { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 12px; }
.dbc-unlocked > span { display: inline-flex; align-items: center; gap: 7px; padding: 5px 12px; border-radius: 999px; font-size: .84rem; font-weight: 700; color: #bdf3d9; background: rgba(31, 138, 99, .22); border: 1px solid rgba(126, 240, 189, .4); }
.dbc-unlocked b { font-variant-numeric: tabular-nums; color: #fff; }
.dbc-lock code { background: rgba(255, 255, 255, .6); padding: 1px 6px; border-radius: 6px; color: #8f1d26; }
.dbc-backups { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.dbc-backup { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; border: 1px solid #ece3cc; background: #fffdf8; color: #16204a; transition: border-color .15s, box-shadow .15s; }
.dbc-backup:hover { color: #16204a; border-color: #c9a255; box-shadow: 0 10px 22px -16px rgba(13, 22, 52, .6); }
.dbc-backup > i:first-child { font-size: 1.5rem; color: #c9a255; }
.dbc-backup b { display: block; font-size: .88rem; }
.dbc-backup small { display: block; font-size: .72rem; color: var(--ink-faint); overflow-wrap: anywhere; }
.dbc-backup .bi-download { color: #2b4fb0; }
.dbc-go { height: 42px; border-radius: 12px; font-weight: 800; display: inline-flex; align-items: center; gap: 8px; padding: 0 18px; }

/* ==========================================================================
   Database backup page (Super Admin)
   ========================================================================== */
.dbk-go { border-radius: 14px; font-weight: 800; padding: .75rem 1.4rem; display: inline-flex; align-items: center; gap: 8px; }
.dbk-hint { font-size: .74rem; color: rgba(248, 242, 226, .65); margin-top: 6px; text-align: center; }
.dbk-list { display: grid; gap: 10px; }
.dbk-item { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 16px; border: 1px solid #ece3cc; background: #fffdf8; transition: border-color .15s, box-shadow .15s; }
.dbk-item:hover { border-color: #e6d3a0; box-shadow: 0 10px 22px -18px rgba(13, 22, 52, .6); }
.dbk-item.fresh { border-color: #1f8a63; background: #f3fcf8; box-shadow: 0 0 0 4px rgba(31, 138, 99, .12); }
.dbk-ico { flex: 0 0 46px; width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; font-size: 1.3rem; color: #f6e7b4; background: linear-gradient(140deg, #24397f, #0f1a40); box-shadow: 0 0 0 1px rgba(214, 177, 96, .55); }
.dbk-item.fresh .dbk-ico { color: #fff; background: linear-gradient(140deg, #2bb383, #1f8a63); }
.dbk-info { flex: 1; min-width: 0; }
.dbk-when { font-weight: 800; color: #16204a; }
.dbk-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .78rem; color: var(--ink-soft); margin-top: 2px; }
.dbk-meta i { color: #c9a255; margin-right: 5px; }
.dbk-info code { font-size: .7rem; color: var(--ink-faint); background: none; padding: 0; overflow-wrap: anywhere; }
.dbk-actions { display: flex; gap: 6px; flex-shrink: 0; }
.dbk-dl { font-weight: 800; color: #f6e7b4; background: linear-gradient(140deg, #24397f, #0f1a40); box-shadow: 0 0 0 1px rgba(214, 177, 96, .5); border-radius: 10px; }
.dbk-dl:hover { color: #fff; filter: brightness(1.15); }
.dbk .os-how code { background: #f6f0e1; padding: 1px 6px; border-radius: 6px; color: #7a5c1e; }
@media (max-width: 575.98px) { .dbk-item { flex-wrap: wrap; } .dbk-actions { width: 100%; justify-content: flex-end; } }

/* ==========================================================================
   Switch to branch (topbar) and the "working as" banner
   ========================================================================== */
.btn-switch {
    display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 16px; border-radius: 12px; font-weight: 700; font-size: .9rem;
    color: #2a1f08; border: 0; white-space: nowrap;
    background: linear-gradient(135deg, #f1dfa6 0%, #c9a255 60%, #a47b2c 100%);
    box-shadow: 0 8px 18px -10px rgba(164, 123, 44, .9), inset 0 1px 0 rgba(255, 255, 255, .5);
}
.btn-switch:hover, .btn-switch:focus-visible, .btn-switch.show { color: #2a1f08; filter: brightness(1.05); }
.btn-switch i { font-size: 1.05rem; }
.switch-menu { width: 340px; max-width: calc(100vw - 32px); padding: 0; border-radius: 16px; overflow: hidden; border: 1px solid #e7dcc2; box-shadow: 0 24px 48px -20px rgba(13, 22, 52, .45); }
.switch-head { padding: 14px 16px 12px; background: linear-gradient(135deg, #0d1634, #1b2f6e); color: #f8f2e2; }
.switch-head strong { display: block; font-size: .95rem; }
.switch-head span { font-size: .78rem; color: #e6d3a0; }
.switch-loading, .switch-empty { padding: 22px 16px; text-align: center; color: var(--ink-soft); font-size: .88rem; }
.switch-empty i { display: block; font-size: 1.6rem; color: #c9a255; margin-bottom: 6px; }
.switch-filter { position: relative; padding: 10px 12px 6px; }
.switch-filter i { position: absolute; left: 24px; top: 50%; transform: translateY(-30%); color: var(--ink-faint); font-size: .85rem; }
.switch-filter input { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 7px 10px 7px 32px; font-size: .86rem; }
.switch-filter input:focus { outline: 2px solid #c9a255; outline-offset: 0; border-color: #c9a255; }
.switch-list { max-height: 340px; overflow-y: auto; padding: 4px 8px 8px; }
.switch-branch { display: flex; align-items: center; gap: 7px; padding: 10px 8px 4px; font-size: .78rem; font-weight: 800; color: #94702d; }
.switch-user { width: 100%; display: flex; align-items: center; gap: 10px; padding: 8px; border: 0; background: none; border-radius: 10px; text-align: left; color: var(--ink); }
.switch-user:hover, .switch-user:focus-visible { background: #fbf7ec; outline: none; }
.switch-user .avatar { width: 32px; height: 32px; flex: none; border-radius: 50%; display: grid; place-items: center; font-size: .74rem; font-weight: 800; color: #f8f2e2; background: linear-gradient(135deg, #1b2f6e, #0d1634); }
.switch-user .who { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
.switch-user .who b { font-size: .88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.switch-user .who small { color: var(--ink-faint); font-size: .74rem; }
.switch-user > i { color: #c9a255; opacity: 0; transition: opacity .15s; }
.switch-user:hover > i, .switch-user:focus-visible > i { opacity: 1; }
.switch-note { padding: 10px 14px; font-size: .74rem; color: var(--ink-soft); background: #fbf7ec; border-top: 1px solid #efe6d0; }
.switch-note i { color: #94702d; }

.switch-banner {
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 16px 28px 0; padding: 10px 14px; border-radius: 14px;
    background: linear-gradient(135deg, #0d1634, #1b2f6e); color: #f8f2e2; box-shadow: inset 0 0 0 1px rgba(201, 162, 85, .45);
}
.switch-banner .crest { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: #2a1f08; background: linear-gradient(135deg, #f1dfa6, #c9a255); flex: none; }
.switch-banner .msg { flex: 1; min-width: 200px; font-size: .9rem; }
.switch-banner .msg b { color: #f1dfa6; }
.switch-banner form { margin: 0; }
@media (max-width: 991.98px) {
    .btn-switch span { display: none; }
    .btn-switch { padding: 0 13px; }
    .switch-banner { margin: 12px 16px 0; }
}

/* ==========================================================================
   Toasts (partials/flash + App.toast) and the inline form alert
   ========================================================================== */
.toast-stack {
    position: fixed; top: 86px; right: 24px; z-index: 2100; width: 400px; max-width: calc(100vw - 32px);
    display: flex; flex-direction: column; gap: 12px; pointer-events: none;
}
.app-toast {
    --t-c: var(--ok); --t-c2: #0a7f52; --t-bg: #e3f7ee;
    position: relative; overflow: hidden; isolation: isolate; pointer-events: auto;
    display: grid; grid-template-columns: 44px minmax(0, 1fr) 30px; gap: 14px; align-items: center;
    padding: 16px 14px 18px 16px; border-radius: 18px;
    background:
        radial-gradient(120% 140% at 0% 0%, color-mix(in srgb, var(--t-c) 13%, transparent) 0%, transparent 55%),
        linear-gradient(180deg, rgba(255, 255, 255, .98), rgba(255, 255, 255, .94));
    color: var(--ink);
    border: 1px solid color-mix(in srgb, var(--t-c) 24%, #e7ebf3);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, .9) inset,
        0 2px 6px rgba(13, 22, 52, .06),
        0 22px 48px -18px color-mix(in srgb, var(--t-c) 42%, rgba(13, 22, 52, .35));
    backdrop-filter: blur(14px) saturate(1.4);
    -webkit-backdrop-filter: blur(14px) saturate(1.4);
}
/* soft glow in the corner */
.app-toast::after {
    content: ''; position: absolute; z-index: -1; right: -40px; top: -60px; width: 160px; height: 160px; border-radius: 50%;
    background: radial-gradient(circle, color-mix(in srgb, var(--t-c) 16%, transparent) 0%, transparent 70%);
    pointer-events: none;
}
.app-toast.t-error { --t-c: var(--danger); --t-c2: #b3242f; --t-bg: #fde7e9; }
.app-toast.t-warning { --t-c: var(--warn); --t-c2: #b97700; --t-bg: #fff2d8; }
.app-toast.t-info { --t-c: var(--info); --t-c2: #0c6e9e; --t-bg: #e1f2fb; }

.app-toast .t-icon {
    width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; align-self: start;
    font-size: 1.25rem; color: #fff;
    background: linear-gradient(140deg, var(--t-c) 0%, var(--t-c2) 100%);
    box-shadow: 0 0 0 5px color-mix(in srgb, var(--t-c) 13%, transparent), 0 8px 18px -6px color-mix(in srgb, var(--t-c) 70%, transparent);
}
.app-toast .t-body { min-width: 0; }
.app-toast .t-title { font-weight: 800; font-size: .95rem; line-height: 1.3; letter-spacing: -.005em; color: color-mix(in srgb, var(--t-c2) 55%, var(--ink)); }
.app-toast .t-msg { font-size: .86rem; color: var(--ink-soft); line-height: 1.5; margin-top: 3px; overflow-wrap: anywhere; }
.app-toast .t-close {
    width: 30px; height: 30px; border: 0; border-radius: 50%; align-self: start;
    background: rgba(23, 32, 51, .04); color: var(--ink-faint);
    display: grid; place-items: center; font-size: .78rem; transition: background .15s, color .15s, transform .15s;
}
.app-toast .t-close:hover, .app-toast .t-close:focus-visible {
    background: color-mix(in srgb, var(--t-c) 14%, white); color: var(--t-c2); transform: rotate(90deg); outline: none;
}
.app-toast .t-timer {
    position: absolute; left: 0; right: 0; bottom: 0; height: 4px; transform-origin: left;
    background: linear-gradient(90deg, var(--t-c), var(--t-c2));
    border-radius: 0 4px 4px 0; opacity: .85;
}
.app-toast .t-timer::before { content: ''; position: absolute; inset: 0; background: color-mix(in srgb, var(--t-c) 12%, transparent); z-index: -1; }
.app-toast.sticky .t-timer { display: none; }
.app-toast.sticky { border-bottom-width: 3px; border-bottom-color: var(--t-c); }   /* errors stay until closed */
.app-toast:not(.sticky) .t-timer { animation: t-timer var(--t-time, 4500ms) linear forwards; }
.app-toast.paused .t-timer { animation-play-state: paused; }
@keyframes t-timer { from { transform: scaleX(1); } to { transform: scaleX(0); } }

[data-animate="1"] .app-toast { animation: t-in .55s cubic-bezier(.16, 1.2, .3, 1) both; }
[data-animate="1"] .app-toast .t-icon { animation: t-pop .6s .12s cubic-bezier(.2, 1.6, .4, 1) both; }
[data-animate="1"] .app-toast:not(.leaving) .t-icon::after {
    content: ''; position: absolute; inset: 0; border-radius: inherit;
    border: 2px solid var(--t-c); animation: t-ring 1.1s .25s ease-out both; pointer-events: none;
}
[data-animate="1"] .app-toast .t-icon { position: relative; }
[data-animate="1"] .app-toast.leaving { animation: t-out .3s ease-in forwards; }
@keyframes t-in { from { opacity: 0; transform: translateX(40px) scale(.94); filter: blur(4px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes t-out { to { opacity: 0; transform: translateX(40px) scale(.96); filter: blur(2px); } }
@keyframes t-pop { from { transform: scale(.4) rotate(-12deg); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes t-ring { from { opacity: .6; transform: scale(1); } to { opacity: 0; transform: scale(1.6); } }
@media (prefers-reduced-motion: reduce) {
    .app-toast, .app-toast.leaving, .app-toast .t-icon, .app-toast .t-icon::after { animation: none !important; }
    .app-toast .t-timer { display: none; }
}
@media (max-width: 575.98px) {
    .toast-stack { top: 12px; right: 12px; left: 12px; width: auto; max-width: none; }
    .app-toast { grid-template-columns: 38px minmax(0, 1fr) 28px; gap: 12px; padding: 13px 12px 15px 13px; border-radius: 16px; }
    .app-toast .t-icon { width: 38px; height: 38px; border-radius: 12px; font-size: 1.1rem; }
    [data-animate="1"] .app-toast { animation-name: t-in-top; }
    @keyframes t-in-top { from { opacity: 0; transform: translateY(-24px) scale(.96); } to { opacity: 1; transform: none; } }
}
@media print { .toast-stack { display: none; } }

/* validation summary above a form: compact, stays in place, same look as the error toast */
.form-alert {
    position: relative; overflow: hidden;
    display: flex; gap: 12px; align-items: flex-start; margin-bottom: 18px; padding: 13px 16px; border-radius: 14px;
    background: radial-gradient(120% 160% at 0% 0%, #fde3e5 0%, #fff6f6 60%);
    border: 1px solid #f5c6ca; color: #8f1d26; font-size: .88rem;
    box-shadow: 0 10px 28px -18px rgba(224, 68, 79, .55);
}
.form-alert > i {
    flex: 0 0 32px; width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center;
    font-size: 1rem; color: #fff; background: linear-gradient(140deg, var(--danger), #b3242f);
    box-shadow: 0 0 0 4px rgba(224, 68, 79, .12);
}
.form-alert > div { padding-top: 5px; }
.form-alert strong { font-weight: 800; }
.form-alert ul { margin: 4px 0 0; padding-left: 1.1rem; }
.form-alert li { margin: 1px 0; }

/* ------------------------------------------------------------------ filter bar: reset + date range */
.filter-bar .filter-reset { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-soft); border: 1px solid var(--line-strong); background: var(--surface); }
.filter-bar .filter-reset:hover { color: var(--primary); border-color: var(--primary); background: var(--primary-soft); }
.date-range-field { position: relative; min-width: 250px; }
.date-range-field .form-control { width: 100%; padding-left: 2.3rem; padding-right: 2rem; cursor: pointer; background-color: var(--surface); }
.date-range-field .drf-icon { position: absolute; left: .85rem; top: 50%; transform: translateY(-50%); color: var(--primary); pointer-events: none; }
.date-range-field .drf-clear { position: absolute; right: .55rem; top: 50%; transform: translateY(-50%); border: 0; background: none; padding: 0 .2rem; color: var(--ink-faint); line-height: 1; }
.date-range-field .drf-clear:hover { color: var(--danger); }
input.flatpickr-input[readonly]:not(:disabled) { background-color: var(--surface); cursor: pointer; }

/* ------------------------------------------------------------------ flatpickr calendar (matches the app) */
.flatpickr-calendar { border-radius: 16px; border: 1px solid var(--line); box-shadow: 0 24px 50px -18px rgba(13, 20, 40, .35); font-family: inherit; padding: 6px; }
.flatpickr-calendar.arrowTop::before, .flatpickr-calendar.arrowTop::after, .flatpickr-calendar.arrowBottom::before, .flatpickr-calendar.arrowBottom::after { display: none; }
.flatpickr-months { padding: 4px 2px 2px; }
.flatpickr-months .flatpickr-month { height: 40px; color: var(--ink); }
.flatpickr-current-month { font-size: 1rem; font-weight: 700; padding-top: 8px; }
.flatpickr-current-month .flatpickr-monthDropdown-months { font-weight: 700; border-radius: 8px; }
.flatpickr-months .flatpickr-prev-month, .flatpickr-months .flatpickr-next-month { top: 8px; border-radius: 10px; padding: 8px 10px; height: auto; }
.flatpickr-months .flatpickr-prev-month:hover, .flatpickr-months .flatpickr-next-month:hover { background: var(--primary-soft); }
.flatpickr-months .flatpickr-prev-month:hover svg, .flatpickr-months .flatpickr-next-month:hover svg { fill: var(--primary); }
span.flatpickr-weekday { color: var(--ink-faint); font-weight: 700; font-size: .78rem; }
.flatpickr-day { border-radius: 10px; color: var(--ink); font-weight: 500; }
.flatpickr-day:hover, .flatpickr-day:focus { background: var(--primary-soft); border-color: transparent; }
.flatpickr-day.today { border-color: var(--primary); }
.flatpickr-day.today:hover { background: var(--primary-soft); color: var(--ink); }
.flatpickr-day.selected, .flatpickr-day.startRange, .flatpickr-day.endRange,
.flatpickr-day.selected:hover, .flatpickr-day.startRange:hover, .flatpickr-day.endRange:hover { background: var(--primary); border-color: var(--primary); color: #fff; }
.flatpickr-day.inRange { background: var(--primary-soft); border-color: var(--primary-soft); box-shadow: -5px 0 0 var(--primary-soft), 5px 0 0 var(--primary-soft); color: var(--ink); }
.flatpickr-day.flatpickr-disabled, .flatpickr-day.prevMonthDay, .flatpickr-day.nextMonthDay { color: var(--ink-faint); }
.flatpickr-day.flatpickr-disabled { opacity: .45; }
.drf-presets { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px 6px 10px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
.drf-presets button { border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); border-radius: 999px; font-size: .78rem; font-weight: 600; padding: 4px 11px; }
.drf-presets button:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
@media (max-width: 575.98px) { .date-range-field { min-width: 0; flex: 1 1 100%; } }
@media print { .flatpickr-calendar { display: none !important; } }

/* ==========================================================================
   Form controls — clean, modern look (text boxes, text areas, dropdowns, Tom Select)
   Placed last so it wins over the earlier, older rules.
   ========================================================================== */
:root {
    --field-bg: #ffffff;
    --field-border: #dde3ee;
    --field-border-hover: #bfc8da;
    --field-radius: 12px;
    --field-h: 44px;
    --field-shadow: 0 1px 2px rgba(16, 24, 40, .05);
    --field-ring: 0 0 0 4px color-mix(in srgb, var(--primary) 14%, transparent);
    --field-chevron: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%2367728a' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.8' d='m4 6 4 4 4-4'/%3e%3c/svg%3e");
}

.form-label { font-size: .82rem; font-weight: 600; color: #344054; letter-spacing: .01em; margin-bottom: 6px; }
.form-text { font-size: .78rem; color: var(--ink-faint); margin-top: 5px; }

.form-control, .form-select {
    background-color: var(--field-bg);
    border: 1px solid var(--field-border);
    border-radius: var(--field-radius);
    min-height: var(--field-h);
    padding: .6rem .9rem;
    font-size: .94rem;
    line-height: 1.45;
    color: var(--ink);
    box-shadow: var(--field-shadow);
    transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}
.form-control::placeholder { color: #a3acbf; opacity: 1; }
.form-control:hover:not(:disabled):not(:focus), .form-select:hover:not(:disabled):not(:focus) { border-color: var(--field-border-hover); }
.form-control:focus, .form-select:focus { background-color: #fff; border-color: var(--primary); box-shadow: var(--field-ring); outline: 0; }

textarea.form-control { min-height: 100px; resize: vertical; }
textarea.form-control[rows="1"] { min-height: var(--field-h); }

.form-select {
    --bs-form-select-bg-img: var(--field-chevron);
    padding-right: 2.6rem;
    background-position: right .85rem center;
    background-size: 16px 16px;
    cursor: pointer;
}

/* sizes */
.form-control-sm, .form-select-sm { min-height: 36px; padding: .38rem .7rem; font-size: .86rem; border-radius: 10px; }
.form-select-sm { padding-right: 2.2rem; background-position: right .6rem center; }
.form-control-lg, .form-select-lg { min-height: 50px; padding: .75rem 1rem; font-size: 1rem; border-radius: 14px; }

/* states */
.form-control:disabled, .form-select:disabled { background-color: #f4f6fa; color: var(--ink-soft); box-shadow: none; cursor: not-allowed; }
.form-control[readonly]:not(.flatpickr-input):not([type="file"]) { background-color: #f8f9fc; }
.form-control[readonly]:not(.flatpickr-input):focus { box-shadow: none; border-color: var(--field-border-hover); }
.form-control.is-invalid, .form-select.is-invalid, .was-validated .form-control:invalid { border-color: var(--danger); background-color: #fff; }
.form-control.is-invalid:focus, .form-select.is-invalid:focus { box-shadow: 0 0 0 4px color-mix(in srgb, var(--danger) 14%, transparent); }
.invalid-feedback { font-size: .78rem; font-weight: 500; margin-top: 5px; }

/* file and colour pickers */
.form-control[type="file"] { padding: .28rem .35rem; line-height: 1.75; }
.form-control::file-selector-button {
    border: 0; border-radius: 8px; margin: 0 .75rem 0 0; padding: .35rem .85rem;
    height: auto; background: var(--primary-soft); color: var(--primary); font-weight: 600; transition: background .15s;
}
.form-control:hover:not(:disabled)::file-selector-button { background: color-mix(in srgb, var(--primary) 20%, white); }
.form-control-color { min-height: var(--field-h); padding: .35rem; }

/* input groups: one rounded box */
.input-group > .form-control, .input-group > .form-select { box-shadow: none; }
.input-group-text { background: #f6f8fc; border-color: var(--field-border); color: var(--ink-soft); border-radius: var(--field-radius); padding: 0 .85rem; }
.input-group > .btn { border-radius: var(--field-radius); }
.input-group:not(.input-group-sm) > .btn { min-height: var(--field-h); }
.input-group:focus-within { border-radius: var(--field-radius); box-shadow: var(--field-ring); }
.input-group:focus-within > .form-control { box-shadow: none; }

/* checkboxes, radios, switches */
.form-check-input { border: 1.5px solid #c3cbdb; width: 1.15em; height: 1.15em; margin-top: .2em; transition: background-color .15s, border-color .15s, box-shadow .15s; }
.form-check-input[type="checkbox"] { border-radius: 6px; }
.form-check-input:focus { border-color: var(--primary); box-shadow: var(--field-ring); }
.form-check-input:checked { background-color: var(--primary); border-color: var(--primary); }
.form-switch .form-check-input { width: 2.5em; height: 1.4em; margin-top: .1em; border-radius: 2em; border-color: #c3cbdb; background-color: #e4e8f0; cursor: pointer;
    --bs-form-switch-bg: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23fff'/%3e%3c/svg%3e"); }
.form-switch .form-check-input:checked { background-color: var(--primary); border-color: var(--primary); }
.form-check-label { color: var(--ink); }
.form-switch .form-check-label { padding-left: .35rem; }

/* Tom Select (searchable dropdowns) */
.ts-wrapper.form-select, .ts-wrapper.form-control { min-height: var(--field-h); padding: 0 !important; }
.ts-wrapper.form-select.focus, .ts-wrapper.form-control.focus { border-color: var(--primary); box-shadow: var(--field-ring); }
.ts-wrapper.form-select .ts-control, .ts-wrapper.form-control .ts-control { min-height: calc(var(--field-h) - 2px); padding: .55rem 2.6rem .55rem .9rem; border-radius: var(--field-radius); font-size: .94rem; box-shadow: none; }
.ts-wrapper:not(.form-select):not(.form-control) .ts-control {
    min-height: var(--field-h); padding: .55rem 2.4rem .55rem .9rem; font-size: .94rem;
    background-color: var(--field-bg); border: 1px solid var(--field-border); border-radius: var(--field-radius); box-shadow: var(--field-shadow);
}
.ts-wrapper.single:not(.form-select):not(.form-control) .ts-control { background-image: var(--field-chevron); background-repeat: no-repeat; background-position: right .85rem center; background-size: 16px 16px; }
.ts-wrapper:not(.form-select):not(.form-control).focus .ts-control { border-color: var(--primary); box-shadow: var(--field-ring); }
.ts-control > input { font-size: .94rem; }
.ts-control > input::placeholder { color: #a3acbf; }
.ts-dropdown { margin-top: 6px; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 18px 40px -16px rgba(13, 20, 40, .3); overflow: hidden; z-index: 1060; }
.ts-dropdown .ts-dropdown-content { padding: 4px; }
.ts-dropdown .option, .ts-dropdown .no-results, .ts-dropdown .create { padding: .5rem .75rem; border-radius: 8px; font-size: .9rem; }
.ts-dropdown .active { background: var(--primary-soft); color: var(--ink); }
.ts-dropdown .selected { font-weight: 600; color: var(--primary); }
.ts-dropdown .dropdown-input-wrap { padding: 6px; }
.ts-dropdown .dropdown-input { border: 1px solid var(--field-border); border-radius: 10px; padding: .45rem .75rem; }

/* filter bars: a little more compact so a row fits */
.filter-bar .form-control, .filter-bar .form-select { min-height: 42px; }
.filter-bar .btn { min-height: 42px; display: inline-flex; align-items: center; gap: 6px; }

/* ------------------------------------------------------------------ branch login + searchable branch filter */
.switch-user.is-current { background: #fbf7ec; }
.switch-user .avatar .bi { font-size: .9rem; }
.branch-switch .ts-wrapper { min-width: 240px; }
.branch-switch .ts-wrapper.form-select { border-radius: 12px; font-weight: 600; box-shadow: var(--shadow-sm); }
.branch-switch .ts-dropdown { min-width: 260px; }

/* ------------------------------------------------------------------ report summary cards (Sale Detail Report) */
.report-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.report-card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; box-shadow: var(--shadow-sm); }
.report-card .rc-label { font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-faint); }
.report-card .rc-value { font-size: 1.15rem; font-weight: 800; color: var(--ink); margin-top: 4px; word-break: break-word; }
@media print { .report-cards { grid-template-columns: repeat(5, 1fr); } }
