/* Design system de Rocket List (thème « Airmail ») : mêmes couleurs, polices et composants
   (shadcn base-nova), transposés en CSS sans framework pour des pages rendues côté serveur. */

@font-face { font-family: "IBM Plex Sans"; font-weight: 400; font-display: swap; src: url(/assets/ibm-plex-sans-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 500; font-display: swap; src: url(/assets/ibm-plex-sans-latin-500-normal.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 600; font-display: swap; src: url(/assets/ibm-plex-sans-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Sans Condensed"; font-weight: 600; font-display: swap; src: url(/assets/ibm-plex-sans-condensed-latin-600-normal.woff2) format("woff2"); }

:root {
  --ink: #1f2a44;
  --paper: #f5f6f8;
  --airmail-blue: #2445b5;
  --airmail-red: #c8343b;
  --ok: #1e7f56;
  --warn: #a8701a;
  --stop: var(--airmail-red);

  --background: var(--paper);
  --foreground: var(--ink);
  --card: #ffffff;
  --primary: var(--airmail-blue);
  --primary-foreground: #ffffff;
  --muted: #eceef2;
  --muted-foreground: #5b6478;
  --accent: #e8edfb;
  --accent-foreground: #1b3590;
  --destructive: var(--airmail-red);
  --border: #dde1e8;
  --input: #cfd5de;
  --ring: #2445b5;
  --radius: 0.5rem;

  --font-sans: "IBM Plex Sans", system-ui, sans-serif;
  --font-heading: "IBM Plex Sans Condensed", "IBM Plex Sans", sans-serif;
  --focus: 0 0 0 3px color-mix(in srgb, var(--ring) 50%, transparent);
  --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { font-family: var(--font-sans); font-variant-numeric: tabular-nums; }
body { margin: 0; background: var(--background); color: var(--foreground); font-size: 0.875rem; line-height: 1.5; -webkit-font-smoothing: antialiased; }
h1, h2, h3 { margin: 0; font-family: var(--font-heading); font-weight: 600; letter-spacing: -0.01em; }
p { margin: 0; }
a { color: var(--primary); text-underline-offset: 4px; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.85em; word-break: break-all; }
.muted { color: var(--muted-foreground); }
.small { font-size: 0.75rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.stack { display: grid; gap: 1rem; }
.field { display: grid; gap: 0.5rem; }
.row { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }

/* Logo : le timbre « par avion » de Rocket List. */
.logo { display: flex; align-items: center; gap: 0.625rem; color: var(--foreground); text-decoration: none; }
.logo-mark { border-radius: 0.375rem; padding: 3px; background: repeating-linear-gradient(-45deg, var(--airmail-red) 0 12px, #fff 12px 18px, var(--airmail-blue) 18px 30px, #fff 30px 36px); }
.logo-mark span { display: grid; place-items: center; width: 1.5rem; height: 1.5rem; border-radius: 4px; background: var(--card); font-family: var(--font-heading); font-size: 0.875rem; font-weight: 600; color: var(--primary); }
.logo-name { font-family: var(--font-heading); font-size: 17px; font-weight: 600; letter-spacing: -0.025em; }

/* Coquille : barre latérale + contenu. */
.shell { display: flex; min-height: 100svh; }
.sidebar { position: sticky; top: 0; display: flex; flex-direction: column; width: 15rem; height: 100svh; flex-shrink: 0; overflow-y: auto; padding: 0.75rem; background: var(--card); border-right: 1px solid var(--border); }
.sidebar > .logo { margin-bottom: 1rem; padding: 0.25rem 0.5rem 0; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 0.625rem; height: 2rem; padding: 0 0.625rem; border-radius: 0.375rem; color: color-mix(in srgb, var(--foreground) 85%, transparent); text-decoration: none; transition: background-color 0.15s, color 0.15s; }
.nav a:hover { background: var(--muted); color: var(--foreground); }
.nav a:focus-visible { outline: none; box-shadow: var(--focus); }
.nav a svg { width: 1rem; height: 1rem; flex-shrink: 0; color: var(--muted-foreground); }
.nav a[aria-current="page"] { background: var(--accent); color: var(--accent-foreground); font-weight: 500; }
.nav a[aria-current="page"] svg { color: var(--primary); }
.account { margin-top: auto; padding-top: 1rem; }
.account hr { margin: 0 0 0.5rem; border: 0; border-top: 1px solid var(--border); }
.nav + .nav-title, .switcher + .nav { margin-top: 0; }
.nav-title { padding: 1rem 0.625rem 0.375rem; font-family: var(--font-heading); font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted-foreground); }

/* Sélecteur d'organisation et menu du compte : boutons qui ouvrent un menu (popover). */
.switcher, .me { display: flex; align-items: center; gap: 0.625rem; width: 100%; padding: 0.375rem; color: inherit; font: inherit; text-align: left; cursor: pointer; border-radius: var(--radius); outline: none; }
.switcher { anchor-name: --org-switcher; margin-bottom: 0.75rem; background: var(--card); border: 1px solid var(--border); box-shadow: var(--shadow-sm); }
.me { anchor-name: --me; background: none; border: 0; }
.switcher:hover, .me:hover, .me[aria-current="page"] { background: var(--muted); }
.switcher:focus-visible, .me:focus-visible { box-shadow: var(--focus); }
.switcher > span:not(.avatar), .me > span:not(.avatar) { min-width: 0; flex: 1; }
.switcher b, .switcher small, .me b, .me small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.switcher b, .me b { font-weight: 500; }
.switcher small { font-size: 11px; line-height: 1.2; color: var(--muted-foreground); }
.me small { font-size: 0.75rem; color: var(--muted-foreground); }
.switcher > svg, .me > svg { width: 0.875rem; height: 0.875rem; flex-shrink: 0; color: var(--muted-foreground); }

.menu { position: fixed; inset: auto; top: 7.5rem; left: 0.75rem; width: 14rem; max-height: 60vh; margin: 0; padding: 0.25rem; overflow-y: auto; color: var(--foreground); background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1); }
.menu-up { top: auto; bottom: 4.25rem; }
@supports (anchor-name: --a) {
  .menu { position-anchor: --org-switcher; top: anchor(bottom); left: anchor(left); width: anchor-size(width); margin-top: 0.25rem; }
  .menu-up { position-anchor: --me; top: auto; bottom: anchor(top); margin: 0 0 0.25rem; }
}
.menu-label { padding: 0.375rem 0.5rem; font-size: 0.75rem; font-weight: 500; color: var(--muted-foreground); }
.menu-item { display: flex; align-items: center; gap: 0.5rem; min-height: 2rem; padding: 0.25rem 0.5rem; color: var(--foreground); text-decoration: none; border-radius: 0.375rem; outline: none; }
.menu-item:hover, .menu-item:focus-visible { background: var(--accent); color: var(--accent-foreground); }
.menu-item > span:not(.avatar) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-item > svg { width: 1rem; height: 1rem; flex-shrink: 0; color: var(--muted-foreground); }
.menu-item[aria-current] { font-weight: 500; }
.menu-item[aria-current] > svg { color: var(--primary); }
.menu hr { margin: 0.25rem -0.25rem; border: 0; border-top: 1px solid var(--border); }
.content { flex: 1; min-width: 0; }
@media (max-width: 767px) {
  .shell { flex-direction: column; }
  .sidebar { position: static; width: auto; height: auto; border-right: 0; border-bottom: 1px solid var(--border); }
  .sidebar .nav { flex-direction: row; flex-wrap: wrap; }
  .account { margin-top: 0.5rem; padding-top: 0; }
  .account hr { display: none; }
}

/* Page : titre, description, actions. */
.page { max-width: 1280px; margin: 0 auto; padding: 1.5rem 1rem; }
@media (min-width: 768px) { .page { padding: 1.5rem 2rem; } }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; }
.page-head h1 { font-size: 1.5rem; line-height: 2rem; }
.desc { margin-top: 0.25rem; max-width: 42rem; color: var(--muted-foreground); }
.section { margin-top: 2.5rem; }
.section > h2 { margin-bottom: 0.75rem; font-size: 1.125rem; line-height: 1.75rem; }

.card { padding: 1.5rem; background: var(--card); border: 1px solid var(--border); border-radius: calc(var(--radius) * 1.4); box-shadow: var(--shadow-sm); }
.empty { padding: 3.5rem 1.5rem; text-align: center; background: var(--card); border: 1px dashed var(--border); border-radius: var(--radius); }
.empty h2 { font-size: 1.125rem; }
.empty p { max-width: 28rem; margin: 0.25rem auto 0; color: var(--muted-foreground); }

/* Formulaires. */
label { display: flex; align-items: center; gap: 0.5rem; font-size: 0.875rem; line-height: 1; font-weight: 500; }
.input { width: 100%; min-width: 0; height: 2rem; padding: 0.25rem 0.625rem; background: transparent; color: inherit; font: inherit; font-size: 1rem; border: 1px solid var(--input); border-radius: var(--radius); outline: none; transition: border-color 0.15s, box-shadow 0.15s; }
textarea.input { height: auto; min-height: 4rem; padding: 0.5rem 0.625rem; resize: vertical; }
select.input { width: auto; min-width: 8.5rem; padding-right: 2rem; appearance: none; cursor: pointer; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235b6478' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 0.5rem center / 1rem; }
.input::placeholder { color: var(--muted-foreground); }
.input:focus-visible { border-color: var(--ring); box-shadow: var(--focus); }
.input[aria-invalid="true"] { border-color: var(--destructive); }
.input[readonly] { background: var(--card); }
@media (min-width: 768px) { .input { font-size: 0.875rem; } }
input[type="checkbox"] { width: 1rem; height: 1rem; margin: 0; accent-color: var(--primary); cursor: pointer; }
.checks { display: grid; gap: 0.75rem; }
.narrow-input { max-width: 12rem; }
.section-hint { margin-bottom: 0.75rem; }
.section-foot { margin-top: 1rem; gap: 1rem; }
.hint { font-size: 0.75rem; color: var(--muted-foreground); }
.error { color: var(--stop); }

/* Boutons. */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.375rem; height: 2rem; padding: 0 0.625rem; color: var(--primary-foreground); background: var(--primary); font: inherit; font-size: 0.875rem; font-weight: 500; white-space: nowrap; text-decoration: none; cursor: pointer; border: 1px solid transparent; border-radius: var(--radius); outline: none; transition: background-color 0.15s, box-shadow 0.15s; }
.btn:hover { background: color-mix(in srgb, var(--primary) 80%, transparent); }
.btn:focus-visible { border-color: var(--ring); box-shadow: var(--focus); }
.btn:active { transform: translateY(1px); }
.btn svg { width: 1rem; height: 1rem; }
.btn-outline { color: var(--foreground); background: var(--background); border-color: var(--border); }
.btn-outline:hover { background: var(--muted); }
.btn-ghost { color: var(--foreground); background: transparent; }
.btn-ghost:hover { background: var(--muted); }
.btn-destructive { color: var(--destructive); background: color-mix(in srgb, var(--destructive) 10%, transparent); }
.btn-destructive:hover { background: color-mix(in srgb, var(--destructive) 20%, transparent); }
.btn-sm { height: 1.75rem; font-size: 0.8rem; border-radius: calc(var(--radius) * 0.8); }
.btn-lg { height: 2.5rem; }
.btn-block { width: 100%; }

/* Pastilles et avatars. */
.pill { display: inline-flex; align-items: center; gap: 0.25rem; height: 1.25rem; padding: 0 0.5rem; font-size: 0.75rem; font-weight: 500; white-space: nowrap; border-radius: 9999px; }
.pill-muted { background: var(--muted); color: var(--muted-foreground); }
.pill-info { background: var(--accent); color: var(--accent-foreground); }
.pill-ok { background: #e3f3eb; color: var(--ok); }
.pill-warn { background: #f8eedb; color: var(--warn); }
.pill-stop { background: #fbe9ea; color: var(--stop); }
.avatar { display: inline-grid; place-items: center; width: 1.75rem; height: 1.75rem; flex-shrink: 0; color: #fff; font-size: 11px; font-weight: 600; border-radius: 9999px; box-shadow: 0 0 0 2px var(--card); }
.avatar.square { border-radius: 0.375rem; box-shadow: none; }
.menu .avatar { width: 1.25rem; height: 1.25rem; font-size: 9px; }
.avatar-0 { background: #2445b5; }
.avatar-1 { background: #1e7f56; }
.avatar-2 { background: #a8701a; }
.avatar-3 { background: #6b3fa0; }
.avatar-4 { background: #0f7489; }
.avatar-5 { background: #b0413e; }
.avatar-6 { background: #4a5675; }
.person { display: flex; align-items: center; gap: 0.625rem; }
.person b { display: block; font-weight: 500; }

/* Tableau de données. */
.table-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); }
.table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.table thead { background: color-mix(in srgb, var(--muted) 40%, transparent); }
.table th { height: 2.25rem; padding: 0 0.75rem; color: var(--muted-foreground); font-size: 0.75rem; font-weight: 500; text-align: left; white-space: nowrap; border-bottom: 1px solid var(--border); }
.table td { padding: 0.625rem 0.75rem; vertical-align: middle; border-bottom: 1px solid var(--border); }
.table tbody tr:last-child td { border-bottom: 0; }
.table a { color: inherit; text-decoration: none; }
.table a:hover { text-decoration: underline; }
.table td.end { width: 1%; }
.table .actions { flex-wrap: nowrap; }
.actions { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 0.5rem; }
.actions form { margin: 0; }

/* Fenêtres : l'attribut HTML popover, sans JavaScript. */
.dialog { width: calc(100% - 2rem); max-width: 28rem; margin: auto; padding: 1.5rem; color: var(--foreground); background: var(--card); border: 1px solid var(--border); border-radius: calc(var(--radius) * 1.4); box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1); }
.dialog::backdrop { background: rgb(0 0 0 / 0.1); backdrop-filter: blur(4px); }
.dialog h2 { font-size: 1rem; line-height: 1.5rem; }
.dialog-desc { margin-top: 0.375rem; color: var(--muted-foreground); }
.dialog form { margin-top: 1rem; }
.dialog-foot { display: flex; justify-content: flex-end; gap: 0.5rem; margin-top: 1.5rem; }

/* Pages hors connexion : connexion, mot de passe, messages. */
.auth { display: grid; min-height: 100svh; place-items: center; padding: 2.5rem 1rem; }
.auth-box { width: 100%; max-width: 24rem; }
.auth-box > .logo { justify-content: center; margin-bottom: 2rem; }
.auth h1 { font-size: 1.25rem; line-height: 1.75rem; }
.auth-foot { margin-top: 1rem; text-align: center; font-size: 0.75rem; color: var(--muted-foreground); }
.steps { display: grid; gap: 1.25rem; margin: 0; padding-left: 1.25rem; }
.steps > li { display: grid; gap: 0.75rem; }
.steps > li::marker { font-weight: 600; color: var(--muted-foreground); }
.qr { display: grid; place-items: center; width: fit-content; padding: 0.75rem; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); }
.qr svg { display: block; width: 10rem; height: 10rem; }

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