/* Thème « Nuit profonde » — partagé par le portail et le Server Manager */
:root {
  --bg: #0b1020;
  --bg-glow: #111a33;
  --panel: #121a2e;
  --panel-2: #172138;
  --line: #1f2a44;
  --line-strong: #2b3a5e;
  --text: #e6ebf5;
  --muted: #8a97b4;
  --accent: #4f8cff;
  --accent-strong: #3b74e6;
  --accent-soft: rgba(79, 140, 255, .14);
  --green: #34d399;
  --yellow: #fbbf24;
  --orange: #fb923c;
  --red: #f87171;
  --grey: #56627d;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; color: var(--text); display: flex; flex-direction: column;
  background: radial-gradient(1200px 600px at 10% -10%, var(--bg-glow), transparent 60%), var(--bg);
  font: 15px/1.5 "Inter", system-ui, "Segoe UI", sans-serif;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select { font: inherit; color: inherit; }
h1, h2, h3 { line-height: 1.2; }

/* ---------- barre du haut ---------- */
.topbar {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 12px 24px; border-bottom: 1px solid var(--line);
  background: rgba(11, 16, 32, .85); backdrop-filter: blur(10px);
  position: sticky; top: 0; z-index: 10;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), #7c5cff); color: #fff; font-size: 15px;
}
.topbar .grow { flex: 1; }
.page-title { font-weight: 600; font-size: 16px; }
.who { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; }
.who b { color: var(--text); font-weight: 600; }

/* ---------- éléments ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--line-strong); background: var(--panel-2); color: var(--text);
  padding: 8px 14px; border-radius: var(--radius-sm); cursor: pointer; white-space: nowrap;
}
.btn:hover:not(:disabled) { border-color: var(--accent); text-decoration: none; }
.btn:disabled { opacity: .4; cursor: default; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover:not(:disabled) { background: var(--accent-strong); }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--red); }
.btn.small { padding: 5px 10px; font-size: 13px; }

.badge {
  display: inline-block; font-size: 12px; padding: 2px 9px; border-radius: 99px;
  background: var(--panel-2); border: 1px solid var(--line); color: var(--muted);
}
.badge.accent { color: var(--accent); border-color: rgba(79,140,255,.35); background: var(--accent-soft); }
.badge.green { color: var(--green); border-color: rgba(52,211,153,.35); }
.badge.red { color: var(--red); border-color: rgba(248,113,113,.35); }

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

label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--muted); }
input, select {
  background: var(--panel-2); border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  padding: 9px 11px; min-width: 0;
}
input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: -1px; }

.alert { padding: 10px 14px; border-radius: var(--radius-sm); font-size: 14px; border: 1px solid; }
.alert.error { color: var(--red); border-color: rgba(248,113,113,.4); background: rgba(248,113,113,.08); }
.alert.success { color: var(--green); border-color: rgba(52,211,153,.4); background: rgba(52,211,153,.08); }

.muted { color: var(--muted); }

/* ---------- pages d'authentification ---------- */
.auth { display: grid; place-items: center; padding: 24px 16px; }
.auth-box { width: min(400px, 100%); display: flex; flex-direction: column; gap: 18px; }
.auth-box .brand { justify-content: center; font-size: 20px; }
.auth-box form { display: flex; flex-direction: column; gap: 14px; }
.auth-links { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; font-size: 14px; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ---------- accueil ---------- */
.page { max-width: 1100px; margin: 0 auto; padding: 32px 24px 48px; }
.hero h1 { font-size: 28px; margin: 0 0 6px; }
.hero p { margin: 0; color: var(--muted); }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; margin-top: 28px; }
.tile {
  display: flex; flex-direction: column; gap: 10px; padding: 22px; color: var(--text);
  background: linear-gradient(180deg, var(--panel-2), var(--panel)); border: 1px solid var(--line);
  border-radius: var(--radius); transition: border-color .15s, transform .15s, box-shadow .15s;
}
.tile:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow); text-decoration: none; }
.tile-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-size: 22px; background: var(--accent-soft); }
.tile h2 { margin: 0; font-size: 18px; }
.tile p { margin: 0; color: var(--muted); font-size: 14px; flex: 1; }

/* ---------- tableaux (admin) ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; background: var(--panel); }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); font-size: 14px; vertical-align: middle; }
th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; background: var(--panel-2); }
tr:last-child td { border-bottom: none; }
td select { padding: 6px 8px; }
td form { margin: 0; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.legend { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; margin: 18px 0; }
.legend .card { padding: 14px; font-size: 13px; color: var(--muted); }
.legend b { color: var(--text); display: block; margin-bottom: 4px; }

/* ---------- avatar, signature ---------- */
.avatar { display: inline-grid; place-items: center; border-radius: 50%; object-fit: cover; flex: none;
  background: linear-gradient(135deg, var(--accent), #7c5cff); color: #fff; font-weight: 700; border: 1px solid var(--line-strong); }
.avatar-edit { display: flex; align-items: center; gap: 12px; }
.avatar-edit input[type=file] { font-size: 13px; padding: 6px; }
body > main { flex: 1 0 auto; width: 100%; }
.signature { margin-top: auto; text-align: center; color: var(--muted); font-size: 12px; padding: 20px 16px; border-top: 1px solid var(--line); }

@media (max-width: 600px) {
  .topbar, .page { padding-left: 16px; padding-right: 16px; }
  .hero h1 { font-size: 23px; }
}
