:root {
    --bg: #f5f7fb;
    --surface: #ffffff;
    --surface-soft: #f8fafc;
    --surface-muted: #eef2f7;
    --sidebar: #0d1424;
    --sidebar-soft: #151f34;
    --text: #111827;
    --muted: #667085;
    --muted-2: #98a2b3;
    --line: #e7ebf1;
    --line-strong: #d7dde7;
    --primary: #5865f2;
    --primary-strong: #424ed5;
    --primary-soft: #eef0ff;
    --success: #16a36a;
    --success-soft: #e9f8f1;
    --danger: #dc3f55;
    --danger-soft: #fff0f2;
    --warning: #d78a12;
    --warning-soft: #fff7e6;
    --info: #1379c9;
    --info-soft: #eaf5ff;
    --shadow-sm: 0 1px 2px rgba(16, 24, 40, .03), 0 1px 3px rgba(16, 24, 40, .05);
    --shadow: 0 12px 32px rgba(25, 35, 58, .07);
    --shadow-lg: 0 28px 70px rgba(15, 23, 42, .16);
    --radius-sm: 10px;
    --radius: 16px;
    --radius-lg: 22px;
    --sidebar-width: 260px;
    --topbar-height: 78px;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    background: var(--bg);
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}
button, input, select, textarea { font: inherit; }
a { color: inherit; }
svg { display: block; }

.app-shell { min-height: 100vh; }
.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 70;
    width: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    padding: 18px 14px;
    color: #fff;
    background:
        radial-gradient(circle at 20% 0, rgba(88, 101, 242, .22), transparent 30%),
        linear-gradient(180deg, #0e172a 0%, #0b1120 100%);
    border-right: 1px solid rgba(255,255,255,.06);
}
.sidebar-brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 56px;
    margin-bottom: 26px;
    padding: 0 8px;
}
.brand-mark {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    color: #fff;
    text-decoration: none;
}
.brand-symbol {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border-radius: 13px;
    color: #fff;
    background: linear-gradient(135deg, #6b76ff, #4551db);
    box-shadow: 0 10px 24px rgba(67, 81, 219, .35), inset 0 1px 0 rgba(255,255,255,.2);
}
.brand-symbol svg { width: 27px; height: 27px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
.brand-copy { display: flex; flex-direction: column; line-height: 1.05; }
.brand-copy strong { font-size: 17px; letter-spacing: .08em; }
.brand-copy small { margin-top: 5px; color: #9ba8bd; font-size: 11px; font-weight: 650; letter-spacing: .04em; }
.sidebar-close { display: none; }
.sidebar-section-label {
    margin: 0 10px 9px;
    color: #71809a;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .13em;
    text-transform: uppercase;
}
.sidebar-nav { display: grid; gap: 5px; }
.nav-item {
    min-height: 46px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 13px;
    color: #aeb9cb;
    border-radius: 12px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 700;
    transition: background .18s ease, color .18s ease, transform .18s ease;
}
.nav-item:hover { color: #fff; background: rgba(255,255,255,.06); }
.nav-item.active {
    color: #fff;
    background: linear-gradient(90deg, rgba(88,101,242,.26), rgba(88,101,242,.12));
    box-shadow: inset 3px 0 0 #7c86ff;
}
.nav-icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sidebar-spacer { flex: 1; }
.sidebar-status {
    display: flex;
    align-items: center;
    gap: 11px;
    margin: 16px 5px 10px;
    padding: 13px;
    border: 1px solid rgba(255,255,255,.07);
    border-radius: 14px;
    background: rgba(255,255,255,.035);
}
.status-dot {
    width: 9px;
    height: 9px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: #35d08b;
    box-shadow: 0 0 0 5px rgba(53,208,139,.11);
}
.sidebar-status div:last-child { min-width: 0; display: flex; flex-direction: column; }
.sidebar-status strong { color: #e8edf5; font-size: 12px; }
.sidebar-status span { margin-top: 3px; color: #7f8ca2; font-size: 10px; }
.nav-logout { margin-top: 2px; color: #8e9bb0; }

.sidebar-backdrop { display: none; }
.app-main { min-width: 0; min-height: 100vh; margin-left: var(--sidebar-width); }
.topbar {
    position: sticky;
    top: 0;
    z-index: 45;
    height: var(--topbar-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 0 30px;
    background: rgba(255,255,255,.9);
    border-bottom: 1px solid rgba(226,232,240,.9);
    backdrop-filter: blur(14px);
}
.topbar-left, .topbar-right { display: flex; align-items: center; }
.topbar-left { gap: 14px; min-width: 0; }
.topbar-right { gap: 18px; }
.eyebrow { margin-bottom: 4px; color: var(--muted-2); font-size: 10px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.topbar-title { overflow: hidden; font-size: 18px; font-weight: 800; white-space: nowrap; text-overflow: ellipsis; }
.topbar-date { color: var(--muted); font-size: 13px; font-weight: 700; }
.icon-button {
    width: 42px;
    height: 42px;
    display: inline-grid;
    place-items: center;
    padding: 0;
    color: var(--text);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    cursor: pointer;
}
.icon-button svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.mobile-menu-button { display: none; }
.user-menu { position: relative; }
.user-menu summary {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    list-style: none;
    cursor: pointer;
    user-select: none;
}
.user-menu summary::-webkit-details-marker { display: none; }
.user-menu summary > svg { width: 16px; height: 16px; fill: none; stroke: #8b95a5; stroke-width: 2; }
.user-avatar {
    width: 39px;
    height: 39px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    color: #fff;
    background: linear-gradient(135deg, #6570f6, #414ccf);
    border-radius: 12px;
    font-size: 14px;
    font-weight: 850;
}
.user-copy { max-width: 190px; display: flex; flex-direction: column; line-height: 1.12; }
.user-copy strong { overflow: hidden; font-size: 13px; white-space: nowrap; text-overflow: ellipsis; }
.user-copy small { overflow: hidden; margin-top: 4px; color: var(--muted); font-size: 10px; white-space: nowrap; text-overflow: ellipsis; }
.user-dropdown {
    position: absolute;
    top: calc(100% + 13px);
    right: 0;
    width: 260px;
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 15px;
    box-shadow: var(--shadow-lg);
}
.user-dropdown-head { display: flex; flex-direction: column; padding: 15px 16px; background: var(--surface-soft); border-bottom: 1px solid var(--line); }
.user-dropdown-head strong { font-size: 13px; }
.user-dropdown-head span { margin-top: 4px; color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
.user-dropdown a { display: flex; align-items: center; gap: 10px; padding: 12px 15px; color: #344054; text-decoration: none; font-size: 12px; font-weight: 700; }
.user-dropdown a:hover { background: #f8fafc; }
.user-dropdown svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.user-dropdown .danger-link { color: var(--danger); }

.page-content { width: 100%; max-width: 1600px; margin: 0 auto; padding: 28px 30px 44px; }
.page-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 22px;
}
.page-heading h1 { margin: 0; font-size: clamp(25px, 2vw, 34px); line-height: 1.15; letter-spacing: -.035em; }
.page-heading p { max-width: 760px; margin: 8px 0 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.heading-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.btn {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 0 16px;
    color: #fff;
    background: var(--primary);
    border: 1px solid var(--primary);
    border-radius: 11px;
    box-shadow: 0 7px 18px rgba(88,101,242,.18);
    text-decoration: none;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    transition: transform .16s ease, background .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.btn:hover { transform: translateY(-1px); background: var(--primary-strong); border-color: var(--primary-strong); }
.btn:active { transform: translateY(0); }
.btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.btn-secondary { color: #344054; background: #fff; border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
.btn-secondary:hover { color: var(--text); background: #f9fafb; border-color: #cbd2dc; }
.btn-danger { color: #fff; background: var(--danger); border-color: var(--danger); box-shadow: 0 7px 18px rgba(220,63,85,.16); }
.btn-danger:hover { background: #bf2e43; border-color: #bf2e43; }
.btn-success { background: var(--success); border-color: var(--success); box-shadow: 0 7px 18px rgba(22,163,106,.16); }
.btn-success:hover { background: #108657; border-color: #108657; }
.btn-sm { min-height: 36px; padding: 0 12px; border-radius: 9px; font-size: 11px; }
.btn[disabled] { opacity: .6; cursor: wait; transform: none; }

.metrics-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.metrics-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.metric-card {
    position: relative;
    min-height: 145px;
    overflow: hidden;
    padding: 19px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}
.metric-card::after {
    content: "";
    position: absolute;
    top: -34px;
    right: -34px;
    width: 104px;
    height: 104px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(88,101,242,.11), rgba(88,101,242,0));
}
.metric-head { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.metric-label { color: var(--muted); font-size: 11px; font-weight: 750; }
.metric-icon {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    color: var(--primary);
    background: var(--primary-soft);
    border-radius: 11px;
}
.metric-icon.success { color: var(--success); background: var(--success-soft); }
.metric-icon.info { color: var(--info); background: var(--info-soft); }
.metric-icon.warning { color: var(--warning); background: var(--warning-soft); }
.metric-icon svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.metric-value { position: relative; z-index: 1; margin-top: 20px; font-size: clamp(23px, 2vw, 30px); font-weight: 850; line-height: 1; letter-spacing: -.035em; }
.metric-value.positive { color: #107a51; }
.metric-value.negative { color: var(--danger); }
.metric-foot { position: relative; z-index: 1; margin-top: 10px; color: var(--muted-2); font-size: 10px; font-weight: 650; }

.dashboard-panels { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(290px, .8fr); gap: 14px; margin-bottom: 18px; }
.panel-stack { display: grid; gap: 14px; }
.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}
.card-pad { padding: 19px; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 17px; }
.card-title { display: flex; align-items: center; gap: 11px; }
.card-title-icon {
    width: 35px;
    height: 35px;
    display: grid;
    place-items: center;
    color: var(--primary);
    background: var(--primary-soft);
    border-radius: 10px;
}
.card-title-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.card-head h2, .card-head h3 { margin: 0; font-size: 15px; letter-spacing: -.015em; }
.card-head p { margin: 5px 0 0; color: var(--muted); font-size: 11px; line-height: 1.45; }

.segmented { display: inline-flex; gap: 3px; padding: 4px; background: var(--surface-muted); border-radius: 11px; }
.segmented a { min-height: 32px; display: inline-flex; align-items: center; padding: 0 11px; color: var(--muted); border-radius: 8px; text-decoration: none; font-size: 10px; font-weight: 800; }
.segmented a:hover { color: var(--text); }
.segmented a.active { color: #fff; background: var(--primary); box-shadow: 0 5px 12px rgba(88,101,242,.2); }
.rate-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; color: var(--muted); font-size: 10px; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 4px var(--success-soft); }
.error-text { color: var(--danger); font-weight: 700; }
.rates-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; }
.rate-chip { min-width: 0; padding: 11px 12px; background: var(--surface-soft); border: 1px solid #edf0f4; border-radius: 11px; }
.rate-chip span { display: block; color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .06em; }
.rate-chip strong { display: block; overflow: hidden; margin-top: 6px; font-size: 12px; white-space: nowrap; text-overflow: ellipsis; }

.search-form { display: flex; gap: 9px; }
.input-wrap { position: relative; flex: 1; min-width: 0; }
.input-wrap > svg { position: absolute; top: 50%; left: 13px; width: 18px; height: 18px; color: #98a2b3; fill: none; stroke: currentColor; stroke-width: 1.8; transform: translateY(-50%); pointer-events: none; }
.form-input, .form-select {
    width: 100%;
    min-height: 42px;
    padding: 0 13px;
    color: var(--text);
    background: #fff;
    border: 1px solid var(--line-strong);
    border-radius: 10px;
    outline: none;
    font-size: 12px;
    transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}
.input-wrap .form-input { padding-left: 41px; }
.form-input::placeholder { color: #a7afbd; }
.form-input:focus, .form-select:focus { border-color: #8d96ff; box-shadow: 0 0 0 4px rgba(88,101,242,.10); }
.form-label { display: block; margin-bottom: 7px; color: #475467; font-size: 10px; font-weight: 800; }
.form-help { margin-top: 9px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.quick-links { display: grid; gap: 9px; }
.quick-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 13px;
    color: var(--text);
    background: var(--surface-soft);
    border: 1px solid #edf0f4;
    border-radius: 11px;
    text-decoration: none;
    transition: border-color .16s ease, transform .16s ease, background .16s ease;
}
.quick-link:hover { transform: translateY(-1px); background: #fff; border-color: #cfd5ff; }
.quick-link-main { display: flex; align-items: center; gap: 11px; min-width: 0; }
.quick-link-icon { width: 34px; height: 34px; flex: 0 0 auto; display: grid; place-items: center; color: var(--primary); background: var(--primary-soft); border-radius: 10px; }
.quick-link-icon svg, .quick-link > svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.quick-link-copy { min-width: 0; display: flex; flex-direction: column; }
.quick-link-copy strong { font-size: 11px; }
.quick-link-copy span { margin-top: 4px; overflow: hidden; color: var(--muted); font-size: 9px; white-space: nowrap; text-overflow: ellipsis; }
.quick-link > svg { color: var(--muted-2); }

.table-card { overflow: hidden; }
.table-card-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 17px 19px; border-bottom: 1px solid var(--line); }
.table-card-head h2 { margin: 0; font-size: 15px; }
.table-card-head p { margin: 5px 0 0; color: var(--muted); font-size: 10px; }
.table-summary { display: inline-flex; align-items: center; gap: 7px; padding: 7px 10px; color: #475467; background: var(--surface-soft); border: 1px solid var(--line); border-radius: 999px; font-size: 9px; font-weight: 800; }
.table-wrap { width: 100%; overflow-x: auto; }
.data-table { width: 100%; border-collapse: separate; border-spacing: 0; }
.data-table th {
    position: sticky;
    top: 0;
    z-index: 2;
    padding: 11px 13px;
    color: #7a8494;
    background: #f8fafc;
    border-bottom: 1px solid var(--line);
    text-align: left;
    font-size: 9px;
    font-weight: 850;
    letter-spacing: .055em;
    white-space: nowrap;
    text-transform: uppercase;
}
.data-table td { padding: 13px; border-bottom: 1px solid #eef1f5; vertical-align: middle; font-size: 11px; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr { transition: background .14s ease; }
.data-table tbody tr:hover { background: #fbfcff; }
.order-id { font-size: 12px; font-weight: 850; }
.cell-main { font-weight: 750; }
.cell-sub { margin-top: 4px; color: var(--muted); font-size: 9px; line-height: 1.35; }
.amount { font-variant-numeric: tabular-nums; white-space: nowrap; }
.profit-main { font-size: 12px; font-weight: 850; font-variant-numeric: tabular-nums; white-space: nowrap; }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-muted { color: var(--muted); }
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 26px;
    padding: 0 9px;
    border-radius: 999px;
    font-size: 9px;
    font-weight: 850;
    white-space: nowrap;
}
.badge-success { color: #08784b; background: var(--success-soft); }
.badge-neutral { color: #475467; background: #f0f2f5; }
.badge-primary { color: #424ed5; background: var(--primary-soft); }
.badge-danger { color: #bb2c42; background: var(--danger-soft); }
.badge-warning { color: #9f6200; background: var(--warning-soft); }
.badge-dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .75; }
.empty-state { padding: 52px 24px !important; text-align: center; }
.empty-icon { width: 48px; height: 48px; display: grid; place-items: center; margin: 0 auto 12px; color: var(--muted-2); background: var(--surface-muted); border-radius: 14px; }
.empty-icon svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.empty-state strong { display: block; font-size: 13px; }
.empty-state span { display: block; margin-top: 6px; color: var(--muted); font-size: 10px; }

.pagination-bar { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 15px 18px; border-top: 1px solid var(--line); background: #fff; }
.pagination-info { color: var(--muted); font-size: 10px; }
.pagination { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.pagination a, .pagination span {
    min-width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 9px;
    color: #475467;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    text-decoration: none;
    font-size: 9px;
    font-weight: 800;
}
.pagination a:hover { color: var(--primary); border-color: #bbc1ff; background: #fafaff; }
.pagination .active { color: #fff; background: var(--primary); border-color: var(--primary); }
.pagination .disabled { opacity: .45; }

.filter-card { margin-bottom: 16px; padding: 18px; }
.filter-form { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.form-field { min-width: 210px; }
.period-summary { display: inline-flex; align-items: center; gap: 8px; margin-top: 12px; color: var(--muted); font-size: 10px; }
.period-summary strong { color: #344054; }
.period-summary svg { width: 16px; height: 16px; fill: none; stroke: var(--primary); stroke-width: 1.8; }

.accounting-layout { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(300px, .55fr); gap: 14px; margin-bottom: 16px; }
.chart-card { min-height: 300px; padding: 18px; }
.chart-area { height: 206px; display: flex; align-items: stretch; gap: 7px; padding-top: 8px; }
.chart-item { min-width: 0; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 7px; }
.chart-track { width: 100%; height: 154px; display: flex; align-items: flex-end; justify-content: center; border-bottom: 1px dashed #d8dde6; }
.chart-bar { width: min(24px, 72%); min-height: 5px; border-radius: 6px 6px 2px 2px; background: linear-gradient(180deg, #7780ff, #5662ef); box-shadow: 0 5px 10px rgba(88,101,242,.14); }
.chart-bar.negative { background: linear-gradient(180deg, #f17889, #dc3f55); box-shadow: 0 5px 10px rgba(220,63,85,.12); }
.chart-date { color: var(--muted-2); font-size: 8px; white-space: nowrap; transform: rotate(-38deg); transform-origin: center; }
.chart-legend { display: flex; gap: 15px; margin-top: 18px; color: var(--muted); font-size: 9px; }
.legend-item { display: inline-flex; align-items: center; gap: 6px; }
.legend-swatch { width: 8px; height: 8px; border-radius: 3px; background: var(--primary); }
.legend-swatch.negative { background: var(--danger); }
.summary-list { display: grid; gap: 9px; }
.summary-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid #eef1f5; }
.summary-row:last-child { border-bottom: 0; }
.summary-row span { color: var(--muted); font-size: 10px; }
.summary-row strong { font-size: 11px; text-align: right; }

.alert { position: relative; display: flex; align-items: flex-start; gap: 11px; margin-bottom: 14px; padding: 13px 15px; border: 1px solid transparent; border-radius: 12px; font-size: 11px; line-height: 1.5; }
.alert svg { width: 18px; height: 18px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.8; }
.alert-success { color: #08784b; background: var(--success-soft); border-color: #c8eddc; }
.alert-danger { color: #b3283d; background: var(--danger-soft); border-color: #ffd2d8; }

.staff-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 16px; }
.compact-stat { display: flex; align-items: center; gap: 12px; padding: 15px; }
.compact-stat-icon { width: 38px; height: 38px; display: grid; place-items: center; color: var(--primary); background: var(--primary-soft); border-radius: 11px; }
.compact-stat-icon.success { color: var(--success); background: var(--success-soft); }
.compact-stat-icon.danger { color: var(--danger); background: var(--danger-soft); }
.compact-stat-icon svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.compact-stat span { display: block; color: var(--muted); font-size: 9px; }
.compact-stat strong { display: block; margin-top: 3px; font-size: 20px; }
.staff-form-grid { display: grid; grid-template-columns: 1.2fr .8fr .9fr auto; gap: 11px; align-items: end; }
.password-field { position: relative; }
.password-field .form-input { padding-right: 40px; }
.password-toggle { position: absolute; right: 7px; bottom: 5px; width: 32px; height: 32px; display: grid; place-items: center; padding: 0; color: var(--muted); background: transparent; border: 0; border-radius: 8px; cursor: pointer; }
.password-toggle:hover { background: var(--surface-muted); }
.password-toggle svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.table-actions { display: flex; align-items: center; gap: 7px; }
.inline-password-form { display: flex; align-items: center; gap: 7px; min-width: 255px; }
.inline-password-form .form-input { min-height: 36px; }

.auth-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 28px;
    background:
        radial-gradient(circle at 0 0, rgba(88,101,242,.17), transparent 30%),
        radial-gradient(circle at 100% 100%, rgba(17,121,201,.12), transparent 30%),
        #f4f6fb;
}
.auth-shell {
    width: min(980px, 100%);
    min-height: 590px;
    display: grid;
    grid-template-columns: 1.06fr .94fr;
    overflow: hidden;
    background: #fff;
    border: 1px solid rgba(214,220,230,.9);
    border-radius: 26px;
    box-shadow: 0 35px 90px rgba(31,42,68,.18);
}
.auth-visual {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 42px;
    color: #fff;
    background:
        radial-gradient(circle at 80% 20%, rgba(124,134,255,.5), transparent 30%),
        linear-gradient(145deg, #111a31, #0b1120 70%);
}
.auth-visual::before, .auth-visual::after { content: ""; position: absolute; border: 1px solid rgba(255,255,255,.08); border-radius: 50%; }
.auth-visual::before { width: 330px; height: 330px; top: 80px; right: -170px; }
.auth-visual::after { width: 210px; height: 210px; left: -100px; bottom: 65px; }
.auth-brand { position: relative; z-index: 1; display: inline-flex; align-items: center; gap: 12px; }
.auth-brand .brand-symbol { width: 44px; height: 44px; }
.auth-brand strong { display: block; font-size: 18px; letter-spacing: .09em; }
.auth-brand span { display: block; margin-top: 4px; color: #9faac0; font-size: 10px; font-weight: 700; }
.auth-message { position: relative; z-index: 1; max-width: 410px; }
.auth-message h1 { margin: 0; font-size: clamp(30px, 3.1vw, 45px); line-height: 1.08; letter-spacing: -.045em; }
.auth-message p { margin: 18px 0 0; color: #a8b3c7; font-size: 13px; line-height: 1.75; }
.auth-features { position: relative; z-index: 1; display: grid; gap: 10px; }
.auth-feature { display: flex; align-items: center; gap: 10px; color: #c5cede; font-size: 11px; font-weight: 650; }
.auth-feature i { width: 23px; height: 23px; display: grid; place-items: center; color: #93a0ff; background: rgba(88,101,242,.16); border-radius: 8px; font-style: normal; }
.auth-feature svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; }
.auth-form-side { display: flex; align-items: center; padding: 48px; }
.auth-form-box { width: 100%; max-width: 370px; margin: 0 auto; }
.auth-form-box .eyebrow { color: var(--primary); }
.auth-form-box h2 { margin: 7px 0 9px; font-size: 27px; letter-spacing: -.035em; }
.auth-form-box > p { margin: 0 0 24px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.auth-form { display: grid; gap: 15px; }
.auth-form .form-input { min-height: 48px; font-size: 13px; }
.auth-form .btn { min-height: 48px; margin-top: 3px; font-size: 13px; }
.auth-security { display: flex; align-items: center; justify-content: center; gap: 7px; margin-top: 20px; color: var(--muted-2); font-size: 9px; }
.auth-security svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; }

@media (max-width: 1220px) {
    .metrics-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .metrics-grid-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
    .rates-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
    .staff-form-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .staff-form-grid .btn { align-self: end; }
}

@media (max-width: 1020px) {
    :root { --sidebar-width: 236px; }
    .page-content { padding-left: 22px; padding-right: 22px; }
    .topbar { padding-left: 22px; padding-right: 22px; }
    .dashboard-panels, .accounting-layout { grid-template-columns: 1fr; }
    .rates-grid { grid-template-columns: repeat(4, minmax(0,1fr)); }
    .user-copy { display: none; }
}

@media (max-width: 820px) {
    :root { --sidebar-width: 268px; --topbar-height: 70px; }
    .sidebar { transform: translateX(-100%); transition: transform .22s ease; box-shadow: var(--shadow-lg); }
    body.sidebar-open { overflow: hidden; }
    body.sidebar-open .sidebar { transform: translateX(0); }
    .sidebar-backdrop { position: fixed; inset: 0; z-index: 60; display: block; visibility: hidden; opacity: 0; background: rgba(9,14,27,.55); backdrop-filter: blur(2px); transition: opacity .22s ease, visibility .22s ease; }
    body.sidebar-open .sidebar-backdrop { visibility: visible; opacity: 1; }
    .sidebar-close { width: 34px; height: 34px; display: grid; place-items: center; padding: 0; color: #9eabc0; background: rgba(255,255,255,.05); border: 0; border-radius: 9px; cursor: pointer; }
    .sidebar-close svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.9; }
    .app-main { margin-left: 0; }
    .mobile-menu-button { display: inline-grid; }
    .topbar-date { display: none; }
    .page-content { padding: 22px 16px 34px; }
    .topbar { padding: 0 16px; }
    .page-heading { align-items: flex-start; flex-direction: column; }
    .heading-actions { width: 100%; }
    .rates-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
    .auth-shell { grid-template-columns: 1fr; max-width: 520px; }
    .auth-visual { min-height: 275px; padding: 30px; }
    .auth-message h1 { font-size: 32px; }
    .auth-message p { margin-top: 12px; }
    .auth-features { display: none; }
    .auth-form-side { padding: 36px 30px; }
}

@media (max-width: 620px) {
    .topbar-title { font-size: 15px; }
    .eyebrow { display: none; }
    .user-avatar { width: 36px; height: 36px; }
    .metrics-grid, .metrics-grid-3, .staff-stats { grid-template-columns: 1fr; }
    .metric-card { min-height: 125px; }
    .metric-value { margin-top: 15px; }
    .rates-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .card-head { align-items: flex-start; flex-direction: column; }
    .segmented { width: 100%; overflow-x: auto; }
    .segmented a { flex: 1; justify-content: center; white-space: nowrap; }
    .search-form { flex-direction: column; }
    .search-form .btn { width: 100%; }
    .filter-form { align-items: stretch; flex-direction: column; }
    .form-field { min-width: 0; width: 100%; }
    .filter-form .btn { width: 100%; }
    .staff-form-grid { grid-template-columns: 1fr; }
    .pagination-bar { align-items: flex-start; flex-direction: column; }
    .pagination { max-width: 100%; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 2px; }
    .pagination a, .pagination span { flex: 0 0 auto; }
    .table-card-head { align-items: flex-start; flex-direction: column; }
    .inline-password-form { min-width: 230px; }
    .page-heading h1 { font-size: 25px; }
    .heading-actions .btn { flex: 1; }
    .auth-page { padding: 14px; }
    .auth-shell { border-radius: 20px; }
    .auth-visual { min-height: 230px; padding: 25px; }
    .auth-message h1 { font-size: 27px; }
    .auth-message p { font-size: 11px; }
    .auth-form-side { padding: 30px 22px; }
}

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