:root {
  --bg: #f7f7f5;
  --panel: #fff;
  --text: #171717;
  --muted: #6d6d6a;
  --line: #e8e7e3;
  --soft: #efefec;
  --dark: #20211f;
  --green: #0f8a5f;
  --green2: #e9f7f1;
  --red: #bc3b3b;
  --amber: #9a6b05;
  --radius: 16px;
  --shadow: 0 12px 38px rgba(22, 22, 20, 0.07);
}
* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
html,
body {
  margin: 0;
  min-height: 100%;
  font-family:
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    Helvetica,
    Arial,
    sans-serif;
  color: var(--text);
  background: var(--bg);
}
button,
input,
select,
textarea {
  font: inherit;
}
button {
  cursor: pointer;
}
.app-shell {
  min-height: 100vh;
}
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 248px;
  background: #f0f0ed;
  border-right: 1px solid var(--line);
  padding: 17px 13px;
  display: flex;
  flex-direction: column;
  z-index: 30;
}
.sidebar-head {
  display: flex;
  gap: 11px;
  align-items: center;
  padding: 3px 7px 22px;
}
.sidebar-head strong {
  font-size: 14px;
  display: block;
}
.sidebar-head span {
  font-size: 12px;
  color: var(--muted);
}
.brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 15px;
  background: var(--dark);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 850;
  letter-spacing: -1px;
}
.brand-mark.small {
  width: 35px;
  height: 35px;
  border-radius: 10px;
  font-size: 12px;
}
.sidebar nav {
  display: grid;
  gap: 4px;
}
.nav-item {
  border: 0;
  background: transparent;
  border-radius: 9px;
  padding: 10px 11px;
  text-align: left;
  color: #3f3f3c;
  display: flex;
  align-items: center;
  gap: 11px;
  font-size: 14px;
}
.nav-item i {
  font-style: normal;
  width: 18px;
  text-align: center;
  color: #5e5e5a;
}
.nav-item:hover {
  background: #e8e8e4;
}
.nav-item.active {
  background: #dfdfda;
  color: #171717;
  font-weight: 650;
}
.sidebar-foot {
  margin-top: auto;
  padding: 12px 5px 2px;
}
.sync-state {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 10px;
}
.sync-state span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #a4a49e;
}
.sync-state.ok span {
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(15, 138, 95, 0.12);
}
.sync-state.bad span {
  background: var(--red);
}
.logout {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 7px 0;
  font-size: 12px;
}
.content {
  margin-left: 248px;
  padding: 40px 42px 80px;
  max-width: 1600px;
}
.page {
  display: none;
}
.page.active {
  display: block;
}
.page-title {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-end;
  margin-bottom: 28px;
}
.page-title h1 {
  font-size: 32px;
  letter-spacing: -1.05px;
  margin: 2px 0 4px;
}
.page-title p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}
.eyebrow {
  font-size: 10px !important;
  font-weight: 800;
  letter-spacing: 1.3px;
  color: #8d8d87 !important;
}
.primary,
.secondary {
  border-radius: 10px;
  padding: 11px 15px;
  border: 1px solid var(--dark);
  font-weight: 700;
}
.primary {
  background: var(--dark);
  color: #fff;
}
.primary:hover {
  background: #000;
}
.secondary {
  background: #fff;
  color: var(--text);
  border-color: var(--line);
}
.compact {
  padding: 9px 13px;
  font-size: 13px;
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 17px;
}
.stat {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
}
.stat label {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 16px;
}
.stat b {
  font-size: 29px;
  letter-spacing: -1px;
}
.stat small {
  display: block;
  color: var(--muted);
  margin-top: 5px;
}
.grid-two {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(280px, 0.7fr);
  gap: 17px;
}
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
}
.panel.flush {
  padding: 0;
  overflow: hidden;
}
.panel h2 {
  font-size: 16px;
  margin: 0 0 15px;
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 14px;
}
.panel-head h2 {
  margin: 0;
}
.panel-head p {
  font-size: 12px;
  color: var(--muted);
  margin: 4px 0 0;
}
.text-button {
  border: 0;
  background: transparent;
  font-size: 12px;
  color: var(--muted);
}
.table-wrap {
  overflow: auto;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.data-table th {
  text-align: left;
  padding: 12px 14px;
  color: #8b8b85;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.data-table td {
  padding: 13px 14px;
  border-bottom: 1px solid #f0efec;
  vertical-align: middle;
}
.data-table tr:last-child td {
  border-bottom: 0;
}
.data-table tr[data-id] {
  cursor: pointer;
}
.data-table tr[data-id]:hover td {
  background: #fafaf8;
}
.route-cell {
  max-width: 340px;
}
.route-cell b,
.route-cell span {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.route-cell span {
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
}
.money {
  font-weight: 700;
  white-space: nowrap;
}
.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 5px 8px;
  font-size: 10px;
  font-weight: 800;
  background: #efefec;
  color: #5b5b57;
  text-transform: capitalize;
}
.badge.processing,
.badge.completed {
  background: var(--green2);
  color: #08754f;
}
.badge.pending {
  background: #fff5d9;
  color: var(--amber);
}
.badge.cancelled,
.badge.failed,
.badge.refunded {
  background: #fdecec;
  color: #a52d2d;
}
.badge.on_hold {
  background: #f0effa;
  color: #62558d;
}
.status-list {
  display: grid;
  gap: 5px;
}
.status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 2px;
  border-bottom: 1px solid #f1f0ed;
}
.status-row:last-child {
  border-bottom: 0;
}
.status-row div {
  display: flex;
  align-items: center;
  gap: 9px;
}
.status-row i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #b8b8b1;
}
.status-row b {
  font-size: 13px;
}
.status-row span {
  font-weight: 800;
}
.toolbar {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}
.toolbar input,
.toolbar select {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 12px;
  outline: none;
}
.toolbar input {
  min-width: 260px;
  flex: 1;
}
.toolbar input:focus,
.toolbar select:focus {
  border-color: #a4a49d;
}
.pager {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  padding: 12px 15px;
}
.pager button {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  padding: 7px 10px;
}
.pager button:disabled {
  opacity: 0.4;
}
.pager span {
  font-size: 12px;
  color: var(--muted);
}
.calendar-list {
  display: grid;
  gap: 13px;
}
.calendar-day {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
}
.calendar-day h3 {
  margin: 0 0 12px;
  font-size: 14px;
}
.calendar-item {
  display: grid;
  grid-template-columns: 80px 1fr auto;
  gap: 14px;
  padding: 12px 0;
  border-top: 1px solid #f0efec;
  align-items: center;
}
.calendar-item time {
  font-weight: 800;
}
.calendar-item b {
  display: block;
  font-size: 13px;
}
.calendar-item span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}
.resource-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 16px;
}
.resource-nav {
  display: grid;
  gap: 5px;
  align-content: start;
}
.resource-nav button {
  border: 1px solid transparent;
  background: transparent;
  padding: 11px 12px;
  text-align: left;
  border-radius: 10px;
  color: #4f4f4b;
}
.resource-nav button:hover {
  background: #efefeb;
}
.resource-nav button.active {
  background: #fff;
  border-color: var(--line);
  font-weight: 750;
}
.resource-editor {
  padding: 18px;
}
.resource-editor textarea {
  width: 100%;
  min-height: 520px;
  resize: vertical;
  border: 1px solid var(--line);
  background: #fbfbf9;
  border-radius: 12px;
  padding: 15px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  line-height: 1.55;
  outline: none;
}
.resource-editor textarea:focus {
  border-color: #aaa9a1;
}
.inline-message {
  min-height: 22px;
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
}
.health-card {
  border: 1px solid var(--line);
  background: #fafaf8;
  border-radius: 12px;
  padding: 15px;
  margin: 10px 0 14px;
  font-size: 13px;
}
.health-card .big {
  font-size: 17px;
  font-weight: 800;
  margin-bottom: 5px;
}
.prose {
  font-size: 13px;
  line-height: 1.6;
  color: #4f4f4c;
}
.prose p {
  margin: 0 0 11px;
}
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 15, 14, 0.25);
  opacity: 0;
  pointer-events: none;
  transition: 0.2s;
  z-index: 49;
}
.drawer-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}
.drawer {
  position: fixed;
  right: 0;
  top: 0;
  bottom: 0;
  width: min(590px, 94vw);
  background: #fff;
  box-shadow: -20px 0 60px rgba(0, 0, 0, 0.12);
  transform: translateX(102%);
  transition: 0.25s;
  z-index: 50;
  display: flex;
  flex-direction: column;
}
.drawer.open {
  transform: none;
}
.drawer-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 22px 24px;
  border-bottom: 1px solid var(--line);
}
.drawer-head h2 {
  margin: 2px 0 0;
}
.drawer-head button {
  border: 0;
  background: #f1f1ee;
  width: 35px;
  height: 35px;
  border-radius: 50%;
  font-size: 22px;
}
.drawer-body {
  padding: 22px 24px 50px;
  overflow: auto;
}
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.field {
  display: grid;
  gap: 5px;
}
.field.full {
  grid-column: 1/-1;
}
.field label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--muted);
  font-weight: 750;
}
.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 10px 11px;
  outline: none;
  background: #fff;
}
.field textarea {
  min-height: 90px;
  resize: vertical;
}
.drawer-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 20px;
}
.summary-card {
  background: #f7f7f4;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 18px;
}
.summary-card b {
  display: block;
  font-size: 13px;
}
.summary-card span {
  font-size: 12px;
  color: var(--muted);
}
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 20px);
  background: #20211f;
  color: #fff;
  padding: 10px 14px;
  border-radius: 9px;
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transition: 0.2s;
  z-index: 80;
}
.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
.empty {
  padding: 32px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}
.loading {
  padding: 30px;
  text-align: center;
  color: var(--muted);
}
.mobile-header {
  display: none;
}
.login-page {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 22px;
}
.login-card {
  width: min(390px, 100%);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 31px;
  box-shadow: var(--shadow);
}
.login-card h1 {
  font-size: 22px;
  margin: 20px 0 2px;
}
.login-card > p {
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 13px;
}
.login-card form {
  display: grid;
  gap: 15px;
}
.login-card label {
  display: grid;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
}
.login-card input {
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 12px;
  outline: none;
}
.login-card .primary {
  width: 100%;
  margin-top: 4px;
}
.form-error {
  font-size: 12px;
  color: var(--red);
  text-align: center;
}
@media (max-width: 1000px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .grid-two {
    grid-template-columns: 1fr;
  }
  .resource-layout {
    grid-template-columns: 190px 1fr;
  }
}
@media (max-width: 760px) {
  .sidebar {
    transform: translateX(-102%);
    transition: 0.22s;
    width: 270px;
    box-shadow: 20px 0 40px rgba(0, 0, 0, 0.12);
  }
  .sidebar.open {
    transform: none;
  }
  .content {
    margin: 0;
    padding: 82px 14px 60px;
  }
  .mobile-header {
    display: flex;
    position: fixed;
    z-index: 25;
    top: 0;
    left: 0;
    right: 0;
    height: 64px;
    padding: 9px 12px;
    padding-top: max(9px, env(safe-area-inset-top));
    background: rgba(247, 247, 245, 0.93);
    backdrop-filter: blur(18px);
    border-bottom: 1px solid var(--line);
    align-items: center;
    justify-content: space-between;
  }
  .mobile-header button {
    border: 0;
    background: transparent;
    font-size: 20px;
    width: 38px;
    height: 38px;
  }
  .mobile-header div {
    text-align: center;
  }
  .mobile-header strong {
    display: block;
    font-size: 13px;
  }
  .mobile-header span {
    font-size: 10px;
    color: var(--muted);
  }
  .page-title {
    align-items: flex-start;
  }
  .page-title h1 {
    font-size: 27px;
  }
  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 9px;
  }
  .stat {
    padding: 15px;
  }
  .stat b {
    font-size: 24px;
  }
  .toolbar {
    flex-direction: column;
  }
  .toolbar input {
    min-width: 0;
    width: 100%;
  }
  .resource-layout {
    grid-template-columns: 1fr;
  }
  .resource-nav {
    display: flex;
    overflow: auto;
    padding-bottom: 4px;
  }
  .resource-nav button {
    white-space: nowrap;
    background: #efefec;
  }
  .resource-editor textarea {
    min-height: 430px;
  }
  .detail-grid {
    grid-template-columns: 1fr;
  }
  .field.full {
    grid-column: auto;
  }
  .calendar-item {
    grid-template-columns: 65px 1fr;
  }
  .calendar-item > span:last-child {
    display: none;
  }
  .data-table th:nth-child(4),
  .data-table td:nth-child(4) {
    display: none;
  }
}

/* v1.1 operations UI */
.page-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}
.page-actions select {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;
  padding: 10px 12px;
  color: var(--text);
}
.stat-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  min-height: 118px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.stat-card > span {
  font-size: 11px;
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.55px;
}
.stat-card > strong {
  font-size: 28px;
  line-height: 1.05;
  letter-spacing: -0.8px;
  margin: 9px 0 5px;
}
.stat-card > small {
  color: var(--muted);
  font-size: 11px;
}
.compact-stats {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.compact-stats .stat-card {
  min-height: 98px;
}
.data-table tr[data-booking],
.data-table tr[data-client-search] {
  cursor: pointer;
}
.data-table tr[data-booking]:hover td,
.data-table tr[data-client-search]:hover td {
  background: #fafaf8;
}
.data-table td small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-top: 3px;
}
.data-table.mini td {
  padding: 11px 10px;
}
.data-table.mini th {
  padding: 10px;
}
.data-table code {
  font-size: 11px;
  word-break: break-all;
}
.status-list > div {
  padding: 8px 0;
  border-bottom: 1px solid #f0efec;
}
.status-list > div:last-child {
  border-bottom: 0;
}
.status-list > div > span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.status-list > div > span b {
  font-size: 12px;
}
.progress {
  height: 5px;
  background: #f0efec;
  border-radius: 999px;
  overflow: hidden;
  margin-top: 8px;
}
.progress i {
  display: block;
  height: 100%;
  background: #2c2d2b;
  border-radius: 999px;
}
.mini-chart {
  height: 190px;
  display: flex;
  align-items: flex-end;
  gap: 4px;
  padding: 8px 0 0;
  overflow: hidden;
}
.bar-col {
  height: 100%;
  flex: 1;
  min-width: 4px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  gap: 5px;
}
.bar-col i {
  display: block;
  width: 100%;
  min-height: 4px;
  background: #252624;
  border-radius: 4px 4px 1px 1px;
  opacity: 0.86;
}
.bar-col span {
  font-size: 8px;
  color: var(--muted);
}
.toolbar.multi {
  align-items: center;
  flex-wrap: wrap;
}
.toolbar.multi > input {
  min-width: 240px;
}
.mini-field {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 11px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding-left: 10px;
}
.mini-field input {
  border: 0 !important;
  min-width: 140px !important;
  padding-left: 4px !important;
}
.inline-summary {
  color: var(--muted);
  font-size: 12px;
  margin: -2px 0 12px;
}
.calendar-day h3 {
  display: flex;
  justify-content: space-between;
  align-items: center;
  text-transform: capitalize;
}
.calendar-day h3 small {
  font-size: 10px;
  color: var(--muted);
  font-weight: 500;
}
.calendar-item {
  grid-template-columns: 72px minmax(0, 1fr) auto;
}
.calendar-main small {
  display: block;
  color: #868680;
  font-size: 11px;
  margin-top: 4px;
}
.calendar-tail {
  text-align: right;
}
.calendar-tail > b {
  margin-bottom: 6px;
}
.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.entity-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 17px;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.01);
}
.entity-card-head {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 15px;
}
.entity-card-head > div:not(.avatar) {
  min-width: 0;
}
.entity-card-head h3 {
  font-size: 16px;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.entity-card-head span:not(.entity-state) {
  font-size: 10px;
  color: var(--muted);
}
.avatar {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: #eff0ed;
  font-weight: 850;
}
.entity-state {
  margin-left: auto;
  border-radius: 999px;
  padding: 5px 8px;
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
}
.entity-state.on {
  background: #e9f7f1;
  color: #08754f;
}
.entity-state.off {
  background: #f1f1ef;
  color: #777;
}
.entity-card dl {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  margin: 0;
}
.entity-card dl > div {
  padding: 10px 0;
  border-top: 1px solid #f0efec;
}
.entity-card dt {
  font-size: 9px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.entity-card dd {
  margin: 4px 0 0;
  font-size: 12px;
  font-weight: 700;
  overflow-wrap: anywhere;
}
.entity-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 15px;
}
.danger {
  border: 1px solid #efcaca;
  background: #fff4f4;
  color: #a52d2d;
  border-radius: 10px;
  font-weight: 700;
}
.danger:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.next-assignment {
  border-radius: 11px;
  background: #f7f7f4;
  padding: 11px;
  margin-top: 10px;
  display: grid;
  gap: 3px;
}
.next-assignment small {
  font-size: 9px;
  color: var(--muted);
  text-transform: uppercase;
}
.next-assignment b {
  font-size: 12px;
}
.next-assignment span {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.vehicle-card {
  overflow: hidden;
}
.vehicle-img {
  height: 120px;
  background: #f6f6f3;
  margin: -17px -17px 15px;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.vehicle-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.vehicle-card .entity-card-head {
  margin-bottom: 10px;
}
.vehicle-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin: 9px 0 10px;
}
.vehicle-metrics span {
  background: #f7f7f4;
  border-radius: 8px;
  padding: 7px 5px;
  text-align: center;
  font-size: 9px;
  color: var(--muted);
}
.vehicle-metrics b {
  display: block;
  font-size: 11px;
  color: var(--text);
  margin-bottom: 2px;
}
.entity-meta {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.entity-meta span {
  font-size: 9px;
  background: #f1f1ee;
  border-radius: 999px;
  padding: 4px 7px;
  color: #5d5d58;
}
.pay-badge {
  display: inline-flex;
  border-radius: 999px;
  padding: 5px 8px;
  font-size: 10px;
  font-weight: 800;
  text-transform: capitalize;
  background: #f0efec;
  color: #666;
}
.pay-badge.paid,
.pay-badge.completed,
.pay-badge.captured,
.pay-badge.succeeded,
.pay-badge.success {
  background: #e9f7f1;
  color: #08754f;
}
.pay-badge.failed,
.pay-badge.refunded {
  background: #fdecec;
  color: #a52d2d;
}
.pay-badge.pending {
  background: #fff5d9;
  color: #9a6b05;
}
.form-section {
  border-top: 1px solid #efefec;
  padding-top: 16px;
  margin-top: 16px;
}
.form-section h3 {
  margin: 0 0 12px;
  font-size: 12px;
}
.info-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}
.info-strip span {
  background: #f7f7f4;
  border-radius: 8px;
  padding: 7px 9px;
  font-size: 10px;
  color: var(--muted);
}
.toggle-field {
  align-items: center;
}
.toggle-field label {
  text-transform: none !important;
  letter-spacing: 0 !important;
  color: var(--text) !important;
  font-size: 12px !important;
  display: flex;
  align-items: center;
  gap: 8px;
}
.toggle-field input {
  width: auto !important;
}
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 15, 14, 0.28);
  opacity: 0;
  pointer-events: none;
  transition: 0.2s;
  z-index: 59;
}
.modal-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}
.modal {
  position: fixed;
  z-index: 60;
  left: 50%;
  top: 50%;
  width: min(620px, calc(100vw - 28px));
  max-height: min(760px, calc(100vh - 30px));
  overflow: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 25px 90px rgba(0, 0, 0, 0.2);
  transform: translate(-50%, -46%) scale(0.98);
  opacity: 0;
  pointer-events: none;
  transition: 0.2s;
}
.modal.open {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}
.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 22px;
  border-bottom: 1px solid var(--line);
}
.modal-head h2 {
  margin: 2px 0 0;
  font-size: 20px;
}
.modal-head button {
  border: 0;
  background: #f1f1ee;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 21px;
}
.modal-body {
  padding: 20px 22px 24px;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 20px;
}
.health-ok,
.health-bad {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 13px;
}
.health-ok > span,
.health-bad > span {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 900;
}
.health-ok > span {
  background: #e9f7f1;
  color: #08754f;
}
.health-bad > span {
  background: #fdecec;
  color: #a52d2d;
}
.health-ok b,
.health-bad b {
  display: block;
}
.health-ok small,
.health-bad small {
  display: block;
  color: var(--muted);
  margin-top: 2px;
}
.health-card dl {
  margin: 0;
}
.health-card dl div {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-top: 1px solid #ecece8;
}
.health-card dt {
  color: var(--muted);
}
.health-card dd {
  margin: 0;
  font-weight: 700;
}
.version-info {
  margin-top: 16px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #f7f7f4;
  font-size: 11px;
  color: var(--muted);
}
.backup-list {
  display: grid;
}
.backup-row {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 12px 0;
  border-top: 1px solid #efefec;
}
.backup-row:first-child {
  border-top: 0;
}
.backup-row b {
  display: block;
  font-size: 12px;
}
.backup-row span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  margin-top: 2px;
}
.backup-row time {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}
.toast.bad {
  background: #9e2929;
}

@media (max-width: 1180px) {
  .cards-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .compact-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 760px) {
  .page-title {
    flex-direction: column;
    gap: 14px;
  }
  .page-actions {
    width: 100%;
    justify-content: space-between;
  }
  .page-actions select {
    flex: 1;
  }
  .compact-stats {
    grid-template-columns: 1fr;
  }
  .cards-grid {
    grid-template-columns: 1fr;
  }
  .calendar-item {
    grid-template-columns: 58px minmax(0, 1fr);
  }
  .calendar-tail {
    grid-column: 2;
    display: flex;
    align-items: center;
    gap: 8px;
    text-align: left;
  }
  .calendar-tail > b {
    margin: 0;
  }
  .vehicle-metrics {
    grid-template-columns: repeat(2, 1fr);
  }
  .toolbar.multi {
    flex-direction: column;
    align-items: stretch;
  }
  .mini-field {
    justify-content: space-between;
  }
  .mini-field input {
    flex: 1;
  }
  .data-table th:nth-child(4),
  .data-table td:nth-child(4) {
    display: table-cell;
  }
  .data-table {
    min-width: 760px;
  }
  .panel .data-table.mini {
    min-width: 560px;
  }
  .stat-card > strong {
    font-size: 23px;
  }
  .modal {
    width: calc(100vw - 16px);
    max-height: calc(100vh - 20px);
  }
  .modal-body {
    padding: 16px;
  }
  .modal-head {
    padding: 16px;
  }
  .entity-card dl {
    grid-template-columns: 1fr 1fr;
  }
}

/* v1.2 dispatch, deposits and recovery UI */
.attention-panel {
  margin-top: 17px;
}
.attention-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.attention-card {
  border: 1px solid var(--line);
  background: #fafaf8;
  border-radius: 12px;
  padding: 16px;
  text-align: left;
  display: grid;
  gap: 5px;
}
.attention-card span {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.55px;
  color: var(--muted);
  font-weight: 800;
}
.attention-card strong {
  font-size: 26px;
}
.attention-card small {
  font-size: 11px;
  color: var(--muted);
}
.attention-card.warn {
  background: #fffaf0;
  border-color: #f0dfb7;
}
.attention-card.bad {
  background: #fff5f5;
  border-color: #efcccc;
}
.attention-card:hover {
  transform: translateY(-1px);
}
.dispatch-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 13px;
  align-items: start;
}
.dispatch-column {
  background: #efefec;
  border: 1px solid var(--line);
  border-radius: 15px;
  padding: 10px;
  min-width: 0;
}
.dispatch-column > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 5px 11px;
}
.dispatch-column > header h3 {
  margin: 0;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}
.dispatch-column > header span {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  min-width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  font-size: 10px;
  font-weight: 800;
}
.dispatch-column.warn {
  background: #fff9ed;
}
.dispatch-column.done {
  background: #eff8f4;
}
.dispatch-column > div {
  display: grid;
  gap: 9px;
}
.dispatch-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 13px;
  display: grid;
  gap: 11px;
}
.dispatch-time {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.dispatch-time b {
  font-size: 19px;
}
.dispatch-time span {
  font-size: 10px;
  color: var(--muted);
}
.dispatch-route b {
  display: block;
  font-size: 13px;
}
.dispatch-route span {
  display: block;
  font-size: 11px;
  color: #50504d;
  line-height: 1.45;
  margin-top: 4px;
}
.dispatch-route small {
  display: block;
  font-size: 10px;
  color: var(--muted);
  margin-top: 5px;
}
.dispatch-controls {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 6px;
}
.dispatch-controls select {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  background: #fff;
  font-size: 10px;
}
.dispatch-controls button {
  padding: 8px 10px;
  font-size: 10px;
}
.overdue-text {
  color: #a52d2d !important;
  font-weight: 800;
}
.backup-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.backup-actions time {
  min-width: 128px;
  text-align: right;
}
.backup-actions button {
  padding: 7px 10px;
  font-size: 10px;
}
@media (max-width: 1180px) {
  .dispatch-board {
    grid-template-columns: 1fr;
  }
  .dispatch-column > div {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 760px) {
  .attention-grid {
    grid-template-columns: 1fr;
  }
  .dispatch-column > div {
    grid-template-columns: 1fr;
  }
  .dispatch-controls {
    grid-template-columns: 1fr 1fr;
  }
  .dispatch-controls button {
    grid-column: 1/-1;
  }
  .backup-row {
    align-items: flex-start;
  }
  .backup-actions {
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
  }
  .backup-actions time {
    min-width: 0;
  }
  .attention-panel {
    margin-top: 10px;
  }
}

/* v1.3 full bookings, payments and invoices */
.finance-table {
  min-width: 1420px;
}
.finance-table td > small,
.finance-table td small {
  display: block;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.4;
  margin-top: 4px;
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.finance-table td > code {
  display: block;
  max-width: 210px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 10px;
  background: #f6f6f3;
  border-radius: 6px;
  padding: 4px 6px;
}
.bookings-full {
  min-width: 1580px;
}
.payments-full {
  min-width: 1700px;
}
.invoices-full {
  min-width: 1250px;
}
.row-actions {
  display: flex;
  gap: 5px;
  margin-top: 7px;
  align-items: center;
}
.vertical-actions {
  flex-direction: column;
  align-items: stretch;
  min-width: 112px;
}
.tiny {
  padding: 6px 8px !important;
  font-size: 9px !important;
  border-radius: 7px !important;
  white-space: nowrap;
}
.muted-cell {
  color: var(--muted);
  font-size: 10px;
}
.warn-text {
  color: #9a6b05 !important;
  font-weight: 750;
}
.type-pill {
  display: inline-flex;
  border-radius: 999px;
  padding: 5px 8px;
  background: #f1f1ee;
  font-size: 9px;
  font-weight: 800;
  white-space: nowrap;
}
.type-pill.deposit {
  background: #eef3ff;
  color: #3d58a1;
}
.error-chip {
  display: block;
  max-width: 180px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border-radius: 7px;
  background: #fff0f0;
  color: #9e2929;
  padding: 5px 7px;
  font-size: 9px;
  font-weight: 700;
}
.invoice-sent,
.invoice-unsent {
  display: inline-flex;
  border-radius: 999px;
  padding: 5px 8px;
  font-size: 9px;
  font-weight: 850;
}
.invoice-sent {
  background: #e9f7f1;
  color: #08754f;
}
.invoice-unsent {
  background: #f1f1ee;
  color: #696963;
}
.booking-toolbar {
  align-items: center;
  flex-wrap: wrap;
}
.booking-toolbar > input {
  flex: 1 1 360px;
}
.booking-toolbar > select {
  flex: 0 0 auto;
}
.booking-toolbar .mini-field {
  min-width: 150px;
}
.payment-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.payment-detail-grid > div {
  border: 1px solid var(--line);
  background: #fafaf8;
  border-radius: 10px;
  padding: 10px;
  min-width: 0;
}
.payment-detail-grid > div.full {
  grid-column: 1/-1;
}
.payment-detail-grid span {
  display: block;
  font-size: 9px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.45px;
  margin-bottom: 4px;
}
.payment-detail-grid b,
.payment-detail-grid code {
  display: block;
  font-size: 11px;
  overflow-wrap: anywhere;
}
.payment-detail-grid small {
  display: block;
  color: var(--muted);
  font-size: 9px;
  margin-top: 3px;
}
.payment-error {
  background: #fff7f7 !important;
  border-color: #efd2d2 !important;
  color: #9e2929;
}
.invoice-action-card {
  margin-top: 16px;
  border: 1px solid #d9e6df;
  background: #f5fbf8;
  border-radius: 12px;
  padding: 13px;
  display: flex;
  gap: 15px;
  align-items: center;
  justify-content: space-between;
}
.invoice-action-card > div:first-child {
  min-width: 0;
}
.invoice-action-card span {
  display: block;
  font-size: 9px;
  text-transform: uppercase;
  color: #678074;
  letter-spacing: 0.5px;
  font-weight: 800;
}
.invoice-action-card b {
  display: block;
  font-size: 14px;
  margin-top: 3px;
}
.invoice-action-card small {
  display: block;
  font-size: 10px;
  color: var(--muted);
  margin-top: 2px;
}
.invoice-buttons {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.page-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}
.toolbar.multi select {
  max-width: 220px;
}
.finance-table tr[data-booking] {
  cursor: pointer;
}
.finance-table tr[data-booking]:hover td {
  background: #fbfbf9;
}
@media (max-width: 760px) {
  .payment-detail-grid {
    grid-template-columns: 1fr;
  }
  .invoice-action-card {
    align-items: stretch;
    flex-direction: column;
  }
  .invoice-buttons {
    justify-content: stretch;
  }
  .invoice-buttons button {
    flex: 1;
  }
  .booking-toolbar .mini-field {
    min-width: 0;
  }
  .page-actions {
    width: 100%;
    flex-wrap: wrap;
  }
  .page-actions button {
    flex: 1;
  }
  .finance-table {
    min-width: 1320px;
  }
}

/* v1.4 AI Invoice Studio */
button.ai,
.ai.primary {
  border: 1px solid #173b31;
  background: #173b31;
  color: #fff;
  border-radius: 10px;
  padding: 11px 15px;
  font-weight: 800;
}
.ai:hover,
.ai.primary:hover {
  background: #0d2d25;
}
.ai.compact {
  padding: 9px 13px;
  font-size: 13px;
}
.ai.tiny {
  border-color: #173b31 !important;
  background: #173b31 !important;
  color: #fff !important;
}
.ai-settings-panel {
  margin-top: 17px;
}
.ai-invoice-modal {
  width: min(1180px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
}
.ai-invoice-body {
  padding: 0;
}
.ai-studio-toolbar {
  position: sticky;
  top: 0;
  z-index: 4;
  background: #fff;
  border-bottom: 1px solid var(--line);
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
}
.ai-studio-toolbar > div:first-child {
  display: grid;
  gap: 5px;
}
.ai-studio-toolbar small {
  color: var(--muted);
  font-size: 10px;
}
.ai-model-pill {
  display: inline-flex;
  width: max-content;
  padding: 5px 8px;
  border-radius: 999px;
  background: #e7f3ee;
  color: #145a43;
  font-size: 10px;
  font-weight: 850;
}
.ai-studio-grid {
  display: grid;
  grid-template-columns: minmax(420px, 0.85fr) minmax(520px, 1.15fr);
  min-height: 660px;
}
.ai-editor {
  padding: 18px;
  border-right: 1px solid var(--line);
  background: #fbfbf9;
  overflow: auto;
}
.ai-preview-wrap {
  padding: 24px;
  background: #eceeeb;
  overflow: auto;
}
.ai-preview-label {
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 1.1px;
  color: #76766f;
  margin: 0 0 9px;
}
.ai-section-editor {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 11px;
  padding: 12px;
  margin-bottom: 9px;
}
.ai-section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.ai-section-head b {
  font-size: 11px;
}
.ai-warnings {
  margin: 13px 18px 0;
  display: grid;
  gap: 5px;
}
.ai-warnings span {
  display: block;
  border-radius: 8px;
  background: #fff8e8;
  border: 1px solid #ead8ad;
  padding: 8px 10px;
  color: #806016;
  font-size: 10px;
}
.ai-empty-state,
.ai-generating {
  padding: 58px 26px;
  text-align: center;
  max-width: 680px;
  margin: auto;
}
.ai-empty-state h3,
.ai-generating h3 {
  margin: 16px 0 7px;
  font-size: 22px;
}
.ai-empty-state p,
.ai-generating p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}
.ai-orb {
  width: 60px;
  height: 60px;
  border-radius: 20px;
  background: #173b31;
  color: #fff;
  display: grid;
  place-items: center;
  margin: auto;
  font-weight: 900;
  letter-spacing: -1px;
}
.ai-orb.pulse {
  animation: aiPulse 1.4s infinite;
}
@keyframes aiPulse {
  50% {
    transform: scale(1.06);
    box-shadow: 0 0 0 11px rgba(23, 59, 49, 0.08);
  }
}
.ai-reference-card {
  display: flex;
  gap: 14px;
  align-items: center;
  text-align: left;
  border: 1px solid var(--line);
  background: #fafaf8;
  border-radius: 13px;
  padding: 13px;
  margin: 20px auto;
  max-width: 530px;
}
.ai-reference-card img {
  width: 76px;
  height: 76px;
  object-fit: contain;
  background: #fff;
  border-radius: 9px;
}
.ai-reference-card b,
.ai-reference-card span {
  display: block;
}
.ai-reference-card span {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.45;
  margin-top: 4px;
}
.facture-preview {
  width: 100%;
  max-width: 710px;
  min-height: 930px;
  margin: auto;
  background: #fff;
  box-shadow: 0 10px 35px rgba(0, 0, 0, 0.09);
  padding: 0 34px 30px;
  font-size: 10px;
  color: #242424;
}
.facture-mint {
  height: 25px;
  background: #d8f4e8;
  margin: 0 -34px 28px;
}
.facture-head {
  display: flex;
  justify-content: space-between;
  gap: 28px;
}
.facture-brand {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  max-width: 59%;
}
.facture-brand img {
  width: 74px;
  height: 74px;
  object-fit: contain;
}
.facture-brand b,
.facture-client b {
  display: block;
  font-size: 11px;
  margin-bottom: 6px;
}
.facture-brand span,
.facture-client span {
  display: block;
  color: #5c5c59;
  line-height: 1.45;
}
.facture-client {
  min-width: 32%;
  padding-top: 3px;
}
.facture-title-row {
  margin-top: 28px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
}
.facture-title-row h3 {
  margin: 0;
  font-size: 18px;
}
.facture-title-row p {
  margin: 7px 0 4px;
}
.facture-title-row small {
  color: #696965;
}
.facture-title-row > div:last-child {
  display: grid;
  gap: 5px;
  text-align: right;
  color: #5d5d59;
}
.facture-table-head,
.facture-line {
  display: grid;
  grid-template-columns: minmax(230px, 1fr) 72px 96px 55px 88px;
  align-items: start;
}
.facture-table-head {
  margin-top: 28px;
  background: #111;
  color: #fff;
  padding: 9px 10px;
  font-weight: 850;
  gap: 7px;
}
.facture-line {
  padding: 12px 10px;
  border-bottom: 1px solid #deded9;
  gap: 7px;
}
.facture-line > div > b {
  display: block;
  margin-bottom: 7px;
}
.facture-line small {
  display: block;
  color: #565652;
  line-height: 1.45;
  margin: 3px 0;
}
.facture-line.zero {
  background: #fbfbf9;
}
.facture-terms {
  padding: 14px 10px;
  border-bottom: 1px solid #deded9;
}
.facture-terms > b {
  display: block;
  text-decoration: underline;
  margin-bottom: 8px;
}
.facture-terms small {
  display: block;
  color: #555;
  line-height: 1.5;
  margin: 3px 0;
}
.facture-bottom {
  margin-top: 26px;
  display: grid;
  grid-template-columns: 1fr 200px;
  gap: 45px;
}
.facture-bottom > div > b {
  display: block;
  background: #111;
  color: #fff;
  padding: 9px 11px;
}
.facture-bottom > div > span {
  display: block;
  margin-top: 13px;
}
.facture-bottom dl {
  margin: 0;
}
.facture-bottom dl div {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid #e0e0dc;
}
.facture-bottom dl dt {
  font-weight: 800;
}
.facture-bottom dl dd {
  margin: 0;
}
.facture-bottom dl .grand {
  font-size: 12px;
  border-bottom: 0;
  padding-top: 13px;
}
.facture-preview footer {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  border-top: 1px solid #ddd;
  margin-top: 65px;
  padding-top: 15px;
  color: #767671;
}
.facture-preview footer b,
.facture-preview footer span {
  display: block;
  line-height: 1.45;
}
.facture-preview footer b {
  color: #60605c;
  margin-bottom: 3px;
}
@media (max-width: 980px) {
  .ai-studio-grid {
    grid-template-columns: 1fr;
  }
  .ai-editor {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .ai-preview-wrap {
    padding: 14px;
  }
  .ai-studio-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }
  .ai-studio-toolbar .page-actions {
    width: 100%;
    flex-wrap: wrap;
  }
  .ai-studio-toolbar .page-actions button {
    flex: 1;
  }
  .facture-preview {
    min-width: 650px;
  }
}
@media (max-width: 760px) {
  .ai-invoice-modal {
    width: calc(100vw - 10px);
    max-height: calc(100vh - 10px);
  }
  .ai-editor {
    padding: 13px;
  }
  .ai-preview-wrap {
    overflow: auto;
  }
  .ai-empty-state,
  .ai-generating {
    padding: 40px 18px;
  }
  .ai-settings-panel .page-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .ai-reference-card {
    align-items: flex-start;
  }
}

/* v1.5 mobile-first admin + exact PDF preview + France 09/2026 invoice readiness */
.reform-banner {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  background: #eef7f3;
  border: 1px solid #cee3d9;
  border-radius: 14px;
  padding: 14px 16px;
  margin: -6px 0 16px;
}
.reform-banner b,
.reform-banner span {
  display: block;
}
.reform-banner b {
  font-size: 12px;
}
.reform-banner span {
  font-size: 10px;
  color: #53665e;
  line-height: 1.45;
  margin-top: 4px;
}
.reform-banner > strong {
  font-size: 10px;
  border: 1px solid #b9d5c8;
  background: #fff;
  border-radius: 999px;
  padding: 7px 10px;
  color: #225a47;
  white-space: nowrap;
}
.france-compliance {
  margin: 14px 18px 0;
  border: 1px solid #d8ded9;
  background: #fbfcfa;
  border-radius: 13px;
  padding: 13px;
}
.france-compliance-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}
.france-compliance-head b,
.france-compliance-head span {
  display: block;
}
.france-compliance-head b {
  font-size: 12px;
}
.france-compliance-head span {
  font-size: 10px;
  color: var(--muted);
  margin-top: 3px;
}
.reform-pill {
  font-size: 9px !important;
  font-weight: 850 !important;
  color: #155e46 !important;
  background: #e5f4ed;
  border-radius: 999px;
  padding: 5px 8px;
  white-space: nowrap;
  margin: 0 !important;
}
.compliance-checks {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
  margin-top: 11px;
}
.compliance-check {
  display: flex;
  gap: 7px;
  align-items: flex-start;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 9px;
  padding: 8px;
  min-width: 0;
}
.compliance-check i {
  font-style: normal;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 10px;
  font-weight: 900;
  flex: 0 0 auto;
}
.compliance-check.ok i {
  background: #e6f5ee;
  color: #08754f;
}
.compliance-check.warn i {
  background: #fff0d7;
  color: #8c5d00;
}
.compliance-check b,
.compliance-check span {
  display: block;
  overflow-wrap: anywhere;
}
.compliance-check b {
  font-size: 9px;
}
.compliance-check span {
  font-size: 8px;
  color: var(--muted);
  line-height: 1.3;
  margin-top: 2px;
}
.einvoice-note,
.france-mini-note {
  font-size: 10px;
  line-height: 1.5;
  color: #5a5a55;
  background: #f5f5f2;
  border-radius: 9px;
  padding: 9px 10px;
  margin: 10px 0 0;
}
.france-mini-note {
  max-width: 530px;
  margin: 10px auto 18px;
  text-align: left;
}
.pdf-preview-card {
  background: #dfe3df;
  border-radius: 12px;
  padding: 10px;
  min-height: 650px;
}
.pdf-preview-status {
  font-size: 9px;
  font-weight: 750;
  color: #6a6a65;
  padding: 2px 2px 9px;
}
.pdf-preview-status.ready {
  color: #1a684e;
}
.pdf-preview-status.bad {
  color: #a52d2d;
}
.ai-pdf-frame {
  display: block;
  width: 100%;
  height: 780px;
  border: 0;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.11);
}

@media (max-width: 1040px) {
  .compliance-checks {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .ai-pdf-frame {
    height: 720px;
  }
}
@media (max-width: 760px) {
  html,
  body {
    max-width: 100%;
    overflow-x: hidden;
  }
  .content {
    padding-left: 10px;
    padding-right: 10px;
    padding-bottom: calc(78px + env(safe-area-inset-bottom));
  }
  .page-title {
    margin-bottom: 18px;
  }
  .page-title > div {
    min-width: 0;
  }
  .page-title h1 {
    font-size: 25px;
  }
  .page-title p {
    font-size: 12px;
    line-height: 1.45;
  }
  .page-actions,
  .toolbar.multi {
    width: 100%;
  }
  .page-actions > * {
    min-height: 42px;
  }
  .toolbar.multi > input,
  .toolbar.multi > select,
  .toolbar.multi > .mini-field {
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
  }
  .mini-field input {
    min-width: 0 !important;
  }
  .stats-grid,
  .compact-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .stat,
  .stat-card {
    min-width: 0;
    padding: 13px;
  }
  .stat b,
  .stat-card > strong {
    font-size: 21px;
  }
  .grid-two {
    gap: 10px;
  }
  .panel {
    border-radius: 13px;
    padding: 14px;
  }
  .panel.flush {
    padding: 0;
  }
  .panel-head {
    align-items: flex-start;
  }
  .panel-head p {
    font-size: 10px;
  }
  .cards-grid {
    gap: 10px;
  }
  .drawer {
    width: 100vw;
    max-width: none;
  }
  .drawer-head {
    padding: calc(14px + env(safe-area-inset-top)) 14px 14px;
  }
  .drawer-body {
    padding: 14px 12px calc(30px + env(safe-area-inset-bottom));
  }
  .drawer-actions {
    position: sticky;
    bottom: 0;
    background: #fff;
    border-top: 1px solid var(--line);
    padding: 10px 0 calc(8px + env(safe-area-inset-bottom));
    z-index: 3;
  }
  .drawer-actions button {
    flex: 1;
  }
  .modal,
  .ai-invoice-modal {
    width: 100vw !important;
    height: 100dvh;
    max-height: 100dvh !important;
    left: 0;
    top: 0;
    border: 0;
    border-radius: 0;
    transform: translateY(4px) !important;
  }
  .modal.open,
  .ai-invoice-modal.open {
    transform: none !important;
  }
  .modal-head {
    position: sticky;
    top: 0;
    z-index: 9;
    background: #fff;
    padding: calc(12px + env(safe-area-inset-top)) 12px 12px;
  }
  .modal-body {
    padding: 12px;
  }
  .ai-invoice-body {
    padding: 0;
  }
  .ai-studio-toolbar {
    top: 0;
    padding: 10px 10px;
    gap: 9px;
  }
  .ai-studio-toolbar .page-actions {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 7px;
  }
  .ai-studio-toolbar .page-actions button {
    width: 100%;
    min-height: 40px;
  }
  .france-compliance {
    margin: 10px;
  }
  .france-compliance-head {
    flex-direction: column;
  }
  .compliance-checks {
    grid-template-columns: 1fr 1fr;
  }
  .ai-studio-grid {
    display: flex;
    flex-direction: column;
    min-height: 0;
  }
  .ai-editor {
    padding: 10px;
    border: 0;
  }
  .ai-preview-wrap {
    padding: 10px;
    background: #e9ece9;
    overflow: visible;
  }
  .pdf-preview-card {
    padding: 7px;
    min-height: 0;
  }
  .ai-pdf-frame {
    height: 68dvh;
    min-height: 520px;
    border-radius: 6px;
  }
  .ai-section-editor {
    padding: 10px;
  }
  .ai-reference-card {
    max-width: 100%;
  }
  .reform-banner {
    align-items: flex-start;
    flex-direction: column;
    padding: 12px;
    margin-top: 0;
  }
  .reform-banner > strong {
    white-space: normal;
  }
  .finance-table {
    min-width: 0 !important;
    width: 100%;
    display: block;
    font-size: 12px;
  }
  .finance-table thead {
    display: none;
  }
  .finance-table tbody {
    display: grid;
    gap: 10px;
  }
  .finance-table tr {
    display: block;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: #fff;
    overflow: hidden;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.025);
  }
  .finance-table td,
  .finance-table td:nth-child(4) {
    display: grid !important;
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 9px;
    align-items: start;
    width: 100%;
    padding: 10px 11px;
    border-bottom: 1px solid #efefec;
    min-height: 38px;
  }
  .finance-table td:last-child {
    border-bottom: 0;
  }
  .finance-table td::before {
    font-size: 8px;
    font-weight: 850;
    letter-spacing: 0.55px;
    text-transform: uppercase;
    color: #888880;
    padding-top: 2px;
  }
  .finance-table td > * {
    min-width: 0;
  }
  .finance-table td > small,
  .finance-table td small {
    max-width: none;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
  }
  .finance-table td > code {
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  .bookings-full td:nth-child(1)::before {
    content: "Booking";
  }
  .bookings-full td:nth-child(2)::before {
    content: "Trip";
  }
  .bookings-full td:nth-child(3)::before {
    content: "Route";
  }
  .bookings-full td:nth-child(4)::before {
    content: "Vehicle / driver";
  }
  .bookings-full td:nth-child(5)::before {
    content: "Client";
  }
  .bookings-full td:nth-child(6)::before {
    content: "Total";
  }
  .bookings-full td:nth-child(7)::before {
    content: "Booking status";
  }
  .bookings-full td:nth-child(8)::before {
    content: "Payment";
  }
  .bookings-full td:nth-child(9)::before {
    content: "Deposit";
  }
  .bookings-full td:nth-child(10)::before {
    content: "Invoice";
  }
  .payments-full td:nth-child(1)::before {
    content: "Booking";
  }
  .payments-full td:nth-child(2)::before {
    content: "Client / route";
  }
  .payments-full td:nth-child(3)::before {
    content: "Provider";
  }
  .payments-full td:nth-child(4)::before {
    content: "Transaction";
  }
  .payments-full td:nth-child(5)::before {
    content: "Amount";
  }
  .payments-full td:nth-child(6)::before {
    content: "Status";
  }
  .payments-full td:nth-child(7)::before {
    content: "Paid / return";
  }
  .payments-full td:nth-child(8)::before {
    content: "Type";
  }
  .payments-full td:nth-child(9)::before {
    content: "Diagnostics";
  }
  .payments-full td:nth-child(10)::before {
    content: "Invoice";
  }
  .invoices-full td:nth-child(1)::before {
    content: "Invoice";
  }
  .invoices-full td:nth-child(2)::before {
    content: "Booking";
  }
  .invoices-full td:nth-child(3)::before {
    content: "Client";
  }
  .invoices-full td:nth-child(4)::before {
    content: "Trip / route";
  }
  .invoices-full td:nth-child(5)::before {
    content: "Total";
  }
  .invoices-full td:nth-child(6)::before {
    content: "Payment";
  }
  .invoices-full td:nth-child(7)::before {
    content: "AI facture";
  }
  .invoices-full td:nth-child(8)::before {
    content: "Email status";
  }
  .invoices-full td:nth-child(9)::before {
    content: "Actions";
  }
  .row-actions,
  .vertical-actions {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    min-width: 0;
  }
  .row-actions button,
  .vertical-actions button {
    white-space: normal !important;
    min-height: 36px;
  }
  .table-wrap {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .pager {
    justify-content: space-between;
    padding: 10px 4px;
    gap: 4px;
  }
  .pager span {
    font-size: 10px;
    text-align: center;
  }
  .pager button {
    padding: 8px 9px;
  }
  .resource-editor textarea {
    min-height: 55dvh;
  }
  .calendar-day {
    padding: 13px;
  }
  .calendar-item {
    grid-template-columns: 52px minmax(0, 1fr);
    gap: 9px;
  }
  .calendar-tail {
    grid-column: 2;
  }
  .dispatch-column {
    padding: 11px;
  }
  .invoice-action-card {
    margin-top: 10px;
  }
  .toast {
    bottom: calc(16px + env(safe-area-inset-bottom));
    max-width: calc(100vw - 20px);
    text-align: center;
  }
}
@media (max-width: 420px) {
  .stats-grid,
  .compact-stats {
    grid-template-columns: 1fr;
  }
  .compliance-checks {
    grid-template-columns: 1fr;
  }
  .row-actions,
  .vertical-actions {
    grid-template-columns: 1fr;
  }
  .ai-studio-toolbar .page-actions {
    grid-template-columns: 1fr 1fr;
  }
  .content {
    padding-left: 8px;
    padding-right: 8px;
  }
  .mobile-header {
    padding-left: 8px;
    padding-right: 8px;
  }
}

/* v1.6 mobile command-center: fixed viewport, bottom tabs, dense records */
.mobile-dashboard,
.mobile-bottom-nav {
  display: none;
}
@media (max-width: 760px) {
  html,
  body,
  .app-shell {
    width: 100%;
    height: 100dvh;
    min-height: 100dvh;
    overflow: hidden;
    overscroll-behavior: none;
  }
  body {
    position: fixed;
    inset: 0;
  }
  .mobile-header {
    height: calc(48px + env(safe-area-inset-top));
    min-height: 0;
    padding: env(safe-area-inset-top) 8px 0;
    display: flex;
    background: rgba(247, 247, 245, 0.97);
  }
  .mobile-header button {
    width: 34px;
    height: 34px;
    font-size: 18px;
  }
  .mobile-header strong {
    font-size: 12px;
    line-height: 1.05;
  }
  .mobile-header span {
    font-size: 9px;
    line-height: 1.1;
  }
  .content {
    position: fixed;
    left: 0;
    right: 0;
    top: calc(48px + env(safe-area-inset-top));
    bottom: calc(55px + env(safe-area-inset-bottom));
    margin: 0;
    max-width: none;
    padding: 6px 8px !important;
    overflow: hidden;
    background: var(--bg);
  }
  .page.active {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    overflow: hidden;
  }
  .page-title {
    flex: 0 0 auto;
    min-height: 34px;
    margin: 0 0 5px !important;
    display: flex;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between;
    gap: 6px !important;
  }
  .page-title .eyebrow,
  .page-title > div > p:not(.eyebrow) {
    display: none;
  }
  .page-title h1 {
    font-size: 18px !important;
    line-height: 1.05;
    margin: 0 !important;
    letter-spacing: -0.45px;
  }
  .page-actions {
    width: auto !important;
    display: flex;
    flex-wrap: nowrap !important;
    gap: 5px;
    align-items: center;
    justify-content: flex-end;
  }
  .page-actions > * {
    min-height: 30px !important;
    height: 30px;
    padding: 5px 8px !important;
    border-radius: 8px;
    font-size: 10px;
    white-space: nowrap;
  }
  #page-dashboard > .page-title {
    display: none !important;
  }
  #page-dashboard > :not(.page-title):not(.mobile-dashboard) {
    display: none !important;
  }
  .mobile-dashboard {
    display: flex;
    flex-direction: column;
    gap: 5px;
    height: 100%;
    min-height: 0;
    overflow: hidden;
  }
  .m-kpis {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: repeat(2, 64px);
    gap: 5px;
    flex: 0 0 auto;
  }
  .m-kpis button {
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 11px;
    padding: 6px 9px;
    text-align: left;
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto 1fr auto;
    align-items: center;
    min-width: 0;
  }
  .m-kpis span {
    font-size: 8px;
    font-weight: 800;
    letter-spacing: 0.45px;
    text-transform: uppercase;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .m-kpis b {
    grid-column: 1/-1;
    font-size: 18px;
    line-height: 1;
    letter-spacing: -0.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .m-kpis small {
    grid-column: 1/-1;
    font-size: 8px;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .m-attention {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5px;
    flex: 0 0 34px;
  }
  .m-attention button {
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 9px;
    padding: 4px 8px;
    display: flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
  }
  .m-attention button.warn {
    background: #fff9ed;
    border-color: #f0dfb7;
  }
  .m-attention button.bad {
    background: #fff4f4;
    border-color: #efcccc;
  }
  .m-attention i {
    font-style: normal;
    font-size: 14px;
    font-weight: 850;
    line-height: 1;
  }
  .m-attention span {
    font-size: 8px;
    font-weight: 750;
    color: #555;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .m-dash-tabs {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 3px;
    background: #e9e9e5;
    border-radius: 9px;
    padding: 3px;
    flex: 0 0 34px;
  }
  .m-dash-tabs button {
    border: 0;
    background: transparent;
    border-radius: 7px;
    font-size: 9px;
    font-weight: 750;
    color: #6c6c67;
  }
  .m-dash-tabs button.active {
    background: #fff;
    color: #171717;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.07);
  }
  .m-dash-pane {
    flex: 1;
    min-height: 0;
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 11px;
    padding: 4px 8px;
    overflow: hidden;
  }
  .m-trip-list {
    height: 100%;
    display: grid;
    grid-auto-rows: minmax(0, 1fr);
  }
  .m-trip-row {
    border: 0;
    border-top: 1px solid #efefec;
    background: transparent;
    padding: 4px 0;
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) auto;
    gap: 7px;
    align-items: center;
    text-align: left;
    min-height: 0;
  }
  .m-trip-row:first-child {
    border-top: 0;
  }
  .m-trip-row time {
    font-style: normal;
    font-size: 8px;
    color: var(--muted);
    text-transform: uppercase;
  }
  .m-trip-row time b {
    display: block;
    font-size: 12px;
    color: var(--text);
    margin-top: 1px;
  }
  .m-trip-row > div {
    min-width: 0;
  }
  .m-trip-row strong {
    display: block;
    font-size: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .m-trip-row div span {
    display: block;
    font-size: 8px;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
  }
  .m-trip-row em {
    font-style: normal;
    font-size: 9px;
    font-weight: 800;
    white-space: nowrap;
  }
  .m-pipeline {
    height: 100%;
    display: grid;
    grid-auto-rows: minmax(0, 1fr);
  }
  .m-pipeline > div {
    display: grid;
    grid-template-columns: 116px 1fr;
    gap: 8px;
    align-items: center;
    border-top: 1px solid #f0efec;
  }
  .m-pipeline > div:first-child {
    border-top: 0;
  }
  .m-pipeline span {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
  }
  .m-pipeline span b {
    font-size: 9px;
  }
  .m-pipeline i {
    height: 5px;
    background: #efefec;
    border-radius: 999px;
    overflow: hidden;
  }
  .m-pipeline u {
    display: block;
    height: 100%;
    background: #292a28;
    border-radius: 999px;
    text-decoration: none;
  }
  .m-activity-bars {
    height: 100%;
    display: flex;
    align-items: flex-end;
    gap: 5px;
    padding: 10px 2px 4px;
  }
  .m-activity-bars > div {
    height: 100%;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    gap: 3px;
  }
  .m-activity-bars i {
    width: 100%;
    min-height: 6px;
    background: #252624;
    border-radius: 3px 3px 1px 1px;
  }
  .m-activity-bars span {
    font-size: 7px;
    color: var(--muted);
  }
  .m-empty {
    height: 100%;
    display: grid;
    place-items: center;
    font-size: 10px;
    color: var(--muted);
  }

  .mobile-bottom-nav {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    position: fixed;
    z-index: 28;
    left: 0;
    right: 0;
    bottom: 0;
    height: calc(55px + env(safe-area-inset-bottom));
    padding: 3px 5px env(safe-area-inset-bottom);
    background: rgba(248, 248, 246, 0.98);
    border-top: 1px solid var(--line);
    backdrop-filter: blur(16px);
  }
  .mobile-bottom-nav button {
    border: 0;
    background: transparent;
    border-radius: 9px;
    color: #777773;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
    min-width: 0;
    padding: 2px 0;
  }
  .mobile-bottom-nav button i {
    font-style: normal;
    font-size: 16px;
    line-height: 1;
  }
  .mobile-bottom-nav button span {
    font-size: 8px;
    font-weight: 750;
  }
  .mobile-bottom-nav button.active {
    color: #111;
    background: #ecece8;
  }

  .toolbar.multi,
  .toolbar {
    flex: 0 0 auto;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 5px;
    margin: 0 0 5px !important;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .toolbar::-webkit-scrollbar,
  .toolbar.multi::-webkit-scrollbar {
    display: none;
  }
  .toolbar input,
  .toolbar select,
  .toolbar.multi > input,
  .toolbar.multi > select,
  .toolbar.multi > .mini-field {
    flex: 0 0 auto !important;
    width: auto !important;
    min-width: 118px !important;
    max-width: 190px !important;
    height: 31px !important;
    min-height: 31px !important;
    padding: 5px 8px !important;
    border-radius: 8px;
    font-size: 9px;
  }
  .toolbar input,
  .toolbar.multi > input {
    min-width: 180px !important;
    max-width: 240px !important;
  }
  .toolbar .mini-field {
    padding-left: 7px !important;
    gap: 4px !important;
  }
  .toolbar .mini-field input {
    height: 29px !important;
    min-height: 29px !important;
    min-width: 112px !important;
    padding: 4px !important;
  }
  #bookingPerPage,
  #paymentPerPage,
  #invoicePerPage {
    display: none !important;
  }
  #exportBookings,
  #exportPayments {
    display: none !important;
  }
  .inline-summary {
    flex: 0 0 auto;
    margin: 0 0 4px !important;
    font-size: 8px;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .compact-stats {
    display: flex !important;
    flex: 0 0 53px;
    gap: 5px;
    margin: 0 0 5px !important;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
  }
  .compact-stats::-webkit-scrollbar {
    display: none;
  }
  .compact-stats .stat-card {
    flex: 0 0 112px;
    min-height: 53px !important;
    height: 53px;
    padding: 6px 8px !important;
    border-radius: 9px;
  }
  .compact-stats .stat-card > span {
    font-size: 7px;
  }
  .compact-stats .stat-card > strong {
    font-size: 13px !important;
    margin: 3px 0 1px;
  }
  .compact-stats .stat-card > small {
    font-size: 7px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .panel.flush {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    border-radius: 11px !important;
    overflow: hidden;
  }
  .panel.flush > .table-wrap {
    flex: 1;
    min-height: 0;
    overflow: hidden !important;
  }
  .pager {
    flex: 0 0 34px;
    min-height: 34px;
    padding: 3px 5px !important;
    border-top: 1px solid var(--line);
    gap: 4px;
  }
  .pager button {
    height: 27px;
    padding: 4px 8px !important;
    font-size: 9px;
    border-radius: 7px;
  }
  .pager span {
    font-size: 8px !important;
    line-height: 1.1;
  }
  .mobile-record-list {
    height: 100%;
    min-height: 0;
    display: grid;
    grid-auto-rows: minmax(0, 1fr);
    gap: 4px;
    padding: 4px;
    background: #f5f5f2;
  }
  .mobile-record-card {
    min-height: 0;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: #fff;
    overflow: hidden;
    box-shadow: none;
  }
  button.mobile-record-card,
  .mrec-main {
    width: 100%;
    height: 100%;
    border: 0;
    background: transparent;
    text-align: left;
    padding: 6px 8px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    min-width: 0;
  }
  .mobile-record-card article {
    min-height: 0;
  }
  .payment-record,
  .invoice-record {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 92px;
  }
  .payment-record .mrec-main,
  .invoice-record .mrec-main {
    min-width: 0;
  }
  .mrec-top,
  .mrec-mid,
  .mrec-foot {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
  }
  .mrec-top .mrec-id {
    font-size: 8px;
    font-weight: 850;
    color: #6a6a65;
    flex: 0 0 auto;
  }
  .mrec-top > b {
    font-size: 9px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
  }
  .mrec-money {
    margin-left: auto;
    font-size: 10px;
    font-weight: 850;
    white-space: nowrap;
  }
  .mrec-mid strong {
    font-size: 9px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
  }
  .mrec-mid > span {
    margin-left: auto;
    display: flex;
    gap: 3px;
    white-space: nowrap;
  }
  .mrec-mid .badge,
  .mrec-mid .pay-badge {
    font-size: 7px;
    padding: 3px 5px;
  }
  .mrec-route {
    font-size: 8px;
    color: #5f5f5b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .m-arrow {
    color: #999;
  }
  .mrec-foot {
    font-size: 7px;
    color: #8a8a84;
    white-space: nowrap;
    overflow: hidden;
  }
  .mrec-foot span {
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .mrec-foot span + span:before {
    content: "·";
    margin-right: 6px;
  }
  .mrec-actions {
    border-left: 1px solid #efefec;
    padding: 4px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 3px;
    align-content: center;
  }
  .mrec-actions button {
    min-height: 21px !important;
    height: 21px;
    padding: 2px 4px !important;
    font-size: 7px !important;
    border-radius: 6px !important;
    white-space: nowrap;
  }

  .reform-banner {
    flex: 0 0 auto;
    min-height: 34px;
    margin: 0 0 5px !important;
    padding: 5px 8px !important;
    display: flex !important;
    flex-direction: row !important;
    gap: 6px !important;
    align-items: center !important;
    border-radius: 9px;
  }
  .reform-banner b {
    font-size: 8px;
  }
  .reform-banner span {
    display: none;
  }
  .reform-banner > strong {
    font-size: 7px;
    padding: 4px 6px;
    white-space: nowrap !important;
    margin-left: auto;
  }
  .cards-grid {
    flex: 1;
    min-height: 0;
    display: flex !important;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 6px;
    scroll-snap-type: x mandatory;
  }
  .cards-grid > .entity-card {
    flex: 0 0 min(82vw, 310px);
    height: 100%;
    overflow: hidden;
    scroll-snap-align: start;
    padding: 10px;
  }
  .entity-card-head {
    margin-bottom: 7px;
  }
  .entity-card-head h3 {
    font-size: 13px;
  }
  .entity-card dl > div {
    padding: 6px 0;
  }
  .entity-actions {
    margin-top: 7px;
  }
  .calendar-list,
  .dispatch-board,
  .resource-layout,
  #logsTable,
  .backup-list {
    flex: 1;
    min-height: 0;
    overflow: auto;
    overscroll-behavior: contain;
  }
  .calendar-list {
    gap: 6px;
  }
  .calendar-day {
    padding: 8px;
    border-radius: 10px;
  }
  .calendar-day h3 {
    margin-bottom: 5px;
    font-size: 10px;
  }
  .calendar-item {
    padding: 6px 0 !important;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 6px;
  }
  .calendar-item time {
    font-size: 9px;
  }
  .calendar-item b {
    font-size: 9px;
  }
  .calendar-item span,
  .calendar-main small {
    font-size: 8px;
  }
  .dispatch-board {
    display: flex !important;
    gap: 6px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
  }
  .dispatch-column {
    flex: 0 0 calc(100vw - 26px);
    height: 100%;
    overflow: hidden;
    scroll-snap-align: start;
    border-radius: 10px;
    padding: 7px;
  }
  .dispatch-column > header {
    padding: 2px 3px 5px;
  }
  .dispatch-column > div {
    height: calc(100% - 28px);
    overflow: auto;
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 5px;
  }
  .dispatch-card {
    padding: 8px;
    gap: 5px;
  }
  .dispatch-time b {
    font-size: 14px;
  }
  .dispatch-route b {
    font-size: 9px;
  }
  .dispatch-route span,
  .dispatch-route small {
    font-size: 8px;
  }
  .dispatch-controls select,
  .dispatch-controls button {
    padding: 5px;
    font-size: 8px;
  }
  .resource-layout {
    display: flex !important;
    flex-direction: column;
    gap: 5px;
    overflow: hidden;
  }
  .resource-nav {
    flex: 0 0 32px;
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 4px;
    padding: 0;
  }
  .resource-nav button {
    padding: 5px 8px;
    font-size: 8px;
    border-radius: 7px;
  }
  .resource-editor {
    flex: 1;
    min-height: 0;
    padding: 7px !important;
    display: flex;
    flex-direction: column;
  }
  .resource-editor .panel-head {
    margin-bottom: 4px;
  }
  .resource-editor textarea {
    flex: 1;
    min-height: 0 !important;
    resize: none;
    padding: 8px;
    font-size: 9px;
  }
  #page-settings .grid-two {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5px;
    flex: 0 0 auto;
  }
  #page-settings .grid-two .panel {
    padding: 8px;
  }
  .health-card {
    padding: 7px;
    margin: 3px 0 5px;
    font-size: 8px;
  }
  .health-card dl {
    display: none;
  }
  .prose {
    font-size: 8px;
    line-height: 1.25;
  }
  .prose p {
    margin: 0 0 4px;
  }
  .version-info {
    margin-top: 5px;
    padding: 5px;
    font-size: 7px;
  }
  .ai-settings-panel {
    padding: 8px;
    margin-top: 5px;
  }
  .ai-settings-panel .detail-grid {
    grid-template-columns: 1fr 1fr;
    gap: 5px;
  }
  .ai-settings-panel .field.full {
    display: none;
  }
  .ai-settings-panel .field input {
    padding: 6px;
    font-size: 8px;
  }
  .ai-settings-panel + .panel {
    margin-top: 5px;
  }
  .toast {
    bottom: calc(61px + env(safe-area-inset-bottom)) !important;
  }
}
@media (max-width: 390px) {
  .content {
    padding-left: 5px !important;
    padding-right: 5px !important;
  }
  .m-kpis {
    grid-template-rows: repeat(2, 58px);
  }
  .m-kpis b {
    font-size: 16px;
  }
  .m-kpis small {
    font-size: 7px;
  }
  .m-attention {
    flex-basis: 31px;
  }
  .m-dash-tabs {
    flex-basis: 31px;
  }
  .mobile-record-list {
    gap: 3px;
    padding: 3px;
  }
  .mobile-record-card {
    border-radius: 8px;
  }
  .payment-record,
  .invoice-record {
    grid-template-columns: minmax(0, 1fr) 82px;
  }
  .mrec-actions {
    padding: 3px;
  }
  .mrec-actions button {
    font-size: 6.5px !important;
  }
}

/* =====================================================================
 * v1.7 — operations layer styles
 * ===================================================================== */
.search-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;
  padding: 8px 10px;
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 12px;
  text-align: left;
}
.search-trigger i {
  font-style: normal;
  font-size: 15px;
  color: #3f3f3c;
}
.search-trigger span {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
kbd {
  font: 600 10px/1 Inter, system-ui, sans-serif;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 5px;
  padding: 3px 5px;
  color: var(--muted);
  background: #f7f7f4;
}
.nav-badge {
  margin-left: auto;
  background: #e0dfda;
  color: #3f3f3c;
  font-size: 10px;
  font-weight: 800;
  border-radius: 999px;
  padding: 2px 7px;
}
.nav-badge.bad {
  background: var(--red);
  color: #fff;
}
.user-chip {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 8px 5px 10px;
  border-top: 1px solid var(--line);
  margin-bottom: 6px;
}
.user-chip b {
  font-size: 12px;
}
.user-chip span {
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 700;
}
#mobileSearchButton {
  display: none;
}

/* dashboard: today strip, alerts */
.today-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 17px;
}
.today-strip button {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 12px;
  padding: 11px 14px;
  text-align: left;
  display: grid;
  gap: 2px;
}
.today-strip button span {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--muted);
}
.today-strip button b {
  font-size: 22px;
  letter-spacing: -0.6px;
}
.today-strip button small {
  color: var(--muted);
  font-size: 11px;
}
.today-strip button.warn {
  background: #fff9ed;
  border-color: #f0dfb7;
}
.today-strip button.bad {
  background: #fff4f4;
  border-color: #efcccc;
}
.alert-list {
  display: grid;
  gap: 6px;
}
.alert-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  border: 1px solid var(--line);
  background: #fafaf8;
  border-radius: 10px;
  padding: 9px 11px;
  text-align: left;
}
.alert-row i {
  font-style: normal;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 12px;
  background: #f0dfb7;
  color: #6a4a00;
  flex: 0 0 auto;
}
.alert-row.bad i {
  background: #efcccc;
  color: #8c2b2b;
}
.alert-row b {
  display: block;
  font-size: 13px;
}
.alert-row span {
  font-size: 12px;
  color: var(--muted);
}
.alert-ok {
  display: flex;
  gap: 8px;
  align-items: center;
  color: var(--green);
  font-size: 13px;
  padding: 10px 4px;
}
.alert-ok i {
  font-style: normal;
  font-weight: 800;
}
.alert-more {
  font-size: 12px;
  color: var(--muted);
  padding: 4px;
}

/* search palette */
.search-palette {
  position: fixed;
  left: 50%;
  top: 8vh;
  transform: translate(-50%, -12px);
  width: min(720px, calc(100vw - 32px));
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.22);
  z-index: 70;
  opacity: 0;
  pointer-events: none;
  transition: 0.15s;
  overflow: hidden;
}
.search-palette.open {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, 0);
}
.search-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}
.search-input-row i {
  font-style: normal;
  font-size: 18px;
  color: var(--muted);
}
.search-input-row input {
  flex: 1;
  border: 0;
  outline: none;
  font-size: 16px;
  padding: 6px 0;
  background: transparent;
}
.search-results {
  max-height: 60vh;
  overflow: auto;
  padding: 6px;
}
.search-hint {
  padding: 14px 12px;
  color: var(--muted);
  font-size: 13px;
}
.search-group {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: #8d8d87;
  padding: 10px 10px 4px;
}
.search-row {
  width: 100%;
  border: 0;
  background: transparent;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 9px 10px;
  border-radius: 10px;
  text-align: left;
}
.search-row:hover,
.search-row.active {
  background: #f1f1ee;
}
.search-row .sr-id {
  font-weight: 800;
  font-size: 12px;
  color: #6a6a65;
}
.search-row div {
  min-width: 0;
}
.search-row b {
  display: block;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.search-row div span {
  display: block;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.search-row em {
  font-style: normal;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  gap: 6px;
  align-items: center;
}

/* pills & chips */
.trip-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 999px;
  background: #ededea;
  color: #4a4a46;
  white-space: nowrap;
}
.trip-pill::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.7;
}
.trip-pill.driver_notified {
  background: #eef2fb;
  color: #2f4f9e;
}
.trip-pill.driver_confirmed {
  background: #e6f0fb;
  color: #1d4f9a;
}
.trip-pill.en_route {
  background: #fff3df;
  color: #9a5a00;
}
.trip-pill.arrived {
  background: #fff0cc;
  color: #7a4a00;
}
.trip-pill.on_board {
  background: #e4f4ff;
  color: #0b5b8e;
}
.trip-pill.completed {
  background: var(--green2);
  color: var(--green);
}
.trip-pill.no_show {
  background: #fde8e8;
  color: var(--red);
}
.trip-pill.cancelled {
  background: #f1f1ee;
  color: #8a8a84;
  text-decoration: line-through;
}
.flag-chip {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 6px;
  border: 1px solid transparent;
  white-space: nowrap;
}
.flag-chip.warn {
  background: #fff8e6;
  border-color: #f1e2b5;
  color: #6a4a00;
}
.flag-chip.bad {
  background: #fff1f1;
  border-color: #efcccc;
  color: #8c2b2b;
}
.flag-chip.ok {
  background: var(--green2);
  border-color: #bfe6d4;
  color: var(--green);
}
.flag-chip.muted {
  background: #f4f4f1;
  border-color: #e4e4df;
  color: #6d6d6a;
}
.flight-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  background: #eef2fb;
  color: #2f4f9e;
  white-space: nowrap;
}
.flight-chip.ok {
  background: var(--green2);
  color: var(--green);
}
.flight-chip.warn {
  background: #fff3df;
  color: #9a5a00;
}
.flight-chip.bad {
  background: #fde8e8;
  color: var(--red);
}
.flight-chip.muted {
  background: #f1f1ee;
  color: #8a8a84;
}
.pos-link {
  font-size: 10px;
  font-weight: 700;
  color: var(--green);
  text-decoration: none;
  white-space: nowrap;
}
.test-tag {
  font-style: normal;
  font-size: 9px;
  font-weight: 900;
  background: #f3e8ff;
  color: #7e22ce;
  border-radius: 4px;
  padding: 1px 4px;
  vertical-align: middle;
}
.btn-link {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 7px;
}

/* dispatch 2.0 */
.dispatch-toolbar .check-field {
  gap: 6px;
  align-items: center;
  white-space: nowrap;
}
.check-field input {
  width: auto !important;
  min-width: 0 !important;
  height: auto !important;
  min-height: 0 !important;
  padding: 0 !important;
  margin: 0;
}
.dispatch-board.view-board {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.dispatch-column.live {
  background: #fbf6ea;
}
.dispatch-board.refreshing {
  opacity: 0.55;
  transition: opacity 0.2s;
}
.dispatch-card.is-test {
  background: #fcf8ff;
}
.dispatch-card.late {
  border-color: #efcccc;
}
.dispatch-time small {
  display: block;
  font-size: 10px;
  color: var(--muted);
  margin-top: 3px;
}
.dispatch-route .comment {
  color: #5c5c58;
  font-style: italic;
}
.dispatch-route .note {
  color: #7e22ce;
}
.dispatch-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 6px;
}
.dispatch-actions .tiny {
  padding: 6px 8px;
  font-size: 11px;
}
.dispatch-board.view-list,
.dispatch-board.view-timeline {
  display: block;
}
.dispatch-list table td small {
  display: block;
}
.row-bad td {
  background: #fff7f7;
}
.row-muted td {
  opacity: 0.55;
}

/* driver timeline */
.timeline {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px 8px;
  overflow-x: auto;
}
.tl-head,
.tl-row {
  display: grid;
  grid-template-columns: 170px minmax(560px, 1fr);
  gap: 12px;
  align-items: stretch;
}
.tl-head {
  border-bottom: 1px solid var(--line);
  padding-bottom: 6px;
  margin-bottom: 4px;
}
.tl-head .tl-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #8d8d87;
  align-self: end;
}
.tl-axis {
  position: relative;
  height: 16px;
}
.tl-axis span {
  position: absolute;
  transform: translateX(-50%);
  font-size: 10px;
  color: var(--muted);
}
.tl-row {
  min-height: 56px;
  border-bottom: 1px solid #f0f0ec;
  padding: 6px 0;
}
.tl-row.unassigned {
  background: #fffaf0;
}
.tl-row .tl-label b {
  display: block;
  font-size: 13px;
}
.tl-row .tl-label small {
  display: block;
  font-size: 11px;
  color: var(--muted);
}
.tl-track {
  position: relative;
  min-height: 44px;
}
.tl-track i {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: #f1f1ee;
}
.tl-block {
  position: absolute;
  top: 4px;
  height: 38px;
  border: 0;
  border-radius: 8px;
  background: #e6ecf7;
  color: #1d3a75;
  font-size: 11px;
  font-weight: 700;
  text-align: left;
  padding: 4px 8px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  box-shadow: inset 0 0 0 2px #fff;
}
.tl-block small {
  display: block;
  font-weight: 500;
  font-size: 10px;
  opacity: 0.8;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tl-block.live {
  background: #ffe9c2;
  color: #6a3f00;
}
.tl-block.done {
  background: #d9efe5;
  color: #0a5d40;
}
.tl-block.noshow {
  background: #f7d6d6;
  color: #7d1f1f;
}
.tl-block.conflict {
  background: #f9c9c9;
  color: #7d1f1f;
  outline: 2px solid var(--red);
}
.tl-block.unassigned {
  background: #f2e6c3;
  color: #5a4200;
}
.tl-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  padding: 10px 0 2px;
  font-size: 11px;
  color: var(--muted);
}
.tl-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.tl-legend i {
  width: 14px;
  height: 10px;
  border-radius: 3px;
  background: #e6ecf7;
}
.tl-legend i.live {
  background: #ffe9c2;
}
.tl-legend i.done {
  background: #d9efe5;
}
.tl-legend i.noshow {
  background: #f7d6d6;
}
.tl-legend i.conflict {
  background: #f9c9c9;
  outline: 2px solid var(--red);
}
.tl-legend i.unassigned {
  background: #f2e6c3;
}

/* drawer tabs & actions */
.drawer-tabs {
  display: flex;
  gap: 4px;
  padding: 10px 24px 0;
  border-bottom: 1px solid var(--line);
}
.drawer-tabs button {
  border: 0;
  background: transparent;
  padding: 9px 12px;
  font-size: 13px;
  font-weight: 650;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.drawer-tabs button.active {
  color: var(--text);
  border-bottom-color: var(--dark);
}
.drawer-head .eyebrow {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}
.trip-current {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  font-size: 12px;
  color: var(--muted);
}
.stepper {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 4px;
  margin-bottom: 10px;
}
.stepper .step {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 9px;
  padding: 8px 4px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.15;
  color: #5c5c58;
  display: grid;
  gap: 3px;
}
.stepper .step small {
  font-weight: 500;
  color: var(--muted);
}
.stepper .step.done {
  background: var(--green2);
  border-color: #bfe6d4;
  color: var(--green);
}
.stepper .step.next:not(:disabled) {
  background: var(--dark);
  color: #fff;
  border-color: var(--dark);
}
.stepper .step:disabled {
  opacity: 0.6;
  cursor: default;
}
.driver-line b {
  display: block;
  font-size: 14px;
}
.driver-line > span {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 8px;
}
.driver-line small {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-top: 8px;
}
.link-row {
  display: flex;
  gap: 7px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 6px;
}
.link-row.wrap {
  margin-bottom: 8px;
}
.link-row input {
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 8px 10px;
  min-width: 180px;
}
.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  padding: 4px 0;
}
.check-row input {
  width: 16px;
  height: 16px;
}
.check-row span small {
  display: block;
  color: var(--muted);
  font-size: 11px;
}
.action-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid #f0f0ec;
}
.action-row:first-of-type {
  border-top: 0;
}
.action-row.col {
  flex-direction: column;
  align-items: stretch;
}
.action-row.col textarea {
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 9px 10px;
  width: 100%;
}
.action-row b {
  display: block;
  font-size: 13px;
}
.action-row small {
  display: block;
  font-size: 11px;
  color: var(--muted);
}
.action-row.disabled b {
  color: #9a9a94;
}
.danger-zone {
  border: 1px solid #efcccc;
  border-radius: 12px;
  padding: 12px 14px;
  background: #fffafa;
}
.danger-zone small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-top: 6px;
}
.danger-text {
  color: var(--red) !important;
}
.ok-text {
  color: var(--green);
}
.hint {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.45;
}
.notify-grid {
  display: grid;
  gap: 4px;
  margin-bottom: 10px;
}
.copy-area {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 9px 10px;
  font: 12px/1.45 ui-monospace, SFMono-Regular, Menlo, monospace;
  background: #fafaf8;
}
.link-list > div {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 9px;
}
.link-list b {
  display: block;
  font-size: 13px;
}
.link-list span {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin: 2px 0 8px;
}
.link-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 6px;
}
.timeline-list {
  display: grid;
  gap: 2px;
}
.tl-item {
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr);
  gap: 12px;
  padding: 8px 0;
  border-top: 1px solid #f0f0ec;
}
.tl-item time {
  font-size: 11px;
  color: var(--muted);
  padding-top: 2px;
}
.tl-item b {
  display: block;
  font-size: 13px;
}
.tl-item span {
  display: block;
  font-size: 12px;
  color: #4a4a46;
  word-break: break-word;
}
.tl-item small {
  display: block;
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-top: 2px;
}
.tl-item.trip b {
  color: #1d4f9a;
}

/* drivers & vehicles */
.doc-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 8px 0 2px;
}
.doc-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 6px;
  background: #f4f4f1;
  color: #6d6d6a;
  border: 1px solid #e4e4df;
  white-space: nowrap;
}
.doc-badge.ok {
  background: var(--green2);
  border-color: #bfe6d4;
  color: var(--green);
}
.doc-badge.expiring {
  background: #fff8e6;
  border-color: #f1e2b5;
  color: #6a4a00;
}
.doc-badge.expired {
  background: #fff1f1;
  border-color: #efcccc;
  color: #8c2b2b;
}
.entity-notes {
  font-size: 12px;
  color: #5c5c58;
  margin: 8px 0 0;
  white-space: pre-wrap;
}
.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}

/* reports */
.page-scroll {
  display: block;
}
.report-body {
  display: grid;
  gap: 17px;
}
.report-body.refreshing {
  opacity: 0.55;
}
.grid-two.equal {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.grid-three {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 17px;
}
.stat-card .delta {
  font-weight: 700;
}
.stat-card .delta.good {
  color: var(--green);
}
.stat-card .delta.bad {
  color: var(--red);
}
.viz-bars {
  width: 100%;
  height: auto;
  display: block;
  font-family: inherit;
}
.viz-bars .grid line {
  stroke: #ecece8;
  stroke-width: 1;
}
.viz-bars .tick,
.viz-bars .lbl {
  font-size: 10px;
  fill: #8a8a84;
}
.viz-bars .bar path {
  fill: #2a2b29;
  transition: fill 0.12s;
}
.viz-bars .bar:hover path {
  fill: #5a5b58;
}
.viz-bars .val {
  font-size: 10px;
  font-weight: 700;
  fill: #3f3f3c;
}
.chart-tip {
  position: fixed;
  z-index: 80;
  background: #20211f;
  color: #fff;
  border-radius: 9px;
  padding: 7px 10px;
  font-size: 12px;
  pointer-events: none;
  max-width: 260px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}
.chart-tip b {
  display: block;
  font-size: 13px;
}
.chart-tip span {
  color: #cfcfca;
  font-size: 11px;
}
.hbars {
  display: grid;
  gap: 7px;
}
.hbar {
  display: grid;
  grid-template-columns: minmax(90px, 0.9fr) minmax(0, 1.4fr) auto;
  grid-template-rows: auto auto;
  gap: 2px 10px;
  align-items: center;
  font-size: 12px;
}
.hbar .hlabel {
  grid-row: 1 / span 2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 600;
}
.hbar i {
  display: block;
  height: 8px;
  background: #f0f0ec;
  border-radius: 4px;
  overflow: hidden;
  grid-column: 2;
}
.hbar u {
  display: block;
  height: 100%;
  background: #2a2b29;
  border-radius: 0 4px 4px 0;
  text-decoration: none;
}
.hbar b {
  grid-column: 3;
  grid-row: 1;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.hbar small {
  grid-column: 2 / span 2;
  grid-row: 2;
  color: var(--muted);
  font-size: 10px;
}
.table-details {
  margin-top: 8px;
}
.table-details summary {
  cursor: pointer;
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
}
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
h3.sub {
  font-size: 12px;
  margin: 14px 0 8px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

/* payouts */
.payout-body {
  display: grid;
  gap: 12px;
}
.payout-driver summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.payout-driver summary::-webkit-details-marker {
  display: none;
}
.payout-driver summary b {
  font-size: 15px;
}
.payout-driver summary > div > small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}
.payout-figures {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--muted);
}
.payout-figures b {
  color: var(--text);
  margin-left: 4px;
}
.payout-driver[open] summary {
  margin-bottom: 12px;
}

/* team */
.role-legend {
  margin-top: 17px;
}
.role-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.role-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
}
.role-card b {
  display: block;
  margin-bottom: 6px;
}
.role-card ul {
  margin: 0;
  padding-left: 16px;
  font-size: 12px;
  color: #4a4a46;
  display: grid;
  gap: 3px;
}

/* operations settings */
.ops-settings-panel {
  margin-top: 17px;
}
.ops-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.ops-block {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  display: grid;
  gap: 10px;
  align-content: start;
}
.ops-block h3 {
  margin: 0;
  font-size: 13px;
}
.ops-block .field small.hint {
  display: block;
  margin-top: 3px;
}
.status-line {
  display: grid;
  gap: 5px;
  font-size: 12px;
}
.status-line span {
  display: inline-block;
  width: fit-content;
}
.ops-settings-panel + .ai-settings-panel {
  margin-top: 17px;
}

@media (max-width: 1180px) {
  .dispatch-board.view-board {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .today-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .grid-three,
  .role-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .stepper {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 760px) {
  .search-trigger,
  .user-chip {
    display: none;
  }
  #mobileSearchButton {
    display: inline-flex;
  }
  .today-strip {
    display: flex;
    flex: 0 0 auto;
    gap: 5px;
    overflow-x: auto;
    margin: 0 0 5px;
    scrollbar-width: none;
  }
  .today-strip button {
    flex: 0 0 104px;
    padding: 6px 8px;
    border-radius: 9px;
  }
  .today-strip button b {
    font-size: 15px;
  }
  .today-strip button span,
  .today-strip button small {
    font-size: 7px;
  }
  .page-scroll {
    flex: 1;
    min-height: 0;
    overflow: auto;
    overscroll-behavior: contain;
    display: grid;
    gap: 6px;
    align-content: start;
  }
  .page-scroll .stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5px;
    margin: 0;
  }
  .page-scroll .stat-card {
    padding: 8px 9px !important;
    min-height: 0 !important;
  }
  .page-scroll .stat-card > strong {
    font-size: 15px !important;
  }
  .report-body,
  .payout-body {
    gap: 6px;
  }
  .grid-two.equal,
  .grid-three,
  .role-grid,
  .ops-grid,
  .two-col {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .report-body .panel,
  .payout-body .panel,
  .role-card,
  .ops-block {
    padding: 9px;
    border-radius: 10px;
  }
  .search-palette {
    top: calc(6px + env(safe-area-inset-top));
    width: calc(100vw - 12px);
  }
  .search-results {
    max-height: 70vh;
  }
  .dispatch-board.view-board {
    display: flex !important;
  }
  .dispatch-board.view-list,
  .dispatch-board.view-timeline {
    display: block !important;
    overflow: auto;
  }
  .timeline {
    min-width: 760px;
  }
  .dispatch-toolbar .check-field {
    min-width: 0 !important;
  }
  .drawer-tabs {
    padding: 6px 12px 0;
  }
  .drawer-tabs button {
    padding: 7px 8px;
    font-size: 11px;
  }
  .stepper {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .tl-item {
    grid-template-columns: 1fr;
    gap: 2px;
  }
  .payout-driver summary {
    gap: 6px;
  }
  .payout-figures {
    gap: 8px;
    font-size: 11px;
  }
  .alert-list {
    gap: 4px;
  }
  .chart-tip {
    display: none;
  }
}

/* dispatch 2.0 layout fixes */
.dispatch-controls {
  grid-template-columns: 1fr 1fr;
}
.dispatch-controls .dispatch-actions {
  grid-column: 1 / -1;
}
.dispatch-controls .dispatch-actions button,
.dispatch-controls .dispatch-actions .btn-link {
  padding: 6px 9px;
  font-size: 10px;
}
#dispatchStats.compact-stats,
#payoutStats.compact-stats {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
@media (max-width: 1180px) {
  #dispatchStats.compact-stats,
  #payoutStats.compact-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* mobile polish for the v1.7 pages */
@media (max-width: 760px) {
  .toolbar,
  .toolbar.multi {
    flex-wrap: nowrap !important;
  }
  .toolbar .mini-field.check-field {
    min-width: 0 !important;
    max-width: none !important;
    padding: 5px 9px !important;
    white-space: nowrap;
  }
  .toolbar .mini-field.check-field input {
    width: 15px !important;
    min-width: 15px !important;
    height: 15px !important;
    min-height: 15px !important;
    padding: 0 !important;
  }
  .dispatch-column > div {
    align-content: start;
  }
  .dispatch-controls .dispatch-actions {
    grid-column: 1 / -1;
  }
  .dispatch-controls .dispatch-actions button,
  .dispatch-controls .dispatch-actions .btn-link {
    grid-column: auto;
    padding: 5px 7px;
    font-size: 9px;
  }
  .page-scroll {
    display: flex;
    flex-direction: column;
  }
  .page-scroll > * {
    min-width: 0;
    max-width: 100%;
    flex: 0 0 auto;
  }
  .page-scroll .stats-grid,
  .page-scroll .grid-two,
  .page-scroll .grid-three {
    min-width: 0;
  }
  .stat-card > strong {
    white-space: normal;
    word-break: break-word;
  }
  .tl-block {
    min-width: 34px;
  }
}
