@import url("https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap");

:root {
  --ink: #15211a;
  --ink-2: #2f3d35;
  --muted: #738078;
  --muted-2: #97a39b;
  --line: #e5eae6;
  --line-strong: #d7ded9;
  --bg: #f4f6f3;
  --surface: #ffffff;
  --surface-2: #f8faf8;
  --green: #0a8f5b;
  --green-2: #08784c;
  --green-3: #065f3c;
  --green-soft: #e7f5ee;
  --green-pale: #f1faf5;
  --blue: #2f6fed;
  --red: #dd4c4c;
  --red-soft: #fdf0f0;
  --amber: #e8a33d;
  --shadow-sm: 0 1px 2px rgba(18, 42, 28, 0.04), 0 4px 14px rgba(18, 42, 28, 0.04);
  --shadow: 0 12px 38px rgba(18, 42, 28, 0.11);
  --shadow-lg: 0 28px 80px rgba(18, 42, 28, 0.18);
  --radius: 16px;
  --radius-sm: 11px;
  --font: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(10, 143, 91, 0.24);
  outline-offset: 2px;
}

a {
  color: inherit;
}

svg {
  display: block;
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  min-width: 0;
}

.brand img {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  box-shadow: 0 5px 15px rgba(10, 143, 91, 0.24);
}

.brand-name {
  display: block;
  font-size: 21px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: -0.6px;
}

.brand-name span {
  color: var(--green);
}

.brand-sub {
  display: block;
  margin-top: 4px;
  font-size: 10px;
  line-height: 1;
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ---------------- Admin app ---------------- */

.admin-body {
  overflow: hidden;
}

.admin-shell {
  display: grid;
  grid-template-columns: 390px minmax(0, 1fr);
  height: 100dvh;
  overflow: hidden;
}

.sidebar {
  position: relative;
  z-index: 20;
  background: var(--surface);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
}

.brand-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 19px 20px 15px;
}

.connection-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 700;
  white-space: nowrap;
  background: var(--surface);
}

.connection-chip .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted-2);
}

.connection-chip.online {
  color: var(--green-2);
  background: var(--green-pale);
  border-color: #d4eddf;
}

.connection-chip.online .dot {
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(10, 143, 91, 0.12);
}

.side-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin: 0 18px 14px;
  padding: 4px;
  border-radius: 13px;
  background: #eef2ee;
}

.side-tab {
  border: 0;
  border-radius: 10px;
  padding: 8px 10px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  transition: 0.2s ease;
  white-space: nowrap;
}

.side-tab svg {
  width: 15px;
  height: 15px;
}

.side-tab.active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 2px 8px rgba(18, 42, 28, 0.08);
}

.side-pane {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0 18px 14px;
  scrollbar-width: thin;
  scrollbar-color: #d9e0db transparent;
}

.side-pane::-webkit-scrollbar,
.driver-list::-webkit-scrollbar,
.shift-list::-webkit-scrollbar {
  width: 5px;
}

.side-pane::-webkit-scrollbar-thumb,
.driver-list::-webkit-scrollbar-thumb,
.shift-list::-webkit-scrollbar-thumb {
  background: #d9e0db;
  border-radius: 8px;
}

.day-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 1px 2px 11px;
}

.day-line strong {
  font-size: 12px;
  font-weight: 700;
}

.day-line span {
  font-size: 10.5px;
  color: var(--muted);
  font-weight: 500;
}

.stat-grid {
  display: grid;
  grid-template-columns: 1.16fr 1fr 1fr;
  gap: 7px;
  margin-bottom: 18px;
}

.stat-card {
  position: relative;
  padding: 11px 12px 10px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: 13px;
  min-width: 0;
  overflow: hidden;
}

.stat-card:first-child {
  background: linear-gradient(145deg, #0b8f5b, #08764b);
  border-color: transparent;
  color: white;
  box-shadow: 0 9px 20px rgba(10, 143, 91, 0.18);
}

.stat-label {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
}

.stat-card:first-child .stat-label {
  color: rgba(255, 255, 255, 0.72);
}

.stat-label svg {
  width: 12px;
  height: 12px;
}

.stat-value {
  position: relative;
  z-index: 1;
  margin-top: 5px;
  display: flex;
  align-items: baseline;
  gap: 3px;
  font-size: 21px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: -0.7px;
}

.stat-value small {
  font-size: 9.5px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0;
}

.stat-card:first-child .stat-value small {
  color: rgba(255, 255, 255, 0.6);
}

.stat-card::after {
  content: "";
  position: absolute;
  right: -21px;
  bottom: -27px;
  width: 67px;
  height: 67px;
  border: 10px solid rgba(255, 255, 255, 0.06);
  border-radius: 50%;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  padding: 0 2px;
}

.section-heading h2 {
  margin: 0;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: -0.2px;
}

.count-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 21px;
  height: 19px;
  padding: 0 6px;
  margin-left: 5px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green-2);
  font-size: 9.5px;
  font-weight: 800;
  vertical-align: 1px;
}

.text-btn {
  border: 0;
  background: transparent;
  color: var(--green);
  padding: 4px 3px;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10.5px;
  font-weight: 700;
}

.text-btn:hover {
  background: var(--green-pale);
}

.text-btn svg {
  width: 13px;
  height: 13px;
}

.search-box {
  position: relative;
  margin-bottom: 9px;
}

.search-box svg {
  position: absolute;
  left: 12px;
  top: 50%;
  width: 15px;
  height: 15px;
  transform: translateY(-50%);
  color: var(--muted-2);
  pointer-events: none;
}

.search-box input {
  width: 100%;
  height: 38px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink);
  border-radius: 11px;
  padding: 0 13px 0 35px;
  font-size: 11.5px;
  font-weight: 500;
  transition: 0.2s ease;
}

.search-box input::placeholder {
  color: var(--muted-2);
}

.search-box input:focus {
  background: white;
  border-color: #bedfce;
  box-shadow: 0 0 0 3px rgba(10, 143, 91, 0.08);
  outline: none;
}

.filter-row {
  display: flex;
  gap: 5px;
  margin-bottom: 10px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.filter-row::-webkit-scrollbar {
  display: none;
}

.filter-chip {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 9.5px;
  font-weight: 700;
  transition: 0.18s ease;
}

.filter-chip:hover {
  border-color: var(--line-strong);
  color: var(--ink);
}

.filter-chip.active {
  border-color: var(--green);
  background: var(--green);
  color: white;
}

.driver-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  flex: 1;
}

.driver-card {
  position: relative;
  width: 100%;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px 11px;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 13px;
  text-align: left;
  color: inherit;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.driver-card:hover {
  border-color: #cbd9d1;
  box-shadow: 0 5px 16px rgba(18, 42, 28, 0.06);
}

.driver-card.selected {
  border-color: rgba(10, 143, 91, 0.42);
  background: var(--green-pale);
  box-shadow: inset 3px 0 0 var(--green);
}

.avatar {
  position: relative;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: white;
  background: var(--green);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: -0.2px;
  flex: 0 0 auto;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2);
}

.avatar::after {
  content: "";
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--muted-2);
  border: 2px solid white;
}

.driver-card[data-status="live"] .avatar::after,
.driver-detail-avatar[data-status="live"]::after {
  background: #13b26d;
  box-shadow: 0 0 0 3px rgba(19, 178, 109, 0.14);
}

.driver-card[data-status="idle"] .avatar::after,
.driver-detail-avatar[data-status="idle"]::after {
  background: var(--amber);
}

.driver-card-main {
  min-width: 0;
}

.driver-name {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  font-size: 11.8px;
  font-weight: 700;
  letter-spacing: -0.15px;
}

.driver-name > span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.driver-meta {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 3px;
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.driver-meta .sep {
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: #c5cec8;
  flex: 0 0 auto;
}

.driver-home-line {
  display: flex;
  align-items: center;
  gap: 3px;
  margin-top: 2px;
  color: var(--green-2);
  font-size: 8px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.driver-home-line svg {
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
}

.driver-home-line.late,
.driver-home-line.pending {
  color: #a5660b;
}

.driver-home-line.muted {
  color: var(--muted-2);
}

.driver-card-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  white-space: nowrap;
}

.signal {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 9px;
  line-height: 1;
  font-weight: 700;
  color: var(--muted);
}

.signal::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.signal.live {
  color: var(--green);
}

.signal.live::before {
  animation: softPulse 1.8s infinite;
}

.signal.idle {
  color: #c08116;
}

.signal.ended,
.signal.offline {
  color: var(--muted-2);
}

.speed-mini {
  color: var(--ink-2);
  font-size: 10px;
  font-weight: 700;
}

.speed-mini small {
  color: var(--muted-2);
  font-weight: 500;
  font-size: 8px;
}

.list-empty {
  border: 1px dashed var(--line-strong);
  border-radius: 14px;
  padding: 28px 18px;
  text-align: center;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}

.list-empty strong {
  display: block;
  color: var(--ink);
  font-size: 12px;
  margin-bottom: 3px;
}

.sidebar-foot {
  border-top: 1px solid var(--line);
  padding: 11px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: rgba(255, 255, 255, 0.9);
}

.admin-badge {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.admin-badge > span {
  width: 31px;
  height: 31px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: #eef2ee;
  color: var(--ink-2);
  font-size: 10px;
  font-weight: 800;
}

.admin-badge strong,
.admin-badge small {
  display: block;
}

.admin-badge strong {
  font-size: 10.5px;
  font-weight: 700;
}

.admin-badge small {
  margin-top: 1px;
  font-size: 9px;
  color: var(--muted);
}

.icon-btn {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 9px;
  color: var(--muted);
  transition: 0.18s ease;
  flex: 0 0 auto;
}

.icon-btn:hover {
  color: var(--red);
  border-color: #f2d1d1;
  background: var(--red-soft);
}

.icon-btn svg {
  width: 15px;
  height: 15px;
}

.foot-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.foot-actions a.icon-btn:hover {
  color: var(--green);
  border-color: #cfe8da;
  background: var(--green-pale);
}

/* ---------------- Map ---------------- */

.map-stage {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: #e9eee9;
  isolation: isolate;
}

#map,
#driverMap {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  background: #e8ede8;
}

.leaflet-container {
  font-family: var(--font) !important;
}

.leaflet-tile-pane {
  filter: saturate(0.76) contrast(0.98) brightness(1.02);
}

.leaflet-control-attribution {
  font-size: 8px !important;
  background: rgba(255, 255, 255, 0.75) !important;
  color: #738078 !important;
  padding: 2px 6px !important;
  backdrop-filter: blur(4px);
}

.leaflet-control-attribution a {
  color: #5d7467 !important;
}

.leaflet-bottom.leaflet-right {
  z-index: 500;
}

.leaflet-control-zoom {
  display: none;
}

.map-header {
  position: absolute;
  z-index: 550;
  top: 16px;
  left: 16px;
  right: 16px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  pointer-events: none;
}

.map-header > * {
  pointer-events: auto;
}

.monitoring-pill {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 15px 10px 13px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: 15px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
  min-width: 0;
}

.live-halo {
  position: relative;
  width: 35px;
  height: 35px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--green-soft);
  color: var(--green);
  flex: 0 0 auto;
}

.live-halo::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid var(--green);
  border-radius: 50%;
  animation: haloPulse 2.4s infinite;
}

.live-halo svg {
  width: 17px;
  height: 17px;
}

.monitoring-pill strong {
  display: block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: -0.15px;
}

.monitoring-pill small {
  display: block;
  margin-top: 2px;
  font-size: 9.5px;
  color: var(--muted);
  font-weight: 500;
}

.map-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.map-clock {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(10px);
  border-radius: 12px;
  padding: 9px 13px;
  text-align: right;
}

.map-clock strong {
  display: block;
  font-size: 12px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.2px;
}

.map-clock small {
  display: block;
  margin-top: 1px;
  font-size: 8.5px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.09em;
  font-weight: 600;
}

.map-square-btn {
  width: 39px;
  height: 39px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(10px);
  border-radius: 11px;
  color: var(--ink-2);
  transition: 0.18s ease;
}

.map-square-btn:hover {
  background: white;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(18, 42, 28, 0.12);
}

.map-square-btn svg {
  width: 17px;
  height: 17px;
}

.map-legend {
  position: absolute;
  z-index: 540;
  left: 18px;
  bottom: 18px;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 7px 11px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(8px);
  color: var(--muted);
  font-size: 8.5px;
  font-weight: 600;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
}

.legend-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
}

.legend-dot.amber {
  background: var(--amber);
}

.legend-dot.gray {
  background: var(--muted-2);
}

.map-empty {
  position: absolute;
  z-index: 530;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
}

.empty-panel {
  width: min(300px, calc(100% - 40px));
  padding: 20px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(14px);
  border-radius: 18px;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
}

.empty-panel strong {
  display: block;
  font-size: 13px;
}

.empty-panel p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.6;
}

/* Leaflet markers */

.driver-marker {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--marker-color, var(--green));
  border: 2.5px solid white;
  box-shadow: 0 5px 14px rgba(15, 37, 23, 0.28);
  display: grid;
  place-items: center;
  color: white;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: -0.2px;
  transition: transform 0.3s ease;
}

.driver-marker::before {
  content: "";
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 2px solid var(--marker-color, var(--green));
  opacity: 0;
}

.driver-marker.is-live::before {
  animation: markerPulse 2.1s ease-out infinite;
}

.driver-marker.selected {
  border-color: #fff;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--marker-color, var(--green)) 32%, transparent), 0 6px 18px rgba(15, 37, 23, 0.32);
  transform: scale(1.08);
}

.driver-marker.is-ended {
  filter: grayscale(0.32);
  opacity: 0.82;
}

.driver-marker .heading-arrow {
  position: absolute;
  top: -8px;
  left: 50%;
  width: 13px;
  height: 13px;
  transform: translateX(-50%) rotate(var(--heading, 0deg));
  transition: transform 0.4s ease;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.2));
}

.stop-marker {
  width: 24px;
  height: 24px;
  border: 2px solid white;
  border-radius: 8px;
  background: #f0a23c;
  box-shadow: 0 3px 8px rgba(50, 35, 4, 0.24);
  display: grid;
  place-items: center;
  color: white;
}

.stop-marker svg {
  width: 11px;
  height: 11px;
}

.endpoint-marker {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 3px solid white;
  color: white;
  font-size: 9px;
  font-weight: 800;
  box-shadow: 0 4px 12px rgba(18, 42, 28, 0.25);
}

.endpoint-marker.start {
  background: var(--green);
}

.endpoint-marker.end {
  background: #25312a;
}

/* Detail card */

.detail-card {
  position: absolute;
  z-index: 600;
  left: 18px;
  bottom: 18px;
  width: 375px;
  max-width: calc(100% - 36px);
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 19px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
  padding: 14px;
  animation: riseIn 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.detail-top {
  display: flex;
  align-items: flex-start;
  gap: 11px;
}

.driver-detail-avatar {
  position: relative;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: white;
  font-size: 13px;
  font-weight: 800;
  flex: 0 0 auto;
}

.driver-detail-avatar::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 2.5px solid white;
  background: var(--muted-2);
}

.detail-name {
  min-width: 0;
  padding-top: 1px;
  flex: 1;
}

.detail-name h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -0.3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.detail-name p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.detail-close {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 8px;
  background: #f2f5f2;
  color: var(--muted);
  display: grid;
  place-items: center;
}

.detail-close:hover {
  background: #e9eeea;
  color: var(--ink);
}

.detail-close svg {
  width: 13px;
  height: 13px;
}

.detail-live-line {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 9.5px;
}

.detail-live-line .signal {
  font-size: 9.5px;
}

.detail-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  margin: 13px 0 12px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.detail-stat {
  padding: 0 8px;
  border-right: 1px solid var(--line);
}

.detail-stat:first-child {
  padding-left: 0;
}

.detail-stat:last-child {
  border: 0;
  padding-right: 0;
}

.detail-stat span {
  display: block;
  color: var(--muted);
  font-size: 8.5px;
  font-weight: 600;
  white-space: nowrap;
}

.detail-stat b {
  display: block;
  margin-top: 3px;
  font-size: 14px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: -0.4px;
}

.detail-stat b small {
  color: var(--muted);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0;
}

.detail-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}

.btn {
  height: 36px;
  border: 0;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 13px;
  font-size: 10.5px;
  font-weight: 700;
  transition: 0.18s ease;
  text-decoration: none;
}

.btn svg {
  width: 14px;
  height: 14px;
}

.btn-primary {
  background: var(--green);
  color: white;
  box-shadow: 0 5px 12px rgba(10, 143, 91, 0.2);
}

.btn-primary:hover {
  background: var(--green-2);
  transform: translateY(-1px);
}

.btn-soft {
  background: var(--green-soft);
  color: var(--green-2);
}

.btn-soft:hover {
  background: #dcf1e6;
}

.btn-ghost {
  background: #f2f5f2;
  color: var(--ink-2);
}

.btn-ghost:hover {
  background: #e9eeea;
}

.btn-danger {
  background: var(--red-soft);
  color: var(--red);
}

.btn-danger:hover {
  background: #fbe3e3;
}

.btn-block {
  width: 100%;
}

.btn-grow {
  flex: 1;
}

/* History */

.history-filter-card {
  padding: 13px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 14px;
  margin-bottom: 13px;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 8px;
}

.field {
  display: block;
  min-width: 0;
}

.field + .field {
  margin-top: 9px;
}

.field-row .field + .field {
  margin-top: 0;
}

.field > span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.field input,
.field select {
  width: 100%;
  height: 35px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: white;
  padding: 0 9px;
  font-size: 10.5px;
  color: var(--ink);
  font-weight: 600;
}

.field input:focus,
.field select:focus {
  border-color: #bddfcd;
  outline: none;
  box-shadow: 0 0 0 3px rgba(10, 143, 91, 0.08);
}

.history-summary {
  display: flex;
  gap: 7px;
  margin-bottom: 11px;
}

.history-summary > div {
  flex: 1;
  min-width: 0;
  padding: 9px 10px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.history-summary span {
  display: block;
  font-size: 8.5px;
  color: var(--muted);
  font-weight: 600;
}

.history-summary b {
  display: block;
  margin-top: 3px;
  font-size: 13px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: -0.3px;
}

.history-summary b small {
  font-size: 8px;
  color: var(--muted);
  font-weight: 500;
}

.shift-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.shift-card {
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 13px;
  padding: 11px;
  color: inherit;
  transition: 0.18s ease;
}

.shift-card:hover {
  border-color: #cbd9d1;
  box-shadow: 0 4px 14px rgba(18, 42, 28, 0.05);
}

.shift-card.active {
  border-color: rgba(10, 143, 91, 0.4);
  background: var(--green-pale);
  box-shadow: inset 3px 0 0 var(--green);
}

.shift-card-head {
  display: flex;
  align-items: center;
  gap: 9px;
}

.shift-card-head .avatar {
  width: 34px;
  height: 34px;
  font-size: 10px;
}

.shift-card-head .avatar::after {
  display: none;
}

.shift-card-title {
  flex: 1;
  min-width: 0;
}

.shift-card-title strong {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.shift-card-title span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 500;
}

.shift-status {
  padding: 3px 6px;
  border-radius: 5px;
  font-size: 8px;
  font-weight: 800;
  color: var(--green-2);
  background: var(--green-soft);
  white-space: nowrap;
}

.shift-status.ended {
  color: var(--muted);
  background: #f0f3f1;
}

.shift-status.scheduled {
  color: #3d6bcc;
  background: #eef4ff;
}

.shift-status.completed {
  color: var(--muted);
  background: #f0f3f1;
}

.shift-status.canceled {
  color: var(--red);
  background: var(--red-soft);
}

.shift-card-metrics {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 9px;
  padding-top: 8px;
  border-top: 1px solid #eef2ef;
  color: var(--muted);
  font-size: 8.5px;
  font-weight: 500;
}

.shift-card-metrics b {
  color: var(--ink-2);
  font-weight: 700;
}

.shift-card.active .shift-card-metrics {
  border-top-color: #d8ebe1;
}

.shift-arrow {
  color: var(--muted-2);
  margin-left: auto;
}

.shift-arrow svg {
  width: 12px;
  height: 12px;
}

.history-dock {
  position: absolute;
  z-index: 620;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  width: min(760px, calc(100% - 90px));
  padding: 13px 15px;
  border-radius: 17px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.97);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(16px);
  animation: riseIn 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.dock-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.dock-driver {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 0 0 auto;
}

.dock-driver .avatar {
  width: 32px;
  height: 32px;
  font-size: 9.5px;
}

.dock-driver .avatar::after {
  display: none;
}

.dock-driver-text {
  min-width: 0;
}

.dock-driver-text strong {
  display: block;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dock-driver-text small {
  display: block;
  margin-top: 2px;
  font-size: 8.5px;
  color: var(--muted);
  white-space: nowrap;
}

.dock-metrics {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

.dock-metric {
  text-align: right;
  padding-left: 12px;
  border-left: 1px solid var(--line);
}

.dock-metric span {
  display: block;
  color: var(--muted);
  font-size: 8px;
  font-weight: 600;
}

.dock-metric b {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  font-weight: 800;
}

.dock-metric b small {
  font-size: 8px;
  color: var(--muted);
  font-weight: 500;
}

.dock-close {
  width: 27px;
  height: 27px;
  border: 0;
  border-radius: 8px;
  background: #f1f4f1;
  color: var(--muted);
  display: grid;
  place-items: center;
}

.dock-close svg {
  width: 12px;
  height: 12px;
}

.dock-playback {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.play-btn {
  width: 35px;
  height: 35px;
  flex: 0 0 auto;
  border: 0;
  border-radius: 50%;
  background: var(--green);
  color: white;
  display: grid;
  place-items: center;
  box-shadow: 0 4px 10px rgba(10, 143, 91, 0.25);
}

.play-btn:hover {
  background: var(--green-2);
}

.play-btn svg {
  width: 14px;
  height: 14px;
  margin-left: 1px;
}

.timeline-wrap {
  flex: 1;
  min-width: 0;
}

.timeline-labels {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 8.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.timeline-labels .current-time {
  color: var(--ink-2);
  font-weight: 800;
}

input[type="range"].timeline {
  width: 100%;
  height: 4px;
  margin: 3px 0;
  border-radius: 999px;
  appearance: none;
  background: linear-gradient(to right, var(--green) var(--progress, 0%), #e2e8e3 var(--progress, 0%));
  cursor: pointer;
}

input[type="range"].timeline::-webkit-slider-thumb {
  appearance: none;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: 2px solid white;
  background: var(--green);
  box-shadow: 0 1px 4px rgba(10, 143, 91, 0.4);
}

input[type="range"].timeline::-moz-range-thumb {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 2px solid white;
  background: var(--green);
}

.speed-select {
  height: 28px;
  padding: 0 6px;
  border: 1px solid var(--line);
  border-radius: 7px;
  font-size: 9px;
  font-weight: 700;
  color: var(--ink-2);
  background: var(--surface-2);
}

.history-dock .btn {
  height: 34px;
  flex: 0 0 auto;
}

/* Modal */

#addDriverModal {
  z-index: 2200;
}

.modal-backdrop {
  position: fixed;
  z-index: 2000;
  inset: 0;
  background: rgba(15, 29, 20, 0.4);
  backdrop-filter: blur(5px);
  display: grid;
  place-items: center;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}

.modal {
  width: min(440px, 100%);
  max-height: calc(100dvh - 40px);
  overflow-y: auto;
  border-radius: 20px;
  background: var(--surface);
  box-shadow: 0 30px 90px rgba(12, 30, 18, 0.3);
  padding: 20px;
  animation: modalIn 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.modal-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 17px;
}

.modal-title {
  flex: 1;
}

.modal-title h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.4px;
}

.modal-title p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.6;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.form-grid .field.full {
  grid-column: 1 / -1;
}

.form-grid .field + .field {
  margin-top: 0;
}

.form-grid .field input,
.form-grid .field select {
  height: 40px;
  font-size: 11.5px;
  background: var(--surface-2);
}

.color-options {
  display: flex;
  gap: 7px;
  padding-top: 2px;
}

.color-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.color-option span {
  display: block;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid white;
  box-shadow: 0 0 0 1px var(--line);
  cursor: pointer;
  transition: 0.18s ease;
}

.color-option input:checked + span {
  box-shadow: 0 0 0 2px var(--ink);
  transform: scale(1.04);
}

.modal-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
  padding-top: 15px;
  border-top: 1px solid var(--line);
}

.modal-foot .btn {
  height: 38px;
  min-width: 82px;
}

.btn[disabled] {
  opacity: 0.6;
  pointer-events: none;
}

/* Toast */

.toast-wrap {
  position: fixed;
  z-index: 3000;
  right: 20px;
  bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  min-width: 230px;
  max-width: 360px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 13px;
  border-radius: 12px;
  background: #1d2b23;
  color: white;
  box-shadow: 0 12px 38px rgba(12, 30, 18, 0.3);
  font-size: 10.5px;
  line-height: 1.5;
  animation: toastIn 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  pointer-events: auto;
}

.toast.success {
  background: #0a7148;
}

.toast.error {
  background: #9c3434;
}

.toast svg {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  margin-top: 1px;
}

.toast.leaving {
  animation: toastOut 0.25s ease forwards;
}

/* ---------------- Login ---------------- */

.login-body {
  min-height: 100dvh;
  background: #f3f6f2;
  display: grid;
  place-items: center;
  overflow-x: hidden;
}

.login-shell {
  width: min(1080px, calc(100% - 40px));
  min-height: min(680px, calc(100dvh - 48px));
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  border-radius: 28px;
  overflow: hidden;
  background: white;
  box-shadow: 0 35px 100px rgba(16, 41, 25, 0.15);
  margin: 24px 0;
}

.login-visual {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 80% 12%, rgba(69, 201, 144, 0.24), transparent 28%),
    radial-gradient(circle at 18% 90%, rgba(20, 96, 63, 0.6), transparent 40%),
    linear-gradient(148deg, #0d3d2b 0%, #0a5e3d 46%, #0a7d50 100%);
  color: white;
  padding: 44px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  isolation: isolate;
}

.login-visual::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.055) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, transparent, black 20%, black 80%, transparent);
}

.login-visual::after {
  content: "";
  position: absolute;
  z-index: -1;
  width: 440px;
  height: 440px;
  right: -190px;
  top: 100px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  box-shadow:
    0 0 0 60px rgba(255, 255, 255, 0.025),
    0 0 0 120px rgba(255, 255, 255, 0.018);
}

.login-brand .brand-name {
  font-size: 23px;
}

.login-brand .brand-sub {
  color: rgba(255, 255, 255, 0.56);
}

.login-brand .brand img {
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.login-copy {
  position: relative;
  z-index: 1;
  max-width: 440px;
}

.login-kicker {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #d4f5e4;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.login-kicker .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #66e0a6;
  box-shadow: 0 0 0 4px rgba(102, 224, 166, 0.12);
}

.login-copy h1 {
  margin: 19px 0 0;
  font-size: clamp(32px, 4vw, 47px);
  line-height: 1.07;
  letter-spacing: -1.8px;
  font-weight: 800;
}

.login-copy h1 em {
  font-style: normal;
  color: #8be8ba;
}

.login-copy p {
  margin: 17px 0 0;
  color: rgba(255, 255, 255, 0.66);
  font-size: 12px;
  line-height: 1.8;
  max-width: 370px;
}

.login-features {
  display: flex;
  gap: 22px;
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.13);
}

.login-feature {
  display: flex;
  align-items: center;
  gap: 8px;
  color: rgba(255, 255, 255, 0.74);
  font-size: 9.5px;
  font-weight: 600;
}

.login-feature svg {
  width: 15px;
  height: 15px;
  color: #8be8ba;
}

.route-art {
  position: relative;
  z-index: 1;
  height: 160px;
  margin: 20px 0 0;
}

.route-art svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.route-art .route-line {
  stroke-dasharray: 8 9;
  animation: dashFlow 18s linear infinite;
}

.login-side-foot {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  color: rgba(255, 255, 255, 0.4);
  font-size: 9px;
  font-weight: 500;
}

.login-panel {
  padding: 40px 44px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
}

.mobile-logo {
  display: none;
  margin-bottom: 28px;
}

.login-form-wrap {
  width: 100%;
  max-width: 350px;
  margin: 0 auto;
}

.login-form-head {
  margin-bottom: 27px;
}

.login-form-head .eyebrow {
  display: block;
  margin-bottom: 8px;
  color: var(--green);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.login-form-head h2 {
  margin: 0;
  font-size: 27px;
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -1px;
}

.login-form-head p {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.65;
}

.login-form .field {
  margin-bottom: 13px;
}

.login-form .field > span {
  font-size: 9.5px;
  margin-bottom: 7px;
}

.login-form .field input {
  height: 46px;
  border-radius: 11px;
  background: var(--surface-2);
  font-size: 12px;
  padding: 0 13px;
}

.pin-field {
  position: relative;
}

.pin-field input {
  letter-spacing: 0.32em;
  font-weight: 700 !important;
  padding-right: 46px !important;
}

.pin-toggle {
  position: absolute;
  right: 6px;
  bottom: 6px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  display: grid;
  place-items: center;
}

.pin-toggle:hover {
  color: var(--ink);
  background: #edf1ed;
}

.pin-toggle svg {
  width: 16px;
  height: 16px;
}

.login-submit {
  width: 100%;
  height: 47px;
  margin-top: 8px;
  border: 0;
  border-radius: 11px;
  background: var(--green);
  color: white;
  font-size: 11.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 8px 20px rgba(10, 143, 91, 0.22);
  transition: 0.2s ease;
}

.login-submit:hover {
  background: var(--green-2);
  transform: translateY(-1px);
  box-shadow: 0 11px 25px rgba(10, 143, 91, 0.28);
}

.login-submit:active {
  transform: translateY(0);
}

.login-submit svg {
  width: 16px;
  height: 16px;
}

.login-error {
  display: none;
  margin-bottom: 13px;
  padding: 9px 11px;
  border-radius: 9px;
  background: var(--red-soft);
  border: 1px solid #f5d7d7;
  color: #a33d3d;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.5;
}

.login-error.show {
  display: block;
  animation: shake 0.35s ease;
}

.demo-note {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-top: 19px;
  padding: 11px 12px;
  border-radius: 10px;
  background: #f4f8f4;
  border: 1px dashed #d4e2d8;
  color: var(--muted);
  font-size: 9.5px;
  line-height: 1.6;
}

.demo-note svg {
  width: 14px;
  height: 14px;
  color: var(--green);
  flex: 0 0 auto;
  margin-top: 1px;
}

.demo-note code {
  padding: 1px 4px;
  border-radius: 4px;
  background: white;
  color: var(--green-2);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 9px;
  font-weight: 700;
  border: 1px solid #dce9e0;
}

.login-alt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 17px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 9.5px;
}

.login-alt a {
  color: var(--green-2);
  text-decoration: none;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.login-alt a:hover {
  text-decoration: underline;
}

.login-alt svg {
  width: 12px;
  height: 12px;
}

.login-foot {
  position: absolute;
  left: 44px;
  right: 44px;
  bottom: 22px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted-2);
  font-size: 8.5px;
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.32);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

/* ---------------- Driver app ---------------- */

.driver-body {
  min-height: 100dvh;
  background:
    radial-gradient(circle at 20% -10%, rgba(10, 143, 91, 0.09), transparent 35%),
    #f2f5f1;
}

.driver-shell {
  width: min(560px, 100%);
  min-height: 100dvh;
  margin: 0 auto;
  background: #f7f9f6;
  position: relative;
  box-shadow: 0 0 80px rgba(18, 42, 28, 0.09);
  display: flex;
  flex-direction: column;
}

.driver-header {
  height: 68px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(14px);
  position: sticky;
  top: 0;
  z-index: 100;
}

.driver-header .brand img {
  width: 35px;
  height: 35px;
  border-radius: 11px;
}

.driver-header .brand-name {
  font-size: 17px;
}

.driver-header .brand-sub {
  font-size: 8px;
}

.driver-user {
  display: flex;
  align-items: center;
  gap: 8px;
}

.driver-user .avatar {
  width: 33px;
  height: 33px;
  font-size: 9.5px;
}

.driver-user .avatar::after {
  display: none;
}

.driver-user-text strong,
.driver-user-text small {
  display: block;
  text-align: right;
}

.driver-user-text strong {
  font-size: 9.5px;
  font-weight: 700;
  max-width: 110px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.driver-user-text small {
  margin-top: 2px;
  font-size: 8px;
  color: var(--green);
  font-weight: 700;
}

.driver-content {
  padding: 22px 18px 32px;
  flex: 1;
}

.driver-view {
  animation: fadeUp 0.35s ease;
}

.driver-login-card {
  max-width: 410px;
  margin: 6vh auto 0;
  background: white;
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 27px 24px;
  box-shadow: var(--shadow);
}

.driver-login-icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: var(--green-soft);
  color: var(--green);
  margin-bottom: 18px;
}

.driver-login-icon svg {
  width: 25px;
  height: 25px;
}

.driver-login-card h1 {
  margin: 0;
  font-size: 25px;
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -0.9px;
}

.driver-login-card > p {
  margin: 8px 0 22px;
  font-size: 11px;
  line-height: 1.7;
  color: var(--muted);
}

.driver-login-card .field {
  margin-bottom: 12px;
}

.driver-login-card .field > span {
  font-size: 9.5px;
}

.driver-login-card .field input {
  height: 45px;
  font-size: 12px;
  background: var(--surface-2);
}

.driver-login-card .login-submit {
  height: 46px;
}

.driver-login-help {
  margin-top: 17px;
  padding-top: 15px;
  border-top: 1px solid var(--line);
  text-align: center;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.65;
}

.driver-login-help strong {
  color: var(--green-2);
}

.native-server-info {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 8.5px;
  line-height: 1.4;
}

.native-server-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  flex: 0 0 auto;
}

.native-server-label {
  font-weight: 700;
  color: var(--muted);
}

.native-server-url {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink-2);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 8px;
  flex: 1;
}

.native-server-lock {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  flex: 0 0 auto;
  padding: 2px 5px;
  border-radius: 5px;
  background: #e6f4ec;
  color: var(--green-2);
  font-size: 7.5px;
  font-weight: 800;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.native-server-lock svg {
  width: 9px;
  height: 9px;
}

.hero-welcome {
  position: relative;
  overflow: hidden;
  padding: 24px 22px;
  border-radius: 22px;
  color: white;
  background:
    radial-gradient(circle at 85% 5%, rgba(255, 255, 255, 0.12), transparent 32%),
    linear-gradient(145deg, #0b4a32, #0a8355);
  box-shadow: 0 18px 40px rgba(10, 94, 61, 0.2);
}

.hero-welcome::after {
  content: "";
  position: absolute;
  width: 200px;
  height: 200px;
  right: -80px;
  bottom: -120px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  box-shadow:
    0 0 0 35px rgba(255, 255, 255, 0.035),
    0 0 0 70px rgba(255, 255, 255, 0.02);
}

.hero-welcome .hello {
  position: relative;
  z-index: 1;
  font-size: 10px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.58);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.hero-welcome h1 {
  position: relative;
  z-index: 1;
  margin: 7px 0 0;
  font-size: 26px;
  line-height: 1.15;
  letter-spacing: -0.9px;
  font-weight: 800;
}

.hero-welcome p {
  position: relative;
  z-index: 1;
  margin: 9px 0 0;
  max-width: 320px;
  font-size: 10.5px;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.64);
}

.hero-time {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 20px;
  padding-top: 15px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 9.5px;
  color: rgba(255, 255, 255, 0.62);
}

.hero-time strong {
  color: white;
  font-weight: 700;
}

.hero-time svg {
  width: 13px;
  height: 13px;
}

.start-card {
  margin-top: 14px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 22px;
  box-shadow: var(--shadow-sm);
}

.start-illustration {
  position: relative;
  height: 136px;
  display: grid;
  place-items: center;
  margin-bottom: 17px;
  border-radius: 16px;
  background:
    radial-gradient(circle at 50% 50%, rgba(10, 143, 91, 0.12), transparent 36%),
    radial-gradient(circle at 50% 50%, transparent 38%, rgba(10, 143, 91, 0.07) 39%, transparent 40%),
    radial-gradient(circle at 50% 50%, transparent 56%, rgba(10, 143, 91, 0.05) 57%, transparent 58%),
    #f5faf7;
  overflow: hidden;
}

.start-illustration::before,
.start-illustration::after {
  content: "";
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--green);
  opacity: 0.45;
}

.start-illustration::before {
  top: 25px;
  left: 62px;
}

.start-illustration::after {
  bottom: 28px;
  right: 66px;
}

.start-pin {
  position: relative;
  z-index: 2;
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  border-radius: 50% 50% 50% 9px;
  transform: rotate(-45deg);
  background: var(--green);
  color: white;
  box-shadow: 0 14px 28px rgba(10, 143, 91, 0.3);
}

.start-pin svg {
  width: 27px;
  height: 27px;
  transform: rotate(45deg);
}

.start-ring {
  position: absolute;
  width: 128px;
  height: 128px;
  border: 1.5px solid rgba(10, 143, 91, 0.2);
  border-radius: 50%;
  animation: startRing 2.6s ease-out infinite;
}

.start-card h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.start-card > p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.7;
}

.start-perks {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 17px 0;
  padding: 13px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
}

.start-perk {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 9.5px;
  line-height: 1.5;
  color: var(--ink-2);
  font-weight: 500;
}

.start-perk svg {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  color: var(--green);
}

.start-btn {
  width: 100%;
  height: 52px;
  border: 0;
  border-radius: 14px;
  background: var(--green);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  font-size: 12px;
  font-weight: 800;
  box-shadow: 0 10px 24px rgba(10, 143, 91, 0.26);
  transition: 0.2s ease;
}

.start-btn:hover {
  background: var(--green-2);
  transform: translateY(-1px);
}

.start-btn svg {
  width: 18px;
  height: 18px;
}

.start-footnote {
  margin: 11px 0 0;
  text-align: center;
  color: var(--muted-2);
  font-size: 8.5px;
  line-height: 1.6;
}

.sharing-hero {
  position: relative;
  overflow: hidden;
  border-radius: 22px;
  background:
    radial-gradient(circle at 82% 0%, rgba(83, 227, 158, 0.2), transparent 35%),
    linear-gradient(145deg, #083a27, #08764b 72%, #0a8f5b);
  color: white;
  padding: 21px;
  box-shadow: 0 18px 40px rgba(8, 74, 48, 0.22);
}

.sharing-hero::after {
  content: "";
  position: absolute;
  right: -45px;
  top: 36px;
  width: 145px;
  height: 145px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 50%;
  box-shadow: 0 0 0 32px rgba(255, 255, 255, 0.03);
}

.sharing-status {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 10px;
}

.sharing-pulse {
  position: relative;
  width: 37px;
  height: 37px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.sharing-pulse::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid rgba(113, 240, 172, 0.7);
  animation: haloPulse 2s infinite;
}

.sharing-pulse .dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #6ff0ad;
  box-shadow: 0 0 9px rgba(111, 240, 173, 0.8);
}

.sharing-status-text strong {
  display: block;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: -0.15px;
}

.sharing-status-text span {
  display: block;
  margin-top: 2px;
  font-size: 8.5px;
  color: rgba(255, 255, 255, 0.56);
}

.shift-timer {
  position: relative;
  z-index: 1;
  margin-top: 19px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
}

.shift-timer .timer-label {
  display: block;
  margin-bottom: 3px;
  color: rgba(255, 255, 255, 0.5);
  font-size: 8.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
}

.shift-timer .timer-value {
  font-size: 36px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: -1.6px;
  font-variant-numeric: tabular-nums;
}

.shift-timer .timer-value small {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.52);
  font-weight: 600;
  letter-spacing: 0;
}

.shift-start {
  text-align: right;
}

.shift-start span {
  display: block;
  color: rgba(255, 255, 255, 0.46);
  font-size: 8px;
}

.shift-start strong {
  display: block;
  margin-top: 2px;
  font-size: 10.5px;
  font-weight: 700;
}

.driver-map-card {
  position: relative;
  height: 238px;
  margin-top: 12px;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #e8ede8;
  box-shadow: var(--shadow-sm);
}

.driver-map-card #driverMap {
  position: absolute;
}

.driver-map-overlay {
  position: absolute;
  z-index: 500;
  left: 11px;
  right: 11px;
  top: 11px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  pointer-events: none;
}

.map-data-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 9px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 3px 10px rgba(18, 42, 28, 0.1);
  font-size: 8.5px;
  color: var(--ink-2);
  font-weight: 700;
  backdrop-filter: blur(8px);
}

.map-data-pill .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
}

.map-data-pill.stale .dot {
  background: var(--amber);
}

.map-open {
  pointer-events: auto;
  width: 29px;
  height: 29px;
  border: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--ink-2);
  box-shadow: 0 3px 10px rgba(18, 42, 28, 0.1);
  display: grid;
  place-items: center;
  text-decoration: none;
}

.map-open svg {
  width: 13px;
  height: 13px;
}

.driver-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}

.driver-stat {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: white;
  box-shadow: var(--shadow-sm);
}

.driver-stat-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--green-soft);
  color: var(--green);
  flex: 0 0 auto;
}

.driver-stat-icon svg {
  width: 16px;
  height: 16px;
}

.driver-stat span {
  display: block;
  color: var(--muted);
  font-size: 8.5px;
  font-weight: 600;
}

.driver-stat b {
  display: block;
  margin-top: 2px;
  font-size: 15px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: -0.4px;
}

.driver-stat b small {
  font-size: 8.5px;
  color: var(--muted);
  font-weight: 500;
}

.gps-note {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-top: 12px;
  padding: 11px 12px;
  border-radius: 11px;
  background: #eff7f1;
  border: 1px solid #d9ebdf;
  font-size: 9px;
  line-height: 1.55;
  color: #46715a;
}

.gps-note svg {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  margin-top: 1px;
  color: var(--green);
}

.gps-note.error {
  background: var(--red-soft);
  border-color: #f2d4d4;
  color: #9e4040;
}

.gps-note.error svg {
  color: var(--red);
}

.stop-btn {
  width: 100%;
  height: 46px;
  margin-top: 14px;
  border: 1px solid #efd3d3;
  border-radius: 13px;
  background: white;
  color: #bd4242;
  font-size: 10.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: 0.18s ease;
}

.stop-btn:hover {
  background: var(--red-soft);
  border-color: #e7bebe;
}

.stop-btn svg {
  width: 15px;
  height: 15px;
}

.shift-summary-card {
  margin-top: 14px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: white;
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.summary-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 15px;
}

.summary-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: var(--green-soft);
  color: var(--green);
}

.summary-icon svg {
  width: 18px;
  height: 18px;
}

.summary-head strong {
  display: block;
  font-size: 12.5px;
  font-weight: 800;
}

.summary-head span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 15px;
}

.summary-grid > div {
  padding: 10px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--line);
}

.summary-grid span {
  display: block;
  color: var(--muted);
  font-size: 8px;
  font-weight: 600;
}

.summary-grid b {
  display: block;
  margin-top: 3px;
  font-size: 12px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: -0.3px;
}

.summary-grid b small {
  font-size: 8px;
  color: var(--muted);
  font-weight: 500;
}

/* Driver modal */
.confirm-modal {
  text-align: center;
  padding: 25px;
}

.confirm-icon {
  width: 50px;
  height: 50px;
  margin: 0 auto 14px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--red-soft);
  color: var(--red);
}

.confirm-icon svg {
  width: 22px;
  height: 22px;
}

.confirm-modal h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.confirm-modal p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.7;
}

.confirm-actions {
  display: flex;
  gap: 8px;
  margin-top: 20px;
}

.confirm-actions .btn {
  flex: 1;
  height: 42px;
}

/* ---------------- Attendance ---------------- */

.attendance-strip {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 14px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(135deg, #f3fbf7, #ffffff);
}

.attendance-icon {
  width: 33px;
  height: 33px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--green-soft);
  color: var(--green);
  flex: 0 0 auto;
}

.attendance-icon svg {
  width: 16px;
  height: 16px;
}

.attendance-copy {
  flex: 1;
  min-width: 0;
}

.attendance-copy strong {
  display: block;
  font-size: 10px;
  font-weight: 800;
}

.attendance-copy small {
  display: block;
  min-width: 0;
  margin-top: 2px;
  color: var(--muted);
  font-size: 8px;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.attendance-hours {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 7px;
  border: 1px solid #d8e9df;
  border-radius: 7px;
  background: white;
  color: var(--green-2);
  font-size: 8px;
  font-weight: 800;
  white-space: nowrap;
}

.attendance-hours:hover {
  background: var(--green-pale);
}

.attendance-hours svg {
  width: 11px;
  height: 11px;
}

.detail-home-line {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 8.5px;
  line-height: 1.4;
}

.detail-home-line svg {
  width: 12px;
  height: 12px;
  color: var(--green);
  flex: 0 0 auto;
}

.detail-home-line .late {
  color: #b1730f;
  font-weight: 700;
}

.detail-home-line .success {
  color: var(--green-2);
  font-weight: 700;
}

.settings-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  margin-bottom: 14px;
  border-radius: 10px;
  background: #eef2ee;
}

.settings-tab {
  border: 0;
  background: transparent;
  border-radius: 7px;
  padding: 8px;
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.settings-tab.active {
  background: white;
  color: var(--ink);
  box-shadow: 0 2px 7px rgba(18, 42, 28, 0.08);
}

.settings-tab svg {
  width: 13px;
  height: 13px;
}

.settings-driver-list {
  max-height: 420px;
  margin-top: 4px;
}

.settings-driver-actions {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.work-settings-layout {
  display: grid;
  grid-template-columns: 1.12fr 0.88fr;
  gap: 18px;
  min-height: 380px;
}

.shift-manager,
.assignment-manager {
  min-width: 0;
}

.section-heading h4 {
  margin: 0;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: -0.2px;
}

.shift-settings-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 15px;
}

.shift-setting-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
}

.shift-color-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex: 0 0 auto;
}

.shift-setting-main {
  flex: 1;
  min-width: 0;
}

.shift-setting-main strong {
  display: block;
  font-size: 10px;
  font-weight: 800;
}

.shift-setting-main span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 8px;
}

.shift-setting-drivers {
  color: var(--green-2);
  background: var(--green-soft);
  border-radius: 5px;
  padding: 3px 5px;
  font-size: 7.5px;
  font-weight: 700;
  white-space: nowrap;
}

.shift-setting-actions {
  display: flex;
  gap: 3px;
}

.shift-form {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
}

.shift-form .section-heading {
  margin-bottom: 8px;
}

.shift-form .field {
  margin-bottom: 8px;
}

.shift-form .section-heading h4 {
  font-size: 10.5px;
}

.shift-form-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 3px;
}

.shift-form-actions .btn {
  height: 34px;
}

.shift-color-input {
  width: 100%;
  height: 37px !important;
  padding: 3px !important;
  cursor: pointer;
}

.workday-options {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.workday-options label {
  position: relative;
}

.workday-options input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.workday-options span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  cursor: pointer;
}

.workday-options input:checked + span {
  background: var(--green);
  border-color: var(--green);
  color: white;
}

.assignment-manager {
  display: flex;
  flex-direction: column;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
}

.assignment-manager .section-heading {
  margin-bottom: 4px;
}

.assignment-hint {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 8.5px;
  line-height: 1.6;
}

.shift-assignment-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 365px;
  overflow-y: auto;
  margin-bottom: 12px;
  padding-right: 2px;
}

.shift-assignment-row {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: white;
}

.shift-assignment-row .avatar {
  width: 27px;
  height: 27px;
  font-size: 7.5px;
}

.shift-assignment-row .avatar::after {
  display: none;
}

.shift-assignment-name {
  flex: 1;
  min-width: 0;
}

.shift-assignment-name strong {
  display: block;
  font-size: 9.5px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.shift-assignment-name span {
  display: block;
  margin-top: 1px;
  color: var(--muted);
  font-size: 7.5px;
}

.shift-assignment-row select {
  width: 120px;
  height: 29px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--ink);
  font-size: 8.5px;
  font-weight: 600;
  padding: 0 5px;
}

.shift-assignment-row select:focus {
  outline: none;
  border-color: #b9dfca;
  box-shadow: 0 0 0 2px rgba(10, 143, 91, 0.08);
}

.assignment-mode-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  padding: 3px;
  margin-bottom: 9px;
  border-radius: 8px;
  background: #eef2ee;
}

.assignment-mode-tabs button {
  border: 0;
  border-radius: 6px;
  padding: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 8.5px;
  font-weight: 700;
}

.assignment-mode-tabs button.active {
  background: white;
  color: var(--ink);
  box-shadow: 0 1px 5px rgba(18, 42, 28, 0.08);
}

.override-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  margin-bottom: 8px;
}

.override-controls .field + .field {
  margin-top: 0;
}

.override-controls .field input,
.override-controls .field select {
  height: 32px;
  font-size: 9px;
}

#assignmentDatePane .shift-assignment-list {
  max-height: 300px;
}

.settings-foot-note {
  margin-right: auto;
  color: var(--muted-2);
  font-size: 8.5px;
}

@media (max-width: 760px) {
  .work-settings-layout {
    grid-template-columns: 1fr;
  }
  .shift-assignment-list {
    max-height: 300px;
  }
}

.driver-attendance-card {
  margin-top: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: white;
  box-shadow: var(--shadow-sm);
}

.driver-attendance-card.done {
  background: linear-gradient(145deg, #f4fcf7, #ffffff);
  border-color: #d6ebdf;
}

.driver-attendance-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.driver-attendance-icon {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: var(--green-soft);
  color: var(--green);
  flex: 0 0 auto;
}

.driver-attendance-icon svg {
  width: 18px;
  height: 18px;
}

.driver-attendance-title {
  flex: 1;
  min-width: 0;
}

.driver-attendance-title span {
  display: block;
  color: var(--green-2);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.driver-attendance-title strong {
  display: block;
  margin-top: 2px;
  font-size: 13px;
  font-weight: 800;
}

.driver-attendance-title small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 8.5px;
}

.attendance-badge {
  padding: 3px 6px;
  border-radius: 5px;
  background: #fff6e4;
  color: #9a6211;
  font-size: 7.5px;
  font-weight: 800;
  white-space: nowrap;
}

.attendance-badge.on_time {
  background: var(--green-soft);
  color: var(--green-2);
}

.attendance-badge.late {
  background: #fff1dd;
  color: #a5660b;
}

.attendance-badge.not_checked_in {
  background: #f0f3f1;
  color: var(--muted);
}

.attendance-times {
  display: flex;
  gap: 13px;
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 8.5px;
}

.attendance-times span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.attendance-times svg {
  width: 12px;
  height: 12px;
  color: var(--green);
}

.attendance-times b {
  color: var(--ink-2);
  font-weight: 800;
}

.driver-attendance-actions {
  display: flex;
  gap: 7px;
  margin-top: 10px;
}

.driver-attendance-actions .btn {
  flex: 1;
  height: 39px;
  font-size: 10px;
}

.driver-attendance-note {
  margin-top: 7px;
  color: var(--muted);
  font-size: 8px;
  line-height: 1.5;
}

/* ---------------- Perdin ---------------- */

.side-tabs {
  grid-template-columns: repeat(3, 1fr);
}

.heading-actions {
  display: flex;
  align-items: center;
  gap: 1px;
}

.perdin-kpis {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 5px;
  margin-bottom: 12px;
}

.perdin-kpi {
  padding: 8px 9px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface-2);
}

.perdin-kpi span {
  display: block;
  color: var(--muted);
  font-size: 8px;
  font-weight: 600;
  white-space: nowrap;
}

.perdin-kpi b {
  display: block;
  margin-top: 3px;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: -0.2px;
}

.perdin-kpi b small {
  color: var(--muted-2);
  font-size: 7.5px;
  font-weight: 500;
}

.perdin-kpi.kpi-alert b {
  color: #c98213;
}

.perdin-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.perdin-card {
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
  padding: 11px;
  color: inherit;
  transition: 0.18s ease;
}

.perdin-card:hover {
  border-color: #cbd9d1;
  box-shadow: 0 4px 14px rgba(18, 42, 28, 0.05);
}

.perdin-card.selected {
  border-color: rgba(10, 143, 91, 0.45);
  background: var(--green-pale);
  box-shadow: inset 3px 0 0 var(--green);
}

.perdin-card-head {
  display: flex;
  align-items: flex-start;
  gap: 9px;
}

.perdin-card-flag {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: #eef4ff;
  color: #3d6bcc;
  flex: 0 0 auto;
}

.perdin-card-flag.active {
  background: var(--green-soft);
  color: var(--green);
}

.perdin-card-flag.completed {
  background: #f0f3f1;
  color: var(--ink-2);
}

.perdin-card-flag.canceled {
  background: var(--red-soft);
  color: var(--red);
}

.perdin-card-flag svg {
  width: 16px;
  height: 16px;
}

.perdin-card-title {
  flex: 1;
  min-width: 0;
}

.perdin-card-title strong {
  display: block;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.perdin-card-title span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 8.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.perdin-badge {
  flex: 0 0 auto;
  border-radius: 5px;
  padding: 3px 6px;
  font-size: 7.5px;
  font-weight: 800;
  color: var(--green-2);
  background: var(--green-soft);
  white-space: nowrap;
}

.perdin-badge.scheduled {
  color: #3d6bcc;
  background: #eef4ff;
}

.perdin-badge.completed {
  color: var(--muted);
  background: #f0f3f1;
}

.perdin-badge.canceled {
  color: var(--red);
  background: var(--red-soft);
}

.perdin-card-driver {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 8.5px;
}

.perdin-card-driver .avatar {
  width: 20px;
  height: 20px;
  font-size: 6.5px;
}

.perdin-card-driver .avatar::after {
  display: none;
}

.perdin-card-driver strong {
  color: var(--ink-2);
  font-weight: 700;
}

.perdin-card-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 3px;
  margin-top: 9px;
  padding-top: 8px;
  border-top: 1px solid #eef2ef;
}

.perdin-card-metrics > div {
  min-width: 0;
}

.perdin-card-metrics span {
  display: block;
  color: var(--muted-2);
  font-size: 7.5px;
  font-weight: 500;
}

.perdin-card-metrics b {
  display: block;
  margin-top: 2px;
  color: var(--ink-2);
  font-size: 9.5px;
  font-weight: 800;
  white-space: nowrap;
}

.perdin-card-metrics b small {
  font-size: 7px;
  color: var(--muted);
  font-weight: 500;
}

.perdin-anomaly-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin-top: 7px;
}

.anomaly-pill {
  padding: 2px 5px;
  border-radius: 4px;
  color: #9a6211;
  background: #fff6e4;
  font-size: 7px;
  font-weight: 700;
  white-space: nowrap;
}

.anomaly-pill.critical {
  color: #a33d3d;
  background: #fdecec;
}

.perdin-detail-card {
  position: absolute;
  z-index: 610;
  left: 18px;
  bottom: 18px;
  width: 405px;
  max-width: calc(100% - 36px);
  max-height: calc(100% - 130px);
  overflow-y: auto;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 19px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
  animation: riseIn 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.perdin-flag {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  color: #3d6bcc;
  background: #eef4ff;
  flex: 0 0 auto;
}

.perdin-flag.active {
  color: var(--green);
  background: var(--green-soft);
}

.perdin-flag.completed {
  color: var(--ink-2);
  background: #f0f3f1;
}

.perdin-flag.canceled {
  color: var(--red);
  background: var(--red-soft);
}

.perdin-flag svg {
  width: 22px;
  height: 22px;
}

.perdin-driver-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px 0;
  padding: 9px 10px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--line);
}

.perdin-driver-row .avatar {
  width: 29px;
  height: 29px;
  font-size: 8px;
}

.perdin-driver-row .avatar::after {
  display: none;
}

.perdin-driver-row > div:nth-child(2) {
  flex: 1;
  min-width: 0;
}

.perdin-driver-row strong {
  display: block;
  font-size: 9.5px;
  font-weight: 700;
}

.perdin-driver-row span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 8px;
}

.perdin-timeline {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin-bottom: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.perdin-time-item {
  padding: 0 9px;
  border-right: 1px solid var(--line);
}

.perdin-time-item:first-child {
  padding-left: 0;
}

.perdin-time-item:last-child {
  border: 0;
  padding-right: 0;
}

.perdin-time-item span {
  display: block;
  color: var(--muted);
  font-size: 7.5px;
}

.perdin-time-item strong {
  display: block;
  margin-top: 3px;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.3;
}

.perdin-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  margin-bottom: 10px;
}

.perdin-metrics > div {
  padding: 7px;
  border-radius: 8px;
  background: var(--surface-2);
  border: 1px solid var(--line);
}

.perdin-metrics span {
  display: block;
  color: var(--muted);
  font-size: 7.5px;
}

.perdin-metrics b {
  display: block;
  margin-top: 2px;
  font-size: 10.5px;
  font-weight: 800;
}

.perdin-metrics b small {
  font-size: 7px;
  color: var(--muted);
  font-weight: 500;
}

.perdin-anomalies {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 10px;
}

.perdin-anomaly {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  padding: 6px 8px;
  border-radius: 7px;
  background: #fff8eb;
  border: 1px solid #f5e5c5;
  color: #8d5d15;
  font-size: 8px;
  line-height: 1.4;
}

.perdin-anomaly.critical {
  background: var(--red-soft);
  border-color: #f2d4d4;
  color: #9e4040;
}

.perdin-anomaly svg {
  width: 12px;
  height: 12px;
  margin-top: 1px;
  flex: 0 0 auto;
}

.perdin-anomaly strong {
  display: block;
  font-weight: 800;
  margin-bottom: 1px;
}

.perdin-detail-card .detail-actions .btn {
  height: 34px;
}

.perdin-history-btn {
  height: 34px;
  margin-bottom: 8px;
}

.loading-inline {
  padding: 20px;
  text-align: center;
  color: var(--muted);
  font-size: 10px;
}

/* Driver manage modal */

.driver-manage-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  max-height: 420px;
  overflow-y: auto;
  margin-bottom: 4px;
}

.driver-manage-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-2);
}

.driver-manage-row .avatar {
  width: 34px;
  height: 34px;
  font-size: 9px;
}

.driver-manage-row .avatar::after {
  display: none;
}

.driver-manage-main {
  flex: 1;
  min-width: 0;
}

.driver-manage-main strong {
  display: block;
  font-size: 10.5px;
  font-weight: 700;
}

.driver-manage-main span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 8.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.driver-manage-actions {
  display: flex;
  gap: 4px;
}

.manage-action {
  width: 29px;
  height: 29px;
  border: 1px solid var(--line);
  border-radius: 7px;
  display: grid;
  place-items: center;
  background: white;
  color: var(--muted);
}

.manage-action:hover {
  color: var(--green-2);
  border-color: #cfe8da;
  background: var(--green-pale);
}

.manage-action.danger:hover {
  color: var(--red);
  border-color: #f1d2d2;
  background: var(--red-soft);
}

.manage-action svg {
  width: 13px;
  height: 13px;
}

/* Perdin modal */

.modal-wide {
  width: min(960px, 100%);
  max-height: calc(100dvh - 32px);
}

.perdin-form-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 370px;
  gap: 15px;
}

.perdin-form-fields {
  min-width: 0;
}

.perdin-form-fields .field {
  margin-bottom: 10px;
}

.perdin-form-fields textarea {
  width: 100%;
  min-height: 50px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-2);
  padding: 8px 9px;
  font-family: var(--font);
  font-size: 10.5px;
  color: var(--ink);
  line-height: 1.5;
}

.perdin-form-fields textarea:focus {
  border-color: #bddfcd;
  outline: none;
  box-shadow: 0 0 0 3px rgba(10, 143, 91, 0.08);
}

.perdin-form-fields .field input,
.perdin-form-fields .field select {
  height: 37px;
  font-size: 10.5px;
  background: var(--surface-2);
}

.geocode-search {
  display: flex;
  gap: 6px;
}

.geocode-search input {
  flex: 1;
  height: 39px !important;
}

.geocode-search .btn {
  height: 39px;
  flex: 0 0 auto;
}

.geocode-tools {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-top: 5px;
  color: var(--muted);
  font-size: 7.5px;
  line-height: 1.5;
}

.geocode-tools code {
  padding: 1px 3px;
  border-radius: 3px;
  background: var(--surface-2);
  color: var(--ink-2);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 7.5px;
}

.geocode-tool-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
  white-space: nowrap;
}

.geocode-tool-actions .text-btn {
  font-size: 7.5px;
  color: var(--green-2);
}

@media (max-width: 700px) {
  .geocode-tools {
    flex-direction: column;
  }
}

.geocode-results {
  margin-top: 6px;
  max-height: 235px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: white;
  box-shadow: var(--shadow-sm);
}

.geocode-result {
  display: block;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-bottom: 1px solid #eef2ef;
  background: white;
  text-align: left;
  color: inherit;
}

.geocode-result:last-child {
  border: 0;
}

.geocode-result:hover {
  background: var(--green-pale);
}

.geocode-result strong {
  display: block;
  font-size: 9.5px;
  font-weight: 700;
}

.geocode-result span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 8px;
  line-height: 1.4;
}

.geocode-result .geocode-coords {
  display: block;
  margin-top: 2px;
  color: var(--muted-2);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 7px;
  font-style: normal;
}

.perdin-map-wrap {
  position: relative;
  min-height: 400px;
  border-radius: 13px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #e8ede8;
}

#perdinPickMap {
  position: absolute;
  inset: 0;
}

.perdin-map-label {
  position: absolute;
  z-index: 500;
  left: 10px;
  top: 10px;
  padding: 5px 8px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--muted);
  box-shadow: 0 2px 8px rgba(18, 42, 28, 0.1);
  font-size: 8px;
  font-weight: 700;
  pointer-events: none;
}

.perdin-point-hint {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin-top: 2px;
  padding: 8px 9px;
  border-radius: 8px;
  background: #f3f8f4;
  border: 1px dashed #d3e3d8;
  color: var(--muted);
  font-size: 8.5px;
  line-height: 1.5;
}

.perdin-point-hint svg {
  width: 13px;
  height: 13px;
  flex: 0 0 auto;
  margin-top: 1px;
  color: var(--green);
}

.perdin-pick-marker {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50% 50% 50% 8px;
  transform: rotate(-45deg);
  background: var(--green);
  border: 3px solid white;
  color: white;
  box-shadow: 0 5px 16px rgba(10, 143, 91, 0.35);
}

.perdin-pick-marker svg {
  width: 17px;
  height: 17px;
  transform: rotate(45deg);
}

.perdin-map-marker {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50% 50% 50% 7px;
  transform: rotate(-45deg);
  border: 2.5px solid white;
  color: white;
  background: #3d6bcc;
  box-shadow: 0 4px 12px rgba(22, 49, 96, 0.28);
  font-size: 8px;
  font-weight: 800;
}

.perdin-map-marker.active {
  background: var(--green);
}

.perdin-map-marker.completed {
  background: #435048;
}

.perdin-map-marker.canceled {
  background: var(--red);
}

.perdin-map-marker > span {
  transform: rotate(45deg);
}

.perdin-map-marker.selected {
  box-shadow: 0 0 0 4px rgba(47, 111, 237, 0.22), 0 5px 16px rgba(22, 49, 96, 0.32);
  transform: rotate(-45deg) scale(1.08);
}

/* Driver portal Perdin */

.driver-perdin-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-top: 13px;
}

.perdin-driver-card {
  position: relative;
  overflow: hidden;
  padding: 15px;
  border-radius: 17px;
  background: white;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}

.perdin-driver-card.active {
  border-color: rgba(10, 143, 91, 0.3);
  background: linear-gradient(150deg, #f7fdf9, #ffffff);
}

.perdin-driver-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.perdin-driver-icon {
  width: 39px;
  height: 39px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: #eef4ff;
  color: #3d6bcc;
  flex: 0 0 auto;
}

.perdin-driver-icon.active {
  background: var(--green-soft);
  color: var(--green);
}

.perdin-driver-icon svg {
  width: 19px;
  height: 19px;
}

.perdin-driver-title {
  flex: 1;
  min-width: 0;
}

.perdin-driver-title span {
  display: block;
  color: var(--green-2);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.perdin-driver-title strong {
  display: block;
  margin-top: 3px;
  font-size: 14px;
  line-height: 1.25;
  font-weight: 800;
  letter-spacing: -0.3px;
}

.perdin-driver-title small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.5;
}

.perdin-driver-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 11px;
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 8.5px;
}

.perdin-driver-meta b {
  color: var(--ink-2);
  font-weight: 700;
}

.perdin-distance-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 11px;
  padding: 10px 11px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--line);
}

.perdin-distance-row span {
  color: var(--muted);
  font-size: 8.5px;
}

.perdin-distance-row b {
  display: block;
  margin-top: 2px;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.4px;
}

.perdin-distance-row b small {
  font-size: 8px;
  color: var(--muted);
  font-weight: 500;
}

.perdin-checkin-state {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 7px;
  border-radius: 6px;
  background: #fff6e4;
  color: #9a6211;
  font-size: 8px;
  font-weight: 700;
  white-space: nowrap;
}

.perdin-checkin-state.ready {
  background: var(--green-soft);
  color: var(--green-2);
}

.perdin-driver-actions {
  display: flex;
  gap: 7px;
  margin-top: 11px;
}

.perdin-driver-actions .btn {
  flex: 1;
  height: 40px;
  font-size: 10px;
}

.perdin-driver-actions .btn[disabled] {
  opacity: 0.55;
  pointer-events: none;
}

.perdin-complete-note {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin-top: 9px;
  padding: 8px 9px;
  border-radius: 8px;
  background: var(--green-pale);
  color: var(--green-2);
  font-size: 8.5px;
  line-height: 1.5;
}

.perdin-complete-note svg {
  width: 13px;
  height: 13px;
  flex: 0 0 auto;
  margin-top: 1px;
}

@media (max-width: 860px) {
  .perdin-form-layout {
    grid-template-columns: 1fr;
  }
  .perdin-map-wrap {
    min-height: 280px;
  }
  .perdin-detail-card {
    left: 12px;
    bottom: 12px;
    width: calc(100% - 24px);
    max-height: 58%;
  }
}

@media (max-width: 600px) {
  .perdin-kpis {
    grid-template-columns: 1fr 1fr;
  }
  .perdin-card-metrics {
    grid-template-columns: 1fr 1fr;
  }
  .perdin-metrics {
    grid-template-columns: 1fr 1fr;
  }
  .perdin-detail-card {
    padding: 12px;
  }
  .modal-wide {
    padding: 15px;
  }
  .perdin-timeline {
    grid-template-columns: 1fr;
    gap: 7px;
  }
  .perdin-time-item {
    padding: 0 !important;
    border: 0 !important;
  }
  .perdin-time-item strong {
    display: inline;
    margin-left: 5px;
  }
}

/* ---------------- Main Dashboard ---------------- */

.side-tabs {
  grid-template-columns: repeat(4, 1fr);
  gap: 2px;
}

.side-tab {
  padding: 7px 4px;
  gap: 3px;
  font-size: 9.5px;
}

.side-tab svg {
  width: 12px;
  height: 12px;
}

.dashboard-stage {
  position: absolute;
  z-index: 700;
  inset: 0;
  overflow-y: auto;
  background:
    radial-gradient(circle at 92% 0%, rgba(10, 143, 91, 0.06), transparent 26%),
    var(--bg);
  scrollbar-width: thin;
  scrollbar-color: #cfd9d2 transparent;
}

.dashboard-stage[hidden] {
  display: none !important;
}

.dashboard-scroll {
  width: min(1380px, 100%);
  margin: 0 auto;
  padding: 24px 26px 40px;
}

.dashboard-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 18px;
}

.dashboard-heading {
  min-width: 0;
}

.eyebrow-dark {
  display: block;
  color: var(--green);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  margin-bottom: 5px;
}

.dashboard-heading h1 {
  margin: 0;
  font-size: 27px;
  line-height: 1.05;
  letter-spacing: -1px;
  font-weight: 800;
}

.dashboard-heading p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 9.5px;
  line-height: 1.6;
  max-width: 560px;
}

.dashboard-filter {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 7px;
}

.dashboard-presets {
  display: flex;
  gap: 4px;
}

.dashboard-dates {
  display: flex;
  align-items: flex-end;
  gap: 6px;
}

.dashboard-dates label {
  display: flex;
  flex-direction: column;
  gap: 3px;
  color: var(--muted);
  font-size: 7.5px;
  font-weight: 600;
}

.dashboard-dates input {
  height: 29px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  padding: 0 6px;
  color: var(--ink);
  font-size: 8.5px;
}

.dashboard-dates .btn {
  height: 29px;
}

.dashboard-kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}

.dashboard-kpi {
  position: relative;
  overflow: hidden;
  padding: 12px 13px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
  box-shadow: var(--shadow-sm);
}

.dashboard-kpi.primary {
  background: linear-gradient(145deg, #0a8355, #0b6947);
  border-color: transparent;
  color: white;
  box-shadow: 0 10px 22px rgba(10, 120, 76, 0.18);
}

.dashboard-kpi.alert {
  border-color: #f2dfbf;
  background: #fffbf3;
}

.dashboard-kpi.danger {
  border-color: #f0d1d1;
  background: #fffafa;
}

.dashboard-kpi > span {
  display: block;
  color: var(--muted);
  font-size: 8.5px;
  font-weight: 600;
  white-space: nowrap;
}

.dashboard-kpi.primary > span {
  color: rgba(255, 255, 255, 0.62);
}

.dashboard-kpi > b {
  display: block;
  margin-top: 4px;
  font-size: 23px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: -0.7px;
}

.dashboard-kpi > b small {
  font-size: 9px;
  color: var(--muted);
  font-weight: 500;
  letter-spacing: 0;
}

.dashboard-kpi > b .kpi-count {
  font-size: 13px;
  color: var(--muted);
  font-weight: 700;
  letter-spacing: 0;
  margin-left: 1px;
}

.dashboard-kpi.primary > b small {
  color: rgba(255, 255, 255, 0.55);
}

.dashboard-kpi > small {
  display: block;
  margin-top: 5px;
  color: var(--muted-2);
  font-size: 7.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dashboard-kpi.primary > small {
  color: rgba(255, 255, 255, 0.48);
}

.dashboard-kpi.danger > b {
  color: #b44b4b;
}

.dashboard-charts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 15px;
}

.chart-card {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: white;
  box-shadow: var(--shadow-sm);
}

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

.chart-head h3 {
  margin: 0;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: -0.2px;
}

.chart-head span:not(.chart-unit) {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 8px;
}

.chart-unit {
  padding: 3px 6px;
  border-radius: 5px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 7.5px;
  font-weight: 700;
  white-space: nowrap;
}

.chart-canvas-wrap {
  position: relative;
  height: 235px;
  min-width: 0;
}

.chart-canvas-wrap.chart-pie {
  height: 215px;
}

.chart-canvas-wrap canvas {
  width: 100% !important;
  height: 100% !important;
}

.chart-empty {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 45%;
  text-align: center;
  color: var(--muted);
  font-size: 9px;
  pointer-events: none;
}

.chart-card {
  position: relative;
}

.dashboard-section {
  margin-bottom: 16px;
}

.dashboard-section .section-heading h3 {
  margin: 0;
  font-size: 12px;
  font-weight: 800;
}

.dashboard-side-intro {
  padding: 14px;
  border-radius: 13px;
  background: linear-gradient(145deg, #f4fbf7, #ebf6ef);
  border: 1px solid #d9ebdf;
  margin-bottom: 11px;
}

.dashboard-side-intro h2 {
  margin: 4px 0 0;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.4px;
}

.dashboard-side-intro p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.65;
}

.dashboard-side-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
  margin-bottom: 11px;
}

.dashboard-side-summary > div {
  padding: 9px 8px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: white;
}

.dashboard-side-summary span {
  display: block;
  color: var(--muted);
  font-size: 7.5px;
  font-weight: 600;
}

.dashboard-side-summary b {
  display: block;
  margin-top: 3px;
  font-size: 15px;
  font-weight: 800;
}

.dashboard-side-help {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: 12px;
  padding: 10px;
  border-radius: 9px;
  background: var(--surface-2);
  border: 1px dashed var(--line-strong);
  color: var(--muted);
  font-size: 8px;
  line-height: 1.55;
}

.dashboard-side-help strong {
  color: var(--ink-2);
  font-size: 8.5px;
}

.dashboard-foot {
  margin-top: 4px;
  color: var(--muted-2);
  font-size: 8px;
  text-align: right;
}

@media (max-width: 1100px) {
  .dashboard-charts {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .dashboard-scroll {
    padding: 16px 14px 28px;
  }
  .dashboard-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }
  .dashboard-filter {
    align-items: flex-start;
    width: 100%;
  }
  .dashboard-kpis {
    grid-template-columns: 1fr 1fr;
  }
  .dashboard-charts {
    grid-template-columns: 1fr;
  }
  .dashboard-heading h1 {
    font-size: 23px;
  }
}

@media (max-width: 600px) {
  .dashboard-kpis {
    grid-template-columns: 1fr 1fr;
  }
  .dashboard-kpi > b {
    font-size: 19px;
  }
  .chart-canvas-wrap {
    height: 205px;
  }
  .dashboard-dates {
    flex-wrap: wrap;
  }
}

/* ---------------- Performance dashboard ---------------- */

#performanceModal {
  background: rgba(244, 246, 243, 0.985);
  backdrop-filter: blur(3px);
}

#performanceModal .performance-modal {
  width: min(1100px, 100%);
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  box-shadow: 0 30px 90px rgba(12, 30, 18, 0.18);
}

.perf-range-bar {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px;
  margin-bottom: 10px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-2);
}

.perf-range-presets {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-right: auto;
}

.perf-date-field {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 8px;
  font-weight: 600;
}

.perf-date-field input {
  height: 29px;
  padding: 0 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  font-size: 8.5px;
  color: var(--ink);
}

.perf-range-bar .btn {
  height: 29px;
}

.performance-kpis {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 7px;
  margin-bottom: 16px;
}

.performance-kpis > div {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
}

.performance-kpis span {
  display: block;
  color: var(--muted);
  font-size: 8px;
  font-weight: 600;
  white-space: nowrap;
}

.performance-kpis b {
  display: block;
  margin-top: 3px;
  font-size: 16px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: -0.4px;
}

.performance-kpis b small {
  font-size: 8px;
  color: var(--muted);
  font-weight: 500;
  letter-spacing: 0;
}

.performance-section {
  margin-bottom: 16px;
}

.performance-section .section-heading {
  margin-bottom: 7px;
}

.perf-note {
  color: var(--muted-2);
  font-size: 8px;
}

.perf-table-wrap {
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow-x: auto;
  background: white;
}

.perf-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1020px;
}

.perf-table th {
  padding: 8px 9px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 8px;
  font-weight: 700;
  text-align: left;
  white-space: nowrap;
  border-bottom: 1px solid var(--line);
}

.perf-table td {
  padding: 8px 9px;
  border-bottom: 1px solid #eef2ef;
  color: var(--ink-2);
  font-size: 8.5px;
  white-space: nowrap;
}

.perf-table tr:last-child td {
  border-bottom: 0;
}

.perf-table tbody tr {
  cursor: pointer;
}

.perf-table tbody tr:hover {
  background: var(--green-pale);
}

.perf-destination {
  display: flex;
  flex-direction: column;
  max-width: 220px;
}

.perf-destination strong {
  font-size: 8.8px;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.perf-destination span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 7.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.perf-status {
  display: inline-block;
  padding: 2px 5px;
  border-radius: 4px;
  font-size: 7px;
  font-weight: 800;
  background: #eef4ff;
  color: #3d6bcc;
}

.perf-status.active,
.perf-status.completed {
  background: var(--green-soft);
  color: var(--green-2);
}

.perf-status.canceled {
  background: var(--red-soft);
  color: var(--red);
}

.perf-anomaly-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 999px;
  background: #f0f3f1;
  color: var(--muted);
  font-size: 7.5px;
  font-weight: 800;
}

.perf-anomaly-count.has {
  background: #fff1dd;
  color: #9a6211;
}

.perf-empty {
  padding: 22px;
  text-align: center;
  color: var(--muted);
  font-size: 9px;
}

@media (max-width: 900px) {
  .performance-kpis {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 600px) {
  .performance-kpis {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Animations */

@keyframes softPulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(19, 178, 109, 0.28);
  }
  50% {
    box-shadow: 0 0 0 4px rgba(19, 178, 109, 0);
  }
}

@keyframes haloPulse {
  0% {
    transform: scale(0.92);
    opacity: 0.8;
  }
  80%,
  100% {
    transform: scale(1.55);
    opacity: 0;
  }
}

@keyframes markerPulse {
  0% {
    transform: scale(0.85);
    opacity: 0.55;
  }
  90%,
  100% {
    transform: scale(1.85);
    opacity: 0;
  }
}

@keyframes startRing {
  0% {
    transform: scale(0.68);
    opacity: 0.65;
  }
  100% {
    transform: scale(1.35);
    opacity: 0;
  }
}

@keyframes riseIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.history-dock {
  animation-name: dockIn;
}

@keyframes dockIn {
  from {
    opacity: 0;
    transform: translate(-50%, 10px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: scale(0.97) translateY(8px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(7px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateX(20px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

@keyframes toastOut {
  to {
    opacity: 0;
    transform: translateX(20px);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  20% {
    transform: translateX(-4px);
  }
  40% {
    transform: translateX(4px);
  }
  60% {
    transform: translateX(-3px);
  }
  80% {
    transform: translateX(2px);
  }
}

@keyframes dashFlow {
  to {
    stroke-dashoffset: -170;
  }
}

/* Skeleton */

.skeleton {
  position: relative;
  overflow: hidden;
  background: #edf1ed;
  border-radius: 8px;
}

.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.65), transparent);
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  100% {
    transform: translateX(100%);
  }
}

/* Responsive */

@media (max-width: 1020px) {
  .admin-shell {
    grid-template-columns: 350px minmax(0, 1fr);
  }
  .detail-card {
    width: 340px;
  }
}

@media (max-width: 860px) {
  .admin-body {
    overflow: auto;
  }
  .admin-shell {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(380px, 48dvh) minmax(420px, 52dvh);
    height: auto;
    min-height: 100dvh;
  }
  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .brand-bar {
    padding: 14px 16px 11px;
  }
  .side-tabs {
    margin: 0 14px 10px;
  }
  .side-pane {
    padding: 0 14px 10px;
  }
  .sidebar-foot {
    padding: 8px 14px;
  }
  .stat-grid {
    margin-bottom: 12px;
  }
  .map-stage {
    min-height: 420px;
  }
  .map-header {
    top: 12px;
    left: 12px;
    right: 12px;
  }
  .map-clock {
    display: none;
  }
  .detail-card {
    left: 12px;
    bottom: 12px;
    width: calc(100% - 24px);
    max-width: 390px;
  }
  .history-dock {
    left: 12px;
    right: 12px;
    bottom: 12px;
    width: auto;
    transform: none;
    animation-name: riseIn;
  }
  .map-legend {
    display: none;
  }
  .toast-wrap {
    right: 12px;
    bottom: 12px;
    left: 12px;
    align-items: stretch;
  }
  .toast {
    max-width: none;
  }
}

@media (max-width: 600px) {
  .admin-shell {
    grid-template-rows: minmax(400px, 51dvh) minmax(390px, 49dvh);
  }
  .brand img {
    width: 37px;
    height: 37px;
  }
  .brand-name {
    font-size: 19px;
  }
  .brand-sub {
    font-size: 8.5px;
  }
  .connection-chip {
    padding: 6px 8px;
    font-size: 9px;
  }
  .side-tab {
    font-size: 10.5px;
    padding: 7px;
  }
  .stat-card {
    padding: 9px 10px;
  }
  .stat-value {
    font-size: 18px;
  }
  .driver-card {
    padding: 9px 10px;
    grid-template-columns: 38px minmax(0, 1fr) auto;
  }
  .avatar {
    width: 38px;
    height: 38px;
    font-size: 10.5px;
  }
  .driver-name {
    font-size: 11px;
  }
  .monitoring-pill {
    padding: 8px 11px;
  }
  .monitoring-pill strong {
    font-size: 10px;
  }
  .monitoring-pill small {
    font-size: 8.5px;
  }
  .live-halo {
    width: 31px;
    height: 31px;
  }
  .map-square-btn {
    width: 35px;
    height: 35px;
  }
  .detail-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px 0;
  }
  .detail-stat:nth-child(2) {
    border-right: 0;
  }
  .detail-stat {
    padding: 0 8px;
  }
  .detail-stat:nth-child(3) {
    padding-left: 0;
  }
  .detail-card {
    padding: 12px;
  }
  .history-dock {
    padding: 12px;
  }
  .dock-metrics {
    gap: 8px;
  }
  .dock-metric {
    padding-left: 8px;
  }
  .dock-metric:nth-child(3) {
    display: none;
  }
  .history-dock .btn span {
    display: none;
  }
  .history-dock .btn {
    width: 34px;
    padding: 0;
  }
  .login-shell {
    grid-template-columns: 1fr;
    width: min(460px, calc(100% - 24px));
    min-height: auto;
    margin: 12px 0;
    border-radius: 22px;
  }
  .login-visual {
    display: none;
  }
  .login-panel {
    padding: 30px 25px 58px;
  }
  .mobile-logo {
    display: block;
  }
  .login-foot {
    left: 25px;
    right: 25px;
    bottom: 16px;
  }
  .login-form-head h2 {
    font-size: 25px;
  }
  .driver-content {
    padding: 17px 13px 28px;
  }
  .driver-header {
    padding: 0 14px;
    height: 62px;
  }
  .driver-user-text strong {
    max-width: 80px;
  }
  .hero-welcome {
    padding: 20px 17px;
  }
  .hero-welcome h1 {
    font-size: 23px;
  }
  .start-card {
    padding: 18px 16px;
  }
  .sharing-hero {
    padding: 18px;
  }
  .shift-timer .timer-value {
    font-size: 31px;
  }
  .driver-map-card {
    height: 210px;
  }
  .summary-grid {
    grid-template-columns: 1fr 1fr;
  }
  .summary-grid > div:last-child {
    grid-column: 1 / -1;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .form-grid .field.full {
    grid-column: auto;
  }
}

/* ---------------- Penjadwalan (tanpa peta) ---------------- */

.schedule-stage {
  position: absolute;
  z-index: 700;
  inset: 0;
  overflow-y: auto;
  background:
    radial-gradient(circle at 92% 0%, rgba(10, 143, 91, 0.06), transparent 26%),
    var(--bg);
  scrollbar-width: thin;
  scrollbar-color: #cfd9d2 transparent;
}

.schedule-stage[hidden] {
  display: none !important;
}

.schedule-scroll {
  width: min(1400px, 100%);
  margin: 0 auto;
  padding: 24px 26px 40px;
}

.schedule-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 16px;
}

.schedule-head-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.schedule-head-actions .btn {
  height: 34px;
}

.schedule-head-actions .btn svg {
  width: 13px;
  height: 13px;
}

.schedule-tabs {
  display: flex;
  gap: 4px;
  width: fit-content;
  max-width: 100%;
  margin-bottom: 14px;
  padding: 4px;
  border-radius: 11px;
  background: #e9efea;
  overflow-x: auto;
}

.schedule-tab {
  display: flex;
  align-items: center;
  gap: 5px;
  border: 0;
  border-radius: 8px;
  padding: 8px 13px;
  background: transparent;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  white-space: nowrap;
}

.schedule-tab small {
  color: var(--muted-2);
  font-size: 7px;
  font-weight: 500;
}

.schedule-tab.active {
  background: white;
  color: var(--ink);
  box-shadow: 0 2px 7px rgba(18, 42, 28, 0.08);
}

.schedule-kpis {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 7px;
  margin-bottom: 7px;
}

.schedule-kpis.secondary {
  grid-template-columns: repeat(4, 1fr);
  margin-bottom: 14px;
}

.schedule-kpi {
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: white;
  box-shadow: var(--shadow-sm);
}

.schedule-kpi.primary {
  border-color: transparent;
  background: linear-gradient(145deg, #0a8355, #0b6947);
  color: white;
}

.schedule-kpi.alert {
  border-color: #f2dfbf;
  background: #fffbf3;
}

.schedule-kpi > span {
  display: block;
  color: var(--muted);
  font-size: 8px;
  font-weight: 600;
  white-space: nowrap;
}

.schedule-kpi.primary > span {
  color: rgba(255, 255, 255, 0.62);
}

.schedule-kpi > b {
  display: block;
  margin-top: 3px;
  font-size: 19px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.schedule-kpi > b small {
  color: var(--muted);
  font-size: 8px;
  font-weight: 500;
}

.schedule-kpi > b .kpi-count {
  margin-left: 1px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0;
}

.schedule-kpi > small {
  display: block;
  margin-top: 4px;
  color: var(--muted-2);
  font-size: 7px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.schedule-kpi.primary > small {
  color: rgba(255, 255, 255, 0.5);
}

.schedule-kpi.alert > b {
  color: #c98213;
}

.schedule-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  gap: 12px;
  align-items: start;
}

.schedule-list-panel {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: white;
  box-shadow: var(--shadow-sm);
}

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

.schedule-list-head h2 {
  margin: 0;
  font-size: 12px;
  font-weight: 800;
}

.schedule-list-head > div > span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 8px;
}

.schedule-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.schedule-kind-badge {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  padding: 3px 6px;
  border-radius: 5px;
  font-size: 7px;
  font-weight: 800;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.schedule-kind-badge.perdin {
  color: #3d6bcc;
  background: #eef4ff;
}

.schedule-kind-badge.local {
  color: #a36a15;
  background: #fff4df;
}

.schedule-detail {
  position: sticky;
  top: 0;
  min-height: 400px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: white;
  box-shadow: var(--shadow-sm);
}

.schedule-detail-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 360px;
  gap: 6px;
  text-align: center;
  color: var(--muted);
}

.schedule-empty-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin-bottom: 4px;
  border-radius: 16px;
  background: var(--green-soft);
  color: var(--green);
}

.schedule-empty-icon svg {
  width: 24px;
  height: 24px;
}

.schedule-detail-empty strong {
  color: var(--ink);
  font-size: 12px;
}

.schedule-detail-empty p {
  max-width: 260px;
  margin: 0;
  font-size: 9px;
  line-height: 1.6;
}

.schedule-detail-top {
  display: flex;
  align-items: flex-start;
  gap: 9px;
}

.schedule-detail-title {
  flex: 1;
  min-width: 0;
}

.schedule-detail-title h2 {
  margin: 0;
  font-size: 14px;
  line-height: 1.25;
  font-weight: 800;
}

.schedule-detail-title p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 8.5px;
  line-height: 1.5;
}

.schedule-detail-location {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
  padding: 8px 9px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 7.5px;
  flex-wrap: wrap;
}

.schedule-detail-location a {
  color: var(--green-2);
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.schedule-detail .detail-actions .btn {
  height: 34px;
}

.schedule-shift-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: white;
  box-shadow: var(--shadow-sm);
  flex-wrap: wrap;
}

.schedule-shift-head h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
}

.schedule-shift-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 9px;
}

.schedule-shift-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 9px;
}

.schedule-shift-card {
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
  box-shadow: var(--shadow-sm);
}

.schedule-shift-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.schedule-shift-card-head strong {
  font-size: 11px;
}

.schedule-shift-card-head span {
  color: var(--muted);
  font-size: 8px;
}

.schedule-shift-time {
  margin: 8px 0 3px;
  font-size: 16px;
  font-weight: 800;
}

.schedule-shift-days {
  display: flex;
  gap: 2px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.schedule-shift-day {
  padding: 2px 5px;
  border-radius: 4px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 7px;
  font-weight: 600;
}

.schedule-shift-drivers {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin-top: 8px;
}

.schedule-shift-driver {
  padding: 2px 6px;
  border-radius: 5px;
  background: var(--surface-2);
  color: var(--ink-2);
  font-size: 7.5px;
}

.schedule-shift-note {
  margin-top: 12px;
  padding: 11px 13px;
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 8px;
  line-height: 1.6;
}

.schedule-side-nav {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 12px;
}

.schedule-side-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: white;
  color: var(--ink-2);
  font-size: 9px;
  font-weight: 700;
  text-align: left;
}

.schedule-side-link span {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.schedule-side-link small {
  color: var(--muted);
  font-size: 7px;
  font-weight: 500;
}

.schedule-side-link b {
  color: var(--muted);
  font-size: 11px;
}

.schedule-side-link.active {
  border-color: rgba(10, 143, 91, 0.35);
  background: var(--green-pale);
  color: var(--green-2);
}

.schedule-side-link.active b {
  color: var(--green-2);
}

.schedule-side-tip {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 10px;
  border: 1px dashed var(--line-strong);
  border-radius: 9px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 8px;
  line-height: 1.6;
}

.schedule-side-tip strong {
  color: var(--ink-2);
  font-size: 8.5px;
}

.schedule-kind-picker {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  margin-bottom: 12px;
}

.schedule-kind-option {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-2);
  cursor: pointer;
}

.schedule-kind-option input {
  margin-top: 2px;
  accent-color: var(--green);
}

.schedule-kind-option span {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.schedule-kind-option strong {
  font-size: 9px;
}

.schedule-kind-option small {
  color: var(--muted);
  font-size: 7.5px;
  line-height: 1.4;
}

.schedule-kind-option:has(input:checked) {
  border-color: rgba(10, 143, 91, 0.4);
  background: var(--green-pale);
}

@media (max-width: 1100px) {
  .schedule-layout {
    grid-template-columns: 1fr;
  }
  .schedule-detail {
    position: static;
  }
  .schedule-kpis {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 700px) {
  .schedule-scroll {
    padding: 16px 14px 28px;
  }
  .schedule-head {
    flex-direction: column;
    align-items: flex-start;
  }
  .schedule-kpis,
  .schedule-kpis.secondary {
    grid-template-columns: 1fr 1fr;
  }
  .schedule-kind-picker {
    grid-template-columns: 1fr;
  }
  .schedule-tabs {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }
}
