/* ==========================================================================
   Dashboard — identité "table céleste"
   Palette inspirée des atlas astronomiques anciens : ciel de nuit profond,
   or de vélin, cyan des cartes stellaires.
   ========================================================================== */

:root {
  --ink:        #0b1020;  /* ciel nocturne profond (fond) */
  --ink-raised: #121a30;  /* panneaux */
  --ink-line:   #1f2a45;  /* filets, bordures */
  --vellum:     #e8e2d0;  /* texte principal, ton parchemin */
  --vellum-dim: #9aa3b8;  /* texte secondaire */
  --gold:       #c9a25a;  /* accent principal, or ancien */
  --gold-bright:#e4c37e;
  --cyan:       #6fb7c9;  /* accent secondaire, cartographie */
  --danger:     #d98a6a;  /* alertes, en ton chaud pour rester dans la palette */

  --font-display: "Iowan Old Style", "Palatino Linotype", "Palatino", "Georgia", serif;
  --font-body:    "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-mono:    "JetBrains Mono", "SF Mono", "Consolas", monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--ink);
  color: var(--vellum);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--cyan); text-decoration: none; }
a:hover { color: var(--gold-bright); }

/* --------------------------------------------------------------------------
   Page de login
   -------------------------------------------------------------------------- */
.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background:
    radial-gradient(1200px 800px at 70% -10%, #16203c 0%, transparent 60%),
    radial-gradient(900px 700px at 10% 110%, #101830 0%, transparent 55%),
    var(--ink);
}

.login-shell {
  position: relative;
  width: min(92vw, 420px);
  padding: 8px;
}

.celestial {
  position: absolute;
  inset: -70px 0 auto 50%;
  transform: translateX(-50%);
  width: 240px;
  height: 240px;
  opacity: 0.5;
  pointer-events: none;
}

.astrolabe { width: 100%; height: 100%; }
.astrolabe .ring {
  fill: none;
  stroke: var(--gold);
  stroke-width: 0.6;
  opacity: 0.5;
}
.astrolabe .ring-outer { stroke-width: 1; opacity: 0.7; }
.astrolabe .grat { stroke: var(--cyan); stroke-width: 0.4; opacity: 0.35; }
.astrolabe .grat-faint { opacity: 0.16; }
.astrolabe .star { fill: var(--gold-bright); }

.login-card {
  position: relative;
  background: linear-gradient(180deg, var(--ink-raised), #0e1526);
  border: 1px solid var(--ink-line);
  border-radius: 14px;
  padding: 40px 34px 34px;
  box-shadow: 0 30px 80px -40px rgba(0,0,0,0.9);
}

.eyebrow {
  margin: 0 0 6px;
  font-size: 11px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--gold);
}

.login-card h1 {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 30px;
  letter-spacing: 0.01em;
}

.sub { margin: 0 0 24px; color: var(--vellum-dim); font-size: 14px; line-height: 1.5; }

.form { display: grid; gap: 16px; }
.form label { display: grid; gap: 6px; }
.form label span {
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--vellum-dim);
  text-transform: uppercase;
}
.form input {
  background: #0a0f1e;
  border: 1px solid var(--ink-line);
  border-radius: 8px;
  padding: 12px 13px;
  color: var(--vellum);
  font-size: 15px;
  font-family: var(--font-body);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.form input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201, 162, 90, 0.15);
}

.form button {
  margin-top: 6px;
  background: linear-gradient(180deg, var(--gold-bright), var(--gold));
  color: #1a1206;
  border: none;
  border-radius: 8px;
  padding: 13px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: transform 0.08s ease, filter 0.15s ease;
}
.form button:hover { filter: brightness(1.06); }
.form button:active { transform: translateY(1px); }

.alert {
  background: rgba(217, 138, 106, 0.12);
  border: 1px solid rgba(217, 138, 106, 0.4);
  color: var(--danger);
  padding: 11px 13px;
  border-radius: 8px;
  font-size: 13.5px;
  margin-bottom: 18px;
}

/* --------------------------------------------------------------------------
   Barre supérieure + coquille du dashboard
   -------------------------------------------------------------------------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 28px;
  border-bottom: 1px solid var(--ink-line);
  background: linear-gradient(180deg, var(--ink-raised), transparent);
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark { color: var(--gold); font-size: 18px; }
.brand-name {
  font-family: var(--font-display);
  font-size: 19px;
  letter-spacing: 0.02em;
}
.topnav .logout { font-size: 14px; color: var(--vellum-dim); }
.topnav .logout:hover { color: var(--gold-bright); }

.shell { max-width: 1080px; margin: 0 auto; padding: 48px 28px; }

.placeholder-panel {
  background: var(--ink-raised);
  border: 1px solid var(--ink-line);
  border-radius: 14px;
  padding: 40px;
}
.placeholder-panel h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 28px;
  margin: 0 0 10px;
}

/* --------------------------------------------------------------------------
   Accessibilité
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* --------------------------------------------------------------------------
   Tableau de bord — cartes serveur (Brique 2)
   -------------------------------------------------------------------------- */
.refresh-hint {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--vellum-dim);
  margin-right: 18px;
  letter-spacing: 0.03em;
}

.server-card {
  background: var(--ink-raised);
  border: 1px solid var(--ink-line);
  border-radius: 14px;
  padding: 28px 30px;
  margin-bottom: 22px;
}

.server-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--ink-line);
}
.server-title { display: flex; align-items: center; gap: 12px; }
.server-title h2 {
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 600;
  margin: 0;
}
.server-state {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--vellum-dim);
}

.status-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.dot-on  { background: #7fc9a0; box-shadow: 0 0 10px rgba(127,201,160,0.6); }
.dot-off { background: #6b7280; }

.stat-row { display: flex; gap: 40px; margin-bottom: 24px; }
.stat { display: flex; flex-direction: column; gap: 2px; }
.stat-num {
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 600;
  color: var(--gold-bright);
  line-height: 1;
}
.stat-label {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--vellum-dim);
}

.player-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.player-table thead th {
  text-align: left;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--vellum-dim);
  font-weight: 500;
  padding: 8px 10px;
  border-bottom: 1px solid var(--ink-line);
}
.player-table tbody td {
  padding: 10px;
  border-bottom: 1px solid rgba(31,42,69,0.5);
}
.player-table tbody tr:last-child td { border-bottom: none; }
.p-name { font-weight: 600; color: var(--vellum); }
.p-meta { color: var(--vellum-dim); font-family: var(--font-mono); font-size: 13px; }
.p-empty { color: var(--vellum-dim); font-style: italic; text-align: center; padding: 20px; }

.empty-state {
  background: var(--ink-raised);
  border: 1px solid var(--ink-line);
  border-radius: 14px;
  padding: 40px;
  text-align: center;
  color: var(--vellum-dim);
}

/* --------------------------------------------------------------------------
   Panneaux LLM + journaux (Brique 2)
   -------------------------------------------------------------------------- */
.panel {
  background: var(--ink-raised);
  border: 1px solid var(--ink-line);
  border-radius: 14px;
  padding: 26px 30px;
  margin-bottom: 22px;
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.panel-title { display: flex; align-items: center; gap: 12px; }
.panel-title h2 {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 600;
  margin: 0;
}
.panel-state {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--vellum-dim);
}

.llm-detail { color: var(--vellum-dim); font-size: 14px; margin: 0 0 16px; }
.llm-badges { display: flex; gap: 12px; flex-wrap: wrap; }
.badge {
  font-family: var(--font-mono);
  font-size: 12px;
  background: #0a0f1e;
  border: 1px solid var(--ink-line);
  border-radius: 6px;
  padding: 6px 12px;
  color: var(--vellum-dim);
}

.log-tabs { display: flex; gap: 6px; }
.tab {
  background: transparent;
  border: 1px solid var(--ink-line);
  color: var(--vellum-dim);
  border-radius: 7px;
  padding: 6px 14px;
  font-size: 13px;
  cursor: pointer;
  font-family: var(--font-body);
  transition: all 0.12s ease;
}
.tab:hover { color: var(--vellum); border-color: var(--gold); }
.tab.active {
  background: rgba(201,162,90,0.14);
  border-color: var(--gold);
  color: var(--gold-bright);
}

.log-view {
  background: #070b16;
  border: 1px solid var(--ink-line);
  border-radius: 10px;
  padding: 16px 18px;
  margin: 0;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.55;
  color: #b9c2d4;
  max-height: 380px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
}
.log-view::-webkit-scrollbar { width: 10px; }
.log-view::-webkit-scrollbar-track { background: transparent; }
.log-view::-webkit-scrollbar-thumb { background: var(--ink-line); border-radius: 5px; }
