/*
 * Tableau de bord admin + call center, identite ToGo.
 * Mise en page issue de mockups/admin-01-03-togo-refonte.html (validee le 26/09/2026).
 * Tout est en proprietes logiques (inline-start / inline-end) pour que l'arabe
 * passe en RTL sans feuille de style separee.
 */

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-latin);
  font-size: var(--text-sm);
  line-height: 1.5;
  color: var(--ink-900);
  background: var(--surface-alt);
}

body[dir='rtl'] {
  font-family: var(--font-arabic);
  line-height: 1.7;
}

[hidden] {
  display: none !important;
}

/* Icones du menu et des compteurs : un trait, la couleur du texte. */
.icon {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

/* ---------------------------------------------------------------- Logo ToGo */
/*
 * « ToGo » est un logotype : il reste en lettres latines et de gauche a droite,
 * meme en arabe. On ne translittere pas une marque.
 */
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  direction: ltr;
}

.logo-mark {
  width: 46px;
  height: auto;
  flex-shrink: 0;
  display: block;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.25));
}

/* Sur la page de connexion, le logo du client est mis en avant. */
.login-art .logo .logo-mark {
  width: 88px;
}

.login-art .logo .logo-name {
  font-size: 30px;
}

.login-logo .logo-mark {
  width: 64px;
}

.logo-word {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.logo-name {
  font-family: var(--font-latin);
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -0.02em;
  color: #fff;
}

.logo-name i {
  font-style: normal;
  color: var(--brand-300);
}

.logo-tag {
  font-family: var(--font-latin);
  font-size: 8.5px;
  letter-spacing: 0.16em;
  color: #a39c90;
  margin-top: 4px;
  font-weight: 600;
}

/* ---------------------------------------------------------------- Connexion */
.login-screen {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
}

.login-art {
  background: var(--accent-600);
  color: #fff;
  padding: 44px;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.login-art .rings {
  position: absolute;
  inset-inline-end: -140px;
  top: 60px;
  width: 460px;
  height: 460px;
}

.login-art .headline {
  margin-top: auto;
  font-size: var(--text-2xl);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  max-width: 440px;
  position: relative;
}

.login-art .headline i {
  font-style: normal;
  color: var(--brand-300);
}

.login-art p {
  color: #a39c90;
  max-width: 400px;
  position: relative;
}

.login-form {
  background: var(--surface);
  display: grid;
  place-items: center;
  padding: 40px var(--space-4);
}

.login-card {
  width: 100%;
  max-width: 360px;
}

.login-card .lang-switch {
  margin-bottom: 36px;
}

/* Logo sur fond clair : il n'apparait que lorsque le panneau noir est masque. */
.login-logo {
  display: none;
  margin-bottom: 32px;
}

.logo.on-light .logo-name {
  color: var(--ink-900);
}

.logo.on-light .logo-name i {
  color: var(--brand-500);
}

.logo.on-light .logo-tag {
  color: var(--ink-500);
}

.login-card h2 {
  margin: 0 0 4px;
  font-size: 24px;
}

.login-card .subtitle {
  color: var(--ink-500);
  margin-bottom: 28px;
}

.note-sim {
  margin-top: var(--space-5);
  font-size: 12.5px;
  color: var(--brand-700);
  background: var(--brand-100);
  border: 1px dashed var(--brand-300);
  border-radius: 10px;
  padding: 10px 12px;
}

/* ------------------------------------------------------------------ Coquille */
.shell {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: var(--accent-600);
  color: #c9c3b8;
  display: flex;
  flex-direction: column;
  padding: 20px 12px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar .logo {
  padding: 0 8px 24px;
}

.sidebar nav {
  flex: 1;
  overflow-y: auto;
}

.nav-group {
  margin-bottom: 18px;
}

.nav-group .title {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #7d766b;
  padding: 0 10px 6px;
  font-weight: 600;
}

body[dir='rtl'] .nav-group .title {
  letter-spacing: 0;
}

.sidebar nav a {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 8px 10px;
  border-radius: 9px;
  color: inherit;
  text-decoration: none;
  font-weight: 500;
}

.sidebar nav a .icon {
  opacity: 0.85;
}

.sidebar nav a:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.sidebar nav a.active {
  background: var(--brand-500);
  color: #fff;
  font-weight: 600;
}

.sidebar nav a.active .icon {
  opacity: 1;
}

.sidebar nav a .count {
  margin-inline-start: auto;
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  border-radius: var(--radius-pill);
  padding: 0 7px;
  line-height: 18px;
}

.sidebar .foot {
  padding: 12px 10px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--brand-100);
  color: var(--brand-700);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
}

.sidebar .foot .who {
  line-height: 1.25;
  min-width: 0;
}

.sidebar .foot .who b {
  color: #fff;
  font-weight: 600;
  display: block;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar .foot .who span {
  font-size: 12px;
  color: #8f887c;
}

.sidebar .foot button {
  margin-inline-start: auto;
  background: none;
  border: 0;
  color: #8f887c;
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
}

.sidebar .foot button:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: 18px 28px;
  background: var(--surface);
  border-bottom: 1px solid var(--ink-100);
}

.topbar h1 {
  margin: 0;
  font-size: var(--text-lg);
  font-weight: 700;
}

.topbar .sub {
  color: var(--ink-500);
  font-size: 13px;
}

.topbar .right {
  margin-inline-start: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

.workshop-pill {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--brand-700);
  background: var(--brand-100);
  border: 1px dashed var(--brand-300);
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}

.content {
  padding: var(--space-5) 28px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* -------------------------------------------------------------- Composants */
.btn {
  font: inherit;
  font-weight: 600;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 10px var(--space-4);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  text-decoration: none;
}

.btn:hover:not(:disabled) {
  filter: brightness(0.95);
}

.btn:disabled {
  background: var(--ink-100);
  color: var(--ink-300);
  cursor: not-allowed;
}

.btn-primary {
  background: var(--brand-500);
  color: #fff;
}

.btn-secondary {
  background: var(--brand-100);
  color: var(--brand-900);
}

.btn-ghost {
  background: var(--surface-sunk);
  color: var(--ink-700);
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12.5px;
  border-radius: 8px;
}

.btn-block {
  width: 100%;
}

.btn-lg {
  padding: 13px;
  font-size: var(--text-md);
}

.field {
  margin-bottom: var(--space-4);
}

.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
}

.field input,
.field select {
  width: 100%;
  font: inherit;
  font-size: 15px;
  padding: 11px 14px;
  border: 1px solid var(--ink-100);
  border-radius: 10px;
  background: var(--surface-alt);
  color: inherit;
}

.field input:focus,
.field select:focus {
  outline: 2px solid var(--brand-300);
  border-color: var(--brand-500);
  background: var(--surface);
}

.field .help {
  font-size: var(--text-xs);
  color: var(--ink-500);
  margin-top: var(--space-1);
}

.card {
  background: var(--surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  padding: 20px;
}

.card h2 {
  font-size: 15px;
  font-weight: 700;
  margin: 0 0 var(--space-3);
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: 14px;
}

.card-head h2 {
  margin: 0;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--text-xs);
  font-weight: 600;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}

.badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

/* Vert et rouge sont des couleurs d'action : en ligne / actif, arret / bloque. */
.badge-active,
.badge-approved,
.badge-online {
  background: #e3f3ea;
  color: var(--success);
}

.badge-ride {
  background: var(--brand-100);
  color: var(--brand-700);
}

.badge-pending,
.badge-warning {
  background: var(--brand-100);
  color: var(--brand-700);
}

.badge-suspended,
.badge-rejected,
.badge-wait {
  background: #fde8e8;
  color: #c22d33;
}

.badge-offline,
.badge-neutral {
  background: var(--surface-sunk);
  color: var(--ink-500);
}

.badge-shared {
  background: #e4eef8;
  color: var(--info);
}

.badge-simulated {
  background: repeating-linear-gradient(
    45deg,
    var(--accent-100),
    var(--accent-100) 6px,
    #fff8ec 6px,
    #fff8ec 12px
  );
  color: var(--accent-600);
}

/* ---------------------------------------------------------------- Compteurs */
.kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: var(--space-4);
}

.kpi {
  background: var(--surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  padding: 18px 20px;
}

.kpi .top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.kpi .label {
  color: var(--ink-500);
  font-size: 13px;
  font-weight: 500;
}

.kpi .ico {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
}

.kpi .value {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-top: var(--space-2);
  font-variant-numeric: tabular-nums;
}

.kpi .value small {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--ink-500);
  margin-inline-start: 4px;
}

.kpi .foot-line {
  font-size: var(--text-xs);
  color: var(--ink-500);
  margin-top: 2px;
}

.ico.gold { background: var(--brand-100); color: var(--brand-700); }
.ico.green { background: #e3f3ea; color: var(--success); }
.ico.blue { background: #e4eef8; color: var(--info); }
.ico.red { background: #fde8e8; color: var(--danger); }

.grid-2 {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

/* ----------------------------------------------------------------- Tableaux */
table {
  width: 100%;
  border-collapse: collapse;
}

th {
  text-align: start;
  color: var(--ink-500);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  padding: 0 12px 10px;
  white-space: nowrap;
}

body[dir='rtl'] th {
  letter-spacing: 0;
}

td {
  padding: 11px 12px;
  border-top: 1px solid var(--ink-100);
  vertical-align: middle;
}

tbody tr:hover {
  background: var(--surface-alt);
}

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

.person {
  display: flex;
  align-items: center;
  gap: 10px;
}

.person .avatar {
  width: 30px;
  height: 30px;
  font-size: 11.5px;
}

.amount {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.amount.neg {
  color: var(--danger);
}

.amount.pos {
  color: var(--success);
}

.toolbar {
  display: flex;
  gap: var(--space-3);
  align-items: end;
  flex-wrap: wrap;
}

.toolbar .field {
  margin: 0;
  min-width: 190px;
}

.toolbar .field input,
.toolbar .field select {
  background: var(--surface);
  font-size: var(--text-sm);
  padding: 9px 12px;
}

/* ------------------------------------------------------------------ Onglets */
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 5px;
  background: var(--surface-sunk);
  border-radius: 12px;
  width: fit-content;
  max-width: 100%;
}

.tabs button,
.tabs a {
  border: 0;
  background: none;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 8px;
  color: var(--ink-500);
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}

.tabs .on {
  background: var(--surface);
  color: var(--ink-900);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.tabs .b {
  background: var(--danger);
  color: #fff;
  border-radius: var(--radius-pill);
  padding: 0 6px;
  font-size: 11px;
  margin-inline-start: 4px;
}

/* ---------------------------------------------------------- Langue, alertes */
.lang-switch {
  display: inline-flex;
  background: var(--surface-sunk);
  border-radius: var(--radius-pill);
  padding: 3px;
}

.lang-switch button {
  border: 0;
  background: none;
  font: inherit;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--ink-500);
  padding: 4px 11px;
  border-radius: var(--radius-pill);
  cursor: pointer;
}

.lang-switch button.active {
  background: var(--surface);
  color: var(--ink-900);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.alert {
  padding: var(--space-3) var(--space-4);
  border-radius: 10px;
  font-size: var(--text-sm);
  border-inline-start: 4px solid;
}

.alert-error {
  background: #fde8e8;
  border-color: var(--danger);
  color: #8e2a1f;
}

.alert-info {
  background: var(--brand-100);
  border-color: var(--brand-500);
  color: var(--brand-900);
}

.empty {
  text-align: center;
  color: var(--ink-500);
  font-size: var(--text-sm);
  padding: var(--space-6);
}

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

td .muted {
  font-size: var(--text-xs);
}

.diff {
  font-family: ui-monospace, 'Cascadia Code', Consolas, monospace;
  font-size: var(--text-xs);
  white-space: pre-wrap;
  word-break: break-word;
}

.diff .before {
  color: var(--danger);
}

.diff .after {
  color: var(--success);
}

.setting-value {
  display: flex;
  gap: var(--space-2);
  align-items: center;
}

.setting-value input,
.setting-value select {
  width: 130px;
  font: inherit;
  padding: 6px var(--space-2);
  border: 1px solid var(--ink-100);
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
}

/* ------------------------------------------------------ Fil d'activite */
.feed {
  display: flex;
  flex-direction: column;
}

.feed-item {
  display: flex;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--ink-100);
}

.feed-item:first-child {
  border-top: 0;
  padding-top: 0;
}

.feed-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: 7px;
  flex-shrink: 0;
}

.feed-item .txt {
  flex: 1;
}

.feed-item .time {
  color: var(--ink-500);
  font-size: var(--text-xs);
  white-space: nowrap;
}

/* ---------------------------------------------------------------- Carte live */
.live {
  position: relative;
  height: calc(100vh - 150px);
  min-height: 520px;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  background: var(--surface-sunk);
}

.live #map {
  position: absolute;
  inset: 0;
}

.overlay-kpis {
  position: absolute;
  top: 16px;
  /* Le zoom de la carte occupe le coin : les compteurs se posent a cote. */
  inset-inline-start: 64px;
  display: flex;
  gap: 10px;
  z-index: 500;
  flex-wrap: wrap;
  max-width: calc(100% - 400px);
}

.chip {
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(6px);
  border-radius: 12px;
  padding: 10px 14px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  gap: 10px;
}

.chip .n {
  font-size: var(--text-lg);
  font-weight: 800;
}

.chip .l {
  font-size: var(--text-xs);
  color: var(--ink-500);
  line-height: 1.2;
  max-width: 90px;
}

.chip .d {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.map-filters {
  position: absolute;
  bottom: 24px;
  inset-inline-start: 16px;
  display: flex;
  gap: 6px;
  z-index: 500;
  flex-wrap: wrap;
}

.map-filters button {
  border: 0;
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  padding: 7px 13px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.96);
  color: var(--ink-700);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  cursor: pointer;
}

.map-filters button.on {
  background: var(--accent-600);
  color: #fff;
}

.map-note {
  position: absolute;
  bottom: 70px;
  inset-inline-start: 16px;
  z-index: 500;
  font-size: var(--text-xs);
  background: rgba(255, 255, 255, 0.92);
  border-radius: 8px;
  padding: 4px 10px;
  color: var(--ink-500);
  max-width: 360px;
}

.panel {
  position: absolute;
  top: 16px;
  bottom: 16px;
  inset-inline-end: 16px;
  width: 330px;
  background: var(--surface);
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 500;
}

.panel .tabs {
  margin: 12px;
  width: auto;
}

.panel .tabs button {
  flex: 1;
  padding: 7px 6px;
  font-size: 12.5px;
}

.panel .list {
  overflow: auto;
  padding: 0 12px 12px;
  flex: 1;
}

.req {
  border: 1px solid var(--ink-100);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 10px;
  cursor: pointer;
}

.req:hover {
  border-color: var(--brand-300);
}

.req .row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.req .route {
  margin: 8px 0;
  font-size: 13px;
  display: grid;
  gap: 4px;
}

.req .route div {
  display: flex;
  align-items: center;
  gap: 8px;
}

.req .route i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* -------------------------------------------------------------- Responsive */
@media (max-width: 1100px) {
  .grid-2 {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 900px) {
  /* minmax(0, 1fr) : sans lui, la colonne prend la largeur du menu deroule. */
  .shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .sidebar {
    position: static;
    min-width: 0;
    height: auto;
    padding: 12px;
  }

  .sidebar .logo {
    padding-bottom: 12px;
  }

  .sidebar nav {
    display: flex;
    gap: 4px;
    overflow-x: auto;
  }

  .nav-group {
    display: flex;
    gap: 4px;
    margin: 0;
  }

  .nav-group .title,
  .sidebar .foot .who {
    display: none;
  }

  .sidebar nav a {
    white-space: nowrap;
  }

  .sidebar .foot {
    border: 0;
    padding: 8px 0 0;
  }

  .login-screen {
    grid-template-columns: 1fr;
  }

  .login-art {
    display: none;
  }

  .login-logo {
    display: flex;
  }

  .topbar,
  .content {
    padding-inline: var(--space-4);
  }

  .topbar {
    flex-wrap: wrap;
  }

  .workshop-pill {
    display: none;
  }

  .panel {
    position: static;
    width: auto;
    margin-top: 12px;
    max-height: 420px;
  }

  .live {
    height: 60vh;
  }

  .overlay-kpis {
    max-width: calc(100% - 32px);
  }
}

/* Histogramme des rapports : trois barres, pas de bibliotheque de graphiques. */
.chart {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 160px;
  padding-top: var(--space-3);
}

.chart-col {
  flex: 1;
  display: flex;
  flex-direction: column-reverse;
  align-items: stretch;
  gap: 2px;
  min-width: 10px;
  position: relative;
}

.chart-bar {
  border-radius: 2px 2px 0 0;
  min-height: 2px;
}

.chart-bar.private { background: var(--brand-500); }
.chart-bar.shared { background: var(--info); }

.chart-label {
  font-size: 10px;
  color: var(--ink-500);
  text-align: center;
  order: -1;
  margin-top: 4px;
}

/* Une plaque est un code : elle ne se lit jamais a l envers, meme en arabe. */
.plate {
  display: inline-block;
  border: 1px solid var(--ink-300);
  border-radius: 4px;
  padding: 1px 7px;
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.04em;
  direction: ltr;
  unicode-bidi: bidi-override;
}

.link {
  color: var(--brand-700);
  font-weight: 600;
  text-decoration: none;
  font-size: 13px;
}

.link:hover {
  text-decoration: underline;
}

/* Infobulle des marqueurs de la carte (Google Maps et Leaflet). */
.map-tip {
  font-family: var(--font-latin);
  font-size: 13px;
  line-height: 1.4;
}

body[dir='rtl'] .map-tip {
  font-family: var(--font-arabic);
}

/* Un conteneur de message vide ne doit pas creuser d'espace entre deux cartes. */
.content > div:empty {
  display: none;
}

/* La mention sous le logo se traduit (le nom ToGo, lui, reste latin). */
body[dir='rtl'] .sidebar .logo-tag {
  font-family: var(--font-arabic);
  letter-spacing: 0;
  font-size: 11px;
}

/* Dossier chauffeur et visionneuse des pieces : voir css/documents.css. */

/* --------------------------------------------------------- Fenetre de motif */
.reason-dialog {
  border: none;
  padding: 0;
  border-radius: var(--radius-lg);
  width: min(440px, calc(100vw - 32px));
  background: var(--surface);
  color: var(--ink-900);
  box-shadow: 0 24px 64px rgba(20, 18, 12, 0.28);
  animation: rd-in 0.18s ease-out;
}

.reason-dialog::backdrop {
  background: rgba(20, 18, 12, 0.45);
  backdrop-filter: blur(3px);
}

@keyframes rd-in {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

.rd-card {
  padding: var(--space-5);
}

.rd-head {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.rd-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--brand-100);
  color: var(--brand-700);
}

.rd-icon-danger {
  background: #fdecec;
  color: var(--danger);
}

.rd-title {
  margin: 0;
  font-size: var(--text-lg);
  line-height: 1.3;
}

.rd-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--ink-700);
  margin-bottom: var(--space-2);
}

.rd-label b {
  color: var(--danger);
}

.rd-input {
  width: 100%;
  box-sizing: border-box;
  font: inherit;
  resize: vertical;
  min-height: 84px;
  padding: var(--space-3);
  border: 1px solid var(--ink-100);
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
  color: var(--ink-900);
}

.rd-input:focus {
  outline: none;
  border-color: var(--brand-500);
  box-shadow: 0 0 0 3px var(--brand-100);
  background: var(--surface);
}

.rd-hint {
  margin: var(--space-2) 0 0;
  font-size: var(--text-xs);
  color: var(--ink-500);
}

.rd-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-2);
  margin-top: var(--space-5);
}

/* ------------------------------------------------- Pastilles de la carte live */
/* Photo ou initiales dans un anneau a la couleur du statut, avec une ombre de
   la meme couleur : on lit l'etat d'un chauffeur avant meme de lire son nom. */
.live-pin-host {
  background: none;
  border: none;
}

.live-pin {
  position: absolute;
  width: var(--pin-size);
  height: var(--pin-size);
  transform: translate(-50%, -50%);
  border-radius: 50%;
  padding: 3px;
  box-sizing: border-box;
  background: var(--pin);
  box-shadow:
    0 0 0 2px #fff,
    0 4px 14px color-mix(in srgb, var(--pin) 65%, transparent),
    0 0 22px color-mix(in srgb, var(--pin) 45%, transparent);
  cursor: pointer;
  transition: transform 0.15s ease;
}

/* Leaflet place deja l'icone : on annule le recentrage fait pour Google. */
.live-pin-host .live-pin {
  position: relative;
  transform: none;
}

.live-pin:hover {
  transform: translate(-50%, -50%) scale(1.12);
  z-index: 20 !important;
}

.live-pin-host .live-pin:hover {
  transform: scale(1.12);
}

.live-pin-face {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  background: #fff;
  color: var(--pin);
  font: 700 12px/1 var(--font-latin);
  letter-spacing: 0.02em;
}

.live-pin-face img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Client en attente : un halo qui bat, pour qu'on ne le rate pas. */
.live-pin-pulse::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid var(--pin);
  animation: live-pin-pulse 1.6s ease-out infinite;
  pointer-events: none;
}

@keyframes live-pin-pulse {
  from { transform: scale(1); opacity: 0.9; }
  to { transform: scale(1.7); opacity: 0; }
}
