/* ==========================================================================
   High Fly Travels ERP — design system
   Admin-dashboard look: dark sidebar, white top bar, soft cards, gradient KPI cards.
   All colours are tokens below; restyle the whole app by changing them.
   ========================================================================== */
@font-face { font-family: "Roboto"; font-style: normal; font-weight: 400; font-display: swap; src: url("../vendor/roboto/roboto-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Roboto"; font-style: normal; font-weight: 500; font-display: swap; src: url("../vendor/roboto/roboto-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Roboto"; font-style: normal; font-weight: 700; font-display: swap; src: url("../vendor/roboto/roboto-latin-700-normal.woff2") format("woff2"); }

:root {
    --brand: #5e72e4;
    --brand-600: #4b5fd4;
    --brand-50: #eef0fd;
    --accent: #f5a623;

    --bg: #f8f9fe;
    --surface: #ffffff;
    --surface-2: #f8f9fa;
    --border: #e9ecef;
    --input-border: #dee2e6;
    --heading: #32393f;
    --text: #4c5258;
    --text-2: #6c757d;
    --text-3: #9aa1a9;

    --sidebar-bg: #12181a;
    --sidebar-text: rgba(255, 255, 255, .86);
    --sidebar-active: rgba(255, 255, 255, .12);
    --sidebar-label: #a4a8ab;

    --success: #15a362;  --success-bg: #e3f6ec;
    --warning: #b9770e;  --warning-bg: #fff4dd;
    --danger:  #e72e2e;  --danger-bg:  #fde8e8;
    --info:    #0d8bd9;  --info-bg:    #e1f2fc;
    --muted:   #6c757d;  --muted-bg:   #eef0f3;

    --grad-blue: linear-gradient(45deg, #6a11cb, #2575fc);
    --grad-green: linear-gradient(45deg, #00b09b, #96c93d);
    --grad-orange: linear-gradient(45deg, #ee0979, #ff6a00);
    --grad-dark: linear-gradient(to right, #0f2027, #203a43, #2c5364);
    --grad-sky: linear-gradient(45deg, #0575e6, #00c6fb);
    --grad-purple: linear-gradient(45deg, #8e2de2, #da22ff);

    --radius: 10px;
    --radius-sm: 6px;
    --shadow: 0 0 32px rgba(136, 152, 170, .15);
    --shadow-lg: 0 12px 36px rgba(31, 45, 61, .16);
    --sidebar-w: 250px;
    --sidebar-mini: 70px;
    --topbar-h: 60px;
    --font: "Roboto", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

[data-theme="dark"] {
    --brand: #7b8cf0;
    --brand-600: #95a3f4;
    --brand-50: #232a4a;
    --bg: #161c1f;
    --surface: #1e2629;
    --surface-2: #252e32;
    --border: #2f393e;
    --input-border: #3a454b;
    --heading: #e9ecef;
    --text: #c5ccd3;
    --text-2: #9aa4ad;
    --text-3: #77818a;
    --sidebar-bg: #0e1315;
    --success-bg: #123124; --success: #4fd08f;
    --warning-bg: #36290f; --warning: #f2b85a;
    --danger-bg:  #3b1a1d; --danger:  #ff7b7b;
    --info-bg:    #12304a; --info:    #5cb8f2;
    --muted-bg:   #2a3338; --muted:   #a3adb5;
    --shadow: 0 0 24px rgba(0, 0, 0, .35);
    --shadow-lg: 0 12px 36px rgba(0, 0, 0, .5);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 14px; line-height: 1.5; color: var(--text); background: var(--bg); }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0 0 .5rem; line-height: 1.25; font-weight: 500; color: var(--heading); }
h1 { font-size: 1.35rem; }
h2 { font-size: 1.05rem; }
h3 { font-size: .98rem; }
p { margin: 0 0 .75rem; }
hr { border: 0; border-top: 1px solid var(--border); margin: 1rem 0; }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .92em; }
.muted { color: var(--text-2); }
.small { font-size: .85rem; }
.xs { font-size: .78rem; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }
.strong { font-weight: 500; color: var(--heading); }
.hidden { display: none !important; }
.mt-0 { margin-top: 0 !important; } .mt-1 { margin-top: .5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; }
.mb-0 { margin-bottom: 0 !important; } .mb-1 { margin-bottom: .5rem; } .mb-2 { margin-bottom: 1.5rem; }
.gap-1 { gap: .5rem; } .gap-2 { gap: 1rem; }
.flex { display: flex; align-items: center; }
.flex-wrap { flex-wrap: wrap; }
.between { justify-content: space-between; }
.grow { flex: 1; }
.text-success { color: var(--success); } .text-danger { color: var(--danger); } .text-warning { color: var(--warning); }

/* ---------- Layout ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
    width: var(--sidebar-w);
    background: var(--sidebar-bg);
    position: fixed; inset: 0 auto 0 0;
    display: flex; flex-direction: column;
    z-index: 40;
    box-shadow: 0 1.6px 11px rgba(0, 0, 0, .32);
    transition: width .2s ease, transform .2s ease;
}
.sidebar-brand {
    height: var(--topbar-h); flex-shrink: 0;
    display: flex; align-items: center; gap: .6rem;
    padding: 0 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
    color: #e7e9ec; font-weight: 500; font-size: 1.25rem; white-space: nowrap; overflow: hidden;
}
.sidebar-brand a { color: inherit; display: flex; align-items: center; gap: .6rem; text-decoration: none; min-width: 0; }
.sidebar-brand .logo { width: 34px; height: 34px; border-radius: 8px; background: var(--grad-blue); color: #fff; display: grid; place-items: center; font-size: .95rem; flex-shrink: 0; }
.sidebar-brand small { display: block; font-weight: 400; color: var(--sidebar-label); font-size: .7rem; line-height: 1; margin-top: 2px; }
.sidebar-brand .collapse-btn { margin-left: auto; background: none; border: 0; color: #e7e9ec; font-size: 1.05rem; cursor: pointer; padding: .3rem .4rem; border-radius: 4px; }
.sidebar-brand .collapse-btn:hover { background: var(--sidebar-active); }
.sidebar-office {
    margin: .75rem .75rem .1rem; padding: .5rem .7rem;
    border-radius: var(--radius-sm); background: rgba(255, 255, 255, .06);
    display: flex; align-items: center; gap: .55rem; color: #fff; font-size: .85rem; white-space: nowrap; overflow: hidden;
}
.sidebar-office .muted { color: var(--sidebar-label); }
.sidebar-office img { width: 24px; height: 18px; border-radius: 3px; object-fit: cover; flex-shrink: 0; }
.nav { padding: .35rem .65rem 1.2rem; overflow-y: auto; overflow-x: hidden; flex: 1; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.15) transparent; }
.nav-section { margin: 1.1rem .35rem .35rem; font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--sidebar-label); white-space: nowrap; }
.nav a {
    display: flex; align-items: center; gap: .75rem; position: relative;
    padding: .5rem .9rem; border-radius: 4px; margin-bottom: 2px;
    color: var(--sidebar-text); font-size: 14.5px; white-space: nowrap;
    transition: background .15s;
}
.nav a i { width: 20px; text-align: center; font-size: 15px; opacity: .9; flex-shrink: 0; }
.nav a:hover { background: var(--sidebar-active); color: #fff; text-decoration: none; }
.nav a.active { background: var(--sidebar-active); color: #fff; }
.nav .count { margin-left: auto; background: var(--danger); color: #fff; border-radius: 999px; font-size: .68rem; padding: 0 .45rem; font-weight: 700; }

.main { flex: 1; margin-left: var(--sidebar-w); min-width: 0; display: flex; flex-direction: column; min-height: 100vh; transition: margin-left .2s ease; }
.topbar {
    height: var(--topbar-h);
    background: var(--surface);
    box-shadow: var(--shadow);
    display: flex; align-items: center; gap: .6rem;
    padding: 0 1.5rem;
    position: sticky; top: 0; z-index: 30;
}
.topbar .search { flex: 1; max-width: 360px; position: relative; }
.topbar .search i { position: absolute; left: .9rem; top: 50%; transform: translateY(-50%); color: var(--text-3); }
.topbar .search input { padding-left: 2.5rem; border-radius: var(--radius-sm); height: 38px; }
.topbar .divider-v { width: 1px; height: var(--topbar-h); background: var(--border); margin: 0 .25rem; }
.icon-btn {
    width: 40px; height: 40px; border-radius: 50%;
    display: inline-grid; place-items: center; position: relative;
    border: 0; background: transparent; color: var(--heading); cursor: pointer; font-size: 1.12rem;
}
.icon-btn:hover { background: var(--surface-2); }
.icon-btn .dot { position: absolute; top: 2px; right: 0; min-width: 18px; height: 18px; border-radius: 999px; background: var(--danger); color: #fff; font-size: .66rem; font-weight: 700; display: grid; place-items: center; padding: 0 4px; border: 2px solid var(--surface); }
.menu-toggle { display: none; }
.topbar .show-xs { display: none; }
.content { padding: 1.5rem; width: 100%; max-width: 1480px; flex: 1; }
.page-footer { background: var(--surface); border-top: 1px solid var(--border); text-align: center; padding: .55rem 1rem; color: var(--text-2); font-size: .85rem; }
.back-to-top { position: fixed; right: 1.1rem; bottom: 1.1rem; width: 38px; height: 38px; border-radius: 50%; background: var(--brand); color: #fff; border: 0; display: none; place-items: center; cursor: pointer; box-shadow: var(--shadow-lg); z-index: 25; }
.back-to-top.show { display: grid; }

.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--grad-blue); color: #fff; font-weight: 500; font-size: .85rem; display: grid; place-items: center; flex-shrink: 0; }
.user-box { display: flex; align-items: center; gap: .6rem; text-align: left; line-height: 1.2; }
.user-box .nm { color: var(--heading); font-weight: 500; font-size: .92rem; }
.user-box .rl { color: var(--text-2); font-size: .78rem; }

/* Mini sidebar (desktop collapse) */
body.sidebar-mini .sidebar { width: var(--sidebar-mini); }
body.sidebar-mini .main { margin-left: var(--sidebar-mini); }
body.sidebar-mini .sidebar:not(:hover) .nav a { font-size: 0; justify-content: center; padding: .6rem 0; gap: 0; }
body.sidebar-mini .sidebar:not(:hover) .nav a i { font-size: 16px; }
body.sidebar-mini .sidebar:not(:hover) .nav .count { position: absolute; top: 2px; right: 6px; font-size: .6rem; }
body.sidebar-mini .sidebar:not(:hover) .nav-section { font-size: 0; margin: .6rem 0; border-top: 1px solid rgba(255,255,255,.08); }
body.sidebar-mini .sidebar:not(:hover) .sidebar-brand .brand-text, body.sidebar-mini .sidebar:not(:hover) .collapse-btn { display: none; }
body.sidebar-mini .sidebar:not(:hover) .sidebar-office { justify-content: center; padding: .5rem 0; font-size: 0; }
body.sidebar-mini .sidebar:hover { width: var(--sidebar-w); }

/* ---------- Dropdown ---------- */
.dropdown { position: relative; }
.dropdown-toggle { display: flex; align-items: center; gap: .5rem; background: none; border: 0; cursor: pointer; color: var(--heading); padding: .25rem .35rem; border-radius: var(--radius-sm); font: inherit; }
.dropdown-toggle:hover { background: var(--surface-2); }
.dropdown-menu {
    position: absolute; right: 0; top: calc(100% + 10px);
    min-width: 230px; background: var(--surface);
    border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: var(--shadow-lg); padding: .4rem; display: none; z-index: 50;
}
.dropdown-menu.wide { min-width: 320px; }
.dropdown.open .dropdown-menu { display: block; }
.dropdown-menu a, .dropdown-menu button {
    display: flex; align-items: center; gap: .65rem; width: 100%;
    padding: .55rem .7rem; border-radius: var(--radius-sm);
    color: var(--text); background: none; border: 0; font: inherit; cursor: pointer; text-align: left;
}
.dropdown-menu a:hover, .dropdown-menu button:hover { background: var(--surface-2); text-decoration: none; color: var(--heading); }
.dropdown-menu .divider { height: 1px; background: var(--border); margin: .3rem 0; }
.dropdown-menu .head { padding: .5rem .7rem; font-size: .8rem; color: var(--text-2); display: flex; justify-content: space-between; align-items: center; }
.dropdown-menu .head strong { color: var(--heading); font-size: .92rem; font-weight: 500; }
.notif-ico { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; }
.notif-text { line-height: 1.3; }
.notif-text b { display: block; color: var(--heading); font-weight: 500; }
.notif-text span { font-size: .78rem; color: var(--text-2); }
.apps-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .2rem; }
.dropdown-menu .apps-grid a { flex-direction: column; gap: .4rem; text-align: center; font-size: .78rem; padding: .7rem .3rem; }
.apps-grid a i { font-size: 1.1rem; width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center; color: #fff; }
.flag { width: 22px; height: 16px; border-radius: 2px; object-fit: cover; box-shadow: 0 0 0 1px var(--border); flex-shrink: 0; }

/* ---------- Page header ---------- */
.page-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.page-header h1 { margin: 0; }
.page-header .sub { color: var(--text-2); margin-top: .2rem; }
.page-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.breadcrumb { font-size: .82rem; color: var(--text-3); margin-bottom: .25rem; }
.breadcrumb a { color: var(--text-2); }

/* ---------- Cards ---------- */
.card { background: var(--surface); border: 0; border-radius: var(--radius); box-shadow: var(--shadow); }
.card + .card { margin-top: 1.5rem; }
.grid > .card + .card, .offices > .card + .card, .board > .card + .card { margin-top: 0; }
.card-header { padding: 1rem 1.25rem; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; }
.card-header h2, .card-header h3 { margin: 0; font-size: 1.05rem; font-weight: 500; }
.card-header h2 i { color: var(--text-3); margin-right: .2rem; }
.card-body { padding: 1.25rem; }
.card-body.flush { padding: 0; }
.card-footer { padding: .85rem 1.25rem; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); }

.grid { display: grid; gap: 1.5rem; }
.grid > * { min-width: 0; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }

/* ---------- Gradient KPI cards ---------- */
.kpi { display: block; border-radius: var(--radius); padding: 1.1rem 1.15rem 1rem; color: #fff; box-shadow: var(--shadow); background: var(--grad-blue); position: relative; overflow: hidden; }
a.kpi { transition: transform .15s, box-shadow .15s; }
a.kpi:hover { text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.kpi .top { display: flex; justify-content: space-between; align-items: flex-start; gap: .5rem; }
.kpi .value { font-size: 1.6rem; font-weight: 500; line-height: 1.15; color: #fff; word-break: break-word; }
.kpi .value small { font-size: .8rem; opacity: .85; font-weight: 400; }
.kpi .top i { font-size: 1.45rem; opacity: .95; }
.kpi .bar { height: 4px; background: rgba(255, 255, 255, .3); border-radius: 4px; margin: .85rem 0 .65rem; overflow: hidden; }
.kpi .bar span { display: block; height: 100%; background: #fff; border-radius: 4px; }
.kpi .bottom { display: flex; justify-content: space-between; align-items: center; gap: .5rem; font-size: .9rem; }
.kpi .bottom .hint { font-size: .8rem; opacity: .9; text-align: right; }
.kpi-blue { background: var(--grad-blue); }
.kpi-green { background: var(--grad-green); }
.kpi-orange { background: var(--grad-orange); }
.kpi-dark { background: var(--grad-dark); }
.kpi-sky { background: var(--grad-sky); }
.kpi-purple { background: var(--grad-purple); }

/* ---------- Stats (white) ---------- */
.stat { padding: 1.1rem 1.2rem; display: flex; gap: .95rem; align-items: center; }
.stat .ico { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; font-size: 1.1rem; flex-shrink: 0; }
.stat .label { color: var(--text-2); font-size: .82rem; }
.stat .value { font-size: 1.35rem; font-weight: 500; line-height: 1.2; color: var(--heading); }
.stat .hint { color: var(--text-3); font-size: .76rem; }
.ico-brand { background: var(--grad-blue); color: #fff; }
.ico-success { background: var(--grad-green); color: #fff; }
.ico-warning { background: linear-gradient(45deg, #f7971e, #ffd200); color: #fff; }
.ico-danger { background: var(--grad-orange); color: #fff; }
.ico-info { background: var(--grad-sky); color: #fff; }
a.stat-link { color: inherit; transition: transform .15s; }
a.stat-link:hover { text-decoration: none; transform: translateY(-2px); }
a.flex:hover, a.card:hover { text-decoration: none; }
a.flex:hover strong { color: var(--brand); }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
    padding: .48rem .95rem; border-radius: var(--radius-sm);
    border: 1px solid var(--input-border); font: inherit; font-weight: 500; font-size: .9rem;
    cursor: pointer; white-space: nowrap; line-height: 1.35;
    background: var(--surface); color: var(--heading);
    transition: background .15s, box-shadow .15s, filter .15s;
}
.btn:hover { text-decoration: none; background: var(--surface-2); }
.btn:disabled, .btn.disabled { opacity: .55; cursor: not-allowed; pointer-events: none; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-600); border-color: var(--brand-600); box-shadow: 0 4px 12px rgba(94, 114, 228, .35); }
.btn-accent { background: var(--accent); border-color: var(--accent); color: #1b1300; }
.btn-success { background: var(--success); border-color: var(--success); color: #fff; }
.btn-success:hover { background: var(--success); filter: brightness(.94); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: var(--danger); filter: brightness(.94); }
.btn-outline { background: var(--surface); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); color: var(--heading); }
.btn-sm { padding: .28rem .6rem; font-size: .8rem; }
.btn-lg { padding: .68rem 1.25rem; font-size: 1rem; }
.btn-block { width: 100%; }
.btn-link { background: none; border: 0; color: var(--brand); padding: 0; font-weight: 500; cursor: pointer; font: inherit; }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: .3rem; padding: .18rem .6rem; border-radius: 999px; font-size: .74rem; font-weight: 500; white-space: nowrap; }
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-muted { background: var(--muted-bg); color: var(--muted); }
.badge-brand { background: var(--brand-50); color: var(--brand); }

/* ---------- Tables ---------- */
.table-wrap { width: 100%; overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: .75rem 1rem; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table th { font-size: .82rem; color: var(--heading); background: var(--surface-2); font-weight: 500; white-space: nowrap; }
.table tbody tr:hover { background: var(--surface-2); }
.table tbody tr:last-child td { border-bottom: 0; }
.table td.num, .table th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.table .primary { font-weight: 500; color: var(--heading); }
.table .sub { font-size: .78rem; color: var(--text-3); }
.table-compact th, .table-compact td { padding: .5rem .8rem; }
.th-sort { color: inherit; }

/* ---------- Forms ---------- */
label { display: block; font-weight: 500; font-size: .85rem; margin-bottom: .35rem; color: var(--heading); }
label .req { color: var(--danger); }
input:not([type]), input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=datetime-local],
input[type=search], input[type=tel], input[type=url], input[type=file], select, textarea {
    width: 100%; padding: .5rem .75rem;
    border: 1px solid var(--input-border); border-radius: var(--radius-sm);
    background: var(--surface); color: var(--heading);
    font: inherit; font-size: .92rem; transition: border-color .15s, box-shadow .15s;
}
input[type=color] { width: 48px; height: 38px; padding: 2px; border: 1px solid var(--input-border); border-radius: var(--radius-sm); background: var(--surface); }
textarea { min-height: 80px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 .2rem rgba(94, 114, 228, .2); }
input.is-invalid, select.is-invalid, textarea.is-invalid { border-color: var(--danger); }
input::placeholder, textarea::placeholder { color: var(--text-3); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem 1.1rem; }
.form-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.form-grid .span-2 { grid-column: span 2; }
.form-grid .span-all { grid-column: 1 / -1; }
.form-group { margin-bottom: 1rem; }
.help { font-size: .77rem; color: var(--text-3); margin-top: .3rem; }
.error { font-size: .78rem; color: var(--danger); margin-top: .3rem; }
.check { display: flex; align-items: center; gap: .5rem; font-weight: 400; cursor: pointer; color: var(--text); }
.check input { width: 16px; height: 16px; accent-color: var(--brand); }
.form-section { font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--brand); font-weight: 500; margin: 1.5rem 0 .9rem; padding-bottom: .45rem; border-bottom: 1px solid var(--border); }
.form-section:first-child { margin-top: 0; }
.form-actions { display: flex; gap: .5rem; justify-content: flex-end; margin-top: 1.25rem; flex-wrap: wrap; }
.input-group { display: flex; }
.input-group > * { border-radius: 0; }
.input-group > :first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.input-group > :last-child { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.input-addon { padding: .5rem .75rem; background: var(--surface-2); border: 1px solid var(--input-border); color: var(--text-2); font-size: .85rem; white-space: nowrap; }

/* ---------- Filters toolbar ---------- */
.toolbar { display: flex; gap: .7rem; flex-wrap: wrap; align-items: flex-end; padding: 1rem 1.25rem; border-bottom: 1px solid var(--border); }
.toolbar .field { min-width: 150px; }
.toolbar .field.grow { flex: 1; min-width: 220px; }
.toolbar label { font-size: .76rem; color: var(--text-2); font-weight: 400; }

/* ---------- Alerts ---------- */
.alert { padding: .8rem 1rem; border-radius: var(--radius-sm); margin-bottom: 1.25rem; display: flex; gap: .65rem; align-items: flex-start; border: 0; border-left: 4px solid currentColor; box-shadow: var(--shadow); }
.alert i { margin-top: .15rem; }
.alert-success { background: var(--success-bg); color: var(--success); }
.alert-danger { background: var(--danger-bg); color: var(--danger); }
.alert-warning { background: var(--warning-bg); color: var(--warning); }
.alert-info { background: var(--info-bg); color: var(--info); }
.alert .close { margin-left: auto; background: none; border: 0; color: inherit; cursor: pointer; opacity: .7; }
.alert ul { margin: .3rem 0 0 1rem; padding: 0; }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: .2rem; border-bottom: 1px solid var(--border); overflow-x: auto; padding: 0 .75rem; }
.tabs button, .tabs a {
    background: none; border: 0; padding: .9rem .85rem; cursor: pointer;
    font: inherit; font-weight: 500; color: var(--text-2);
    border-bottom: 2px solid transparent; white-space: nowrap; display: flex; align-items: center; gap: .4rem;
}
.tabs button:hover, .tabs a:hover { color: var(--heading); text-decoration: none; }
.tabs button.active, .tabs a.active { color: var(--brand); border-bottom-color: var(--brand); }
.tabs .pill { background: var(--muted-bg); color: var(--muted); border-radius: 999px; padding: 0 .45rem; font-size: .72rem; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ---------- Definition lists ---------- */
.dl { display: grid; grid-template-columns: 160px 1fr; gap: .5rem 1rem; margin: 0; }
.dl dt { color: var(--text-2); font-size: .86rem; }
.dl dd { margin: 0; color: var(--heading); word-break: break-word; }

/* ---------- Empty state ---------- */
.empty { text-align: center; padding: 2.5rem 1rem; color: var(--text-2); }
.empty i { font-size: 2rem; color: var(--text-3); margin-bottom: .6rem; display: block; }
.empty h3 { color: var(--heading); }

/* ---------- Dialog ---------- */
dialog.modal { border: 0; border-radius: var(--radius); padding: 0; width: min(560px, calc(100vw - 2rem)); background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg); }
dialog.modal.wide { width: min(820px, calc(100vw - 2rem)); }
dialog.modal::backdrop { background: rgba(18, 24, 26, .5); }
.modal-header { padding: 1rem 1.25rem; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.modal-header h3 { margin: 0; }
.modal-body { padding: 1.25rem; max-height: 70vh; overflow-y: auto; }
.modal-footer { padding: .9rem 1.25rem; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: .5rem; background: var(--surface-2); }

/* ---------- Pagination ---------- */
.pagination { display: flex; gap: .3rem; align-items: center; justify-content: space-between; padding: .85rem 1.25rem; border-top: 1px solid var(--border); flex-wrap: wrap; }
.pagination .pages { display: flex; gap: .25rem; flex-wrap: wrap; }
.pagination a, .pagination span.page { min-width: 34px; padding: .35rem .6rem; border: 1px solid var(--input-border); border-radius: var(--radius-sm); text-align: center; color: var(--text-2); background: var(--surface); font-size: .84rem; }
.pagination a:hover { text-decoration: none; background: var(--surface-2); }
.pagination .current { background: var(--brand); color: #fff; border-color: var(--brand); }
.pagination .disabled { opacity: .45; }

/* ---------- Checklist / timeline ---------- */
.checklist { list-style: none; margin: 0; padding: 0; }
.checklist li { display: flex; align-items: center; gap: .75rem; padding: .7rem 1.25rem; border-bottom: 1px solid var(--border); }
.checklist li:last-child { border-bottom: 0; }
.checklist .state { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: .8rem; flex-shrink: 0; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 1rem 1.4rem; border-left: 2px solid var(--border); margin-left: .4rem; }
.timeline li::before { content: ""; position: absolute; left: -6px; top: 3px; width: 10px; height: 10px; border-radius: 50%; background: var(--brand); }
.timeline li:last-child { padding-bottom: 0; }

/* ---------- Progress ---------- */
.progress { height: 6px; border-radius: 999px; background: var(--muted-bg); overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--grad-green); border-radius: 999px; }

/* ---------- Queue board ---------- */
.board { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.25rem; }
.board-col { background: var(--surface); border-radius: var(--radius); min-height: 200px; box-shadow: var(--shadow); }
.board-col h3 { padding: .9rem 1rem; margin: 0; font-size: .92rem; display: flex; justify-content: space-between; border-bottom: 1px solid var(--border); }
.board-col .items { padding: .75rem; display: grid; gap: .7rem; }
.ticket { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .75rem; }
.ticket .token { font-weight: 700; color: var(--brand); font-size: 1.05rem; }
.ticket .actions { display: flex; gap: .35rem; margin-top: .6rem; flex-wrap: wrap; }

/* ---------- Office flags landing ---------- */
.offices { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.5rem; }
.office-card { padding: 0; overflow: hidden; display: flex; flex-direction: column; transition: transform .15s, box-shadow .15s; }
.office-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.office-card .flag-hero { height: 124px; display: grid; place-items: center; position: relative; background: var(--grad-dark); }
.office-card:nth-child(1) .flag-hero { background: var(--grad-blue); }
.office-card:nth-child(2) .flag-hero { background: var(--grad-green); }
.office-card:nth-child(3) .flag-hero { background: var(--grad-orange); }
.office-card .flag-hero img { height: 72px; border-radius: 6px; box-shadow: 0 6px 18px rgba(0,0,0,.28); }
.office-card .flag-hero .all { font-size: 2.8rem; color: #fff; }
.office-card .body { padding: 1.1rem 1.2rem; flex: 1; }
.office-card .kpis { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; margin-top: .8rem; }
.office-card .kpi { background: var(--surface-2); border-radius: var(--radius-sm); padding: .55rem .65rem; color: var(--text); box-shadow: none; min-width: 0; }
.office-card .kpi .v { font-weight: 500; font-size: 1.02rem; color: var(--heading); overflow-wrap: anywhere; }
.office-card .kpi .l { font-size: .72rem; color: var(--text-2); }
.office-card form { padding: 0 1.2rem 1.2rem; }

/* ---------- Auth pages (High Fly Desk Aesthetic) ---------- */
.auth-scene {
    min-height: 100vh;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 2.5rem 1.5rem;
    position: relative;
    background-color: #f8fafc;
    background-image: url('../images/login-desk-bg.jpg');
    background-position: right center;
    background-repeat: no-repeat;
    background-size: cover;
    background-attachment: fixed;
}
[data-theme="dark"] .auth-scene::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.72);
    backdrop-filter: blur(4px);
    z-index: 1;
}

.auth-card {
    width: 100%;
    max-width: 440px;
    margin-left: clamp(1rem, 7vw, 7rem);
    position: relative;
    z-index: 10;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 28px;
    padding: 2.4rem 2.2rem;
    box-shadow: 0 20px 50px -10px rgba(15, 23, 42, 0.14), 0 0 0 1px rgba(255, 255, 255, 0.9) inset;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
[data-theme="dark"] .auth-card {
    background: rgba(26, 34, 38, 0.92);
    box-shadow: 0 25px 60px -12px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.08) inset;
}

/* Brand badge in login header */
.auth-brand-badge {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    margin-bottom: 1.25rem;
}
.auth-brand-logo {
    width: 48px;
    height: 48px;
    object-fit: contain;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.08));
}
.auth-brand-text {
    display: flex;
    flex-direction: column;
}
.auth-brand-name {
    font-size: 1.55rem;
    font-weight: 800;
    line-height: 1.1;
    color: #0f172a;
    letter-spacing: -0.02em;
}
[data-theme="dark"] .auth-brand-name {
    color: #f8fafc;
}
.auth-brand-accent {
    color: #2563eb;
}
[data-theme="dark"] .auth-brand-accent {
    color: #3b82f6;
}
.auth-brand-tag {
    font-size: 0.72rem;
    font-weight: 600;
    color: #64748b;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}
[data-theme="dark"] .auth-brand-tag {
    color: #94a3b8;
}

/* Headings */
.auth-login-title {
    font-size: 2.15rem;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.03em;
    margin: 0 0 0.35rem;
    line-height: 1.15;
}
[data-theme="dark"] .auth-login-title {
    color: #ffffff;
}
.auth-login-subtitle {
    font-size: 0.86rem;
    color: #64748b;
    margin: 0 0 1.6rem;
    line-height: 1.45;
}
[data-theme="dark"] .auth-login-subtitle {
    color: #94a3b8;
}

/* Pill Input Containers */
.auth-pill-group {
    margin-bottom: 1rem;
}
.auth-pill-input {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    border-radius: 9999px;
    padding: 0.58rem 1.15rem;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
}
[data-theme="dark"] .auth-pill-input {
    background: #151b1e;
    border-color: #2c3539;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}
.auth-pill-input:focus-within {
    border-color: #2563eb;
    box-shadow: 0 0 0 3.5px rgba(37, 99, 235, 0.16), 0 4px 14px rgba(37, 99, 235, 0.1);
}
.auth-pill-input.is-invalid {
    border-color: #ef4444;
    box-shadow: 0 0 0 3.5px rgba(239, 68, 68, 0.16);
}
.auth-pill-input.flash-fill {
    animation: pillFlash 0.5s ease-out;
}
@keyframes pillFlash {
    0% { background: #dbeafe; border-color: #2563eb; }
    100% { background: #ffffff; border-color: #e2e8f0; }
}

.auth-pill-icon {
    color: #94a3b8;
    font-size: 1rem;
    width: 18px;
    text-align: center;
    flex-shrink: 0;
}
.auth-pill-input input {
    border: none !important;
    outline: none !important;
    background: transparent !important;
    width: 100%;
    font-size: 0.93rem;
    color: #0f172a;
    font-family: inherit;
    font-weight: 500;
    box-shadow: none !important;
    padding: 0.25rem 0 !important;
}
[data-theme="dark"] .auth-pill-input input {
    color: #f1f5f9;
}
.auth-pill-input input::placeholder {
    color: #94a3b8;
    font-weight: 400;
}
.auth-pill-status {
    color: #10b981;
    font-size: 1rem;
    flex-shrink: 0;
    display: inline-flex;
}
.auth-pill-action {
    border: none;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    transition: color 0.15s;
    border-radius: 50%;
}
.auth-pill-action:hover {
    color: #2563eb;
}
.auth-field-error {
    font-size: 0.78rem;
    color: #ef4444;
    margin: 0.35rem 0 0 1rem;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

/* Options row */
.auth-options-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0.85rem 0.5rem 1.35rem;
    font-size: 0.84rem;
    color: #64748b;
}
[data-theme="dark"] .auth-options-row {
    color: #94a3b8;
}
.auth-check {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    cursor: pointer;
    user-select: none;
    font-weight: 500;
}
.auth-check input {
    accent-color: #2563eb;
    cursor: pointer;
    width: 16px;
    height: 16px;
}
.auth-forgot-link {
    background: none;
    border: none;
    color: #64748b;
    font-size: 0.84rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    padding: 0;
    transition: color 0.15s;
}
.auth-forgot-link:hover {
    color: #2563eb;
    text-decoration: underline;
}

/* Big Login Pill Button */
.auth-btn-login {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: #ffffff;
    border: none;
    border-radius: 9999px;
    padding: 0.85rem 1.5rem;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.32);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.auth-btn-login:hover {
    transform: translateY(-1.5px);
    box-shadow: 0 14px 28px rgba(37, 99, 235, 0.4);
    filter: brightness(1.04);
}
.auth-btn-login:active {
    transform: translateY(0);
    box-shadow: 0 6px 14px rgba(37, 99, 235, 0.3);
}

/* Group Divisions Section (Image 2 Logos) */
.auth-divisions-section {
    margin-top: 1.6rem;
}
.auth-divider-label {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    color: #94a3b8;
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
    margin-bottom: 0.75rem;
}
.auth-divider-label::before,
.auth-divider-label::after {
    content: "";
    flex: 1;
    height: 1px;
    background: #e2e8f0;
}
[data-theme="dark"] .auth-divider-label::before,
[data-theme="dark"] .auth-divider-label::after {
    background: #2c3539;
}
.auth-entities-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.55rem;
}
.auth-entity-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    padding: 0.55rem 0.35rem;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.03);
    transition: all 0.2s ease;
}
[data-theme="dark"] .auth-entity-card {
    background: #151b1e;
    border-color: #2c3539;
}
.auth-entity-card:hover {
    transform: translateY(-2px);
    border-color: #93c5fd;
    box-shadow: 0 6px 14px rgba(37, 99, 235, 0.1);
}
.auth-entity-card.active {
    border-color: #bfdbfe;
    background: #eff6ff;
}
[data-theme="dark"] .auth-entity-card.active {
    background: #1e293b;
    border-color: #3b82f6;
}
.auth-entity-img-wrap {
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.auth-entity-img-wrap img {
    max-height: 36px;
    max-width: 100%;
    object-fit: contain;
}
.auth-entity-name {
    font-size: 0.68rem;
    font-weight: 600;
    color: #334155;
    text-align: center;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}
[data-theme="dark"] .auth-entity-name {
    color: #cbd5e1;
}

/* Quick Demo Roles */
.auth-quick-roles {
    margin-top: 1.2rem;
    padding-top: 1rem;
    border-top: 1px dashed #e2e8f0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.45rem;
}
[data-theme="dark"] .auth-quick-roles {
    border-top-color: #2c3539;
}
.auth-quick-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
[data-theme="dark"] .auth-quick-label {
    color: #94a3b8;
}
.auth-roles-chips {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.35rem;
}
.auth-role-pill {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 9999px;
    padding: 0.25rem 0.65rem;
    font-size: 0.72rem;
    font-weight: 600;
    color: #334155;
    cursor: pointer;
    transition: all 0.15s ease;
}
[data-theme="dark"] .auth-role-pill {
    background: #1e262a;
    border-color: #2c3539;
    color: #cbd5e1;
}
.auth-role-pill:hover {
    background: #2563eb;
    border-color: #2563eb;
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(37, 99, 235, 0.25);
}

/* Auth Page Footer */
.auth-page-footer {
    text-align: center;
    margin-top: 1.35rem;
    font-size: 0.74rem;
    color: #94a3b8;
    line-height: 1.45;
}
.auth-footer-copy {
    margin: 0;
    font-weight: 500;
}
.auth-footer-sub {
    margin: 0.2rem 0 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.hub-item {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}
.hub-item img {
    width: 14px;
    height: 10px;
    border-radius: 2px;
}

/* IT Support Dialog */
.auth-dialog {
    border: none;
    border-radius: 20px;
    padding: 0;
    background: #ffffff;
    box-shadow: 0 25px 60px rgba(15, 23, 42, 0.25);
    max-width: 380px;
    width: 90%;
    margin: auto;
}
[data-theme="dark"] .auth-dialog {
    background: #1a2226;
    color: #f1f5f9;
}
.auth-dialog::backdrop {
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(4px);
}
.auth-dialog-content {
    padding: 1.8rem;
    text-align: center;
}
.auth-dialog-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #eff6ff;
    color: #2563eb;
    display: grid;
    place-items: center;
    font-size: 1.4rem;
    margin: 0 auto 1rem;
}
[data-theme="dark"] .auth-dialog-icon {
    background: #1e293b;
    color: #3b82f6;
}
.auth-dialog h3 {
    margin: 0 0 0.5rem;
    font-size: 1.15rem;
}
.auth-dialog p {
    font-size: 0.85rem;
    color: #64748b;
    margin: 0 0 1rem;
}
[data-theme="dark"] .auth-dialog p {
    color: #94a3b8;
}
.auth-dialog-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 0.8rem;
    font-size: 0.82rem;
    text-align: left;
    display: grid;
    gap: 0.35rem;
    margin-bottom: 1rem;
}
[data-theme="dark"] .auth-dialog-card {
    background: #151b1e;
    border-color: #2c3539;
}

/* Backwards compatibility for other auth views */
.auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.auth-box { width: min(440px, 100%); background: var(--surface); padding: 2.2rem; border-radius: 24px; box-shadow: var(--shadow); }
.auth-box .logo-lg { width: 48px; height: 48px; border-radius: 12px; background: var(--grad-blue); color: #fff; display: grid; place-items: center; font-size: 1.3rem; margin-bottom: 1.2rem; }
.qr { background: #fff; padding: .6rem; border-radius: var(--radius-sm); display: inline-block; border: 1px solid var(--border); }
.qr svg { display: block; width: 180px; height: 180px; }
.codes { display: grid; grid-template-columns: repeat(2, 1fr); gap: .4rem; font-family: ui-monospace, monospace; background: var(--surface-2); padding: .8rem; border-radius: var(--radius-sm); border: 1px dashed var(--input-border); }

/* Responsive adjustments */
@media (max-width: 900px) {
    .auth-scene {
        justify-content: center;
        background-position: center;
        padding: 1.5rem 1rem;
    }
    .auth-card {
        margin-left: 0;
        max-width: 420px;
        padding: 2rem 1.6rem;
    }
}

/* ---------- Invoice preview frame ---------- */
.invoice-frame { background: #e9ecf3; padding: 1.25rem; border-radius: var(--radius); overflow-x: auto; }
[data-theme="dark"] .invoice-frame { background: #0f1416; }
.invoice-frame iframe { width: 100%; min-height: 1100px; border: 0; background: #fff; border-radius: 4px; box-shadow: var(--shadow-lg); }
.sticky { position: sticky; top: calc(var(--topbar-h) + 1.5rem); }

/* ---------- Item editor ---------- */
.items-table input, .items-table select { padding: .42rem .55rem; font-size: .88rem; }
.items-table td { padding: .45rem .5rem; vertical-align: top; }
.totals { width: 100%; max-width: 360px; margin-left: auto; }
.totals td { padding: .3rem 0; }
.totals td:last-child { text-align: right; font-variant-numeric: tabular-nums; font-weight: 500; color: var(--heading); }
.totals tr.grand td { font-size: 1.12rem; font-weight: 700; border-top: 1px solid var(--border); padding-top: .6rem; color: var(--heading); }

.lookup { position: relative; }
.lookup-results { position: absolute; left: 0; right: 0; top: calc(100% + 4px); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); z-index: 20; max-height: 300px; overflow-y: auto; }
.lookup-results button { display: block; width: 100%; text-align: left; padding: .6rem .8rem; background: none; border: 0; border-bottom: 1px solid var(--border); cursor: pointer; color: var(--text); font: inherit; }
.lookup-results button:hover { background: var(--surface-2); }
.picked { display: flex; align-items: center; gap: .75rem; padding: .65rem .85rem; border: 1px solid var(--brand); background: var(--brand-50); border-radius: var(--radius-sm); color: var(--heading); }

.dup-box { border-radius: var(--radius-sm); padding: .75rem .95rem; margin-bottom: 1rem; border-left: 4px solid currentColor; }
.dup-box.blocking { background: var(--danger-bg); color: var(--danger); }
.dup-box.warning { background: var(--warning-bg); color: var(--warning); }

.sensitive { display: inline-flex; align-items: center; gap: .4rem; }

/* ---------- Matrix ---------- */
.matrix th, .matrix td { text-align: center; }
.matrix td:first-child, .matrix th:first-child { text-align: left; }
.matrix input { width: 16px; height: 16px; accent-color: var(--brand); }

/* ---------- Responsive ---------- */
@media (max-width: 1200px) {
    .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .board { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .grid-main { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 1024px) {
    .sidebar { transform: translateX(-100%); }
    body.sidebar-open .sidebar { transform: translateX(0); width: var(--sidebar-w); }
    body.sidebar-open::after { content: ""; position: fixed; inset: 0; background: rgba(18,24,26,.45); z-index: 35; }
    .main, body.sidebar-mini .main { margin-left: 0; }
    .menu-toggle { display: inline-grid; }
    .sidebar-brand .collapse-btn { display: none; }
}
@media (max-width: 860px) {
    .content { padding: 1rem; }
    .grid { gap: 1rem; }
    .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); }
    .chart-summary .v { font-size: 1rem; }
    .page-header { align-items: flex-start; }
    .form-grid, .form-grid.cols-3, .form-grid.cols-4 { grid-template-columns: 1fr; }
    .form-grid .span-2 { grid-column: auto; }
    .auth { grid-template-columns: 1fr; }
    .auth-side { display: none; }
    .dl { grid-template-columns: 1fr; gap: .1rem; }
    .dl dd { margin-bottom: .5rem; }
    .topbar .user-name, .topbar .divider-v { display: none; }
    .topbar { padding: 0 .75rem; gap: .25rem; }
}
@media (max-width: 560px) {
    .grid-4 { grid-template-columns: 1fr; }
    .board { grid-template-columns: 1fr; }
    .topbar .hide-xs { display: none; }
    .topbar .show-xs { display: inline-grid; }
}

@media print {
    .sidebar, .topbar, .page-actions, .page-footer, .back-to-top, .no-print { display: none !important; }
    .main { margin: 0 !important; }
    body { background: #fff; }
}

/* ---------- Charts ---------- */
:root { --chart-bar: #5e72e4; --chart-grid: #eceef2; --chart-axis: #8a929b; }
[data-theme="dark"] { --chart-bar: #7486ee; --chart-grid: #2c3539; --chart-axis: #8d979f; }
.chart { position: relative; padding: .5rem 1.25rem 0; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .bar { fill: var(--chart-bar); }
.chart .hit { fill: transparent; cursor: pointer; }
.chart .col:hover .bar, .chart .col:focus .bar { filter: brightness(1.12); }
.chart .col:hover .hit { fill: var(--brand-50); opacity: .5; }
.chart .grid-line { stroke: var(--chart-grid); stroke-width: 1; }
.chart .axis-text { fill: var(--chart-axis); font-size: 11px; font-family: var(--font); }
.chart-tip { position: absolute; pointer-events: none; background: var(--heading); color: var(--surface); padding: .35rem .55rem; border-radius: 6px; font-size: .78rem; white-space: nowrap; transform: translate(-50%, calc(-100% - 8px)); box-shadow: var(--shadow-lg); z-index: 5; }
.chart-tip b { font-weight: 500; }
.chart-summary { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--border); margin-top: .5rem; }
.chart-summary > div { text-align: center; padding: .9rem .5rem; }
.chart-summary > div + div { border-left: 1px solid var(--border); }
.chart-summary .v { font-size: 1.25rem; font-weight: 500; color: var(--heading); }
.chart-summary .l { font-size: .78rem; color: var(--text-2); }
.sr-table { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Tabs counters & notification footer ---------- */
.tabs a .count { display: inline-block; min-width: 18px; padding: 0 6px; margin-left: 4px; border-radius: 9px; background: var(--surface-2); color: var(--muted); font-size: .72rem; line-height: 18px; text-align: center; }
.tabs a.active .count { background: var(--brand); color: #fff; }
.dropdown-menu .notif-foot { border-top: 1px solid var(--border); }
.dropdown-menu .notif-foot button { justify-content: center; font-size: .82rem; color: var(--brand); }
