:root {
  --bg: #0b0c10; --panel: #14161c; --panel2: #1b1e26; --line: #262a35; --text: #e8eaf0; --muted: #8b91a1;
  --accent: #e50914; --accent2: #ff3b45; --ok: #22c55e; --warn: #f59e0b; --err: #ef4444; --info: #3b82f6;
  --r: 12px; --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.45 var(--font); }
a { color: var(--accent2); }
button, input, select { font: inherit; color: inherit; }
.boot { padding: 40px; color: var(--muted); }
[hidden] { display: none !important; }

/* connexion */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px;
  background: radial-gradient(1200px 600px at 20% -10%, #3a0a10 0%, transparent 60%), var(--bg); }
.login form { width: 100%; max-width: 360px; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 28px; }
.login h1 { margin: 0 0 4px; font-size: 22px; }
.login p { margin: 0 0 20px; color: var(--muted); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.brand img { width: 30px; height: 30px; }

/* structure */
.app { display: grid; grid-template-columns: 230px 1fr; min-height: 100vh; }
.side { background: var(--panel); border-right: 1px solid var(--line); padding: 18px 12px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; }
.side .brand { padding: 4px 10px 18px; }
.nav { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; cursor: pointer; color: var(--muted); border: 0; background: none; text-align: left; width: 100%; }
.nav:hover { background: var(--panel2); color: var(--text); }
.nav.on { background: #2a0d12; color: #fff; box-shadow: inset 3px 0 0 var(--accent); }
.side .grow { flex: 1; }
.side .who { color: var(--muted); font-size: 12px; padding: 8px 12px; }
.main { padding: 26px 30px 60px; min-width: 0; }
.main h2 { margin: 0 0 4px; font-size: 22px; }
.sub { color: var(--muted); margin: 0 0 20px; }
@media (max-width: 820px) {
  .app { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; }
  .side .brand, .side .grow, .side .who { display: none; }
  .nav { width: auto; }
  .main { padding: 18px 16px 60px; }
}

/* composants */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; margin-bottom: 22px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; }
.card.clickable { cursor: pointer; }
.card.clickable:hover { border-color: #3a4050; }
a.btn { text-decoration: none; color: var(--text); display: inline-block; }
.card h3 { margin: 0 0 8px; font-size: 13px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.card .big { font-size: 26px; font-weight: 700; }
.card .small { color: var(--muted); font-size: 12px; margin-top: 4px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; margin-bottom: 18px; }
.panel h3 { margin: 0 0 12px; font-size: 16px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.spacer { flex: 1; }
label.f { display: block; margin-bottom: 12px; }
label.f span { display: block; color: var(--muted); font-size: 12px; margin-bottom: 5px; }
input[type=text], input[type=password], input[type=search], input:not([type]), select {
  width: 100%; background: var(--panel2); border: 1px solid var(--line); border-radius: 9px; padding: 9px 11px; outline: none; }
input:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px #e5091433; }
select { cursor: pointer; }
.row input, .row select { width: auto; }
.btn { background: var(--panel2); border: 1px solid var(--line); border-radius: 9px; padding: 8px 14px; cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: #3a4050; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.btn.primary:hover { background: var(--accent2); }
.btn.danger { color: #ffb4b4; border-color: #5a1d1d; }
.btn.small { padding: 4px 10px; font-size: 12px; }
.btn:disabled { opacity: .5; cursor: default; }
.btn.block { width: 100%; padding: 11px; }
.err { color: #ffb4b4; min-height: 20px; margin: 4px 0 10px; }
.tag { display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: 11px; font-weight: 600; background: var(--panel2); border: 1px solid var(--line); color: var(--muted); }
.tag.ok { color: #86efac; border-color: #14532d; background: #052e16; }
.tag.err { color: #fca5a5; border-color: #7f1d1d; background: #2a0b0b; }
.tag.warn { color: #fcd34d; border-color: #78350f; background: #2a1a05; }
.tag.info { color: #93c5fd; border-color: #1e3a8a; background: #0b1631; }
.tag.red { color: #fff; background: var(--accent); border-color: var(--accent); }
.muted { color: var(--muted); }
.mono { font-family: ui-monospace, Consolas, monospace; font-size: 12px; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; position: sticky; top: 0; background: var(--panel); z-index: 1; }
tr:hover td { background: #171a21; }
td.num { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
td select { min-width: 220px; }
tr.changed td { background: #1f1508; }
tr.excluded td.name { color: var(--muted); }
.tablewrap { overflow: auto; max-height: calc(100vh - 260px); border: 1px solid var(--line); border-radius: var(--r); }
.tabs { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.tab { padding: 8px 14px; border-radius: 99px; border: 1px solid var(--line); background: var(--panel); cursor: pointer; }
.tab.on { background: var(--text); color: #000; border-color: var(--text); font-weight: 600; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.toolbar input[type=search] { width: 260px; }
.toolbar select { width: auto; max-width: 280px; }
@media (max-width: 640px) { .toolbar input[type=search], .toolbar select { width: 100%; max-width: none; } }
.savebar { position: sticky; bottom: 0; margin-top: 12px; background: #1f1508; border: 1px solid #78350f; border-radius: var(--r); padding: 10px 14px; display: flex; gap: 10px; align-items: center; }

.modal { position: fixed; inset: 0; background: #000a; display: grid; place-items: center; padding: 16px; z-index: 50; }
.modal .box { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; width: 100%; max-width: 560px; max-height: 85vh; overflow: auto; padding: 22px; }
.modal h3 { margin: 0 0 14px; }
.list { margin: 0; padding-left: 18px; color: var(--muted); }
.toast { position: fixed; bottom: 20px; right: 20px; background: var(--panel2); border: 1px solid var(--line); padding: 12px 16px; border-radius: 12px; z-index: 60; max-width: 420px; box-shadow: 0 10px 30px #0008; }
.toast.err { border-color: #7f1d1d; color: #fecaca; }
.toast.ok { border-color: #14532d; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; margin-right: 6px; background: var(--muted); }
.dot.ok { background: var(--ok); } .dot.err { background: var(--err); } .dot.warn { background: var(--warn); }
.help { background: #0b1631; border: 1px solid #1e3a8a; color: #bfdbfe; border-radius: var(--r); padding: 12px 14px; margin-bottom: 16px; font-size: 13px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 640px) { .grid2 { grid-template-columns: 1fr; } }
