/* Tableau de bord de Fentikelt — les couleurs du site et du launcher : noir profond, blanc franc, jaune électrique. */
@font-face { font-family: "Barlow"; font-weight: 400; font-display: swap; src: url(fonts/barlow-400.woff2) format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 600; font-display: swap; src: url(fonts/barlow-600.woff2) format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 800; font-display: swap; src: url(fonts/barlow-condensed-800.woff2) format("woff2"); }

:root {
  --bg: #050507; --bg-2: #0b0b0e; --panel: #111116; --panel-2: #17171d; --line: rgba(255,255,255,.09); --line-2: rgba(255,255,255,.16);
  --ink: #f7f7f5; --ink-soft: #a2a3aa; --ink-faint: #6c6d75; --gold: #ffdb1f; --on-gold: #0a0a0a;
  --green: #4fe08a; --red: #ff5d70; --blue: #6ab7ff;
  --title: "Barlow Condensed", "Bahnschrift", "Arial Narrow", sans-serif;
  --text: "Barlow", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, Menlo, monospace;
  --r: 10px;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 15px/1.5 var(--text); -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
h1, h2 { font-family: var(--title); font-weight: 800; text-transform: uppercase; letter-spacing: .03em; margin: 0; line-height: 1; }
h1 { font-size: 34px; }
h2 { font-size: 19px; color: var(--ink); margin-bottom: 14px; }
code { font-family: var(--mono); font-size: .9em; background: rgba(255,255,255,.06); padding: 1px 5px; border-radius: 4px; }
.muted { color: var(--ink-soft); }
.small { font-size: 13px; }
a { color: inherit; }

/* ------------------------------------------------ boutons et champs */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 18px; border: 1px solid var(--line-2); border-radius: 8px;
  background: rgba(255,255,255,.04); color: var(--ink); font: 600 14px/1 var(--text); cursor: pointer; transition: background .15s, border-color .15s, transform .1s; }
.btn:hover { border-color: var(--gold); background: rgba(255,255,255,.08); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--gold); border-color: var(--gold); color: var(--on-gold); font: 800 16px/1 var(--title); letter-spacing: .06em; text-transform: uppercase; }
.btn.primary:hover { background: #ffe556; }
.btn.ghost { background: transparent; }
.btn.small { min-height: 32px; padding: 0 12px; font-size: 13px; }
.btn.danger:hover { border-color: var(--red); color: var(--red); }
.btn:disabled { opacity: .4; cursor: default; }
.link { background: none; border: 0; color: var(--ink-soft); cursor: pointer; padding: 0; font: inherit; text-decoration: underline; text-underline-offset: 3px; }
.link:hover { color: var(--gold); }
.icon-btn { background: none; border: 1px solid transparent; color: var(--ink-soft); cursor: pointer; border-radius: 6px; padding: 5px 8px; font: 600 13px var(--text); white-space: nowrap; }
.icon-btn:hover { border-color: var(--line-2); color: var(--ink); }
.icon-btn.danger:hover { color: var(--red); border-color: rgba(255,93,112,.4); }
input, select, textarea { width: 100%; background: rgba(255,255,255,.04); border: 1px solid var(--line-2); color: var(--ink); border-radius: 8px; padding: 10px 12px; font: 400 15px var(--text); outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--gold); background: rgba(255,255,255,.07); }
select option { background: var(--panel); }
label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--ink-soft); font-weight: 600; }
label.check { flex-direction: row; align-items: center; gap: 8px; font-weight: 400; }
label.check input { width: auto; accent-color: var(--gold); }
.field-label { font-size: 13px; color: var(--ink-soft); font-weight: 600; margin: 14px 0 8px; }
.inline { display: flex; gap: 8px; }
.inline .btn { flex: none; min-height: 42px; }

/* ------------------------------------------------ connexion */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px;
  background: radial-gradient(1200px 600px at 70% -10%, rgba(255,219,31,.08), transparent 60%), var(--bg); }
.login-card { width: min(400px, 100%); display: flex; flex-direction: column; gap: 16px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 32px; }
.login-card .btn { width: 100%; min-height: 48px; }
.err { color: var(--red); min-height: 1em; margin: 0; font-size: 14px; }
.hint { color: var(--ink-faint); font-size: 12.5px; margin: 0; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand img { width: 44px; height: 44px; }
.brand b { display: block; font: 800 24px/1 var(--title); letter-spacing: .04em; }
.brand span { display: block; font: 600 12px/1.4 var(--text); color: var(--gold); letter-spacing: .14em; text-transform: uppercase; }

/* ------------------------------------------------ mise en page */
.app { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 28px; padding: 24px 16px; background: var(--bg-2); border-right: 1px solid var(--line); }
.side .brand { padding: 0 8px; }
nav { display: flex; flex-direction: column; gap: 2px; }
nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 8px; text-decoration: none; color: var(--ink-soft); font-weight: 600; }
nav a svg { width: 18px; height: 18px; fill: currentColor; flex: none; }
nav a:hover { background: rgba(255,255,255,.04); color: var(--ink); }
nav a.on { background: rgba(255,219,31,.1); color: var(--gold); }
.me { margin-top: auto; padding: 14px 12px 0; border-top: 1px solid var(--line); display: flex; flex-direction: column; align-items: flex-start; gap: 4px; font-size: 14px; }
.me span { font-weight: 600; }
.main { padding: 28px clamp(16px, 3vw, 40px) 60px; min-width: 0; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.view { display: flex; flex-direction: column; gap: 20px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 22px; min-width: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

/* ------------------------------------------------ chiffres */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 18px 16px; }
.stat .v { font: 800 36px/1 var(--title); letter-spacing: .02em; }
.stat .l { color: var(--ink-soft); font-size: 13px; font-weight: 600; margin-top: 8px; }
.stat .s { color: var(--ink-faint); font-size: 12.5px; margin-top: 2px; }
.stat.accent .v { color: var(--gold); }

/* ------------------------------------------------ formulaires en ligne */
.form-row .fields { display: flex; gap: 14px; flex-wrap: wrap; }
.form-row .fields label { min-width: 140px; }
.form-row .fields label.grow { flex: 1; min-width: 220px; }
.actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; }
.new-codes { margin-top: 18px; padding: 16px; border: 1px dashed rgba(255,219,31,.4); border-radius: 8px; background: rgba(255,219,31,.04); }
.new-codes .codes { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }

/* ------------------------------------------------ pastilles */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px; font-size: 12.5px; font-weight: 600; border: 1px solid var(--line-2); color: var(--ink-soft); white-space: nowrap; }
.chip.gold { color: var(--gold); border-color: rgba(255,219,31,.45); background: rgba(255,219,31,.07); }
.chip.green { color: var(--green); border-color: rgba(79,224,138,.4); }
.chip.red { color: var(--red); border-color: rgba(255,93,112,.4); }
.chip.blue { color: var(--blue); border-color: rgba(106,183,255,.4); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips-pick { display: flex; flex-wrap: wrap; gap: 8px; }
.chips-pick label { flex-direction: row; align-items: center; gap: 8px; padding: 7px 12px; border: 1px solid var(--line-2); border-radius: 999px; cursor: pointer; color: var(--ink); font-weight: 600; }
.chips-pick label:has(input:checked) { border-color: var(--gold); background: rgba(255,219,31,.08); color: var(--gold); }
.chips-pick input { width: auto; accent-color: var(--gold); margin: 0; }
.code { font-family: var(--mono); font-size: 14px; letter-spacing: .04em; color: var(--ink); background: rgba(255,255,255,.05); border: 1px solid var(--line-2); padding: 5px 9px; border-radius: 6px; cursor: copy; white-space: nowrap; }
.code:hover { border-color: var(--gold); }

/* ------------------------------------------------ tableaux */
.table-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 12px; }
.table-head h2 { margin: 0; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; }
.filters input { width: 280px; max-width: 100%; }
.filters select { width: auto; }
.table-wrap { overflow-x: auto; margin: 0 -22px -22px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font: 600 12px/1 var(--text); color: var(--ink-faint); text-transform: uppercase; letter-spacing: .08em; padding: 12px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th:first-child, td:first-child { padding-left: 22px; }
th:last-child, td:last-child { padding-right: 22px; }
tbody tr:hover { background: rgba(255,255,255,.02); }
tbody tr:last-child td { border-bottom: 0; }
td.right, th.right { text-align: right; }
td .row-actions { display: flex; gap: 4px; justify-content: flex-end; }
.empty { color: var(--ink-faint); text-align: center; padding: 30px; }
.toggle-list { display: flex; gap: 6px; flex-wrap: wrap; }
.toggle { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; border: 1px solid var(--line-2); color: var(--ink-faint); cursor: pointer; background: none; }
.toggle.on { color: var(--gold); border-color: rgba(255,219,31,.45); background: rgba(255,219,31,.07); }
.toggle:hover { border-color: var(--gold); }

/* ------------------------------------------------ branches */
.branch-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; }
.branch { display: flex; flex-direction: column; gap: 14px; }
.branch .bh { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.branch .bh h2 { margin: 0 0 4px; }
.branch .id { font-family: var(--mono); color: var(--ink-faint); font-size: 13px; }
.branch .plat { display: grid; grid-template-columns: 90px 1fr; align-items: center; gap: 10px; }
.branch .plat span { color: var(--ink-soft); font-weight: 600; font-size: 13px; }
.branch .foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; border-top: 1px solid var(--line); padding-top: 12px; }
.list-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); gap: 10px; }
.list-row:last-child { border-bottom: 0; }

/* ------------------------------------------------ fenêtre et messages */
dialog { background: var(--panel); color: var(--ink); border: 1px solid var(--line-2); border-radius: 14px; padding: 26px; width: min(520px, calc(100vw - 32px)); }
dialog::backdrop { background: rgba(0,0,0,.65); backdrop-filter: blur(2px); }
#dlg-body { display: flex; flex-direction: column; gap: 14px; margin-top: 14px; }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; transition: .2s; background: var(--panel-2); border: 1px solid var(--line-2);
  border-radius: 10px; padding: 12px 18px; font-weight: 600; box-shadow: 0 10px 40px rgba(0,0,0,.5); z-index: 50; max-width: calc(100vw - 32px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { border-color: rgba(255,93,112,.5); color: var(--red); }

/* ------------------------------------------------ téléphone */
@media (max-width: 860px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 16px; }
  .side .brand span { display: none; }
  .side .brand img { width: 34px; height: 34px; }
  nav { flex-direction: row; overflow-x: auto; width: 100%; order: 3; scrollbar-width: none; }
  nav a { padding: 8px 10px; white-space: nowrap; }
  .me { order: 2; margin: 0 0 0 auto; border: 0; padding: 0; flex-direction: row; align-items: center; gap: 12px; }
  td.muted { white-space: nowrap; }
  .filters, .filters input { width: 100%; }
  .grid2 { grid-template-columns: 1fr; }
  .main { padding-top: 18px; }
  h1 { font-size: 28px; }
  .table-wrap { margin: 0 -22px -22px; }
}
