/* FrontLine - panel (DA ecran de chargement : noir militaire, jaune, angles droits, grille tactique) */
:root {
    --y: #F2B705;
    --y-rgb: 242, 183, 5;
    --y-dim: rgba(var(--y-rgb), .55);
    --y-soft: rgba(var(--y-rgb), .14);
    --y-faint: rgba(var(--y-rgb), .06);
    --bg: #090a07;
    --bg2: #0e100b;
    --panel: rgba(17, 19, 13, .92);
    --panel2: #15180f;
    --line: rgba(var(--y-rgb), .14);
    --line2: rgba(var(--y-rgb), .3);
    --text: #e9e6d6;
    --muted: #8d8b78;
    --dim: #5d5c4f;
    --red: #e5483a;
    --green: #7dbb4f;
    --blue: #5aa7d8;
    --mono: "JetBrains Mono", Consolas, "Courier New", monospace;
    --sans: "Barlow", "Segoe UI", Arial, sans-serif;
    --title: "Barlow Condensed", "Bahnschrift Condensed", "Arial Narrow", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
    background: var(--bg); color: var(--text); font-family: var(--sans); font-size: 14.5px; line-height: 1.45;
    -webkit-font-smoothing: antialiased;
}
body::before {
    content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0;
    background:
        radial-gradient(ellipse 50% 40% at 15% 0%, rgba(61, 66, 40, .35), transparent 70%),
        radial-gradient(ellipse 40% 40% at 100% 100%, rgba(55, 60, 36, .25), transparent 70%),
        linear-gradient(rgba(var(--y-rgb), .035) 1px, transparent 1px), linear-gradient(90deg, rgba(var(--y-rgb), .035) 1px, transparent 1px);
    background-size: auto, auto, 48px 48px, 48px 48px;
}
a { color: var(--y); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--y); color: #0a0b08; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(var(--y-rgb), .25); }
::-webkit-scrollbar-thumb:hover { background: var(--y-dim); }

#app { position: relative; z-index: 1; min-height: 100%; }

/* ---------------------------------------------------------------- layout */
.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.side {
    position: sticky; top: 0; height: 100vh; overflow-y: auto; background: rgba(8, 9, 6, .94);
    border-right: 1px solid var(--line); display: flex; flex-direction: column;
}
.brand { padding: 22px 20px 18px; border-bottom: 1px solid var(--line); }
.brand b { display: block; font-family: var(--title); font-weight: 700; font-size: 26px; letter-spacing: 3px; text-transform: uppercase; line-height: 1; }
.brand b i { font-style: normal; color: var(--y); }
.brand span { display: block; margin-top: 6px; font-family: var(--mono); font-size: 10.5px; letter-spacing: 2px; color: var(--muted); text-transform: uppercase; }
.nav { padding: 10px 0 16px; flex: 1; }
.nav h6 { margin: 16px 20px 6px; font-family: var(--mono); font-weight: 400; font-size: 10px; letter-spacing: 2.5px; color: var(--dim); text-transform: uppercase; }
.nav a {
    position: relative; display: flex; align-items: center; gap: 11px; padding: 8px 20px; color: var(--muted);
    font-weight: 500; font-size: 14px; text-decoration: none; border-left: 3px solid transparent;
}
.nav a svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; flex: none; }
.nav a:hover { color: var(--text); background: var(--y-faint); }
.nav a.on { color: var(--text); background: linear-gradient(90deg, var(--y-soft), transparent); border-left-color: var(--y); }
.nav a.on svg { color: var(--y); }
.nav a .badge { margin-left: auto; }
.side-foot { padding: 14px 20px; border-top: 1px solid var(--line); font-family: var(--mono); font-size: 10.5px; color: var(--dim); letter-spacing: 1px; }

.main { min-width: 0; display: flex; flex-direction: column; }
.top {
    position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 14px; padding: 14px 32px;
    background: rgba(9, 10, 7, .88); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
}
.top h1 { margin: 0; font-family: var(--title); font-weight: 700; font-size: 24px; letter-spacing: 2px; text-transform: uppercase; }
.top .crumb { font-family: var(--mono); font-size: 11px; color: var(--muted); letter-spacing: 1.5px; text-transform: uppercase; }
.top .sp { flex: 1; }
.user-btn { display: flex; align-items: center; gap: 10px; padding: 6px 12px; border: 1px solid var(--line); background: var(--panel); cursor: pointer; }
.user-btn:hover { border-color: var(--y-dim); }
.user-btn .av { width: 26px; height: 26px; display: grid; place-items: center; background: var(--y); color: #0a0b08; font-family: var(--title); font-weight: 700; }
.user-btn small { display: block; font-family: var(--mono); font-size: 10px; color: var(--muted); letter-spacing: 1px; text-transform: uppercase; }
.content { padding: 28px 32px 60px; max-width: 1400px; width: 100%; }

/* ---------------------------------------------------------------- blocs */
.grid { display: grid; gap: 18px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span2 { grid-column: span 2; }
.card {
    position: relative; background: var(--panel); border: 1px solid var(--line); border-top: 2px solid var(--y);
    padding: 20px 22px; box-shadow: 0 12px 30px rgba(0, 0, 0, .35);
}
.card::after { content: ""; position: absolute; right: -1px; bottom: -1px; width: 12px; height: 12px; border-right: 2px solid var(--y); border-bottom: 2px solid var(--y); pointer-events: none; }
.card.plain { border-top-width: 1px; border-top-color: var(--line); }
.card.plain::after { display: none; }
.card h2 { margin: 0 0 4px; font-family: var(--title); font-weight: 700; font-size: 19px; letter-spacing: 1.5px; text-transform: uppercase; display: flex; align-items: center; gap: 10px; }
.card h2 .sp { flex: 1; }
.card .sub { margin: 0 0 16px; color: var(--muted); font-size: 13.5px; }
.section-title { display: flex; align-items: center; gap: 10px; margin: 30px 0 12px; font-family: var(--mono); font-size: 11px; letter-spacing: 3px; text-transform: uppercase; color: var(--y); }
.section-title::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.section-title:first-child { margin-top: 0; }

.stat { padding: 18px 20px; }
.stat .k { font-family: var(--mono); font-size: 10.5px; letter-spacing: 2px; text-transform: uppercase; color: var(--muted); }
.stat .v { margin-top: 6px; font-family: var(--title); font-weight: 700; font-size: 38px; line-height: 1; letter-spacing: 1px; }
.stat .v small { font-size: 18px; color: var(--muted); font-weight: 600; }
.stat .n { margin-top: 6px; font-size: 12.5px; color: var(--muted); }

.banner { display: flex; align-items: center; gap: 14px; padding: 12px 16px; margin-bottom: 18px; border: 1px solid var(--line2); border-left: 3px solid var(--y); background: var(--y-faint); }
.banner.red { border-color: rgba(229, 72, 58, .45); border-left-color: var(--red); background: rgba(229, 72, 58, .07); }
.banner .sp { flex: 1; }

/* ---------------------------------------------------------------- formulaires */
label.f { display: block; margin-bottom: 16px; }
label.f > span { display: block; margin-bottom: 6px; font-family: var(--mono); font-size: 10.5px; letter-spacing: 1.8px; text-transform: uppercase; color: var(--muted); }
label.f > span em { font-style: normal; color: var(--dim); text-transform: none; letter-spacing: 0; margin-left: 6px; }
.in, select.in, textarea.in {
    width: 100%; padding: 10px 12px; background: rgba(0, 0, 0, .35); border: 1px solid var(--line); outline: none; border-radius: 0;
    transition: border-color .15s, background .15s;
}
.in:focus { border-color: var(--y-dim); background: rgba(0, 0, 0, .5); }
.in::placeholder { color: var(--dim); }
select.in { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--y) 50%), linear-gradient(135deg, var(--y) 50%, transparent 50%); background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 32px; }
select.in option { background: #11130d; }
textarea.in { resize: vertical; min-height: 120px; font-family: var(--mono); font-size: 13px; }
.hint { margin-top: 6px; font-size: 12.5px; color: var(--dim); }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.row .grow { flex: 1; }

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 16px; cursor: pointer;
    background: transparent; border: 1px solid var(--line2); color: var(--text); font-family: var(--title); font-weight: 700;
    font-size: 15px; letter-spacing: 1.5px; text-transform: uppercase; transition: background .15s, border-color .15s, color .15s; white-space: nowrap;
}
.btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; }
.btn:hover { border-color: var(--y); background: var(--y-faint); }
.btn.pri { background: var(--y); border-color: var(--y); color: #0a0b08; }
.btn.pri:hover { filter: brightness(1.08); }
.btn.red { border-color: rgba(229, 72, 58, .5); color: #ff8a7f; }
.btn.red:hover { background: rgba(229, 72, 58, .12); border-color: var(--red); }
.btn.green { border-color: rgba(125, 187, 79, .5); color: #a6dc7c; }
.btn.green:hover { background: rgba(125, 187, 79, .12); border-color: var(--green); }
.btn.sm { padding: 5px 10px; font-size: 13px; }
.btn.ghost { border-color: transparent; }
.btn:disabled { opacity: .45; pointer-events: none; }

.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch i { width: 40px; height: 22px; border: 1px solid var(--line2); background: rgba(0, 0, 0, .4); position: relative; transition: background .15s; flex: none; }
.switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; background: var(--muted); transition: transform .15s, background .15s; }
.switch input:checked + i { background: var(--y-soft); border-color: var(--y); }
.switch input:checked + i::after { transform: translateX(18px); background: var(--y); }
.switch input:focus-visible + i { outline: 2px solid var(--y-dim); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 7px; background: rgba(0, 0, 0, .35); border: 1px solid var(--line); min-height: 44px; }
.chips:focus-within { border-color: var(--y-dim); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 4px 3px 10px; background: var(--y-soft); border: 1px solid var(--line2); font-size: 13px; }
.chip button { border: none; background: none; cursor: pointer; color: var(--muted); padding: 0 4px; font-size: 15px; line-height: 1; }
.chip button:hover { color: var(--red); }
.chips input { flex: 1; min-width: 120px; border: none; outline: none; background: none; padding: 3px 4px; }

.badge { display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px; font-family: var(--mono); font-size: 10.5px; letter-spacing: 1px; text-transform: uppercase; border: 1px solid var(--line2); color: var(--muted); white-space: nowrap; }
.badge.y { background: var(--y); color: #0a0b08; border-color: var(--y); }
.badge.green { color: #a6dc7c; border-color: rgba(125, 187, 79, .45); }
.badge.red { color: #ff8a7f; border-color: rgba(229, 72, 58, .45); }
.badge.blue { color: #8fc6ea; border-color: rgba(90, 167, 216, .45); }
.dot { width: 8px; height: 8px; display: inline-block; background: var(--dim); }
.dot.on { background: var(--green); box-shadow: 0 0 8px var(--green); }
.dot.wait { background: var(--y); animation: blink 1s infinite; }
.dot.off { background: var(--red); }
@keyframes blink { 50% { opacity: .3; } }

/* ---------------------------------------------------------------- tables */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; padding: 9px 12px; font-family: var(--mono); font-weight: 400; font-size: 10.5px; letter-spacing: 1.8px; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--line2); white-space: nowrap; }
.tbl td { padding: 10px 12px; border-bottom: 1px solid rgba(var(--y-rgb), .07); vertical-align: middle; }
.tbl tr:hover td { background: var(--y-faint); }
.tbl td.mono, .mono { font-family: var(--mono); font-size: 12.5px; }
.tbl td.muted, .muted { color: var(--muted); }
.tbl td.act { text-align: right; white-space: nowrap; }
.empty { padding: 28px; text-align: center; color: var(--dim); font-family: var(--mono); font-size: 12px; letter-spacing: 1px; }
.pager { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 12px; font-family: var(--mono); font-size: 12px; color: var(--muted); }

/* ---------------------------------------------------------------- graphique */
.chart { width: 100%; height: 240px; display: block; }
.chart .grid line { stroke: rgba(var(--y-rgb), .08); }
.chart text { fill: var(--muted); font-family: var(--mono); font-size: 10.5px; }
.chart .area { fill: url(#flgrad); }
.chart .line { fill: none; stroke: var(--y); stroke-width: 2; }
.chart .avg { fill: none; stroke: rgba(233, 230, 214, .45); stroke-width: 1.2; stroke-dasharray: 4 4; }
.tabs { display: inline-flex; border: 1px solid var(--line); }
.tabs button { padding: 5px 12px; background: none; border: none; cursor: pointer; font-family: var(--mono); font-size: 11px; letter-spacing: 1.5px; color: var(--muted); text-transform: uppercase; }
.tabs button.on { background: var(--y); color: #0a0b08; }
.tabs button:not(.on):hover { color: var(--text); background: var(--y-faint); }

/* ---------------------------------------------------------------- listes */
.list { display: flex; flex-direction: column; }
.list .it { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid rgba(var(--y-rgb), .07); }
.list .it:last-child { border-bottom: none; }
.list .it .t { flex: 1; min-width: 0; }
.list .it .t b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list .it .t small { display: block; color: var(--muted); font-size: 12.5px; }

.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.media { border: 1px solid var(--line); background: rgba(0, 0, 0, .3); }
.media .pv { aspect-ratio: 16/10; display: grid; place-items: center; background: #050604; overflow: hidden; }
.media .pv img, .media .pv video { width: 100%; height: 100%; object-fit: cover; }
.media .pv svg { width: 34px; height: 34px; stroke: var(--y); fill: none; stroke-width: 1.5; }
.media .meta { padding: 8px 10px; }
.media .meta b { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.media .meta small { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.media .meta .row { margin-top: 6px; gap: 6px; }

.drop {
    display: grid; place-items: center; gap: 6px; padding: 26px; text-align: center; cursor: pointer;
    border: 1px dashed var(--y-dim); background: rgba(0, 0, 0, .25); transition: background .15s;
}
.drop:hover, .drop.over { background: var(--y-faint); border-style: solid; }
.drop b { font-family: var(--title); font-size: 17px; letter-spacing: 2px; text-transform: uppercase; color: var(--y); }
.drop small { color: var(--muted); }
.progress { height: 6px; background: rgba(var(--y-rgb), .1); margin-top: 10px; overflow: hidden; display: none; }
.progress.on { display: block; }
.progress i { display: block; height: 100%; width: 0; background: var(--y); transition: width .2s; }

/* ---------------------------------------------------------------- couleurs / HUD */
.color-row { display: flex; align-items: center; gap: 12px; }
.color-row input[type=color] { width: 46px; height: 40px; padding: 0; border: 1px solid var(--line2); background: none; cursor: pointer; }
.color-row input[type=color]::-webkit-color-swatch-wrapper { padding: 3px; }
.color-row input[type=color]::-webkit-color-swatch { border: none; }
.preview-box { padding: 18px; border: 1px solid var(--line); }
.hud-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.hud-opt { position: relative; cursor: pointer; border: 1px solid var(--line); background: rgba(0, 0, 0, .3); padding: 12px; transition: border-color .15s; }
.hud-opt:hover { border-color: var(--y-dim); }
.hud-opt.on { border-color: var(--y); box-shadow: inset 0 0 0 1px var(--y); }
.hud-opt b { display: block; margin-top: 10px; font-family: var(--title); font-size: 16px; letter-spacing: 1.5px; text-transform: uppercase; }
.hud-opt small { color: var(--muted); }
.hud-opt svg { width: 100%; height: auto; display: block; background: linear-gradient(160deg, #3d4a52, #6a6f5a 60%, #2f3328); }

/* ---------------------------------------------------------------- editeur de config */
.editor { display: grid; grid-template-columns: auto 1fr; border: 1px solid var(--line); background: #070806; height: 62vh; overflow: hidden; }
.editor .ln { padding: 12px 8px; text-align: right; font-family: var(--mono); font-size: 12.5px; line-height: 20px; color: var(--dim); background: rgba(var(--y-rgb), .03); border-right: 1px solid var(--line); overflow: hidden; user-select: none; white-space: pre; }
.editor textarea { border: none; outline: none; resize: none; padding: 12px 14px; font-family: var(--mono); font-size: 12.5px; line-height: 20px; background: transparent; white-space: pre; overflow: auto; tab-size: 4; }
.cfg-list a { display: block; padding: 9px 12px; border-left: 2px solid transparent; color: var(--text); text-decoration: none; }
.cfg-list a small { display: block; font-family: var(--mono); font-size: 11px; color: var(--muted); }
.cfg-list a:hover { background: var(--y-faint); }
.cfg-list a.on { border-left-color: var(--y); background: var(--y-soft); }

/* ---------------------------------------------------------------- patch notes / suggestions */
.note { padding: 16px 18px; border: 1px solid var(--line); background: rgba(0, 0, 0, .25); margin-bottom: 12px; }
.note h3 { margin: 0; font-family: var(--title); font-size: 19px; letter-spacing: 1px; text-transform: uppercase; }
.note .md { margin-top: 10px; color: #cfccbc; white-space: pre-wrap; font-size: 14px; }
.sug { padding: 14px 16px; border: 1px solid var(--line); border-left: 3px solid var(--line2); background: rgba(0, 0, 0, .25); margin-bottom: 10px; }
.sug.s-nouvelle { border-left-color: var(--y); }
.sug.s-acceptée, .sug.s-réalisée { border-left-color: var(--green); }
.sug.s-refusée { border-left-color: var(--red); }
.sug p { margin: 8px 0; white-space: pre-wrap; }

/* ---------------------------------------------------------------- modales / toasts */
.modal-bg { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: rgba(4, 5, 3, .7); backdrop-filter: blur(3px); animation: fade .15s; padding: 20px; }
.modal { width: min(560px, 100%); max-height: 90vh; overflow: auto; }
.modal.wide { width: min(760px, 100%); }
@keyframes fade { from { opacity: 0; } }
.secret-box { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: #050604; border: 1px solid var(--y-dim); font-family: var(--mono); font-size: 15px; word-break: break-all; }
.secret-box span { flex: 1; color: var(--y); }
.toasts { position: fixed; right: 22px; bottom: 22px; z-index: 60; display: flex; flex-direction: column; gap: 10px; }
.toast { min-width: 260px; max-width: 420px; padding: 12px 16px; background: #0d0f0a; border: 1px solid var(--line2); border-left: 3px solid var(--y); box-shadow: 0 10px 30px rgba(0, 0, 0, .5); animation: slide .2s; }
.toast.err { border-left-color: var(--red); }
.toast.ok { border-left-color: var(--green); }
@keyframes slide { from { transform: translateX(30px); opacity: 0; } }

/* ---------------------------------------------------------------- connexion */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login { width: min(420px, 100%); }
.login .brand { border: none; padding: 0 0 22px; text-align: center; }
.login .brand b { font-size: 40px; }
.login .card { padding: 28px; }
.login .err { margin-bottom: 14px; padding: 10px 12px; border: 1px solid rgba(229, 72, 58, .45); background: rgba(229, 72, 58, .08); color: #ff9c92; font-size: 13.5px; }
.login footer { margin-top: 16px; text-align: center; font-family: var(--mono); font-size: 10.5px; letter-spacing: 1.5px; color: var(--dim); text-transform: uppercase; }

.perm-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 18px; }
.perm-grid label { display: flex; align-items: center; gap: 9px; padding: 6px 0; cursor: pointer; font-size: 13.5px; }
.perm-grid input { accent-color: var(--y); width: 16px; height: 16px; }
.console { height: 60vh; overflow: auto; padding: 12px 14px; background: #050604; border: 1px solid var(--line); font-family: var(--mono); font-size: 12px; white-space: pre-wrap; color: #c8c5b4; }

@media (max-width: 1100px) {
    .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .g3 { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
    .shell { grid-template-columns: 1fr; }
    .side { position: relative; height: auto; }
    .nav { display: flex; flex-wrap: wrap; }
    .nav h6 { width: 100%; }
    .g2, .g4 { grid-template-columns: 1fr; }
    .span2 { grid-column: auto; }
    .content, .top { padding-left: 16px; padding-right: 16px; }
    .perm-grid { grid-template-columns: 1fr; }
}
.banner svg { width: 20px; height: 20px; fill: none; stroke: var(--y); stroke-width: 1.8; flex: none; }
.drop svg { width: 26px; height: 26px; fill: none; stroke: var(--y); stroke-width: 1.6; }
.card h2 svg, .row > svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; }
[hidden] { display: none !important; }
label.f.switch { display: flex; }
label.f.switch > span { display: inline; margin: 0; font-family: var(--sans); font-size: 14px; letter-spacing: 0; text-transform: none; color: var(--text); }
.hud-opt svg { max-height: 230px; }
