/* =========================================================================
   MOTIX BUSINESS — feuille de style (identique à MOTIX CONTROL)
   Palette reprise du logo MOTIX EXPRESS : noir #14161A, vert #58BE3B,
   blanc, avec les accents "EXPRESS" en pilule et le lettrage incliné.
   ========================================================================= */

:root {
    --motix-black: #14161A;
    --motix-black-soft: #1B1E24;
    --motix-panel: #20232B;
    --motix-panel-2: #262a33;
    --motix-border: rgba(255, 255, 255, 0.08);
    --motix-border-strong: rgba(255, 255, 255, 0.16);
    --motix-green: #58BE3B;
    --motix-green-dark: #3E9C29;
    --motix-white: #FFFFFF;
    --motix-text-dim: rgba(255, 255, 255, 0.62);
    --motix-text-faint: rgba(255, 255, 255, 0.4);
    --motix-red: #E5484D;
    --motix-amber: #F2B94C;
    --motix-blue: #4C9AF2;
    --motix-radius: 14px;
    --motix-radius-lg: 20px;
    --header-h: 64px;
    font-size: 15px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--motix-black);
    color: var(--motix-white);
    font-family: "Inter", "Segoe UI", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
a.lien { color: var(--motix-green); font-weight: 600; }
a.lien:hover { text-decoration: underline; }
.icone { flex-shrink: 0; vertical-align: middle; }
h2, h3 { letter-spacing: -0.2px; }
h3 { font-size: 16px; margin: 0 0 14px; }
hr { border: none; border-top: 1px solid var(--motix-border); margin: 18px 0; }
.muted { color: var(--motix-text-dim); }
.faint { color: var(--motix-text-faint); }
.petit { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.texte-droite { text-align: right; }
.texte-vert { color: var(--motix-green); }
.texte-rouge { color: var(--motix-red); }
.texte-ambre { color: var(--motix-amber); }

/* ---------------------------------------------------------------------
   Structure : menu latéral + colonne (barre du haut + contenu)
   --------------------------------------------------------------------- */
.motix-app { display: flex; min-height: 100vh; }

.motix-sidebar {
    width: 240px;
    flex-shrink: 0;
    background: var(--motix-black-soft);
    border-right: 1px solid var(--motix-border);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.motix-sidebar-logo {
    padding: 20px 22px 16px;
    border-bottom: 1px solid var(--motix-border);
    display: flex;
    align-items: center;
    gap: 10px;
}

.motix-sidebar-logo img { width: 100%; max-width: 128px; display: block; }

.motix-sidebar-tag {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1.4px;
    color: #08170A;
    background: var(--motix-green);
    border-radius: 999px;
    padding: 3px 8px;
    font-style: italic;
}

.motix-nav { flex: 1; padding: 16px 12px; display: flex; flex-direction: column; gap: 2px; }

.motix-nav a {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px 14px;
    border-radius: 10px;
    color: var(--motix-text-dim);
    font-size: 13.5px;
    font-weight: 600;
    transition: background 0.15s ease, color 0.15s ease;
}

.motix-nav a:hover { background: rgba(255, 255, 255, 0.05); color: var(--motix-white); }
.motix-nav a.active { background: rgba(88, 190, 59, 0.15); color: var(--motix-green); }

.motix-nav-groupe {
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--motix-text-faint);
    padding: 18px 14px 6px;
}

.nav-compteur {
    margin-left: auto;
    min-width: 20px;
    padding: 1px 7px;
    border-radius: 999px;
    background: var(--motix-red);
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    text-align: center;
}

.motix-colonne { flex: 1; min-width: 0; display: flex; flex-direction: column; }

/* Barre du haut */
.motix-header {
    position: sticky;
    top: 0;
    z-index: 30;
    height: var(--header-h);
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 0 34px;
    background: rgba(20, 22, 26, 0.92);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--motix-border);
}

.motix-header-recherche {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    max-width: 440px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--motix-border);
    border-radius: 10px;
    padding: 0 12px;
    color: var(--motix-text-faint);
}

.motix-header-recherche input { border: none !important; background: transparent !important; padding: 9px 0 !important; }

.motix-header-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }

.motix-header-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    color: var(--motix-text-dim);
    background: none;
    border: none;
    cursor: pointer;
    list-style: none;
}

.motix-header-btn:hover, .motix-header-btn.active, details[open] > .motix-header-btn {
    background: rgba(255, 255, 255, 0.06);
    color: var(--motix-white);
}

.motix-burger { display: none; }

.pastille {
    position: absolute;
    top: 4px;
    right: 3px;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    border-radius: 999px;
    background: var(--motix-red);
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    line-height: 17px;
    text-align: center;
}

.motix-header-utilisateur {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 10px 4px 4px;
    border-radius: 12px;
    cursor: pointer;
    list-style: none;
}

.motix-header-utilisateur:hover, details[open] > .motix-header-utilisateur { background: rgba(255, 255, 255, 0.06); }
.motix-header-utilisateur-texte { display: flex; flex-direction: column; line-height: 1.2; }
.motix-header-utilisateur-texte strong { font-size: 13px; }
.motix-header-utilisateur-texte small { font-size: 11.5px; color: var(--motix-text-faint); }

summary::-webkit-details-marker { display: none; }

.avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(88, 190, 59, 0.18);
    color: var(--motix-green);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 12.5px;
    flex-shrink: 0;
    overflow: hidden;
}

.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-lg { width: 64px; height: 64px; font-size: 20px; }

/* Menus déroulants (details/summary) */
.menu-deroulant { position: relative; }

.menu-deroulant-contenu {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    min-width: 230px;
    background: var(--motix-panel-2);
    border: 1px solid var(--motix-border-strong);
    border-radius: 14px;
    padding: 6px;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
    z-index: 40;
}

.menu-deroulant-contenu a, .menu-deroulant-contenu button {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    border-radius: 9px;
    font-size: 13px;
    color: var(--motix-white);
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    text-align: left;
}

.menu-deroulant-contenu a:hover, .menu-deroulant-contenu button:hover { background: rgba(255, 255, 255, 0.06); }
.menu-deroulant-titre { padding: 8px 12px 6px; font-size: 11px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; color: var(--motix-text-faint); }
.notifications { min-width: 320px; }
.notif { border-left: 3px solid transparent; }
.notif strong { min-width: 22px; }
.notif-rouge { border-left-color: var(--motix-red) !important; }
.notif-ambre { border-left-color: var(--motix-amber) !important; }
.notif-vide { display: flex; gap: 8px; align-items: center; padding: 14px 12px; color: var(--motix-text-dim); font-size: 13px; }

.motix-main { flex: 1; min-width: 0; padding: 28px 34px 48px; }

/* En-tête de page */
.motix-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.motix-title { font-size: 22px; font-weight: 800; font-style: italic; letter-spacing: -0.3px; }
.motix-title .accent { color: var(--motix-green); }
.motix-subtitle { color: var(--motix-text-dim); font-size: 13.5px; margin-top: 2px; font-style: normal; }
.motix-topbar-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.fil-ariane { display: inline-flex; align-items: center; gap: 6px; color: var(--motix-text-dim); font-size: 13px; margin-bottom: 8px; }
.fil-ariane:hover { color: var(--motix-white); }

/* ---------------------------------------------------------------------
   Boutons
   --------------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 10px;
    font-size: 13.5px;
    font-weight: 700;
    border: 1px solid transparent;
    cursor: pointer;
    transition: opacity 0.15s ease, background 0.15s ease;
    font-family: inherit;
    white-space: nowrap;
}

.btn:hover { opacity: 0.88; }
.btn-primary { background: var(--motix-green); color: #08170A; }
.btn-outline { background: transparent; border-color: var(--motix-border-strong); color: var(--motix-white); }
.btn-ghost { background: transparent; color: var(--motix-text-dim); padding-left: 10px; padding-right: 10px; }
.btn-ghost:hover { color: var(--motix-white); background: rgba(255, 255, 255, 0.05); }
.btn-danger { background: var(--motix-red); color: #fff; }
.btn-danger-outline { background: transparent; border-color: rgba(229, 72, 77, 0.4); color: var(--motix-red); }
.btn-sm { padding: 7px 12px; font-size: 12.5px; }
.btn-bloc { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
form.inline { display: inline; }

/* ---------------------------------------------------------------------
   Cartes / grilles
   --------------------------------------------------------------------- */
.card {
    background: var(--motix-panel);
    border: 1px solid var(--motix-border);
    border-radius: var(--motix-radius-lg);
    padding: 22px;
}

.card + .card { margin-top: 18px; }
.card-entete { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card-entete h3 { margin: 0; }
.card-flush { padding: 0; overflow: hidden; }
.card-flush .card-entete { padding: 18px 22px 0; }
.card-flush table.motix-table { margin-top: 6px; }

.grille-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grille-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.grille-fiche { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 18px; align-items: start; }
.grille-2 > .card + .card, .grille-3 > .card + .card { margin-top: 0; }
.pile > * + * { margin-top: 18px; }

/* KPI */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 22px;
}

.kpi-tile {
    background: var(--motix-panel);
    border: 1px solid var(--motix-border);
    border-radius: var(--motix-radius);
    padding: 18px 20px;
    display: block;
    position: relative;
}

a.kpi-tile:hover { border-color: var(--motix-border-strong); }

.kpi-tile .kpi-label {
    font-size: 11.5px;
    color: var(--motix-text-dim);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.kpi-tile .kpi-value { font-size: 30px; font-weight: 800; margin-top: 6px; letter-spacing: -0.5px; }
.kpi-tile .kpi-value.accent { color: var(--motix-green); }
.kpi-tile .kpi-value.ambre { color: var(--motix-amber); }
.kpi-tile .kpi-value.bleu { color: var(--motix-blue); }
.kpi-tile .kpi-value.rouge { color: var(--motix-red); }
.kpi-tile .kpi-hint { font-size: 12px; color: var(--motix-text-faint); margin-top: 4px; }
.kpi-tile.alerte { border-color: rgba(229, 72, 77, 0.45); }

/* Liste clé : valeur (fiches) */
.infos { display: grid; grid-template-columns: 150px 1fr; gap: 10px 16px; font-size: 13.5px; margin: 0; }
.infos dt { color: var(--motix-text-dim); }
.infos dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

/* ---------------------------------------------------------------------
   Tables
   --------------------------------------------------------------------- */
.table-defile { overflow-x: auto; }
table.motix-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }

table.motix-table thead th {
    text-align: left;
    padding: 10px 14px;
    color: var(--motix-text-dim);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--motix-border);
    white-space: nowrap;
}

table.motix-table tbody td { padding: 12px 14px; border-bottom: 1px solid var(--motix-border); vertical-align: middle; }
table.motix-table tbody tr:hover { background: rgba(255, 255, 255, 0.02); }
table.motix-table tbody tr:last-child td { border-bottom: none; }
table.motix-table tr.ligne-lien { cursor: pointer; }
table.motix-table td.vide { text-align: center; color: var(--motix-text-dim); padding: 34px 14px; }
table.motix-table tfoot td { padding: 12px 14px; border-top: 1px solid var(--motix-border-strong); font-weight: 800; }

.mono { font-family: "SFMono-Regular", Consolas, monospace; letter-spacing: 0.3px; }
table.motix-table .mono { white-space: nowrap; }
.sous-ligne { display: block; color: var(--motix-text-faint); font-size: 12px; margin-top: 2px; }

/* ---------------------------------------------------------------------
   Badges
   --------------------------------------------------------------------- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

.badge-green { background: rgba(88, 190, 59, 0.15); color: var(--motix-green); }
.badge-amber { background: rgba(242, 185, 76, 0.15); color: var(--motix-amber); }
.badge-blue  { background: rgba(76, 154, 242, 0.15); color: var(--motix-blue); }
.badge-red   { background: rgba(229, 72, 77, 0.15); color: var(--motix-red); }
.badge-grey  { background: rgba(255, 255, 255, 0.08); color: var(--motix-text-dim); }
.badge-contour { background: transparent; border: 1px solid var(--motix-border-strong); color: var(--motix-text-dim); }

/* ---------------------------------------------------------------------
   Formulaires
   --------------------------------------------------------------------- */
label { display: block; font-size: 12.5px; font-weight: 700; color: var(--motix-text-dim); margin-bottom: 6px; }
label.case { display: flex; align-items: center; gap: 10px; font-weight: 600; color: var(--motix-white); font-size: 13.5px; cursor: pointer; }

input[type=text], input[type=email], input[type=tel], input[type=password], input[type=number],
input[type=date], input[type=month], input[type=search], input[type=url], select, textarea {
    width: 100%;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--motix-border);
    border-radius: 10px;
    padding: 10px 12px;
    color: var(--motix-white);
    font-size: 13.5px;
    font-family: inherit;
}

input[type=date], input[type=month] { color-scheme: dark; }
select option { background: var(--motix-panel); }
textarea { min-height: 90px; resize: vertical; }
input[type=checkbox], input[type=radio] { accent-color: var(--motix-green); width: 17px; height: 17px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--motix-green); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 16px; }
.form-row { margin-bottom: 16px; }
.form-hint { font-size: 12px; color: var(--motix-text-faint); margin-top: 5px; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 6px; flex-wrap: wrap; }

/* ---------------------------------------------------------------------
   Filtres, onglets, recherche
   --------------------------------------------------------------------- */
.filter-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }

.filter-chip {
    padding: 7px 14px;
    border-radius: 999px;
    font-size: 12.5px;
    font-weight: 700;
    border: 1px solid var(--motix-border);
    color: var(--motix-text-dim);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.filter-chip:hover { border-color: var(--motix-border-strong); color: var(--motix-white); }
.filter-chip.active { background: var(--motix-green); color: #08170A; border-color: var(--motix-green); }
.filter-chip .compte { opacity: 0.7; font-weight: 800; }
.search-box { flex: 1; min-width: 220px; max-width: 340px; margin-left: auto; }
.filter-bar select { width: auto; }

.onglets { display: flex; gap: 4px; border-bottom: 1px solid var(--motix-border); margin-bottom: 22px; overflow-x: auto; }

.onglets a {
    padding: 11px 16px;
    font-size: 13.5px;
    font-weight: 700;
    color: var(--motix-text-dim);
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.onglets a:hover { color: var(--motix-white); }
.onglets a.active { color: var(--motix-green); border-bottom-color: var(--motix-green); }

.pagination { display: flex; gap: 6px; justify-content: center; padding: 16px; flex-wrap: wrap; }
.pagination a { min-width: 34px; padding: 7px 10px; border-radius: 9px; text-align: center; border: 1px solid var(--motix-border); font-size: 13px; font-weight: 700; color: var(--motix-text-dim); }
.pagination a.active { background: var(--motix-green); color: #08170A; border-color: var(--motix-green); }
.pagination-gap { padding: 7px 4px; color: var(--motix-text-faint); }

/* ---------------------------------------------------------------------
   Alertes
   --------------------------------------------------------------------- */
.alert { padding: 12px 16px; border-radius: 10px; font-size: 13px; margin-bottom: 18px; border: 1px solid transparent; }
.alert-success { background: rgba(88, 190, 59, 0.12); border-color: rgba(88, 190, 59, 0.3); color: var(--motix-green); }
.alert-error { background: rgba(229, 72, 77, 0.12); border-color: rgba(229, 72, 77, 0.3); color: var(--motix-red); }
.alert-warning { background: rgba(242, 185, 76, 0.12); border-color: rgba(242, 185, 76, 0.3); color: var(--motix-amber); }
.alert-info { background: rgba(76, 154, 242, 0.1); border-color: rgba(76, 154, 242, 0.28); color: #9cc6f7; }

.etat-vide { text-align: center; padding: 34px 16px; color: var(--motix-text-dim); font-size: 13.5px; }
.etat-vide .icone { color: var(--motix-text-faint); margin-bottom: 8px; }

/* ---------------------------------------------------------------------
   Modales
   --------------------------------------------------------------------- */
.motix-modal-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.62);
    z-index: 60;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.motix-modal-backdrop.open { display: flex; }

.motix-modal {
    background: var(--motix-panel);
    border: 1px solid var(--motix-border);
    border-radius: var(--motix-radius-lg);
    padding: 24px;
    width: 100%;
    max-width: 520px;
    max-height: 92vh;
    overflow-y: auto;
}

.motix-modal.large { max-width: 760px; }
.motix-modal h3 { margin-top: 0; }
.motix-modal-close { float: right; cursor: pointer; color: var(--motix-text-dim); font-size: 22px; line-height: 1; }

/* ---------------------------------------------------------------------
   Fil d'activité / chronologie
   --------------------------------------------------------------------- */
.chrono { list-style: none; margin: 0; padding: 0; }
.chrono li { position: relative; padding: 0 0 18px 24px; font-size: 13.5px; }
.chrono li::before { content: ""; position: absolute; left: 5px; top: 6px; width: 9px; height: 9px; border-radius: 50%; background: var(--motix-text-faint); }
.chrono li::after { content: ""; position: absolute; left: 9px; top: 18px; bottom: 0; width: 1px; background: var(--motix-border); }
.chrono li:last-child::after { display: none; }
.chrono li.fait::before { background: var(--motix-green); }
.chrono li.actuel::before { background: var(--motix-amber); box-shadow: 0 0 0 4px rgba(242, 185, 76, 0.18); }
.chrono li.echec::before { background: var(--motix-red); }
.chrono .quand { display: block; color: var(--motix-text-faint); font-size: 12px; margin-top: 2px; }

.activite { list-style: none; margin: 0; padding: 0; }
.activite li { display: flex; gap: 12px; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--motix-border); font-size: 13.5px; }
.activite li:last-child { border-bottom: none; }
.activite .quand { margin-left: auto; color: var(--motix-text-faint); font-size: 12px; white-space: nowrap; }

/* Photo (preuve, colis, incident) */
.photo { display: block; width: 100%; max-height: 320px; object-fit: cover; border-radius: 12px; border: 1px solid var(--motix-border); }
.photo-vignette { width: 52px; height: 52px; object-fit: cover; border-radius: 8px; border: 1px solid var(--motix-border); }

/* ---------------------------------------------------------------------
   Barres (statistiques)
   --------------------------------------------------------------------- */
.barres { display: flex; align-items: flex-end; gap: 4px; height: 180px; padding-top: 10px; }
.barres .barre { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; min-width: 0; }
.barres .barre-pile { width: 100%; display: flex; flex-direction: column-reverse; border-radius: 4px 4px 0 0; overflow: hidden; min-height: 2px; background: rgba(255, 255, 255, 0.05); }
.barres .seg-livree { background: var(--motix-green); }
.barres .seg-autre { background: var(--motix-blue); }
.barres .seg-annulee { background: var(--motix-red); }
.barres .barre-label { font-size: 10px; color: var(--motix-text-faint); margin-top: 6px; white-space: nowrap; }
.legende { display: flex; gap: 16px; font-size: 12px; color: var(--motix-text-dim); flex-wrap: wrap; }
.legende span { display: inline-flex; align-items: center; gap: 6px; }
.legende i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

.jauge { height: 8px; border-radius: 999px; background: rgba(255, 255, 255, 0.07); overflow: hidden; }
.jauge > span { display: block; height: 100%; background: var(--motix-green); border-radius: 999px; }
.classement td:first-child { width: 36px; color: var(--motix-text-faint); font-weight: 800; }

/* ---------------------------------------------------------------------
   Grille de tarifs
   --------------------------------------------------------------------- */
.grille-tarifs { border-collapse: separate; border-spacing: 4px; font-size: 13px; }
.grille-tarifs th { padding: 6px 8px; color: var(--motix-text-dim); font-size: 11.5px; text-align: center; white-space: nowrap; }
.grille-tarifs th.ligne { text-align: right; }
.grille-tarifs input { width: 100px; text-align: right; padding: 8px; }
.grille-tarifs td.diag input { border-color: rgba(88, 190, 59, 0.35); }
.pastille-zone { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: middle; }
.liste-quartiers { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px 16px; max-height: 520px; overflow-y: auto; padding-right: 6px; }
.liste-quartiers label { font-weight: 500; color: var(--motix-white); margin: 0; display: flex; align-items: center; gap: 8px; font-size: 13px; }
.liste-quartiers select { padding: 6px 8px; font-size: 12.5px; }

/* Autorisations des rôles */
.matrice td, .matrice th { text-align: center; }
.matrice td:first-child, .matrice th:first-child { text-align: left; }

/* ---------------------------------------------------------------------
   Connexion
   --------------------------------------------------------------------- */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: radial-gradient(circle at top, #1c2018 0%, #0c0d10 70%);
}

.login-card {
    background: var(--motix-panel);
    border: 1px solid var(--motix-border);
    border-radius: var(--motix-radius-lg);
    padding: 36px 32px;
    width: 100%;
    max-width: 380px;
    text-align: center;
}

.login-card img { width: 200px; margin-bottom: 22px; }
.login-card .form-row { text-align: left; }
.login-card .btn { width: 100%; justify-content: center; margin-top: 6px; }

/* ---------------------------------------------------------------------
   Cartes géographiques
   --------------------------------------------------------------------- */
#motix-map { width: 100%; height: calc(100vh - 230px); min-height: 420px; border-radius: var(--motix-radius-lg); border: 1px solid var(--motix-border); }
.mini-carte { width: 100%; height: 260px; border-radius: 14px; border: 1px solid var(--motix-border); background: var(--motix-black-soft); }
.map-legend { display: flex; gap: 18px; align-items: center; font-size: 12.5px; color: var(--motix-text-dim); margin-bottom: 14px; flex-wrap: wrap; }
.map-legend span { display: flex; align-items: center; gap: 6px; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.dot-green { background: var(--motix-green); }
.dot-blue { background: var(--motix-blue); }
.dot-grey { background: var(--motix-text-faint); }

/* ---------------------------------------------------------------------
   Facture imprimable
   --------------------------------------------------------------------- */
.facture { background: #fff; color: #14161A; border-radius: 16px; padding: 40px; max-width: 860px; margin: 0 auto; }
.facture table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.facture th { text-align: left; border-bottom: 2px solid #14161A; padding: 8px 6px; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.5px; }
.facture td { border-bottom: 1px solid #e3e6e3; padding: 9px 6px; }
.facture .entete { display: flex; justify-content: space-between; gap: 24px; align-items: flex-start; margin-bottom: 30px; }
.facture .entete img { width: 110px; border-radius: 12px; }
.facture .numero { font-size: 22px; font-weight: 800; font-style: italic; }
.facture .totaux { margin-left: auto; width: 300px; margin-top: 18px; }
.facture .totaux div { display: flex; justify-content: space-between; padding: 6px 0; }
.facture .totaux .ttc { font-size: 18px; font-weight: 800; border-top: 2px solid #14161A; padding-top: 10px; }
.facture .faint { color: #6b716f; }

@media print {
    body { background: #fff; }
    .motix-sidebar, .motix-header, .no-print, .alert { display: none !important; }
    .motix-main { padding: 0; }
    .facture { border-radius: 0; padding: 0; }
}

/* ---------------------------------------------------------------------
   Écrans étroits
   --------------------------------------------------------------------- */
@media (max-width: 1100px) {
    .grille-fiche, .grille-3 { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
    .motix-sidebar {
        position: fixed;
        left: 0;
        top: 0;
        z-index: 70;
        transform: translateX(-100%);
        transition: transform 0.2s ease;
    }
    body.menu-ouvert .motix-sidebar { transform: none; }
    .motix-sidebar-voile { display: none; }
    body.menu-ouvert .motix-sidebar-voile { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, 0.55); z-index: 65; }
    .motix-burger { display: inline-flex; }
    .motix-header { padding: 0 14px; }
    .motix-header-utilisateur-texte { display: none; }
    .motix-main { padding: 20px 16px 40px; }
    .grille-2 { grid-template-columns: 1fr; }
    .infos { grid-template-columns: 1fr; gap: 2px 0; }
    .infos dd { margin-bottom: 8px; }
    .notifications { min-width: 280px; right: -60px; }
    .search-box { max-width: none; margin-left: 0; }
}

@media (max-width: 560px) {
    .motix-header-recherche { display: none; }
    .kpi-grid { grid-template-columns: 1fr 1fr; }
    .kpi-tile .kpi-value { font-size: 24px; }
}
