/* GMAO Parkings — feuille de style */
:root {
    --bleu: #123c5a;
    --bleu-fonce: #0d2a40;
    --bg: #f1f5f9;
    --carte: #ffffff;
    --bord: #e2e8f0;
    --texte: #1e293b;
    --muted: #64748b;
    --vert: #16a34a;
    --orange: #ea580c;
    --rouge: #dc2626;
    --jaune: #ca8a04;
    --radius: 10px;
    --ombre: 0 1px 3px rgba(0,0,0,.08);
}
* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--texte);
    font-size: 15px;
    line-height: 1.5;
}
a { color: var(--bleu); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.25; }
code { background: #f1f5f9; padding: .1em .4em; border-radius: 4px; font-size: .9em; }
hr { border: none; border-top: 1px solid var(--bord); margin: 28px 0; }

/* ---------- En-tête ---------- */
.entete { background: var(--bleu-fonce); color: #fff; }
.entete-inner { max-width: 1200px; margin: 0 auto; padding: 10px 20px; display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.entete-titre { color: #fff; display: flex; flex-direction: column; line-height: 1.1; }
.entete-titre:hover { text-decoration: none; }
.entete-titre strong { font-size: 18px; }
.entete-titre span { font-size: 12px; opacity: .8; }
.entete-nav { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
.entete-nav a { color: #dbeafe; padding: 6px 12px; border-radius: 6px; font-size: 14px; }
.entete-nav a:hover { background: rgba(255,255,255,.12); text-decoration: none; }
.entete-nav a.actif { background: rgba(255,255,255,.2); color: #fff; font-weight: 600; }
.entete-user { font-size: 13px; text-align: right; color: #cbd5e1; }
.entete-user a { display: block; }
.lien-discret { color: #93c5fd; }

/* ---------- Contenu ---------- */
.contenu { max-width: 1200px; margin: 0 auto; padding: 24px 20px 60px; }
.titre-page { font-size: 24px; margin: 0 0 18px; }
.pied { text-align: center; color: var(--muted); font-size: 13px; padding: 24px; }
.muted { color: var(--muted); }
.petit { font-size: 13px; }
.droite { text-align: right; }
.centre { text-align: center; }
.sans-marge { margin: 0; }
.vide { color: var(--muted); font-style: italic; padding: 12px 0; }

/* ---------- Cartes & colonnes ---------- */
.carte { background: var(--carte); border: 1px solid var(--bord); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--ombre); margin-bottom: 20px; }
.carte h2 { margin-top: 0; font-size: 18px; }
.carte h3 { margin-top: 0; font-size: 16px; }
.deux-colonnes { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.deux-colonnes.inverse { grid-template-columns: 2fr 1fr; }
@media (max-width: 860px) { .deux-colonnes, .deux-colonnes.inverse { grid-template-columns: 1fr; } }

/* ---------- KPI ---------- */
.kpi-grille { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 22px; }
.kpi { background: var(--carte); border: 1px solid var(--bord); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; box-shadow: var(--ombre); }
a.kpi:hover { text-decoration: none; border-color: var(--bleu); }
.kpi-nombre { font-size: 26px; font-weight: 700; color: var(--bleu-fonce); }
.kpi-label { font-size: 13px; color: var(--muted); margin-top: 2px; }
.kpi-attention { border-left: 4px solid var(--orange); }
.kpi-attention .kpi-nombre { color: var(--orange); }
.kpi-urgent { border-left: 4px solid var(--rouge); }
.kpi-urgent .kpi-nombre { color: var(--rouge); }

/* ---------- Tableaux ---------- */
.tableau { width: 100%; border-collapse: collapse; }
.tableau th, .tableau td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--bord); }
.tableau thead th { font-size: 12px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
.tableau tbody tr:hover { background: #f8fafc; }
.tableau tfoot th { border-top: 2px solid var(--bord); }
.tableau .inactif, tr.inactif { opacity: .55; }
.ligne-retard { background: #fef2f2; }
.actions-cell { text-align: right; white-space: nowrap; }
.actions-cell form { display: inline; }
.tableau-fiche th { text-align: left; color: var(--muted); font-weight: 500; width: 38%; padding: 6px 10px 6px 0; vertical-align: top; }
.tableau-fiche td { padding: 6px 0; }

/* ---------- Boutons ---------- */
.bouton { display: inline-block; padding: 8px 14px; border-radius: 7px; border: 1px solid var(--bord); background: #fff; color: var(--texte); cursor: pointer; font-size: 14px; line-height: 1.2; }
.bouton:hover { background: #f1f5f9; text-decoration: none; }
.bouton.primaire { background: var(--bleu); border-color: var(--bleu); color: #fff; }
.bouton.primaire:hover { background: var(--bleu-fonce); }
.bouton.petit { padding: 5px 10px; font-size: 13px; }
.bouton.bloc { width: 100%; text-align: center; }
.lien-danger { background: none; border: none; color: var(--rouge); cursor: pointer; font-size: 14px; padding: 0; }
.lien-danger:hover { text-decoration: underline; }

/* ---------- Barres d'action & filtres ---------- */
.barre-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.barre-actions form { display: inline; }
.filtres { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; background: var(--carte); padding: 12px; border-radius: var(--radius); border: 1px solid var(--bord); }
.filtres input[type=search] { flex: 1; min-width: 180px; }

/* ---------- Formulaires ---------- */
input, select, textarea { font: inherit; padding: 8px 10px; border: 1px solid #cbd5e1; border-radius: 7px; background: #fff; width: 100%; color: var(--texte); }
input:focus, select:focus, textarea:focus { outline: 2px solid #bfdbfe; border-color: var(--bleu); }
label { display: block; margin-bottom: 12px; font-size: 14px; font-weight: 500; }
label input, label select, label textarea { margin-top: 4px; font-weight: 400; }
.case { display: flex; align-items: center; gap: 8px; }
.case input { width: auto; margin: 0; }
.formulaire { background: var(--carte); border: 1px solid var(--bord); border-radius: var(--radius); padding: 20px; box-shadow: var(--ombre); }
.grille-form { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
@media (max-width: 640px) { .grille-form { grid-template-columns: 1fr; } }
.form-boutons { display: flex; gap: 10px; margin-top: 8px; }
.form-laterale label { margin-bottom: 10px; }
.form-supprimer { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--bord); }
.ligne-etat { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--bord); }
.ligne-etat label { margin: 0; display: flex; align-items: center; gap: 8px; }
.ligne-etat select { width: auto; }
.form-depense { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 12px; }
.form-depense input[type=text] { flex: 1; min-width: 160px; }
.form-depense select { width: auto; }
.form-journal { margin-bottom: 16px; }
.form-journal textarea { margin-bottom: 8px; }

/* ---------- Bloc de code (cron) ---------- */
.code-bloc { background: #0f172a; color: #e2e8f0; padding: 10px 12px; border-radius: 8px; font-size: 12px; overflow-x: auto; white-space: pre; }

/* ---------- Bloc mode de traitement ---------- */
.bloc-mode { border: 1px solid var(--bord); border-radius: var(--radius); padding: 14px 16px; margin: 6px 0 16px; }
.bloc-mode legend { font-weight: 600; padding: 0 6px; color: var(--bleu-fonce); }
.mode-choix { display: flex; gap: 20px; flex-wrap: wrap; margin-bottom: 12px; }
.mode-choix .case { margin: 0; }
.bloc-traitement { padding-top: 10px; border-top: 1px dashed var(--bord); }

/* ---------- Fiche ---------- */
.fiche-entete { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.fiche-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.fil { font-size: 13px; color: var(--muted); margin: 0 0 4px; }
.notes-bloc { background: #f8fafc; border-radius: 8px; padding: 10px 12px; margin-top: 12px; font-size: 14px; }
.resume-parc { font-size: 16px; }

/* ---------- QR ---------- */
.qr-box { display: flex; justify-content: center; margin: 10px 0; }
.qr-box img, .qr-box canvas { border: 1px solid var(--bord); border-radius: 6px; }

/* ---------- Journal ---------- */
.journal { list-style: none; margin: 0; padding: 0; }
.journal li { padding: 10px 0; border-bottom: 1px solid var(--bord); }
.journal li:last-child { border-bottom: none; }
.journal-meta { font-size: 13px; color: var(--muted); margin-bottom: 2px; }

/* ---------- Histogramme ---------- */
.histogramme { display: flex; align-items: flex-end; gap: 8px; height: 160px; padding-top: 10px; }
.histo-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; }
.histo-barre { width: 70%; background: var(--bleu); border-radius: 4px 4px 0 0; min-height: 2px; transition: height .3s; }
.histo-label { font-size: 11px; color: var(--muted); margin-top: 4px; }

/* ---------- Badges ---------- */
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; line-height: 1.5; }
.badge-ok { background: #dcfce7; color: #166534; }
.badge-etat-service { background: #dcfce7; color: #166534; }
.badge-etat-panne { background: #fee2e2; color: #991b1b; }
.badge-etat-maintenance { background: #fef9c3; color: #854d0e; }
.badge-etat-hors_service { background: #e2e8f0; color: #475569; }
.badge-statut-ouvert { background: #dbeafe; color: #1e40af; }
.badge-statut-en_cours { background: #fef9c3; color: #854d0e; }
.badge-statut-en_attente { background: #ffedd5; color: #9a3412; }
.badge-statut-resolu { background: #dcfce7; color: #166534; }
.badge-statut-clos { background: #e2e8f0; color: #475569; }
.badge-prio-basse { background: #e2e8f0; color: #475569; }
.badge-prio-normale { background: #dbeafe; color: #1e40af; }
.badge-prio-haute { background: #ffedd5; color: #9a3412; }
.badge-prio-urgente { background: #fee2e2; color: #991b1b; }

/* ---------- Page de connexion ---------- */
.page-login { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: linear-gradient(135deg, #1e3a8a, #1d4ed8); }
.login-carte { background: #fff; border-radius: 14px; padding: 32px; width: 100%; max-width: 380px; box-shadow: 0 10px 40px rgba(0,0,0,.25); }
.login-carte h1 { margin: 0 0 4px; font-size: 22px; color: var(--bleu-fonce); }
.login-sous { margin: 0 0 18px; color: var(--muted); font-size: 14px; }
.info { background: #dbeafe; color: #1e40af; padding: 10px 12px; border-radius: 8px; font-size: 14px; }

/* ---------- Flash ---------- */
.flash { padding: 11px 14px; border-radius: 8px; margin-bottom: 14px; font-size: 14px; }
.flash-ok { background: #dcfce7; color: #166534; }
.flash-erreur { background: #fee2e2; color: #991b1b; }
.flash-info { background: #dbeafe; color: #1e40af; }
