:root {
    --bg-gradient: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
    --card-bg: rgba(30, 41, 59, 0.7);
    --card-border: rgba(255, 255, 255, 0.1);
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --accent: #10b981;
    --accent-glow: rgba(16, 185, 129, 0.3);
    --warning: #f59e0b;
    --danger: #ef4444;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

body {
    background: #F5F7FB;
    color: #02338C;
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    min-height: 100vh;
    padding: 0.5rem 0.8rem;
}

.dashboard-container {
    max-width: 100%;
    margin: 0 auto;
}

#multi-match-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.65rem;
}

@media (max-width: 1400px) {
    #multi-match-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 1100px) {
    #multi-match-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    #multi-match-grid {
        grid-template-columns: repeat(1, 1fr);
    }
}

.card {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    padding: 0.65rem 0.8rem;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

button.icon-control-btn {
    background: rgba(15, 23, 42, 0.8) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    border-radius: 6px !important;
    color: #fff !important;
    cursor: pointer !important;
    padding: 3px 8px !important;
    font-size: 0.85rem !important;
    box-shadow: none !important;
    transition: all 0.2s ease !important;
}

button.icon-control-btn:hover {
    background: rgba(51, 65, 85, 0.9) !important;
    border-color: var(--accent) !important;
    transform: scale(1.1) !important;
}

.badge-paused {
    background: rgba(239, 68, 68, 0.2) !important;
    color: #f87171 !important;
    border: 1px solid rgba(239, 68, 68, 0.4) !important;
}



.card-title {
    font-size: 0.9rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.card-value {
    font-size: 2rem;
    font-weight: 700;
    color: #ffffff;
}

.unit {
    font-size: 1rem;
    color: var(--text-muted);
    font-weight: 400;
}

.format-list, .chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.8rem;
}

.chip {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0.3rem 0.7rem;
    border-radius: 8px;
    font-size: 0.85rem;
}

.chip.live {
    border-color: var(--accent);
    color: #34d399;
}

.controls-card {
    grid-column: 1 / -1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.button-group {
    display: flex;
    gap: 1rem;
}

button {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.7rem 1.4rem;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}

button:hover {
    background: var(--primary-hover);
}

button.btn-warning {
    background: #d97706;
}

button.btn-warning:hover {
    background: #b45309;
}

button.btn-danger {
    background: #dc2626;
}

button.btn-danger:hover {
    background: #b91c1c;
}

input, select {
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid var(--card-border);
    color: white;
    padding: 0.6rem 1rem;
    border-radius: 8px;
    font-size: 0.95rem;
}

button.icon-control-btn {
    background: rgba(15, 23, 42, 0.9) !important;
    border: 1px solid rgba(255, 255, 255, 0.25) !important;
    border-radius: 6px !important;
    color: #fff !important;
    cursor: pointer !important;
    padding: 4px 8px !important;
    font-size: 0.82rem !important;
    line-height: 1.2 !important;
    box-shadow: none !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.2s ease !important;
}


.match-date-time {
    color: #5A6E99;
    font-weight: 500;
}

.db-timestamp-val {
    color: #02338C;
    font-weight: 700;
}

/* ── Dark Theme Overrides ─────────────────────────────────────── */
body.dark-mode {
    background: linear-gradient(135deg, #0b1329 0%, #111c38 100%) !important;
    color: #f8fafc !important;
}

body.dark-mode .match-date-time {
    color: #cbd5e1 !important;
    font-weight: 600 !important;
}

body.dark-mode .db-timestamp-val {
    color: #38bdf8 !important;
    font-weight: 700 !important;
}

body.dark-mode header {
    border-bottom-color: rgba(255, 255, 255, 0.12) !important;
}

body.dark-mode .kd-heading-1 {
    background: linear-gradient(90deg, #93c5fd, #c084fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

body.dark-mode .kd-heading-2,
body.dark-mode .kd-heading-3 {
    color: #ffffff !important;
    font-weight: 700 !important;
}

body.dark-mode .kd-body {
    color: #e2e8f0 !important;
}

body.dark-mode .kd-body-muted,
body.dark-mode .kd-caption {
    color: #94a3b8 !important;
}

body.dark-mode .kd-label {
    color: #64748b !important;
}

body.dark-mode .kd-sub {
    color: #6ee7b7 !important;
}

body.dark-mode .kd-mono {
    color: #38bdf8 !important;
    font-weight: 600 !important;
}

/* Card Styling in Dark Mode */
body.dark-mode .kd-card {
    background: rgba(20, 30, 55, 0.85) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    color: #f8fafc !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4) !important;
}

body.dark-mode .kd-card--primary {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.14), rgba(20, 30, 55, 0.95)) !important;
    border: 1.5px solid #34d399 !important;
    box-shadow: 0 0 18px rgba(52, 211, 153, 0.25) !important;
}

body.dark-mode .kd-card--accent {
    border-top: 3px solid #f97316 !important;
    border-color: rgba(249, 115, 22, 0.3) !important;
}

body.dark-mode .kd-card--surface {
    background: rgba(15, 23, 42, 0.8) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

/* Score Pill in Dark Mode */
body.dark-mode .kd-pill--blue {
    background: rgba(56, 189, 248, 0.15) !important;
    color: #38bdf8 !important;
    border: 1px solid rgba(56, 189, 248, 0.3) !important;
}

/* Innings Chips in Dark Mode */
body.dark-mode .kd-pill--outline {
    background: rgba(255, 255, 255, 0.08) !important;
    color: #cbd5e1 !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
}

body.dark-mode .kd-pill--orange-tint {
    background: rgba(240, 105, 1, 0.25) !important;
    color: #fb923c !important;
    border: 1px solid #f97316 !important;
}

body.dark-mode .kd-pill--muted {
    background: rgba(51, 65, 85, 0.8) !important;
    color: #94a3b8 !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

body.dark-mode .kd-pill--tint {
    background: rgba(56, 189, 248, 0.15) !important;
    color: #38bdf8 !important;
    border: 1px solid rgba(56, 189, 248, 0.25) !important;
}

/* Push Latency Container in Dark Mode */
body.dark-mode [style*="background: #F5F7FB"] {
    background: rgba(11, 19, 41, 0.7) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

/* Form Controls & Inputs */
body.dark-mode .kd-input,
body.dark-mode .kd-select {
    background: rgba(15, 23, 42, 0.9) !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
    color: #f8fafc !important;
}

/* Modal Overlay & Tables in Dark Mode */
body.dark-mode #sql-log-modal {
    background: rgba(11, 19, 41, 0.85) !important;
}

body.dark-mode .kd-table-wrap {
    border-color: rgba(255, 255, 255, 0.15) !important;
}

body.dark-mode .kd-table thead th {
    background: #0f172a !important;
    color: #38bdf8 !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15) !important;
}

body.dark-mode .kd-table tbody td {
    border-bottom-color: rgba(255, 255, 255, 0.08) !important;
    color: #f1f5f9 !important;
}

body.dark-mode .kd-table tbody tr:hover td {
    background: rgba(51, 65, 85, 0.5) !important;
}

body.dark-mode .kd-table--striped tbody tr:nth-child(even) td {
    background: rgba(30, 41, 59, 0.6) !important;
}

