/* ==========================================================================
   Suivi des roulages véhicules - Victory Lane
   Feuille de style unique.

   Deux contraintes ont guidé les choix :
   1. L'écran de scan est lu sur un téléphone, souvent en plein soleil, parfois
      avec des gants : fond sombre, contrastes élevés, boutons hauts (60 px
      minimum) et texte large.
   2. L'administration est lue sur un ordinateur : tableaux denses, mais même
      palette pour ne pas avoir deux identités visuelles.
   ========================================================================== */

:root {
    --bg: #0f1115;
    --panel: #181c23;
    --panel-alt: #20252e;
    --line: #2c333f;
    --text: #f2f4f7;
    --muted: #9aa4b2;
    --accent: #e10600;          /* rouge course, couleur d'action principale */
    --accent-dark: #b40500;
    --ok: #1f9d55;
    --warn: #d99100;
    --radius: 10px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.45;
    -webkit-text-size-adjust: 100%;
}

a { color: #7fb3ff; }

.wrap {
    max-width: 1100px;
    margin: 0 auto;
    padding: 16px;
}

.wrap.narrow { max-width: 520px; }

/* --- En-tête ------------------------------------------------------------ */

header.site {
    background: #000;
    border-bottom: 3px solid var(--accent);
    padding: 12px 16px;
}

header.site .title {
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-size: 15px;
}

header.site nav {
    margin-top: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    font-size: 14px;
}

header.site nav a { color: var(--muted); text-decoration: none; }
header.site nav a:hover { color: var(--text); }

/* --- Messages ----------------------------------------------------------- */

.flash {
    padding: 12px 14px;
    border-radius: var(--radius);
    margin-bottom: 14px;
    font-weight: 600;
}

.flash.ok    { background: rgba(31, 157, 85, 0.15); border: 1px solid var(--ok); }
.flash.error { background: rgba(225, 6, 0, 0.15);   border: 1px solid var(--accent); }

/* --- Blocs -------------------------------------------------------------- */

.card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 16px;
}

.card h2 { margin: 0 0 12px; font-size: 17px; }

.muted { color: var(--muted); }
.small { font-size: 13px; }

/* --- Écran de scan ------------------------------------------------------ */

.vehicle-name {
    font-size: 34px;
    font-weight: 800;
    text-align: center;
    margin: 18px 0 4px;
    letter-spacing: 0.02em;
}

.vehicle-plate {
    text-align: center;
    color: var(--muted);
    margin-bottom: 20px;
}

.status {
    text-align: center;
    padding: 18px 14px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    background: var(--panel);
    border: 1px solid var(--line);
}

.status .state { font-size: 20px; font-weight: 700; }
.status .detail { color: var(--muted); margin-top: 6px; }

.status.free  { border-color: var(--ok); }
.status.mine  { border-color: var(--warn); }
.status.other { border-color: var(--accent); }

/* --- Boutons ------------------------------------------------------------ */

.btn {
    display: block;
    width: 100%;
    min-height: 62px;
    padding: 16px;
    margin-bottom: 12px;
    border: none;
    border-radius: var(--radius);
    background: var(--accent);
    color: #fff;
    font-size: 19px;
    font-weight: 700;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
}

.btn:active { background: var(--accent-dark); }

.btn.secondary {
    background: var(--panel-alt);
    color: var(--text);
    border: 1px solid var(--line);
    font-size: 16px;
    min-height: 52px;
}

.btn.small {
    display: inline-block;
    width: auto;
    min-height: 0;
    padding: 6px 12px;
    font-size: 14px;
    margin: 0 4px 4px 0;
}

/* --- Formulaires -------------------------------------------------------- */

label { display: block; margin: 12px 0 6px; font-weight: 600; font-size: 14px; }

input[type="text"],
input[type="password"],
input[type="date"],
input[type="datetime-local"],
select {
    width: 100%;
    padding: 12px;
    font-size: 16px;               /* 16px minimum : évite le zoom auto sur iOS */
    color: var(--text);
    background: var(--panel-alt);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.row > div { flex: 1 1 160px; }

/* --- Tableaux ----------------------------------------------------------- */

.table-scroll { overflow-x: auto; }

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

th, td {
    padding: 8px 10px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    white-space: nowrap;
}

th { color: var(--muted); font-weight: 600; text-transform: uppercase; font-size: 12px; }

tr.open td { background: rgba(217, 145, 0, 0.10); }

/* --- Planche de QR codes ------------------------------------------------ */

.qr-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}

.qr-card {
    background: #fff;
    color: #000;
    border: 2px solid #000;
    border-radius: 8px;
    padding: 14px;
    text-align: center;
    break-inside: avoid;
}

.qr-card img { width: 100%; max-width: 260px; height: auto; }
.qr-card .qr-name { font-size: 24px; font-weight: 800; margin-bottom: 6px; }
.qr-card .qr-hint { font-size: 13px; margin-top: 8px; }
.qr-card .qr-url  { font-size: 11px; color: #555; margin-top: 4px; word-break: break-all; }

/* Impression : uniquement les fiches, sur fond blanc. */
@media print {
    body { background: #fff; color: #000; }
    header.site, .no-print { display: none !important; }
    .wrap { max-width: none; padding: 0; }
    .qr-grid { grid-template-columns: repeat(2, 1fr); gap: 10mm; }
}
