/*
 * Panel GMod
 * Fond ardoise, accent bleu « physgun », police Onest.
 * La seule touche décorative : la grille de gm_construct sur la page de connexion.
 */

@font-face {
    font-family: "Onest";
    src: url("../fonts/onest-latin-wght-normal.woff2") format("woff2-variations");
    font-weight: 100 900;
    font-display: swap;
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: "Onest";
    src: url("../fonts/onest-latin-ext-wght-normal.woff2") format("woff2-variations");
    font-weight: 100 900;
    font-display: swap;
    unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: "JetBrains Mono";
    src: url("../fonts/jetbrains-mono-latin-400-normal.woff2") format("woff2");
    font-weight: 400;
    font-display: swap;
}

:root {
    --bg: #1a2030;
    --surface: #222a3b;
    --surface-2: #2b3549;
    --line: #34405a;
    --text: #e8edf6;
    --muted: #8f9cb4;
    --accent: #4cc2ff;
    --accent-ink: #062233;
    --accent-soft: rgba(76, 194, 255, 0.13);
    --danger: #ff7d7d;
    --danger-soft: rgba(255, 125, 125, 0.12);
    --warn: #f2c35b;
    --warn-soft: rgba(242, 195, 91, 0.13);
    --ok: #5ad19b;
    --ok-soft: rgba(90, 209, 155, 0.12);
    --radius: 10px;
    --radius-lg: 16px;
    --font: "Onest", system-ui, -apple-system, "Segoe UI", sans-serif;
    --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
    --tabbar-h: 64px;
}

* { box-sizing: border-box; }

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

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 400 15px/1.55 var(--font);
    -webkit-font-smoothing: antialiased;
}

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

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 6px;
}

h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: 28px; line-height: 1.2; }
h2 { font-size: 16px; }

.ico { flex: none; display: block; }

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* ---- Structure ---------------------------------------------------- */

.shell {
    display: grid;
    grid-template-columns: 252px 1fr;
    min-height: 100vh;
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    gap: 28px;
    padding: 22px 14px;
    border-right: 1px solid var(--line);
}

.brand { display: flex; align-items: center; gap: 12px; padding: 0 8px; }
.brand-mark {
    width: 36px;
    height: 36px;
    flex: none;
    display: grid;
    place-items: center;
    border-radius: 11px;
    background: var(--accent);
    color: var(--accent-ink);
    font-weight: 700;
    font-size: 17px;
}
.brand strong { display: block; font-weight: 600; line-height: 1.25; }
.brand div span { color: var(--muted); font-size: 13px; }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a, .nav .soon {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 12px;
    border-radius: var(--radius);
    color: var(--muted);
    font-weight: 500;
}
.nav a:hover { background: var(--surface); color: var(--text); text-decoration: none; }
.nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); }
.nav .soon { opacity: 0.55; cursor: default; }
.nav .soon small {
    margin-left: auto;
    font-size: 11px;
    padding: 1px 7px;
    border: 1px solid var(--line);
    border-radius: 999px;
}

.me {
    margin-top: auto;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: 12px;
    background: var(--surface);
}
.me > div { min-width: 0; flex: 1; }
.me strong { display: block; font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me span { color: var(--muted); font-size: 12px; }

.avatar {
    width: 34px;
    height: 34px;
    flex: none;
    border-radius: 50%;
    object-fit: cover;
    background: var(--surface-2);
}

.icon-btn {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 0;
    border-radius: 9px;
    background: none;
    color: var(--muted);
    cursor: pointer;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }

.topbar, .tabbar { display: none; }

.main {
    width: 100%;
    max-width: 1200px;
    padding: 36px 44px 56px;
}

.page-head { margin-bottom: 28px; }
.page-head p { margin: 6px 0 0; color: var(--muted); }

/* ---- Cartes ------------------------------------------------------- */

.stack { display: grid; gap: 20px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 20px 22px;
    min-width: 0;
}
.card-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}
.count {
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    background: var(--surface-2);
    padding: 1px 8px;
    border-radius: 999px;
}

/* ---- Chiffres du tableau de bord ----------------------------------- */

.stats {
    display: grid;
    grid-template-columns: 1.3fr repeat(3, 1fr);
    gap: 14px;
    margin-bottom: 20px;
}
.stat {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 18px 20px;
}
.stat b {
    display: block;
    font-size: 32px;
    font-weight: 600;
    line-height: 1.1;
    letter-spacing: -0.02em;
}
.stat span { color: var(--muted); font-size: 13px; }

.stat-live { border-color: rgba(76, 194, 255, 0.45); background: linear-gradient(var(--accent-soft), var(--accent-soft)), var(--surface); }
.stat-live b { color: var(--accent); font-size: 40px; }
.stat-live span { display: flex; align-items: center; gap: 8px; }

.live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
}
@media (prefers-reduced-motion: no-preference) {
    .live-dot { animation: pulse 2s ease-out infinite; }
    @keyframes pulse {
        0% { box-shadow: 0 0 0 0 rgba(76, 194, 255, 0.55); }
        70% { box-shadow: 0 0 0 9px rgba(76, 194, 255, 0); }
        100% { box-shadow: 0 0 0 0 rgba(76, 194, 255, 0); }
    }
}

/* ---- Tableaux ---------------------------------------------------- */

.table-wrap { overflow-x: auto; margin: 0 -10px; }
table { width: 100%; border-collapse: collapse; }
th {
    text-align: left;
    font-size: 12px;
    font-weight: 500;
    color: var(--muted);
    padding: 0 10px 8px;
    border-bottom: 1px solid var(--line);
}
td { padding: 11px 10px; border-bottom: 1px solid rgba(52, 64, 90, 0.6); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: rgba(255, 255, 255, 0.025); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td.nowrap { white-space: nowrap; }

.person { display: flex; align-items: center; gap: 12px; min-width: 0; }
.person > div { min-width: 0; }
.person strong { display: block; font-weight: 500; }
.initial {
    width: 32px;
    height: 32px;
    flex: none;
    display: grid;
    place-items: center;
    border-radius: 50%;
    font-size: 13px;
    font-weight: 600;
    color: var(--c, var(--text));
    background: color-mix(in srgb, var(--c, #8f9cb4) 18%, transparent);
}

.steamid { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.muted { color: var(--muted); }
.sub { color: var(--muted); font-size: 13px; }

.empty {
    margin: 0;
    padding: 26px 16px;
    text-align: center;
    color: var(--muted);
    border: 1px dashed var(--line);
    border-radius: 12px;
}

/* ---- Pastilles --------------------------------------------------- */

.pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 999px;
    white-space: nowrap;
    background: var(--surface-2);
    color: var(--text);
}
.pill-ban { background: var(--danger-soft); color: var(--danger); }
.pill-warn { background: var(--warn-soft); color: var(--warn); }
.pill-kick { background: var(--surface-2); color: var(--muted); }
.pill-group::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--c, var(--muted));
}

/* ---- Formulaires et boutons --------------------------------------- */

.form-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.field { display: grid; gap: 6px; }
.field-grow { flex: 1 1 280px; }

label { font-size: 13px; color: var(--muted); }

input, select {
    font: inherit;
    font-size: 14px;
    color: var(--text);
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 9px 12px;
    min-width: 0;
    width: 100%;
}
select { width: auto; }
input:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 16px;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    background: var(--surface-2);
    border: 1px solid transparent;
    border-radius: var(--radius);
    cursor: pointer;
    white-space: nowrap;
}
.btn:hover { background: #33405a; text-decoration: none; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: #73d0ff; }
.btn-ghost { background: none; border-color: var(--line); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger { background: none; color: var(--danger); }
.btn-danger:hover { background: var(--danger-soft); }
.btn-lg { padding: 13px 20px; font-size: 15px; width: 100%; }

.inline-form { display: flex; gap: 8px; align-items: center; }

.flash {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 20px;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 14px;
}
.flash-ok { background: var(--ok-soft); color: var(--ok); }
.flash-error { background: var(--danger-soft); color: var(--danger); }
.field-error { color: var(--danger); font-size: 13px; margin: 0; }

/* ---- Connexion --------------------------------------------------- */
/* La grille du sol de gm_construct, en fond */

.login {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px 16px;
    background:
        radial-gradient(circle at 50% 42%, rgba(76, 194, 255, 0.16), transparent 55%),
        linear-gradient(rgba(143, 156, 180, 0.07) 1px, transparent 1px) 0 0 / 48px 48px,
        linear-gradient(90deg, rgba(143, 156, 180, 0.07) 1px, transparent 1px) 0 0 / 48px 48px,
        var(--bg);
}
.login-card {
    width: 100%;
    max-width: 400px;
    padding: 32px 28px 26px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 20px;
    display: grid;
    gap: 20px;
}
.login-card .brand { padding: 0; }
.login-card h1 { font-size: 24px; }
.login-card p { margin: 0; color: var(--muted); }
.login-note { font-size: 13px; text-align: center; }

/* ---- Mobile ------------------------------------------------------ */

@media (max-width: 960px) {
    .main { padding: 28px 24px 48px; }
    .stats { grid-template-columns: repeat(2, 1fr); }
    .grid-2 { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
    .shell { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
    .sidebar { display: none; }

    .topbar {
        position: sticky;
        top: 0;
        z-index: 10;
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 12px 16px;
        background: rgba(26, 32, 48, 0.92);
        backdrop-filter: blur(10px);
        border-bottom: 1px solid var(--line);
    }
    .topbar .brand { padding: 0; flex: 1; min-width: 0; }
    .topbar .brand-mark { width: 32px; height: 32px; font-size: 15px; border-radius: 10px; }

    .tabbar {
        position: fixed;
        inset: auto 0 0 0;
        z-index: 10;
        display: flex;
        justify-content: space-around;
        height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
        padding-bottom: env(safe-area-inset-bottom);
        background: rgba(34, 42, 59, 0.96);
        backdrop-filter: blur(10px);
        border-top: 1px solid var(--line);
    }
    .tabbar a {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        font-size: 11px;
        font-weight: 500;
        color: var(--muted);
    }
    .tabbar a:hover { text-decoration: none; }
    .tabbar a[aria-current="page"] { color: var(--accent); }

    .main { padding: 22px 16px calc(var(--tabbar-h) + 32px); }
    h1 { font-size: 24px; }
    .page-head { margin-bottom: 20px; }
    .card { padding: 16px; border-radius: 14px; }
    .stats { grid-template-columns: repeat(3, 1fr); gap: 10px; }
    .stat { padding: 12px 14px; border-radius: 14px; }
    .stat b { font-size: 22px; }
    .stat:not(.stat-live) span { font-size: 12px; line-height: 1.35; display: block; }
    .stat-live { grid-column: 1 / -1; }
    .stat-live b { font-size: 34px; }
    .hide-sm { display: none; }
    .table-wrap { margin: 0 -6px; }
}
