:root {
  --bg:      #0a0a0b;
  --bg2:     #111114;
  --bg3:     #18181c;
  --border:  rgba(255,255,255,0.07);
  --border2: rgba(255,255,255,0.12);
  --text:    #e8e6e0;
  --muted:   #6b6966;
  --muted2:  #9a9590;
  /* Anciennement doré — neutralisé en sable clair / blanc cassé.
     Les noms --gold / --gold2 restent pour ne pas casser les usages dans
     les autres CSS. Pour un futur cleanup, renommer en --accent / --accent2. */
  --gold:    #c4bfb1;
  --gold2:   #e8e3d7;
  --red:     #c94c4c;
  --mono:    'DM Mono', monospace;
  --serif:   'Instrument Serif', serif;
  --sans:    'DM Sans', sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* Caret masqué partout sauf dans les vrais champs de saisie */
*:not(input):not(textarea):not([contenteditable="true"]) { caret-color: transparent; }
input, textarea, [contenteditable="true"] { caret-color: auto; }

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.landing {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 48px;
}

/* ── Logo ── */
.landing-logo {
  display: flex;
  align-items: center;
  gap: 14px;
  user-select: none;
}

.landing-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 12px var(--gold);
  animation: pulse-dot 2.4s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 12px var(--gold); }
  50%      { box-shadow: 0 0 24px var(--gold2), 0 0 48px rgba(255, 255, 255,0.25); }
}

.landing-title {
  font-family: var(--serif);
  font-size: 3.2rem;
  font-weight: 400;
  color: var(--text);
  letter-spacing: 0.02em;
}

/* ── Stats cliquables ── */
.landing-stats {
  display: flex;
  gap: 16px;
}

.stat-block {
  position: relative;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg2);
  padding: 14px 22px;
  min-width: 140px;
  cursor: default;
  transition: border-color 0.2s, background 0.2s;
}

.stat-block:has(.stat-detail) {
  cursor: pointer;
}

.stat-block:has(.stat-detail):hover {
  border-color: var(--border2);
  background: var(--bg3);
}

.stat-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--muted2);
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.stat-head .val {
  font-size: 1.4rem;
  font-weight: 500;
  color: var(--gold);
  font-family: var(--mono);
}

.stat-head .lbl {
  text-transform: uppercase;
  font-size: 0.65rem;
  letter-spacing: 0.06em;
}

.stat-head .chevron {
  font-size: 0.65rem;
  color: var(--muted);
  margin-left: auto;
  transition: transform 0.25s ease;
}

.stat-block.open .chevron {
  transform: rotate(180deg);
}

/* Detail dropdown */
.stat-detail {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, margin-top 0.3s ease, opacity 0.25s ease;
  opacity: 0;
  margin-top: 0;
}

.stat-block.open .stat-detail {
  max-height: 160px;
  opacity: 1;
  margin-top: 12px;
}

.detail-row {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--muted2);
  padding: 3px 0;
  letter-spacing: 0.02em;
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.detail-val {
  color: var(--text);
  font-weight: 500;
  min-width: 24px;
}

/* Alertes : couleur rouge si > 0 */
#sb-alerts .val {
  color: var(--red);
}

/* ── Boutons ── */
.landing-actions {
  display: flex;
  gap: 28px;
}

.landing-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding: 40px 48px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--bg2);
  text-decoration: none;
  color: var(--text);
  transition: all 0.25s ease;
  cursor: pointer;
  min-width: 260px;
}

.landing-card:hover {
  border-color: var(--gold);
  background: var(--bg3);
  transform: translateY(-4px);
  box-shadow: 0 8px 32px rgba(255, 255, 255,0.1);
}

.card-icon {
  font-size: 2.6rem;
  line-height: 1;
  opacity: 0.9;
}

.card-title {
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 400;
  letter-spacing: 0.01em;
}

.card-desc {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted2);
  text-align: center;
  line-height: 1.6;
  max-width: 200px;
}

/* Déconnexion discrète en bas à droite */
.landing-logout {
  position: fixed;
  bottom: 18px;
  right: 22px;
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--muted);
  text-decoration: none;
  letter-spacing: 0.04em;
  opacity: 0.6;
  transition: opacity 0.2s, color 0.2s;
}
.landing-logout:hover {
  opacity: 1;
  color: var(--gold);
}

/* ── Responsive mobile (< 640px) ───────────────────────────────── */
@media (max-width: 640px) {
  html, body {
    overflow: auto;
    align-items: flex-start;
    padding: 24px 0;
  }
  .landing {
    gap: 28px;
    padding: 16px;
    width: 100%;
  }
  .landing-title { font-size: 2.2rem; }
  .landing-dot  { width: 10px; height: 10px; }

  .landing-stats {
    flex-direction: column;
    width: 100%;
    gap: 10px;
  }
  .stat-block {
    width: 100%;
    min-width: 0;
    padding: 12px 16px;
  }

  .landing-actions {
    flex-direction: column;
    gap: 14px;
    width: 100%;
  }
  .landing-card {
    width: 100%;
    min-width: 0;
    padding: 24px 20px;
    flex-direction: row;
    align-items: center;
    gap: 16px;
    text-align: left;
  }
  .card-icon { font-size: 2rem; }
  .card-desc { text-align: left; max-width: none; }

  .landing-logout {
    bottom: 10px;
    right: 12px;
    font-size: 0.65rem;
  }
}
