/* ============================================
   ADMIN CSS — STAY HIGH
   ============================================ */
:root {
    --bg: #0a0a0a;
    --surface: #111;
    --surface2: #1a1a1a;
    --gold: #ffc800;
    --red: #c4161c;
    --green: #22c55e;
    --white: #f0f0f0;
    --muted: #888;
    --line: rgba(255,255,255,.08);
    --nav-w: 220px;
    --font-title: 'Bebas Neue', sans-serif;
    --font: 'Inter', sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { background: var(--bg); color: var(--white); font-family: var(--font); display: flex; min-height: 100vh; }

/* NAV */
.admin-nav {
    width: var(--nav-w);
    background: var(--surface);
    border-right: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0;
    height: 100vh;
    z-index: 100;
    overflow-y: auto;
}
.admin-nav-logo {
    padding: 24px 20px;
    border-bottom: 1px solid var(--line);
}
.admin-nav-logo a {
    font-family: var(--font-title);
    font-size: 22px;
    color: var(--gold);
    text-decoration: none;
    display: block;
    margin-bottom: 2px;
}
.admin-nav-logo span {
    font-size: 11px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 2px;
}
.admin-nav-links {
    list-style: none;
    padding: 12px 0;
    flex: 1;
}
.admin-nav-links li a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 13px 20px;
    color: var(--muted);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all .15s;
    border-left: 3px solid transparent;
}
.admin-nav-links li a:hover,
.admin-nav-links li a.active {
    color: var(--white);
    background: rgba(255,200,0,.06);
    border-left-color: var(--gold);
}
.admin-nav-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.admin-nav-footer a {
    font-size: 12px;
    color: var(--muted);
    text-decoration: none;
    transition: color .15s;
}
.admin-nav-footer a:hover { color: var(--white); }
.logout-link { color: var(--red) !important; }
.logout-link:hover { color: #ff6b6b !important; }

/* MAIN */
.admin-main {
    margin-left: var(--nav-w);
    padding: 40px;
    flex: 1;
    max-width: 1100px;
}
.admin-header { margin-bottom: 36px; }
.admin-header h1 {
    font-family: var(--font-title);
    font-size: 38px;
    letter-spacing: 3px;
    text-transform: uppercase;
    line-height: 1;
}
.admin-header p { color: var(--muted); margin-top: 6px; font-size: 15px; }

/* CARD */
.admin-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 28px;
}
.admin-card h2 {
    font-family: var(--font-title);
    font-size: 20px;
    letter-spacing: 2px;
    text-transform: uppercase;
}

/* STATS */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}
.stat-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 22px 18px;
    text-align: center;
}
.stat-card--warning { border-color: rgba(255,200,0,.3); }
.stat-card--success { border-color: rgba(34,197,94,.3); }
.stat-card--muted { opacity: .55; }
.stat-icon { font-size: 26px; margin-bottom: 8px; }
.stat-value { font-size: 30px; font-weight: 800; color: var(--gold); line-height: 1; }
.stat-label { font-size: 11px; color: var(--muted); margin-top: 5px; text-transform: uppercase; letter-spacing: 1px; }

/* DASHBOARD ACTIONS */
.dashboard-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}
.action-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 28px 18px;
    text-align: center;
    text-decoration: none;
    color: var(--white);
    transition: all .2s;
    display: block;
}
.action-card:hover { border-color: var(--gold); transform: translateY(-2px); background: rgba(255,200,0,.04); }
.action-icon { font-size: 34px; margin-bottom: 10px; }
.action-card h3 { font-size: 15px; font-weight: 700; margin-bottom: 5px; }
.action-card p { font-size: 12px; color: var(--muted); }

/* ALERTS */
.alert {
    padding: 14px 18px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 14px;
    line-height: 1.5;
}
.alert-success { background: rgba(34,197,94,.08); border: 1px solid rgba(34,197,94,.25); color: #86efac; }
.alert-error   { background: rgba(196,22,28,.08); border: 1px solid rgba(196,22,28,.25); color: #fca5a5; }
.alert-warning { background: rgba(255,200,0,.06); border: 1px solid rgba(255,200,0,.25); color: var(--gold); }
.alert a { color: inherit; font-weight: 700; text-decoration: underline; }

/* BUTTONS */
.btn-admin {
    padding: 10px 20px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    font-family: var(--font);
    transition: all .15s;
    text-decoration: none;
    display: inline-block;
    line-height: 1.4;
}
.btn-admin-primary { background: var(--gold); color: #000; }
.btn-admin-primary:hover { background: #e6b400; }
.btn-admin-success { background: rgba(34,197,94,.12); color: #86efac; border: 1px solid rgba(34,197,94,.25); }
.btn-admin-success:hover { background: rgba(34,197,94,.22); }
.btn-admin-danger { background: rgba(196,22,28,.12); color: #fca5a5; border: 1px solid rgba(196,22,28,.25); }
.btn-admin-danger:hover { background: rgba(196,22,28,.22); }
.btn-admin-ghost { background: transparent; color: var(--muted); border: 1px solid var(--line); }
.btn-admin-ghost:hover { color: var(--white); border-color: rgba(255,255,255,.2); }
.btn-sm { padding: 7px 13px; font-size: 12px; }

/* TABLE */
.admin-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.admin-table th {
    text-align: left;
    padding: 9px 12px;
    color: var(--muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid var(--line);
    font-weight: 600;
}
.admin-table td { padding: 10px 12px; border-bottom: 1px solid var(--line); }
.admin-table tr.qualifie td { color: var(--gold); font-weight: 600; }
.admin-table tr:last-child td { border-bottom: none; }

/* FILTER TABS */
.filter-tabs { display: flex; gap: 8px; margin-bottom: 24px; flex-wrap: wrap; }
.filter-tab {
    padding: 8px 16px;
    border-radius: 8px;
    background: var(--surface);
    border: 1px solid var(--line);
    color: var(--muted);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: all .15s;
}
.filter-tab.active, .filter-tab:hover { border-color: var(--gold); color: var(--gold); background: rgba(255,200,0,.06); }

/* TEAMS */
.teams-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 18px;
}
.team-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    overflow: hidden;
}
.team-card--valide { border-color: rgba(34,197,94,.2); }
.team-card--refuse { border-color: rgba(196,22,28,.15); opacity: .7; }
.team-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 18px 20px;
    border-bottom: 1px solid var(--line);
    gap: 12px;
}
.team-card-header h3 { font-size: 16px; font-weight: 700; margin-bottom: 4px; }
.team-id { font-size: 11px; color: var(--muted); font-family: monospace; }
.team-card-body { padding: 14px 20px; }
.team-info-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 7px;
    flex-wrap: wrap;
    gap: 4px;
}
.team-card-actions {
    display: flex;
    gap: 8px;
    padding: 12px 20px;
    border-top: 1px solid var(--line);
    flex-wrap: wrap;
    align-items: center;
}
.status-badge {
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 20px;
    white-space: nowrap;
    font-weight: 600;
}
.status-valide     { background: rgba(34,197,94,.1); color: #86efac; border: 1px solid rgba(34,197,94,.25); }
.status-en_attente { background: rgba(255,200,0,.08); color: var(--gold); border: 1px solid rgba(255,200,0,.25); }
.status-refuse     { background: rgba(196,22,28,.1); color: #fca5a5; border: 1px solid rgba(196,22,28,.25); }

/* MATCHES */
.match-row {
    background: var(--surface2);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}
.match-row.match-played { border-color: rgba(34,197,94,.2); }
.match-label {
    font-size: 11px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    width: 100%;
    margin-bottom: -4px;
}
.match-teams {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 180px;
}
.match-team { font-weight: 700; font-size: 14px; }
.match-vs { font-size: 11px; color: var(--muted); font-weight: 700; }
.match-score-display {
    font-size: 20px;
    color: var(--gold);
    font-weight: 800;
    min-width: 70px;
    text-align: center;
}
.match-score-form { display: flex; align-items: center; gap: 7px; }
.score-input {
    width: 58px;
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--white);
    font-size: 18px;
    font-weight: 700;
    text-align: center;
    padding: 8px 4px;
    font-family: var(--font);
}
.score-input:focus { outline: none; border-color: var(--gold); }

/* FORM */
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 7px; font-weight: 500; }
.form-input {
    width: 100%;
    background: var(--surface2);
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--white);
    padding: 12px 14px;
    font-size: 15px;
    font-family: var(--font);
    transition: border-color .15s;
}
.form-input:focus { outline: none; border-color: var(--gold); }

/* EMPTY STATE */
.empty-state { text-align: center; padding: 80px 40px; color: var(--muted); }
.empty-state h3 { font-size: 22px; color: var(--white); margin-bottom: 8px; }

/* LOGIN */
.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--bg);
    margin-left: 0;
}
.login-box {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 48px 40px;
    width: 100%;
    max-width: 400px;
}
.login-logo {
    font-family: var(--font-title);
    font-size: 28px;
    color: var(--gold);
    text-align: center;
    margin-bottom: 6px;
    letter-spacing: 3px;
}
.login-title {
    text-align: center;
    font-size: 14px;
    color: var(--muted);
    margin-bottom: 30px;
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .admin-nav { display: none; }
    .admin-main { margin-left: 0; padding: 20px 16px; }
    .teams-grid { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .match-teams { min-width: 100%; }
}

/* ===== Sidebar : sous-section contextuelle, badge, toggle mobile ===== */
.admin-nav-section {
    padding: 16px 20px 6px;
    margin-top: 8px;
    border-top: 1px solid var(--line);
    font-family: var(--font-title);
    font-size: 14px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--gold);
    list-style: none;
}
.admin-nav-badge {
    display: inline-block;
    background: var(--red);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 8px;
    margin-left: 4px;
    vertical-align: middle;
}
.admin-burger { display: none; }

@media (max-width: 768px) {
    .admin-burger {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        position: fixed;
        top: 12px;
        left: 12px;
        z-index: 200;
        background: var(--surface);
        color: var(--white);
        border: 1px solid var(--line);
        border-radius: 8px;
        padding: 9px 14px;
        font-size: 14px;
        font-weight: 600;
        cursor: pointer;
    }
    .admin-nav.open { display: flex; box-shadow: 0 8px 30px rgba(0,0,0,.6); }
    .admin-main { padding-top: 64px; }
}
