/* ==========================================================================
   GameDay Analytics — MLB
   Complete CSS Theme
   ========================================================================== */

/* ─── CSS Custom Properties ──────────────────────────────────────────────── */

:root {
    --bg-primary: #0f1117;
    --bg-secondary: #1a1d26;
    --bg-tertiary: #242830;
    --text-primary: #e4e4e7;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;
    --accent: #00d4ff;
    --accent-hover: #00b8db;
    --green: #22c55e;
    --red: #ef4444;
    --amber: #f59e0b;
    --border: #2d3139;
    --border-light: #3f4451;
    --radius: 8px;
    --radius-lg: 12px;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --mono: 'JetBrains Mono', 'Fira Code', monospace;
}


/* ─── Reset & Base ───────────────────────────────────────────────────────── */

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    padding-top: 60px; /* Space for fixed nav */
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--accent-hover);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--text-primary);
    font-weight: 600;
    line-height: 1.3;
}

h1 { font-size: 1.75rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.1rem; }

p {
    color: var(--text-secondary);
}

strong {
    font-weight: 600;
}

small {
    font-size: 0.85em;
}

hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 1.5rem 0;
}

::selection {
    background: var(--accent);
    color: var(--bg-primary);
}


/* ─── Layout ─────────────────────────────────────────────────────────────── */

.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1rem;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.grid-3 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.grid-4 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.flex {
    display: flex;
    gap: 0.75rem;
}

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
}

.flex-center {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
}

.flex-wrap {
    flex-wrap: wrap;
}

.flex-col {
    flex-direction: column;
}

.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }


/* ─── Navigation ─────────────────────────────────────────────────────────── */

.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    height: 60px;
}

.nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-primary);
    font-weight: 700;
    font-size: 1rem;
    text-decoration: none;
    flex-shrink: 0;
}

.nav-brand:hover {
    color: var(--accent);
}

.nav-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--accent), var(--accent-hover));
    color: var(--bg-primary);
    border-radius: var(--radius);
    font-weight: 700;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
}

.nav-title {
    display: none;
}

.nav-menu {
    display: none;
    list-style: none;
    flex-direction: column;
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    padding: 0.5rem 0;
}

.nav-menu.nav-open {
    display: flex;
}

.nav-item {
    list-style: none;
}

.nav-link {
    display: block;
    padding: 0.75rem 1.25rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.2s ease, background-color 0.2s ease;
    text-decoration: none;
}

.nav-link:hover {
    color: var(--accent);
    background-color: var(--bg-tertiary);
}

.nav-link.active {
    color: var(--accent);
}

/* Hamburger toggle */
.nav-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius);
    transition: background-color 0.2s;
}

.nav-toggle:hover {
    background-color: var(--bg-tertiary);
}

.nav-toggle-bar {
    display: block;
    width: 22px;
    height: 2px;
    background-color: var(--text-secondary);
    border-radius: 1px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

/* Active hamburger state (X shape) */
.nav-toggle.active .nav-toggle-bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.nav-toggle.active .nav-toggle-bar:nth-child(2) {
    opacity: 0;
}

.nav-toggle.active .nav-toggle-bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}


/* ─── Cards ──────────────────────────────────────────────────────────────── */

.card {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.card-header {
    border-bottom: 1px solid var(--border);
    padding-bottom: 1rem;
    margin-bottom: 1rem;
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-header h2,
.card-header h3 {
    font-size: 1rem;
    margin: 0;
}

.card-body {
    color: var(--text-secondary);
}

.card-footer {
    border-top: 1px solid var(--border);
    padding-top: 1rem;
    margin-top: 1rem;
}

.card-stat {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    text-align: center;
    box-shadow: var(--shadow);
}

.card-stat .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.card-stat .stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}


/* ─── Data Tables ────────────────────────────────────────────────────────── */

.table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
    white-space: nowrap;
}

.data-table thead {
    background-color: var(--bg-secondary);
}

.data-table th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    background-color: var(--bg-secondary);
}

.data-table th[data-sortable] {
    cursor: pointer;
    user-select: none;
    transition: color 0.2s;
}

.data-table th[data-sortable]:hover {
    color: var(--accent);
}

.data-table th[data-sortable]::after {
    content: ' \2195'; /* Up-down arrow */
    font-size: 0.7em;
    color: var(--text-muted);
    margin-left: 0.25rem;
}

.data-table th[data-sortable].sort-asc::after {
    content: ' \2191'; /* Up arrow */
    color: var(--accent);
}

.data-table th[data-sortable].sort-desc::after {
    content: ' \2193'; /* Down arrow */
    color: var(--accent);
}

.data-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    color: var(--text-secondary);
}

.data-table tbody tr {
    transition: background-color 0.15s ease;
}

.data-table tbody tr:nth-child(even) {
    background-color: rgba(255, 255, 255, 0.02);
}

.data-table tbody tr:hover {
    background-color: var(--bg-tertiary);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

/* Compact table variant */
.data-table.table-compact th,
.data-table.table-compact td {
    padding: 0.5rem 0.75rem;
}

/* Numeric alignment */
.data-table .col-num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* Row link style */
.data-table .row-link {
    color: var(--accent);
    font-weight: 500;
}

.data-table .row-link:hover {
    text-decoration: underline;
}


/* ─── Badges & Pills ────────────────────────────────────────────────────── */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.6rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.4;
    letter-spacing: 0.25px;
    text-transform: uppercase;
    white-space: nowrap;
}

.badge-over {
    background-color: rgba(34, 197, 94, 0.15);
    color: var(--green);
}

.badge-under {
    background-color: rgba(239, 68, 68, 0.15);
    color: var(--red);
}

.badge-push {
    background-color: rgba(245, 158, 11, 0.15);
    color: var(--amber);
}

.badge-live {
    background-color: rgba(0, 212, 255, 0.15);
    color: var(--accent);
    animation: badge-pulse 2s ease-in-out infinite;
}

@keyframes badge-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.badge-final {
    background-color: rgba(113, 113, 122, 0.15);
    color: var(--text-muted);
}

.badge-scheduled {
    background-color: rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
}

.badge-win {
    background-color: rgba(34, 197, 94, 0.15);
    color: var(--green);
}

.badge-loss {
    background-color: rgba(239, 68, 68, 0.15);
    color: var(--red);
}


/* ─── Stats Display ──────────────────────────────────────────────────────── */

.stat-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-change {
    font-size: 0.8rem;
    font-weight: 500;
    margin-top: 0.25rem;
}

.stat-change.up {
    color: var(--green);
}

.stat-change.down {
    color: var(--red);
}


/* ─── Prop Analysis ──────────────────────────────────────────────────────── */

.prop-line {
    font-family: var(--mono);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: 0.25px;
}

.prop-line .line-value {
    color: var(--accent);
}

.prop-line .odds {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-left: 0.5rem;
}

.hit-rate-bar {
    position: relative;
    height: 8px;
    background-color: var(--bg-tertiary);
    border-radius: 4px;
    overflow: hidden;
    width: 100%;
}

.hit-rate-bar .bar-fill {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    border-radius: 4px;
    transition: width 0.6s ease;
}

.hit-rate-bar .bar-fill.green {
    background-color: var(--green);
}

.hit-rate-bar .bar-fill.red {
    background-color: var(--red);
}

.hit-rate-bar .bar-fill.amber {
    background-color: var(--amber);
}

.hit-rate-bar .bar-fill.neutral {
    background-color: var(--text-muted);
}

.trend-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
}

.trend-row .trend-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    min-width: 60px;
    flex-shrink: 0;
}

.trend-row .trend-value {
    font-weight: 600;
    font-size: 0.9rem;
    min-width: 50px;
    text-align: right;
    flex-shrink: 0;
}

.trend-row .hit-rate-bar {
    flex: 1;
}

.prop-card {
    border-left: 3px solid var(--border-light);
    padding-left: 1rem;
}

.prop-card.prop-hot {
    border-left-color: var(--green);
}

.prop-card.prop-cold {
    border-left-color: var(--red);
}


/* ─── Forms & Filters ────────────────────────────────────────────────────── */

.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    margin-bottom: 1.5rem;
}

.filter-select,
.filter-input {
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.5rem 0.75rem;
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 0.875rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    outline: none;
    appearance: none;
}

.filter-select {
    padding-right: 2rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='M3 4.5L6 7.5L9 4.5' stroke='%23a1a1aa' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.65rem center;
}

.filter-select:focus,
.filter-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(0, 212, 255, 0.15);
}

.filter-select option {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
}

.search-wrapper {
    position: relative;
    flex: 1;
    min-width: 200px;
}

.search-wrapper::before {
    content: '';
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2371717a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    pointer-events: none;
}

.search-input {
    width: 100%;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.5rem 0.75rem 0.5rem 2.25rem;
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 0.875rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    outline: none;
}

.search-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(0, 212, 255, 0.15);
}

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

label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}


/* ─── Buttons ────────────────────────────────────────────────────────────── */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.6rem 1.25rem;
    border: 1px solid transparent;
    border-radius: var(--radius);
    font-family: var(--font);
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.4;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    white-space: nowrap;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background-color: var(--accent);
    color: var(--bg-primary);
    border-color: var(--accent);
}

.btn-primary:hover {
    background-color: var(--accent-hover);
    border-color: var(--accent-hover);
    color: var(--bg-primary);
}

.btn-secondary {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    border-color: var(--border);
}

.btn-secondary:hover {
    background-color: var(--border);
    color: var(--text-primary);
}

.btn-sm {
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
}

.btn-lg {
    padding: 0.75rem 1.75rem;
    font-size: 1rem;
}

.btn-group {
    display: flex;
    border-radius: var(--radius);
    overflow: hidden;
}

.btn-group .btn {
    border-radius: 0;
    border-right-width: 0;
}

.btn-group .btn:first-child {
    border-top-left-radius: var(--radius);
    border-bottom-left-radius: var(--radius);
}

.btn-group .btn:last-child {
    border-top-right-radius: var(--radius);
    border-bottom-right-radius: var(--radius);
    border-right-width: 1px;
}

.btn-group .btn.active {
    background-color: var(--accent);
    color: var(--bg-primary);
    border-color: var(--accent);
}


/* ─── Loading Spinner ────────────────────────────────────────────────────── */

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

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

.spinner-center {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 3rem;
}

.spinner-sm {
    width: 20px;
    height: 20px;
    border-width: 2px;
}

.loading-overlay {
    position: absolute;
    inset: 0;
    background-color: rgba(15, 17, 23, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: var(--radius-lg);
    z-index: 10;
}


/* ─── Charts ─────────────────────────────────────────────────────────────── */

.chart-container {
    position: relative;
    width: 100%;
    height: 300px;
}

.chart-container canvas {
    max-width: 100%;
}

.chart-container-sm {
    height: 200px;
}

.chart-container-lg {
    height: 400px;
}


/* ─── Page Header ────────────────────────────────────────────────────────── */

.page-header {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 2rem;
    padding-top: 1.5rem;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.3;
}

.page-subtitle {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.page-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}


/* ─── Game Cards ─────────────────────────────────────────────────────────── */

.game-card {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    box-shadow: var(--shadow);
    transition: border-color 0.2s ease;
}

.game-card:hover {
    border-color: var(--border-light);
}

.game-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.game-teams {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.game-team {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0;
}

.game-team-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.game-team-logo {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-muted);
    flex-shrink: 0;
}

.game-team-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.game-team-record {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-left: 0.5rem;
}

.game-score {
    font-size: 1.25rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--text-primary);
    min-width: 30px;
    text-align: right;
}

.game-score.winner {
    color: var(--accent);
}

.game-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
    font-size: 0.8rem;
    color: var(--text-muted);
}

.game-card-footer a {
    font-size: 0.8rem;
}

.game-divider {
    height: 1px;
    background-color: var(--border);
}


/* ─── Pagination ─────────────────────────────────────────────────────────── */

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    padding: 1.5rem 0;
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 0.5rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s;
}

.pagination a {
    color: var(--text-secondary);
    background-color: var(--bg-secondary);
    border: 1px solid var(--border);
    text-decoration: none;
}

.pagination a:hover {
    background-color: var(--bg-tertiary);
    border-color: var(--border-light);
    color: var(--text-primary);
}

.pagination .active {
    background-color: var(--accent);
    color: var(--bg-primary);
    border-color: var(--accent);
    font-weight: 600;
}

.pagination .disabled {
    color: var(--text-muted);
    opacity: 0.4;
    pointer-events: none;
}


/* ─── Tabs ───────────────────────────────────────────────────────────────── */

.tabs {
    display: flex;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1.5rem;
    gap: 0;
    overflow-x: auto;
}

.tab {
    padding: 0.75rem 1.25rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    transition: color 0.2s, border-color 0.2s;
    cursor: pointer;
    white-space: nowrap;
    text-decoration: none;
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
    font-family: var(--font);
}

.tab:hover {
    color: var(--text-primary);
}

.tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.tab-content {
    display: none;
}

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


/* ─── Alerts / Notices ───────────────────────────────────────────────────── */

.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    border: 1px solid;
}

.alert-info {
    background-color: rgba(0, 212, 255, 0.08);
    border-color: rgba(0, 212, 255, 0.2);
    color: var(--accent);
}

.alert-success {
    background-color: rgba(34, 197, 94, 0.08);
    border-color: rgba(34, 197, 94, 0.2);
    color: var(--green);
}

.alert-warning {
    background-color: rgba(245, 158, 11, 0.08);
    border-color: rgba(245, 158, 11, 0.2);
    color: var(--amber);
}

.alert-error {
    background-color: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.2);
    color: var(--red);
}


/* ─── Empty State ────────────────────────────────────────────────────────── */

.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--text-muted);
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.4;
}

.empty-state-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.empty-state-text {
    font-size: 0.9rem;
    max-width: 400px;
    margin: 0 auto;
}


/* ─── Footer ─────────────────────────────────────────────────────────────── */

.site-footer {
    margin-top: 3rem;
    padding: 1.5rem 0;
    border-top: 1px solid var(--border);
    text-align: center;
}

.site-footer p {
    font-size: 0.8rem;
    color: var(--text-muted);
}


/* ─── Tooltips ───────────────────────────────────────────────────────────── */

[data-tooltip] {
    position: relative;
    cursor: help;
}

[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    padding: 0.4rem 0.65rem;
    border-radius: var(--radius);
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    z-index: 100;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

[data-tooltip]:hover::after {
    opacity: 1;
}


/* ─── Responsive Breakpoints ─────────────────────────────────────────────── */

/* Tablet and up */
@media (min-width: 768px) {
    .container {
        padding: 0 1.5rem;
    }

    .grid-2 {
        grid-template-columns: repeat(2, 1fr);
    }

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

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

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

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

    /* Desktop nav */
    .nav-toggle {
        display: none;
    }

    .nav-title {
        display: inline;
    }

    .nav-menu {
        display: flex;
        flex-direction: row;
        position: static;
        background: none;
        border-bottom: none;
        padding: 0;
        gap: 0;
    }

    .nav-link {
        padding: 0.5rem 0.85rem;
        border-radius: var(--radius);
    }

    .nav-link:hover {
        background-color: var(--bg-tertiary);
    }

    .filter-bar {
        flex-wrap: nowrap;
    }
}

/* Desktop */
@media (min-width: 1024px) {
    .container {
        padding: 0 2rem;
    }

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

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

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

/* Wide desktop */
@media (min-width: 1280px) {
    .grid-4 {
        grid-template-columns: repeat(4, 1fr);
    }

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

    .chart-container {
        height: 350px;
    }
}

/* Small mobile tweaks */
@media (max-width: 480px) {
    body {
        font-size: 14px;
    }

    .card {
        padding: 1rem;
    }

    .card-stat {
        padding: 1rem;
    }

    .card-stat .stat-value {
        font-size: 1.5rem;
    }

    .page-title {
        font-size: 1.25rem;
    }

    .data-table th,
    .data-table td {
        padding: 0.5rem 0.65rem;
    }
}


/* ─── Utility Classes ────────────────────────────────────────────────────── */

/* Text colors */
.text-green { color: var(--green) !important; }
.text-red { color: var(--red) !important; }
.text-amber { color: var(--amber) !important; }
.text-accent { color: var(--accent) !important; }
.text-muted { color: var(--text-muted) !important; }
.text-primary { color: var(--text-primary) !important; }
.text-secondary { color: var(--text-secondary) !important; }

/* Text alignment */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

/* Font */
.font-mono { font-family: var(--mono); }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-medium { font-weight: 500; }

/* Truncate */
.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Display */
.hidden { display: none !important; }
.block { display: block; }
.inline-block { display: inline-block; }
.inline-flex { display: inline-flex; }

/* Visibility at breakpoints */
.show-mobile { display: block; }
.hide-mobile { display: none; }

@media (min-width: 768px) {
    .show-mobile { display: none; }
    .hide-mobile { display: block; }
}

/* Margins */
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mt-5 { margin-top: 2rem; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mb-5 { margin-bottom: 2rem; }

.ml-1 { margin-left: 0.25rem; }
.ml-2 { margin-left: 0.5rem; }
.mr-1 { margin-right: 0.25rem; }
.mr-2 { margin-right: 0.5rem; }

/* Padding */
.p-0 { padding: 0; }
.p-1 { padding: 0.25rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 1rem; }
.p-4 { padding: 1.5rem; }
.p-5 { padding: 2rem; }

.px-1 { padding-left: 0.25rem; padding-right: 0.25rem; }
.px-2 { padding-left: 0.5rem; padding-right: 0.5rem; }
.px-3 { padding-left: 1rem; padding-right: 1rem; }

.py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-3 { padding-top: 1rem; padding-bottom: 1rem; }

/* Width */
.w-full { width: 100%; }

/* Overflow */
.overflow-hidden { overflow: hidden; }
.overflow-auto { overflow: auto; }

/* Position */
.relative { position: relative; }
.absolute { position: absolute; }

/* Border */
.border-t { border-top: 1px solid var(--border); }
.border-b { border-bottom: 1px solid var(--border); }

/* Opacity */
.opacity-50 { opacity: 0.5; }
.opacity-75 { opacity: 0.75; }

/* Cursor */
.cursor-pointer { cursor: pointer; }

/* Tabular nums for consistent number alignment */
.tabular-nums { font-variant-numeric: tabular-nums; }
