/* Quantrex My CEO by Quantrex LLC — Admin Panel (mobile-first) */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', sans-serif;
    background: #0d0f14; color: #e0e0e0;
    min-height: 100vh; min-height: 100dvh;
    -webkit-font-smoothing: antialiased;
}
a { color: #00d4aa; text-decoration: none; }
a:hover { text-decoration: underline; }
code { background: #1a1a1a; padding: 2px 6px; border-radius: 4px; font-size: 0.85em; color: #ccc; }
small { display: block; margin-top: 2px; }

/* ===== Layout ===== */
.container { max-width: 1200px; margin: 0 auto; padding: 16px; padding-top: 60px; padding-bottom: 80px; }

/* ===== Desktop Navigation (hidden on mobile) ===== */
.nav-desktop {
    display: none;
}

/* ===== Navigation base (shared) ===== */
.nav {
    background: #0a0c12; padding: 12px 16px;
    display: flex; align-items: center; gap: 8px;
    border-bottom: 1px solid #1e2030;
    position: sticky; top: 0; z-index: 100;
    overflow-x: auto; -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.nav::-webkit-scrollbar { display: none; }
.nav-brand { color: #00d4aa; font-weight: bold; font-size: 1em; white-space: nowrap; margin-right: 8px; }
.nav a {
    color: #888; font-size: 0.85em; white-space: nowrap;
    padding: 6px 10px; border-radius: 6px;
    transition: background 0.15s, color 0.15s;
    min-height: 36px; display: flex; align-items: center;
}
.nav a:hover, .nav a.active {
    color: #00d4aa; background: rgba(0,212,170,0.08);
    text-decoration: none;
}
.nav-logout { margin-left: auto !important; color: #e74c3c !important; }

/* Language Selector */
.lang-selector { display: flex; gap: 4px; margin-left: 8px; }
.lang-selector a {
    padding: 4px 8px; border-radius: 4px; font-size: 0.75em;
    color: #666; text-decoration: none; text-transform: uppercase;
    border: 1px solid transparent; transition: all 0.15s;
    min-width: 28px; min-height: 28px;
    display: inline-flex; align-items: center; justify-content: center;
}
.lang-selector a:hover { color: #00d4aa; border-color: #00d4aa33; }
.lang-selector a.active-lang { color: #00d4aa; border-color: #00d4aa; background: rgba(0,212,170,0.08); }

/* Brand */
.brand-text { color: #f0f1f3; font-weight: 700; font-size: 1.15em; letter-spacing: -0.3px; white-space: nowrap; }
.brand-text span { background: linear-gradient(135deg, #00d4aa, #00b4ff, #00d4aa); background-size: 200% auto; -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; animation: brandShift 4s ease-in-out infinite; }
@keyframes brandShift { 0%,100%{background-position:0% center} 50%{background-position:200% center} }

/* ===== Mobile Header ===== */
.mobile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 200;
    background: #0a0c12;
    border-bottom: 1px solid #1e2030;
    padding: 10px 16px;
    padding-top: calc(10px + env(safe-area-inset-top, 0px));
    height: auto;
    min-height: 50px;
}
.mobile-header::after {
    content: ''; position: absolute; bottom: -1px; left: 0; right: 0; height: 1px;
    background: linear-gradient(90deg, transparent 0%, #00d4aa33 30%, #00b4ff22 70%, transparent 100%);
}
.mobile-header .lang-selector { margin-left: 0; }

/* ===== Mobile Bottom Tab Bar ===== */
.bottom-nav {
    display: flex;
    align-items: stretch;
    justify-content: space-around;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    z-index: 200;
    background: #0a0c12;
    border-top: 1px solid #1e2030;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    height: auto;
}
.bottom-nav::before {
    content: ''; position: absolute; top: -1px; left: 0; right: 0; height: 1px;
    background: linear-gradient(90deg, transparent 0%, #00d4aa22 30%, #00b4ff15 70%, transparent 100%);
}
.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    flex: 1;
    padding: 10px 6px 8px;
    color: #555;
    font-size: 0.65em;
    text-decoration: none !important;
    background: none;
    border: none;
    cursor: pointer;
    transition: color 0.15s;
    -webkit-tap-highlight-color: transparent;
    font-family: inherit;
}
.bottom-nav-item svg {
    width: 24px;
    height: 24px;
    opacity: 0.5;
    transition: opacity 0.15s;
}
.bottom-nav-item.active,
.bottom-nav-item:active {
    color: #00d4aa;
}
.bottom-nav-item.active svg,
.bottom-nav-item:active svg {
    opacity: 1;
    stroke: #00d4aa;
}

/* ===== Drawer Overlay ===== */
.drawer-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 290;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    opacity: 0;
    transition: opacity 0.3s ease;
}
.drawer-overlay.open {
    display: block;
    opacity: 1;
}

/* ===== Drawer Menu ===== */
.drawer {
    position: fixed;
    top: 0; right: 0; bottom: 0;
    width: 280px;
    max-width: 90vw;
    z-index: 300;
    background: #0d0f14;
    border-left: 1px solid #1e2030;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
.drawer.open {
    transform: translateX(0);
}
.drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    padding-top: calc(16px + env(safe-area-inset-top, 0px));
    border-bottom: 1px solid #1e2030;
    flex-shrink: 0;
}
.drawer-close {
    background: none;
    border: none;
    cursor: pointer;
    color: #888;
    padding: 4px;
    border-radius: 6px;
    transition: color 0.15s, background 0.15s;
    -webkit-tap-highlight-color: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
}
.drawer-close:hover,
.drawer-close:active {
    color: #e74c3c;
    background: rgba(231,76,60,0.1);
}
.drawer-body {
    flex: 1;
    padding: 8px 0;
    overflow-y: auto;
}
.drawer-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: #999;
    font-size: 0.92em;
    text-decoration: none !important;
    transition: background 0.15s, color 0.15s;
    -webkit-tap-highlight-color: transparent;
}
.drawer-item svg {
    flex-shrink: 0;
    opacity: 0.5;
    transition: opacity 0.15s;
}
.drawer-item:hover,
.drawer-item:active,
.drawer-item.active {
    color: #00d4aa;
    background: rgba(0,212,170,0.06);
}
.drawer-item.active svg,
.drawer-item:hover svg {
    opacity: 1;
    stroke: #00d4aa;
}
.drawer-divider {
    height: 1px;
    background: #1e2030;
    margin: 6px 16px;
}
.drawer-footer {
    border-top: 1px solid #1e2030;
    padding: 4px 0;
    flex-shrink: 0;
    padding-bottom: env(safe-area-inset-bottom, 0px);
}
.drawer-logout {
    color: #e74c3c !important;
}
.drawer-logout svg {
    stroke: #e74c3c !important;
    opacity: 0.7 !important;
}
.drawer-logout:hover,
.drawer-logout:active {
    background: rgba(231,76,60,0.08) !important;
    color: #ff6b5a !important;
}

/* Cosmic Background (login pages) */
.cosmic-bg {
    position: fixed; inset: 0; z-index: 0; overflow: hidden;
    background: radial-gradient(ellipse at 20% 50%, #0a1628 0%, #0d0f14 50%),
                radial-gradient(ellipse at 80% 20%, #0f1a2e 0%, transparent 50%);
}
.cosmic-bg::before, .cosmic-bg::after {
    content: ''; position: absolute; border-radius: 50%; filter: blur(100px); opacity: 0.12;
    animation: cosmicFloat 14s ease-in-out infinite alternate;
}
.cosmic-bg::before {
    width: 600px; height: 600px; top: -200px; right: -150px;
    background: radial-gradient(circle, #00d4aa 0%, transparent 70%);
}
.cosmic-bg::after {
    width: 500px; height: 500px; bottom: -150px; left: -100px;
    background: radial-gradient(circle, #0066ff 0%, transparent 70%);
    animation-delay: -7s; animation-duration: 18s;
}
@keyframes cosmicFloat {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(40px, -30px) scale(1.15); }
}
#cosmicCanvas { position: fixed; inset: 0; z-index: 1; }

/* Futuristic Login Box */
.login-box {
    max-width: 380px; margin: 0 auto; padding: 0 16px;
    position: relative; top: 50%; transform: translateY(-50%);
}
.login-hero { text-align: center; margin-bottom: 20px; }
.login-hero .brand-text { font-size: 1.8em; letter-spacing: -0.5px; display: inline-block; }
.login-hero .brand-sub { color: #556; font-size: 0.8em; margin-top: 6px; letter-spacing: 2px; text-transform: uppercase; }
.login-box .card {
    background: rgba(18,20,26,0.85); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(0,212,170,0.1);
    box-shadow: 0 0 40px rgba(0,212,170,0.03), 0 20px 60px rgba(0,0,0,0.4);
}
.login-box .btn-primary {
    background: linear-gradient(135deg, #00d4aa, #00a5ff);
    color: #000; font-weight: bold; position: relative; overflow: hidden;
}
.login-box .btn-primary::after {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(135deg, transparent 30%, rgba(255,255,255,0.15) 50%, transparent 70%);
    background-size: 200% 100%; animation: btnShine 3s ease-in-out infinite;
}
@keyframes btnShine { 0%{background-position:200% 0} 100%{background-position:-200% 0} }

/* Futuristic Nav glow line */
.nav { position: relative; }
.nav::after {
    content: ''; position: absolute; bottom: -1px; left: 0; right: 0; height: 1px;
    background: linear-gradient(90deg, transparent 0%, #00d4aa33 30%, #00b4ff22 70%, transparent 100%);
}

/* Footer cosmic */
.footer-dev {
    text-align: center; color: #333; font-size: 0.68em;
    letter-spacing: 1.5px; text-transform: uppercase;
    padding-bottom: 10px;
}

/* ===== Cards ===== */
.card {
    background: #12141a; border: 1px solid #1e2030; border-radius: 10px;
    padding: 16px; margin-bottom: 14px;
    overflow: hidden;
}
.card h2 { color: #00d4aa; margin-bottom: 10px; font-size: 1.05em; }
.card h3 { color: #ccc; margin-bottom: 8px; font-size: 0.95em; }

/* ===== Page Header ===== */
.page-header {
    display: flex; align-items: center; gap: 10px;
    margin-bottom: 14px; flex-wrap: wrap;
}
.page-header h2 { color: #00d4aa; font-size: 1.2em; }
.page-header .back { color: #888; font-size: 0.9em; }

/* ===== Stats Grid ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px; margin-bottom: 16px;
}
.stat-card {
    background: #12141a; border: 1px solid #1e2030; border-radius: 10px;
    padding: 14px; text-align: center;
}
.stat-value { font-size: 1.6em; font-weight: bold; color: #00d4aa; margin: 4px 0; }
.stat-value.warning { color: #f1c40f; }
.stat-value.danger { color: #e74c3c; }
.stat-label { color: #888; font-size: 0.78em; text-transform: uppercase; letter-spacing: 0.5px; }
.stat-detail { color: #666; font-size: 0.75em; margin-top: 2px; }

/* ===== Tables ===== */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -16px; padding: 0 16px; }
table { width: 100%; border-collapse: collapse; min-width: 500px; }
th, td { padding: 10px 10px; text-align: left; border-bottom: 1px solid #1e1e1e; }
th { color: #666; font-size: 0.78em; text-transform: uppercase; white-space: nowrap; }
td { font-size: 0.9em; }
tr:hover { background: #1a1a1a; }
td.number, th.number { text-align: right; font-variant-numeric: tabular-nums; }

/* ===== Mobile Conversation Cards ===== */
.mobile-cards { display: block; }
.mobile-conv-card {
    background: #16181f;
    border: 1px solid #1e2030;
    border-radius: 10px;
    padding: 14px;
    margin-bottom: 10px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}
.mobile-conv-avatar {
    width: 40px; height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #00d4aa22, #00b4ff22);
    border: 1px solid #00d4aa33;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #00d4aa;
    font-size: 0.85em;
    font-weight: 600;
}
.mobile-conv-info {
    flex: 1;
    min-width: 0;
}
.mobile-conv-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 4px;
}
.mobile-conv-name {
    color: #e0e0e0;
    font-weight: 600;
    font-size: 0.92em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.mobile-conv-time {
    color: #555;
    font-size: 0.72em;
    white-space: nowrap;
    flex-shrink: 0;
}
.mobile-conv-phone {
    color: #666;
    font-size: 0.78em;
    margin-bottom: 6px;
}
.mobile-conv-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.mobile-conv-msgs {
    color: #555;
    font-size: 0.75em;
}

/* Hide table on mobile, show cards */
.table-wrap.desktop-only { display: none; }

/* ===== Status Dots ===== */
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 4px; vertical-align: middle; }
.dot-green { background: #00d4aa; }
.dot-red { background: #e74c3c; }
.dot-yellow { background: #f1c40f; }
.dot-blue { background: #3498db; }
.dot-orange { background: #e67e22; }

/* ===== Badges ===== */
.badge { display: inline-block; padding: 3px 8px; border-radius: 10px; font-size: 0.75em; font-weight: 600; white-space: nowrap; }
.badge-chat { background: #1a3a5c; color: #5dade2; }
.badge-tts { background: #1a3a2a; color: #00d4aa; }
.badge-transcription { background: #3a3a1a; color: #f1c40f; }
.badge-search { background: #3a2a1a; color: #e67e22; }

/* ===== Buttons ===== */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 10px 16px; border-radius: 8px; border: none; cursor: pointer;
    font-size: 0.9em; color: #fff; font-weight: 500;
    min-height: 44px; /* Touch-friendly */
    transition: background 0.15s, transform 0.1s;
    text-decoration: none !important;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: #00d4aa; color: #000; font-weight: bold; }
.btn-primary:hover { background: #00b892; }
.btn-danger { background: #e74c3c; }
.btn-danger:hover { background: #c0392b; }
.btn-sm { padding: 6px 12px; font-size: 0.8em; min-height: 36px; border-radius: 6px; }
.btn-group { display: flex; gap: 6px; flex-wrap: wrap; }

/* ===== Forms ===== */
.form-group { margin-bottom: 14px; }
.form-group label { display: block; margin-bottom: 4px; color: #aaa; font-size: 0.85em; }
.form-group input, .form-group textarea, .form-group select {
    width: 100%; padding: 10px 12px; background: #1a1a1a; border: 1px solid #333;
    border-radius: 8px; color: #e0e0e0; font-size: 1em;
    min-height: 44px; /* Touch-friendly */
    -webkit-appearance: none; appearance: none;
}
.form-group select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23888' d='M6 8L1 3h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }
.form-group textarea { min-height: 100px; resize: vertical; font-family: inherit; }
.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
    outline: none; border-color: #00d4aa; box-shadow: 0 0 0 2px rgba(0,212,170,0.15);
}
.form-row { display: grid; grid-template-columns: 1fr; gap: 0; }
.form-group small { color: #555; font-size: 0.78em; }

/* Checkboxes */
.checkbox-list { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }
.checkbox-list label {
    display: flex; align-items: center; gap: 8px; color: #ccc;
    font-size: 0.9em; cursor: pointer; padding: 4px 0;
}
.checkbox-list input[type="checkbox"] { width: 18px; height: 18px; accent-color: #00d4aa; }

/* ===== QR Page ===== */
.qr-container { text-align: center; padding: 40px 16px; }
.qr-container img { max-width: 280px; width: 100%; border-radius: 12px; background: #fff; padding: 12px; }
.qr-status { margin-top: 16px; font-size: 1.2em; font-weight: bold; }
.qr-status.connected { color: #00d4aa; }
.qr-status.waiting { color: #f1c40f; }

/* ===== Flash Messages ===== */
.flash { padding: 12px 16px; border-radius: 8px; margin-bottom: 12px; font-size: 0.9em; }
.flash-success { background: #1a3a2a; border: 1px solid #00d4aa; color: #00d4aa; }
.flash-error { background: #3a1a1a; border: 1px solid #e74c3c; color: #e74c3c; }
.flash-warning { background: #3a3a1a; border: 1px solid #f1c40f; color: #f1c40f; }

/* ===== Login (overridden by futuristic styles above) ===== */
.login-box h1 { color: #00d4aa; text-align: center; margin-bottom: 24px; font-size: 1.4em; }

/* ===== Charts ===== */
.chart-container { margin: 12px 0; }
.chart-bar-row { display: flex; align-items: center; margin-bottom: 4px; gap: 6px; }
.chart-bar-label { width: 60px; text-align: right; font-size: 0.75em; color: #888; flex-shrink: 0; }
.chart-bar-track { flex: 1; height: 22px; background: #1a1a1a; border-radius: 4px; overflow: hidden; display: flex; }
.chart-bar-fill { height: 100%; transition: width 0.3s; }
.chart-bar-fill.chat { background: #5dade2; }
.chart-bar-fill.tts { background: #00d4aa; }
.chart-bar-fill.transcription { background: #f1c40f; }
.chart-bar-fill.search { background: #e67e22; }
.chart-bar-value { width: 64px; font-size: 0.75em; color: #aaa; font-variant-numeric: tabular-nums; text-align: right; }
.chart-legend { margin-top: 10px; display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; font-size: 0.8em; color: #888; }

/* ===== Section Separator ===== */
.section-title {
    color: #888; font-size: 0.8em; text-transform: uppercase; letter-spacing: 1px;
    margin: 20px 0 10px; padding-bottom: 6px; border-bottom: 1px solid #1e2030;
}

/* ===== Details/Summary ===== */
details summary { cursor: pointer; color: #00d4aa; font-size: 0.9em; }
details summary:hover { text-decoration: underline; }
details pre { margin-top: 8px; white-space: pre-wrap; color: #ccc; font-size: 0.82em; max-height: 200px; overflow: auto; }

/* ===== Action Bar (bottom sticky) ===== */
.action-bar {
    position: sticky; bottom: 66px;
    background: #0a0c12; border-top: 1px solid #1e2030;
    padding: 12px 16px; margin: 0 -16px;
    display: flex; gap: 10px;
}
.action-bar .btn { flex: 1; }

/* ===== Utility ===== */
.text-muted { color: #666; }
.text-center { text-align: center; }
.text-sm { font-size: 0.85em; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.gap-row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }

/* ===== Quick Actions (mobile grid) ===== */
.quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}
.quick-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 14px 8px;
    background: #16181f;
    border: 1px solid #1e2030;
    border-radius: 10px;
    color: #ccc;
    font-size: 0.78em;
    text-decoration: none !important;
    transition: background 0.15s, border-color 0.15s;
    -webkit-tap-highlight-color: transparent;
    text-align: center;
}
.quick-action-btn svg {
    opacity: 0.6;
}
.quick-action-btn:hover,
.quick-action-btn:active {
    background: rgba(0,212,170,0.06);
    border-color: #00d4aa33;
    color: #00d4aa;
}
.quick-action-btn:hover svg,
.quick-action-btn:active svg {
    opacity: 1;
    stroke: #00d4aa;
}
.quick-action-btn.primary {
    background: linear-gradient(135deg, rgba(0,212,170,0.12), rgba(0,180,255,0.08));
    border-color: #00d4aa33;
    color: #00d4aa;
}
.quick-action-btn.primary svg { opacity: 0.9; stroke: #00d4aa; }

/* ================================================= */
/* Small phones (<=480px)                             */
/* ================================================= */
@media (max-width: 480px) {
    .bottom-nav-item svg {
        width: 26px;
        height: 26px;
    }
    .lang-selector a {
        min-width: 28px;
        min-height: 28px;
    }
    .mobile-header {
        padding: 8px 12px;
        padding-top: calc(8px + env(safe-area-inset-top, 0px));
    }

    /* Tighter stats grid for small phones */
    .stats-grid { gap: 6px; }
    .stat-card { padding: 10px 8px; }
    .stat-value { font-size: 1.25em; }
    .stat-label { font-size: 0.7em; }
    .stat-detail { font-size: 0.68em; }

    /* Ensure conversation cards have enough touch area */
    .mobile-conv-card { padding: 14px 12px; min-height: 60px; }

    /* Reduce chart label width on small screens */
    .chart-bar-label { width: 48px; font-size: 0.7em; }
    .chart-bar-value { width: 52px; }

    /* Tighter container padding */
    .container { padding: 12px 10px; padding-top: 56px; padding-bottom: 76px; }

    /* Slightly smaller card padding */
    .card { padding: 12px; }

    /* Quick actions tighter on small phones */
    .quick-actions-grid { gap: 6px; }
    .quick-action-btn { padding: 12px 6px; font-size: 0.72em; }
}

/* ================================================= */
/* Desktop (>=768px)                                  */
/* ================================================= */
@media (min-width: 768px) {
    /* Show desktop nav, hide mobile nav */
    .nav-desktop { display: flex; }
    .mobile-header { display: none; }
    .bottom-nav { display: none; }
    .drawer { display: none; }
    .drawer-overlay { display: none !important; }

    /* Remove mobile body padding */
    .container { padding: 20px 24px; padding-top: 20px; padding-bottom: 20px; }

    .nav { padding: 12px 24px; gap: 6px; }
    .nav-brand { font-size: 1.1em; margin-right: 16px; }
    .nav a { font-size: 0.9em; padding: 8px 14px; }

    .card { padding: 20px; margin-bottom: 16px; }
    .card h2 { font-size: 1.1em; }

    .stats-grid { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
    .stat-value { font-size: 2em; }

    .form-row { grid-template-columns: 1fr 1fr; gap: 16px; }

    table { min-width: auto; }
    th, td { padding: 10px 12px; }
    td { font-size: 0.95em; }

    .chart-bar-label { width: 80px; font-size: 0.8em; }
    .chart-bar-value { width: 70px; font-size: 0.8em; }

    .action-bar { position: static; bottom: auto; background: none; border: none; padding: 0; margin: 8px 0 32px; }
    .action-bar .btn { flex: none; }

    /* Desktop: show table, hide mobile cards */
    .table-wrap.desktop-only { display: block; }
    .mobile-cards { display: none; }

    .quick-actions-grid { grid-template-columns: repeat(4, 1fr); }

    .footer-dev { padding-bottom: 20px; }
}

/* ================================================= */
/* Large Desktop (>=1024px)                           */
/* ================================================= */
@media (min-width: 1024px) {
    .stats-grid { grid-template-columns: repeat(4, 1fr); }
}
