/* vigie — Tidy Ship interface. Tokens and fonts from VAB-Tech/tidyship.fr (static/css/site.css).
   Light theme only, as on the site. Sober and dense: one level of cards, no shadow. */

@font-face {
  font-family: "Martian Mono";
  src: url("/static/fonts/MartianMono-Variable.woff2") format("woff2");
  font-weight: 100 800;
  font-stretch: 75% 112.5%;
  font-display: swap;
}
@font-face {
  font-family: "Geist";
  src: url("/static/fonts/Geist-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --bg: #f4f5f2;
  --surface: #ffffff;
  --surface-2: #eaece7;
  --text: #111315;
  --text-muted: #545b56;
  --border: #d5d9d3;
  --border-strong: #7c837d;
  --accent: #1a7346;      /* « ça passe » : fait, à l'heure, RDV pris */
  --accent-hover: #145c38;
  --accent-soft: #e2eee6;
  --on-accent: #ffffff;
  --danger: #b42318;      /* en retard : 6.0:1 sur --bg, 6.6:1 sur --surface (AA) */
  --danger-soft: #fbeae8;
  --font-mono: "Martian Mono", ui-monospace, Menlo, monospace;
  --font-sans: "Geist", ui-sans-serif, system-ui, Arial, sans-serif;
  --gutter: 16px;
  --radius-sm: 4px;
  --radius: 8px;
  color-scheme: light;
}
@media (min-width: 600px) { :root { --gutter: 32px; } }

*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 22px;
}
h1, h2, h3, p, ul, ol, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-hover); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }

.wrap { max-width: 1200px; margin: 0 auto; padding: 0 var(--gutter); }
.main { padding-top: 24px; padding-bottom: 64px; }

.mono, .label, .logo, .count, .tag {
  font-family: var(--font-mono);
  font-weight: 500;
  font-variation-settings: "wdth" 87.5;
}
.label { font-size: 11px; line-height: 16px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); }
.small { font-size: 13px; line-height: 18px; }
.muted { color: var(--text-muted); }

.h1 { font-size: 28px; line-height: 34px; font-weight: 620; letter-spacing: -0.02em; margin-bottom: 16px; }
.h2 { font-size: 19px; line-height: 26px; font-weight: 600; letter-spacing: -0.01em; margin-bottom: 12px; }
.h3 { font-size: 15px; line-height: 22px; font-weight: 600; margin-bottom: 10px; }
.count { font-size: 12px; color: var(--text-muted); font-weight: 500; margin-left: 8px; letter-spacing: 0; }

/* Header and logo: « tidy ship » + green block cursor. */
.top { background: var(--bg); border-bottom: 1px solid var(--border); }
.top__inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 56px; flex-wrap: wrap; }
.logo { display: inline-flex; align-items: center; gap: 3px; color: var(--text); font-size: 18px; line-height: 24px; text-decoration: none; }
.logo:hover { color: var(--text); }
.logo__cursor { display: inline-block; width: 0.6em; height: 1.05em; background: var(--accent); }
.nav { display: flex; align-items: center; gap: 16px; }
.nav__link { color: var(--text-muted); text-decoration: none; font-weight: 500; }
.nav__link.is-current, .nav__link:hover { color: var(--text); }

/* Blocks and cards: one level only. */
.block { margin-top: 32px; }
.block--quiet { border-top: 1px solid var(--border); padding-top: 20px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; }
.grid { display: grid; gap: 16px; }
@media (min-width: 900px) { .grid { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); } }
.stack { display: grid; gap: 8px; margin-top: 12px; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.inline { display: inline; }

/* Forms */
input[type=text], input[type=password], input[type=email], input[type=datetime-local], select, textarea {
  font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 6px 10px; min-height: 36px; max-width: 100%;
}
textarea { width: 100%; resize: vertical; }
.btn {
  font: inherit; font-weight: 600; cursor: pointer; min-height: 36px; padding: 6px 14px;
  border-radius: var(--radius-sm); border: 1px solid var(--accent); background: var(--accent); color: var(--on-accent);
}
.btn:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn--ghost { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn--ghost:hover { background: var(--surface-2); border-color: var(--border-strong); }
.btn--danger { background: var(--surface); color: var(--danger); border-color: var(--danger); }
.link--danger { color: var(--danger); }
.btn--danger:hover { background: var(--danger-soft); border-color: var(--danger); }
.link-button { font: inherit; background: none; border: 0; padding: 0; color: var(--text-muted); cursor: pointer; font-weight: 500; }
.link-button:hover { color: var(--text); }

/* Flash */
.flash { border: 1px solid var(--accent); background: var(--accent-soft); border-radius: var(--radius-sm); padding: 8px 12px; margin-bottom: 16px; }
.flash--error { border-color: var(--danger); background: var(--danger-soft); color: var(--danger); }

/* Tags */
.tag { display: inline-block; font-size: 11px; line-height: 16px; padding: 1px 6px; border-radius: var(--radius-sm); background: var(--surface-2); color: var(--text); text-transform: uppercase; letter-spacing: 0.04em; }
.tag--stage { background: var(--accent-soft); color: var(--accent); }
.tag--late { background: var(--danger-soft); color: var(--danger); }
.tag--ok { background: var(--accent-soft); color: var(--accent); }
.tags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }

/* Daily list */
.list { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.item { display: grid; gap: 4px 16px; padding: 10px 14px; border-top: 1px solid var(--border); }
.item:first-child { border-top: 0; }
@media (min-width: 700px) { .item { grid-template-columns: 220px minmax(0, 1fr) auto; align-items: start; } }
.item__when { font-size: 12px; color: var(--text-muted); }
.item--overdue { box-shadow: inset 3px 0 0 var(--danger); }
.item--overdue .item__when { color: var(--danger); }
.item__lead { font-weight: 600; margin-right: 8px; }
.item__done { display: flex; gap: 6px; flex-wrap: wrap; }
.draft { margin-top: 6px; }
.draft summary { cursor: pointer; color: var(--text-muted); font-size: 13px; }
.draft pre { white-space: pre-wrap; font-family: var(--font-sans); background: var(--surface-2); border-radius: var(--radius-sm); padding: 8px 10px; margin: 6px 0 0; }

/* Tables */
.table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; display: block; overflow-x: auto; }
@media (min-width: 700px) { .table { display: table; } }
.table th { text-align: left; font-family: var(--font-mono); font-weight: 500; font-variation-settings: "wdth" 87.5; font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); background: var(--surface-2); padding: 8px 12px; }
.table td { padding: 8px 12px; border-top: 1px solid var(--border); vertical-align: top; }
.is-dnc td { color: var(--text-muted); }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.stat { padding: 12px 14px; border-left: 1px solid var(--border); }
.stat:first-child { border-left: 0; }
.stat__value { font-size: 22px; line-height: 30px; margin-top: 4px; }
.stat__sub { font-size: 11px; color: var(--text-muted); }

/* Filters */
.filters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.chip { font-size: 13px; text-decoration: none; color: var(--text); border: 1px solid var(--border); border-radius: 999px; padding: 2px 10px; background: var(--surface); }
.chip.is-current { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

/* Lead page */
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 12px; align-items: baseline; }
/* Self-assessment answers: the question wraps inside the card; the answer keeps one line
   (up to half the card, then it wraps as a whole phrase, never word by word). */
.answers { display: grid; grid-template-columns: minmax(0, 1fr) fit-content(50%); gap: 6px 16px; align-items: baseline; margin: 8px 0 0; }
.answers dt { min-width: 0; overflow-wrap: anywhere; color: var(--text-muted); }
.answers dd { margin: 0; min-width: 0; text-align: right; font-weight: 500; overflow-wrap: anywhere; }
.log li { padding: 6px 0; border-top: 1px solid var(--border); }
.log li:first-child { border-top: 0; }

/* Login */
.login { max-width: 380px; margin: 48px auto 0; }
.login .muted { margin-bottom: 16px; }
.numbered { list-style: decimal; padding-left: 20px; margin: 6px 0 10px; }
.is-late { color: var(--danger); }
.item__done select { min-height: 32px; padding: 2px 6px; }

/* « 3 points prioritaires » page: one page, printable. */
.gift { max-width: 760px; margin: 0 auto; }
.gift .label:first-child { margin-bottom: 8px; }
.gift__facts { display: grid; gap: 4px; }
.gift__facts dt { margin-top: 8px; }
@media print {
  .top { border: 0; }
  .card { break-inside: avoid; border-color: #d5d9d3; }
  body { background: #fff; }
}
