/* ---------------------------------------------------------------------------
   Portail — feuille de style commune (design system minimal)
   --------------------------------------------------------------------------- */
:root {
  --bg: #0b0f14;
  --panel: rgba(255, 255, 255, .045);
  --panel-strong: rgba(255, 255, 255, .08);
  --line: rgba(255, 255, 255, .1);
  --text: #e9eef6;
  --muted: #8a97a8;
  --accent: #2ee6a8;
  --accent-dim: #17a97b;
  --warn: #f2b53d;
  --danger: #f2545b;
  --radius: 18px;
  --shadow: 0 18px 50px rgba(0, 0, 0, .45);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body { margin: 0; min-height: 100%; }

body {
  background:
    radial-gradient(90ch 60ch at 50% -20%, rgba(46, 230, 168, .10), transparent 70%),
    radial-gradient(70ch 50ch at 50% 120%, rgba(46, 130, 230, .08), transparent 70%),
    var(--bg);
  color: var(--text);
  font-family: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", sans-serif;
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  font-size: 15px;
}

a { color: inherit; text-decoration: none; }

/* ---------- Barre supérieure ---------- */
.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: max(12px, env(safe-area-inset-top)) 18px 12px;
  border-bottom: 1px solid var(--line);
  background: rgba(11, 15, 20, .72);
  backdrop-filter: blur(14px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 17px;
  font-weight: 650;
  letter-spacing: .2px;
}

.brand .dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 14px rgba(46, 230, 168, .75);
}

.brand small {
  font-weight: 400;
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .3px;
}

.spacer { flex: 1; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  font-size: 12.5px;
  color: var(--muted);
  white-space: nowrap;
}

.chip b { color: var(--text); font-weight: 600; }

.chip .badge-admin {
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(242, 181, 61, .14);
  border: 1px solid rgba(242, 181, 61, .35);
  color: #ffdf9b;
  font-size: 10.5px;
  letter-spacing: .06em;
  text-transform: uppercase;
}

/* ---------- Liens / boutons ---------- */
.link-btn {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  border-radius: 999px;
  padding: 7px 13px;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
  transition: background .15s, border-color .15s;
}

.link-btn:hover { background: var(--panel-strong); border-color: rgba(255, 255, 255, .22); }

.btn {
  padding: 11px 18px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background .15s, transform .12s, border-color .15s;
}

.btn:hover { background: var(--panel-strong); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }

.btn.primary { background: var(--accent); border-color: transparent; color: #06231a; }
.btn.primary:hover { background: #4df0ba; }

.btn.danger {
  background: rgba(242, 84, 91, .14);
  border-color: rgba(242, 84, 91, .4);
  color: #ffd7d9;
}
.btn.danger:hover { background: rgba(242, 84, 91, .24); }

.icon-btn {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
  font-size: 16px;
  transition: background .15s, transform .15s, border-color .15s;
}

.icon-btn:hover { background: var(--panel-strong); border-color: rgba(255, 255, 255, .2); }
.icon-btn:active { transform: scale(.94); }
.icon-btn svg { width: 19px; height: 19px; }

/* ---------- Mise en page ---------- */
.wrap {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 22px 18px 40px;
}

.page-head { margin-bottom: 18px; }
.page-head h1 { margin: 0 0 6px; font-size: 22px; font-weight: 650; letter-spacing: -.2px; }
.page-head p { margin: 0; color: var(--muted); font-size: 13.5px; }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
}

/* ---------- Formulaires ---------- */
.field { display: flex; flex-direction: column; gap: 7px; }
.field label { font-size: 12.5px; color: var(--muted); letter-spacing: .02em; }

input[type="text"], input[type="password"], select, textarea {
  width: 100%;
  padding: 12px 13px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .05);
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
}

select { appearance: none; background-image: none; }

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: rgba(46, 230, 168, .55);
  box-shadow: 0 0 0 3px rgba(46, 230, 168, .13);
}

/* ---------- Divers ---------- */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel);
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

.pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.pill.ok .dot { background: var(--accent); box-shadow: 0 0 10px rgba(46, 230, 168, .9); }
.pill.ok { color: #bff3df; border-color: rgba(46, 230, 168, .35); }
.pill.bad .dot { background: var(--danger); box-shadow: 0 0 10px rgba(242, 84, 91, .8); }
.pill.bad { color: #ffc9cc; border-color: rgba(242, 84, 91, .3); }
.pill.warn .dot { background: var(--warn); box-shadow: 0 0 10px rgba(242, 181, 61, .8); }
.pill.warn { color: #ffe6ae; border-color: rgba(242, 181, 61, .3); }

.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; }

.empty {
  padding: 28px 18px;
  text-align: center;
  color: var(--muted);
  font-size: 13.5px;
  border: 1px dashed var(--line);
  border-radius: 14px;
}

.hidden { display: none !important; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  padding: 11px 18px;
  border-radius: 999px;
  background: #121821;
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 13px;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s, transform .25s;
  z-index: 60;
}

.toast.show { opacity: 1; transform: translateX(-50%) translateY(-4px); }
.toast.err { color: #ffc9cc; border-color: rgba(242, 84, 91, .35); }
.toast.ok { color: #bff3df; border-color: rgba(46, 230, 168, .35); }

dialog {
  width: min(520px, calc(100vw - 32px));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #121821;
  color: var(--text);
  padding: 0;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .65);
}

dialog::backdrop { background: rgba(4, 7, 10, .68); backdrop-filter: blur(3px); }

.dlg-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 20px 12px;
  border-bottom: 1px solid var(--line);
}

.dlg-head h2 { margin: 0; font-size: 16px; font-weight: 650; }
.dlg-body { padding: 18px 20px; display: flex; flex-direction: column; gap: 16px; }
.dlg-foot { display: flex; gap: 10px; justify-content: flex-end; padding: 0 20px 20px; }

.flash { font-size: 12.5px; min-height: 1em; }
.flash.ok { color: var(--accent); }
.flash.err { color: var(--danger); }
