/* NK Car Rental · back office
   Charte NK Car Rental : rouge du logo #E8501E et noir #1A1A1A ; barre latérale noire, bandeau logo blanc. */
@font-face { font-family: "Barlow Condensed"; font-weight: 600; font-display: swap; src: url(fonts/BarlowCondensed-SemiBold.ttf) format("truetype"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 700; font-display: swap; src: url(fonts/BarlowCondensed-Bold.ttf) format("truetype"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 800; font-display: swap; src: url(fonts/BarlowCondensed-ExtraBold.ttf) format("truetype"); }
@font-face { font-family: "Barlow"; font-weight: 400; font-display: swap; src: url(fonts/Barlow-Regular.ttf) format("truetype"); }
@font-face { font-family: "Barlow"; font-weight: 600; font-display: swap; src: url(fonts/Barlow-SemiBold.ttf) format("truetype"); }
@font-face { font-family: "Barlow"; font-weight: 700; font-display: swap; src: url(fonts/Barlow-Bold.ttf) format("truetype"); }
:root {
  --ink: #141414;
  --ink-2: #262626;
  --paper: #f3f3f3;
  --panel: #ffffff;
  --line: #e2e2e2;
  --text: #1a1a1a;
  --muted: #6b6b6b;
  --red: #E8501E;
  --red-dark: #B8400F;
  --red-tint: #fde9e1;
  --blue: #B8400F;
  --ok: #1f7a4a;  --ok-bg: #e4f3ea;
  --warn: #9a5b00; --warn-bg: #fdf0d9;
  --bad: #b3261e;  --bad-bg: #fbe5e3;
  --info: #0a66ad; --info-bg: #e3eef8;
  --f-body: "Barlow", "Segoe UI", Arial, sans-serif;
  --f-display: "Barlow Condensed", "Arial Narrow", Arial, sans-serif;
  --f-mono: "IBM Plex Mono", Consolas, monospace;
  --r: 6px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 14px/1.5 var(--f-body); color: var(--text); background: var(--paper); }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-family: var(--f-display); font-weight: 700; letter-spacing: .2px; margin: 0; text-wrap: balance; }
h1 { font-size: 28px; text-transform: uppercase; letter-spacing: .6px; }
h1::after { content: ""; display: block; width: 42px; height: 4px; background: var(--red); margin-top: 6px; transform: skewX(-20deg); }
h2 { font-size: 19px; margin-bottom: 10px; }
h3 { font-size: 16px; margin: 18px 0 6px; }
.mono { font-family: var(--f-mono); font-size: 13px; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.sub { display: block; color: var(--muted); font-size: 12px; font-family: var(--f-body); }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

/* Structure */
.shell { display: flex; min-height: 100vh; }
.side { width: 236px; flex: none; background: var(--ink); color: #c9c8c5; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: block; background: #fff; padding: 14px 16px 10px; text-decoration: none !important; border-bottom: 4px solid var(--red); }
.brand img { display: block; width: 100%; max-width: 190px; height: auto; }
.brand small { display: block; margin-top: 6px; color: var(--ink); font: 700 12px/1 var(--f-display); text-transform: uppercase; letter-spacing: 2.4px; }
.side nav { padding: 8px 0 16px; flex: 1; }
.side nav a { display: block; padding: 7px 18px; color: #d4d3d0; font-size: 13.5px; border-left: 3px solid transparent; }
.side nav a:hover { background: var(--ink-2); text-decoration: none; color: #fff; }
.side nav a.on { background: var(--ink-2); color: #fff; border-left-color: var(--red); font-weight: 600; }
.nav-sep { padding: 16px 18px 4px; font: 700 12px var(--f-display); text-transform: uppercase; letter-spacing: 1.8px; color: #FF8A5C; }
.side-user { border-top: 1px solid var(--ink-2); padding: 12px 18px 16px; font-size: 13px; display: flex; flex-direction: column; gap: 4px; }
.side-user small { display: block; color: #8d8b87; }
.side-user a { color: #e9e8e6; }
.main { flex: 1; min-width: 0; padding-block: 18px 80px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); max-width: 1320px; }
@media (min-width: 900px) { .main { padding-left: 32px; padding-right: 32px; } }
.main-full { width: 100%; }
.login-card h1::after { margin-left: auto; margin-right: auto; }
.topbar { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.menu-btn { display: none; }

/* Blocs */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; margin-bottom: 16px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.panel-head h2 { margin: 0; }
.actions-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.actions-bar > .btn:first-child { margin-left: 0; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-top: 3px solid var(--ink); border-radius: var(--r); padding: 14px 16px; }
.kpi:first-child { border-top-color: var(--red); }
.kpi span { display: block; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .8px; }
.kpi strong { display: block; font: 800 27px/1.2 var(--f-display); margin-top: 4px; font-variant-numeric: tabular-nums; }
.kpi strong small { font: 400 13px var(--f-body); color: var(--muted); }
.kpi-bad { border-color: #f0b9b4; background: var(--bad-bg); }
.empty { text-align: center; padding: 28px 12px; color: var(--muted); }
.empty h2 { color: var(--text); }
.hint { background: var(--red-tint); border-left: 3px solid var(--red); border-radius: var(--r); padding: 9px 12px; margin: 0 0 12px; font-size: 13.5px; }
.flash { padding: 10px 14px; border-radius: var(--r); margin-bottom: 12px; font-weight: 500; }
.flash-ok { background: var(--ok-bg); color: var(--ok); }
.flash-warn { background: var(--warn-bg); color: var(--warn); }
.flash-bad { background: var(--bad-bg); color: var(--bad); }
.alertes { list-style: none; margin: 0; padding: 0; }
.alertes li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.alertes li:first-child { border-top: 0; }

/* Pastilles */
.pill { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 10px; white-space: nowrap; }
.pill-ok { background: var(--ok-bg); color: var(--ok); }
.pill-warn { background: var(--warn-bg); color: var(--warn); }
.pill-bad { background: var(--bad-bg); color: var(--bad); }
.pill-info { background: var(--info-bg); color: var(--info); }
.pill-muted { background: #eeece8; color: var(--muted); }
.statuts { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }

/* Boutons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: 600 13.5px var(--f-body); padding: 8px 14px; border-radius: var(--r); border: 1px solid #cfcbc5; background: #fff; color: var(--text); cursor: pointer; text-decoration: none !important; }
.btn:hover { border-color: #a9a49c; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--red); border-color: var(--red); color: #141414; font-weight: 700; }
.btn-primary:hover { background: var(--red-dark); border-color: var(--red-dark); color: #fff; }
.btn-dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost.danger { color: var(--bad); }
.btn-small { padding: 5px 10px; font-size: 12.5px; }
.btn-block { width: 100%; }
.inline-form { display: contents; }
.stack { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.stack .btn { width: 100%; }

/* Tableaux */
.table-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .7px; color: var(--ink); font-weight: 700; padding: 8px 10px; border-bottom: 2px solid var(--ink); white-space: nowrap; }
.tbl td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl tbody tr:hover { background: #faf9f7; }
.tbl tfoot td { font-weight: 700; border-top: 2px solid var(--line); border-bottom: 0; }
.tbl .num { white-space: nowrap; }
.tbl tr.dim td { color: #9b9893; }
.tbl-compact td, .tbl-compact th { padding: 5px 6px; font-size: 12.5px; }
.tbl-compta tr.first td { border-top: 2px solid var(--line); }
.tbl-compta tr:not(.first) td { border-bottom-color: transparent; }
.tbl-compta tr.report td { background: #f6f5f2; font-style: italic; }
.trunc { max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Formulaires */
.form label, .doc-form label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; font-weight: 600; color: #47464a; min-width: 0; }
.form label small, .doc-form label small { font-weight: 400; color: var(--muted); }
input, select, textarea { font: 14px var(--f-body); color: var(--text); padding: 8px 10px; border: 1px solid #cfcbc5; border-radius: var(--r); background: #fff; width: 100%; min-width: 0; }
textarea { resize: vertical; }
input.mono { font-family: var(--f-mono); }
input.big { font-size: 22px; font-weight: 600; }
label.check { flex-direction: row !important; align-items: center; gap: 8px !important; font-weight: 500 !important; }
label.check input { width: auto; }
.grid2, .grid3 { display: grid; gap: 12px 16px; margin-bottom: 12px; }
.grid2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.span2 { grid-column: span 2; }
.span3 { grid-column: 1 / -1; }
.form-foot { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
fieldset { border: 1px solid var(--line); border-radius: var(--r); padding: 10px 14px 14px; margin: 0 0 14px; }
legend { font-weight: 600; padding: 0 6px; }
fieldset.checks { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.seg { display: inline-flex; border: 1px solid #cfcbc5; border-radius: var(--r); overflow: hidden; margin-bottom: 14px; }
.seg label { flex-direction: row !important; align-items: center; gap: 6px; padding: 8px 14px; cursor: pointer; font-weight: 600; }
.seg label:has(input:checked) { background: var(--ink); color: #fff; }
.seg input { width: auto; }
.inline { display: flex; gap: 8px; }
.search { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.search input[type=search] { width: 260px; max-width: 100%; }
.search input[type=date], .search select { width: auto; }
.inl { display: inline-flex !important; flex-direction: row !important; align-items: center; gap: 6px; font-size: 13px; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.tabs a { padding: 6px 12px; border-radius: 16px; color: var(--text); font-size: 13px; border: 1px solid transparent; }
.tabs a.on { background: var(--red); color: #141414; font-weight: 600; }
.tabs a:hover { text-decoration: none; border-color: var(--line); }
.inline-add { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.inline-add input { width: auto; flex: 1; min-width: 140px; }
.images .thumb { display: block; background: repeating-conic-gradient(#eee 0 25%, #fff 0 50%) 0 0/16px 16px; border: 1px solid var(--line); border-radius: var(--r); padding: 8px; text-align: center; }
.images .thumb img { max-height: 90px; }

/* Lignes de document */
.lines { display: flex; flex-direction: column; gap: 12px; }
.line { border: 1px solid var(--line); border-radius: var(--r); padding: 12px; display: flex; flex-direction: column; gap: 8px; background: #fcfbfa; }
.line-top { display: grid; grid-template-columns: 2fr 1.6fr 1fr auto; gap: 8px; }
.l-des { font-weight: 600; }
.line-nums { display: grid; grid-template-columns: 70px 1fr 1fr 80px 70px 1fr; gap: 8px; align-items: end; }
.line-nums label small { font-weight: 400; color: var(--muted, #777); }
.extra-lignes { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line); }
.line-nums label { font-size: 11.5px; }
.l-total { font: 600 15px var(--f-mono); padding-bottom: 8px; }
.l-del { background: none; border: 0; color: var(--bad); cursor: pointer; font-size: 12.5px; }
.totals { margin: 16px 0 0 auto; max-width: 340px; }
.totals div { display: flex; justify-content: space-between; padding: 5px 0; border-bottom: 1px solid var(--line); }
.totals dt { color: var(--muted); }
.totals dd { margin: 0; font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
.totals .ttc dt, .totals .ttc dd { font-weight: 700; color: var(--text); font-size: 17px; }
.tva-check { align-self: end; padding-bottom: 8px; }
.sticky-foot { position: sticky; bottom: 0; background: rgba(244,243,241,.96); border-top: 1px solid var(--line); padding: 12px 0 calc(12px + env(safe-area-inset-bottom, 0px)); display: flex; gap: 10px; align-items: center; flex-wrap: wrap; z-index: 5; }

/* Fiche document */
.view-grid { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 18px; align-items: start; }
.view-main { min-width: 0; }
.paper-frame { background: #dcdcdc; border-radius: var(--r); padding: 18px; }
.side-status { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.side-status strong { font: 700 24px var(--f-display); font-variant-numeric: tabular-nums; }
dl.mini { margin: 10px 0 0; }
dl.mini div { display: flex; justify-content: space-between; padding: 4px 0; font-size: 13px; border-bottom: 1px dashed var(--line); }
dl.mini dd { margin: 0; font-variant-numeric: tabular-nums; }
dl.mini .strong { font-weight: 700; }
.copy { display: flex; gap: 6px; margin-bottom: 10px; }
.copy input { font-size: 12px; font-family: var(--f-mono); }
details.send { border-top: 1px solid var(--line); padding: 10px 0; }
details.send summary { cursor: pointer; font-weight: 600; }
.form.compact { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.envois { list-style: none; padding: 0; margin: 8px 0 0; font-size: 12.5px; }
.envois li { padding: 5px 0 5px 10px; border-left: 3px solid var(--line); margin-bottom: 4px; }
.envois li.ok { border-left-color: var(--ok); }
.envois li.bad { border-left-color: var(--bad); }
.envois span { color: var(--muted); margin-right: 6px; }
.timeline { list-style: none; padding: 0; margin: 0; font-size: 13px; }
.timeline li { padding: 6px 0; border-bottom: 1px solid var(--line); display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.timeline li span:first-child { color: var(--muted); min-width: 74px; }
.schema { display: grid; gap: 6px; margin: 10px 0 16px; font-size: 13px; }
.schema div { background: #f7f6f3; border-radius: var(--r); padding: 8px 12px; }

/* Connexion */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; width: 100%; background: var(--ink) linear-gradient(115deg, transparent 62%, var(--red) 62%, var(--red) 64%, transparent 64%); }
.login-card { background: #fff; border: 0; border-top: 5px solid var(--red); border-radius: 6px; padding: 28px; width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 14px; }
.login-card.wide { max-width: 620px; }
.login-card label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; font-weight: 600; }
.login-logo { width: 190px; align-self: center; }
.login-card h1 { text-align: center; }

@media (max-width: 1100px) { .view-grid { grid-template-columns: 1fr; } }
@media (max-width: 860px) {
  .shell { display: block; }
  .side { position: fixed; z-index: 30; left: 0; top: 0; transform: translateX(-100%); transition: transform .2s; padding-top: env(safe-area-inset-top, 0px); }
  .side.open { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.4); }
  .menu-btn { display: inline-flex; font: 600 13px var(--f-body); padding: 7px 12px; border: 1px solid #cfcbc5; border-radius: var(--r); background: #fff; }
  .grid3 { grid-template-columns: 1fr 1fr; }
  .line-top { grid-template-columns: 1fr 1fr; }
  .line-nums { grid-template-columns: 1fr 1fr 1fr; }
}
@media (max-width: 560px) {
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .span2, .span3 { grid-column: auto; }
  h1 { font-size: 22px; }
  .line-nums { grid-template-columns: 1fr 1fr; }
}
@media (prefers-reduced-motion: reduce) { .side { transition: none; } }

/* Aperçu A4 réduit pour tenir dans la colonne */
@media (max-width: 1500px) { .paper-frame .doc { zoom: .82; } }
@media (max-width: 1100px) { .paper-frame .doc { zoom: .9; } }
@media (max-width: 860px) { .paper-frame { padding: 8px; } .paper-frame .doc { zoom: .46; } }
@media (max-width: 560px) { .sticky-foot .muted { display: none; } .sticky-foot { gap: 8px; } }

/* ===== Intranet ===== */
.cols2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 16px; align-items: start; }
.cols2 > * { min-width: 0; }
.annonce { background: var(--ink); color: #fff; border-left: 4px solid var(--red); padding: 10px 14px; border-radius: var(--r); margin-bottom: 10px; }
.panel-alerte { border-color: var(--red); box-shadow: inset 4px 0 0 var(--red); }
.row-bad td { background: var(--bad-bg); }
.txt-bad { color: var(--bad); }
.prewrap { white-space: pre-wrap; }
.actions { white-space: nowrap; display: flex; gap: 4px; flex-wrap: wrap; }
.comments { list-style: none; padding: 0; margin: 0 0 12px; }
.comments li { padding: 10px 0; border-bottom: 1px solid var(--line); }
.comments p { margin: 4px 0 0; }
.cell-input { max-width: 150px; padding: 5px 8px; }
.stackform { display: flex; flex-direction: column; gap: 12px; }
.stackform label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; font-weight: 600; }
.steps-2fa { padding-left: 18px; margin: 0; display: flex; flex-direction: column; gap: 8px; font-size: 13.5px; }
.qr { background: #fff; padding: 10px; border: 1px solid var(--line); border-radius: var(--r); width: max-content; margin: 8px 0; min-height: 40px; }
.codes { columns: 2; padding-left: 22px; font-size: 15px; background: #f7f7f7; border-radius: var(--r); padding-block: 10px; }
.reauth { max-width: 420px; }
.funnel { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 8px; margin-bottom: 16px; }
.funnel-step { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 10px 12px; color: var(--text); display: flex; flex-direction: column; gap: 2px; }
.funnel-step:hover { text-decoration: none; border-color: var(--ink); }
.funnel-step span { font-size: 11.5px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); }
.funnel-step strong { font: 800 26px/1 var(--f-display); }
.funnel-step.on { border-color: var(--red); box-shadow: inset 0 -3px 0 var(--red); }
.funnel-step.relance { background: var(--ink); color: #fff; border-color: var(--ink); }
.funnel-step.relance span { color: #ccc; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.card-person { border: 1px solid var(--line); border-top: 3px solid var(--ink); border-radius: var(--r); padding: 12px; display: flex; flex-direction: column; gap: 3px; min-width: 0; overflow-wrap: anywhere; }
.card-person strong { font: 700 17px var(--f-display); text-transform: uppercase; letter-spacing: .3px; }
.jauge { height: 6px; background: #eee; border-radius: 3px; margin-top: 8px; overflow: hidden; }
.jauge i { display: block; height: 100%; background: var(--red); }
.ged { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 16px; align-items: start; }
.ged-rubs { display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 6px; position: sticky; top: 12px; }
.ged-rubs a { padding: 8px 10px; border-radius: 4px; color: var(--text); font-size: 13px; display: flex; gap: 6px; align-items: baseline; }
.ged-rubs a small { margin-left: auto; color: var(--muted); }
.ged-rubs a.on { background: var(--ink); color: #fff; }
.ged-rubs a.on small { color: #bbb; }
.ged-rubs a:hover { text-decoration: none; background: #f2f2f2; }
.ged-rubs a.on:hover { background: var(--ink); }
.ged-rubs .lock { font-style: normal; font-size: 10px; text-transform: uppercase; letter-spacing: .5px; color: var(--red); }
.ged-main { min-width: 0; }
@media (max-width: 900px) { .ged { grid-template-columns: 1fr; } .ged-rubs { position: static; } }

/* ===== NK Car Rental : location ===== */
.res-steps { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 14px; padding: 0; list-style: none; }
.res-steps li { flex: 1 1 120px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--r); font-size: 12.5px; background: var(--panel); color: var(--muted); }
.res-steps li.fait { border-color: var(--ok); color: var(--ok); background: var(--ok-bg); }
.res-steps li.encours { border-color: var(--red); color: var(--text); box-shadow: inset 0 -3px 0 var(--red); font-weight: 600; }
.planning { border-collapse: collapse; font-size: 12px; min-width: 900px; }
.planning th, .planning td { border: 1px solid var(--line); padding: 4px 6px; text-align: center; white-space: nowrap; }
.planning th.veh, .planning td.veh { text-align: left; position: sticky; left: 0; background: var(--panel); z-index: 1; }
.planning td.occ { background: var(--red); color: #141414; font-weight: 600; }
.planning td.occ a { color: #141414; }
.planning td.dev { background: var(--warn-bg); }
.planning th.we { background: var(--paper); }
.sigpad { border: 2px dashed var(--line); border-radius: var(--r); background: #fff; width: 100%; height: 190px; touch-action: none; display: block; }
.edl-grid { display: grid; grid-template-columns: 1fr auto auto; gap: 6px 12px; align-items: center; }
.edl-grid label { display: inline-flex; gap: 4px; align-items: center; font-weight: 400; margin: 0; }
.ech-depasse { color: var(--bad); font-weight: 700; }
.ech-proche { color: var(--warn); font-weight: 600; }
.ech-inconnu { color: var(--muted); }
.prix-detail td { font-size: 13px; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
