/* Direction artistique du launcher New Horizon (crates/nh-launcher : theme.rs, components, screens).
   Polices Outfit et Inter sous licence SIL OFL (fonts/OFL-*.txt), icônes Lucide (icons/LICENSE-LUCIDE.txt). */
@font-face { font-family: Outfit; font-weight: 400; src: url("/static/fonts/Outfit-Regular.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: Outfit; font-weight: 500; src: url("/static/fonts/Outfit-Medium.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: Outfit; font-weight: 600; src: url("/static/fonts/Outfit-SemiBold.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: Inter; font-weight: 600; src: url("/static/fonts/Inter-SemiBold.ttf") format("truetype"); font-display: swap; }

:root {
  color-scheme: dark;
  --bg: #0e0f11;
  --bg-2: #0f1116;
  --surface: #14161b; /* teinte moyenne d'un panneau, pour les anneaux des points des graphiques */
  --primary: #008cff;
  --red: #e70732;
  --green: #00f895;
  --amber: #ffb020;
  --baby-blue: #ecf5ff;
  --nav: rgba(232, 232, 232, 0.87);
  --muted: rgba(255, 255, 255, 0.5);
  --faint: rgba(255, 255, 255, 0.45);
  /* Séries des graphiques : palette catégorielle validée sur fond sombre, ordre fixe. */
  --s1: #3987e5;
  --s2: #d95926;
  --s3: #199e70;
  --s4: #c98500;
  --s5: #d55181;
  font: 400 12px/1.5 Outfit, system-ui, "Segoe UI", sans-serif;
  font-kerning: normal;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; color: #fff; background: var(--bg) url("/static/fond.jpg") center / cover fixed no-repeat; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: #1f9aff; }
h1, h2, p { margin: 0; }
code { font-family: ui-monospace, Consolas, monospace; font-size: 12px; color: rgba(255, 255, 255, 0.9); }
small, .hint, .desc, .muted { color: var(--muted); }
.hint { font-size: 11px; color: var(--faint); margin-top: 10px; }
.empty { color: var(--muted); }

/* ------------------------------------------------------------ barre latérale */
.sidebar { position: fixed; inset: 0 auto 0 0; width: 228px; display: flex; flex-direction: column; padding: 25px 0 22px; z-index: 1; }
.profile { display: flex; gap: 13px; padding-left: 25px; }
.avatar { width: 52px; height: 52px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--bg-2);
  border: 1px solid rgba(255, 255, 255, 0.06); font: 600 22px/1 Outfit; color: var(--baby-blue); }
.who { display: flex; flex-direction: column; padding-top: 5px; min-width: 0; }
.who strong { font-weight: 500; font-size: 14px; line-height: 17.64px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.role { font-size: 13px; line-height: 16.38px; color: var(--red); }
.role.douanier { color: #35d6ff; }
.presence { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; font: 500 12px/15.12px Outfit; margin-top: 2px; }
.presence::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.presence.on { color: var(--green); }
.presence.off { color: var(--muted); }
.presence:hover { filter: brightness(1.25); }
.presence:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

.menu { position: relative; margin-top: 52px; display: flex; flex-direction: column; gap: 6px; }
.menu::before { content: ""; position: absolute; left: 29px; top: 0; bottom: 0; width: 46px; border-radius: 23px; background: var(--bg-2); }
.item { position: relative; display: flex; align-items: center; height: 46px; padding-left: 29px; color: var(--nav); font: 500 13px/18px Outfit; }
.item:hover { color: #e8e8e8; }
.item .icon { width: 46px; height: 46px; flex: none; display: grid; place-items: center; }
.item .icon::after { content: ""; width: 20px; height: 20px; background: var(--baby-blue); mask: var(--icon) center / contain no-repeat; }
.item[aria-current] .icon { background: url("/static/nav-active.png") center / 56px 56px no-repeat; }
.item[aria-current] .label { color: #e8e8e8; font-weight: 600; }
.item .label { margin-left: 8px; }
.i-dashboard { --icon: url("/static/icons/dashboard.svg"); }
.i-douaniers { --icon: url("/static/icons/douaniers.svg"); }
.i-file { --icon: url("/static/icons/file.svg"); }
.i-candidatures { --icon: url("/static/icons/candidatures.svg"); }
.i-comptes { --icon: url("/static/icons/comptes.svg"); }
.i-categories { --icon: url("/static/icons/categories.svg"); }
.i-journal { --icon: url("/static/icons/journal.svg"); }
.i-mes-candidatures { --icon: url("/static/icons/mes-candidatures.svg"); }
.foot { margin-top: auto; padding-left: 29px; display: flex; gap: 14px; align-items: center; font: 500 11px Outfit; }
.foot a, .foot .link { color: rgba(255, 255, 255, 0.45); }
.foot a:hover, .foot .link:hover { color: rgba(255, 255, 255, 0.75); }

/* ------------------------------------------------------------ contenu */
.content { margin-left: 240px; padding: 56px 24px 48px 0; max-width: 1340px; }
.page-head { margin-bottom: 18px; }
h1 { font: 600 20px/26px Outfit; }
.subtitle { margin-top: 4px; font-size: 12px; line-height: 15.12px; color: var(--muted); }

.panel { border-radius: 5px; border: 0.5px solid rgba(221, 221, 221, 0.04); padding: 22px; margin-bottom: 12px;
  background: linear-gradient(137.773deg, rgba(15, 17, 22, 0.93) 45.405%, rgba(38, 40, 44, 0.772) 100%); }
.panel h2 { font: 600 14px/1.3 Outfit; margin-bottom: 4px; }
.panel .desc { font-size: 12px; line-height: 18px; margin-bottom: 14px; }
.panel.narrow { max-width: 480px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 12px; }
.columns { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 12px; align-items: start; }
.text { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; line-height: 20px; color: rgba(255, 255, 255, 0.85); margin-top: 10px; }
.summary h2 { font-size: 16px; margin-bottom: 8px; }
.summary dl { display: grid; gap: 2px; margin: 14px 0 0; }
.summary dt { font-size: 12px; color: var(--faint); margin-top: 8px; }
.summary dd { margin: 0; font: 500 13px Outfit; color: rgba(255, 255, 255, 0.9); }

/* Indicateurs */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
.kpis .panel { margin: 0; }
.kpi { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 18px 22px; }
.kpi-label { font-size: 12px; color: var(--muted); }
.kpi strong { font: 600 28px/34px Outfit; }
.kpi strong.small { font-size: 16px; line-height: 22px; }
.kpi-hint { font-size: 11px; color: var(--faint); }
.delta { font: 500 11px Outfit; }
.delta.good { color: var(--green); }
.delta.bad { color: #ff5c7a; }
.delta.flat, .delta.none { color: var(--faint); }

/* ------------------------------------------------------------ boutons et champs */
button, .button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px; padding: 0 16px;
  border-radius: 5px; font: 600 10px/12.1px Inter, Outfit, sans-serif; color: #fff; cursor: pointer; white-space: nowrap;
  background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(255, 255, 255, 0.1); }
button:hover, .button:hover { color: #fff; background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.18); }
button:active, .button:active { background: rgba(255, 255, 255, 0.12); }
.primary { background: var(--primary); border-color: var(--primary); }
.primary:hover { background: #1f9aff; border-color: #1f9aff; }
.primary:active { background: #007be0; }
.danger { background: var(--red); border-color: var(--red); }
.danger:hover { background: #ea254b; border-color: #ea254b; }
button.link { all: unset; cursor: pointer; }
button.wide { width: 100%; height: 38px; }
button:focus-visible, .button:focus-visible, a:focus-visible, summary:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

label { display: flex; flex-direction: column; gap: 6px; font: 500 11px Outfit; color: rgba(255, 255, 255, 0.6); }
input, select { height: 34px; padding: 0 10px; min-width: 0; font: 400 13px Outfit; color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(255, 255, 255, 0.08); border-radius: 5px; }
textarea { min-height: 84px; padding: 8px 10px; resize: vertical; font: 400 13px/1.5 Outfit; color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(255, 255, 255, 0.08); border-radius: 5px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: rgba(0, 140, 255, 0.6); }
input::placeholder { color: #a3a3a3; }
input[type="date"]::-webkit-calendar-picker-indicator { filter: invert(0.8); }
select option { background: var(--bg-2); }
.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.filters .hint { flex-basis: 100%; margin: 0; }
.filters .grow, form.inline .grow { flex: 1 1 260px; }
.actions { display: flex; gap: 8px; align-items: center; }
form.inline { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; }
.stack { display: flex; flex-direction: column; gap: 14px; text-align: left; }
.stack label { font-size: 12px; color: rgba(255, 255, 255, 0.7); }

/* ------------------------------------------------------------ étiquettes et messages */
.badge { display: inline-flex; align-items: center; height: 16px; padding: 0 7px; border-radius: 25px; white-space: nowrap;
  font: 600 10px/1 Outfit; color: #fff; border: 0.5px solid; }
.badge.pending { background: rgba(0, 140, 255, 0.5); border-color: rgba(0, 140, 255, 0.55); }
.badge.incomplete, .badge.away { background: rgba(255, 176, 32, 0.22); border-color: rgba(255, 176, 32, 0.8); }
.badge.appointment, .badge.oral_passed, .badge.active { background: rgba(0, 248, 149, 0.22); border-color: var(--green); }
.badge.refused, .badge.oral_refused { background: rgba(231, 7, 50, 0.55); border-color: rgba(231, 7, 50, 0.65); }
.badge.expired, .badge.muted { font-weight: 500; color: rgba(255, 255, 255, 0.6); background: rgba(255, 255, 255, 0.03); border-color: rgba(255, 255, 255, 0.12); }

.notice, .error { padding: 10px 14px; border-radius: 5px; margin-bottom: 12px; font-size: 12px; line-height: 18px; color: rgba(255, 255, 255, 0.85); }
.notice { border: 1px solid rgba(0, 140, 255, 0.35); background: rgba(0, 140, 255, 0.1); }
.error { border: 1px solid rgba(231, 7, 50, 0.35); background: rgba(231, 7, 50, 0.1); }
.secret code { display: block; margin: 12px 0; font-size: 22px; letter-spacing: 0.06em; color: #fff; user-select: all; }

.toast { position: fixed; right: 28px; bottom: 28px; height: 40px; display: flex; align-items: center; padding: 0 16px 0 15px;
  border-left: 3px solid var(--primary); border-radius: 5px; font: 500 12px Outfit; z-index: 2;
  background: linear-gradient(137.773deg, rgba(15, 17, 22, 0.96) 45.405%, rgba(38, 40, 44, 0.9) 100%); }
.toast.success { border-left-color: var(--green); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.chips a { height: 20px; display: inline-flex; align-items: center; padding: 0 9px; border-radius: 25px; font: 500 11px Outfit;
  color: rgba(255, 255, 255, 0.7); background: rgba(255, 255, 255, 0.03); border: 0.5px solid rgba(255, 255, 255, 0.12); }
.chips a[aria-current] { color: #fff; background: rgba(0, 140, 255, 0.5); border-color: rgba(0, 140, 255, 0.55); }

/* Réponses : boutons dépliants, bandeau du launcher */
.responses { display: flex; flex-direction: column; gap: 8px; }
details.action > summary { list-style: none; width: 100%; }
details.action > summary::-webkit-details-marker { display: none; }
details.action[open] { padding: 12px; border-radius: 5px; background: rgba(7, 8, 10, 0.5); border: 1px solid rgba(255, 255, 255, 0.06); }
details.action[open] > summary { margin-bottom: 12px; }
.launcher-notice { --tone: var(--primary); padding: 10px 14px; border-radius: 5px; margin: 6px 0 14px;
  border: 1px solid color-mix(in srgb, var(--tone) 35%, transparent); background: color-mix(in srgb, var(--tone) 10%, transparent); }
.launcher-notice.green { --tone: var(--green); }
.launcher-notice.red { --tone: var(--red); }
.launcher-notice strong { display: block; font: 600 13px Outfit; color: var(--tone); margin-bottom: 4px; }
.launcher-notice p { font-size: 12px; line-height: 18px; color: rgba(255, 255, 255, 0.85); white-space: pre-line; }

/* ------------------------------------------------------------ tableaux */
.table { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th { text-align: left; font: 500 11px Outfit; color: var(--faint); padding: 0 10px 10px; white-space: nowrap; }
td { padding: 9px 10px; color: rgba(255, 255, 255, 0.85); border-top: 1px solid rgba(255, 255, 255, 0.05); vertical-align: middle; }
tbody tr:hover td { background: rgba(255, 255, 255, 0.02); }
tr.dim td { color: var(--faint); }
td.num { font-variant-numeric: tabular-nums; }
td.actions { flex-wrap: wrap; }
.pager { display: flex; gap: 12px; align-items: center; margin-top: 14px; color: var(--muted); }
details.confirm summary { cursor: pointer; color: var(--primary); list-style: none; font-weight: 500; }
details.confirm summary::-webkit-details-marker { display: none; }
details.confirm[open] { padding: 10px; border-radius: 5px; background: rgba(7, 8, 10, 0.72); border: 1px solid rgba(255, 255, 255, 0.08); max-width: 300px; }
details.confirm p { margin: 6px 0 10px; color: rgba(255, 255, 255, 0.6); }

.timeline { list-style: none; padding: 0; margin: 12px 0 0; display: flex; flex-direction: column; gap: 10px; }
.timeline li { position: relative; padding-left: 14px; color: rgba(255, 255, 255, 0.7); line-height: 18px; }
.timeline li::before { content: ""; position: absolute; left: 0; top: 7px; width: 4px; height: 4px; border-radius: 50%; background: var(--primary); }
.timeline time { color: var(--faint); margin-right: 6px; font-variant-numeric: tabular-nums; }
.timeline p { margin-top: 4px; }

/* ------------------------------------------------------------ graphiques */
.chart { display: block; width: 100%; height: auto; overflow: visible; font-family: Outfit, sans-serif; }
.chart .grid { stroke: rgba(255, 255, 255, 0.06); stroke-width: 1; }
.chart .baseline { stroke: rgba(255, 255, 255, 0.2); stroke-width: 1; }
.chart .tick { fill: var(--faint); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart .label { fill: rgba(255, 255, 255, 0.85); font-size: 12px; }
.chart .value { fill: #fff; font-size: 12px; font-weight: 500; }
.chart .note { fill: var(--faint); font-weight: 400; }
.s1 { fill: var(--s1); }
.s2 { fill: var(--s2); }
.s3 { fill: var(--s3); }
.s4 { fill: var(--s4); }
.s5 { fill: var(--s5); }
.chart .line { fill: none; stroke: var(--s1); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .dot, .spark .dot { stroke: var(--surface); stroke-width: 2; }
.chart .hit { fill: transparent; }
.chart path:hover, .chart rect:hover { filter: brightness(1.25); }
.q0 { fill: rgba(255, 255, 255, 0.04); }
.q1 { fill: #184f95; }
.q2 { fill: #1c5cab; }
.q3 { fill: #2a78d6; }
.q4 { fill: #5598e7; }
.q5 { fill: #9ec5f4; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; list-style: none; padding: 0; margin: 0 0 12px; color: rgba(255, 255, 255, 0.7); }
.legend li { display: flex; align-items: center; gap: 6px; }
.key { display: inline-block; width: 10px; height: 10px; border-radius: 2px; }
.key.s1 { background: var(--s1); }
.key.s2 { background: var(--s2); }
.key.s3 { background: var(--s3); }
.key.s4 { background: var(--s4); }
.key.s5 { background: var(--s5); }
.key.q1 { background: #184f95; }
.key.q2 { background: #1c5cab; }
.key.q3 { background: #2a78d6; }
.key.q4 { background: #5598e7; }
.key.q5 { background: #9ec5f4; }
.scale { display: flex; align-items: center; gap: 4px; margin-top: 8px; font-size: 11px; color: var(--faint); }
.spark { width: 96px; height: 24px; display: block; }
.spark .trend { fill: none; stroke: rgba(255, 255, 255, 0.35); stroke-width: 1.5; stroke-linejoin: round; }
details.data { margin-top: 10px; }
details.data summary { cursor: pointer; font: 500 11px Outfit; color: var(--primary); }
details.data table { margin-top: 8px; }

/* ------------------------------------------------------------ connexion (page centrée) */
body.center { display: grid; place-items: center; padding: 24px 16px; }
.card { width: 420px; max-width: 100%; padding: 36px 40px; text-align: center; border-radius: 5px; border: 0.5px solid rgba(221, 221, 221, 0.04);
  background: linear-gradient(137.773deg, rgba(15, 17, 22, 0.93) 45.405%, rgba(38, 40, 44, 0.772) 100%); }
.card .logo { display: block; width: 220px; height: auto; margin: 0 auto 26px; }
.card h1 { margin-bottom: 8px; }
.card .subtitle { margin: 0 0 24px; }
.card .panel { padding: 0; border: 0; background: none; text-align: left; }
.card .foot { justify-content: center; padding: 18px 0 0; margin: 0; }

@media (max-width: 1100px) {
  .grid-2, .columns { grid-template-columns: minmax(0, 1fr); }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .sidebar { position: static; width: auto; padding: 16px; }
  .profile { padding: 0; }
  .menu { margin-top: 16px; flex-direction: row; flex-wrap: wrap; gap: 4px; }
  .menu::before { display: none; }
  .item { padding-left: 0; height: 38px; }
  .item .icon { width: 38px; height: 38px; }
  .foot { padding: 12px 0 0; }
  .content { margin: 0; padding: 0 16px 32px; }
}
