:root {
    color-scheme: light;
    --bg: #f8f3ea;
    --bg-2: #eaf6ef;
    --panel: rgba(255, 253, 248, 0.86);
    --panel-strong: rgba(255, 253, 248, 0.96);
    --line: rgba(76, 65, 82, 0.16);
    --text: #2c2630;
    --muted: #756b79;
    --violet: #a991d6;
    --purple: #d6c5ef;
    --cyan: #8ed8d1;
    --turquoise: #78cbb5;
    --pink: #ee91aa;
    --amber: #f4c95d;
    --green: #7fcda7;
    --red: #e8798e;
    --shadow: 0 24px 70px rgba(96, 76, 60, 0.18);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
    box-sizing: border-box;
}

html,
body,
#app {
    min-height: 100%;
}

body {
    margin: 0;
    background:
        linear-gradient(135deg, #fbf6ec 0%, #eaf7ef 40%, #f8edf3 72%, #fff4d3 100%);
    color: var(--text);
    letter-spacing: 0;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select,
textarea {
    font: inherit;
}

button {
    cursor: pointer;
}

.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 32px;
}

.login-panel {
    width: min(420px, 100%);
    padding: 30px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: linear-gradient(160deg, rgba(255, 253, 248, 0.96), rgba(238, 246, 236, 0.82));
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

.brand-mark {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 26px;
}

.brand-badge {
    width: 46px;
    height: 46px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    font-weight: 900;
    color: var(--text);
    background: linear-gradient(135deg, var(--cyan), var(--amber), var(--pink));
    box-shadow: 0 12px 32px rgba(169, 145, 214, 0.22);
}

.brand-title {
    font-size: 26px;
    font-weight: 900;
    line-height: 1;
}

.brand-subtitle {
    color: var(--muted);
    font-size: 13px;
    margin-top: 5px;
}

.form-grid {
    display: grid;
    gap: 14px;
}

.field {
    display: grid;
    gap: 7px;
}

.address-field {
    position: relative;
}

.combobox-field {
    position: relative;
}

.field label {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.input,
.select,
.textarea {
    width: 100%;
    border: 1px solid rgba(76, 65, 82, 0.18);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.68);
    color: var(--text);
    outline: none;
    padding: 12px 13px;
}

.textarea {
    min-height: 92px;
    resize: vertical;
}

.input:focus,
.select:focus,
.textarea:focus {
    border-color: var(--cyan);
    box-shadow: 0 0 0 3px rgba(142, 216, 209, 0.26);
}

.select option {
    color: var(--text);
}

.address-suggestions {
    position: absolute;
    z-index: 90;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    display: grid;
    overflow: hidden;
    max-height: 260px;
    overflow-y: auto;
    border: 1px solid rgba(120, 203, 181, 0.38);
    border-radius: 8px;
    background: #fffaf4;
    box-shadow: 0 18px 42px rgba(96, 76, 60, 0.20);
}

.address-suggestion {
    border: 0;
    border-bottom: 1px solid rgba(76, 65, 82, 0.10);
    padding: 11px 12px;
    color: var(--text);
    background: transparent;
    font: inherit;
    text-align: left;
}

.address-suggestion:hover,
.address-suggestion:focus {
    background: rgba(120, 203, 181, 0.16);
    outline: none;
}

.empty-suggestion {
    color: var(--muted);
    cursor: default;
}

.combobox-options {
    position: absolute;
    z-index: 95;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    display: grid;
    max-height: 290px;
    overflow-y: auto;
    border: 1px solid rgba(120, 203, 181, 0.38);
    border-radius: 8px;
    background: #fffaf4;
    box-shadow: 0 18px 42px rgba(96, 76, 60, 0.20);
}

.combobox-option {
    display: grid;
    gap: 3px;
    width: 100%;
    border: 0;
    border-bottom: 1px solid rgba(76, 65, 82, 0.10);
    padding: 11px 12px;
    color: var(--text);
    background: transparent;
    font: inherit;
    text-align: left;
}

.combobox-option span {
    color: var(--muted);
    font-size: 13px;
}

.combobox-option:hover,
.combobox-option:focus {
    background: rgba(120, 203, 181, 0.16);
    outline: none;
}

.button {
    border: 0;
    border-radius: 8px;
    padding: 12px 16px;
    color: var(--text);
    font-weight: 850;
    background: linear-gradient(135deg, var(--cyan), var(--purple), var(--pink));
    box-shadow: 0 12px 28px rgba(169, 145, 214, 0.22);
}

.button.secondary {
    color: var(--text);
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid var(--line);
    box-shadow: none;
}

.button.danger {
    color: var(--text);
    background: rgba(232, 121, 142, 0.22);
    border: 1px solid rgba(232, 121, 142, 0.38);
}

.button.small {
    padding: 8px 10px;
    font-size: 13px;
}

.remember-row {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--muted);
    font-weight: 800;
}

.remember-row input {
    width: 18px;
    height: 18px;
    accent-color: var(--cyan);
}

.error,
.notice {
    border-radius: 8px;
    padding: 10px 12px;
    display: none;
    font-size: 14px;
}

.error {
    color: #7a2636;
    background: rgba(232, 121, 142, 0.16);
    border: 1px solid rgba(232, 121, 142, 0.28);
}

.notice {
    color: #2f6656;
    background: rgba(120, 203, 181, 0.16);
    border: 1px solid rgba(120, 203, 181, 0.30);
}

.fare-estimate {
    display: grid;
    gap: 4px;
    border: 1px solid rgba(120, 203, 181, 0.34);
    border-radius: 8px;
    padding: 13px 15px;
    background: linear-gradient(135deg, rgba(157, 219, 211, 0.24), rgba(236, 166, 199, 0.14));
}

.fare-estimate-label {
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.fare-estimate-value {
    color: var(--text);
    font-size: 22px;
    font-weight: 950;
}

.fare-estimate-meta {
    color: var(--muted);
    font-size: 13px;
    font-weight: 760;
}

.fare-estimate.is-loading {
    opacity: 0.78;
}

.fare-estimate.is-ready {
    border-color: rgba(120, 203, 181, 0.62);
    background: linear-gradient(135deg, rgba(157, 219, 211, 0.36), rgba(244, 210, 127, 0.18));
}

.fare-estimate.is-error {
    border-color: rgba(232, 121, 142, 0.46);
    background: rgba(232, 121, 142, 0.08);
}

.dashboard-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 270px 1fr;
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 22px;
    border-right: 1px solid var(--line);
    background: rgba(255, 250, 244, 0.80);
    backdrop-filter: blur(18px);
}

.sidebar .brand-mark {
    margin-bottom: 24px;
}

.nav {
    display: grid;
    gap: 7px;
}

.nav-section {
    margin: 12px 0 4px;
    color: #8a7897;
    font-size: 11px;
    text-transform: uppercase;
    font-weight: 850;
}

.nav-link {
    min-height: 42px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 11px;
    border-radius: 8px;
    color: var(--muted);
    border: 1px solid transparent;
}

.nav-link:hover,
.nav-link.active {
    color: var(--text);
    background: rgba(238, 145, 170, 0.12);
    border-color: rgba(169, 145, 214, 0.22);
}

.nav-dot {
    width: 8px;
    height: 8px;
    border-radius: 99px;
    background: linear-gradient(135deg, var(--cyan), var(--pink));
}

.main {
    min-width: 0;
    padding: 24px;
}

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

.page-title {
    font-size: clamp(24px, 3vw, 38px);
    font-weight: 900;
    margin: 0;
}

.page-kicker {
    color: var(--muted);
    margin-top: 5px;
}

.user-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 11px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.58);
}

.avatar {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--purple), var(--turquoise), var(--amber));
    display: grid;
    place-items: center;
    color: var(--text);
    font-weight: 900;
}

.grid {
    display: grid;
    gap: 16px;
}

.grid.two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid.four {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.stacked-layout {
    display: grid;
    gap: 16px;
}

.panel,
.card {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    box-shadow: 0 18px 52px rgba(96, 76, 60, 0.14);
    backdrop-filter: blur(16px);
}

.panel {
    padding: 18px;
}

.accordion-body {
    min-width: 0;
}

.panel.is-collapsed .panel-title {
    margin-bottom: 0;
}

.card {
    padding: 15px;
    min-width: 0;
}

.stat-card {
    display: grid;
    gap: 6px;
    min-height: 108px;
    border: 1px solid rgba(76, 65, 82, 0.14);
    border-radius: 8px;
    padding: 16px;
    background:
        linear-gradient(135deg, rgba(169, 145, 214, 0.34), rgba(120, 203, 181, 0.20), rgba(244, 201, 93, 0.20)),
        rgba(255, 255, 255, 0.64);
}

.stat-card.clickable {
    cursor: pointer;
}

.stat-label {
    color: var(--muted);
    font-size: 13px;
    font-weight: 750;
}

.stat-value {
    font-size: 36px;
    line-height: 1;
    font-weight: 950;
}

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

.panel-title h2,
.panel-title h3 {
    margin: 0;
    font-size: 18px;
}

.panel[data-accordion-ready="1"] > .panel-title {
    cursor: pointer;
}

.panel[data-accordion-ready="1"] > .panel-title input,
.panel[data-accordion-ready="1"] > .panel-title select,
.panel[data-accordion-ready="1"] > .panel-title textarea {
    cursor: auto;
}

.panel[data-accordion-ready="1"] > .panel-title button {
    cursor: pointer;
}

.accordion-toggle {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    margin-left: auto;
    display: grid;
    place-items: center;
    border: 1px solid rgba(76, 65, 82, 0.16);
    border-radius: 8px;
    color: var(--text);
    background: rgba(255, 255, 255, 0.62);
    box-shadow: none;
}

.accordion-toggle:hover,
.accordion-toggle:focus {
    outline: none;
    border-color: rgba(120, 203, 181, 0.52);
    background: rgba(120, 203, 181, 0.14);
}

.accordion-toggle-icon {
    width: 9px;
    height: 9px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: translateY(-2px) rotate(45deg);
    transition: transform 0.16s ease;
}

.panel.is-collapsed .accordion-toggle-icon {
    transform: translateX(-1px) rotate(-45deg);
}

.toolbar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: end;
}

.toolbar .field {
    min-width: min(230px, 100%);
}

.compact-input {
    max-width: 260px;
}

.map-shell {
    position: relative;
    min-height: 430px;
}

.start-layout {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-areas:
        "map map"
        "order message";
    gap: 16px;
    margin-top: 16px;
}

.start-map-panel {
    grid-area: map;
}

.start-order-panel {
    grid-area: order;
}

.start-message-panel {
    grid-area: message;
}

.start-map-search {
    width: min(420px, 42vw);
}

.start-map-panel .map-shell,
.start-map-panel .map,
.start-map-panel .map .leaflet-container {
    min-height: clamp(430px, 32vw, 560px);
}

#stat-grid + .split {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-areas:
        "legacy-map legacy-map"
        "legacy-actions legacy-actions";
}

#stat-grid + .split > .panel:first-child {
    grid-area: legacy-map;
}

#stat-grid + .split > .grid {
    grid-area: legacy-actions;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
}

#stat-grid + .split > .panel:first-child .map-shell,
#stat-grid + .split > .panel:first-child .map,
#stat-grid + .split > .panel:first-child .map .leaflet-container {
    min-height: clamp(430px, 32vw, 560px);
}

.map-shell.is-expanded {
    position: fixed;
    inset: 0;
    z-index: 120;
    width: 100vw;
    height: 100vh;
    min-height: 0;
    padding: 0;
    border-radius: 0;
    background: rgba(250, 246, 238, 0.96);
    box-shadow: none;
}

.map-shell:fullscreen {
    width: 100vw;
    height: 100vh;
    min-height: 0;
    border-radius: 0;
    background: rgba(250, 246, 238, 0.96);
}

.live-map-expanded {
    overflow: hidden;
}

.map {
    position: relative;
    min-height: 430px;
    height: 100%;
    overflow: hidden;
    border-radius: 8px;
    border: 1px solid rgba(76, 65, 82, 0.14);
    background: rgba(245, 248, 239, 0.92);
}

.map .leaflet-container {
    min-height: 430px;
    height: 100%;
    border-radius: inherit;
}

.map-shell.is-expanded .map,
.map-shell.is-expanded .map .leaflet-container,
.map-shell:fullscreen .map,
.map-shell:fullscreen .map .leaflet-container {
    min-height: 0;
    border-radius: 0;
}

.map-shell.is-expanded .map,
.map-shell:fullscreen .map {
    border: 0;
}

.map-toggle {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 1001;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    border: 1px solid rgba(76, 65, 82, 0.18);
    border-radius: 8px;
    padding: 9px 11px;
    color: var(--text);
    font-size: 13px;
    font-weight: 850;
    background: rgba(255, 253, 248, 0.86);
    box-shadow: 0 14px 34px rgba(96, 76, 60, 0.18);
    backdrop-filter: blur(12px);
}

.map-toggle:hover,
.map-toggle:focus {
    outline: none;
    border-color: rgba(120, 203, 181, 0.56);
    background: rgba(255, 253, 248, 0.98);
}

.map-toggle-icon {
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
    background:
        linear-gradient(currentColor, currentColor) left top / 7px 2px no-repeat,
        linear-gradient(currentColor, currentColor) left top / 2px 7px no-repeat,
        linear-gradient(currentColor, currentColor) right top / 7px 2px no-repeat,
        linear-gradient(currentColor, currentColor) right top / 2px 7px no-repeat,
        linear-gradient(currentColor, currentColor) left bottom / 7px 2px no-repeat,
        linear-gradient(currentColor, currentColor) left bottom / 2px 7px no-repeat,
        linear-gradient(currentColor, currentColor) right bottom / 7px 2px no-repeat,
        linear-gradient(currentColor, currentColor) right bottom / 2px 7px no-repeat;
}

.map-empty {
    height: 430px;
    display: grid;
    place-items: center;
}

.leaflet-taxi-marker {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 8px;
    color: var(--text);
    font-weight: 950;
    font-size: 19px;
    border: 2px solid rgba(255, 255, 255, 0.86);
    box-shadow: 0 12px 24px rgba(96, 76, 60, 0.24);
}

.leaflet-taxi-marker.free {
    background: var(--turquoise);
}

.leaflet-taxi-marker.occupied {
    background: var(--pink);
}

.leaflet-taxi-marker.paused {
    background: var(--amber);
}

.leaflet-taxi-marker.offline {
    background: #c8ced8;
}

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

.list {
    display: grid;
    gap: 11px;
}

.row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 13px;
    border: 1px solid rgba(76, 65, 82, 0.12);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.54);
}

.row-title {
    font-weight: 850;
}

.row-meta {
    color: var(--muted);
    font-size: 13px;
    margin-top: 4px;
}

.badge {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 4px 8px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 850;
    border: 1px solid rgba(76, 65, 82, 0.13);
    color: var(--text);
}

.badge.free,
.badge.ok {
    background: rgba(127, 205, 167, 0.24);
    color: #2d6a53;
}

.badge.occupied,
.badge.exceeded {
    background: rgba(232, 121, 142, 0.20);
    color: #8c3143;
}

.badge.paused,
.badge.near_limit {
    background: rgba(244, 201, 93, 0.28);
    color: #72571b;
}

.badge.offline {
    background: rgba(148, 163, 184, 0.22);
    color: #4f5c6c;
}

.badge.new {
    background: rgba(142, 216, 209, 0.24);
    color: #2d6a68;
}

.badge.assigned,
.badge.active {
    background: rgba(169, 145, 214, 0.24);
    color: #5e4f83;
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
}

th,
td {
    text-align: left;
    padding: 12px;
    border-bottom: 1px solid rgba(76, 65, 82, 0.10);
    vertical-align: top;
}

th {
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
}

.driver-table th:last-child,
.driver-table td:last-child,
.company-table th:last-child,
.company-table td:last-child,
.vehicle-table th:last-child,
.vehicle-table td:last-child,
.user-table th:last-child,
.user-table td:last-child {
    width: 190px;
}

.company-table {
    min-width: 1040px;
}

.vehicle-table {
    min-width: 980px;
}

.user-table {
    min-width: 920px;
}

.customer-company-table {
    min-width: 1040px;
}

.customer-order-table {
    min-width: 1260px;
}

.customer-order-table td:nth-child(4),
.customer-order-table td:nth-child(5) {
    max-width: 280px;
    overflow-wrap: anywhere;
}

.report-table {
    min-width: 900px;
}

.route-summary-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.route-summary-card {
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 14px;
    background: rgba(255, 253, 248, 0.58);
}

.route-summary-card h3 {
    margin-bottom: 8px;
}

.route-addresses {
    display: grid;
    gap: 2px;
    margin: 14px 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0 14px;
    background: rgba(255, 253, 248, 0.48);
}

.route-map {
    min-height: 380px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(245, 248, 239, 0.92);
}

.route-map .leaflet-container {
    min-height: 380px;
    height: 100%;
}

.route-map-empty {
    display: grid;
    place-items: center;
    padding: 20px;
}

.table-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    align-items: center;
}

.pager {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    padding-top: 12px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.button:disabled {
    cursor: not-allowed;
    opacity: 0.45;
}

.detail-list {
    display: grid;
    min-width: 0;
}

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

.driver-modal-grid.single {
    grid-template-columns: minmax(0, 1fr);
}

.driver-detail-card {
    overflow: hidden;
}

.driver-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}

.driver-actions .button {
    flex: 1 1 160px;
}

.driver-action-panel {
    min-width: 0;
}

.driver-inline-form {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid rgba(76, 65, 82, 0.10);
}

.detail-row {
    display: grid;
    grid-template-columns: minmax(120px, 0.9fr) minmax(0, 1.1fr);
    align-items: center;
    gap: 16px;
    min-width: 0;
    padding: 12px 0;
    border-bottom: 1px solid rgba(76, 65, 82, 0.10);
}

.detail-label {
    min-width: 0;
    color: var(--muted);
    font-size: 12px;
    font-weight: 850;
    text-transform: uppercase;
    overflow-wrap: anywhere;
}

.detail-value {
    min-width: 0;
    text-align: right;
    font-size: 16px;
    font-weight: 650;
    overflow-wrap: anywhere;
}

.split {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(340px, 0.85fr);
    gap: 16px;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 160;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(44, 38, 48, 0.36);
}

.modal {
    width: min(840px, 100%);
    max-height: min(780px, calc(100vh - 40px));
    overflow: auto;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: var(--panel-strong);
    box-shadow: var(--shadow);
    padding: 18px;
}

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

.order-card.active-order {
    border-color: rgba(120, 203, 181, 0.55);
    box-shadow: 0 0 0 3px rgba(120, 203, 181, 0.13);
}

.order-card.needs-dispatch {
    border-color: rgba(232, 121, 142, 0.55);
    box-shadow: 0 0 0 3px rgba(232, 121, 142, 0.14);
    background: rgba(232, 121, 142, 0.08);
}

.order-card.needs-dispatch .row-title {
    color: #8c3143;
}

.report-card {
    min-height: 132px;
    display: grid;
    align-content: space-between;
}

.muted {
    color: var(--muted);
}

.empty {
    color: var(--muted);
    padding: 18px;
    text-align: center;
    border: 1px dashed rgba(76, 65, 82, 0.18);
    border-radius: 8px;
}

@media (max-width: 1050px) {
    .dashboard-shell,
    .split {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: relative;
        height: auto;
    }

    .grid.four,
    .grid.three {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .start-layout {
        grid-template-columns: 1fr;
        grid-template-areas:
            "map"
            "order"
            "message";
    }

    #stat-grid + .split {
        grid-template-columns: 1fr;
        grid-template-areas:
            "legacy-map"
            "legacy-actions";
    }

    #stat-grid + .split > .grid {
        grid-template-columns: 1fr;
    }

    .start-map-search {
        width: min(100%, 420px);
    }
}

@media (max-width: 680px) {
    .main,
    .sidebar,
    .login-page {
        padding: 16px;
    }

    .map-shell.is-expanded {
        inset: 0;
    }

    .topbar,
    .row {
        grid-template-columns: 1fr;
        display: grid;
    }

    .start-map-panel .panel-title {
        align-items: stretch;
        display: grid;
    }

    .start-map-search {
        width: 100%;
    }

    .start-map-panel .map-shell,
    .start-map-panel .map,
    .start-map-panel .map .leaflet-container {
        min-height: 360px;
    }

    .grid.two,
    .grid.three,
    .grid.four,
    .driver-modal-grid,
    .route-summary-grid {
        grid-template-columns: 1fr;
    }

    .detail-row {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .detail-value {
        text-align: left;
    }

    .toolbar {
        display: grid;
    }

    .toolbar .field {
        min-width: 0;
    }
}
