@font-face {
  font-family: "Rubik";
  src: url("Schriftarten/Rubik-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Rubik";
  src: url("Schriftarten/Rubik-Medium.ttf") format("truetype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Nunito";
  src: url("Schriftarten/Nunito-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --font-display: "Rubik", "Segoe UI", Arial, sans-serif;
  --font-body: "Nunito", "Segoe UI", Arial, sans-serif;
  --water-a: #5a77bb;
  --water-b: #32305b;
  --earth-a: #875c63;
  --earth-b: #3d271d;
  --air-a: #89a6b6;
  --air-b: #345269;
  --bg: #f4f7f8;
  --surface: rgba(255, 255, 255, 0.34);
  --surface-strong: rgba(255, 255, 255, 0.68);
  --line: rgba(255, 255, 255, 0.58);
  --text: #33424d;
  --muted: #60707b;
  --accent: #345269;
  --accent-strong: #32305b;
  --focus: rgba(90, 119, 187, 0.34);
  --shadow: 0 22px 54px rgba(50, 48, 91, 0.16);
  --left-panel-width: 300px;
  --right-panel-width: 330px;
  --bottom-panel-height: 280px;
  --menu-bg: rgba(255, 255, 255, 0.38);
  --panel-inset: rgba(255, 255, 255, 0.56);
}

body[data-theme="dark"] {
  --bg: #1f2630;
  --surface: rgba(255, 255, 255, 0.12);
  --surface-strong: rgba(255, 255, 255, 0.18);
  --line: rgba(255, 255, 255, 0.2);
  --text: #dde7ef;
  --muted: #aebdca;
  --accent: #89a6b6;
  --accent-strong: #f2f5f8;
  --focus: rgba(137, 166, 182, 0.34);
  --shadow: 0 22px 54px rgba(0, 0, 0, 0.26);
  --menu-bg: rgba(255, 255, 255, 0.1);
  --panel-inset: rgba(255, 255, 255, 0.08);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

body {
  margin: 0;
  color: var(--text);
  background:
    linear-gradient(135deg, rgba(90, 119, 187, 0.16), rgba(137, 166, 182, 0.28) 42%, rgba(255, 255, 255, 0.38)),
    var(--bg);
  font-family: var(--font-body);
}

body[data-theme="dark"] {
  background:
    linear-gradient(135deg, rgba(50, 48, 91, 0.42), rgba(52, 82, 105, 0.34) 45%, rgba(61, 39, 29, 0.16)),
    var(--bg);
}

button,
input {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

.app-shell {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

.login-view {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(320px, 430px);
  align-items: center;
  gap: clamp(24px, 5vw, 82px);
  padding: clamp(24px, 6vw, 72px);
}

.login-brand {
  min-width: 0;
  display: grid;
  align-content: center;
  gap: 28px;
}

.brand-logo {
  width: min(420px, 78vw);
  height: auto;
}

.app-kicker,
.workspace-brand p {
  margin: 0 0 8px;
  color: var(--muted);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0;
}

.login-brand h1 {
  margin: 0;
  color: var(--accent-strong);
  font-family: var(--font-display);
  font-size: clamp(42px, 7vw, 86px);
  font-weight: 700;
  line-height: 0.98;
}

.login-panel,
.status-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px) saturate(1.18);
  -webkit-backdrop-filter: blur(24px) saturate(1.18);
}

.login-panel {
  padding: clamp(24px, 4vw, 36px);
}

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

.form-head {
  margin-bottom: 10px;
}

.form-head h2,
.status-panel h3,
.workspace-brand h2 {
  margin: 0;
  color: var(--accent-strong);
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0;
}

.form-head h2 {
  font-size: 30px;
}

.form-head p,
.status-panel p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.45;
}

.form-head p.is-error {
  color: #875c63;
  font-family: var(--font-display);
  font-weight: 500;
}

.login-form label {
  color: var(--text);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 500;
}

.login-form input {
  width: 100%;
  min-height: 54px;
  border: 1px solid rgba(52, 82, 105, 0.26);
  border-radius: 8px;
  background: var(--surface-strong);
  color: var(--text);
  padding: 0 15px;
  font-size: 18px;
}

.login-form input:focus,
button:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.primary-action,
.secondary-action {
  min-height: 54px;
  border-radius: 8px;
  display: inline-grid;
  grid-template-columns: 22px auto;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  cursor: pointer;
}

.primary-action {
  margin-top: 12px;
  border: 0;
  background: linear-gradient(135deg, var(--water-a), var(--water-b));
  color: #fff;
}

.secondary-action {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--accent-strong);
  padding: 0 16px;
}

.primary-action svg,
.secondary-action svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.primary-action:active,
.secondary-action:active {
  transform: translateY(1px);
}

.workspace-view {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
  padding: max(10px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) max(14px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
}

.classic-menu {
  position: relative;
  z-index: 10;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--menu-bg);
  box-shadow: 0 10px 28px rgba(50, 48, 91, 0.08), inset 0 1px 0 var(--panel-inset);
  backdrop-filter: blur(24px) saturate(1.22);
  -webkit-backdrop-filter: blur(24px) saturate(1.22);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 4px;
}

.view-tabs {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 4px;
}

.view-tab {
  min-height: 30px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 500;
  padding: 0 12px;
  cursor: pointer;
}

.view-tab:hover,
.view-tab:focus-visible,
.view-tab.is-active {
  border-color: var(--line);
  background: var(--surface-strong);
  color: var(--accent-strong);
  box-shadow: inset 0 1px 0 var(--panel-inset);
}

.menu-group {
  position: relative;
}

.dropdown-action {
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

.settings-group {
  margin-left: auto;
}

.settings-icon-button {
  width: 34px;
  height: 30px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--accent-strong);
  display: grid;
  place-items: center;
  cursor: pointer;
}

.settings-icon-button svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.1;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.settings-icon-button:hover,
.settings-icon-button:focus-visible,
.settings-icon-button.is-open,
.dropdown-action:hover,
.dropdown-action:focus-visible,
.dropdown-action.is-active {
  background: var(--surface-strong);
}

.menu-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  width: 270px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  box-shadow: var(--shadow);
  backdrop-filter: blur(26px) saturate(1.2);
  -webkit-backdrop-filter: blur(26px) saturate(1.2);
  padding: 8px;
}

.settings-dropdown {
  display: grid;
  gap: 4px;
}

.settings-section {
  display: grid;
  gap: 2px;
}

.menu-dropdown-title {
  color: var(--muted);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 500;
  padding: 4px 8px 8px;
}

.dropdown-action {
  width: 100%;
  min-height: 36px;
  display: block;
  padding: 0 10px;
  text-align: left;
}

.menu-separator {
  height: 1px;
  margin: 8px;
  background: rgba(52, 82, 105, 0.14);
}

.workspace-content {
  min-height: 0;
  height: 100%;
  overflow: hidden;
  display: grid;
  grid-template-columns: var(--left-panel-width) 10px minmax(340px, 1fr) 10px var(--right-panel-width);
  grid-template-rows: minmax(280px, 1fr) 10px var(--bottom-panel-height);
  grid-template-areas:
    "left leftGrip center rightGrip right"
    "bottomGrip bottomGrip bottomGrip bottomGrip bottomGrip"
    "bottom bottom bottom bottom bottom";
  gap: 0;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow:
    0 16px 36px rgba(50, 48, 91, 0.08),
    inset 0 1px 0 var(--panel-inset);
  backdrop-filter: blur(28px) saturate(1.22);
  -webkit-backdrop-filter: blur(28px) saturate(1.22);
  min-width: 0;
  min-height: 0;
  max-height: 100%;
  overflow: auto;
}

.left-panel {
  grid-area: left;
}

.driver-panel {
  display: grid;
  grid-template-rows: auto auto auto auto minmax(0, 1fr);
  overflow: hidden;
}

.driver-panel-head {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-bottom: 1px solid rgba(52, 82, 105, 0.12);
  background: rgba(255, 255, 255, 0.32);
}

.driver-stat {
  min-width: 0;
  min-height: 54px;
  display: grid;
  place-items: center;
  gap: 2px;
  padding: 6px 4px;
  text-align: center;
}

.driver-stat strong {
  color: #000;
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  line-height: 1;
}

.driver-stat span {
  color: #000;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 500;
}

.driver-toolbar {
  min-height: 36px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid rgba(52, 82, 105, 0.1);
  padding: 4px 8px;
}

.driver-tool-button {
  min-height: 28px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0 4px;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 500;
}

.driver-tool-button svg,
.driver-metrics svg {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.driver-tool-button.is-muted {
  opacity: 0.58;
}

.driver-list-head {
  min-height: 25px;
  display: grid;
  grid-template-columns: 24px 26px minmax(0, 1fr);
  align-items: center;
  border-bottom: 1px solid rgba(52, 82, 105, 0.16);
  color: #000;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  padding: 0 8px;
}

.driver-empty-note {
  min-height: 34px;
  border-bottom: 1px solid rgba(52, 82, 105, 0.08);
  color: var(--muted);
  display: flex;
  align-items: center;
  padding: 0 10px;
  font-size: 13px;
}

.driver-list {
  min-height: 0;
  overflow: auto;
}

.driver-row {
  min-height: 48px;
  display: grid;
  grid-template-columns: 24px 26px 20px minmax(0, 1fr);
  align-items: center;
  border-bottom: 1px solid rgba(52, 82, 105, 0.08);
  padding: 5px 8px;
  cursor: pointer;
}

.driver-row:hover,
.driver-row.is-selected {
  background: rgba(255, 255, 255, 0.34);
}

.driver-row.is-selected {
  box-shadow: inset 3px 0 0 var(--water-a);
}

.driver-check {
  display: grid;
  place-items: center;
}

.driver-check input {
  width: 14px;
  height: 14px;
  margin: 0;
  accent-color: var(--water-a);
}

.driver-lock-button {
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #20313d;
  display: grid;
  place-items: center;
  padding: 0;
  cursor: pointer;
}

.driver-lock-button svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linejoin: round;
}

.driver-lock-button.is-open {
  color: var(--muted);
}

.driver-lock-button:hover,
.driver-lock-button:focus-visible {
  background: var(--surface-strong);
}

.driver-color-dot {
  width: 11px;
  height: 11px;
  border: 1px solid rgba(0, 0, 0, 0.28);
  border-radius: 999px;
  background: var(--driver-color);
}

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

.driver-name {
  min-width: 0;
  color: #000;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.driver-name span {
  font-weight: 500;
}

.driver-metrics {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #000;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.3;
  white-space: nowrap;
}

.driver-metrics span {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.driver-metrics.is-empty {
  color: var(--muted);
}

body[data-theme="dark"] .driver-panel-head,
body[data-theme="dark"] .driver-row:hover,
body[data-theme="dark"] .driver-row.is-selected {
  background: rgba(255, 255, 255, 0.08);
}

body[data-theme="dark"] .driver-stat strong,
body[data-theme="dark"] .driver-stat span,
body[data-theme="dark"] .driver-list-head,
body[data-theme="dark"] .driver-name,
body[data-theme="dark"] .driver-metrics,
body[data-theme="dark"] .driver-lock-button {
  color: var(--text);
}

.right-panel {
  grid-area: right;
}

.center-workspace {
  grid-area: center;
  position: relative;
  overflow: hidden;
}

.map-surface {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: inherit;
  background: #dce7ec;
}

.route-map {
  width: 100%;
  height: 100%;
  min-height: 100%;
  border-radius: inherit;
}

.map-fallback {
  height: 100%;
  display: grid;
  place-items: center;
  padding: 24px;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 14px;
  text-align: center;
}

.route-map .leaflet-container,
.leaflet-container.route-map {
  color: #263640;
  font-family: var(--font-body);
  background: #dce7ec;
}

.route-map .leaflet-control-attribution {
  font-size: 10px;
}

.route-map .leaflet-popup-content-wrapper,
.route-map .leaflet-popup-tip {
  color: #263640;
  background: rgba(255, 255, 255, 0.96);
}

.map-status-bar {
  position: absolute;
  z-index: 600;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 0 10px 28px rgba(50, 48, 91, 0.16);
  backdrop-filter: blur(18px) saturate(1.16);
  -webkit-backdrop-filter: blur(18px) saturate(1.16);
  color: #263640;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 500;
}

.map-status-bar {
  top: 10px;
  right: 10px;
  min-height: 34px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 5px 4px 10px;
}

.map-fit-button {
  min-height: 26px;
  border: 1px solid rgba(52, 82, 105, 0.22);
  border-radius: 6px;
  background: #fff;
  color: #263640;
  padding: 0 10px;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.map-fit-button:hover,
.map-fit-button:focus-visible {
  background: #eef4f6;
}

body[data-theme="dark"] .map-status-bar {
  border-color: rgba(221, 231, 239, 0.22);
  background: rgba(31, 38, 48, 0.86);
  color: #dde7ef;
}

body[data-theme="dark"] .map-fit-button {
  border-color: rgba(221, 231, 239, 0.18);
  background: rgba(255, 255, 255, 0.12);
  color: #dde7ef;
}

.settings-workspace-panel {
  position: absolute;
  inset: 12px;
  z-index: 720;
  min-width: 0;
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 24px 60px rgba(50, 48, 91, 0.2);
  backdrop-filter: blur(24px) saturate(1.16);
  -webkit-backdrop-filter: blur(24px) saturate(1.16);
  color: var(--text);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}

.settings-workspace-head {
  min-height: 66px;
  border-bottom: 1px solid rgba(52, 82, 105, 0.14);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px 12px 18px;
}

.settings-kicker {
  margin: 0 0 3px;
  color: var(--muted);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
}

.settings-workspace-head h2 {
  margin: 0;
  color: var(--accent-strong);
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
}

.settings-close-button {
  width: 36px;
  height: 36px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--accent-strong);
  display: grid;
  place-items: center;
  cursor: pointer;
}

.settings-close-button svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
}

.settings-close-button:hover,
.settings-close-button:focus-visible {
  border-color: var(--line);
  background: var(--surface-strong);
}

.settings-workspace-body {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(180px, 220px) minmax(0, 1fr);
  overflow: hidden;
}

.settings-nav {
  min-width: 0;
  min-height: 0;
  border-right: 1px solid rgba(52, 82, 105, 0.14);
  display: grid;
  align-content: start;
  gap: 4px;
  padding: 12px;
  overflow: auto;
}

.settings-nav-button,
.settings-action-button,
.settings-segment-button,
.settings-tile-button {
  border: 1px solid transparent;
  border-radius: 6px;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

.settings-nav-button {
  min-height: 38px;
  background: transparent;
  color: var(--text);
  padding: 0 10px;
  text-align: left;
}

.settings-nav-button:hover,
.settings-nav-button:focus-visible,
.settings-nav-button.is-active {
  border-color: var(--line);
  background: var(--surface-strong);
  color: var(--accent-strong);
}

.settings-content {
  min-width: 0;
  min-height: 0;
  padding: 14px;
  overflow: auto;
}

.settings-section-panel {
  display: none;
}

.settings-section-panel.is-active {
  display: grid;
  align-content: start;
  gap: 12px;
}

.settings-block {
  border: 1px solid rgba(52, 82, 105, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.48);
  overflow: hidden;
}

.settings-section-panel[data-settings-panel="fahrer"] .settings-block {
  overflow: auto;
}

.settings-block-head {
  border-bottom: 1px solid rgba(52, 82, 105, 0.1);
  padding: 10px 12px;
}

.settings-block-head.split {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.settings-block-head.split span {
  color: var(--muted);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 500;
}

.settings-block h3 {
  margin: 0;
  color: var(--accent-strong);
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
}

.settings-control-row {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 12px;
}

.settings-control-row + .settings-control-row {
  border-top: 1px solid rgba(52, 82, 105, 0.08);
}

.settings-control-row > span {
  min-width: 0;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 500;
}

.settings-segment {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  border: 1px solid rgba(52, 82, 105, 0.16);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.48);
  padding: 3px;
}

.settings-segment-button,
.settings-action-button {
  min-height: 30px;
  background: transparent;
  color: var(--text);
  padding: 0 10px;
}

.settings-segment-button:hover,
.settings-segment-button:focus-visible,
.settings-segment-button.is-active,
.settings-action-button:hover,
.settings-action-button:focus-visible {
  background: var(--surface-strong);
  color: var(--accent-strong);
}

.settings-action-button {
  border-color: rgba(52, 82, 105, 0.16);
  background: rgba(255, 255, 255, 0.52);
}

.settings-action-button.primary {
  border-color: rgba(37, 118, 158, 0.24);
  background: rgba(37, 118, 158, 0.14);
  color: var(--accent-strong);
}

.settings-action-button.danger {
  color: #875c63;
}

.settings-control-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 12px;
}

.settings-tile-button {
  min-height: 44px;
  background: rgba(255, 255, 255, 0.52);
  border-color: rgba(52, 82, 105, 0.14);
  color: var(--text);
  padding: 0 12px;
  text-align: left;
}

.settings-tile-button:hover,
.settings-tile-button:focus-visible {
  background: var(--surface-strong);
  color: var(--accent-strong);
}

.driver-settings-form {
  display: grid;
  grid-template-columns: minmax(90px, 0.7fr) minmax(150px, 1.2fr) minmax(80px, 0.6fr) minmax(70px, 0.4fr) auto;
  align-items: end;
  gap: 10px;
  border-bottom: 1px solid rgba(52, 82, 105, 0.1);
  padding: 12px;
}

.depot-settings-form {
  display: grid;
  grid-template-columns: minmax(140px, 0.8fr) minmax(140px, 0.6fr) minmax(240px, 1.6fr) auto auto;
  align-items: end;
  gap: 10px;
  border-bottom: 1px solid rgba(52, 82, 105, 0.1);
  padding: 12px;
}

.depot-settings-form label {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.depot-settings-form span {
  color: var(--muted);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 500;
}

.depot-settings-form input,
.depot-settings-form select {
  width: 100%;
  min-height: 34px;
  border: 1px solid rgba(52, 82, 105, 0.18);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.56);
  color: var(--text);
  padding: 0 9px;
  font: inherit;
}

.depot-geocode-status {
  min-height: 32px;
  border-bottom: 1px solid rgba(52, 82, 105, 0.08);
  color: var(--muted);
  display: flex;
  align-items: center;
  padding: 0 12px;
  font-family: var(--font-display);
  font-size: 12px;
}

.depot-geocode-status[data-state="success"] {
  color: #1e6d3e;
}

.depot-geocode-status[data-state="error"] {
  color: #9a3b45;
}

.depot-list {
  display: grid;
}

.depot-empty-state {
  min-height: 54px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-family: var(--font-display);
  font-size: 13px;
}

.depot-row {
  min-height: 62px;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid rgba(52, 82, 105, 0.08);
  padding: 8px 12px;
}

.depot-type-dot {
  width: 12px;
  height: 12px;
  border: 1px solid rgba(0, 0, 0, 0.22);
  border-radius: 999px;
}

.depot-type-dot.is-labor {
  background: #25769e;
}

.depot-type-dot.is-external {
  background: #7b5aa6;
}

.depot-row-main {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.depot-row-main strong,
.depot-row-main span,
.depot-row-main small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.depot-row-main strong {
  color: #000;
  font-family: var(--font-display);
  font-size: 13px;
}

.depot-row-main span,
.depot-row-main small {
  color: var(--muted);
  font-size: 12px;
}

.depot-map-marker {
  width: 30px;
  height: 30px;
  border: 2px solid #fff;
  border-radius: 999px 999px 999px 4px;
  color: #fff;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 800;
  box-shadow: 0 10px 22px rgba(31, 48, 60, 0.24);
  transform: rotate(-45deg);
}

.depot-map-marker::before {
  content: "";
  position: absolute;
  inset: 6px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 999px;
}

.depot-map-marker.is-labor {
  background: #25769e;
}

.depot-map-marker.is-external {
  background: #7b5aa6;
}

.depot-map-marker > span {
  line-height: 1;
  transform: rotate(45deg);
}

.driver-settings-form label {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.driver-settings-form label span {
  color: var(--muted);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 500;
}

.driver-settings-form input[type="text"],
.driver-settings-input {
  width: 100%;
  min-height: 34px;
  border: 1px solid rgba(52, 82, 105, 0.18);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.56);
  color: var(--text);
  padding: 0 9px;
  font-size: 14px;
}

.driver-settings-form input[type="color"],
.driver-settings-color {
  width: 30px;
  height: 30px;
  border: 1px solid rgba(52, 82, 105, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.56);
  padding: 2px;
  overflow: hidden;
}

.driver-settings-form input[type="color"]::-webkit-color-swatch-wrapper,
.driver-settings-color::-webkit-color-swatch-wrapper {
  padding: 0;
}

.driver-settings-form input[type="color"]::-webkit-color-swatch,
.driver-settings-color::-webkit-color-swatch {
  border: 0;
  border-radius: 999px;
}

.driver-settings-list {
  display: grid;
}

.driver-settings-table-head {
  min-height: 32px;
  display: grid;
  grid-template-columns: 58px 52px 80px minmax(180px, 1.2fr) 142px 98px 142px 62px;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid rgba(52, 82, 105, 0.12);
  color: var(--muted);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  padding: 0 12px;
}

.driver-settings-row {
  min-height: 52px;
  display: grid;
  grid-template-columns: 58px 52px 80px minmax(180px, 1.2fr) 142px 98px 142px 62px;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid rgba(52, 82, 105, 0.08);
  padding: 7px 12px;
}

.driver-settings-row:last-child {
  border-bottom: 0;
}

.driver-settings-row.is-disabled {
  opacity: 0.55;
}

.driver-active-toggle {
  width: 34px;
  height: 18px;
  display: inline-grid;
  align-items: center;
  cursor: pointer;
}

.driver-active-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.driver-active-toggle span {
  position: relative;
  width: 34px;
  height: 18px;
  border-radius: 999px;
  background: rgba(96, 112, 123, 0.34);
  transition: background 0.16s ease;
}

.driver-active-toggle span::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 2px;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.22);
  transition: transform 0.16s ease;
}

.driver-active-toggle input:checked + span {
  background: #2687e9;
}

.driver-active-toggle input:checked + span::before {
  transform: translateX(16px);
}

.driver-settings-name-edit,
.driver-time-pair {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 58px;
  gap: 6px;
}

.driver-time-pair {
  grid-template-columns: 1fr 1fr;
}

.driver-settings-input.serial,
.driver-settings-input.number,
.driver-settings-input.time,
.driver-settings-input.code {
  padding: 0 6px;
  font-size: 12px;
}

.driver-settings-input.number {
  text-align: right;
}

body[data-theme="dark"] .settings-workspace-panel {
  background: rgba(31, 38, 48, 0.9);
}

body[data-theme="dark"] .settings-workspace-head,
body[data-theme="dark"] .settings-nav,
body[data-theme="dark"] .settings-block-head,
body[data-theme="dark"] .settings-control-row + .settings-control-row {
  border-color: rgba(221, 231, 239, 0.12);
}

body[data-theme="dark"] .settings-block,
body[data-theme="dark"] .settings-segment,
body[data-theme="dark"] .settings-action-button,
body[data-theme="dark"] .settings-tile-button,
body[data-theme="dark"] .driver-settings-form input[type="text"],
body[data-theme="dark"] .driver-settings-form input[type="color"],
body[data-theme="dark"] .driver-settings-color,
body[data-theme="dark"] .driver-settings-input,
body[data-theme="dark"] .depot-settings-form input,
body[data-theme="dark"] .depot-settings-form select {
  border-color: rgba(221, 231, 239, 0.14);
  background: rgba(255, 255, 255, 0.08);
}

body[data-theme="dark"] .depot-row-main strong {
  color: var(--text);
}

.bottom-panel {
  grid-area: bottom;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}

.bottom-tabs {
  min-height: 38px;
  display: flex;
  align-items: end;
  gap: 2px;
  border-bottom: 1px solid rgba(52, 82, 105, 0.16);
  background: rgba(255, 255, 255, 0.28);
  padding: 4px 8px 0;
}

.bottom-tab {
  min-width: 132px;
  min-height: 31px;
  border: 1px solid rgba(52, 82, 105, 0.18);
  border-bottom: 0;
  border-radius: 7px 7px 0 0;
  background: rgba(255, 255, 255, 0.34);
  color: var(--muted);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.bottom-tab:hover,
.bottom-tab:focus-visible,
.bottom-tab.is-active {
  background: rgba(255, 255, 255, 0.72);
  color: var(--accent-strong);
}

.bottom-view-panel {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.bottom-view-panel.is-active {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.bottom-empty-state {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-family: var(--font-display);
  font-size: 13px;
}

.timeline-toolbar {
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid rgba(52, 82, 105, 0.12);
  background: rgba(255, 255, 255, 0.44);
  padding: 0 12px;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 12px;
}

.timeline-toolbar div {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.timeline-toolbar strong {
  color: #000;
  font-weight: 700;
}

.timeline-toolbar span,
.timeline-scale {
  color: var(--muted);
}

.timeline-gantt {
  --timeline-driver-col: 150px;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  background: rgba(255, 255, 255, 0.22);
}

.timeline-grid {
  width: max-content;
  min-width: 100%;
}

.timeline-header,
.timeline-row {
  display: grid;
  grid-template-columns: var(--timeline-driver-col) var(--timeline-width);
  min-width: max-content;
}

.timeline-header {
  position: sticky;
  top: 0;
  z-index: 4;
  min-height: 34px;
  border-bottom: 1px solid rgba(52, 82, 105, 0.16);
  background: rgba(246, 249, 250, 0.96);
}

.timeline-driver-heading,
.timeline-driver-cell {
  position: sticky;
  left: 0;
  z-index: 3;
  min-width: var(--timeline-driver-col);
  border-right: 1px solid rgba(52, 82, 105, 0.16);
  background: rgba(246, 249, 250, 0.96);
  color: #000;
  font-family: var(--font-display);
  font-size: 12px;
}

.timeline-driver-heading {
  display: flex;
  align-items: end;
  padding: 0 10px 7px;
  font-weight: 700;
}

.timeline-row {
  min-height: 84px;
  border-bottom: 1px solid rgba(52, 82, 105, 0.12);
}

.timeline-row:nth-child(odd) .timeline-driver-cell,
.timeline-row:nth-child(odd) .timeline-track {
  background-color: rgba(255, 255, 255, 0.28);
}

.timeline-driver-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
}

.timeline-driver-cell span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.timeline-driver-cell small {
  color: var(--muted);
  font-size: 11px;
}

.timeline-driver-dot {
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  border: 1px solid rgba(0, 0, 0, 0.26);
  border-radius: 999px;
  background: var(--driver-color);
}

.timeline-track {
  position: relative;
  width: var(--timeline-width);
  min-height: 100%;
  background-image:
    linear-gradient(to right, rgba(52, 82, 105, 0.17) 1px, transparent 1px),
    linear-gradient(to right, rgba(52, 82, 105, 0.08) 1px, transparent 1px);
  background-size:
    60px 100%,
    30px 100%;
}

.timeline-track-head {
  min-height: 34px;
  background-color: rgba(255, 255, 255, 0.48);
}

.timeline-tick-label {
  position: absolute;
  left: var(--offset-px);
  bottom: 7px;
  transform: translateX(-1px);
  color: #000;
  font-family: var(--font-display);
  font-size: 11px;
  white-space: nowrap;
}

.timeline-block {
  position: absolute;
  left: var(--offset-px);
  top: 17px;
  width: var(--duration-px);
  height: 50px;
  min-width: 24px;
  border: 1px solid color-mix(in srgb, var(--driver-color), #000 12%);
  border-radius: 5px;
  background: color-mix(in srgb, var(--driver-color), #fff 18%);
  color: #fff;
  display: grid;
  align-content: center;
  gap: 2px;
  padding: 5px 7px;
  overflow: hidden;
  box-shadow: 0 4px 10px rgba(50, 48, 91, 0.08);
}

.timeline-block strong,
.timeline-block span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.timeline-block strong {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
}

.timeline-block span {
  font-size: 10px;
  opacity: 0.92;
}

.timeline-block.is-break {
  border-color: rgba(52, 82, 105, 0.26);
  background: rgba(137, 166, 182, 0.62);
  color: #1f303c;
}

.timeline-off-duty {
  position: absolute;
  left: var(--offset-px);
  top: 0;
  bottom: 0;
  width: var(--duration-px);
  background:
    repeating-linear-gradient(
      -45deg,
      rgba(52, 82, 105, 0.08) 0,
      rgba(52, 82, 105, 0.08) 4px,
      rgba(255, 255, 255, 0.22) 4px,
      rgba(255, 255, 255, 0.22) 8px
    );
}

.timeline-now {
  position: absolute;
  left: var(--offset-px);
  top: 0;
  bottom: 0;
  z-index: 2;
  width: 2px;
  background: #ee3434;
}

.timeline-now::before {
  content: "";
  position: absolute;
  top: -5px;
  left: 50%;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #ee3434;
  transform: translateX(-50%);
}

.timeline-no-blocks,
.timeline-empty-row {
  color: var(--muted);
  font-family: var(--font-display);
  font-size: 12px;
}

.timeline-no-blocks {
  position: absolute;
  left: 14px;
  top: 32px;
}

.timeline-empty-row {
  min-height: 84px;
  display: grid;
  place-items: center;
  border-bottom: 1px solid rgba(52, 82, 105, 0.12);
  background: rgba(255, 255, 255, 0.22);
}

body[data-theme="dark"] .bottom-tabs,
body[data-theme="dark"] .timeline-toolbar,
body[data-theme="dark"] .timeline-track-head,
body[data-theme="dark"] .timeline-empty-row {
  background: rgba(255, 255, 255, 0.08);
}

body[data-theme="dark"] .bottom-tab {
  border-color: rgba(221, 231, 239, 0.14);
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
}

body[data-theme="dark"] .bottom-tab:hover,
body[data-theme="dark"] .bottom-tab:focus-visible,
body[data-theme="dark"] .bottom-tab.is-active {
  background: rgba(255, 255, 255, 0.16);
  color: var(--text);
}

body[data-theme="dark"] .timeline-header,
body[data-theme="dark"] .timeline-driver-heading,
body[data-theme="dark"] .timeline-driver-cell {
  background: rgba(31, 38, 48, 0.96);
  color: var(--text);
}

body[data-theme="dark"] .timeline-toolbar strong,
body[data-theme="dark"] .timeline-tick-label {
  color: var(--text);
}

.splitter {
  position: relative;
  z-index: 3;
  border-radius: 8px;
}

.splitter::before {
  content: "";
  position: absolute;
  border-radius: 8px;
  background: rgba(52, 82, 105, 0.16);
}

.vertical-splitter {
  cursor: col-resize;
}

.left-splitter {
  grid-area: leftGrip;
}

.right-splitter {
  grid-area: rightGrip;
}

.vertical-splitter::before {
  left: 3px;
  top: 10px;
  bottom: 10px;
  width: 4px;
}

.horizontal-splitter {
  grid-area: bottomGrip;
  cursor: row-resize;
}

.horizontal-splitter::before {
  left: 10px;
  right: 10px;
  top: 3px;
  height: 4px;
}

.splitter:hover::before,
.splitter.is-dragging::before,
.splitter:focus-visible::before {
  background: var(--water-a);
}

.status-badge {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  border: 1px solid rgba(137, 166, 182, 0.44);
  border-radius: 8px;
  background: rgba(137, 166, 182, 0.18);
  color: var(--air-b);
  padding: 0 10px;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 500;
}

.status-panel h3 {
  margin-top: 18px;
  font-size: clamp(24px, 4vw, 36px);
}

.is-hidden {
  display: none;
}

@media (max-width: 820px) {
  .login-view {
    grid-template-columns: 1fr;
    align-content: center;
    gap: 26px;
    padding: 22px;
  }

  .brand-logo {
    width: min(300px, 82vw);
  }

  .workspace-view {
    padding: 10px;
  }

  .classic-menu {
    align-items: center;
    flex-direction: row;
  }

  .view-tabs {
    flex: 1 1 auto;
    overflow-x: auto;
  }

  .view-tab {
    flex: 0 0 auto;
    padding: 0 10px;
  }

  .workspace-content {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: auto auto minmax(320px, 1fr) auto;
    grid-template-areas:
      "left"
      "right"
      "center"
      "bottom";
    gap: 12px;
    overflow: hidden;
  }

  .splitter {
    display: none;
  }

  .left-panel,
  .right-panel,
  .bottom-panel {
    max-height: none;
  }

  .bottom-panel {
    min-height: 300px;
  }

  .bottom-tabs {
    overflow-x: auto;
  }

  .bottom-tab {
    flex: 0 0 auto;
    min-width: 112px;
  }

  .timeline-gantt {
    --timeline-driver-col: 128px;
  }

  .settings-workspace-panel {
    inset: 8px;
  }

  .settings-workspace-body {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
  }

  .settings-nav {
    border-right: 0;
    border-bottom: 1px solid rgba(52, 82, 105, 0.14);
    grid-auto-flow: column;
    grid-auto-columns: max-content;
    overflow-x: auto;
  }

  .settings-control-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .settings-control-grid {
    grid-template-columns: 1fr;
  }

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

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

  .depot-row {
    grid-template-columns: 18px minmax(0, 1fr);
  }

  .depot-row .settings-action-button {
    grid-column: 2;
    justify-self: start;
  }

  .driver-settings-table-head,
  .driver-settings-row {
    grid-template-columns: 46px 44px 72px minmax(170px, 1fr) 132px 88px 132px 56px;
    min-width: 840px;
  }
}
