:root {
  --navy: #34495E;
  --navy-dark: #22344A;
  --blue: #5DADE2;
  --grad: linear-gradient(100deg, #FFD60A 0%, #F39A2B 55%, #E9433A 100%);
  --bg: #F4F7FB;
  --surface: #FFFFFF;
  --surface-2: #F8FBFE;
  --text: #22344A;
  --text-sub: #5D7085;
  --text-muted: #8798A9;
  --border: #DCE7F0;
  --grid: #E8EEF4;
  /* Données (palette validée : bleu / orange) */
  --d-moto: #2F8FD0;
  --d-voiture: #E07A1F;
  --d-main: #2F8FD0;
  /* Statuts */
  --ok: #1E7A4C; --ok-bg: #E3F6EC;
  --warn: #9A5B00; --warn-bg: #FFF3DF;
  --bad: #B3261E; --bad-bg: #FDECEA;
  --info: #1F6FA6; --info-bg: #E5F3FB;
  --radius: 14px;
  --sidebar: 248px;
  color-scheme: light;
}

* { box-sizing: border-box; }
body { margin: 0; font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif; background: var(--bg); color: var(--text); font-size: 14.5px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: var(--d-main); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-family: "Montserrat", "Inter", sans-serif; color: var(--navy-dark); margin: 0; }
h1 { font-size: 1.45rem; font-weight: 800; }
h2 { font-size: 1.02rem; font-weight: 700; }
.muted { color: var(--text-muted); }
.sub { color: var(--text-sub); }
.num { font-variant-numeric: tabular-nums; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }

/* Layout */
.layout { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }
.sidebar { background: var(--navy-dark); color: #C9D6E2; padding: 22px 14px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 6px; }
.sidebar .logo { display: flex; align-items: center; gap: 10px; padding: 4px 10px 22px; color: #fff; font-family: "Montserrat"; font-weight: 800; font-size: 1.15rem; letter-spacing: .02em; }
.sidebar .logo img { width: 34px; height: 34px; }
.sidebar .logo small { display: block; font-family: "Inter"; font-weight: 600; font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; color: #8FA5BA; }
.sidebar nav a, .sidebar .link-btn { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 10px; color: #C9D6E2; font-weight: 600; text-decoration: none; position: relative; width: 100%; background: none; border: 0; font: inherit; cursor: pointer; text-align: left; }
.sidebar nav a:hover, .sidebar .link-btn:hover { background: rgba(255,255,255,.06); color: #fff; }
.sidebar nav a.active { background: rgba(93,173,226,.16); color: #fff; }
.sidebar nav a.active::before { content: ""; position: absolute; left: -14px; top: 8px; bottom: 8px; width: 4px; border-radius: 0 4px 4px 0; background: var(--grad); }
.sidebar svg { width: 19px; height: 19px; flex: none; }
.sidebar .bottom { margin-top: auto; border-top: 1px solid rgba(255,255,255,.08); padding-top: 12px; }
.sidebar .me { padding: 8px 12px 10px; font-size: .82rem; color: #8FA5BA; word-break: break-all; }
.sidebar .me b { display: block; color: #fff; font-size: .9rem; }

.main { min-width: 0; padding: 26px clamp(16px, 3vw, 36px) 48px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.topbar .crumbs { font-size: .82rem; color: var(--text-muted); margin-bottom: 4px; }
.topbar .crumbs a { color: var(--text-sub); }
.mobile-bar { display: none; }

/* Cartes / grilles */
.grid { display: grid; gap: 16px; }
.kpis { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); margin-bottom: 16px; }
.cols-2 { grid-template-columns: 1.6fr 1fr; }
.cols-2e { grid-template-columns: 1fr 1fr; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; min-width: 0; }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.panel-head p { margin: 2px 0 0; color: var(--text-sub); font-size: .85rem; }
.panel.flush { padding: 0; overflow: hidden; }
.panel.flush .panel-head { padding: 18px 20px 0; }

.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; position: relative; overflow: hidden; }
.kpi .label { font-size: .8rem; font-weight: 600; color: var(--text-sub); }
.kpi .value { font-family: "Montserrat"; font-weight: 800; font-size: 1.55rem; color: var(--navy-dark); margin-top: 4px; font-variant-numeric: tabular-nums; }
.kpi .hint { font-size: .78rem; color: var(--text-muted); margin-top: 2px; }
.kpi.accent::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--grad); }

/* Boutons & formulaires */
.btn { display: inline-flex; align-items: center; gap: 7px; padding: 9px 15px; border-radius: 10px; font: inherit; font-weight: 700; border: 1px solid transparent; cursor: pointer; text-decoration: none !important; white-space: nowrap; }
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-dark); }
.btn-ghost { background: var(--surface); color: var(--navy); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--blue); }
.btn-danger { background: var(--bad-bg); color: var(--bad); border-color: #F6C7C2; }
.btn-danger:hover { background: #FAD9D5; }
.btn-sm { padding: 5px 10px; font-size: .82rem; border-radius: 8px; }
.btn-link { background: none; border: 0; padding: 0; color: var(--d-main); font: inherit; font-weight: 600; cursor: pointer; }
.btn-link.danger { color: var(--bad); }

label { display: block; font-weight: 600; font-size: .84rem; color: var(--text-sub); margin-bottom: 5px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=search], select {
  width: 100%; padding: 9px 12px; border: 1px solid var(--border); border-radius: 10px; font: inherit; color: var(--text); background: #fff; min-height: 40px;
}
input:focus, select:focus, .btn:focus-visible, a:focus-visible, .bar:focus-visible { outline: 3px solid rgba(47,143,208,.35); outline-offset: 1px; border-color: var(--d-main); }
.field { margin-bottom: 14px; }
.field .err, .errorlist { color: var(--bad); font-size: .82rem; margin: 4px 0 0; padding: 0; list-style: none; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.form-grid .full { grid-column: 1 / -1; }
.inline-form { display: inline-flex; gap: 6px; align-items: center; margin: 0; }
.inline-form select { min-height: 32px; padding: 4px 8px; width: auto; font-size: .85rem; }

/* Filtres (une ligne au-dessus des données) */
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-bottom: 16px; }
.filters .f { display: flex; flex-direction: column; min-width: 140px; flex: 1 1 140px; }
.filters .f.grow { flex: 2 1 220px; }
.filters label { margin-bottom: 4px; font-size: .76rem; }
.filters .actions { display: flex; gap: 8px; }

/* Tableaux */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: .74rem; letter-spacing: .05em; text-transform: uppercase; color: var(--text-muted); font-weight: 700; padding: 10px 14px; border-bottom: 1px solid var(--border); background: var(--surface-2); white-space: nowrap; }
td { padding: 11px 14px; border-bottom: 1px solid var(--grid); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #FAFCFE; }
td .strong { font-weight: 700; color: var(--navy-dark); }
.plate { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-weight: 700; letter-spacing: .04em; color: var(--navy-dark); }
.empty { padding: 32px 20px; text-align: center; color: var(--text-muted); }

/* Badges (statut : icône + libellé, jamais la couleur seule) */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: .76rem; font-weight: 700; white-space: nowrap; }
.badge::before { font-size: .7rem; }
.b-ok { background: var(--ok-bg); color: var(--ok); }
.b-ok::before { content: "●"; }
.b-done { background: var(--info-bg); color: var(--info); }
.b-done::before { content: "✓"; }
.b-off { background: var(--bad-bg); color: var(--bad); }
.b-off::before { content: "✕"; }
.b-role { background: #EAF0F5; color: var(--navy); }
.b-super { background: var(--navy); color: #fff; }
.veh { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.veh::before { content: ""; width: 9px; height: 9px; border-radius: 3px; background: var(--d-moto); }
.veh.voiture::before { background: var(--d-voiture); }

/* Messages */
.messages { list-style: none; padding: 0; margin: 0 0 18px; display: grid; gap: 8px; }
.messages li { padding: 11px 14px; border-radius: 10px; font-weight: 600; background: var(--info-bg); color: var(--info); }
.messages li.success { background: var(--ok-bg); color: var(--ok); }
.messages li.error { background: var(--bad-bg); color: var(--bad); }

/* Graphique colonnes (une série) */
.chart { display: grid; grid-template-columns: auto 1fr; gap: 0 10px; }
.chart .y { display: flex; flex-direction: column; justify-content: space-between; height: 200px; font-size: .72rem; color: var(--text-muted); text-align: right; font-variant-numeric: tabular-nums; }
.chart .y span { transform: translateY(-50%); }
.chart .y span:last-child { transform: translateY(50%); }
.chart .plot { position: relative; height: 200px; display: flex; align-items: flex-end; gap: 2px; border-bottom: 1px solid #C9D6E2;
  background: linear-gradient(var(--grid), var(--grid)) 0 0 / 100% 1px no-repeat, linear-gradient(var(--grid), var(--grid)) 0 50% / 100% 1px no-repeat; }
.bar { flex: 1; position: relative; height: 100%; display: flex; align-items: flex-end; justify-content: center; cursor: default; outline: none; }
.bar i { display: block; width: 100%; max-width: 24px; background: var(--d-main); border-radius: 4px 4px 0 0; min-height: 0; transition: opacity .15s; }
.bar i.zero { min-height: 2px; background: #D5E0EA; border-radius: 1px; }
.plot:hover .bar i, .plot:focus-within .bar i { opacity: .45; }
.plot .bar:hover i, .plot .bar:focus i { opacity: 1; }
.bar .tip { position: absolute; bottom: calc(100% + 8px); left: 50%; translate: -50% 0; background: var(--navy-dark); color: #fff; padding: 7px 10px; border-radius: 8px; font-size: .76rem; white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity .12s; z-index: 5; line-height: 1.35; }
.bar .tip b { display: block; font-size: .86rem; }
.bar:hover .tip, .bar:focus .tip { opacity: 1; }
.bar.first .tip { left: 0; translate: 0 0; }
.bar.last .tip { left: auto; right: 0; translate: 0 0; }
.bar .tip { bottom: calc(var(--h, 0%) + 8px); }
.chart .x { grid-column: 2; display: flex; justify-content: space-between; font-size: .72rem; color: var(--text-muted); margin-top: 6px; }
details.data-table { margin-top: 12px; font-size: .85rem; }
details.data-table summary { cursor: pointer; color: var(--text-sub); font-weight: 600; }
details.data-table table { margin-top: 8px; }
details.data-table td, details.data-table th { padding: 5px 10px; }

/* Barres horizontales (répartition / classement) */
.hbars { display: grid; gap: 14px; }
.hbar .row { display: flex; justify-content: space-between; gap: 10px; font-size: .86rem; margin-bottom: 6px; }
.hbar .row b { color: var(--navy-dark); }
.hbar .track { height: 10px; background: var(--grid); border-radius: 5px; overflow: hidden; }
.hbar .fill { height: 100%; border-radius: 0 4px 4px 0; background: var(--d-main); }
.hbar .fill.moto { background: var(--d-moto); }
.hbar .fill.voiture { background: var(--d-voiture); }
.legend { display: flex; gap: 16px; font-size: .8rem; color: var(--text-sub); margin-bottom: 12px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

/* Pagination */
.pager { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--border); font-size: .85rem; color: var(--text-sub); flex-wrap: wrap; }
.pager .links { display: flex; gap: 6px; }

/* Modale (dialog) */
dialog { border: 0; border-radius: 16px; padding: 0; width: min(560px, calc(100% - 32px)); box-shadow: 0 30px 80px -20px rgba(34,52,74,.45); }
dialog::backdrop { background: rgba(34,52,74,.45); }
dialog .d-head { padding: 18px 22px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
dialog .d-body { padding: 20px 22px 6px; }
dialog .d-foot { padding: 14px 22px 20px; display: flex; justify-content: flex-end; gap: 8px; }
.x-btn { background: none; border: 0; font-size: 1.4rem; line-height: 1; cursor: pointer; color: var(--text-muted); }

/* Connexion */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: radial-gradient(800px 420px at 90% 0%, #E5F3FB, transparent 60%), radial-gradient(600px 360px at 0% 100%, #FFF3DF, transparent 60%), var(--bg); }
.auth-card { width: min(420px, 100%); background: #fff; border: 1px solid var(--border); border-radius: 20px; padding: 32px 30px; box-shadow: 0 30px 60px -30px rgba(34,52,74,.35); }
.auth-card img { height: 54px; width: auto; margin: 0 auto 18px; display: block; }
.auth-card h1 { text-align: center; font-size: 1.2rem; }
.auth-card p.sub { text-align: center; margin: 6px 0 22px; font-size: .9rem; }
.auth-card .btn { width: 100%; justify-content: center; padding: 11px; }
.auth-foot { text-align: center; margin-top: 18px; font-size: .85rem; }
.form-error { background: var(--bad-bg); color: var(--bad); padding: 10px 12px; border-radius: 10px; font-weight: 600; font-size: .86rem; margin-bottom: 14px; }

/* Responsive */
@media (max-width: 1100px) { .cols-2, .cols-2e { grid-template-columns: 1fr; } }
@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 260px; z-index: 40; transform: translateX(-100%); transition: transform .2s; }
  .sidebar.open { transform: none; box-shadow: 0 0 0 100vmax rgba(34,52,74,.45); }
  .mobile-bar { display: flex; align-items: center; justify-content: space-between; background: var(--navy-dark); color: #fff; padding: 10px 16px; position: sticky; top: 0; z-index: 30; }
  .mobile-bar img { height: 30px; }
  .mobile-bar button { background: none; border: 0; color: #fff; cursor: pointer; padding: 4px; }
  .mobile-bar svg { width: 26px; height: 26px; }
  .form-grid { grid-template-columns: 1fr; }
  .hide-sm { display: none; }
}

/* Changement de rôle */
.role-options { display: grid; gap: 10px; }
.role-opt { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; cursor: pointer; margin: 0; font-weight: 400; color: var(--text-sub); font-size: .86rem; }
.role-opt b { display: block; color: var(--navy-dark); font-size: .95rem; margin-bottom: 2px; }
.role-opt input { margin-top: 4px; accent-color: var(--navy); }
.role-opt:has(input:checked) { border-color: var(--d-main); background: var(--info-bg); }
.role-warn { margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: var(--warn-bg); color: var(--warn); font-weight: 600; font-size: .85rem; }
.profile { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px 20px; }
.profile dt { font-size: .76rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; }
.profile dd { margin: 2px 0 0; color: var(--navy-dark); font-weight: 600; word-break: break-word; }

/* Boîte mail */
.nav-count { margin-left: auto; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 11px; background: var(--grad); color: #22344A; font-size: .74rem; font-weight: 800; display: inline-grid; place-items: center; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.tabs a { padding: 7px 14px; border-radius: 999px; font-weight: 600; color: var(--text-sub); background: var(--surface); border: 1px solid var(--border); text-decoration: none; font-size: .88rem; }
.tabs a span { color: var(--text-muted); margin-left: 4px; font-variant-numeric: tabular-nums; }
.tabs a.active { background: var(--navy); border-color: var(--navy); color: #fff; }
.tabs a.active span { color: #C9D6E2; }
.b-sub { background: #FFF3DF; color: #9A5B00; }
.mail-list { list-style: none; margin: 0; padding: 0; }
.mail-list li { border-bottom: 1px solid var(--grid); }
.mail-list li:last-child { border-bottom: 0; }
.mail-list a { display: flex; gap: 12px; align-items: flex-start; padding: 14px 20px; color: inherit; text-decoration: none; }
.mail-list a:hover { background: #FAFCFE; }
.mail-dot { width: 9px; height: 9px; border-radius: 50%; margin-top: 7px; flex: none; background: transparent; }
.mail-list li.unread .mail-dot { background: var(--d-main); }
.mail-list li.unread b { font-weight: 800; }
.mail-main { flex: 1; min-width: 0; display: grid; gap: 2px; }
.mail-top { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; color: var(--navy-dark); }
.mail-top b { font-weight: 600; }
.mail-meta { font-size: .8rem; color: var(--text-muted); }
.mail-excerpt { font-size: .88rem; color: var(--text-sub); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-list li.unread .mail-excerpt { color: var(--text); }
.mail-date { font-size: .8rem; color: var(--text-muted); }
.mail-list li.unread .mail-date { color: var(--navy-dark); font-weight: 700; }
.mail-body { font-size: .98rem; line-height: 1.7; color: var(--text); white-space: normal; word-break: break-word; }
textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; font: inherit; color: var(--text); resize: vertical; }
textarea:focus { outline: 3px solid rgba(47,143,208,.35); border-color: var(--d-main); }
.plain-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: .86rem; }

/* ───────── Interactions ───────── */
.b-warn { background: var(--warn-bg); color: var(--warn); }
.b-warn::before { content: "⏸"; }
.row-muted td { color: var(--text-muted); }
.row-muted .plate { color: var(--text-sub); text-decoration: line-through; text-decoration-color: rgba(154,91,0,.5); }
tr[data-href], tr[data-select-row] { cursor: pointer; }
thead th { position: sticky; top: 0; z-index: 2; }

/* Cases à cocher */
.col-check { width: 44px; padding-right: 0 !important; }
input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--navy); cursor: pointer; vertical-align: middle; }
tbody tr.is-selected td { background: #EDF6FD !important; }
.mail-list li { position: relative; }
.mail-list li.is-selected { background: #EDF6FD; }
.mail-check { position: absolute; left: 18px; top: 18px; z-index: 1; }
.mail-list a { padding-left: 50px; }
.mail-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 20px; border-bottom: 1px solid var(--border); background: var(--surface-2); font-size: .82rem; flex-wrap: wrap; }
.check-label { display: inline-flex; align-items: center; gap: 8px; margin: 0; font-weight: 600; color: var(--text-sub); cursor: pointer; font-size: .82rem; }
.table-tip { padding: 9px 16px; font-size: .78rem; border-bottom: 1px solid var(--grid); }
kbd { font-family: ui-monospace, Consolas, monospace; font-size: .72rem; padding: 1px 5px; border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 4px; background: #fff; color: var(--text-sub); }

/* Barre d'actions de groupe */
.bulk-bar { position: fixed; left: var(--sidebar); right: 0; margin-inline: auto; width: max-content; bottom: 20px; z-index: 35; display: flex; align-items: center; gap: 14px 18px; flex-wrap: wrap; justify-content: center;
  background: var(--navy-dark); color: #fff; padding: 10px 12px 10px 20px; border-radius: 16px; box-shadow: 0 20px 50px -12px rgba(34,52,74,.55); max-width: calc(100vw - var(--sidebar) - 32px); animation: bulk-in .18s ease-out; }
.bulk-bar[hidden] { display: none; }
@keyframes bulk-in { from { opacity: 0; transform: translateY(14px); } }
.bulk-info { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.bulk-info b { font-variant-numeric: tabular-nums; white-space: nowrap; }
.bulk-info .btn-link { color: #9FD0F2; font-size: .85rem; text-decoration: underline; }
.bulk-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.bulk-bar .btn-ghost { background: rgba(255,255,255,.08); color: #fff; border-color: rgba(255,255,255,.18); }
.bulk-bar .btn-ghost:hover { background: rgba(255,255,255,.16); border-color: rgba(255,255,255,.3); }
.bulk-bar .btn-danger { background: #E9583D; color: #fff; border-color: #E9583D; }
.bulk-bar .btn-danger:hover { background: #D4452B; }
.bulk-bar .btn-primary { background: #fff; color: var(--navy-dark); }
.bulk-bar .btn:disabled { opacity: .38; cursor: not-allowed; }
.bulk-n:not(:empty) { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: rgba(255,255,255,.18); font-size: .72rem; margin-left: 2px; }
.bulk-bar .btn-primary .bulk-n:not(:empty) { background: var(--info-bg); }
.bulk-clear { background: transparent; color: #C9D6E2; border: 0; font-size: 1rem; padding: 6px 10px; }
.bulk-clear:hover { color: #fff; }
body.has-bulk .main { padding-bottom: 110px; }

/* Puces de filtres actifs + raccourcis */
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: -4px 0 16px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px 5px 12px; border-radius: 999px; background: var(--info-bg); color: var(--info); font-size: .8rem; font-weight: 600; text-decoration: none !important; }
.chip span { font-size: 1rem; line-height: 1; opacity: .7; }
.chip:hover { background: #D5EBF9; }
.chip:hover span { opacity: 1; }
.chip-clear { background: transparent; color: var(--text-sub); }
.chip-clear:hover { background: var(--grid); }
.quick { display: flex; gap: 6px; flex-wrap: wrap; margin: -8px 0 14px; }
.quick a { font-size: .82rem; font-weight: 600; padding: 5px 12px; border-radius: 999px; border: 1px dashed var(--border); color: var(--text-sub); text-decoration: none; }
.quick a:hover { border-style: solid; border-color: var(--d-main); color: var(--d-main); }
.quick a.on { border-style: solid; background: var(--navy); border-color: var(--navy); color: #fff; }

/* KPI cliquables */
a.kpi-link { display: block; color: inherit; text-decoration: none !important; transition: border-color .15s, box-shadow .15s, transform .15s; }
a.kpi-link:hover { border-color: var(--blue); box-shadow: 0 10px 24px -16px rgba(34,52,74,.45); transform: translateY(-1px); }
a.kpi-link .hint { color: var(--text-muted); }
a.kpi-link:hover .hint { color: var(--d-main); }

/* Graphique : barres-liens */
a.bar { text-decoration: none; cursor: pointer; }
.bar .tip small { display: block; opacity: .7; font-size: .7rem; margin-top: 2px; }

/* Copier la référence */
.copy-chip { font: inherit; font-variant-numeric: tabular-nums; background: none; border: 1px dashed transparent; border-radius: 6px; padding: 2px 6px; margin: -2px -6px; color: inherit; cursor: copy; }
.copy-chip:hover { border-color: var(--border); background: var(--surface-2); }

/* Boutons en cours d'envoi */
.btn.is-loading { position: relative; color: transparent !important; pointer-events: none; }
.btn.is-loading::after { content: ""; position: absolute; inset: 0; margin: auto; width: 16px; height: 16px; border-radius: 50%; border: 2px solid; border-color: rgba(255,255,255,.9) rgba(255,255,255,.9) transparent transparent; animation: spin .7s linear infinite; }
.btn-ghost.is-loading::after, .btn-danger.is-loading::after { border-color: var(--navy) var(--navy) transparent transparent; }
.bulk-bar .btn.is-loading::after { border-color: #fff #fff transparent transparent; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Notifications */
.toasts { position: fixed; top: 18px; right: 18px; z-index: 60; display: grid; gap: 8px; width: min(380px, calc(100vw - 32px)); }
.toast { display: flex; align-items: flex-start; gap: 10px; padding: 12px 12px 12px 14px; border-radius: 12px; background: #fff; border: 1px solid var(--border); box-shadow: 0 16px 40px -16px rgba(34,52,74,.45); font-weight: 600; font-size: .88rem; color: var(--text); animation: toast-in .22s ease-out; }
.toast.out { opacity: 0; transform: translateX(16px); transition: opacity .25s, transform .25s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } }
.toast-icon { flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: .75rem; color: #fff; background: var(--info); }
.toast-icon::before { content: "i"; font-weight: 800; }
.toast.success .toast-icon { background: var(--ok); }
.toast.success .toast-icon::before { content: "✓"; }
.toast.error .toast-icon { background: var(--bad); }
.toast.error .toast-icon::before { content: "!"; }
.toast-text { flex: 1; padding-top: 2px; }
.toast-x { background: none; border: 0; font-size: 1.2rem; line-height: 1; color: var(--text-muted); cursor: pointer; padding: 0 2px; }
.toast-x:hover { color: var(--text); }

/* Confirmation */
.dlg-confirm { width: min(440px, calc(100% - 32px)); }
.dlg-confirm .d-body p { color: var(--text-sub); line-height: 1.55; }

/* Connexion : mot de passe */
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 84px; }
.pw-toggle { position: absolute; right: 6px; top: 50%; translate: 0 -50%; background: none; border: 0; font: inherit; font-size: .8rem; font-weight: 700; color: var(--d-main); cursor: pointer; padding: 6px 8px; border-radius: 8px; }
.pw-toggle:hover { background: var(--info-bg); }
.caps-warn { margin: 6px 0 0; font-size: .8rem; font-weight: 600; color: var(--warn); }

@media (max-width: 860px) {
  .bulk-bar { left: 12px; right: 12px; width: auto; max-width: none; bottom: 12px; padding: 10px 12px; }
  .toasts { top: auto; bottom: 16px; right: 12px; }
  body.has-bulk .toasts { bottom: 150px; }
}
@media (prefers-reduced-motion: reduce) { .bulk-bar, .toast { animation: none; } .btn.is-loading::after { animation-duration: 2s; } }
