:root {
  --bg: #f4f0e8;
  --panel: #fffdf8;
  --panel-soft: #f9f5ed;
  --line: #e3dacd;
  --text: #26251f;
  --muted: #766f64;
  --accent: #7d8f82;
  --accent-strong: #586b5d;
  --danger: #b42318;
  --warn: #af6f00;
  --ok: #28724f;
  --shadow: 0 18px 55px rgba(54, 45, 32, .08);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea {
  font: inherit;
  letter-spacing: 0;
}
button, .button {
  min-height: 38px;
  border: 1px solid var(--line);
  background: var(--panel-soft);
  color: var(--text);
  border-radius: 7px;
  padding: 8px 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}
button:hover, .button:hover { border-color: var(--accent); }
.primary {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
  color: white;
  font-weight: 700;
}
.danger {
  background: #fff6f4;
  border-color: #efb4ad;
  color: var(--danger);
}

.sidebar {
  position: fixed;
  inset: 20px auto 20px 20px;
  width: 270px;
  background: rgba(255, 253, 248, .88);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  backdrop-filter: blur(16px);
}
.brand {
  display: grid;
  grid-template-columns: 46px 1fr;
  column-gap: 12px;
  align-items: center;
  padding-bottom: 18px;
}
.brand-icon {
  grid-row: span 2;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7f8fb;
  overflow: hidden;
}
.brand-icon img {
  width: 100%;
  height: 100%;
  display: block;
}
.brand strong { font-size: 28px; line-height: 1; }
.brand small { color: var(--muted); font-weight: 600; }
nav {
  display: grid;
  gap: 6px;
  margin-top: 14px;
}
nav a {
  position: relative;
  min-height: 48px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  color: #37352f;
  font-weight: 700;
  text-align: center;
}
nav a.active, nav a:hover { background: #d5d8cc; }
.sidebar-assistant {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.sidebar-assistant strong {
  font-size: 13px;
  color: var(--muted);
  text-transform: uppercase;
}
.sidebar-assistant form {
  display: grid;
  gap: 7px;
}
.sidebar-assistant input {
  min-height: 36px;
  font-size: 13px;
}
.sidebar-assistant button {
  min-height: 34px;
  font-size: 13px;
}
.assistant-answer {
  display: grid;
  gap: 7px;
  max-height: 240px;
  overflow: auto;
  font-size: 12px;
}
.assistant-answer:empty { display: none; }
.assistant-answer p {
  color: var(--muted);
  line-height: 1.35;
  font-weight: 700;
}
.assistant-result {
  display: grid;
  gap: 2px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255, 253, 248, .8);
}
.assistant-result span {
  color: var(--muted);
  line-height: 1.25;
}
.assistant-actions {
  display: grid;
  gap: 6px;
}
.assistant-actions .button {
  min-height: 32px;
  font-size: 12px;
}
.logout { margin-top: auto; }
.logout button { width: 100%; color: #8d1f2d; background: #fff6f3; }
.sidebar-copyright {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-align: center;
}
.main {
  margin-left: 310px;
  padding: 36px 34px 54px;
}
.mobile-menu { display: none; }

.page-head {
  min-height: 72px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}
h1, h2, h3, p { margin: 0; }
h1 { font-size: 30px; line-height: 1.1; }
h2 { font-size: 18px; margin-bottom: 16px; }
h3 { font-size: 16px; margin-bottom: 8px; }
.page-head p, small, .muted { color: var(--muted); }
.head-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.head-actions form { margin: 0; }
.inline-select { min-width: 240px; }

.panel {
  background: rgba(255, 253, 248, .78);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  margin-bottom: 18px;
  box-shadow: 0 12px 36px rgba(75, 64, 45, .05);
}
.split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}
.stat-grid article {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
}
.stat-grid strong { display: block; font-size: 30px; }
.stat-grid span { color: var(--muted); font-weight: 700; }

.grid-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.compact-form {
  grid-template-columns: minmax(220px, 320px) minmax(140px, 180px);
  align-items: end;
}
label { display: grid; gap: 7px; font-weight: 700; }
label span { color: #625b50; font-size: 13px; }
input, select, textarea {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  background: #fffefa;
  color: var(--text);
  border-radius: 7px;
  padding: 9px 11px;
}
textarea { min-height: 96px; resize: vertical; }
.wide { grid-column: 1 / -1; }

html.time-picker-open {
  overflow: hidden;
}
.time-picker-backdrop {
  position: fixed;
  inset: 0;
  z-index: 4000;
  display: grid;
  place-items: start center;
  padding: max(76px, calc(env(safe-area-inset-top) + 42px)) 16px 16px;
  background: rgba(32, 31, 34, .42);
  backdrop-filter: blur(3px);
}
.time-picker-backdrop[hidden] {
  display: none;
}
.time-picker-card {
  width: min(318px, calc(100vw - 32px));
  color: #f8f4ff;
  background: #312d3c;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 18px;
  box-shadow: 0 22px 54px rgba(20, 16, 30, .36);
  padding: 16px 16px 14px;
}
.time-picker-title {
  color: rgba(248, 244, 255, .84);
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 8px;
}
.time-picker-fields {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px;
  align-items: start;
}
.time-picker-fields label {
  display: grid;
  gap: 5px;
  font-weight: 600;
}
.time-picker-fields label span {
  color: #cfc6df;
  font-size: 13px;
}
.time-picker-fields input {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  min-height: 76px;
  border: 2px solid transparent;
  border-radius: 8px;
  background: #3b3647 !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff;
  caret-color: #ffffff;
  font-size: 46px;
  line-height: 1;
  font-weight: 500;
  text-align: center;
  padding: 7px 6px;
  box-shadow: none;
  opacity: 1;
}
.time-picker-fields input::selection {
  background: #cbb7ff;
  color: #211c2c;
  -webkit-text-fill-color: #211c2c;
}
.time-picker-fields input:focus {
  outline: 0;
  border-color: #cbb7ff;
  box-shadow: 0 0 0 2px rgba(203, 183, 255, .15);
}
.time-picker-separator {
  color: #f8f4ff;
  font-size: 44px;
  line-height: 76px;
  font-weight: 700;
}
.time-picker-actions {
  display: grid;
  grid-template-columns: 42px 1fr auto;
  align-items: center;
  gap: 10px;
  margin-top: 15px;
}
.time-picker-actions button {
  min-height: 40px;
  border: 0;
  background: transparent;
  color: #d9c5ff;
  border-radius: 8px;
  font-weight: 800;
}
.time-picker-actions button:hover,
.time-picker-actions button:focus {
  background: rgba(255, 255, 255, .08);
  outline: 0;
}
.time-picker-clear {
  color: #f8f4ff !important;
  font-size: 21px;
  justify-self: start;
}
.check {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
}
.check input { width: auto; min-height: auto; }
.bus-change-option {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbf8f1;
  padding: 12px;
}
.bus-change-check {
  justify-content: flex-start;
  min-height: auto;
}
.bus-change-check span {
  color: var(--text);
}
.bus-change-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.bus-change-fields[hidden] {
  display: none;
}
.mysql-fields {
  display: none;
  grid-column: 1 / -1;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.mysql-fields.show { display: grid; }
.install-subsection {
  border-top: 1px solid var(--line);
  padding-top: 14px;
  margin-top: 6px;
}
.install-subsection h2 {
  margin: 0 0 6px;
  font-size: 18px;
}
.install-subsection p {
  margin: 0;
}

.table-panel { overflow: hidden; }
.filters {
  display: flex;
  gap: 10px;
  align-items: end;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.filters input { max-width: 260px; }
table {
  width: 100%;
  border-collapse: collapse;
}
th {
  color: var(--muted);
  text-align: left;
  font-size: 12px;
  text-transform: uppercase;
  padding: 10px;
}
td {
  border-top: 1px solid var(--line);
  padding: 12px 10px;
  vertical-align: top;
}
td strong, td small { display: block; }
.vehicle-plate {
  font-size: 18px;
  line-height: 1.15;
}
.vehicle-in-use {
  margin-top: 6px;
  color: var(--danger);
  font-weight: 900;
}
.actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
}
.inline-form {
  display: flex;
  gap: 7px;
  align-items: center;
  flex-wrap: wrap;
}
.inline-form select { width: 128px; }
.inline-form input { width: 180px; }
.date-jump-form input[type="date"] { width: 158px; }
.date-jump-form button { white-space: nowrap; }
.panel-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 16px;
}
.permission-table th,
.permission-table td {
  text-align: center;
}
.permission-table th:first-child,
.permission-table td:first-child {
  text-align: left;
}
.permission-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 34px;
  padding: 4px 8px;
}
.permission-toggle input {
  width: 18px;
  min-height: 18px;
  accent-color: var(--accent-strong);
}
.permission-toggle span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 7px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 800;
  background: #ece5d9;
  color: #554d43;
}
.badge.ok { background: #e7f4ed; color: var(--ok); }
.badge.warn { background: #fff2d8; color: var(--warn); }
.badge.danger { background: #fde8e4; color: var(--danger); }
.pill {
  position: absolute;
  right: 10px;
  min-width: 24px;
  min-height: 24px;
  display: inline-grid;
  place-items: center;
  background: #8d1f2d;
  color: white;
  border-radius: 999px;
  font-size: 12px;
}
.dot {
  position: absolute;
  right: 14px;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--danger);
}
.deadline { color: var(--danger); font-weight: 900; }
.blink { animation: blink 1s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .22; } }

.list-row {
  display: grid;
  gap: 3px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}
.list-row:first-of-type { border-top: 0; }
.rollback-list {
  display: grid;
  gap: 10px;
  margin: 12px 0;
}
.rollback-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}
.rollback-card strong,
.rollback-card span,
.rollback-card small {
  display: block;
}
.rollback-card span {
  margin-top: 2px;
  font-weight: 900;
}
.driver-directory {
  display: grid;
  gap: 14px;
}
.driver-directory-head,
.driver-detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.driver-directory .filters {
  padding: 0 18px 8px;
}
.driver-directory tr.active-row {
  background: #eef1e8;
}
.driver-directory td a {
  color: var(--text);
}
.fiche-driver-list table strong a {
  color: var(--accent-strong);
}
.fiche-driver-list td {
  vertical-align: middle;
}
.fiche-day-link {
  color: inherit;
}
.fiche-day-title {
  display: grid;
  gap: 16px;
}
.monthly-head {
  display: grid;
  grid-template-columns: auto minmax(120px, 180px) auto repeat(6, minmax(95px, 1fr));
  gap: 12px;
  align-items: center;
}
.monthly-head > div {
  min-height: 58px;
  display: grid;
  align-content: center;
  gap: 3px;
}
.monthly-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.monthly-title strong {
  color: var(--accent-strong);
  font-size: 26px;
  line-height: 1;
}
.monthly-fiche {
  overflow-x: auto;
}
.monthly-fiche table {
  min-width: 980px;
}
.monthly-fiche tr.weekend > td,
.monthly-fiche tr.holiday > td,
.monthly-fiche tr.holiday.worked > td {
  background: #e8f1e8;
}
.monthly-fiche tr.worked:not(.holiday):not(.weekend) > td {
  background: #fffdf8;
}
.monthly-fiche td:first-child strong,
.monthly-fiche td:first-child small {
  display: block;
}
.monthly-fiche td a {
  color: var(--accent-strong);
  font-weight: 900;
}
.fiche-service-form {
  margin-top: 12px;
}
.day-services {
  gap: 12px;
}
.service-detail-card {
  display: grid;
  grid-template-columns: minmax(180px, 1.1fr) minmax(120px, .8fr) minmax(120px, .8fr) minmax(100px, .6fr);
  gap: 14px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 16px;
}
.service-detail-card > div {
  min-width: 0;
}
.service-detail-card span,
.service-detail-card strong {
  display: block;
}
.service-detail-card span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}
.service-detail-card strong {
  color: var(--accent-strong);
}
.service-kind {
  display: inline-flex !important;
  width: max-content;
  padding: 7px 12px;
  border-radius: 7px;
  background: #eaf1ea;
  color: var(--accent-strong) !important;
  margin-bottom: 8px;
}
.service-detail-card.pause-child {
  margin-left: 26px;
  border-left: 5px solid #c29a2e;
  background: #fff8e8;
}
.service-detail-card .actions {
  grid-column: 1 / -1;
  justify-content: flex-start;
}
.fiche-list { padding: 0; overflow: hidden; }
.fiche-row {
  display: grid;
  grid-template-columns: 90px 1.2fr 1.2fr 1.2fr auto;
  gap: 16px;
  align-items: center;
  padding: 18px;
  border-top: 1px solid var(--line);
}
.fiche-row:first-child { border-top: 0; }
.fiche-row span { color: var(--muted); }
.fiche-row b { color: var(--text); }
.fiche-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.fiche-summary div {
  min-height: 74px;
  display: grid;
  align-content: center;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  padding: 12px;
}
.fiche-summary span,
.fiche-task span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}
.fiche-summary strong {
  font-size: 20px;
}
.fiche-task-list {
  display: grid;
  gap: 10px;
}
.fiche-task {
  display: grid;
  grid-template-columns: minmax(90px, .8fr) minmax(130px, 1.25fr) minmax(105px, .9fr) minmax(80px, .7fr) minmax(80px, .7fr);
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 14px;
}
.fiche-task strong,
.fiche-task span {
  display: block;
  min-width: 0;
  overflow-wrap: break-word;
}
.fiche-task .actions {
  grid-column: 1 / -1;
  justify-content: flex-start;
}
.fiche-task.archived {
  opacity: .72;
  background: #f3efe7;
}
.fiche-task.pause-child {
  margin-left: 26px;
  border-left: 5px solid #c29a2e;
  background: #fff8e8;
}
.pause-link {
  margin-top: 3px;
  color: #9a6f15 !important;
}
.note-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
}
.note-bulk-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}
.note-bulk-actions form {
  display: flex;
  gap: 10px;
}
.note-select {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.note-select input {
  width: 16px;
  min-height: 16px;
  accent-color: var(--accent-strong);
}
.note-grid article, .incident-list article {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}
.unread { border-color: #c27165 !important; box-shadow: 0 0 0 2px rgba(180,35,24,.08); }
.incident-list { display: grid; gap: 12px; }
.incident-list article {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}
.incident-main {
  min-width: 0;
  flex: 1;
}
.incident-actions {
  display: grid;
  justify-items: end;
  align-content: start;
  gap: 8px;
  min-width: 170px;
}
.incident-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}
.incident-thumb {
  width: 118px;
  display: grid;
  gap: 6px;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}
.incident-thumb img {
  width: 118px;
  height: 82px;
  display: block;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  box-shadow: 0 8px 18px rgba(37, 43, 38, .08);
}
.incident-thumb span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.incident-thumb:hover img {
  border-color: var(--accent-strong);
}
.incident-thumb.is-file {
  width: auto;
  border: 1px solid var(--line);
  background: var(--panel-soft);
  border-radius: 7px;
  padding: 7px 10px;
}
.thumbs { display: flex; flex-wrap: wrap; gap: 8px; }
.thumbs a {
  border: 1px solid var(--line);
  background: var(--panel-soft);
  border-radius: 7px;
  padding: 7px 10px;
  color: var(--accent-strong);
  font-weight: 700;
}
.service-type-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.service-chip {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  background: var(--panel-soft);
  border-radius: 7px;
  padding: 8px 12px;
  font-weight: 800;
}
.service-chip small {
  color: var(--muted);
  font-weight: 700;
}
.service-chip.muted {
  opacity: .58;
}
.alert {
  border-radius: 7px;
  padding: 12px;
  margin-bottom: 14px;
  background: #fff2d8;
}
.flash-stack {
  margin-bottom: 18px;
}
.flash-stack .alert:last-child {
  margin-bottom: 0;
}
.alert.danger { background: #fde8e4; color: var(--danger); }
.alert.ok { background: #e7f4ed; color: var(--ok); }
.note-read-details {
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
}
.note-read-details summary {
  cursor: pointer;
  font-weight: 800;
  color: var(--text);
}
.live-refresh {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 30;
  display: none;
  align-items: center;
  gap: 10px;
  max-width: min(420px, calc(100vw - 44px));
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 248, .96);
  box-shadow: var(--shadow);
  color: var(--text);
  font-weight: 800;
}
.live-refresh.show { display: flex; }
.live-refresh span { color: var(--muted); }
.live-refresh button {
  min-height: 32px;
  padding: 6px 10px;
  background: var(--accent-strong);
  border-color: var(--accent-strong);
  color: white;
  font-weight: 800;
}
.print-body {
  min-height: 100vh;
  background: #f4f0e8;
  padding: 24px;
}
.print-toolbar {
  width: min(100%, 860px);
  margin: 0 auto 16px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
.print-sheet {
  width: min(100%, 860px);
  margin: 0 auto;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 34px;
  box-shadow: var(--shadow);
}
.print-sheet table {
  margin: 18px 0 24px;
}
.print-sheet th {
  width: 170px;
  text-transform: none;
  font-size: 14px;
}
.print-sheet p {
  white-space: normal;
  line-height: 1.5;
}
.print-images {
  display: grid;
  gap: 18px;
  margin-top: 14px;
}
.print-image {
  break-inside: avoid;
  page-break-inside: avoid;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.print-image img {
  width: 100%;
  max-height: 620px;
  object-fit: contain;
  display: block;
  background: #fff;
}
.print-image figcaption {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.driver-app {
  min-height: 100vh;
  background: #f5f7fb;
  color: #0c1728;
  padding-bottom: calc(88px + env(safe-area-inset-bottom));
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
.driver-app svg {
  width: 24px;
  height: 24px;
  display: block;
}
.driver-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  width: min(100%, 860px);
  margin: 0 auto;
  min-height: 96px;
  padding: calc(18px + env(safe-area-inset-top)) clamp(16px, 5vw, 28px) 14px;
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(12px, 4vw, 18px);
  background: rgba(245, 247, 251, .92);
  backdrop-filter: blur(18px);
}
.driver-brand-lockup {
  min-width: 0;
  display: grid;
  justify-items: start;
}
.driver-brand-lockup strong {
  display: block;
  font-size: clamp(28px, 8vw, 40px);
  line-height: .92;
  letter-spacing: 0;
  color: #10213a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.driver-brand-lockup small {
  display: block;
  margin-top: 5px;
  color: #677180;
  font-size: clamp(16px, 4.2vw, 20px);
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.driver-service-state {
  margin-top: 8px;
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border-radius: 999px;
  padding: 4px 11px;
  background: #eef2f6;
  color: #667280;
  font-size: 13px;
  font-weight: 900;
}
.driver-service-state i {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: currentColor;
}
.driver-service-state.is-active {
  background: #dff3e5;
  color: #24824f;
}
.driver-top-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}
.driver-top-actions form {
  margin: 0;
}
.driver-round {
  position: relative;
  width: clamp(48px, 14vw, 58px);
  height: clamp(48px, 14vw, 58px);
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 20px;
  color: #6a737d;
  background: rgba(255, 255, 255, .9);
  box-shadow: 0 14px 38px rgba(25, 39, 60, .08);
}
.driver-menu {
  color: #111827;
}
.driver-logout {
  color: #9f1f2e;
  cursor: pointer;
}
.driver-notes-shortcut.has-unread {
  color: #10213a;
  animation: driver-note-pulse 1.15s ease-in-out infinite;
}
@keyframes driver-note-pulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 14px 38px rgba(25, 39, 60, .08);
  }
  50% {
    transform: scale(1.06);
    box-shadow: 0 0 0 8px rgba(226, 72, 55, .12), 0 18px 38px rgba(226, 72, 55, .18);
  }
}
.driver-dot {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  border: 2px solid #fff;
  background: #e84736;
  color: #fff;
  font-size: 12px;
  font-weight: 950;
}
.driver-main {
  width: min(100%, 860px);
  margin: 0 auto;
  padding: 8px clamp(16px, 5vw, 28px) 28px;
}
.driver-hero {
  position: relative;
  min-height: clamp(150px, 34vw, 210px);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  overflow: hidden;
  border-radius: clamp(24px, 6vw, 32px);
  background: #0d2039;
  box-shadow: 0 22px 60px rgba(20, 35, 56, .16);
}
.driver-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, rgba(10, 23, 43, .18), rgba(255,255,255,.07));
  pointer-events: none;
}
.driver-hero-copy {
  position: relative;
  z-index: 1;
  min-width: 0;
  padding: clamp(22px, 6vw, 36px);
}
.driver-hero span,
.driver-section-title {
  color: #647081;
  font-size: clamp(14px, 3.9vw, 18px);
  font-weight: 950;
}
.driver-hero span {
  color: rgba(255, 255, 255, .82);
  text-transform: uppercase;
}
.driver-hero h1 {
  margin-top: 14px;
  color: #fff;
  font-size: clamp(30px, 9vw, 48px);
  line-height: 1.02;
  overflow-wrap: break-word;
}
.driver-hero p {
  margin-top: 10px;
  color: rgba(255, 255, 255, .86);
  font-size: clamp(16px, 4.5vw, 23px);
  line-height: 1.16;
  font-weight: 750;
  overflow-wrap: break-word;
}
.driver-card-icon,
.driver-metric-icon,
.driver-feed-icon {
  display: grid;
  place-items: center;
  border-radius: 999px;
}
.driver-section-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: clamp(18px, 5vw, 28px) 4px 12px;
}
.driver-section-line a {
  flex: 0 0 auto;
  color: #316be4;
  font-size: clamp(14px, 3.8vw, 17px);
  font-weight: 900;
}
.driver-section-title {
  margin: 0;
  color: #111827;
  font-size: clamp(20px, 5.6vw, 28px);
}
.driver-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(12px, 4vw, 18px);
}
.driver-card {
  position: relative;
  min-width: 0;
  min-height: clamp(134px, 36vw, 170px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 26px;
  grid-template-rows: auto minmax(0, 1fr);
  align-content: center;
  gap: 10px;
  padding: clamp(18px, 5vw, 24px);
  border-radius: clamp(24px, 6vw, 30px);
  background: #fff;
  box-shadow: 0 20px 50px rgba(25, 39, 60, .07);
  overflow: hidden;
}
.driver-card::after {
  content: "";
  position: absolute;
  right: -20px;
  bottom: -30px;
  width: 54%;
  height: 56%;
  border-radius: 999px 0 0 0;
  background: currentColor;
  opacity: .12;
}
.driver-card-icon {
  grid-column: 1;
  grid-row: 1;
  width: clamp(50px, 14vw, 62px);
  height: clamp(50px, 14vw, 62px);
  background: rgba(255, 255, 255, .72);
  color: inherit;
}
.driver-card-icon svg {
  width: clamp(24px, 7vw, 30px);
  height: clamp(24px, 7vw, 30px);
}
.driver-card-copy {
  grid-column: 1 / -1;
  grid-row: 2;
  position: relative;
  z-index: 1;
  min-width: 0;
  display: block;
  margin-top: 12px;
}
.driver-card strong {
  display: block;
  min-width: 0;
  font-size: clamp(15px, 4.1vw, 21px);
  line-height: 1.08;
  overflow-wrap: break-word;
  hyphens: auto;
}
.driver-card small {
  display: block;
  margin-top: 8px;
  color: #4c5563;
  font-size: clamp(13px, 3.6vw, 16px);
  line-height: 1.18;
  font-weight: 750;
  overflow-wrap: break-word;
}
.driver-card-arrow {
  grid-column: 2;
  grid-row: 1;
  position: relative;
  z-index: 1;
  align-self: start;
  justify-self: end;
  color: #8b94a1;
}
.driver-card-arrow svg {
  width: 22px;
  height: 22px;
}
.tone-blue { background: #edf3ff; color: #3267d6; }
.tone-green { background: #eaf8ec; color: #338553; }
.tone-yellow { background: #fff3cf; color: #d29006; }
.tone-red { background: #ffece6; color: #df4e39; }
.tone-purple { background: #efeaff; color: #7e5bd8; }
.driver-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin-top: clamp(14px, 4vw, 18px);
  overflow: hidden;
  border-radius: clamp(20px, 5vw, 26px);
  background: #fff;
  box-shadow: 0 18px 48px rgba(25, 39, 60, .07);
}
.driver-metrics article {
  min-width: 0;
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: clamp(13px, 3.5vw, 18px) 8px;
  text-align: center;
  border-left: 1px solid #edf0f5;
}
.driver-metrics article:first-child {
  border-left: 0;
}
.driver-metric-icon {
  width: clamp(34px, 9vw, 44px);
  height: clamp(34px, 9vw, 44px);
  background: rgba(255, 255, 255, .72);
  color: inherit;
}
.driver-metric-icon svg {
  width: clamp(18px, 5vw, 23px);
  height: clamp(18px, 5vw, 23px);
}
.driver-metrics strong {
  font-size: clamp(16px, 4.6vw, 25px);
  line-height: 1;
  color: #111827;
  overflow-wrap: anywhere;
}
.driver-metrics small {
  color: #6b7481;
  font-size: clamp(10px, 2.8vw, 13px);
  font-weight: 800;
  line-height: 1.1;
  overflow-wrap: break-word;
}
.driver-feed {
  display: grid;
  gap: 12px;
}
.driver-feed a,
.driver-empty {
  min-height: 78px;
  display: grid;
  grid-template-columns: 10px 52px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  border-radius: clamp(20px, 5vw, 26px);
  background: #fff;
  box-shadow: 0 18px 48px rgba(25, 39, 60, .07);
}
.driver-empty {
  grid-template-columns: 1fr;
  color: #68716e;
  font-weight: 800;
}
.driver-feed a > i {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #316be4;
}
.driver-feed-icon {
  width: 48px;
  height: 48px;
  background: #edf3ff;
  color: #3267d6;
}
.driver-feed strong,
.driver-feed small {
  display: block;
  min-width: 0;
  overflow-wrap: break-word;
}
.driver-feed strong {
  color: #111827;
  font-size: clamp(15px, 4vw, 18px);
  line-height: 1.08;
}
.driver-feed small {
  margin-top: 4px;
  color: #6b7481;
  font-weight: 750;
}
.driver-feed b,
.driver-feed .badge {
  justify-self: end;
  white-space: nowrap;
}
.driver-bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  width: min(100%, 860px);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(58px, 1fr));
  gap: 2px;
  padding: 10px clamp(12px, 4vw, 24px) calc(10px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, .92);
  border-top: 1px solid rgba(226, 231, 238, .9);
  backdrop-filter: blur(18px);
  box-shadow: 0 -14px 34px rgba(25, 39, 60, .07);
}
.driver-bottom-nav a {
  min-width: 0;
  min-height: 52px;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 3px;
  border-radius: 16px;
  color: #6b7481;
  font-size: 12px;
  font-weight: 900;
}
.driver-bottom-nav a.active {
  background: #edf3ff;
  color: #3267d6;
}
.driver-bottom-nav svg {
  width: 24px;
  height: 24px;
}
.driver-bottom-nav span {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
  text-align: center;
  line-height: 1.05;
}
.driver-app .page-head {
  min-height: auto;
  margin: 4px 0 18px;
}
.driver-app .page-head h1 {
  font-size: clamp(28px, 8vw, 38px);
  line-height: 1.04;
  overflow-wrap: break-word;
}
.driver-app .page-head p {
  font-size: clamp(16px, 4.5vw, 20px);
  line-height: 1.18;
  font-weight: 750;
  overflow-wrap: break-word;
}
.driver-app .panel {
  border: 0;
  border-radius: clamp(20px, 7vw, 26px);
  background: #fff;
  box-shadow: 0 12px 30px rgba(35, 44, 39, .06);
  padding: clamp(16px, 5vw, 22px);
}
.driver-app .grid-form,
.driver-app .split,
.driver-app .note-grid {
  grid-template-columns: 1fr;
}
.driver-app .grid-form {
  gap: clamp(14px, 4vw, 20px);
}
.driver-app label {
  gap: 9px;
}
.driver-app label span {
  font-size: clamp(13px, 3.6vw, 16px);
  line-height: 1.15;
  overflow-wrap: break-word;
}
.driver-app input,
.driver-app select,
.driver-app textarea {
  min-width: 0;
  min-height: clamp(48px, 14vw, 58px);
  border-radius: clamp(14px, 5vw, 18px);
  background: #f8faf9;
  font-size: clamp(15px, 4.3vw, 19px);
  line-height: 1.15;
  font-weight: 800;
  padding: 10px clamp(12px, 4vw, 16px);
}
.driver-app textarea {
  min-height: 118px;
}
.driver-file-control {
  position: relative;
  min-width: 0;
  min-height: clamp(50px, 14vw, 58px);
  display: grid;
  grid-template-columns: minmax(125px, .42fr) minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: clamp(14px, 5vw, 18px);
  background: #f8faf9;
  padding: 8px 10px;
  overflow: hidden;
}
.driver-file-control input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}
.driver-file-button {
  min-width: 0;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #e4e5e3;
  color: #171918;
  font-size: clamp(12px, 3.45vw, 14px);
  font-weight: 900;
  padding: 0 10px;
  text-align: center;
  white-space: nowrap;
}
.driver-file-name {
  min-width: 0;
  color: #625f58;
  font-size: clamp(12px, 3.35vw, 14px);
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.driver-app .fiche-row {
  min-width: 0;
  border-top: 1px solid var(--line);
  padding: clamp(14px, 4vw, 18px) 0;
  gap: 12px;
}
.driver-app .fiche-row strong,
.driver-app .fiche-row span,
.driver-app .fiche-row b {
  display: block;
  min-width: 0;
  overflow-wrap: break-word;
}
.driver-app .fiche-row strong {
  font-size: clamp(18px, 5vw, 22px);
  line-height: 1.08;
  margin-top: 8px;
}
.driver-app .fiche-row span {
  font-size: clamp(15px, 4.3vw, 18px);
  line-height: 1.18;
}
.driver-app .fiche-row b {
  margin-top: 2px;
  font-size: clamp(17px, 4.7vw, 20px);
}
.login-body, .install-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: linear-gradient(135deg, #f4f0e8, #e7e1d5);
}
.login-card, .install-card {
  width: min(100%, 470px);
  background: rgba(255,253,248,.92);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 24px;
}
.install-card { width: min(100%, 880px); }
.install-brand { text-align: center; margin-bottom: 18px; }
.install-brand span {
  width: 54px;
  height: 54px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--accent-strong);
}
.install-brand-icon img {
  width: 34px;
  height: 34px;
  display: block;
}
.install-brand h1 { margin-top: 10px; }
.login-card { display: grid; gap: 14px; }
.login-card-inner {
  display: grid;
  gap: 14px;
}
.login-links {
  text-align: center;
  color: var(--accent-strong);
  font-weight: 800;
}
.auth-status:empty {
  display: none;
}
.auth-status {
  min-height: 38px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  padding: 8px 10px;
  background: #fff2d8;
  color: var(--muted);
  font-weight: 800;
  text-align: center;
}
.auth-status.ok {
  background: #e7f4ed;
  color: var(--ok);
}
.auth-status.danger {
  background: #fde8e4;
  color: var(--danger);
}
.passkey-panel {
  display: grid;
  gap: 10px;
}
.passkey-panel h2 {
  margin-bottom: 0;
}

@media (max-width: 1000px) {
  .sidebar {
    transform: translateX(-110%);
    transition: transform .2s ease;
    z-index: 10;
  }
  body.menu-open .sidebar { transform: translateX(0); }
  .mobile-menu {
    display: inline-flex;
    position: fixed;
    z-index: 11;
    top: 12px;
    left: 12px;
    width: 42px;
    height: 42px;
    padding: 0;
    background: var(--panel);
  }
  .main {
    margin-left: 0;
    padding: 70px 16px 32px;
  }
  .page-head, .incident-list article { flex-direction: column; }
  .incident-actions {
    justify-items: start;
    min-width: 0;
  }
  .driver-directory-head,
  .driver-detail-head {
    flex-direction: column;
  }
  .split, .stat-grid, .note-grid, .grid-form, .mysql-fields, .bus-change-fields, .fiche-summary, .monthly-head {
    grid-template-columns: 1fr;
  }
  .fiche-row,
  .fiche-task,
  .service-detail-card {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  table, thead, tbody, th, td, tr { display: block; }
  thead { display: none; }
  tr {
    border-top: 1px solid var(--line);
    padding: 10px 0;
  }
  td { border: 0; padding: 7px 0; }
  .actions { justify-content: flex-start; }
  .live-refresh {
    right: 12px;
    bottom: 12px;
    max-width: calc(100vw - 24px);
  }
}

@media print {
  .sidebar,
  .mobile-menu,
  .head-actions,
  .logout,
  .sidebar-assistant,
  .driver-bottom-nav {
    display: none !important;
  }
  .main {
    margin: 0;
    padding: 0;
  }
  body {
    background: white;
  }
  .panel {
    box-shadow: none;
    break-inside: avoid;
  }
}

@media (max-width: 420px) {
  .driver-topbar {
    grid-template-columns: 48px minmax(0, 1fr) auto;
    padding-left: 14px;
    padding-right: 14px;
    gap: 10px;
  }
  .driver-brand-lockup strong {
    font-size: 27px;
  }
  .driver-brand-lockup small {
    font-size: 16px;
  }
  .driver-round {
    width: 44px;
    height: 44px;
    border-radius: 16px;
  }
  .driver-top-actions {
    gap: 7px;
  }
  .driver-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .driver-metrics article:nth-child(3) {
    border-left: 0;
    border-top: 1px solid #edf0f5;
  }
  .driver-metrics article:nth-child(4) {
    border-top: 1px solid #edf0f5;
  }
  .driver-feed a {
    grid-template-columns: 8px 44px minmax(0, 1fr);
  }
  .driver-feed b,
  .driver-feed .badge {
    grid-column: 3;
    justify-self: start;
  }
}

@media (max-width: 360px) {
  .driver-main {
    padding-left: 10px;
    padding-right: 10px;
  }
  .driver-card {
    grid-template-columns: 1fr;
    justify-items: start;
    align-content: center;
  }
  .driver-card-icon {
    width: 42px;
    height: 42px;
  }
  .driver-file-control {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .driver-file-button {
    justify-content: flex-start;
    width: 100%;
  }
}

@media print {
  body.print-body {
    background: white;
    padding: 0;
  }
  .print-toolbar {
    display: none;
  }
  .print-sheet {
    width: 100%;
    border: 0;
    box-shadow: none;
    padding: 0;
  }
  a {
    color: black;
  }
}
