:root {
    --bg: #0f1419;
    --surface: #1a2332;
    --surface2: #243044;
    --border: #2d3f56;
    --text: #e1e8f0;
    --text-dim: #8899aa;
    --accent: #4a9eff;
    --accent-hover: #6bb3ff;
    --green: #34d399;
    --red: #f87171;
    --yellow: #fbbf24;
    --orange: #fb923c;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
}

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

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

.navbar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    height: 56px;
    gap: 1.5rem;
}
.navbar .brand {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text);
    margin-right: 1rem;
}
.navbar .nav-links { display: flex; gap: 0.25rem; flex: 1; align-items: center; }
.navbar .nav-links > a {
    color: var(--text-dim);
    font-size: 0.9rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}
.navbar .nav-links > a:hover,
.navbar .nav-links > a.active {
    color: var(--text);
    background: var(--surface2);
}

/* ── Nav dropdowns ─────────────────────── */

.nav-dropdown {
    position: relative;
}
.nav-dropdown-btn {
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 0.9rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-family: inherit;
}
.nav-dropdown-btn::after {
    content: " \25BE";
    font-size: 0.7rem;
}
.nav-dropdown-btn:hover,
.nav-dropdown-btn.active {
    color: var(--text);
    background: var(--surface2);
}
.nav-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 0.25rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    min-width: 140px;
    padding: 0.35rem 0;
    z-index: 100;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown-menu:hover,
.nav-dropdown.open .nav-dropdown-menu {
    display: block;
}
.nav-dropdown-menu a {
    display: block;
    padding: 0.4rem 0.75rem;
    color: var(--text-dim);
    font-size: 0.85rem;
    white-space: nowrap;
}
.nav-dropdown-menu a:hover {
    color: var(--text);
    background: var(--surface2);
}
.nav-dropdown-menu a.active {
    color: var(--text);
}

/* ── Sub-navigation (child page tabs) ── */

.subnav {
    display: flex;
    gap: 0.35rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}
.subnav a {
    padding: 0.3rem 0.75rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-dim);
    background: var(--surface);
    border: 1px solid var(--border);
}
.subnav a:hover {
    color: var(--text);
    background: var(--surface2);
}
.subnav a.active {
    color: var(--accent);
    border-color: var(--accent);
    background: var(--surface);
}

.navbar .user-info {
    font-size: 0.85rem;
    color: var(--text-dim);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 1.5rem;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}
.page-subtitle {
    font-size: 0.9rem;
    color: var(--text-dim);
    margin-top: -0.5rem;
    margin-bottom: 1rem;
}

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

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.25rem;
    margin-bottom: 1rem;
}
.card-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.8rem;
}

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

table {
    width: 100%;
    border-collapse: collapse;
}
th, td {
    padding: 0.5rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}
th {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-dim);
    font-weight: 600;
}
tr:last-child td { border-bottom: none; }
tr.highlight { background: var(--surface2); }

.text-right { text-align: right; }
.text-center { text-align: center; }
.text-dim { color: var(--text-dim); }
.text-green { color: var(--green); }
.text-red { color: var(--red); }
.text-yellow { color: var(--yellow); }

/* ── Badges ─────────────────────────────── */

.badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
}
.badge-offense { background: #1e3a5f; color: #4a9eff; }
.badge-defense { background: #1e3a2f; color: #34d399; }
.badge-locked { background: #3a1e1e; color: #f87171; }
.badge-start { background: #1e3a5f; color: #4a9eff; }
.badge-bench { background: var(--surface2); color: var(--text-dim); }
.badge-pending { background: #3a351e; color: #fbbf24; }
.badge-approved { background: #1e3a2f; color: #34d399; }
.badge-denied { background: #3a1e1e; color: #f87171; }

/* ── Forms ──────────────────────────────── */

.form-group { margin-bottom: 1rem; }
.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.35rem;
    color: var(--text-dim);
}
input[type="text"], input[type="password"], select {
    width: 100%;
    padding: 0.5rem 0.75rem;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    font-size: 0.9rem;
}
input:focus, select:focus {
    outline: none;
    border-color: var(--accent);
}

.btn {
    display: inline-block;
    padding: 0.5rem 1.25rem;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    color: #fff;
    background: var(--accent);
}
.btn:hover { background: var(--accent-hover); }
.btn-sm { padding: 0.3rem 0.75rem; font-size: 0.8rem; }
.btn-green { background: var(--green); color: #000; }
.btn-green:hover { background: #4ade80; }
.btn-red { background: var(--red); color: #000; }
.btn-red:hover { background: #fca5a5; }
.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
}
.btn-outline:hover { background: var(--surface2); }

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

.alert {
    padding: 0.75rem 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}
.alert-error { background: #3a1e1e; border: 1px solid #5a2e2e; color: var(--red); }
.alert-success { background: #1e3a2f; border: 1px solid #2e5a3e; color: var(--green); }

/* ── Auth pages ─────────────────────────── */

.auth-container {
    max-width: 400px;
    margin: 4rem auto;
    padding: 0 1rem;
}
.auth-container .card { padding: 2rem; }
.auth-container h1 {
    text-align: center;
    margin-bottom: 1.5rem;
}

/* ── Draft board ────────────────────────── */

.draft-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.5rem;
}
.draft-unit {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
}
.draft-unit .school { font-weight: 600; }
.draft-unit form { margin: 0; }

/* ── Lineup checkboxes ──────────────────── */

.lineup-unit {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0;
}
.lineup-unit input[type="checkbox"] {
    accent-color: var(--accent);
    width: 18px;
    height: 18px;
}
.lineup-unit.locked { opacity: 0.5; }
tr.locked { opacity: 0.5; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ── Trade checkboxes ──────────────────── */

.trade-unit-label {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}
.trade-unit-label:hover { background: var(--surface2); }
.trade-cb { accent-color: var(--accent); width: 16px; height: 16px; cursor: pointer; }

/* ── Matchup comparison ─────────────────── */

.matchup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    margin-bottom: 1rem;
}
.matchup-team {
    text-align: center;
    flex: 1;
}
.matchup-team .name { font-size: 1.2rem; font-weight: 700; }
.matchup-team .total { font-size: 2rem; font-weight: 700; }
.matchup-vs {
    font-size: 0.9rem;
    color: var(--text-dim);
    padding: 0 1rem;
}

/* ── Week nav ───────────────────────────── */

.week-nav {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}
.week-nav .week-label { font-weight: 700; font-size: 1.1rem; }

/* ── Two-column layout ──────────────────── */

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}
@media (max-width: 700px) {
    .grid-2 { grid-template-columns: 1fr; }
}

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

@media (max-width: 600px) {
    .navbar { padding: 0 0.75rem; gap: 0.5rem; flex-wrap: wrap; height: auto; padding-top: 0.5rem; padding-bottom: 0.5rem; }
    .navbar .nav-links { gap: 0.25rem; }
    .navbar .nav-links > a { font-size: 0.8rem; padding: 0.2rem 0.3rem; }
    .nav-dropdown-btn { font-size: 0.8rem; padding: 0.2rem 0.3rem; }
    .container { padding: 1rem; }
    th, td { padding: 0.35rem 0.5rem; font-size: 0.85rem; }
}
