/* Empire Groups — espace pro */

@font-face {
  font-family: 'Manrope';
  font-weight: 200 800;
  font-display: swap;
  src: url(fonts/manrope-latin-wght-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Manrope';
  font-weight: 200 800;
  font-display: swap;
  src: url(fonts/manrope-latin-ext-wght-normal.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
:root {
  color-scheme: light;
  --bg: #f4f3ef;
  --surface: #fbfaf7;
  --surface-2: #ffffff;
  --line: #e2e0d9;
  --line-strong: #cfccc3;
  --ink: #111111;
  --muted: #5d5c57;
  --muted-2: #8a8882;
  --faint: #a8a59d;
  --accent: #ff4f1f;
  --accent-hover: #e0421a;
  --accent-light: #ff8a66;
  --accent-text: #d63d12;
  --accent-wash: rgba(255, 79, 31, 0.08);
  --grad: linear-gradient(90deg, #ff4f1f, #ff4f1f);
  --grad-btn: linear-gradient(90deg, #111111, #111111);
  --side: #111111;
  --side-2: #1d1d1b;
  --navy: #111111;
  --side-text: #f4f3ef;
  --side-muted: #9a9891;

  /* Statut (toujours accompagné d'une icône et d'un libellé). */
  --good: #0ca30c;
  --good-text: #0a7a0a;
  --warning: #fab219;
  --warning-text: #8a5a00;
  --critical: #d03b3b;
  --critical-text: #b42f2f;

  /* Séries de graphiques (palette validée sur le fond #fbfaf7). */
  --s1: #e8461a;
  --s2: #2f6fd6;
  --grid: #ebe9e2;

  --sans: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --serif: var(--sans);
  --mono: var(--sans);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --radius: 18px;
  --shadow: 0 1px 0 rgba(17, 17, 17, 0.02), 0 18px 40px -32px rgba(17, 17, 17, 0.35);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
h1,
h2,
h3,
h4,
p,
ul,
ol,
dl,
dd {
  margin: 0;
}
ul,
ol {
  padding: 0;
  list-style: none;
}
a {
  color: inherit;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
}
svg {
  display: block;
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}
.i {
  width: 16px;
  height: 16px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.mono {
  font-family: var(--mono);
}
.num {
  font-variant-numeric: tabular-nums;
}
.muted {
  color: var(--muted-2);
}
.sr {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
[hidden] {
  display: none !important;
}
.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

/* Écran de démarrage ------------------------------------------------------------------------- */

.boot {
  display: grid;
  place-items: center;
  min-height: 100vh;
  background: var(--navy);
  color: var(--accent-light);
}
.boot svg {
  width: 56px;
  height: 56px;
  border-radius: 13px;
  box-shadow: 0 0 0 1px rgba(244, 243, 239, 0.22);
  animation: pulse 1.4s var(--ease) infinite;
}
@keyframes pulse {
  50% {
    opacity: 0.35;
  }
}

/* Connexion --------------------------------------------------------------------------------- */

.auth {
  display: grid;
  min-height: 100vh;
}
@media (min-width: 900px) {
  .auth {
    grid-template-columns: 1.05fr 1fr;
  }
}
.auth__brand {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 48px;
  padding: clamp(28px, 5vw, 64px);
  overflow: hidden;
  background:
    radial-gradient(700px 500px at 80% 100%, rgba(255, 79, 31, 0.16), transparent 70%),
    radial-gradient(600px 400px at 0% 0%, rgba(40, 40, 38, 0.9), transparent 70%),
    var(--navy);
  color: var(--side-text);
}
.auth__mark {
  display: flex;
  align-items: center;
  gap: 14px;
}
.auth__mark svg {
  width: 44px;
  height: 44px;
  border-radius: 11px;
  box-shadow: 0 0 0 1px rgba(244, 243, 239, 0.22);
}
.auth__mark strong {
  display: block;
  font-family: var(--serif);
  letter-spacing: -0.035em;
  font-size: 26px;
  font-weight: 800;
  line-height: 1;
}
.auth__mark span {
  display: block;
  margin-top: 4px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--side-muted);
}
.auth__title {
  font-family: var(--serif);
  font-weight: 800;
  font-size: clamp(2.6rem, 5vw, 4.4rem);
  line-height: 0.98;
  letter-spacing: -0.035em;
}
.auth__title em {
  font-style: normal;
  color: var(--accent);
}
.auth__brand p {
  max-width: 40ch;
  margin-top: 20px;
  color: var(--side-muted);
  font-size: 15px;
}
.auth__foot {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--side-muted);
}
.auth__panel {
  display: grid;
  place-items: center;
  padding: clamp(24px, 5vw, 64px);
}
.auth__card {
  width: min(420px, 100%);
}
.auth__card h2 {
  font-family: var(--serif);
  letter-spacing: -0.035em;
  font-size: 2.2rem;
  font-weight: 800;
  line-height: 1.05;
}
.auth__card > p {
  margin-top: 8px;
  color: var(--muted);
}
.auth__card form {
  display: grid;
  gap: 16px;
  margin-top: 28px;
}
.auth__card .btn {
  width: 100%;
  margin-top: 6px;
}
@media (max-width: 899px) {
  .auth__brand {
    min-height: 260px;
  }
  .auth__brand p,
  .auth__foot {
    display: none;
  }
}

/* Coquille ---------------------------------------------------------------------------------- */

.shell {
  display: grid;
  min-height: 100vh;
}
@media (min-width: 1080px) {
  .shell {
    grid-template-columns: 268px 1fr;
  }
}
.side {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  width: 268px;
  padding: 22px 14px 16px;
  background:
    radial-gradient(400px 300px at 0% 100%, rgba(255, 79, 31, 0.08), transparent 70%),
    var(--side);
  color: var(--side-text);
  overflow-y: auto;
  transform: translateX(-100%);
  transition: transform 0.45s var(--ease);
}
.side.is-open {
  transform: none;
  box-shadow: 30px 0 80px rgba(0, 0, 0, 0.35);
}
@media (min-width: 1080px) {
  .side {
    position: sticky;
    top: 0;
    height: 100vh;
    transform: none;
  }
}
.side__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 2px 10px 22px;
  text-decoration: none;
}
.side__brand svg {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  box-shadow: 0 0 0 1px rgba(244, 243, 239, 0.22);
}
.side__brand strong {
  display: block;
  font-family: var(--serif);
  letter-spacing: -0.035em;
  font-size: 21px;
  font-weight: 800;
  line-height: 1;
}
.side__brand span {
  display: block;
  margin-top: 4px;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--accent-light);
}
.side__group + .side__group {
  margin-top: 18px;
}
.side__label {
  padding: 0 12px 6px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--side-muted);
}
.side__link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  height: 38px;
  padding: 0 12px;
  border-radius: 10px;
  color: rgba(244, 243, 239, 0.78);
  font-weight: 600;
  font-size: 13.5px;
  text-decoration: none;
  transition: background-color 0.2s, color 0.2s;
}
.side__link:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}
.side__link.is-active {
  background: rgba(255, 79, 31, 0.14);
  color: #fff;
}
.side__link.is-active::before {
  content: '';
  position: absolute;
  left: -14px;
  top: 9px;
  bottom: 9px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--accent);
}
.side__link .i {
  opacity: 0.85;
}
.side__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin: 0 4px;
  background: var(--c);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 22%, transparent);
}
.side__badge {
  margin-left: auto;
  min-width: 22px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  line-height: 20px;
  text-align: center;
}
.side__foot {
  margin-top: auto;
  padding-top: 18px;
}
.side__user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
}
.avatar {
  display: grid;
  place-items: center;
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  font-size: 13px;
}
.side__user strong {
  display: block;
  font-size: 13px;
  line-height: 1.2;
}
.side__user div span {
  font-size: 11.5px;
  color: var(--side-muted);
}
.side__user button {
  margin-left: auto;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--side-muted);
}
.side__user button:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}
.scrim {
  position: fixed;
  inset: 0;
  z-index: 39;
  background: rgba(17, 17, 17, 0.45);
}
@media (min-width: 1080px) {
  .scrim {
    display: none;
  }
}

.main {
  min-width: 0;
  padding: 0 clamp(16px, 3vw, 40px) 64px;
}
.top {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 calc(-1 * clamp(16px, 3vw, 40px));
  padding: 14px clamp(16px, 3vw, 40px);
  background: rgba(244, 243, 239, 0.86);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s;
}
.top.is-stuck {
  border-color: var(--line);
}
.top__menu {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}
@media (min-width: 1080px) {
  .top__menu {
    display: none;
  }
}
.top__crumb {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--muted-2);
}
.top__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}
.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 0 26px;
}
.page-head h1 {
  font-family: var(--serif);
  font-weight: 800;
  font-size: clamp(2.1rem, 3.4vw, 2.9rem);
  line-height: 1;
  letter-spacing: -0.035em;
}
.page-head p {
  margin-top: 8px;
  color: var(--muted);
  max-width: 70ch;
}
.page-head__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Boutons et champs ------------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 38px;
  padding: 0 15px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 650;
  white-space: nowrap;
  text-decoration: none;
  transition: background-color 0.2s, border-color 0.2s, color 0.2s, box-shadow 0.2s, opacity 0.2s;
}
.btn:hover {
  border-color: var(--muted-2);
}
.btn--primary {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
  border-radius: 999px;
  box-shadow: 0 10px 22px -14px rgba(17, 17, 17, 0.7);
}
.btn--primary:hover {
  background: #2a2a27;
  border-color: #2a2a27;
}
.btn--accent {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}
.btn--accent:hover {
  background: #2a2a27;
  border-color: #2a2a27;
}
.btn--ghost {
  border-color: transparent;
  background: transparent;
}
.btn--ghost:hover {
  background: var(--accent-wash);
  border-color: transparent;
}
.btn--danger {
  border-color: rgba(208, 59, 59, 0.4);
  color: var(--critical-text);
  background: transparent;
}
.btn--danger:hover {
  background: rgba(208, 59, 59, 0.08);
  border-color: var(--critical);
}
.btn--danger-solid {
  border-color: var(--critical);
  background: var(--critical);
  color: #fff;
}
.btn--sm {
  height: 32px;
  padding: 0 11px;
  font-size: 12.5px;
  border-radius: 8px;
}
.btn--icon {
  width: 34px;
  padding: 0;
}
.btn--lg {
  height: 46px;
  font-size: 15px;
}
.btn[disabled] {
  opacity: 0.5;
  pointer-events: none;
}
.btn.is-busy {
  opacity: 0.65;
  pointer-events: none;
}

.field {
  display: grid;
  gap: 6px;
}
.field > label,
.field__label {
  font-size: 12.5px;
  font-weight: 700;
}
.field__hint {
  font-size: 12px;
  color: var(--muted-2);
}
.input,
.select,
.textarea {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface-2);
  font-size: 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.textarea {
  height: auto;
  min-height: 110px;
  padding: 10px 12px;
  line-height: 1.6;
  resize: vertical;
}
.select {
  appearance: none;
  padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 6l4 4 4-4' fill='none' stroke='%235d5c57' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 16px;
}
.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255, 79, 31, 0.16);
}
.input[readonly],
.input:disabled,
.select:disabled,
.textarea:disabled,
.textarea[readonly] {
  background: transparent;
  color: var(--muted);
}
.input--color {
  width: 52px;
  padding: 4px;
  cursor: pointer;
}
.switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 650;
  cursor: pointer;
  user-select: none;
}
.switch input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.switch__track {
  position: relative;
  width: 38px;
  height: 22px;
  border-radius: 999px;
  background: var(--line-strong);
  transition: background-color 0.25s;
}
.switch__track::after {
  content: '';
  position: absolute;
  left: 3px;
  top: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s var(--ease);
}
.switch input:checked + .switch__track {
  background: var(--accent);
}
.switch input:checked + .switch__track::after {
  transform: translateX(16px);
}
.switch input:focus-visible + .switch__track {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.switch input:disabled + .switch__track {
  opacity: 0.5;
}
.form-grid {
  display: grid;
  gap: 16px;
}
@media (min-width: 720px) {
  .form-grid--2 {
    grid-template-columns: 1fr 1fr;
  }
  .form-grid--3 {
    grid-template-columns: repeat(3, 1fr);
  }
  .span-2 {
    grid-column: span 2;
  }
  .span-all {
    grid-column: 1 / -1;
  }
}
.form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}
.form-actions__note {
  margin-right: auto;
  font-size: 12.5px;
  color: var(--muted-2);
}
.error-box {
  padding: 10px 12px;
  border: 1px solid rgba(208, 59, 59, 0.3);
  border-radius: 10px;
  background: rgba(208, 59, 59, 0.06);
  color: var(--critical-text);
  font-weight: 600;
  font-size: 13px;
}

/* Cartes ------------------------------------------------------------------------------------ */

.grid {
  display: grid;
  gap: 16px;
}
@media (min-width: 760px) {
  .grid--2 {
    grid-template-columns: repeat(2, 1fr);
  }
  .grid--4 {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (min-width: 1080px) {
  .shell {
    background: linear-gradient(90deg, var(--side) 268px, transparent 268px);
  }
}
@media (min-width: 1240px) {
  .grid--4 {
    grid-template-columns: repeat(4, 1fr);
  }
  .grid--3 {
    grid-template-columns: repeat(3, 1fr);
  }
  .grid--main {
    grid-template-columns: 1.6fr 1fr;
    align-items: start;
  }
}
.stack {
  display: grid;
  gap: 16px;
}
.card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px 0;
}
.card__head h2,
.card__head h3 {
  font-size: 14.5px;
  font-weight: 750;
  letter-spacing: -0.005em;
}
.card__head p {
  font-size: 12.5px;
  color: var(--muted-2);
}
.card__body {
  padding: 16px 20px 20px;
}
.card__body--flush {
  padding: 8px 0 0;
}
.card__foot {
  flex-wrap: wrap;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 20px;
  border-top: 1px solid var(--line);
}

/* Tuiles de chiffres */
.stat {
  padding: 18px 20px 16px;
}
.stat__label {
  font-size: 12.5px;
  font-weight: 650;
  color: var(--muted);
}
.stat__row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
}
.stat__value {
  font-size: 30px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
}
.stat__delta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 10px;
  font-size: 12px;
  font-weight: 650;
  color: var(--muted-2);
}
.stat__delta.is-up {
  color: var(--good-text);
}
.stat__delta.is-down {
  color: var(--critical-text);
}
.stat__spark {
  width: 104px;
  height: 34px;
  flex: none;
}

/* Puces d'état */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 9px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface-2);
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
}
.chip .i {
  width: 13px;
  height: 13px;
}
.chip__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--c, var(--muted-2));
}
.chip--good {
  border-color: rgba(12, 163, 12, 0.35);
  background: rgba(12, 163, 12, 0.07);
  color: var(--good-text);
}
.chip--warning {
  border-color: rgba(250, 178, 25, 0.55);
  background: rgba(250, 178, 25, 0.1);
  color: var(--warning-text);
}
.chip--critical {
  border-color: rgba(208, 59, 59, 0.4);
  background: rgba(208, 59, 59, 0.07);
  color: var(--critical-text);
}
.chip--accent {
  border-color: rgba(255, 79, 31, 0.4);
  background: var(--accent-wash);
  color: var(--accent-hover);
}
.chip--plain {
  color: var(--muted);
}

/* Cartes de jeux */
.game-card {
  position: relative;
  overflow: hidden;
}
.game-card::before {
  content: '';
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: var(--accent);
}
.game-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 20px 0;
}
.game-card__genre {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--muted-2);
}
.game-card__name {
  margin-top: 4px;
  font-family: var(--serif);
  letter-spacing: -0.035em;
  font-size: 1.9rem;
  font-weight: 800;
  line-height: 1.05;
}
.game-card__chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}
.facts {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  margin: 18px 20px 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: var(--line);
}
@media (min-width: 600px) {
  .facts--4 {
    grid-template-columns: repeat(4, 1fr);
  }
  .facts--3 {
    grid-template-columns: repeat(3, 1fr);
  }
}
.facts > div {
  padding: 12px 14px;
  background: var(--surface-2);
}
.facts dt {
  font-size: 11.5px;
  font-weight: 650;
  color: var(--muted-2);
}
.facts dd {
  margin-top: 4px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.facts dd small {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted-2);
}
.game-card__line {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 20px 0;
  font-size: 13px;
  color: var(--muted);
}
.game-card__line strong {
  color: var(--ink);
}

/* Listes */
.list > li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 20px;
  border-top: 1px solid var(--line);
}
.list > li:first-child {
  border-top: 0;
}
.list__main {
  min-width: 0;
  flex: 1;
}
.list__title {
  font-weight: 700;
}
.list__sub {
  margin-top: 2px;
  font-size: 12.5px;
  color: var(--muted-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.list__time {
  flex: none;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted-2);
}
.list a.list__link {
  display: flex;
  gap: 12px;
  width: 100%;
  text-decoration: none;
}
.empty {
  display: grid;
  place-items: center;
  gap: 6px;
  padding: 36px 20px;
  text-align: center;
  color: var(--muted-2);
}
.empty strong {
  color: var(--ink);
  font-size: 14.5px;
}
.empty .i {
  width: 26px;
  height: 26px;
  color: var(--accent);
  margin-bottom: 4px;
}

/* Tableaux */
.table-wrap {
  overflow-x: auto;
}
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
.table th {
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-align: left;
  color: var(--muted-2);
  white-space: nowrap;
}
.table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.table tr:last-child td {
  border-bottom: 0;
}
.table tbody tr:hover td {
  background: rgba(255, 79, 31, 0.04);
}
.table .actions {
  width: 1%;
  white-space: nowrap;
  text-align: right;
}
.table .actions .btn + .btn {
  margin-left: 4px;
}

/* Onglets */
.tabs {
  display: flex;
  gap: 2px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
}
.tabs a {
  position: relative;
  padding: 10px 14px 12px;
  font-weight: 650;
  color: var(--muted-2);
  text-decoration: none;
  white-space: nowrap;
}
.tabs a:hover {
  color: var(--ink);
}
.tabs a.is-active {
  color: var(--ink);
}
.tabs a.is-active::after {
  content: '';
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: -1px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
}
.seg {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}
.seg button {
  height: 30px;
  padding: 0 12px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--muted-2);
}
.seg button[aria-pressed='true'] {
  background: var(--side);
  color: #fff;
}
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}
.toolbar .input {
  max-width: 280px;
}

/* Graphiques */
.chart {
  position: relative;
}
.chart svg:not(.i) {
  width: 100%;
  height: auto;
  overflow: visible;
}
.chart .grid-line {
  stroke: var(--grid);
  stroke-width: 1;
}
.chart .axis-text {
  font-family: var(--sans);
  font-size: 11px;
  fill: var(--muted-2);
}
.chart .crosshair {
  stroke: var(--muted-2);
  stroke-width: 1;
}
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 12.5px;
  font-weight: 650;
  color: var(--muted);
}
.legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.legend i {
  width: 14px;
  height: 2px;
  border-radius: 2px;
  background: var(--c);
}
.legend i.is-box {
  height: 10px;
  width: 10px;
  border-radius: 3px;
}
.tip {
  position: absolute;
  z-index: 5;
  min-width: 150px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface-2);
  box-shadow: 0 16px 36px -18px rgba(17, 17, 17, 0.45);
  pointer-events: none;
  font-size: 12.5px;
  opacity: 0;
  transition: opacity 0.12s;
}
.tip.is-on {
  opacity: 1;
}
.tip__date {
  margin-bottom: 6px;
  font-weight: 650;
  color: var(--muted-2);
}
.tip__row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.tip__row + .tip__row {
  margin-top: 3px;
}
.tip__row i {
  width: 12px;
  height: 2px;
  border-radius: 2px;
  background: var(--c);
}
.tip__row strong {
  font-variant-numeric: tabular-nums;
}
.tip__row span {
  color: var(--muted-2);
}
.bars-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 12px;
  padding: 8px 20px;
}
.bars-list .bar-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}
.bars-list .bar-value {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}
.bars-list .bar-track {
  grid-column: 1 / -1;
  height: 6px;
  border-radius: 4px;
  background: var(--grid);
  overflow: hidden;
}
.bars-list .bar-fill {
  height: 100%;
  border-radius: 4px;
  background: var(--s1);
}
.uptime {
  display: grid;
  grid-template-columns: repeat(24, 1fr);
  gap: 2px;
  height: 34px;
}
.uptime span {
  border-radius: 3px;
  background: var(--grid);
}
.uptime span.is-good {
  background: var(--good);
}
.uptime span.is-warning {
  background: var(--warning);
}
.uptime span.is-critical {
  background: var(--critical);
}
.uptime__axis {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  font-size: 11px;
  color: var(--muted-2);
}
.health {
  display: flex;
  align-items: center;
  gap: 14px;
}
.health__icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 12px;
}
.health__icon .i {
  width: 22px;
  height: 22px;
}
.health__icon.is-good {
  background: rgba(12, 163, 12, 0.1);
  color: var(--good-text);
}
.health__icon.is-critical {
  background: rgba(208, 59, 59, 0.1);
  color: var(--critical-text);
}
.health__icon.is-idle {
  background: var(--accent-wash);
  color: var(--accent);
}
.health strong {
  display: block;
  font-size: 16px;
}
.health span {
  font-size: 12.5px;
  color: var(--muted-2);
}

/* Éditeurs de listes (chiffres clés, points forts) */
.rows {
  display: grid;
  gap: 8px;
}
.row-edit {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
}
.row-edit--pair {
  grid-template-columns: 120px 1fr auto;
}
@media (max-width: 560px) {
  .row-edit--pair {
    grid-template-columns: 90px 1fr auto;
  }
}

/* Messagerie */
.inbox {
  display: grid;
  gap: 16px;
}
@media (min-width: 1100px) {
  .inbox {
    grid-template-columns: minmax(320px, 0.85fr) 1.15fr;
    align-items: start;
  }
  .inbox__detail {
    position: sticky;
    top: 84px;
  }
}
.msg-item {
  display: block;
  width: 100%;
  padding: 14px 18px;
  border: 0;
  border-top: 1px solid var(--line);
  background: transparent;
  text-align: left;
}
.msg-item:first-child {
  border-top: 0;
}
.msg-item:hover {
  background: rgba(255, 79, 31, 0.05);
}
.msg-item.is-active {
  background: var(--accent-wash);
  box-shadow: inset 3px 0 0 var(--accent);
}
.msg-item__top {
  display: flex;
  align-items: center;
  gap: 8px;
}
.msg-item__name {
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.msg-item.is-new .msg-item__name::before {
  content: '';
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 7px;
  border-radius: 50%;
  background: var(--accent-light);
  vertical-align: 1px;
}
.msg-item__time {
  margin-left: auto;
  flex: none;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted-2);
}
.msg-item__meta {
  margin-top: 4px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.msg-item__preview {
  margin-top: 6px;
  font-size: 13px;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.msg-body {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 14.5px;
  line-height: 1.7;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
}
.kv {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 8px 16px;
  font-size: 13.5px;
}
.kv dt {
  color: var(--muted-2);
  font-weight: 650;
}
.kv dd {
  min-width: 0;
  overflow-wrap: anywhere;
}

/* Feuille de route */
.milestone {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 14px 20px;
  border-top: 1px solid var(--line);
}
.milestone:first-child {
  border-top: 0;
}
.milestone__node {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--line-strong);
}
.milestone__node.is-done {
  border-color: var(--accent);
  background: var(--accent);
}
.milestone__node.is-doing {
  border-color: var(--warning);
  background: var(--warning);
}
.milestone strong {
  display: block;
  font-size: 14.5px;
}
.milestone p {
  font-size: 13px;
  color: var(--muted-2);
}
.milestone__actions {
  display: flex;
  gap: 4px;
}

/* Fenêtres modales ---------------------------------------------------------------------------- */

.modal {
  width: min(640px, calc(100vw - 24px));
  max-height: calc(100vh - 40px);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 40px 100px -30px rgba(17, 17, 17, 0.5);
}
.modal--wide {
  width: min(860px, calc(100vw - 24px));
}
.modal--small {
  width: min(440px, calc(100vw - 24px));
}
.modal::backdrop {
  background: rgba(17, 17, 17, 0.45);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}
.modal[open] {
  animation: modalIn 0.35s var(--ease);
}
@keyframes modalIn {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.985);
  }
}
.modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
}
.modal__head h2 {
  font-family: var(--serif);
  letter-spacing: -0.035em;
  font-size: 1.6rem;
  font-weight: 800;
  line-height: 1.1;
}
.modal__body {
  padding: 20px 22px;
  overflow-y: auto;
  max-height: calc(100vh - 200px);
}
.modal__foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 22px;
  border-top: 1px solid var(--line);
}
.secret {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  padding: 14px 16px;
  border: 1px dashed var(--accent);
  border-radius: 12px;
  background: var(--accent-wash);
  font-family: var(--mono);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.04em;
}
.secret code {
  flex: 1;
  overflow-wrap: anywhere;
}

/* Notifications */
.toasts {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 100;
  display: grid;
  gap: 8px;
  width: min(380px, calc(100vw - 32px));
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--side);
  color: #fff;
  font-weight: 600;
  font-size: 13.5px;
  box-shadow: 0 20px 40px -20px rgba(17, 17, 17, 0.6);
  animation: toastIn 0.4s var(--ease);
}
.toast .i {
  margin-top: 2px;
  color: var(--accent-light);
}
.toast.is-error {
  background: #3a1513;
}
.toast.is-error .i {
  color: #ff9a8f;
}
.toast.is-leaving {
  opacity: 0;
  transform: translateY(8px);
  transition: all 0.3s var(--ease);
}
@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
}

.view-enter {
  animation: viewIn 0.45s var(--ease);
}
@keyframes viewIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}
.loading {
  opacity: 0.55;
  transition: opacity 0.2s;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

/* Rythme vertical des pages */
#view > div > * + * {
  margin-top: 16px;
}
#view > div > .page-head + *,
#view > div > .tabs + * {
  margin-top: 0;
}
.stack > * + * {
  margin-top: 0;
}
