/* ============================================
   DASHBOARD LAYOUT - Sidebar + Main Content
   Dark Editorial Design System
   ============================================ */
*, *::before, *::after { box-sizing: border-box; }

body {
    margin: 0 !important;
    padding: 0 !important;
    background: var(--color-bg-primary) !important;
    overflow-x: hidden;
    display: block !important;
    align-items: unset !important;
    justify-content: unset !important;
    min-height: 100vh;
}

/* ============================================
   SIDEBAR
   ============================================ */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 260px;
    height: 100vh;
    background: var(--color-bg-secondary);
    border-right: 1px solid var(--color-border);
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 99;
}

/* Brand */
.sidebar-brand {
    padding: 24px 20px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    border-bottom: 1px solid var(--color-border);
}

.sidebar-logo {
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    max-width: 36px !important;
    max-height: 36px !important;
    border-radius: 10px !important;
    overflow: hidden !important;
    background: var(--color-bg-tertiary) !important;
    flex-shrink: 0;
    padding: 0 !important;
    margin: 0 !important;
}

.sidebar-logo-img {
    display: block !important;
    width: 36px !important;
    height: 36px !important;
    max-width: 36px !important;
    max-height: 36px !important;
    min-width: 0 !important;
    min-height: 0 !important;
    object-fit: cover !important;
    padding: 0 !important;
    margin: 0 !important;
    opacity: 1 !important;
    border-radius: 10px !important;
}

.sidebar-brand-text {
    overflow: hidden;
}

.sidebar-venue-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--color-text-primary);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-venue-sub {
    font-size: 11px;
    font-weight: 500;
    color: var(--color-text-tertiary);
    letter-spacing: 0.3px;
}

/* Navigation */
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 12px 12px;
    scrollbar-width: none;
}

.sidebar-nav::-webkit-scrollbar { display: none; }

.sidebar-section-label {
    font-size: 10px;
    font-weight: 700;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 1.2px;
    padding: 16px 12px 8px;
    margin-top: 4px;
}

.sidebar-section-label:first-child {
    margin-top: 0;
    padding-top: 8px;
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: 12px;
    color: var(--color-text-secondary);
    text-decoration: none;
    cursor: pointer;
    transition: all 0.15s ease;
    position: relative;
    margin-bottom: 2px;
}

.sidebar-item:hover {
    background: var(--color-bg-hover);
    color: var(--color-text-primary);
}

.sidebar-item.active {
    background: var(--accent-color-dim, rgba(0, 207, 180, 0.15));
    color: var(--color-text-primary);
}

.sidebar-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 6px;
    bottom: 6px;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: var(--accent-color, #00cfb4);
}

.sidebar-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    opacity: 0.6;
}

.sidebar-item.active .sidebar-icon {
    opacity: 1;
    color: var(--accent-color, #00cfb4);
}

.sidebar-label {
    font-size: 14px;
    font-weight: 500;
    flex: 1;
    white-space: nowrap;
}

.sidebar-item.active .sidebar-label {
    font-weight: 600;
}

.sidebar-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    background: var(--color-bg-tertiary);
    color: var(--color-text-tertiary);
    min-width: 24px;
    text-align: center;
}

.sidebar-badge.live-pulse {
    background: var(--color-success-bg);
    color: var(--color-success);
}

/* Footer */
.sidebar-footer {
    padding: 16px 12px;
    border-top: 1px solid var(--color-border);
}

.sidebar-signout {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 14px;
    border-radius: 12px;
    border: none;
    background: var(--color-error-bg);
    color: rgba(239, 68, 68, 0.7);
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    transition: all 0.15s ease;
}

.sidebar-signout:hover {
    background: rgba(239, 68, 68, 0.2);
    color: var(--color-error);
}

/* ============================================
   MAIN WRAPPER
   ============================================ */
.main-wrapper {
    margin-left: 260px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    width: calc(100% - 260px);
}

/* ============================================
   TOP BAR
   ============================================ */
.topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 28px;
    background: rgba(10, 10, 10, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--color-border);
    min-height: 64px;
    flex-wrap: wrap;
}

.topbar-menu {
    display: none;
    background: none;
    border: none;
    color: var(--color-text-secondary);
    cursor: pointer;
    padding: 6px;
    border-radius: 8px;
}

.topbar-menu:hover {
    background: var(--color-bg-hover);
    color: var(--color-text-primary);
}

.topbar-title {
    font-size: var(--font-size-lg);
    font-weight: 700;
    color: var(--color-text-primary);
    margin: 0;
    white-space: nowrap;
}

.topbar-stats {
    display: flex;
    align-items: center;
    gap: 0;
    margin-left: auto;
    background: var(--color-bg-secondary);
    border-radius: 12px;
    border: 1px solid var(--color-border);
    padding: 0 4px;
}

.topbar-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 14px;
    gap: 1px;
}

.topbar-stat-val {
    font-size: 16px;
    font-weight: 700;
    color: var(--color-text-primary);
    line-height: 1.2;
}

.topbar-stat-val.revenue {
    color: var(--color-success);
}

.topbar-stat-lbl {
    font-size: 9px;
    font-weight: 600;
    color: var(--color-text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.topbar-stat-divider {
    width: 1px;
    height: 28px;
    background: var(--color-border);
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.topbar-select {
    padding: 7px 28px 7px 12px;
    background: var(--color-bg-tertiary);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    color: var(--color-text-primary);
    font-size: 12px;
    font-weight: 600;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23737373' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 12px;
    font-family: inherit;
}

.topbar-refresh {
    padding: 7px;
    background: var(--color-bg-tertiary);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    color: var(--color-text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.topbar-refresh:hover {
    background: var(--color-bg-hover);
    color: var(--color-text-primary);
}

.topbar-refresh.spinning svg {
    animation: spin 0.8s linear infinite;
}

.topbar-updated {
    font-size: 11px;
    font-weight: 500;
    color: var(--color-text-tertiary);
    white-space: nowrap;
}

/* ============================================
   CONTENT AREA
   ============================================ */
.content-area {
    flex: 1;
    padding: 24px 28px;
}

.dash-content {
    display: none;
    animation: dashFadeIn 0.25s ease;
}

.dash-content.active {
    display: block;
}

@keyframes dashFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ============================================
   KPI CARDS ROW
   ============================================ */
.kpi-row {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}

.kpi-card {
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: 16px;
    padding: 18px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: all 0.25s ease;
}

.kpi-card:hover {
    border-color: var(--color-border-light);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.kpi-card.kpi-highlight {
    border-color: rgba(255, 200, 0, 0.25);
    background: rgba(255, 200, 0, 0.04);
}

.kpi-icon {
    width: 42px;
    height: 42px;
    min-width: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.kpi-icon.blue { background: rgba(74, 144, 226, 0.12); color: var(--accent-color, #00cfb4); }
.kpi-icon.green { background: var(--color-success-bg); color: var(--color-success); }
.kpi-icon.purple { background: rgba(139, 92, 246, 0.12); color: #8b5cf6; }
.kpi-icon.gold { background: rgba(255, 200, 0, 0.12); color: #ffc800; }
.kpi-icon.red { background: var(--color-error-bg); color: var(--color-error); }

.kpi-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.kpi-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--color-text-primary);
    line-height: 1.2;
    white-space: nowrap;
}

.kpi-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--color-text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ============================================
   2-COLUMN ANALYTICS GRID
   ============================================ */
.analytics-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.analytics-full {
    grid-column: 1 / -1;
}

/* ============================================
   CHART CARD
   ============================================ */
.chart-card {
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: 16px;
    overflow: hidden;
}

.chart-card-header {
    padding: 20px 24px 14px;
    border-bottom: 1px solid var(--color-border);
}

.chart-card-header h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--color-text-primary);
    margin: 0;
}

.chart-card-header span {
    font-size: 12px;
    font-weight: 500;
    color: var(--color-text-tertiary);
    display: block;
    margin-top: 3px;
}

.chart-canvas-wrap {
    padding: 20px 20px 16px;
    height: 300px;
    position: relative;
}

/* ============================================
   TODAY'S SNAPSHOT (on Live tab)
   ============================================ */
.today-snapshot {
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: 16px;
    padding: 16px 20px;
    margin-bottom: 16px;
}

.today-snapshot-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.today-snapshot-header svg {
    color: var(--accent-color, #00cfb4);
}

.today-snapshot-stats {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
}

.today-stat {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 70px;
}

.today-stat-val {
    font-size: 22px;
    font-weight: 800;
    color: var(--color-text-primary);
    letter-spacing: -0.5px;
}

.today-stat-val.revenue {
    color: var(--color-success);
}

.today-stat-lbl {
    font-size: 11px;
    font-weight: 500;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.today-snapshot-extras {
    display: flex;
    gap: 20px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--color-border);
    flex-wrap: wrap;
}

.today-extra {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 500;
    color: var(--color-text-secondary);
}

.today-extra svg {
    color: var(--accent-color, #00cfb4);
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .today-snapshot-stats {
        gap: 16px;
    }
    .today-stat-val {
        font-size: 18px;
    }
}

/* ============================================
   LIVE CONTROLS
   ============================================ */
.live-controls {
    display: flex;
    gap: 14px;
    margin-bottom: 20px;
    align-items: center;
    flex-wrap: wrap;
}

.search-box {
    position: relative;
    flex: 1;
    min-width: 200px;
    max-width: 420px;
}

.search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-text-tertiary);
    pointer-events: none;
}

.search-box input {
    width: 100%;
    padding: 10px 14px 10px 42px;
    background: var(--color-bg-tertiary);
    border: 1px solid var(--color-border);
    border-radius: 10px;
    color: var(--color-text-primary);
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    transition: all 0.15s ease;
}

.search-box input:focus {
    outline: none;
    border-color: var(--accent-color, #00cfb4);
    background: var(--color-bg-hover);
}

.search-box input::placeholder { color: var(--color-text-tertiary); }

.filter-pills {
    display: flex;
    gap: 6px;
}

.filter-pill {
    padding: 8px 16px;
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    color: var(--color-text-secondary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: inherit;
}

.filter-pill:hover {
    background: var(--color-bg-hover);
    color: var(--color-text-primary);
}

.filter-pill.active {
    background: var(--accent-color, #00cfb4);
    border-color: var(--accent-color, #00cfb4);
    color: var(--color-text-primary);
}

/* ============================================
   TABLES GRID
   ============================================ */
.tables-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 20px;
    width: 100%;
}

/* ============================================
   TABLE CARD
   ============================================ */
.table-card {
    background: var(--color-bg-secondary);
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--color-border);
    transition: all 0.25s ease;
}

.table-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    border-color: var(--color-border-light);
}

.table-card.active {
    border-color: var(--card-accent, var(--accent-color, #00cfb4));
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--card-accent, var(--accent-color, #00cfb4)) 15%, transparent),
                0 8px 24px rgba(0, 0, 0, 0.3);
}

/* --- Header --- */
.table-header {
    padding: 16px 20px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.header-row-1 {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

.table-label {
    font-size: var(--font-size-lg);
    font-weight: 700;
    color: var(--color-text-primary);
}

.table-type-text {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.header-row-2 {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.player-count {
    display: flex;
    align-items: center;
    gap: 6px;
}

.count-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--color-text-tertiary);
    transition: background 0.2s ease;
}

.count-dot.active {
    box-shadow: 0 0 6px currentColor;
}

.count-text {
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text-secondary);
}

.rate-text {
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text-tertiary);
}

/* --- Divider --- */
.card-divider {
    height: 1px;
    background: var(--color-border);
    margin: 0 20px;
}

.player-chips-container {
    padding: 14px 20px;
    min-height: 180px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, auto);
    justify-items: center;
    align-content: center;
    gap: 10px 8px;
    background-image: url('/images/tablegrid.png');
    background-size: 32px 32px;
    background-repeat: repeat;
    background-position: center;
    opacity: 0.55;
}

.table-card.active .player-chips-container {
    opacity: 1;
}

.player-chip-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    min-width: 72px;
}

.chip-circle {
    width: 64px;
    height: 64px;
    min-width: 64px;
    min-height: 64px;
    aspect-ratio: 1;
    border-radius: 50%;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s ease;
}

.player-chip-wrapper:hover .chip-circle { transform: scale(1.05); }

.chip-initials {
    font-size: 16px;
    font-weight: 700;
    color: var(--color-bg-primary);
    text-transform: uppercase;
    line-height: 1;
}

.chip-icon {
    width: 26px;
    height: 26px;
    object-fit: contain;
    opacity: 0.6;
}

.chip-progress {
    position: absolute;
    top: -4px;
    left: -4px;
    width: 72px;
    height: 72px;
    pointer-events: none;
}

.chip-progress svg { transform: rotate(-90deg); }
.chip-progress circle { fill: none; stroke-width: 3; stroke-linecap: round; }
.progress-bg { stroke: rgba(0, 0, 0, 0.1); }
.progress-fill { stroke: var(--accent-color); transition: stroke-dashoffset 0.3s ease; }

.chip-progress-inner {
    position: absolute;
    top: 6px;
    left: 6px;
    width: 52px;
    height: 52px;
    pointer-events: none;
}

.chip-progress-inner svg { transform: rotate(-90deg); }
.chip-progress-inner circle { fill: none; stroke: #A0D328; stroke-width: 3; stroke-linecap: round; }

.chip-circle.paused {
    border: 3px solid #ff9500;
    animation: pausePulse 1s ease-in-out infinite;
}

@keyframes pausePulse {
    0%, 100% { transform: scale(0.95); opacity: 0.8; }
    50% { transform: scale(1.0); opacity: 1.0; }
}

.chip-info { display: flex; flex-direction: column; align-items: center; gap: 1px; }
.chip-name { font-size: 10px; font-weight: 600; color: var(--color-text-primary); max-width: 76px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip-time { font-size: 9px; font-weight: 500; color: var(--color-text-tertiary); }
.chip-amount { font-size: 10px; font-weight: 700; color: var(--accent-color); }

.chip-empty {
    width: 64px;
    height: 64px;
    aspect-ratio: 1;
    border-radius: 50%;
    background: var(--color-bg-tertiary);
    border: 2px dashed var(--color-border);
}

/* --- Footer (3-column stats) --- */
.table-footer {
    padding: 12px 0;
    border-top: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(26, 26, 31, 0.5);
    border-radius: 0 0 16px 16px;
}

.footer-stat {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.footer-value {
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text-secondary);
    line-height: 1.2;
}

.footer-value.elapsed-value {
    color: var(--card-accent, var(--accent-color, #00cfb4));
}

.footer-value.total-value {
    color: var(--color-text-tertiary);
    transition: color 0.3s;
}

.footer-value.total-value.has-value {
    color: #22c55e;
}

.footer-label {
    font-size: 8px;
    font-weight: 600;
    letter-spacing: 0.12em;
    color: var(--color-text-tertiary);
    text-transform: uppercase;
}

.footer-divider {
    width: 1px;
    height: 32px;
    background: var(--color-border);
    flex-shrink: 0;
}

/* ============================================
   WAITLIST LIVE
   ============================================ */
.waitlist-live-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.waitlist-entry {
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: 16px;
    padding: 16px 20px;
    transition: all 0.2s ease;
}

.waitlist-entry:hover {
    background: var(--color-bg-tertiary);
    border-color: var(--color-border-light);
}

.waitlist-entry-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 10px; }
.waitlist-name { font-size: 17px; font-weight: 700; color: var(--color-text-primary); margin-bottom: 3px; }
.waitlist-party { font-size: 13px; font-weight: 500; color: var(--color-text-secondary); }

.waitlist-status { padding: 4px 12px; border-radius: 8px; font-size: 11px; font-weight: 600; text-transform: capitalize; }
.waitlist-status.waiting { background: rgba(234, 179, 8, 0.15); color: var(--color-warning); }
.waitlist-status.alerted { background: var(--color-success-bg); color: var(--color-success); }

.waitlist-entry-details { display: flex; gap: 16px; flex-wrap: wrap; }
.waitlist-detail { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--color-text-secondary); }
.waitlist-detail svg { width: 15px; height: 15px; opacity: 0.5; }
.waitlist-phone { color: var(--accent-color); text-decoration: none; font-weight: 500; }
.waitlist-phone:hover { text-decoration: underline; }

/* ============================================
   EMPTY / LOADING
   ============================================ */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 100px 20px;
    gap: 20px;
}

.loading-spinner {
    width: 44px;
    height: 44px;
    border: 3px solid var(--color-border);
    border-top-color: var(--accent-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loading-state p { font-size: 15px; font-weight: 500; color: var(--color-text-secondary); }

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    gap: 14px;
}

.empty-state svg { color: var(--color-text-tertiary); opacity: 0.4; }
.empty-state h3 { font-size: 18px; font-weight: 700; color: var(--color-text-primary); margin: 0; }
.empty-state p { font-size: 14px; font-weight: 500; color: var(--color-text-secondary); margin: 0; }
.empty-message { text-align: center; color: var(--color-text-secondary); padding: 60px 20px; font-size: 15px; }

/* ============================================
   TABLE CARD STAGGER ANIMATION
   ============================================ */
.table-card { animation: dashFadeIn 0.35s ease backwards; }
.table-card:nth-child(1) { animation-delay: 0.03s; }
.table-card:nth-child(2) { animation-delay: 0.06s; }
.table-card:nth-child(3) { animation-delay: 0.09s; }
.table-card:nth-child(4) { animation-delay: 0.12s; }
.table-card:nth-child(5) { animation-delay: 0.15s; }
.table-card:nth-child(6) { animation-delay: 0.18s; }

/* ============================================
   RESPONSIVE - Tablet
   ============================================ */
@media (max-width: 1100px) {
    .topbar-stats {
        display: none;
    }

    .analytics-2col {
        grid-template-columns: 1fr;
    }

    .analytics-full {
        grid-column: 1;
    }

    .kpi-row {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ============================================
   RESPONSIVE - Mobile
   ============================================ */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-overlay.open {
        display: block;
    }

    .main-wrapper {
        margin-left: 0;
        width: 100%;
    }

    .topbar-menu {
        display: flex;
    }

    .topbar {
        padding: 12px 16px;
        gap: 10px;
    }

    .topbar-title {
        font-size: 16px;
    }

    .topbar-updated {
        display: none;
    }

    .content-area {
        padding: 16px;
    }

    .tables-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .live-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .search-box {
        max-width: none;
    }

    .filter-pills {
        justify-content: stretch;
    }

    .filter-pill {
        flex: 1;
        text-align: center;
    }

    .kpi-row {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .kpi-card {
        padding: 14px 16px;
    }

    .kpi-value {
        font-size: 18px;
    }

    .chart-canvas-wrap {
        height: 240px;
        padding: 14px;
    }
}
