/* ================================================
   VVS Trader — Professional Trading Dashboard
   Light/Dark Theme System
   ================================================ */

/* ---- Reset ---- */
*, *::before, *::after {
    margin      : 0;
    padding     : 0;
    box-sizing  : border-box;
}

/* ================================================
   LIGHT THEME (Default)
   ================================================ */
:root {
    --bg-app        : #f0f2f5;
    --bg-sidebar    : #ffffff;
    --bg-card       : #ffffff;
    --bg-input      : #f8fafc;
    --bg-hover      : #f1f5f9;
    --bg-topbar     : #ffffff;

    --border        : #e2e8f0;
    --border-light  : #f1f5f9;
    --border-focus  : #2563eb;

    --text-primary  : #1a202c;
    --text-secondary: #64748b;
    --text-muted    : #94a3b8;
    --text-inverse  : #ffffff;

    --blue          : #2563eb;
    --blue-hover    : #1d4ed8;
    --blue-dim      : #eff6ff;
    --blue-border   : #bfdbfe;

    --green         : #16a34a;
    --green-dim     : #f0fdf4;
    --green-border  : #bbf7d0;
    --green-text    : #15803d;

    --red           : #dc2626;
    --red-dim       : #fef2f2;
    --red-border    : #fecaca;
    --red-text      : #b91c1c;

    --amber         : #d97706;
    --amber-dim     : #fffbeb;
    --amber-border  : #fde68a;

    --purple        : #7c3aed;
    --purple-dim    : #f5f3ff;
    --purple-border : #ddd6fe;

    --sidebar-width : 220px;
    --topbar-height : 56px;

    --radius-sm     : 6px;
    --radius-md     : 8px;
    --radius-lg     : 12px;

    --shadow-sm     : 0 1px 3px rgba(0,0,0,0.08),
                      0 1px 2px rgba(0,0,0,0.04);
    --shadow        : 0 4px 6px rgba(0,0,0,0.07),
                      0 2px 4px rgba(0,0,0,0.04);
    --shadow-lg     : 0 10px 15px rgba(0,0,0,0.08),
                      0 4px 6px rgba(0,0,0,0.04);
}

/* ================================================
   DARK THEME
   ================================================ */
[data-theme="dark"] {
    --bg-app        : #0a0a0f;
    --bg-sidebar    : #0f0f1a;
    --bg-card       : #141420;
    --bg-input      : #0f0f1a;
    --bg-hover      : #1a1a2e;
    --bg-topbar     : #0f0f1a;

    --border        : #1e1e30;
    --border-light  : #252538;
    --border-focus  : #3b82f6;

    --text-primary  : #e8e8f0;
    --text-secondary: #6b6b8a;
    --text-muted    : #3a3a52;
    --text-inverse  : #0a0a0f;

    --blue          : #3b82f6;
    --blue-hover    : #2563eb;
    --blue-dim      : rgba(59,130,246,0.12);
    --blue-border   : rgba(59,130,246,0.25);

    --green         : #22c55e;
    --green-dim     : rgba(34,197,94,0.12);
    --green-border  : rgba(34,197,94,0.25);
    --green-text    : #22c55e;

    --red           : #ef4444;
    --red-dim       : rgba(239,68,68,0.12);
    --red-border    : rgba(239,68,68,0.25);
    --red-text      : #ef4444;

    --amber         : #f59e0b;
    --amber-dim     : rgba(245,158,11,0.12);
    --amber-border  : rgba(245,158,11,0.25);

    --purple        : #a78bfa;
    --purple-dim    : rgba(167,139,250,0.12);
    --purple-border : rgba(167,139,250,0.25);

    --shadow-sm     : 0 1px 3px rgba(0,0,0,0.3);
    --shadow        : 0 4px 6px rgba(0,0,0,0.4);
    --shadow-lg     : 0 10px 15px rgba(0,0,0,0.5);
}

/* ================================================
   BASE
   ================================================ */
html, body {
    height     : 100%;
    font-family: 'Inter', 'Segoe UI', system-ui,
                 -apple-system, sans-serif;
    background : var(--bg-app);
    color      : var(--text-primary);
    font-size  : 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    transition : background 0.2s ease, color 0.2s ease;
}

/* ================================================
   LAYOUT
   ================================================ */
.layout {
    display  : flex;
    height   : 100vh;
    overflow : hidden;
}

/* ================================================
   SIDEBAR
   ================================================ */
.sidebar {
    width        : var(--sidebar-width);
    background   : var(--bg-sidebar);
    border-right : 1px solid var(--border);
    display      : flex;
    flex-direction: column;
    flex-shrink  : 0;
    z-index      : 100;
    transition   : background 0.2s ease;
}

.sidebar-logo {
    height         : var(--topbar-height);
    display        : flex;
    align-items    : center;
    padding        : 0 18px;
    border-bottom  : 1px solid var(--border);
    gap            : 10px;
    text-decoration: none;
}

.logo-mark {
    width          : 28px;
    height         : 28px;
    background     : var(--blue);
    border-radius  : var(--radius-sm);
    display        : flex;
    align-items    : center;
    justify-content: center;
    color          : white;
    font-size      : 14px;
    font-weight    : 700;
    flex-shrink    : 0;
}

.logo-text {
    font-size  : 15px;
    font-weight: 700;
    color      : var(--text-primary);
    letter-spacing: 0.2px;
}

.logo-text span {
    color: var(--blue);
}

.sidebar-nav {
    flex      : 1;
    padding   : 12px 10px;
    overflow-y: auto;
}

.nav-section {
    margin-bottom: 20px;
}

.nav-section-title {
    font-size     : 10px;
    font-weight   : 600;
    color         : var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1.2px;
    padding       : 0 8px;
    margin-bottom : 4px;
}

.nav-item {
    display        : flex;
    align-items    : center;
    gap            : 9px;
    padding        : 8px 10px;
    border-radius  : var(--radius-sm);
    color          : var(--text-secondary);
    text-decoration: none;
    font-size      : 13.5px;
    font-weight    : 500;
    transition     : all 0.15s ease;
    margin-bottom  : 1px;
    cursor         : pointer;
}

.nav-item:hover {
    background: var(--bg-hover);
    color     : var(--text-primary);
}

.nav-item.active {
    background: var(--blue-dim);
    color     : var(--blue);
    font-weight: 600;
}

.nav-icon {
    font-size : 15px;
    width     : 18px;
    text-align: center;
    flex-shrink: 0;
}

.sidebar-bottom {
    padding      : 12px 10px;
    border-top   : 1px solid var(--border);
    display      : flex;
    flex-direction: column;
    gap          : 6px;
}

.emergency-btn {
    width          : 100%;
    display        : flex;
    align-items    : center;
    justify-content: center;
    gap            : 6px;
    padding        : 8px;
    background     : var(--red-dim);
    border         : 1px solid var(--red-border);
    border-radius  : var(--radius-sm);
    color          : var(--red-text);
    font-size      : 12px;
    font-weight    : 600;
    cursor         : pointer;
    text-decoration: none;
    transition     : all 0.15s ease;
}

.emergency-btn:hover {
    background: var(--red);
    color     : white;
    border-color: var(--red);
}

.logout-btn {
    width          : 100%;
    display        : flex;
    align-items    : center;
    justify-content: center;
    gap            : 6px;
    padding        : 8px;
    background     : transparent;
    border         : 1px solid var(--border);
    border-radius  : var(--radius-sm);
    color          : var(--text-secondary);
    font-size      : 12px;
    font-weight    : 500;
    cursor         : pointer;
    text-decoration: none;
    transition     : all 0.15s ease;
}

.logout-btn:hover {
    background  : var(--bg-hover);
    color       : var(--text-primary);
    border-color: var(--border-light);
}

/* ================================================
   MAIN AREA
   ================================================ */
.main {
    flex          : 1;
    display       : flex;
    flex-direction: column;
    overflow      : hidden;
    min-width     : 0;
}

/* ---- Topbar ---- */
.topbar {
    height        : var(--topbar-height);
    background    : var(--bg-topbar);
    border-bottom : 1px solid var(--border);
    display       : flex;
    align-items   : center;
    justify-content: space-between;
    padding       : 0 24px;
    flex-shrink   : 0;
    box-shadow    : var(--shadow-sm);
}

.topbar-left .page-title {
    font-size  : 15px;
    font-weight: 600;
    color      : var(--text-primary);
}

.topbar-left .page-subtitle {
    font-size: 12px;
    color    : var(--text-muted);
}

.topbar-right {
    display    : flex;
    align-items: center;
    gap        : 8px;
}

.topbar-stat {
    display       : flex;
    flex-direction: column;
    align-items   : flex-end;
    padding       : 0 12px;
}

.topbar-stat .t-label {
    font-size     : 10px;
    color         : var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    line-height   : 1;
    margin-bottom : 2px;
}

.topbar-stat .t-value {
    font-size  : 13px;
    font-weight: 600;
    color      : var(--text-primary);
    line-height: 1;
}

.t-value.positive { color: var(--green-text); }
.t-value.negative { color: var(--red-text); }

.topbar-divider {
    width     : 1px;
    height    : 24px;
    background: var(--border);
}

/* Kite status pill */
.kite-pill {
    display        : flex;
    align-items    : center;
    gap            : 6px;
    padding        : 5px 12px;
    border-radius  : 20px;
    font-size      : 12px;
    font-weight    : 600;
    cursor         : pointer;
    text-decoration: none;
    transition     : all 0.15s;
    border         : 1px solid transparent;
}

.kite-pill.connected {
    background  : var(--green-dim);
    border-color: var(--green-border);
    color       : var(--green-text);
}

.kite-pill.disconnected {
    background  : var(--amber-dim);
    border-color: var(--amber-border);
    color       : var(--amber);
}

.kite-pill.refresh-needed {
    background  : var(--blue-dim);
    border-color: var(--blue-border);
    color       : var(--blue);
}

.status-dot {
    width        : 6px;
    height       : 6px;
    border-radius: 50%;
    flex-shrink  : 0;
}

.dot-green {
    background: var(--green);
    box-shadow: 0 0 0 2px var(--green-dim);
}

.dot-amber {
    background: var(--amber);
    animation : pulse-dot 1.5s infinite;
}

.dot-blue {
    background: var(--blue);
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.3; }
}

/* Theme toggle button */
.theme-toggle {
    width          : 32px;
    height         : 32px;
    border-radius  : var(--radius-sm);
    border         : 1px solid var(--border);
    background     : var(--bg-card);
    color          : var(--text-secondary);
    cursor         : pointer;
    display        : flex;
    align-items    : center;
    justify-content: center;
    font-size      : 15px;
    transition     : all 0.15s;
}

.theme-toggle:hover {
    background: var(--bg-hover);
    color     : var(--text-primary);
}

/* ---- Content Area ---- */
.content {
    flex      : 1;
    overflow-y: auto;
    padding   : 20px 24px;
}

/* ================================================
   CARDS
   ================================================ */
.card {
    background   : var(--bg-card);
    border       : 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow   : var(--shadow-sm);
}

.card-body {
    padding: 20px;
}

.card-header {
    display        : flex;
    justify-content: space-between;
    align-items    : center;
    padding        : 14px 20px;
    border-bottom  : 1px solid var(--border);
}

.card-title {
    font-size     : 12px;
    font-weight   : 600;
    color         : var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

/* ================================================
   STAT CARDS
   ================================================ */
.stats-grid {
    display              : grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap                  : 14px;
    margin-bottom        : 20px;
}

.stat-card {
    background   : var(--bg-card);
    border       : 1px solid var(--border);
    border-radius: var(--radius-md);
    padding      : 16px 18px;
    box-shadow   : var(--shadow-sm);
}

.stat-label {
    font-size     : 11px;
    font-weight   : 600;
    color         : var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom : 6px;
}

.stat-value {
    font-size  : 22px;
    font-weight: 700;
    color      : var(--text-primary);
    line-height: 1;
    margin-bottom: 4px;
    font-variant-numeric: tabular-nums;
}

.stat-value.positive { color: var(--green-text); }
.stat-value.negative { color: var(--red-text); }

.stat-sub {
    font-size: 12px;
    color    : var(--text-muted);
}

.stat-indicator {
    display      : inline-flex;
    align-items  : center;
    gap          : 3px;
    font-size    : 11px;
    font-weight  : 600;
    padding      : 2px 6px;
    border-radius: 4px;
    margin-top   : 4px;
}

.stat-indicator.up {
    background: var(--green-dim);
    color     : var(--green-text);
}

.stat-indicator.down {
    background: var(--red-dim);
    color     : var(--red-text);
}

/* ================================================
   STATUS ROW
   ================================================ */
.status-row {
    display  : flex;
    gap      : 10px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.status-pill {
    display      : flex;
    align-items  : center;
    gap          : 6px;
    padding      : 6px 14px;
    border-radius: 20px;
    font-size    : 12px;
    font-weight  : 500;
    border       : 1px solid var(--border);
    background   : var(--bg-card);
    color        : var(--text-secondary);
    box-shadow   : var(--shadow-sm);
}

.status-pill .s-label {
    color: var(--text-muted);
    font-size: 11px;
}

.status-pill .s-value {
    font-weight: 600;
    color      : var(--text-primary);
}

.status-pill.open .s-value  { color: var(--green-text); }
.status-pill.closed .s-value { color: var(--red-text); }

/* ================================================
   BADGES
   ================================================ */
.badge {
    display      : inline-flex;
    align-items  : center;
    gap          : 4px;
    padding      : 2px 8px;
    border-radius: 4px;
    font-size    : 11px;
    font-weight  : 600;
    white-space  : nowrap;
}

.badge-green {
    background: var(--green-dim);
    color     : var(--green-text);
    border    : 1px solid var(--green-border);
}

.badge-red {
    background: var(--red-dim);
    color     : var(--red-text);
    border    : 1px solid var(--red-border);
}

.badge-blue {
    background: var(--blue-dim);
    color     : var(--blue);
    border    : 1px solid var(--blue-border);
}

.badge-amber {
    background: var(--amber-dim);
    color     : var(--amber);
    border    : 1px solid var(--amber-border);
}

.badge-purple {
    background: var(--purple-dim);
    color     : var(--purple);
    border    : 1px solid var(--purple-border);
}

.badge-gray {
    background: var(--bg-hover);
    color     : var(--text-secondary);
    border    : 1px solid var(--border);
}

/* ================================================
   TABLES
   ================================================ */
.table-wrap {
    overflow-x: auto;
    border-radius: var(--radius-md);
}

table {
    width          : 100%;
    border-collapse: collapse;
    font-size      : 13px;
}

thead tr {
    border-bottom: 1px solid var(--border);
    background   : var(--bg-hover);
}

thead th {
    padding       : 10px 16px;
    text-align    : left;
    font-size     : 11px;
    font-weight   : 600;
    color         : var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    white-space   : nowrap;
}

tbody tr {
    border-bottom: 1px solid var(--border);
    transition   : background 0.1s;
}

tbody tr:last-child {
    border-bottom: none;
}

tbody tr:hover {
    background: var(--bg-hover);
}

tbody td {
    padding: 11px 16px;
    color  : var(--text-primary);
}

.td-muted {
    color    : var(--text-secondary);
    font-size: 12px;
}

.td-mono {
    font-family: 'Consolas', monospace;
    font-size  : 12px;
}

/* ================================================
   BUTTONS
   ================================================ */
.btn {
    display        : inline-flex;
    align-items    : center;
    justify-content: center;
    gap            : 6px;
    padding        : 7px 14px;
    border-radius  : var(--radius-sm);
    border         : 1px solid transparent;
    font-size      : 13px;
    font-weight    : 500;
    cursor         : pointer;
    text-decoration: none;
    transition     : all 0.15s ease;
    white-space    : nowrap;
    line-height    : 1;
}

.btn-primary {
    background  : var(--blue);
    color       : white;
    border-color: var(--blue);
}

.btn-primary:hover {
    background  : var(--blue-hover);
    border-color: var(--blue-hover);
}

.btn-secondary {
    background  : var(--bg-card);
    color       : var(--text-primary);
    border-color: var(--border);
}

.btn-secondary:hover {
    background: var(--bg-hover);
}

.btn-danger {
    background  : var(--red-dim);
    color       : var(--red-text);
    border-color: var(--red-border);
}

.btn-danger:hover {
    background  : var(--red);
    color       : white;
    border-color: var(--red);
}

.btn-success {
    background  : var(--green-dim);
    color       : var(--green-text);
    border-color: var(--green-border);
}

.btn-success:hover {
    background  : var(--green);
    color       : white;
    border-color: var(--green);
}

.btn-warning {
    background  : var(--amber-dim);
    color       : var(--amber);
    border-color: var(--amber-border);
}

.btn-warning:hover {
    background  : var(--amber);
    color       : white;
    border-color: var(--amber);
}

.btn-sm {
    padding  : 4px 10px;
    font-size: 12px;
}

.btn-lg {
    padding  : 10px 20px;
    font-size: 14px;
}

.btn-icon {
    width : 32px;
    height: 32px;
    padding: 0;
}

/* ================================================
   FORMS
   ================================================ */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display       : block;
    font-size     : 12px;
    font-weight   : 600;
    color         : var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-bottom : 6px;
}

.form-input,
.form-select {
    width        : 100%;
    padding      : 8px 12px;
    background   : var(--bg-input);
    border       : 1px solid var(--border);
    border-radius: var(--radius-sm);
    color        : var(--text-primary);
    font-size    : 13px;
    outline      : none;
    transition   : border-color 0.15s, box-shadow 0.15s;
    appearance   : none;
    line-height  : 1.5;
}

.form-input:focus,
.form-select:focus {
    border-color: var(--border-focus);
    box-shadow  : 0 0 0 3px var(--blue-dim);
}

.form-hint {
    font-size  : 11px;
    color      : var(--text-muted);
    margin-top : 4px;
}

/* ================================================
   ALERTS
   ================================================ */
.alert {
    display      : flex;
    align-items  : center;
    justify-content: space-between;
    padding      : 12px 16px;
    border-radius: var(--radius-md);
    margin-bottom: 16px;
    gap          : 12px;
    font-size    : 13px;
}

.alert p { margin: 0; }

.alert-warning {
    background  : var(--amber-dim);
    border      : 1px solid var(--amber-border);
    color       : var(--amber);
}

.alert-danger {
    background  : var(--red-dim);
    border      : 1px solid var(--red-border);
    color       : var(--red-text);
}

.alert-success {
    background  : var(--green-dim);
    border      : 1px solid var(--green-border);
    color       : var(--green-text);
}

.alert-info {
    background  : var(--blue-dim);
    border      : 1px solid var(--blue-border);
    color       : var(--blue);
}

/* ================================================
   WEBHOOK BOX
   ================================================ */
.webhook-box {
    background   : var(--bg-hover);
    border       : 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding      : 10px 14px;
    font-family  : 'Consolas', 'Courier New', monospace;
    font-size    : 12px;
    color        : var(--blue);
    word-break   : break-all;
}

/* ================================================
   SECTION LAYOUT
   ================================================ */
.section-header {
    display        : flex;
    justify-content: space-between;
    align-items    : center;
    margin-bottom  : 14px;
}

.section-title {
    font-size     : 13px;
    font-weight   : 600;
    color         : var(--text-primary);
}

/* ================================================
   GRID HELPERS
   ================================================ */
.grid-2 {
    display              : grid;
    grid-template-columns: 1fr 1fr;
    gap                  : 16px;
}

.grid-3 {
    display              : grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap                  : 16px;
}

.grid-auto {
    display              : grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap                  : 16px;
}

/* ================================================
   EMPTY STATE
   ================================================ */
.empty-state {
    text-align: center;
    padding   : 40px 24px;
    color     : var(--text-muted);
}

.empty-icon {
    font-size    : 32px;
    margin-bottom: 10px;
    opacity      : 0.5;
}

.empty-state p {
    font-size: 13px;
    color    : var(--text-secondary);
}

/* ================================================
   LOGIN PAGE
   ================================================ */
.login-page {
    min-height     : 100vh;
    display        : flex;
    align-items    : center;
    justify-content: center;
    background     : var(--bg-app);
}

.login-card {
    background   : var(--bg-card);
    border       : 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding      : 36px;
    width        : 100%;
    max-width    : 360px;
    box-shadow   : var(--shadow-lg);
}

.login-header {
    text-align   : center;
    margin-bottom: 28px;
}

.login-logo-mark {
    width          : 44px;
    height         : 44px;
    background     : var(--blue);
    border-radius  : var(--radius-md);
    display        : flex;
    align-items    : center;
    justify-content: center;
    font-size      : 20px;
    font-weight    : 800;
    color          : white;
    margin         : 0 auto 14px;
}

.login-header h1 {
    font-size  : 18px;
    font-weight: 700;
    color      : var(--text-primary);
    margin-bottom: 4px;
}

.login-header p {
    font-size: 13px;
    color    : var(--text-muted);
}

/* ================================================
   MODAL
   ================================================ */
.modal-overlay {
    display        : none;
    position       : fixed;
    top            : 0;
    left           : 0;
    width          : 100%;
    height         : 100%;
    background     : rgba(0,0,0,0.4);
    z-index        : 1000;
    align-items    : center;
    justify-content: center;
    backdrop-filter: blur(2px);
}

.modal-overlay.open {
    display: flex;
}

.modal {
    background   : var(--bg-card);
    border       : 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding      : 24px;
    width        : 100%;
    max-width    : 520px;
    margin       : 20px;
    box-shadow   : var(--shadow-lg);
}

.modal-header {
    display        : flex;
    justify-content: space-between;
    align-items    : center;
    margin-bottom  : 20px;
}

.modal-title {
    font-size  : 15px;
    font-weight: 600;
    color      : var(--text-primary);
}

.modal-close {
    background: none;
    border    : none;
    color     : var(--text-muted);
    font-size : 18px;
    cursor    : pointer;
    padding   : 4px;
    line-height: 1;
    border-radius: var(--radius-sm);
    transition: all 0.15s;
}

.modal-close:hover {
    background: var(--bg-hover);
    color     : var(--text-primary);
}

/* ================================================
   DIVIDER
   ================================================ */
.divider {
    height    : 1px;
    background: var(--border);
    margin    : 16px 0;
}

/* ================================================
   UTILITIES
   ================================================ */
.text-green   { color: var(--green-text) !important; }
.text-red     { color: var(--red-text) !important; }
.text-blue    { color: var(--blue) !important; }
.text-amber   { color: var(--amber) !important; }
.text-muted   { color: var(--text-muted) !important; }
.text-secondary { color: var(--text-secondary) !important; }
.text-right   { text-align: right; }
.text-center  { text-align: center; }
.font-mono    { font-family: 'Consolas', monospace; }
.font-medium  { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold    { font-weight: 700; }

.flex         { display: flex; }
.flex-col     { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-1       { flex: 1; }
.flex-wrap    { flex-wrap: wrap; }

.gap-4        { gap: 4px; }
.gap-6        { gap: 6px; }
.gap-8        { gap: 8px; }
.gap-12       { gap: 12px; }
.gap-16       { gap: 16px; }

.mt-4         { margin-top: 4px; }
.mt-8         { margin-top: 8px; }
.mt-12        { margin-top: 12px; }
.mt-16        { margin-top: 16px; }
.mt-20        { margin-top: 20px; }
.mb-8         { margin-bottom: 8px; }
.mb-12        { margin-bottom: 12px; }
.mb-16        { margin-bottom: 16px; }
.mb-20        { margin-bottom: 20px; }

.p-0          { padding: 0 !important; }
.w-full       { width: 100%; }
.h-full       { height: 100%; }
.overflow-hidden { overflow: hidden; }
.relative     { position: relative; }

/* ================================================
   SCROLLBAR
   ================================================ */
::-webkit-scrollbar       { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background   : var(--border);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ================================================
   TRANSITIONS
   ================================================ */
.card,
.sidebar,
.topbar,
.form-input,
.form-select,
.btn,
.badge,
.nav-item,
.stat-card {
    transition: background 0.2s ease,
                border-color 0.2s ease,
                color 0.2s ease,
                box-shadow 0.2s ease;
}

/* ================================================
   RESPONSIVE
   ================================================ */
@media (max-width: 768px) {
    .sidebar {
        display: none;
    }
    .grid-2,
    .grid-3 {
        grid-template-columns: 1fr;
    }
    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* Sortable table headers */
th[onclick] {
    transition: color 0.15s;
}

th[onclick]:hover {
    color: var(--blue);
}

/* Collapsible Filter Card

.filter-toggle-icon.collapsed {
    transform: rotate(-90deg);
}

.filter-body.collapsed {
    max-height : 0 !important;
    opacity    : 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

*/
.filter-body {
    transition : max-height 0.3s ease,
                 opacity 0.3s ease,
                 padding 0.3s ease;
    overflow   : hidden;
    max-height : 500px;
    opacity    : 1;
}



.filter-toggle-icon {
    transition : transform 0.3s ease;
    font-size  : 12px;
    color      : var(--text-muted);
}

.filter-summary {
    font-size : 12px;
    color     : var(--text-muted);
    transition: opacity 0.2s ease;
}

/* ================================================
   MULTI SELECT DROPDOWN
   ================================================ */
.multi-select {
    position: relative;
}

.multi-select-trigger {
    display        : flex;
    justify-content: space-between;
    align-items    : center;
    padding        : 8px 12px;
    background     : var(--bg-input);
    border         : 1px solid var(--border);
    border-radius  : var(--radius-sm);
    color          : var(--text-primary);
    font-size      : 13px;
    cursor         : pointer;
    user-select    : none;
    transition     : border-color 0.15s;
}

.multi-select-trigger:hover {
    border-color: var(--border-focus);
}

.multi-select-trigger.open {
    border-color: var(--border-focus);
    box-shadow  : 0 0 0 3px var(--blue-dim);
}

.multi-select-dropdown {
    display      : none;
    position     : absolute;
    top          : calc(100% + 4px);
    left         : 0;
    right        : 0;
    background   : var(--bg-card);
    border       : 1px solid var(--border);
    border-radius: var(--radius-sm);
    z-index      : 200;
    max-height   : 200px;
    overflow-y   : auto;
    box-shadow   : var(--shadow-lg);
}

.multi-select-dropdown.open {
    display: block;
}

.multi-select-option {
    display    : flex;
    align-items: center;
    gap        : 8px;
    padding    : 9px 14px;
    font-size  : 13px;
    color      : var(--text-primary);
    cursor     : pointer;
    transition : background 0.1s;
    border-bottom: 1px solid var(--border-light);
}

.multi-select-option:last-child {
    border-bottom: none;
}

.multi-select-option:hover {
    background: var(--bg-hover);
}

.multi-select-option input[type="checkbox"] {
    width        : 14px;
    height       : 14px;
    accent-color : var(--blue);
    cursor       : pointer;
    flex-shrink  : 0;
}

.multi-select-count {
    display      : inline-flex;
    align-items  : center;
    justify-content: center;
    background   : var(--blue);
    color        : white;
    border-radius: 10px;
    padding      : 1px 6px;
    font-size    : 11px;
    font-weight  : 600;
    margin-left  : 4px;
}