:root {
  --bg: #f6f4ec;
  --panel: rgba(255, 255, 255, 0.8);
  --panel-strong: #ffffff;
  --ink: #152033;
  --muted: #667287;
  --line: rgba(21, 32, 51, 0.11);
  --line-strong: rgba(21, 32, 51, 0.16);
  --accent: #0f5f8f;
  --accent-soft: #d8ecf9;
  --warning: #f4b942;
  --danger: #b9402f;
  --success: #2d9b4d;
  --success-soft: #dff5e5;
  --rest: #2769b2;
  --rest-soft: #d6e7fb;
  --shadow: 0 18px 42px rgba(24, 34, 56, 0.1);
  --shadow-soft: 0 10px 24px rgba(24, 34, 56, 0.08);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --control-height: 38px;
  --driver-column-width: 184px;
  --calendar-cell-height: 132px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Aptos", "Segoe UI", "Trebuchet MS", sans-serif;
  font-size: 14px;
  color: var(--ink);
  line-height: 1.45;
  background:
    radial-gradient(circle at top left, rgba(244, 185, 66, 0.16), transparent 28%),
    radial-gradient(circle at top right, rgba(15, 95, 143, 0.18), transparent 26%),
    linear-gradient(180deg, #f8f6f1 0%, #eef3f8 100%);
}

button,
input,
select {
  font: inherit;
}

h1,
h2,
h3,
h4,
h5,
.view-button {
  font-family: "Bahnschrift Condensed", "Arial Narrow", "Franklin Gothic Medium", sans-serif;
  letter-spacing: 0.02em;
}

h1 {
  margin: 0;
  font-size: clamp(2.1rem, 3.2vw, 3.25rem);
  line-height: 0.92;
}

h2,
h3,
h4,
h5,
p {
  margin-top: 0;
}

.shell {
  width: min(1600px, calc(100vw - 20px));
  margin: 12px auto 24px;
}

main {
  display: grid;
  gap: 12px;
}

.is-hidden {
  display: none !important;
}

.eyebrow,
.section-label {
  margin: 0 0 6px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
}

.hero-copy,
.section-copy,
.week-copy,
.meta-card p,
.form-heading p,
.driver-summary p,
.day-caption,
.job-count,
.credentials-copy,
.sync-copy {
  color: var(--muted);
}

.auth-shell {
  display: grid;
  grid-template-columns: 1fr;
  place-items: center;
  min-height: calc(100vh - 36px);
  gap: 0;
}

.login-panel,
.credentials-card,
.hero,
.meta-card,
.panel,
.summary-card,
.driver-day-card,
.planner-driver,
.day-cell,
.account-card {
  border: 1px solid rgba(255, 255, 255, 0.72);
  background: var(--panel);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.login-panel,
.credentials-card {
  padding: 18px 20px;
  border-radius: var(--radius-xl);
}

.login-panel {
  width: min(360px, 100%);
  padding: 18px;
  border-radius: 8px;
  background: #ffffff;
}

.login-brand {
  display: grid;
  gap: 4px;
  margin-bottom: 14px;
  text-align: center;
}

.login-brand h1 {
  color: var(--ink);
  font-size: clamp(1.75rem, 3.4vw, 2.25rem);
  line-height: 0.95;
}

.login-panel .form-heading {
  align-items: center;
  justify-content: center;
  text-align: center;
}

.login-panel .job-form {
  gap: 10px;
}

.credentials-card h2 {
  margin-bottom: 14px;
  font-size: 1.6rem;
}

.credential-list {
  display: grid;
  gap: 10px;
}

.credential-row {
  padding: 10px 12px;
  border-radius: 16px;
  background: rgba(15, 95, 143, 0.07);
}

.credential-row strong,
.credential-row span {
  display: block;
}

.credential-row span {
  margin-top: 6px;
  font-size: 0.95rem;
}

.credential-row code {
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(15, 95, 143, 0.1);
  color: var(--accent);
  font-family: Consolas, "Courier New", monospace;
}

.hero {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  padding: 18px 20px;
  border-radius: var(--radius-xl);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.72)),
    linear-gradient(120deg, rgba(15, 95, 143, 0.2), rgba(244, 185, 66, 0.14));
}

.hero-tools {
  display: grid;
  gap: 8px;
  justify-items: end;
}

.account-card {
  min-width: 250px;
  min-width: 220px;
  padding: 12px 14px;
  border-radius: var(--radius-lg);
}

.account-card h2 {
  margin-bottom: 6px;
  font-size: 1.45rem;
}

.account-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.notification-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  padding: 5px 10px;
  border: 1px solid rgba(15, 95, 143, 0.14);
  border-radius: 999px;
  background: rgba(15, 95, 143, 0.06);
  color: var(--accent);
  font-weight: 700;
  cursor: pointer;
  transition: transform 160ms ease, background-color 160ms ease, border-color 160ms ease;
}

.notification-button:hover {
  transform: translateY(-1px);
  background: rgba(15, 95, 143, 0.1);
}

.notification-button.has-unread {
  border-color: rgba(198, 47, 47, 0.24);
  background: rgba(198, 47, 47, 0.08);
  color: #a92f2f;
}

.notification-icon {
  font-size: 0.96rem;
  line-height: 1;
}

.notification-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: #c62f2f;
  color: #ffffff;
  font-size: 0.74rem;
  font-weight: 800;
}

.view-switcher {
  display: inline-flex;
  gap: 6px;
  margin: 10px 0 8px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: var(--shadow-soft);
}

.view-button,
.week-tab,
.primary-button,
.secondary-button,
.upload-label {
  border: 0;
  cursor: pointer;
  transition: transform 160ms ease, background-color 160ms ease, color 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.view-button {
  min-height: 36px;
  padding: 7px 12px;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 0.92rem;
}

.view-button.is-active,
.week-tab.is-active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 14px 28px rgba(15, 95, 143, 0.22);
}

.view-panel {
  display: none;
}

.view-panel.is-active {
  display: grid;
  gap: 12px;
}

.flash-message {
  min-height: 1.3em;
  margin-bottom: 0;
  font-weight: 600;
}

.flash-message[data-tone="error"] {
  color: var(--danger);
}

.flash-message[data-tone="success"] {
  color: var(--success);
}

.flash-message-inline {
  margin: 0 0 8px;
}

.toast-region {
  position: fixed;
  z-index: 80;
  right: 18px;
  bottom: 18px;
  display: grid;
  gap: 8px;
  width: min(360px, calc(100vw - 28px));
  pointer-events: none;
}

.app-toast {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border: 1px solid rgba(21, 32, 51, 0.1);
  border-left: 4px solid var(--success);
  border-radius: 7px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 16px 38px rgba(24, 34, 56, 0.18);
  pointer-events: auto;
  animation: toast-in 220ms ease-out both;
}

.app-toast-error {
  border-left-color: var(--danger);
}

.toast-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  padding: 0 6px;
  border-radius: 999px;
  color: #ffffff;
  background: var(--success);
  font-size: 0.66rem;
  font-weight: 900;
}

.app-toast-error .toast-icon {
  background: var(--danger);
}

.app-toast span:not(.toast-icon) {
  overflow-wrap: anywhere;
  font-size: 0.82rem;
  font-weight: 750;
}

.app-toast button {
  min-height: 26px;
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--muted);
  background: #f6f8fb;
  cursor: pointer;
  font-size: 0.64rem;
  font-weight: 800;
}

.app-toast.is-leaving {
  animation: toast-out 200ms ease-in both;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes toast-out {
  to {
    opacity: 0;
    transform: translateY(6px) scale(0.98);
  }
}

.workspace-header,
.week-strip-head,
.week-strip-actions,
.form-heading,
.driver-toolbar,
.summary-card-head,
.driver-week-header,
.driver-job-head,
.day-detail-header,
.job-card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.meta-card {
  min-width: 250px;
  min-width: 220px;
  padding: 12px 14px;
  border-radius: var(--radius-lg);
}

.controls-panel,
.driver-panel,
.drivers-admin-panel {
  padding: 16px;
  border-radius: var(--radius-xl);
}

.week-strip {
  margin-bottom: 18px;
}

.week-strip-actions {
  align-items: center;
  flex-wrap: wrap;
  justify-content: end;
}

.week-tabs {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.planner-board-hint {
  padding: 12px 14px;
  border-radius: 18px;
  background: rgba(15, 95, 143, 0.07);
}

.week-copy {
  margin: 0;
  color: var(--muted);
  font-weight: 600;
}

.planner-board-hint h3 {
  margin-bottom: 6px;
  font-size: 1.2rem;
}

.week-tab {
  flex: 0 0 auto;
  min-height: 38px;
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(15, 95, 143, 0.08);
  color: var(--accent);
  font-weight: 600;
}

.week-tab-display {
  flex: 0 0 auto;
  width: auto;
  max-width: min(100%, 420px);
  justify-content: center;
  text-align: center;
  cursor: default;
  white-space: nowrap;
}

.week-nav-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 12px;
  background: rgba(15, 95, 143, 0.08);
  color: var(--accent);
  font-size: 1.05rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform 160ms ease, background-color 160ms ease, color 160ms ease, opacity 160ms ease;
}

.week-nav-arrow:hover:not(:disabled) {
  transform: translateY(-1px);
  background: rgba(15, 95, 143, 0.14);
}

.week-nav-arrow:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}

.week-tab:not(.is-active):hover,
.view-button:not(.is-active):hover,
.primary-button:hover,
.secondary-button:hover,
.upload-label:hover {
  transform: translateY(-1px);
}

.job-form {
  display: grid;
  gap: 12px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

label {
  display: grid;
  gap: 6px;
  font-size: 0.84rem;
  font-weight: 600;
}

input,
select,
textarea {
  width: 100%;
  min-height: var(--control-height);
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.95);
  color: var(--ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

input:focus,
select:focus,
textarea:focus,
.primary-button:focus-visible,
.secondary-button:focus-visible,
.upload-label:focus-visible,
.week-tab:focus-visible,
.week-jump-select:focus-visible,
.week-nav-arrow:focus-visible,
.view-button:focus-visible,
.day-cell:focus-visible {
  outline: 3px solid rgba(15, 95, 143, 0.28);
  outline-offset: 2px;
}

.primary-button,
.secondary-button,
.upload-label {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  min-height: var(--control-height);
  padding: 8px 12px;
  border-radius: 12px;
  font-weight: 700;
}

.primary-button {
  background: linear-gradient(135deg, #0f5f8f, #2778a8);
  color: #fff;
}

.secondary-button,
.upload-label {
  background: rgba(15, 95, 143, 0.08);
  color: var(--accent);
}

.planner-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin: 12px 0;
}

.summary-card {
  padding: 12px 14px;
  border-radius: var(--radius-lg);
}

.summary-card h3 {
  margin-bottom: 6px;
  font-size: 1.55rem;
  line-height: 0.9;
}

.planner-board {
  display: flex;
  gap: 10px;
  overflow-x: scroll;
  overflow-y: hidden;
  padding: 2px 2px 12px;
  scroll-padding: 6px;
  scrollbar-gutter: stable;
  cursor: grab;
  touch-action: pan-y pinch-zoom;
  align-items: stretch;
}

.planner-board::-webkit-scrollbar {
  height: 12px;
}

.planner-board::-webkit-scrollbar-thumb {
  background: rgba(15, 95, 143, 0.24);
  border-radius: 999px;
}

.planner-board::-webkit-scrollbar-track {
  background: rgba(15, 95, 143, 0.08);
  border-radius: 999px;
}

.planner-board.is-dragging {
  cursor: grabbing;
}

.planner-board.is-dragging .planner-driver,
.planner-board.is-drag-ready .planner-driver {
  user-select: none;
}

.planner-driver {
  flex: 0 0 var(--driver-column-width);
  width: var(--driver-column-width);
  padding: 10px;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
}

.driver-header {
  position: sticky;
  top: 0;
  z-index: 3;
  padding-top: 2px;
  padding-bottom: 8px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(14px);
}

.driver-title-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.driver-header h3 {
  margin-bottom: 0;
  font-size: 1.02rem;
  line-height: 1;
}

.truck-chip,
.ghost-button {
  border: 0;
  cursor: pointer;
  transition: transform 160ms ease, background-color 160ms ease, color 160ms ease;
}

.truck-chip {
  min-height: 28px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(15, 95, 143, 0.1);
  color: var(--accent);
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.truck-chip:hover,
.ghost-button:hover {
  transform: translateY(-1px);
}

.driver-meta {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 600;
}

.driver-days {
  display: grid;
  gap: 6px;
  grid-auto-rows: var(--calendar-cell-height);
}

.truck-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 6px;
  margin-top: 8px;
}

.truck-form input,
.truck-form select {
  padding: 7px 8px;
  font-size: 0.78rem;
}

.ghost-button {
  min-height: 34px;
  padding: 6px 10px;
  border-radius: 12px;
  background: rgba(21, 32, 51, 0.06);
  color: var(--ink);
  font-weight: 700;
}

.day-cell {
  padding: 8px;
  border-radius: 12px;
  cursor: pointer;
  min-height: var(--calendar-cell-height);
  height: var(--calendar-cell-height);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.day-cell[data-expanded="true"] {
  background: rgba(255, 255, 255, 0.92);
}

.day-cell.is-selected {
  border-color: rgba(15, 95, 143, 0.38);
  box-shadow: 0 0 0 3px rgba(15, 95, 143, 0.12), var(--shadow);
}

.day-cell.is-complete {
  background: linear-gradient(180deg, rgba(223, 245, 229, 0.94), rgba(255, 255, 255, 0.84));
  border-color: rgba(45, 155, 77, 0.25);
}

.day-cell.is-rest {
  background: linear-gradient(180deg, #0b3b82, #154e9f);
  border-color: rgba(8, 34, 79, 0.65);
}

.day-cell.is-holiday {
  background: linear-gradient(180deg, #ffe000, #ffd100);
  border-color: rgba(184, 150, 0, 0.58);
}

.day-cell.is-rest .day-name,
.day-cell.is-rest .day-caption,
.day-cell.is-rest .day-preview-more,
.day-cell.is-rest .day-preview-item strong,
.day-cell.is-rest .day-preview-item span,
.day-cell.is-rest .day-preview-empty {
  color: #f4f8ff;
}

.day-cell.is-rest .day-preview-item,
.day-cell.is-rest .day-preview-empty {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.16);
}

.day-cell.is-empty {
  border-style: dashed;
}

.day-head {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  align-items: flex-start;
  min-height: 44px;
}

.day-head > div:first-child {
  min-width: 0;
  flex: 1 1 auto;
}

.day-head-pills {
  display: grid;
  gap: 4px;
  justify-items: end;
  flex: 0 0 auto;
}

.day-name {
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.1;
}

.day-pill {
  padding: 4px 6px;
  border-radius: 999px;
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: rgba(15, 95, 143, 0.08);
  color: var(--accent);
}

.day-pill.day-pill-complete {
  background: var(--success-soft);
  color: var(--success);
}

.day-pill.day-pill-rest {
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
}

.day-pill.day-pill-holiday {
  background: rgba(255, 255, 255, 0.55);
  color: #6e5a00;
}

.day-alert-pill {
  padding: 4px 6px;
  border-radius: 999px;
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(198, 47, 47, 0.12);
  color: #a92f2f;
}

.day-caption {
  margin: 4px 0 0;
  font-size: 0.65rem;
  line-height: 1.2;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.day-preview-list {
  display: grid;
  gap: 4px;
  margin-top: 6px;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  align-content: start;
}

.day-preview-item,
.day-preview-empty {
  padding: 6px 7px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(21, 32, 51, 0.08);
  min-height: 34px;
}

.day-preview-item strong,
.day-preview-item span {
  display: block;
}

.day-preview-item strong {
  font-size: 0.58rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.day-preview-item span {
  margin-top: 3px;
  font-size: 0.66rem;
  line-height: 1.15;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.day-preview-more {
  color: var(--muted);
  font-size: 0.64rem;
  font-weight: 600;
  margin-top: auto;
}

.job-card {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.94);
}

.job-card.is-complete {
  border-color: rgba(45, 155, 77, 0.3);
  background: linear-gradient(180deg, rgba(223, 245, 229, 0.92), #ffffff);
}

.job-id {
  margin: 0 0 4px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.job-card h4 {
  margin: 0;
  font-size: 0.96rem;
}

.job-type-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(15, 95, 143, 0.08);
  color: var(--accent);
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.job-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  gap: 8px 10px;
  margin: 8px 0 0;
}

.job-meta dt {
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.job-meta dd {
  margin: 4px 0 0;
  font-size: 0.82rem;
}

.job-meta a {
  color: var(--accent);
  font-weight: 700;
}

.pod-link-group,
.proof-actions {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}

.pod-link-group a,
.proof-actions a {
  color: var(--accent);
  font-weight: 700;
}

.proof-file {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 600;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.status-pending {
  background: rgba(244, 185, 66, 0.18);
  color: #9a5e03;
}

.status-complete {
  background: var(--success-soft);
  color: var(--success);
}

.status-rest {
  background: #0b3b82;
  color: #ffffff;
}

.status-holiday {
  background: #ffe000;
  color: #6e5a00;
}

.status-cancelled {
  background: rgba(185, 64, 47, 0.14);
  color: var(--danger);
}

.driver-summary {
  margin: 12px 0 14px;
  padding: 12px 14px;
  border-radius: var(--radius-lg);
  background: rgba(15, 95, 143, 0.07);
}

.account-settings-panel {
  margin: 0 0 14px;
  padding: 12px 14px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.76);
}

.editor-driver {
  margin-bottom: 10px;
  color: var(--muted);
  font-weight: 600;
}

.editor-job-list {
  display: grid;
  gap: 8px;
  margin: 12px 0 14px;
}

.editor-job-list-compact {
  margin: 0;
}

.editor-empty {
  padding: 12px;
  border: 1px dashed var(--line);
  border-radius: 16px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.7);
}

.editor-form-grid {
  display: grid;
  gap: 10px;
}

.compact-form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.editor-help {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.8rem;
}

.message-panel {
  margin: 0 0 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(247, 250, 253, 0.92);
}

.compact-panel {
  margin: 0;
  padding: 10px;
  border-radius: 14px;
}

.compact-thread {
  max-height: 180px;
  overflow: auto;
}

.compact-message-form textarea {
  min-height: 64px;
}

.planner-modal-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 12px;
}

.planner-modal-toolbar-copy {
  display: grid;
  gap: 6px;
}

.planner-modal-stat-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.planner-modal-stat {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.planner-add-button {
  align-self: center;
  flex: 0 0 auto;
  min-width: 104px;
}

.planner-modal-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(260px, 0.95fr);
  gap: 12px;
  align-items: start;
}

.planner-modal-main,
.planner-modal-side {
  display: grid;
  gap: 10px;
}

.planner-section-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: start;
}

.planner-section-head h3 {
  margin: 4px 0 0;
}

.compact-job-form {
  gap: 10px;
}

.job-category-field {
  display: grid;
  gap: 7px;
}

.job-category-field > span {
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 700;
}

.job-category-options,
.export-category-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.job-category-chip,
.export-category-chip {
  justify-content: flex-start;
  gap: 7px;
  min-height: 32px;
  padding: 6px 8px;
  border-radius: 5px;
  text-align: left;
}

.job-category-chip .category-option-label,
.export-category-chip .category-option-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.category-checkmark {
  position: relative;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 12px;
  height: 12px;
  border: 1px solid #8e9daf;
  border-radius: 3px;
  background: #ffffff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.category-checkmark::after {
  content: "";
  width: 4px;
  height: 7px;
  border-right: 2px solid #ffffff;
  border-bottom: 2px solid #ffffff;
  transform: translateY(-1px) rotate(45deg) scale(0);
  transition: transform 120ms ease;
}

.job-category-chip:has(input:checked) .category-checkmark,
.export-category-chip:has(input:checked) .category-checkmark {
  border-color: var(--job-category-ink, var(--accent));
  background: var(--job-category-ink, var(--accent));
}

.job-category-chip:has(input:checked) .category-checkmark::after,
.export-category-chip:has(input:checked) .category-checkmark::after {
  transform: translateY(-1px) rotate(45deg) scale(1);
}

.job-category-chip:not(:has(input:checked)),
.export-category-chip:not(:has(input:checked)) {
  color: #536174;
  background: #ffffff;
}

.job-category-chip:not(:has(input:checked)) .category-option-label,
.export-category-chip:not(:has(input:checked)) .category-option-label {
  opacity: 0.72;
}

.availability-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
}

.availability-form label {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.availability-form select {
  width: 100%;
}

.availability-form .secondary-button {
  min-width: 72px;
  padding-inline: 14px;
  white-space: nowrap;
}

.message-panel-inline {
  margin: 12px 0 0;
}

.message-panel-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: start;
  margin-bottom: 10px;
}

.message-panel-head h3,
.message-panel-head h4 {
  margin: 4px 0 0;
}

.message-panel-head p:last-child {
  margin: 0;
  max-width: 340px;
  color: var(--muted);
  font-size: 0.8rem;
}

.message-thread {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
}

.message-empty {
  padding: 10px;
  border: 1px dashed var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--muted);
}

.message-bubble {
  padding: 10px 12px;
  border-radius: 16px;
  border: 1px solid rgba(21, 32, 51, 0.08);
  background: rgba(255, 255, 255, 0.92);
}

.message-bubble-driver {
  border-left: 4px solid #d07a00;
}

.message-bubble-scheduler,
.message-bubble-admin {
  border-left: 4px solid var(--accent);
  background: rgba(237, 245, 251, 0.94);
}

.message-bubble-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 6px;
}

.message-bubble-head strong {
  font-size: 0.84rem;
}

.message-bubble-head span {
  color: var(--muted);
  font-size: 0.72rem;
}

.message-bubble p {
  margin: 0;
  white-space: pre-wrap;
  line-height: 1.45;
}

.message-unread-tag {
  display: inline-flex;
  margin-top: 8px;
  padding: 3px 6px;
  border-radius: 999px;
  background: rgba(198, 47, 47, 0.12);
  color: #a92f2f;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.message-form {
  display: grid;
  gap: 10px;
}

.message-form textarea {
  min-height: 78px;
  resize: vertical;
}

.export-modal-card {
  width: min(680px, calc(100vw - 24px));
}

#export-modal .export-modal-card {
  padding-top: 48px;
  scroll-padding-top: 54px;
}

#export-modal .modal-close {
  position: sticky;
  top: 10px;
  right: auto;
  z-index: 120;
  display: flex;
  width: fit-content;
  margin: -36px 0 10px auto;
  box-shadow: 0 10px 20px rgba(24, 34, 56, 0.14);
}

.export-driver-list {
  display: grid;
  gap: 8px;
}

.export-filter-group {
  display: grid;
  gap: 8px;
}

.export-driver-option,
.export-select-all {
  justify-content: space-between;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.88);
}

.export-driver-option strong {
  color: var(--accent);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.planner-modal {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 160;
}

.planner-modal.is-open {
  display: block;
}

.planner-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(21, 32, 51, 0.4);
  backdrop-filter: blur(8px);
}

.planner-modal-card {
  position: relative;
  width: min(1040px, calc(100vw - 20px));
  max-height: calc(100vh - 40px);
  overflow: auto;
  margin: 14px auto;
  padding: 16px;
  border-radius: var(--radius-xl);
  border: 1px solid rgba(255, 255, 255, 0.72);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 28px 64px rgba(24, 34, 56, 0.22);
}

.planner-modal-card h3 {
  margin-bottom: 6px;
  font-size: 1.45rem;
}

.modal-close {
  position: sticky;
  top: 0;
  margin-left: auto;
  display: inline-flex;
  align-self: flex-start;
  padding: 6px 10px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  color: var(--accent);
  font-weight: 700;
  cursor: pointer;
  z-index: 20;
  box-shadow: 0 4px 12px rgba(21, 32, 51, 0.1);
  pointer-events: auto;
}

.driver-summary h3 {
  margin-bottom: 6px;
  font-size: 1.35rem;
}

.driver-app {
  display: grid;
  gap: 12px;
}

.drivers-admin-grid {
  display: grid;
  grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.drivers-admin-tabs {
  display: inline-flex;
  gap: 6px;
  margin-bottom: 12px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(15, 95, 143, 0.06);
}

.drivers-admin-panel-section {
  display: grid;
  gap: 12px;
}

.inline-action-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.drivers-directory-wrap {
  display: grid;
  gap: 12px;
}

.drivers-directory {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

.driver-admin-card {
  padding: 12px 14px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.88);
}

.driver-holiday-panel {
  display: grid;
  gap: 12px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.holiday-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.holiday-panel-head h4 {
  margin: 2px 0 0;
}

.holiday-add-toggle {
  flex: 0 0 auto;
}

.holiday-add-box {
  padding: 12px;
  border: 1px solid #d8e1ee;
  border-radius: 6px;
  background: #f8fbff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.holiday-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
}

.holiday-form label {
  display: grid;
  gap: 6px;
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 700;
}

.holiday-form-actions {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 2px;
}

.holiday-list {
  display: grid;
  gap: 8px;
}

.holiday-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid rgba(215, 184, 0, 0.36);
  border-radius: 6px;
  background: rgba(255, 224, 0, 0.16);
}

.holiday-row strong,
.holiday-row span {
  display: block;
}

.holiday-row span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 600;
}

.holiday-empty {
  padding: 9px 10px;
}

.working-days-field {
  display: grid;
  gap: 6px;
  font-size: 0.84rem;
  font-weight: 600;
}

.working-days-field small {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
 }

.working-days-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.checkbox-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.9);
  cursor: pointer;
  font-size: 0.72rem;
}

.checkbox-chip input {
  display: none;
}

.checkbox-chip:has(input:checked) {
  border-color: rgba(15, 95, 143, 0.24);
  background: rgba(15, 95, 143, 0.1);
  color: var(--accent);
}

.working-day-chip {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
  gap: 5px;
  min-height: 46px;
  border-color: rgba(185, 70, 55, 0.28);
  background: #f6f7f9;
  color: #6f7782;
}

.working-day-chip .day-short {
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 900;
}

.working-day-chip input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  opacity: 0;
  pointer-events: none;
}

.working-day-chip::after {
  content: "";
  display: block;
  width: 4px;
  height: 4px;
  border: 1px solid #9aa5b3;
  border-radius: 2px;
  background: #ffffff;
}

.working-day-chip:has(input:checked) {
  border-color: rgba(45, 155, 77, 0.42);
  background: #e8f7ee;
  color: #176334;
  box-shadow: inset 0 0 0 1px rgba(45, 155, 77, 0.22);
}

.working-day-chip:has(input:checked)::after {
  border-color: var(--success);
  background: var(--success);
}

.driver-admin-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}

.driver-admin-head h4 {
  margin: 4px 0 0;
  font-size: 1.05rem;
}

.danger-button {
  color: var(--danger);
  background: rgba(185, 64, 47, 0.08);
}

.driver-day-card {
  padding: 12px;
  border-radius: 18px;
}

.driver-day-card.is-complete {
  background: linear-gradient(180deg, rgba(223, 245, 229, 0.94), rgba(255, 255, 255, 0.88));
  border-color: rgba(45, 155, 77, 0.24);
}

.driver-day-card.is-rest {
  background: linear-gradient(180deg, #0b3b82, #154e9f);
  border-color: rgba(8, 34, 79, 0.65);
  color: #f4f8ff;
}

.driver-day-card.is-holiday {
  background: linear-gradient(180deg, #ffe000, #ffd100);
  border-color: rgba(184, 150, 0, 0.58);
  color: #5f4e00;
}

.driver-day-card h4 {
  margin: 0;
  font-size: 1.08rem;
}

.driver-job-list {
  display: grid;
  gap: 10px;
}

.driver-job {
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
}

.driver-job.is-complete {
  background: linear-gradient(180deg, rgba(223, 245, 229, 0.92), #ffffff);
  border-color: rgba(45, 155, 77, 0.3);
}

.driver-job h5 {
  margin: 0;
  font-size: 0.94rem;
}

.driver-job-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.driver-job p {
  margin-bottom: 8px;
}

.driver-job-controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
  align-items: end;
}

.driver-job-controls input[type="file"] {
  display: none;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
}

.checkbox-row-inline {
  min-height: 48px;
  padding-top: 26px;
}

.checkbox-row input {
  width: 18px;
  height: 18px;
}

.proof-preview {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
}

.empty-copy {
  margin: 0;
  padding: 12px;
  border: 1px dashed var(--line);
  border-radius: 16px;
  color: var(--muted);
}

.job-card-compact {
  gap: 0;
}

.job-card-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
}

.job-remove-button {
  min-height: 28px;
  padding: 4px 8px;
  font-size: 0.68rem;
}

@media (max-width: 700px) {
  .auth-shell,
  .hero,
  .workspace-header,
  .week-strip-head,
  .week-strip-actions,
  .form-heading,
  .driver-toolbar,
  .driver-admin-head,
  .driver-week-header,
  .day-detail-header,
  .job-card-head {
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .shell {
    width: min(100vw - 18px, 100%);
    margin-top: 10px;
  }

  .login-panel,
  .credentials-card,
  .hero,
  .controls-panel,
  .drivers-admin-panel,
  .driver-panel,
  .planner-driver {
    padding: 18px;
  }

  .hero-tools {
    justify-items: stretch;
  }

  .drivers-admin-grid {
    grid-template-columns: 1fr;
  }

  .planner-modal-layout,
  .compact-form-grid {
    grid-template-columns: 1fr;
  }

  .job-category-options,
  .export-category-list {
    grid-template-columns: 1fr;
  }
}

/* Sidebar operations UI */
:root {
  --bg: #dbe7f4;
  --panel: #ffffff;
  --panel-strong: #ffffff;
  --ink: #172238;
  --muted: #667386;
  --line: #e4e9f1;
  --line-strong: #ccd5e3;
  --accent: #2f73df;
  --accent-soft: #eaf2ff;
  --warning: #ffd900;
  --danger: #c83f45;
  --success: #229c73;
  --success-soft: #e6f7f0;
  --rest: #0a3a78;
  --rest-soft: #dce9fb;
  --shadow: 0 14px 32px rgba(37, 53, 78, 0.1);
  --shadow-soft: 0 8px 18px rgba(37, 53, 78, 0.08);
  --radius-xl: 8px;
  --radius-lg: 8px;
  --radius-md: 6px;
  --control-height: 34px;
  --driver-column-width: 168px;
  --calendar-cell-height: 148px;
}

body {
  font-family: "Segoe UI", "Aptos", sans-serif;
  font-size: 13px;
  color: var(--ink);
  background: var(--bg);
}

h1,
h2,
h3,
h4,
h5,
.view-button {
  font-family: "Segoe UI", "Aptos", sans-serif;
  letter-spacing: 0;
}

h1 {
  font-size: 1.45rem;
  line-height: 1.1;
}

h2 {
  margin-bottom: 0;
  font-size: 1.28rem;
}

h3 {
  font-size: 1rem;
}

.shell {
  width: min(1760px, calc(100vw - 36px));
  margin: 24px auto;
}

.app-shell {
  display: grid;
  grid-template-columns: 252px minmax(0, 1fr);
  min-height: calc(100vh - 48px);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: 18px;
  background: var(--panel-strong);
  box-shadow: 0 24px 50px rgba(43, 62, 91, 0.16);
}

.app-shell.is-driver-session {
  grid-template-columns: minmax(0, 1fr);
  overflow: visible;
  background: linear-gradient(180deg, #eef4fb 0%, #ffffff 44%, #eef4fb 100%);
  transform: none;
}

.app-shell.is-driver-session .app-sidebar,
.app-shell.is-driver-session .topbar {
  display: none;
}

.app-shell.is-driver-session .app-main {
  min-height: calc(100vh - 48px);
  background: transparent;
}

.app-shell.is-driver-session .content-shell {
  max-width: 560px;
  margin: 0 auto;
  overflow: visible;
}

.app-sidebar {
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 24px 22px;
  border-right: 1px solid var(--line);
  background: #f3f6fb;
}

.sidebar-brand {
  padding: 0 4px 18px;
  border-bottom: 1px solid var(--line);
}

.sidebar-brand h1 {
  margin-bottom: 5px;
  color: var(--accent);
  font-size: 1.22rem;
  font-weight: 800;
  text-transform: capitalize;
}

.sidebar-brand p,
.sidebar-footer strong {
  margin: 0;
  color: var(--ink);
}

.sidebar-nav {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.view-button {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  width: 100%;
  min-height: 40px;
  padding: 8px 12px;
  border-radius: 6px;
  color: #586477;
  font-size: 0.9rem;
  font-weight: 700;
  text-align: left;
}

.view-button.is-active {
  background: var(--accent);
  color: #ffffff;
  box-shadow: 0 10px 20px rgba(47, 115, 223, 0.24);
}

.nav-icon {
  font-size: 0.72rem;
  font-weight: 800;
  opacity: 0.72;
}

.sidebar-footer {
  display: grid;
  gap: 10px;
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.app-main {
  min-width: 0;
  padding: 22px 24px 24px;
  overflow: auto;
  background: #ffffff;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 12px;
}

.topbar-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.content-shell {
  display: grid;
  gap: 14px;
}

.workspace-header {
  align-items: center;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.workspace-header h2 {
  color: var(--ink);
}

.calendar-actions {
  display: inline-flex;
  gap: 8px;
  flex-wrap: wrap;
}

.section-label {
  margin-bottom: 4px;
  color: #8792a4;
  font-size: 0.66rem;
  letter-spacing: 0.12em;
}

.flash-message-inline {
  min-height: 18px;
  margin: 0 0 10px;
}

.app-shell.is-driver-view-active #app-message {
  display: none;
}

.panel,
.meta-card,
.summary-card,
.driver-day-card,
.planner-driver,
.day-cell,
.account-card,
.job-card,
.message-panel,
.driver-admin-card,
.driver-job {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  box-shadow: none;
  backdrop-filter: none;
}

.controls-panel,
.driver-panel,
.drivers-admin-panel {
  padding: 10px;
  border-radius: 6px;
}

.week-strip {
  display: grid;
  justify-items: start;
  gap: 6px;
  margin: 0;
}

.week-tabs {
  justify-content: start;
}

.week-tab,
.week-nav-arrow {
  min-height: 34px;
  border-radius: 5px;
  background: #f3f6fb;
  color: var(--ink);
}

.week-tab.is-active {
  background: var(--accent);
  color: #ffffff;
}

.week-tab-display {
  max-width: min(100%, 360px);
  padding: 8px 12px;
  font-weight: 800;
}

.week-jump-select {
  flex: 0 0 auto;
  width: auto;
  max-width: min(54vw, 230px);
  min-height: 34px;
  padding: 7px 28px 7px 10px;
  border: 1px solid #d8e1ee;
  border-radius: 5px;
  background: var(--accent);
  color: #ffffff;
  font-size: 0.76rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: none;
}

.week-jump-select:hover {
  background: #245fbd;
}

.week-jump-select option {
  background: #ffffff;
  color: var(--ink);
}

.week-copy {
  font-size: 0.78rem;
}

.dashboard-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 14px;
}

.dashboard-card {
  display: grid;
  gap: 5px;
  min-height: 86px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  box-shadow: var(--shadow-soft);
}

.dashboard-card p,
.dashboard-card span {
  margin: 0;
  color: var(--muted);
}

.dashboard-card strong {
  color: var(--ink);
  font-size: 2rem;
  line-height: 1;
  font-weight: 700;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.85fr);
  gap: 14px;
}

.dashboard-panel {
  padding: 14px;
}

.panel-heading,
.message-list-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.dashboard-table,
.dashboard-message-list,
.messages-inbox {
  display: grid;
  gap: 8px;
}

.dashboard-row {
  display: grid;
  grid-template-columns: minmax(140px, 1.2fr) repeat(3, minmax(70px, 0.6fr));
  gap: 10px;
  align-items: center;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #f8fafd;
}

.dashboard-row span {
  color: var(--muted);
  font-weight: 600;
}

.message-list-item {
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
}

.message-list-item.has-unread {
  border-left: 4px solid var(--danger);
}

.message-list-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.message-list-item p {
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
}

.message-list-item span:not(.message-unread-tag) {
  display: -webkit-box;
  color: var(--ink);
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.empty-state-panel {
  padding: 16px;
  color: var(--muted);
}

input,
select,
textarea {
  min-height: var(--control-height);
  border-radius: 5px;
  background: #ffffff;
  box-shadow: none;
}

.primary-button,
.secondary-button,
.upload-label,
.ghost-button {
  min-height: var(--control-height);
  border-radius: 5px;
}

.primary-button {
  background: var(--accent);
}

.secondary-button,
.upload-label {
  border: 1px solid #d8e1ee;
  background: #f5f8fc;
  color: var(--accent);
}

.notification-button {
  min-height: 34px;
  border-radius: 5px;
  background: #f5f8fc;
}

.notification-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  color: #ffffff;
  font-size: 0.72rem;
}

.planner-board {
  gap: 8px;
  padding: 2px 2px 14px;
  overflow-x: auto;
  overflow-y: visible;
  border-radius: 0;
  cursor: grab;
}

.planner-driver {
  flex-basis: var(--driver-column-width);
  width: var(--driver-column-width);
  padding: 8px;
  background: #f8fafd;
}

.driver-header {
  top: 0;
  padding: 7px 6px 8px;
  margin: -8px -8px 8px;
  border-bottom: 1px solid var(--line-strong);
  background: #ffffff;
}

.driver-header h3 {
  font-size: 0.94rem;
  font-weight: 800;
}

.driver-meta {
  margin-top: 5px;
  font-size: 0.64rem;
}

.truck-chip {
  min-height: 24px;
  padding: 3px 6px;
  border-radius: 4px;
  background: var(--accent-soft);
  font-size: 0.58rem;
}

.driver-days {
  gap: 6px;
  grid-auto-rows: auto;
}

.day-cell {
  padding: 7px;
  border-radius: 4px;
  background: #ffffff;
}

.day-cell.is-preview-expanded {
  height: auto;
  min-height: calc(var(--calendar-cell-height) + 68px);
  overflow: visible;
  position: relative;
  z-index: 3;
  box-shadow: 0 12px 28px rgba(36, 51, 75, 0.14);
}

.day-cell.is-selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(47, 115, 223, 0.16);
}

.day-cell.is-complete {
  background: #eaf8f2;
  border-color: rgba(34, 156, 115, 0.36);
}

.day-cell.is-rest {
  background: #0a3a78;
  border-color: #082f61;
}

.day-cell.is-holiday {
  background: #ffe000;
  border-color: #d7b800;
}

.day-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 5px;
  min-height: 0;
}

.day-head-pills {
  display: flex;
  align-items: center;
  justify-items: start;
  gap: 4px;
  flex-wrap: wrap;
}

.day-name {
  font-size: 0.76rem;
  font-weight: 800;
}

.day-caption {
  margin-top: 3px;
  font-size: 0.64rem;
  -webkit-line-clamp: 1;
}

.day-pill,
.day-alert-pill,
.status-pill,
.message-unread-tag,
.job-type-badge {
  border-radius: 4px;
  letter-spacing: 0;
}

.day-pill {
  padding: 3px 5px;
  font-size: 0.58rem;
}

.day-preview-list {
  gap: 4px;
  margin-top: 6px;
  overflow: hidden;
}

.day-cell.is-preview-expanded .day-preview-list {
  overflow: visible;
}

.day-preview-item,
.day-preview-empty {
  min-height: 0;
  padding: 4px 6px;
  border-radius: 4px;
  background: #f8fafd;
  overflow: hidden;
}

.day-preview-item strong,
.day-preview-empty strong {
  display: block;
  color: var(--ink);
  font-size: 0.6rem;
  letter-spacing: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.day-preview-item span,
.day-preview-empty span {
  display: block;
  margin-top: 2px;
  color: var(--ink);
  font-size: 0.66rem;
  line-height: 1.18;
  -webkit-line-clamp: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.day-preview-item small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.6rem;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.day-preview-job.is-compact small {
  display: none;
}

.day-preview-more {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  padding: 4px 6px;
  border: 1px dashed #b8c6d8;
  border-radius: 4px;
  background: #eef4fb;
  color: var(--ink);
  font-size: 0.62rem;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.day-preview-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 100%;
  min-height: 23px;
  margin-top: 5px;
  padding: 4px 6px;
  border: 1px dashed #b8c6d8;
  border-radius: 4px;
  background: #eef4fb;
  color: var(--ink);
  cursor: pointer;
  font-size: 0.62rem;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.day-preview-toggle:hover,
.day-preview-toggle:focus-visible {
  border-color: var(--accent);
  background: #e4effc;
}

.day-preview-toggle b {
  color: var(--accent);
  font-size: 0.72rem;
  line-height: 1;
}

.day-preview-job.is-delivery {
  border-left: 3px solid var(--accent);
}

.day-preview-job.is-collection {
  border-left: 3px solid var(--success);
}

.day-cell.is-rest .day-preview-item,
.day-cell.is-rest .day-preview-empty {
  background: rgba(255, 255, 255, 0.14);
}

.day-cell.is-holiday .day-preview-item,
.day-cell.is-holiday .day-preview-empty {
  background: rgba(255, 255, 255, 0.48);
}

.planner-modal-card {
  width: min(1120px, calc(100vw - 28px));
  max-height: calc(100vh - 28px);
  margin: 14px auto;
  padding: 16px;
  padding-top: 44px;
  border-radius: 8px;
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 100;
  margin: 0;
  border-radius: 5px;
  background: var(--accent);
  color: #ffffff;
}

.planner-modal-layout {
  grid-template-columns: minmax(0, 1.65fr) minmax(260px, 0.85fr);
}

.message-panel,
.compact-panel,
.editor-empty,
.driver-day-card,
.driver-job,
.driver-admin-card,
.job-card {
  border-radius: 6px;
}

.drivers-directory {
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
}

@media (max-width: 700px) {
  .shell {
    width: min(100vw - 18px, 100%);
    margin: 10px auto;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .app-sidebar {
    gap: 12px;
    padding: 16px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .sidebar-nav {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  }

  .sidebar-footer {
    margin-top: 0;
  }

  .app-main {
    padding: 16px;
  }

  .topbar,
  .workspace-header,
  .panel-heading,
  .holiday-panel-head,
  .message-list-item {
    align-items: stretch;
    flex-direction: column;
  }

  .dashboard-metrics,
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-row {
    grid-template-columns: 1fr 1fr;
  }

  .holiday-form {
    grid-template-columns: 1fr;
  }

  .holiday-form-actions {
    justify-content: stretch;
  }

  .holiday-form-actions button {
    flex: 1;
  }
}

/* Readability and calmer availability states */
:root {
  --rest: #b9d0ea;
  --rest-soft: #edf4fb;
}

.day-cell.is-rest,
.driver-day-card.is-rest {
  background: #d7e7f8;
  border-color: #adc7e4;
  color: var(--ink);
}

.day-cell.is-rest .day-name,
.day-cell.is-rest .day-caption,
.day-cell.is-rest .day-preview-more,
.day-cell.is-rest .day-preview-item strong,
.day-cell.is-rest .day-preview-item span,
.day-cell.is-rest .day-preview-empty,
.day-cell.is-rest .day-preview-empty strong,
.day-cell.is-rest .day-preview-empty span,
.driver-day-card.is-rest,
.driver-day-card.is-rest .section-label,
.driver-day-card.is-rest h4,
.driver-day-card.is-rest p,
.driver-day-card.is-rest span {
  color: #172238;
}

.day-cell.is-rest .day-preview-item,
.day-cell.is-rest .day-preview-empty,
.driver-day-card.is-rest .driver-job,
.driver-day-card.is-rest .message-panel {
  background: rgba(255, 255, 255, 0.72);
  border-color: rgba(88, 116, 150, 0.18);
}

.day-pill.day-pill-rest,
.status-rest {
  background: #b9d0ea;
  color: #153b64;
}

.status-sick {
  background: #ffb15c;
  color: #663100;
}

.driver-day-card.is-holiday,
.driver-day-card.is-holiday .section-label,
.driver-day-card.is-holiday h4,
.driver-day-card.is-holiday p,
.driver-day-card.is-holiday span {
  color: #352b00;
}

.driver-day-card.is-holiday .driver-job,
.driver-day-card.is-holiday .message-panel {
  background: rgba(255, 255, 255, 0.68);
}

.job-edit-panel {
  border-color: rgba(47, 115, 223, 0.24);
  background: #f8fbff;
}

.job-card-actions {
  gap: 6px;
}

.job-edit-button,
.job-remove-button {
  min-height: 28px;
  padding: 4px 8px;
  font-size: 0.7rem;
}

/* Job category highlights */
.job-category-general-haulage {
  --job-category-ink: #17633c;
  --job-category-border: #78cda1;
  --job-category-bg: #e8f8ef;
  --job-category-bg-strong: #d7f1e3;
}

.job-category-amazon {
  --job-category-ink: #075f72;
  --job-category-border: #72d7e8;
  --job-category-bg: #ddf9ff;
  --job-category-bg-strong: #c9f1fb;
}

.job-category-two-man-delivery {
  --job-category-ink: #6741a0;
  --job-category-border: #c8a8ff;
  --job-category-bg: #f1e8ff;
  --job-category-bg-strong: #e6d8ff;
}

.day-preview-job.job-category-general-haulage,
.day-preview-job.job-category-amazon,
.day-preview-job.job-category-two-man-delivery,
.job-card.job-category-general-haulage,
.job-card.job-category-amazon,
.job-card.job-category-two-man-delivery,
.driver-job.job-category-general-haulage,
.driver-job.job-category-amazon,
.driver-job.job-category-two-man-delivery {
  border-color: var(--job-category-border);
  border-left: 4px solid var(--job-category-border);
  background: linear-gradient(180deg, var(--job-category-bg), #ffffff);
}

.day-preview-job.job-category-general-haulage strong,
.day-preview-job.job-category-amazon strong,
.day-preview-job.job-category-two-man-delivery strong,
.job-card.job-category-general-haulage .job-category,
.job-card.job-category-amazon .job-category,
.job-card.job-category-two-man-delivery .job-category,
.driver-job.job-category-general-haulage .job-category-badge,
.driver-job.job-category-amazon .job-category-badge,
.driver-job.job-category-two-man-delivery .job-category-badge {
  color: var(--job-category-ink);
}

.driver-job.job-category-general-haulage .job-category-badge,
.driver-job.job-category-amazon .job-category-badge,
.driver-job.job-category-two-man-delivery .job-category-badge,
.job-category-chip.job-category-general-haulage:has(input:checked),
.job-category-chip.job-category-amazon:has(input:checked),
.job-category-chip.job-category-two-man-delivery:has(input:checked),
.export-category-chip.job-category-general-haulage:has(input:checked),
.export-category-chip.job-category-amazon:has(input:checked),
.export-category-chip.job-category-two-man-delivery:has(input:checked) {
  border-color: var(--job-category-border);
  background: var(--job-category-bg-strong);
  color: var(--job-category-ink);
}

.profile-group,
.profile-list,
.vehicles-list,
.driver-job-section {
  display: grid;
  gap: 8px;
}

.drivers-directory {
  grid-template-columns: 1fr;
  align-items: start;
}

.profile-group + .profile-group,
.driver-job-section + .driver-job-section {
  margin-top: 12px;
}

.profile-group-head,
.profile-card-head,
.vehicle-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.profile-card-head,
.vehicle-card-head {
  flex-wrap: wrap;
}

.profile-card-head > *,
.vehicle-card-head > * {
  min-width: 0;
}

.profile-group-head h3 {
  margin: 0;
  font-size: 0.95rem;
}

.profile-name-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  padding: 0;
  text-align: left;
  min-width: 150px;
  max-width: 100%;
}

.profile-name-toggle span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-name-toggle b {
  color: var(--muted);
  font-size: 0.62rem;
}

.profile-card-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
  margin-left: auto;
}

.compact-button {
  min-height: 26px;
  padding: 5px 8px;
  font-size: 0.66rem;
}

.profile-details {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin-top: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  background: #f8fafd;
  font-size: 0.68rem;
}

.profile-details span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-card-office {
  background: #fbfcff;
}

.profile-card-office .profile-card-head {
  min-height: 30px;
}

.profile-edit-form {
  margin-top: 8px;
}

.compact-profile-grid {
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
}

.vehicle-create-form,
.vehicle-edit-form {
  display: grid;
  grid-template-columns: minmax(120px, 0.7fr) minmax(150px, 0.8fr) minmax(180px, 1fr) auto;
  gap: 8px;
  align-items: end;
  margin-bottom: 12px;
}

.vehicle-card {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #ffffff;
}

.vehicle-status-attention {
  border-color: #f2bf62;
  background: #fff8e8;
}

.vehicle-status-repair {
  border-color: #f19999;
  background: #fff0f0;
}

.vehicle-note,
.vehicle-report {
  margin-top: 8px;
  padding: 7px 8px;
  border: 1px solid rgba(88, 116, 150, 0.16);
  background: #f8fafd;
  font-size: 0.68rem;
}

.vehicle-report {
  display: grid;
  gap: 3px;
}

.driver-job-section {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #ffffff;
}

.driver-job-section.is-empty {
  background: #f8fafd;
}

.driver-mobile-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  place-items: center;
  text-align: center;
}

.driver-connection-status {
  display: grid;
  gap: 2px;
  width: min(100%, 420px);
  margin: 0 auto 10px;
  padding: 8px 10px;
  border: 1px solid rgba(45, 155, 77, 0.18);
  border-left: 4px solid var(--success);
  border-radius: 10px;
  background: #f1fbf4;
  text-align: left;
}

.driver-connection-status span {
  color: var(--success);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.driver-connection-status strong {
  color: var(--ink);
  font-size: 0.72rem;
}

.driver-connection-status.is-offline {
  border-color: rgba(185, 64, 47, 0.18);
  border-left-color: var(--danger);
  background: #fff3ef;
}

.driver-connection-status.is-offline span {
  color: var(--danger);
}

.driver-connection-status.is-syncing {
  border-color: rgba(244, 185, 66, 0.26);
  border-left-color: var(--warning);
  background: #fff8e8;
}

.driver-connection-status.is-syncing span {
  color: #9a5e03;
}

.driver-mobile-avatar {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 18px;
  background:
    radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.75), transparent 32%),
    linear-gradient(135deg, #d8ecf9, #2f73dc);
  color: #ffffff;
  font-size: 1.1rem;
  font-weight: 900;
  box-shadow: 0 10px 24px rgba(47, 115, 220, 0.18);
}

.driver-mobile-avatar.is-large {
  width: 76px;
  height: 76px;
  margin: 0 auto 10px;
  border-radius: 22px;
  font-size: 1.3rem;
}

.driver-mobile-identity h3 {
  margin: 0 0 3px;
  font-size: 1.2rem;
}

.driver-mobile-identity span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
}

.driver-mobile-stat-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: min(100%, 340px);
  margin-top: 4px;
  overflow: hidden;
  border-radius: 10px;
  background:
    radial-gradient(circle at 15% 35%, rgba(255, 255, 255, 0.12), transparent 26%),
    linear-gradient(135deg, #164a73, #2f73dc);
  color: #ffffff;
}

.driver-mobile-stat-panel div {
  display: grid;
  gap: 2px;
  padding: 11px 14px;
}

.driver-mobile-stat-panel div + div {
  border-left: 1px solid rgba(255, 255, 255, 0.22);
}

.driver-mobile-stat-panel span {
  font-size: 0.68rem;
  opacity: 0.74;
}

.driver-mobile-stat-panel strong {
  font-size: 1.1rem;
}

.driver-mobile-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-top: 12px;
}

.driver-mobile-tabs button {
  display: grid;
  place-items: center;
  gap: 4px;
  min-height: 52px;
  border: 1px solid rgba(47, 115, 220, 0.1);
  border-radius: 18px;
  background: #ffffff;
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 900;
  cursor: pointer;
}

.driver-mobile-tabs button span {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: #eef4fb;
  color: #2f73dc;
}

.driver-mobile-tabs button span svg {
  width: 15px;
  height: 15px;
  fill: currentColor;
}

.driver-mobile-tabs button.is-active {
  border-color: rgba(47, 115, 220, 0.28);
  background: #eef4fb;
  color: #2f73dc;
}

.driver-mobile-tabs button.is-active span {
  background: #2f73dc;
  color: #ffffff;
  box-shadow: 0 7px 16px rgba(47, 115, 220, 0.22);
}

.driver-mobile-dock.driver-mobile-tabs {
  position: fixed;
  right: auto;
  bottom: max(18px, calc(env(safe-area-inset-bottom) + 14px));
  left: 50%;
  z-index: 150;
  width: min(calc(100vw - 24px), 520px);
  margin: 0;
  padding: 8px;
  border: 1px solid rgba(47, 115, 220, 0.12);
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 18px 34px rgba(24, 34, 56, 0.18);
  transform: translateX(-50%) translateZ(0);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.driver-mobile-toolbar {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.driver-view-toggle {
  display: inline-flex;
  align-items: center;
  padding: 3px;
  gap: 3px;
  border: 1px solid rgba(47, 115, 220, 0.16);
  background: #eef4fb;
}

.driver-view-toggle button {
  min-height: 26px;
  border: 0;
  padding: 5px 9px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
  font-size: 0.68rem;
  cursor: pointer;
}

.driver-view-toggle button.is-active {
  color: #ffffff;
  background: #2f73dc;
  box-shadow: 0 4px 10px rgba(47, 115, 220, 0.18);
}

.driver-mobile-alert {
  display: grid;
  gap: 3px;
  padding: 10px 12px;
  border: 1px solid rgba(244, 185, 66, 0.46);
  border-left: 4px solid var(--warning);
  background: #fff8e8;
  color: #664c00;
}

.driver-mobile-alert strong {
  font-size: 0.84rem;
}

.driver-mobile-alert span {
  font-size: 0.72rem;
}

.driver-offline-tip {
  display: grid;
  gap: 2px;
  margin-top: 9px;
  padding: 9px 10px;
  border: 1px solid rgba(185, 64, 47, 0.16);
  border-left: 4px solid var(--danger);
  border-radius: 8px;
  background: #fff3ef;
  color: #7c2d22;
}

.driver-offline-tip strong {
  font-size: 0.76rem;
}

.driver-offline-tip span {
  font-size: 0.7rem;
}

.driver-mobile-page,
.driver-mobile-mini-feed,
.driver-mobile-job-sections,
.driver-mobile-message-list,
.driver-mobile-profile-page {
  display: grid;
  gap: 10px;
}

.driver-mobile-page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.driver-mobile-page-head h4 {
  margin: 0;
}

.driver-mobile-page-head > span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.driver-mobile-highlight-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.driver-highlight-card,
.driver-mobile-action-card,
.driver-completed-toggle {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
  text-align: left;
  cursor: pointer;
}

.driver-highlight-card {
  display: grid;
  gap: 4px;
  min-height: 98px;
  padding: 12px;
}

.driver-highlight-card span,
.driver-mobile-action-card strong,
.driver-completed-toggle strong {
  color: var(--ink);
  font-size: 0.78rem;
}

.driver-highlight-card strong {
  color: #2f73dc;
  font-size: 1.55rem;
  line-height: 1;
}

.driver-highlight-card small,
.driver-mobile-action-card span,
.driver-completed-toggle small {
  color: var(--muted);
  font-size: 0.68rem;
}

.driver-mobile-action-card {
  display: grid;
  gap: 4px;
  padding: 11px 12px;
}

.driver-week-picker {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 7px;
  align-items: end;
  padding: 10px;
  border: 1px solid rgba(47, 115, 220, 0.12);
  border-radius: 10px;
  background: #f8fbff;
}

.driver-week-picker label,
.driver-week-select-field {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 900;
  text-transform: uppercase;
}

.driver-week-picker select,
.driver-week-select-field select {
  width: 100%;
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: var(--ink);
  font-size: 0.76rem;
}

.driver-completed-drawer,
.driver-mobile-card,
.driver-profile-focus {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
}

.driver-completed-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0;
  border: 0;
}

.driver-completed-toggle span {
  display: grid;
  gap: 2px;
}

.driver-completed-toggle b {
  display: inline-flex;
  padding: 6px 9px;
  border-radius: 999px;
  background: #eef4fb;
  color: #2f73dc;
  font-size: 0.66rem;
}

.driver-completed-drawer.is-open {
  display: grid;
  gap: 9px;
}

.driver-message-card {
  display: grid;
  gap: 7px;
  padding: 10px;
  border: 1px solid var(--line);
  border-left: 4px solid #d8ecf9;
  border-radius: 10px;
  background: #ffffff;
}

.driver-message-card.is-unread {
  border-left-color: #2f73dc;
  background: #eef4fb;
}

.driver-message-card h4,
.driver-message-card p {
  margin: 0;
}

.driver-message-card span {
  color: var(--muted);
  font-size: 0.68rem;
}

.driver-profile-focus {
  text-align: center;
  background: #f8fbff;
}

.driver-profile-focus h4 {
  margin: 0 0 2px;
}

.driver-profile-focus p {
  margin-bottom: 10px;
  color: var(--muted);
}

.driver-profile-meta-full {
  grid-template-columns: 1fr;
  min-width: 0;
  text-align: left;
}

.driver-profile-tab {
  display: inline-flex;
  width: fit-content;
  margin-bottom: 8px;
  padding: 5px 11px;
  border: 1px solid rgba(47, 115, 220, 0.18);
  background: #ffffff;
  color: #2f73dc;
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.driver-profile-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
}

.driver-profile-card h3 {
  margin: 0 0 4px;
}

.driver-profile-card p,
.driver-sync-copy {
  margin: 0;
}

.driver-profile-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(110px, 1fr));
  gap: 6px;
  min-width: 280px;
}

.driver-profile-meta span {
  min-width: 0;
  padding: 6px 8px;
  border: 1px solid rgba(21, 32, 51, 0.08);
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  font-size: 0.7rem;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.driver-sync-copy {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
}

.ios-install-tip {
  display: grid;
  gap: 2px;
  margin-top: 9px;
  padding: 9px 10px;
  border: 1px solid rgba(47, 115, 220, 0.18);
  border-left: 4px solid #2f73dc;
  background: #eef4fb;
}

.ios-install-tip strong {
  font-size: 0.76rem;
}

.ios-install-tip span {
  color: var(--muted);
  font-size: 0.7rem;
}

.driver-day-card-compact {
  padding: 8px;
  border-radius: 4px;
}

.day-preview-job.is-collection,
.job-card.is-collection,
.driver-job.is-collection {
  border-color: rgba(214, 62, 62, 0.34);
  border-left-color: #d63e3e;
  background: #fff0f0;
}

.day-preview-job.is-collection strong,
.job-card.is-collection .job-id,
.driver-job.is-collection .job-id {
  color: #a72828;
}

.view-button .nav-icon {
  font-size: 0;
  line-height: 1;
}

.view-button .nav-icon::before {
  content: "\2022";
  font-size: 1.15rem;
}

@media (max-width: 900px) {
  .profile-details,
  .vehicle-create-form,
  .vehicle-edit-form {
    grid-template-columns: 1fr;
  }

  .profile-card-head,
  .vehicle-card-head {
    align-items: flex-start;
  }

  .profile-card-actions {
    width: 100%;
    justify-content: flex-start;
    margin-left: 0;
  }

  .driver-mobile-toolbar,
  .driver-view-toggle {
    width: 100%;
  }

  .driver-mobile-toolbar > button,
  .driver-view-toggle button {
    flex: 1;
  }
}

@media (max-width: 760px) {
  body {
    background: #eef4fb;
  }

  .shell {
    width: 100%;
    margin: 0;
  }

  .app-shell {
    min-height: 100vh;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .app-main {
    padding: 12px;
  }

  .app-shell.is-driver-session .app-main {
    min-height: 100vh;
    padding: 12px 12px 174px;
  }

  #driver-view .workspace-header {
    padding: 2px 0 10px;
  }

  #driver-view .workspace-header h2 {
    font-size: 1.1rem;
  }

  .driver-panel {
    padding: 12px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.74);
  }

  .driver-toolbar {
    display: none;
    grid-template-columns: 1fr;
    gap: 8px;
    margin-bottom: 8px;
  }

  .driver-summary {
    margin: 0 0 12px;
    padding: 14px;
    border: 1px solid rgba(47, 115, 220, 0.12);
    border-radius: 14px;
    background: #f8fbff;
  }

  .driver-connection-status {
    gap: 3px;
    margin-bottom: 12px;
    padding: 10px 12px;
    border-radius: 12px;
  }

  .driver-connection-status span {
    font-size: 0.74rem;
  }

  .driver-connection-status strong {
    font-size: 0.84rem;
    line-height: 1.35;
  }

  .driver-mobile-hero {
    gap: 12px;
  }

  .driver-mobile-avatar {
    width: 70px;
    height: 70px;
    border-radius: 22px;
    font-size: 1.3rem;
  }

  .driver-mobile-identity .section-label {
    font-size: 0.74rem;
  }

  .driver-mobile-identity h3 {
    font-size: 1.45rem;
  }

  .driver-mobile-identity span {
    font-size: 0.88rem;
    line-height: 1.35;
  }

  .driver-mobile-stat-panel {
    width: 100%;
    border-radius: 14px;
  }

  .driver-mobile-stat-panel div {
    gap: 4px;
    padding: 14px 16px;
  }

  .driver-mobile-stat-panel span {
    font-size: 0.78rem;
  }

  .driver-mobile-stat-panel strong {
    font-size: 1.34rem;
  }

  .driver-profile-card {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .driver-profile-meta {
    grid-template-columns: 1fr 1fr;
    min-width: 0;
  }

  .driver-profile-meta span {
    padding: 6px;
    font-size: 0.66rem;
  }

  .driver-mobile-toolbar {
    gap: 8px;
  }

  .driver-mobile-toolbar > button,
  .driver-view-toggle button {
    min-height: 42px;
    padding: 10px 12px;
    font-size: 0.8rem;
  }

  .driver-mobile-tabs {
    position: fixed;
    right: 12px;
    bottom: max(18px, calc(env(safe-area-inset-bottom) + 14px));
    left: 12px;
    z-index: 260;
    padding: 9px;
    border: 1px solid rgba(47, 115, 220, 0.12);
    border-radius: 30px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 18px 34px rgba(24, 34, 56, 0.16);
    backdrop-filter: blur(14px);
  }

  .driver-mobile-tabs button {
    min-height: 56px;
    border: 0;
    border-radius: 22px;
    background: transparent;
    font-size: 0.72rem;
  }

  .driver-mobile-tabs button span {
    width: 32px;
    height: 32px;
  }

  .driver-mobile-tabs button span svg {
    width: 17px;
    height: 17px;
  }

  .driver-mobile-tabs button.is-active {
    background: #eef4fb;
  }

  .driver-job-section,
  .account-settings-panel {
    padding: 14px;
    border-radius: 12px;
  }

  .driver-mobile-page,
  .driver-mobile-mini-feed,
  .driver-mobile-job-sections,
  .driver-mobile-message-list,
  .driver-mobile-profile-page {
    gap: 12px;
  }

  .driver-mobile-page-head h4 {
    font-size: 1.08rem;
  }

  .driver-mobile-page-head > span {
    font-size: 0.8rem;
  }

  .driver-mobile-highlight-grid {
    gap: 10px;
  }

  .driver-highlight-card {
    min-height: 112px;
    padding: 14px;
  }

  .driver-highlight-card span,
  .driver-mobile-action-card strong,
  .driver-completed-toggle strong {
    font-size: 0.88rem;
  }

  .driver-highlight-card strong {
    font-size: 1.78rem;
  }

  .driver-highlight-card small,
  .driver-mobile-action-card span,
  .driver-completed-toggle small {
    font-size: 0.78rem;
  }

  .driver-mobile-action-card,
  .driver-mobile-card,
  .driver-profile-focus,
  .driver-completed-drawer {
    padding: 14px;
    border-radius: 12px;
  }

  .driver-week-picker {
    gap: 9px;
    padding: 12px;
    border-radius: 12px;
  }

  .driver-week-picker label,
  .driver-week-select-field {
    font-size: 0.72rem;
  }

  .driver-week-picker select,
  .driver-week-select-field select {
    min-height: 40px;
    font-size: 0.86rem;
  }

  .driver-week-header,
  .driver-job-head,
  .message-panel-head {
    align-items: stretch;
    flex-direction: column;
    gap: 8px;
  }

  .driver-job-list {
    gap: 12px;
  }

  .driver-job {
    padding: 12px;
    border-radius: 12px;
  }

  .driver-job h5 {
    font-size: 1rem;
  }

  .driver-job-controls {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .driver-job p,
  .message-panel p,
  .driver-job-section p {
    font-size: 0.86rem;
    line-height: 1.42;
  }

  .driver-job-title-row {
    gap: 7px;
  }

  .driver-mobile-alert {
    padding: 12px 14px;
    border-radius: 12px;
  }

  .driver-mobile-alert strong {
    font-size: 0.92rem;
  }

  .driver-mobile-alert span,
  .driver-offline-tip span {
    font-size: 0.82rem;
    line-height: 1.35;
  }

  .driver-offline-tip {
    padding: 11px 12px;
    border-radius: 12px;
  }

  .driver-offline-tip strong {
    font-size: 0.86rem;
  }

  .driver-message-card {
    padding: 12px;
    border-radius: 12px;
  }

  .driver-message-card span,
  .driver-sync-copy,
  .driver-profile-meta span {
    font-size: 0.8rem;
  }

  .message-form textarea {
    min-height: 104px;
    font-size: 0.92rem;
  }
}

@media (max-width: 900px), (pointer: coarse) {
  .app-shell.is-driver-session .app-main {
    padding-bottom: 174px;
  }

  .driver-mobile-dock.driver-mobile-tabs {
    position: fixed;
    right: auto;
    bottom: max(18px, calc(env(safe-area-inset-bottom) + 14px));
    left: 50%;
    z-index: 150;
    width: min(calc(100vw - 24px), 520px);
    padding: 8px;
    border: 1px solid rgba(47, 115, 220, 0.12);
    border-radius: 30px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 18px 34px rgba(24, 34, 56, 0.16);
    transform: translateX(-50%) translateZ(0);
    backdrop-filter: blur(14px);
  }
}

@supports (padding: max(0px)) {
  @media (max-width: 760px) {
    .app-main {
      padding-right: max(12px, env(safe-area-inset-right));
      padding-left: max(12px, env(safe-area-inset-left));
      padding-bottom: max(12px, env(safe-area-inset-bottom));
    }

    .app-shell.is-driver-session .app-main {
      padding-bottom: max(174px, calc(env(safe-area-inset-bottom) + 160px));
    }
  }
}

/* Refined login and calendar surfaces */
.auth-shell {
  grid-template-columns: 1fr;
  place-items: center;
  min-height: calc(100vh - 36px);
}

.login-panel {
  width: min(360px, 100%);
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 18px 42px rgba(24, 34, 56, 0.12);
}

.login-brand {
  display: grid;
  gap: 4px;
  margin-bottom: 14px;
  text-align: center;
}

.login-brand h1 {
  color: var(--ink);
  font-size: clamp(1.75rem, 3.4vw, 2.25rem);
  line-height: 0.95;
}

.login-panel .form-heading {
  justify-content: center;
  text-align: center;
}

.login-panel .job-form {
  gap: 10px;
}

.view-button .nav-icon {
  font-size: 0;
}

.view-button .nav-icon::before {
  content: "\2022";
  font-size: 1.2rem;
  line-height: 1;
}

#scheduler-view.is-active {
  padding: 14px;
  border: 1px solid rgba(21, 32, 51, 0.08);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.88) 0%, rgba(244, 248, 252, 0.96) 100%),
    radial-gradient(circle at top right, rgba(47, 120, 216, 0.08), transparent 34%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

#scheduler-view .workspace-header {
  border-bottom-color: rgba(21, 32, 51, 0.1);
}

#scheduler-view .workspace-header h2,
#scheduler-view .week-copy {
  color: var(--ink);
}

#scheduler-view .section-label {
  color: var(--accent);
}

#scheduler-view .controls-panel {
  border-color: rgba(21, 32, 51, 0.09);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 10px 24px rgba(24, 34, 56, 0.06);
}

#scheduler-view .planner-board {
  margin-top: 4px;
  padding: 10px 10px 16px;
  border: 1px solid rgba(21, 32, 51, 0.1);
  border-radius: 6px;
  background:
    linear-gradient(180deg, #ffffff 0%, #f3f7fb 100%);
  box-shadow:
    inset 0 -18px 0 rgba(21, 32, 51, 0.025),
    0 14px 30px rgba(24, 34, 56, 0.08);
  scrollbar-color: #51677f #d8e1eb;
  scrollbar-width: thin;
}

#scheduler-view .planner-board::-webkit-scrollbar-track {
  background: #d8e1eb;
  border-radius: 999px;
}

#scheduler-view .planner-board::-webkit-scrollbar-thumb {
  background: #51677f;
  border: 2px solid #d8e1eb;
  border-radius: 999px;
}

#scheduler-view .planner-board::-webkit-scrollbar-thumb:hover {
  background: #33475d;
}

#scheduler-view .planner-board.is-drag-ready,
#scheduler-view .planner-board:hover {
  cursor: grab;
}

#scheduler-view .planner-board.is-dragging {
  cursor: grabbing;
}

#scheduler-view .planner-scroll-cue {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: min(520px, 100%);
  min-height: 34px;
  margin: 10px auto 0;
  padding: 7px 14px;
  border: 1px solid rgba(21, 32, 51, 0.2);
  border-radius: 999px;
  color: #25364a;
  background:
    linear-gradient(180deg, #eaf0f7 0%, #d9e3ee 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.82),
    0 8px 18px rgba(24, 34, 56, 0.12);
  cursor: grab;
  user-select: none;
  touch-action: pan-y pinch-zoom;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.01em;
}

#scheduler-view .planner-scroll-cue:hover,
#scheduler-view .planner-scroll-cue.is-drag-ready {
  border-color: rgba(21, 32, 51, 0.34);
  background:
    linear-gradient(180deg, #dfe8f2 0%, #cbd8e6 100%);
}

#scheduler-view .planner-scroll-cue.is-dragging {
  color: #ffffff;
  background: #33475d;
  cursor: grabbing;
}

#scheduler-view .scroll-cue-grip {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
  width: 38px;
  height: 16px;
  border-radius: 999px;
  background:
    repeating-linear-gradient(
      90deg,
      #33475d 0 3px,
      transparent 3px 7px
    );
}

#scheduler-view .planner-scroll-cue.is-dragging .scroll-cue-grip {
  background:
    repeating-linear-gradient(
      90deg,
      #ffffff 0 3px,
      transparent 3px 7px
    );
}

#scheduler-view .planner-driver {
  border-color: rgba(21, 32, 51, 0.1);
  background: #f8fafd;
  box-shadow: 0 8px 20px rgba(24, 34, 56, 0.06);
}

#scheduler-view .week-nav-arrow {
  background: #eef4fb;
}

/* Login dashboard preview and transition */
.auth-shell {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  min-height: calc(100vh - 48px);
  border-radius: 18px;
  background:
    radial-gradient(circle at 18% 16%, rgba(47, 120, 199, 0.22), transparent 30%),
    linear-gradient(135deg, #e8eef7 0%, #f7f9fc 58%, #e4edf8 100%);
}

.login-backdrop-preview {
  position: absolute;
  inset: 18px;
  z-index: 0;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  min-height: calc(100% - 36px);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.66);
  box-shadow: 0 26px 80px rgba(24, 34, 56, 0.18);
  filter: blur(8px);
  opacity: 0.62;
  transform: scale(1.035);
  pointer-events: none;
}

.login-backdrop-preview::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(244, 248, 252, 0.26);
}

.preview-sidebar {
  display: grid;
  align-content: start;
  gap: 18px;
  padding: 26px 24px;
  background: #f2f5fa;
  border-right: 1px solid rgba(21, 32, 51, 0.08);
}

.preview-brand {
  display: grid;
  gap: 4px;
}

.preview-brand strong {
  color: var(--ink);
  font-size: 1.25rem;
  line-height: 1;
}

.preview-brand span {
  color: var(--muted);
  font-size: 0.78rem;
}

.preview-nav {
  display: block;
  width: 145px;
  height: 36px;
  border-radius: 7px;
  background: rgba(15, 95, 143, 0.12);
}

.preview-nav.short {
  width: 118px;
}

.preview-nav.is-active {
  background: #2f78d8;
}

.preview-dashboard {
  display: grid;
  align-content: start;
  gap: 22px;
  padding: 34px;
  background: #ffffff;
}

.preview-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.preview-topbar div {
  display: grid;
  gap: 8px;
}

.preview-topbar span,
.preview-topbar strong,
.preview-topbar i {
  display: block;
  border-radius: 999px;
  background: #e9eef5;
}

.preview-topbar span {
  width: 112px;
  height: 10px;
}

.preview-topbar strong {
  width: 220px;
  height: 28px;
}

.preview-topbar i {
  width: 86px;
  height: 34px;
}

.preview-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.preview-metrics span {
  min-height: 76px;
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(47, 120, 216, 0.14), transparent 38%),
    #ffffff;
  box-shadow: 0 12px 28px rgba(24, 34, 56, 0.1);
}

.preview-board {
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  gap: 16px;
}

.preview-board div {
  min-height: 250px;
  border-radius: 8px;
  background:
    repeating-linear-gradient(180deg, #f2f5fa 0 34px, #ffffff 34px 68px);
  border: 1px solid #edf0f5;
}

.login-panel {
  position: relative;
  z-index: 2;
  box-shadow:
    0 28px 70px rgba(24, 34, 56, 0.24),
    0 8px 18px rgba(24, 34, 56, 0.12);
}

.auth-shell.is-leaving .login-panel {
  animation: login-panel-out 420ms cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.auth-shell.is-leaving .login-backdrop-preview {
  animation: login-preview-out 520ms cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.app-shell {
  transition:
    filter 520ms cubic-bezier(0.4, 0, 0.2, 1),
    opacity 520ms cubic-bezier(0.4, 0, 0.2, 1),
    transform 520ms cubic-bezier(0.4, 0, 0.2, 1);
}

.app-shell.is-transitioning-in {
  filter: blur(12px);
  opacity: 0.35;
  transform: scale(0.985);
}

.app-shell.is-ready {
  filter: blur(0);
  opacity: 1;
  transform: scale(1);
}

.app-shell.is-driver-session.is-ready {
  overflow: visible;
  transform: none;
}

@keyframes login-panel-out {
  0% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }

  100% {
    opacity: 0;
    transform: translateY(-12px) scale(0.96);
  }
}

@keyframes login-preview-out {
  0% {
    opacity: 0.62;
    filter: blur(8px);
  }

  100% {
    opacity: 0;
    filter: blur(1px);
  }
}

@media (max-width: 760px) {
  .login-backdrop-preview {
    grid-template-columns: 84px minmax(0, 1fr);
    inset: 10px;
  }

  .preview-sidebar {
    padding: 18px 12px;
  }

  .preview-brand span,
  .preview-brand strong {
    display: none;
  }

  .preview-nav,
  .preview-nav.short {
    width: 44px;
  }

  .preview-dashboard {
    padding: 22px;
  }

  .preview-metrics {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-shell.is-leaving .login-panel,
  .auth-shell.is-leaving .login-backdrop-preview {
    animation-duration: 1ms;
  }

  .app-shell {
    transition-duration: 1ms;
  }
}

/* Compact manage profiles layout */
#drivers-view .workspace-header {
  padding-bottom: 8px;
}

#drivers-view .workspace-header h2 {
  font-size: 1.35rem;
}

#drivers-view .drivers-admin-panel {
  padding: 8px;
}

#drivers-view .drivers-directory-wrap,
#drivers-view .drivers-directory,
#drivers-view .profile-group {
  gap: 7px;
}

#drivers-view .profile-group-head {
  min-height: 28px;
  padding: 0 2px;
}

#drivers-view .profile-group-head h3 {
  font-size: 0.88rem;
}

#drivers-view .profile-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 7px;
}

#drivers-view .driver-admin-card {
  padding: 7px 8px;
  border-radius: 5px;
  box-shadow: 0 5px 14px rgba(24, 34, 56, 0.04);
}

#drivers-view .profile-card-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  align-items: center;
  min-height: 28px;
}

#drivers-view .profile-name-toggle {
  display: grid;
  grid-template-columns: minmax(84px, 1fr) minmax(70px, auto) auto;
  align-items: center;
  gap: 7px;
  min-width: 0;
  width: 100%;
  font-size: 0.84rem;
}

#drivers-view .profile-name-toggle em {
  overflow: hidden;
  color: var(--muted);
  font-style: normal;
  font-size: 0.68rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#drivers-view .profile-card-actions {
  gap: 4px;
  flex-wrap: nowrap;
  margin-left: 0;
}

#drivers-view .profile-card-actions .status-pill {
  padding: 4px 7px;
  font-size: 0.58rem;
}

#drivers-view .compact-button,
#drivers-view .holiday-add-toggle {
  min-height: 24px;
  padding: 4px 7px;
  font-size: 0.62rem;
  white-space: nowrap;
}

#drivers-view .profile-details {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  margin-top: 6px;
  padding: 6px;
  font-size: 0.66rem;
}

#drivers-view .profile-edit-form {
  margin-top: 6px;
}

#drivers-view .compact-profile-grid {
  grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
  gap: 7px;
}

#drivers-view .working-days-field {
  grid-column: 1 / -1;
  gap: 5px;
  padding: 6px;
  border: 1px solid rgba(21, 32, 51, 0.1);
  border-radius: 6px;
  background: #f8fafd;
}

#drivers-view .working-days-field > span {
  font-size: 0.78rem;
  font-weight: 850;
}

#drivers-view .working-days-field small {
  font-size: 0.65rem;
}

#drivers-view .working-days-grid {
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 3px;
}

#drivers-view .working-day-chip {
  min-width: 0;
  min-height: 30px;
  padding: 4px 2px;
  border-radius: 4px;
}

#drivers-view .working-day-chip .day-short {
  font-size: 0.64rem;
  line-height: 1;
}

#drivers-view .working-day-chip input {
  width: 1px;
  height: 1px;
}

#drivers-view .working-day-chip::after {
  width: 3px;
  height: 3px;
}

#drivers-view .driver-holiday-panel {
  gap: 5px;
  margin-top: 6px;
  padding-top: 6px;
}

#drivers-view .holiday-panel-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  align-items: center;
}

#drivers-view .holiday-summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
}

#drivers-view .holiday-summary span {
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

#drivers-view .holiday-summary strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 0.72rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#drivers-view .holiday-add-box {
  padding: 7px;
}

#drivers-view .holiday-form {
  grid-template-columns: repeat(2, minmax(0, 1fr)) auto;
  gap: 7px;
  align-items: end;
}

#drivers-view .holiday-form label {
  gap: 4px;
  font-size: 0.68rem;
}

#drivers-view .holiday-form-actions {
  grid-column: auto;
  gap: 5px;
  padding-top: 0;
}

#drivers-view .holiday-form-actions button {
  min-height: 28px;
  padding: 5px 8px;
  font-size: 0.64rem;
  white-space: nowrap;
}

#drivers-view .holiday-list {
  gap: 5px;
}

#drivers-view .holiday-row {
  padding: 5px 7px;
  gap: 6px;
}

#drivers-view .holiday-row strong {
  font-size: 0.7rem;
}

#drivers-view .holiday-row span,
#drivers-view .holiday-empty {
  font-size: 0.66rem;
}

@media (max-width: 980px) {
  #drivers-view .profile-list {
    grid-template-columns: 1fr;
  }

  #drivers-view .profile-card-actions {
    flex-wrap: wrap;
  }

  #drivers-view .holiday-form {
    grid-template-columns: 1fr;
  }

  #drivers-view .holiday-form-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 1180px) {
  #drivers-view .working-days-grid {
    grid-template-columns: repeat(7, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  #drivers-view .working-days-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Profile editor popup and cleaner profile cards */
#drivers-view .profile-list {
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 6px;
}

#drivers-view .driver-admin-card {
  padding: 6px 7px;
  border-color: rgba(21, 32, 51, 0.09);
  background: #ffffff;
}

#drivers-view .profile-name-toggle {
  grid-template-columns: minmax(70px, 1fr) minmax(62px, auto) auto;
  gap: 6px;
}

#drivers-view .profile-name-toggle span {
  font-size: 0.82rem;
}

#drivers-view .profile-name-toggle em {
  font-size: 0.62rem;
}

#drivers-view .profile-card-actions .status-pill {
  padding: 3px 6px;
}

#drivers-view .compact-button,
#drivers-view .holiday-add-toggle {
  min-height: 22px;
  padding: 3px 6px;
}

.profile-edit-modal-card {
  width: min(780px, calc(100vw - 28px));
  margin: max(80px, calc((100vh - min(640px, calc(100vh - 40px))) / 2)) auto 24px;
}

.profile-edit-modal-form {
  gap: 12px;
}

.profile-modal-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.profile-modal-grid label {
  min-width: 0;
}

.profile-modal-grid label,
.profile-modal-grid .working-days-field {
  font-size: 0.78rem;
}

.profile-modal-grid input,
.profile-modal-grid select {
  min-width: 0;
}

.profile-modal-working-days {
  grid-column: 1 / -1;
  padding: 9px;
  border: 1px solid rgba(21, 32, 51, 0.1);
  border-radius: 6px;
  background: #f8fafd;
}

.profile-modal-working-days .working-days-grid {
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 5px;
}

.profile-modal-working-days .working-day-chip {
  min-height: 34px;
  padding: 5px 3px;
  border-radius: 5px;
}

.profile-modal-working-days .working-day-chip .day-short {
  font-size: 0.72rem;
}

.profile-modal-working-days .working-day-chip::after {
  width: 4px;
  height: 4px;
}

.profile-modal-actions {
  justify-content: flex-end;
}

@media (max-width: 760px) {
  .profile-modal-grid {
    grid-template-columns: 1fr;
  }

  .profile-modal-working-days .working-days-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .profile-modal-actions {
    justify-content: stretch;
  }

  .profile-modal-actions button {
    flex: 1;
  }
}

/* Grey blurred login background */
.auth-shell {
  background:
    radial-gradient(circle at 18% 20%, rgba(255, 255, 255, 0.8), transparent 28%),
    radial-gradient(circle at 82% 72%, rgba(120, 132, 148, 0.28), transparent 32%),
    linear-gradient(135deg, #d4d9e0 0%, #f2f4f6 48%, #c4ccd5 100%);
}

.auth-shell::before,
.auth-shell::after {
  content: "";
  position: absolute;
  z-index: 0;
  border-radius: 999px;
  filter: blur(34px);
  opacity: 0.78;
  pointer-events: none;
}

.auth-shell::before {
  width: 420px;
  height: 420px;
  left: max(-90px, -5vw);
  top: 10%;
  background: rgba(255, 255, 255, 0.58);
}

.auth-shell::after {
  width: 520px;
  height: 520px;
  right: max(-140px, -8vw);
  bottom: 4%;
  background: rgba(106, 119, 135, 0.34);
}

.auth-shell.is-leaving::before,
.auth-shell.is-leaving::after {
  animation: grey-login-blur-out 520ms cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.login-backdrop-preview,
.preview-sidebar,
.preview-dashboard {
  display: none !important;
}

.login-panel {
  border-color: rgba(255, 255, 255, 0.72);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(18px);
  box-shadow:
    0 30px 76px rgba(55, 66, 82, 0.26),
    0 10px 22px rgba(55, 66, 82, 0.13);
}

.app-shell.is-transitioning-in {
  filter: blur(16px);
  opacity: 0.28;
  transform: scale(0.975);
}

@keyframes grey-login-blur-out {
  0% {
    opacity: 0.78;
    filter: blur(34px);
  }

  100% {
    opacity: 0;
    filter: blur(12px);
  }
}

/* Company logo placement */
.brand-logo {
  display: grid;
  place-items: center;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.brand-logo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  filter: contrast(1.18);
}

.login-logo {
  width: 112px;
  height: 112px;
  margin: -2px auto 8px;
  padding: 0;
}

.sidebar-logo {
  width: 86px;
  height: 86px;
  margin: -6px auto 8px;
  padding: 0;
}

.sidebar-brand {
  text-align: center;
}

.sidebar-brand p {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.driver-mobile-logo {
  width: 128px;
  height: 128px;
  margin: -4px auto 0;
  padding: 0;
}

@media (max-width: 760px) {
  .login-logo {
    width: 104px;
    height: 104px;
  }

  .driver-mobile-logo {
    width: 118px;
    height: 118px;
  }
}

/* Manage Vehicles popout */
.vehicle-create-modal-card {
  width: min(560px, calc(100vw - 28px));
}

.vehicle-create-modal-form.vehicle-create-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  align-items: stretch;
  margin-bottom: 0;
}

.vehicle-create-modal-form .form-grid {
  grid-template-columns: 1fr;
  gap: 10px;
}

.vehicle-create-modal-form .inline-action-row {
  justify-content: flex-end;
}

/* Job Board */
.job-board-panel {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.job-board-toolbar,
.job-board-create-card,
.job-board-filter-card,
.job-board-card,
.calendar-board-jobs {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow-soft);
}

.job-board-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
}

.job-board-toolbar h3,
.job-board-toolbar p,
.job-board-card h4,
.job-board-card p {
  margin-bottom: 0;
}

.job-board-toolbar > div:first-child {
  display: grid;
  gap: 3px;
}

.job-board-toolbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.job-board-toolbar p:not(.section-label) {
  color: var(--muted);
  font-size: 0.82rem;
}

.job-board-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f4f7fb;
}

.job-board-tabs button {
  min-height: 28px;
  padding: 5px 10px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
  cursor: pointer;
}

.job-board-tabs button.is-active {
  background: var(--accent);
  color: #ffffff;
}

.job-board-create-card {
  display: grid;
  gap: 10px;
  padding: 10px;
}

.job-board-form {
  display: grid;
  gap: 10px;
}

.job-board-modal-card {
  width: min(760px, calc(100vw - 28px));
}

.cancel-job-modal-card {
  width: min(560px, calc(100vw - 28px));
}

.job-board-modal-form {
  margin-top: 10px;
}

.job-board-create-assignment {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(220px, 0.85fr);
  gap: 10px;
  align-items: end;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f4f7fb;
}

.job-board-create-assignment h4,
.job-board-create-assignment p {
  margin-bottom: 0;
}

.job-board-create-assignment span {
  color: var(--muted);
  font-size: 0.82rem;
}

.job-board-form-grid {
  grid-template-columns: repeat(4, minmax(130px, 1fr));
}

.job-board-filter-card {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  padding: 10px;
}

.job-board-filter-card h3 {
  margin-bottom: 0;
}

.job-board-filter-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.job-board-filter-grid {
  display: grid;
  grid-template-columns: minmax(160px, 1.1fr) repeat(4, minmax(130px, 0.7fr));
  gap: 8px;
  align-items: end;
}

.job-board-category-filter {
  display: grid;
  gap: 6px;
  grid-column: 1 / -1;
}

.job-board-category-filter > span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.job-board-category-filter-list {
  justify-content: flex-start;
}

.job-board-list,
.job-board-week-group,
.job-board-card-list {
  display: grid;
  gap: 8px;
}

.job-board-week-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f4f7fb;
}

.job-board-week-head span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.job-board-card {
  display: grid;
  gap: 8px;
  padding: 10px;
  border-left: 4px solid var(--job-category-border, var(--accent));
}

.job-board-card-summary {
  display: grid;
  grid-template-columns: minmax(180px, 1.35fr) minmax(110px, 0.7fr) minmax(100px, 0.55fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 42px;
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.job-board-card-summary div,
.job-board-card-summary span {
  min-width: 0;
}

.job-board-card-summary strong,
.job-board-card-summary span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.job-board-card-summary strong {
  color: var(--job-category-ink, var(--ink));
  font-size: 0.78rem;
  font-weight: 900;
}

.job-board-card-summary div span,
.job-board-card-summary > span {
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 750;
}

.job-board-card-summary b {
  justify-self: end;
  min-width: 54px;
  padding: 5px 8px;
  border-radius: 5px;
  color: var(--accent);
  background: rgba(47, 115, 223, 0.1);
  font-size: 0.64rem;
  font-weight: 900;
  text-align: center;
  text-transform: uppercase;
}

.job-board-card.job-category-general-haulage,
.job-board-card.job-category-amazon,
.job-board-card.job-category-two-man-delivery,
.calendar-board-job.job-category-general-haulage,
.calendar-board-job.job-category-amazon,
.calendar-board-job.job-category-two-man-delivery {
  border-color: var(--job-category-border);
  border-left-color: var(--job-category-border);
  background: linear-gradient(180deg, var(--job-category-bg), #ffffff);
}

.job-board-card.is-collection,
.calendar-board-job.is-collection {
  border-color: rgba(214, 62, 62, 0.34);
  border-left-color: #d63e3e;
  background: #fff0f0;
}

.job-board-card.is-unassigned {
  outline: 1px dashed rgba(15, 95, 143, 0.26);
}

.job-board-card.is-cancelled {
  border-color: rgba(185, 64, 47, 0.28);
  border-left-color: var(--danger);
  background: #fff5f3;
}

.job-board-card-head,
.calendar-board-job {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.job-board-card-head span,
.job-board-details,
.job-board-note,
.calendar-board-job span {
  color: var(--muted);
  font-size: 0.8rem;
}

.job-board-details {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  gap: 6px;
}

.job-board-details em {
  color: var(--danger);
  font-style: normal;
  font-weight: 800;
}

.job-board-pod-panel {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 7px 8px;
  border: 1px solid rgba(47, 115, 220, 0.12);
  border-radius: 5px;
  background: #f8fafd;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 750;
}

.job-board-pod-panel strong {
  color: var(--ink);
}

.job-board-pod-actions {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.job-board-pod-actions a {
  color: var(--accent);
  font-weight: 850;
  text-decoration: none;
}

.job-board-pod-empty {
  color: var(--muted);
}

.job-board-note {
  margin: 0;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.78);
}

.job-board-admin-rate,
.job-board-cancelled-reason {
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--muted);
  font-size: 0.8rem;
}

.job-board-cancelled-reason {
  display: grid;
  gap: 3px;
  border-color: rgba(185, 64, 47, 0.2);
  background: #fff9f8;
}

.job-board-cancelled-reason strong {
  color: var(--danger);
}

.job-board-cancelled-reason span {
  color: var(--muted);
}

.job-board-allocate-form {
  display: grid;
  grid-template-columns: minmax(160px, 0.6fr) minmax(150px, 0.45fr) auto;
  align-items: end;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.job-board-edit-form {
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.calendar-board-jobs {
  display: grid;
  gap: 8px;
  padding: 10px;
}

.calendar-board-job-list {
  display: grid;
  gap: 6px;
}

.calendar-board-job {
  padding: 8px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--job-category-border, var(--accent));
  border-radius: 5px;
  background: #ffffff;
}

.calendar-board-job strong,
.calendar-board-job span {
  display: block;
}

@media (max-width: 980px) {
  .job-board-toolbar,
  .job-board-card-head,
  .job-board-filter-head {
    align-items: stretch;
    flex-direction: column;
  }

  .job-board-card-summary {
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .job-board-card-summary b {
    justify-self: start;
  }

  .job-board-toolbar-actions {
    justify-content: flex-start;
  }

  .job-board-filter-card,
  .job-board-filter-grid,
  .job-board-form-grid,
  .job-board-create-assignment,
  .job-board-details,
  .job-board-allocate-form {
    grid-template-columns: 1fr;
  }
}

/* Driver app is phone-only */
.driver-mobile-only-notice {
  display: grid;
  gap: 10px;
  place-items: center;
  width: min(420px, 100%);
  margin: 40px auto;
  padding: 24px;
  border: 1px solid rgba(47, 115, 220, 0.12);
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 18px 40px rgba(24, 34, 56, 0.1);
  text-align: center;
}

.driver-mobile-only-notice h3 {
  margin: 0;
  font-size: 1.25rem;
}

.driver-mobile-only-notice p:not(.section-label) {
  max-width: 320px;
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
}

/* Small UI motion */
.view-panel.is-active {
  animation: view-panel-in 180ms cubic-bezier(0.2, 0.75, 0.28, 1) both;
  transform-origin: 50% 12px;
}

#dashboard-view.is-active .dashboard-card,
#scheduler-view.is-active .controls-panel,
#job-board-view.is-active .job-board-panel,
#drivers-view.is-active .drivers-admin-panel,
#vehicles-view.is-active .vehicles-panel,
#messages-view.is-active .message-list-item,
#driver-view.is-active .driver-panel {
  animation: surface-pop-in 210ms cubic-bezier(0.2, 0.75, 0.28, 1) both;
}

.view-button,
.driver-mobile-tabs button,
.week-nav-arrow,
.week-jump-select,
.primary-button,
.secondary-button,
.ghost-button,
.notification-button,
.modal-close,
.zoom-button,
.upload-label,
.checkbox-chip,
.truck-chip,
.day-preview-toggle,
.profile-name-toggle,
.driver-week-jump,
.driver-week-nav {
  will-change: transform;
  transition:
    transform 140ms ease,
    background-color 160ms ease,
    border-color 160ms ease,
    color 160ms ease,
    box-shadow 160ms ease,
    opacity 160ms ease;
}

.view-button:active,
.driver-mobile-tabs button:active,
.week-nav-arrow:active,
.primary-button:active,
.secondary-button:active,
.ghost-button:active,
.notification-button:active,
.modal-close:active,
.zoom-button:active,
.upload-label:active,
.checkbox-chip:active,
.truck-chip:active,
.day-preview-toggle:active,
.profile-name-toggle:active,
.driver-week-jump:active,
.driver-week-nav:active {
  transform: translateY(1px) scale(0.985);
}

.is-click-feedback {
  animation: button-click-feedback 220ms cubic-bezier(0.2, 0.75, 0.28, 1);
}

.view-button.is-active,
.driver-mobile-tabs button.is-active {
  animation: active-tab-settle 220ms cubic-bezier(0.2, 0.75, 0.28, 1) both;
}

.driver-mobile-tabs button span,
.view-button .nav-icon {
  transition:
    transform 160ms ease,
    background-color 160ms ease,
    color 160ms ease;
}

.driver-mobile-tabs button.is-active span {
  transform: translateY(-1px) scale(1.04);
}

.driver-app > *,
.driver-summary > * {
  animation: driver-panel-in 180ms cubic-bezier(0.2, 0.75, 0.28, 1) both;
}

.planner-modal.is-open .planner-modal-card {
  animation: modal-card-in 180ms cubic-bezier(0.2, 0.75, 0.28, 1) both;
}

.planner-modal.is-open .planner-modal-backdrop {
  animation: modal-backdrop-in 160ms ease both;
}

.day-cell.is-preview-expanded {
  animation: calendar-card-open 180ms cubic-bezier(0.2, 0.75, 0.28, 1) both;
  transform-origin: top center;
}

.day-cell.is-preview-expanded .day-preview-list,
.day-cell.is-preview-expanded .day-preview-toggle {
  animation: calendar-card-content-open 190ms cubic-bezier(0.2, 0.75, 0.28, 1) both;
}

.day-cell.is-preview-collapsing {
  animation: calendar-card-close 180ms cubic-bezier(0.4, 0, 0.2, 1) both;
  overflow: hidden;
  pointer-events: none;
  transform-origin: top center;
}

.day-cell.is-preview-collapsing .day-preview-list,
.day-cell.is-preview-collapsing .day-preview-toggle {
  animation: calendar-card-content-close 150ms cubic-bezier(0.4, 0, 0.2, 1) both;
}

@keyframes view-panel-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.992);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes surface-pop-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes active-tab-settle {
  0% {
    transform: scale(0.98);
  }

  65% {
    transform: scale(1.025);
  }

  100% {
    transform: scale(1);
  }
}

@keyframes button-click-feedback {
  0% {
    transform: scale(1);
  }

  45% {
    transform: scale(0.97);
  }

  100% {
    transform: scale(1);
  }
}

@keyframes driver-panel-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes modal-card-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.985);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes modal-backdrop-in {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes calendar-card-open {
  from {
    opacity: 0.88;
    transform: translateY(-3px) scaleY(0.965);
    clip-path: inset(0 0 18% 0 round 4px);
  }

  to {
    opacity: 1;
    transform: translateY(0) scaleY(1);
    clip-path: inset(0 0 0 0 round 4px);
  }
}

@keyframes calendar-card-close {
  from {
    opacity: 1;
    transform: translateY(0) scaleY(1);
    clip-path: inset(0 0 0 0 round 4px);
  }

  to {
    opacity: 0.86;
    transform: translateY(-3px) scaleY(0.965);
    clip-path: inset(0 0 18% 0 round 4px);
  }
}

@keyframes calendar-card-content-open {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes calendar-card-content-close {
  from {
    opacity: 1;
    transform: translateY(0);
  }

  to {
    opacity: 0;
    transform: translateY(-5px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .view-panel.is-active,
  #dashboard-view.is-active .dashboard-card,
  #scheduler-view.is-active .controls-panel,
  #drivers-view.is-active .drivers-admin-panel,
  #vehicles-view.is-active .vehicles-panel,
  #messages-view.is-active .message-list-item,
  #driver-view.is-active .driver-panel,
  .is-click-feedback,
  .view-button.is-active,
  .driver-mobile-tabs button.is-active,
  .driver-app > *,
  .driver-summary > *,
  .planner-modal.is-open .planner-modal-card,
  .planner-modal.is-open .planner-modal-backdrop,
  .day-cell.is-preview-expanded,
  .day-cell.is-preview-expanded .day-preview-list,
  .day-cell.is-preview-expanded .day-preview-toggle,
  .day-cell.is-preview-collapsing,
  .day-cell.is-preview-collapsing .day-preview-list,
  .day-cell.is-preview-collapsing .day-preview-toggle {
    animation: none !important;
  }

  .view-button,
  .driver-mobile-tabs button,
  .week-nav-arrow,
  .week-jump-select,
  .primary-button,
  .secondary-button,
  .ghost-button,
  .notification-button,
  .modal-close,
  .zoom-button,
  .upload-label,
  .checkbox-chip,
  .truck-chip,
  .day-preview-toggle,
  .profile-name-toggle,
  .driver-week-jump,
  .driver-week-nav {
    transition-duration: 1ms !important;
  }
}

/* Calendar zoom controls and density states */
#scheduler-view .week-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px 14px;
  flex-wrap: wrap;
}

.week-strip-main {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.calendar-toolbar {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex: 0 0 auto;
  min-height: 36px;
  padding: 4px 6px 4px 10px;
  border: 1px solid #d8e1ee;
  border-radius: 6px;
  background: #f8fafd;
  flex-wrap: wrap;
}

.calendar-bulk-status span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 850;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  white-space: nowrap;
}

.calendar-bulk-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.calendar-bulk-status select {
  min-height: 28px;
  padding: 4px 8px;
  font-size: 0.7rem;
}

.zoom-button {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 26px;
  border: 0;
  border-radius: 5px;
  background: var(--accent);
  color: #ffffff;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 900;
  line-height: 1;
}

.zoom-button:disabled,
.calendar-toolbar .compact-button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.planner-board,
.planner-driver,
.day-cell,
.driver-header,
.day-preview-item,
.day-preview-empty {
  transition:
    width 160ms ease,
    flex-basis 160ms ease,
    min-height 160ms ease,
    height 160ms ease,
    padding 160ms ease,
    font-size 160ms ease;
}

.planner-board[data-zoom-density="small"] {
  gap: 6px;
}

.planner-board[data-zoom-density="small"] .planner-driver {
  padding: 6px;
}

.planner-board[data-zoom-density="small"] .driver-header {
  margin: -6px -6px 6px;
  padding: 6px 5px;
}

.planner-board[data-zoom-density="small"] .driver-title-row {
  gap: 5px;
}

.planner-board[data-zoom-density="small"] .driver-header h3 {
  font-size: 0.78rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.planner-board[data-zoom-density="small"] .driver-meta {
  gap: 4px;
  margin-top: 4px;
  font-size: 0.55rem;
}

.planner-board[data-zoom-density="small"] .truck-chip {
  min-height: 20px;
  padding: 2px 4px;
  font-size: 0.5rem;
  white-space: nowrap;
}

.planner-board[data-zoom-density="small"] .driver-days {
  gap: 5px;
}

.planner-board[data-zoom-density="small"] .day-cell {
  padding: 5px;
}

.planner-board[data-zoom-density="small"] .day-head {
  gap: 4px;
}

.planner-board[data-zoom-density="small"] .day-name {
  font-size: 0.67rem;
}

.planner-board[data-zoom-density="small"] .day-caption {
  margin-top: 2px;
  font-size: 0.55rem;
}

.planner-board[data-zoom-density="small"] .day-pill,
.planner-board[data-zoom-density="small"] .day-alert-pill {
  padding: 2px 4px;
  font-size: 0.5rem;
}

.planner-board[data-zoom-density="small"] .day-preview-list {
  gap: 3px;
  margin-top: 4px;
}

.planner-board[data-zoom-density="small"] .day-preview-item,
.planner-board[data-zoom-density="small"] .day-preview-empty {
  padding: 3px 4px;
}

.planner-board[data-zoom-density="small"] .day-preview-item strong,
.planner-board[data-zoom-density="small"] .day-preview-empty strong {
  font-size: 0.52rem;
}

.planner-board[data-zoom-density="small"] .day-preview-item span,
.planner-board[data-zoom-density="small"] .day-preview-empty span {
  font-size: 0.56rem;
}

.planner-board[data-zoom-density="small"] .day-preview-item small {
  display: none;
}

.planner-board[data-zoom-density="small"] .day-preview-toggle {
  min-height: 20px;
  margin-top: 4px;
  padding: 3px 4px;
  font-size: 0.54rem;
}

.planner-board[data-zoom-density="medium"] .planner-driver {
  padding: 7px;
}

.planner-board[data-zoom-density="large"] .driver-header h3 {
  font-size: 1rem;
}

.planner-board[data-zoom-density="large"] .day-name {
  font-size: 0.82rem;
}

@media (max-width: 900px) {
  #scheduler-view .week-strip {
    align-items: stretch;
  }

  .calendar-toolbar {
    width: 100%;
    justify-content: space-between;
  }
}

/* Calendar week grid */
#scheduler-view .planner-board {
  display: grid;
  grid-template-columns: minmax(var(--driver-column-width), 0.72fr) repeat(7, minmax(0, 1fr));
  gap: 6px;
  align-items: stretch;
  min-height: 420px;
  max-height: max(440px, calc(100vh - 280px));
  overflow: auto;
  padding: 8px;
  cursor: default;
  touch-action: pan-x pan-y;
}

#scheduler-view .planner-board.is-drag-ready,
#scheduler-view .planner-board:hover,
#scheduler-view .planner-board.is-dragging {
  cursor: default;
}

.planner-grid-header,
.planner-driver-row-header,
.planner-grid-cell {
  box-sizing: border-box;
  min-width: 0;
  border: 1px solid rgba(21, 32, 51, 0.1);
  border-radius: 5px;
  background: #ffffff;
}

.planner-grid-header {
  position: sticky;
  top: 0;
  z-index: 8;
  display: grid;
  place-items: center;
  min-height: 38px;
  padding: 6px 7px;
  border-color: #d9e3ef;
  background: #f5f8fc;
  box-shadow: 0 7px 16px rgba(24, 34, 56, 0.08);
  line-height: 1.05;
  text-align: center;
  overflow: hidden;
}

.planner-grid-corner {
  left: 0;
  z-index: 12;
  place-items: center;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: center;
}

.planner-day-header strong,
.planner-day-header span {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.planner-day-header strong {
  color: var(--ink);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.planner-day-header span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 800;
}

.planner-day-header.is-today {
  border-color: rgba(47, 115, 223, 0.42);
  background: linear-gradient(180deg, #eaf2ff, #ffffff);
  box-shadow: inset 0 -3px 0 var(--accent), 0 7px 16px rgba(24, 34, 56, 0.1);
}

.planner-day-header.is-today strong {
  color: var(--accent);
}

.planner-driver-row-header {
  position: sticky;
  left: 0;
  z-index: 6;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 5px;
  min-height: var(--calendar-cell-height);
  padding: 8px;
  background: #f8fafd;
  box-shadow: 8px 0 16px rgba(24, 34, 56, 0.05);
  overflow: visible;
  text-align: center;
}

.planner-driver-row-header .driver-title-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
  gap: 5px;
  width: 100%;
}

.planner-driver-row-header h3 {
  margin: 0;
  color: var(--ink);
  font-size: 0.84rem;
  font-weight: 900;
  line-height: 1.12;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
}

.planner-driver-row-header .truck-chip {
  justify-self: center;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.planner-row-truck-form {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 120;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  width: min(260px, calc(100vw - 32px));
  margin: 0;
  padding: 12px;
  border: 1px solid rgba(21, 32, 51, 0.14);
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 22px 48px rgba(24, 34, 56, 0.22);
  transform: translate(-50%, -50%);
}

.planner-row-truck-form select,
.planner-row-truck-form button {
  width: 100%;
  min-height: 30px;
  font-size: 0.72rem;
}

.planner-row-truck-form .secondary-button,
.planner-row-truck-form .ghost-button {
  min-height: 28px;
  padding: 5px 8px;
  border-radius: 5px;
}

.planner-grid-cell.day-cell {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 4px;
  min-height: var(--calendar-cell-height);
  height: auto;
  padding: 5px;
  border-radius: 5px;
  background: #ffffff;
  line-height: 1.15;
  overflow: hidden;
}

.planner-grid-cell.day-cell.is-empty {
  border-style: solid;
  background: rgba(255, 255, 255, 0.6);
}

.planner-grid-cell.day-cell.is-rest {
  background: #d7e7f8;
  border-color: #adc7e4;
}

.planner-grid-cell.day-cell.is-holiday {
  background: #ffe000;
  border-color: #d7b800;
}

.planner-grid-cell.day-cell.is-sick {
  background: #ffb15c;
  border-color: #db7d22;
}

.planner-grid-cell.day-cell.is-multi-selected {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 2px rgba(47, 115, 223, 0.36), 0 0 0 2px rgba(47, 115, 223, 0.08);
}

.planner-grid-cell .day-preview-list {
  display: grid;
  align-content: start;
  margin-top: 0;
  gap: 3px;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.planner-grid-cell.job-count-1 .day-preview-list {
  align-content: center;
}

.planner-grid-cell.has-jobs .day-preview-list {
  align-content: center;
}

.planner-grid-cell .day-preview-item {
  display: grid;
  place-items: center;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: 0;
  padding: 4px 5px;
  border-radius: 4px;
  line-height: 1;
}

.planner-grid-cell .day-preview-item strong,
.planner-grid-cell .day-preview-item span,
.planner-grid-cell .day-preview-item small {
  max-width: 100%;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.planner-grid-cell .day-preview-item span,
.planner-grid-cell .day-preview-item small {
  display: block;
  white-space: nowrap;
}

.planner-grid-cell .day-preview-item strong {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  color: var(--job-category-ink, var(--ink));
  font-size: 0.56rem;
  font-weight: 900;
  line-height: 1.12;
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: center;
}

.planner-grid-cell.job-count-1 .day-preview-item {
  padding: 9px 8px;
  min-height: 42px;
  align-content: center;
}

.planner-grid-cell.job-count-1 .day-preview-item strong {
  font-size: 0.72rem;
  line-height: 1.14;
  text-align: center;
  -webkit-line-clamp: 3;
}

.planner-grid-cell.job-count-2 .day-preview-item {
  padding: 7px 7px;
  min-height: 34px;
}

.planner-grid-cell.job-count-2 .day-preview-item strong {
  font-size: 0.64rem;
}

.planner-grid-cell.job-count-3 .day-preview-item {
  padding: 5px 6px;
  min-height: 28px;
}

.planner-grid-cell.job-count-3 .day-preview-item strong {
  font-size: 0.58rem;
}

.planner-grid-cell.job-count-4 .day-preview-item {
  padding: 4px 5px;
  min-height: 24px;
}

.planner-grid-cell.job-count-4 .day-preview-item strong {
  font-size: 0.53rem;
}

.planner-grid-cell .day-preview-item span {
  font-size: 0.62rem;
  line-height: 1.14;
}

.planner-grid-cell .day-preview-item small {
  font-size: 0.56rem;
  line-height: 1.12;
}

.planner-grid-cell .day-preview-status {
  display: grid;
  align-content: center;
  min-height: calc(var(--calendar-cell-height) - 12px);
  text-align: center;
}

.planner-grid-cell.is-preview-expanded {
  min-height: calc(var(--calendar-cell-height) + 54px);
  overflow: visible;
  z-index: 5;
}

.planner-grid-cell.is-preview-expanded .day-preview-list {
  overflow: visible;
}

.planner-grid-cell .day-preview-toggle {
  align-self: end;
  min-width: 0;
  margin-top: 0;
}

.planner-grid-empty {
  grid-column: 1 / -1;
}

#scheduler-view .planner-scroll-cue {
  display: none;
}

.planner-board[data-zoom-density="small"] .planner-driver-row-header {
  padding: 5px;
}

.planner-board[data-zoom-density="small"] .planner-driver-row-header h3 {
  font-size: 0.72rem;
}

.planner-board[data-zoom-density="small"] .planner-grid-header {
  min-height: 32px;
  padding: 4px;
}

.planner-board[data-zoom-density="small"] .planner-day-header strong {
  font-size: 0.62rem;
}

.planner-board[data-zoom-density="small"] .planner-day-header span {
  font-size: 0.54rem;
}

.planner-board[data-zoom-density="small"] .planner-grid-cell .day-preview-item {
  padding: 3px 4px;
}

.planner-board[data-zoom-density="small"] .planner-grid-cell .day-preview-item strong {
  font-size: 0.5rem;
}

.planner-board[data-zoom-density="small"] .planner-row-truck-form {
  width: min(238px, calc(100vw - 32px));
}

.planner-grid-cell .day-preview-job.is-complete {
  border-color: rgba(34, 156, 115, 0.34);
  border-left-color: var(--success);
  background: var(--success-soft);
}

.planner-grid-cell .day-preview-job.is-complete strong {
  color: var(--success);
}

#scheduler-view.is-calendar-fullscreen {
  position: fixed;
  inset: 12px;
  z-index: 70;
  display: grid !important;
  grid-template-rows: auto auto minmax(0, 1fr);
  padding: 14px;
  border: 1px solid rgba(21, 32, 51, 0.14);
  border-radius: 12px;
  background: #f6f9fc;
  box-shadow: 0 28px 80px rgba(24, 34, 56, 0.35);
}

#scheduler-view.is-calendar-fullscreen .planner-board {
  max-height: none;
  min-height: 0;
  height: 100%;
}

#scheduler-view.is-calendar-fullscreen .workspace-header {
  margin-bottom: 0;
}

@media (max-width: 1180px) {
  #scheduler-view .planner-board {
    grid-template-columns: minmax(96px, var(--driver-column-width)) repeat(7, minmax(92px, 1fr));
  }
}
