/* Palette : ardoise (texte), béton de hangar (fond), bleu aviation (actions),
   rouge "Remove before flight" (danger / reporté), vert (corrigé), ambre (à traiter). */
:root {
  --ink: #1b2b3a;
  --ink-soft: #55646f;
  --hangar: #eceeeb;
  --panel: #ffffff;
  --line: #d3d8d6;
  --blue: #1e5a8c;
  --blue-dark: #164570;
  --red: #b3261e;
  --green: #2e6b45;
  --amber: #a86b00;
  --radius: 4px;
  --font: "Barlow", system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Barlow Condensed", "Arial Narrow", sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--hangar); color: var(--ink); font: 16px/1.5 var(--font); }
a { color: var(--blue); }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.sr-only { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.mono { font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.muted { color: var(--ink-soft); font-size: .9em; }

/* Barre du haut */
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap;
  background: var(--ink); color: #fff; padding: .75rem clamp(1rem, 3vw, 2rem); }
.brand { color: #fff; text-decoration: none; display: flex; align-items: baseline; gap: .75rem; }
.brand-name { font: 700 1.35rem/1 var(--display); letter-spacing: .03em; }
.brand-sub { color: #aebbc6; font-size: .95rem; }
.topnav { display: flex; gap: 1.25rem; align-items: center; font-size: .95rem; }
.topnav a { color: #fff; text-decoration: none; }
.topnav a:hover { text-decoration: underline; }
.who { color: #aebbc6; }
.demo-ribbon { background: var(--red); color: #fff; text-align: center; font-size: .85rem; padding: .2rem; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 1.5rem clamp(1rem, 3vw, 2rem) 4rem; }
h1 { font: 700 2rem/1.1 var(--display); margin: 0; }
h2 { font: 600 1.35rem/1.2 var(--display); margin: 0 0 1rem; }

.flash { background: #e3edf6; border-left: 4px solid var(--blue); padding: .7rem 1rem; margin-bottom: 1.25rem; }
.error { color: var(--red); font-weight: 500; }

/* Boutons */
.btn { display: inline-block; font: 500 .95rem/1 var(--font); padding: .7rem 1.1rem; border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--panel); color: var(--ink); cursor: pointer; text-decoration: none; }
.btn:hover { border-color: var(--ink-soft); }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.primary:hover { background: var(--blue-dark); }
.btn.danger { background: var(--panel); border-color: var(--red); color: var(--red); }
.btn.danger:hover { background: var(--red); color: #fff; }
.btn.ghost { background: transparent; }
.icon-btn { font: .8rem var(--font); background: none; border: 0; color: var(--red); cursor: pointer; padding: .25rem; text-decoration: underline; }

/* Liste */
.list-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.search { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.search input[type=search] { flex: 1 1 340px; }
input, select, textarea { font: inherit; color: var(--ink); background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius); padding: .6rem .7rem; width: 100%; }
.search select { width: auto; }
input[readonly], textarea[readonly], select:disabled { background: #f5f6f5; color: var(--ink); border-color: transparent; opacity: 1; }
.count { color: var(--ink-soft); font-size: .9rem; margin: .5rem 0; }
.table-scroll { overflow-x: auto; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
table.reports { width: 100%; border-collapse: collapse; min-width: 860px; }
.reports th { text-align: left; font-weight: 600; font-size: .85rem; color: var(--ink-soft); padding: .7rem .9rem; border-bottom: 2px solid var(--ink); }
.reports td.mono, .reports td:nth-child(3) { white-space: nowrap; }
.reports td { padding: .75rem .9rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.reports tbody tr { cursor: pointer; }
.reports tbody tr:hover { background: #f4f7fa; }
.reg { font: 700 1.3rem/1 var(--display); letter-spacing: .04em; color: var(--ink); text-decoration: none; }
.empty { background: var(--panel); padding: 2rem; text-align: center; border-radius: var(--radius); }

.tag { display: inline-block; font-size: .8rem; font-weight: 600; padding: .15rem .5rem; border-radius: 2px; white-space: nowrap; }
.tag.closed { background: #e2efe6; color: var(--green); }
.tag.draft { background: #f7ecd6; color: var(--amber); }
.tag.deferred { background: #f6e1df; color: var(--red); }
.tag.big { font-size: .9rem; padding: .45rem .75rem; }

/* Fiche rapport — l'immatriculation en grand, comme peinte sur le fuselage */
.report-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.crumb { margin: 0 0 .4rem; font-size: .9rem; color: var(--ink-soft); }
.livery { font: 700 clamp(3rem, 8vw, 5.5rem)/.9 var(--display); letter-spacing: .06em; }
.sub { margin: .5rem 0 0; color: var(--ink-soft); font-size: 1.05rem; }
.head-actions { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; margin-bottom: 1.25rem; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .9rem 1rem; }
.field { display: block; }
.field > span { display: block; font-size: .85rem; font-weight: 500; color: var(--ink-soft); margin-bottom: .25rem; }
.span2 { grid-column: span 2; }
.span3 { grid-column: span 3; }
@media (max-width: 640px) { .span2, .span3 { grid-column: auto; } }

.finding { border: 1px solid var(--line); border-left: 5px solid var(--amber); border-radius: var(--radius); margin-bottom: 1rem; }
.finding.status-fixed { border-left-color: var(--green); }
.finding.status-deferred { border-left-color: var(--red); }
.finding > header { display: flex; gap: .75rem; align-items: center; padding: .75rem 1rem; background: #f6f7f6; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.num { font: 700 1.2rem/1 var(--display); color: var(--ink-soft); }
.f-title { flex: 1 1 220px; font-weight: 600; }
.finding > header select { width: auto; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; padding: 1rem; }
@media (max-width: 760px) { .cols { grid-template-columns: 1fr; } }

.photos { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: .75rem; }
.photos figure { margin: 0; width: 130px; }
.photos img { width: 130px; height: 130px; object-fit: cover; border-radius: var(--radius); display: block; border: 1px solid var(--line); }
.upload { width: 130px; height: 130px; border: 2px dashed var(--line); border-radius: var(--radius); display: flex;
  align-items: center; justify-content: center; text-align: center; font-size: .85rem; color: var(--ink-soft); cursor: pointer; position: relative; padding: .5rem; }
.upload:hover { border-color: var(--blue); color: var(--blue); }
.upload input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.upload.has-files { border-color: var(--blue); color: var(--blue); border-style: solid; }

.actionbar { position: sticky; bottom: 0; display: flex; gap: .75rem; justify-content: flex-end; padding: .9rem 1.25rem;
  background: rgba(236, 238, 235, .95); border-top: 1px solid var(--line); margin: 0 -1rem; }
.audit ol { list-style: none; margin: 0; padding: 0; font-size: .92rem; }
.audit li { padding: .35rem 0; border-bottom: 1px solid var(--hangar); }
.audit time { color: var(--ink-soft); font-variant-numeric: tabular-nums; margin-right: .5rem; }

/* Connexion */
.login { max-width: 380px; margin: 3rem auto; background: var(--panel); padding: 2rem; border-radius: var(--radius); border: 1px solid var(--line); }
.login form { display: grid; gap: 1rem; margin-top: 1.25rem; }
.login label { font-size: .9rem; font-weight: 500; display: grid; gap: .3rem; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
