:root {
    --navy-950: #071827;
    --navy-900: #0f2942;
    --navy-800: #183b59;
    --navy-700: #245271;
    --orange: #f26a2e;
    --orange-dark: #d94d17;
    --orange-soft: #fff0e8;
    --blue: #2285b9;
    --green: #1f9d68;
    --green-soft: #eaf8f1;
    --red: #cf3f4f;
    --red-soft: #fff0f1;
    --amber: #d98416;
    --amber-soft: #fff7e8;
    --ink: #132536;
    --muted: #657585;
    --line: #dce4ea;
    --line-soft: #eaf0f4;
    --surface: #ffffff;
    --canvas: #f3f6f8;
    --shadow: 0 16px 38px rgba(15, 41, 66, .08);
    --shadow-sm: 0 6px 18px rgba(15, 41, 66, .07);
    --radius: 18px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { color-scheme: light; }
body {
    margin: 0;
    background: var(--canvas);
    color: var(--ink);
    font-family: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 14px;
    line-height: 1.55;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button, summary { -webkit-tap-highlight-color: transparent; }

.app-shell { min-height: 100vh; }
.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 20;
    display: flex;
    width: 264px;
    flex-direction: column;
    overflow-y: auto;
    padding: 28px 20px 22px;
    color: #fff;
    background:
        radial-gradient(circle at 10% 10%, rgba(72, 147, 187, .24), transparent 32%),
        linear-gradient(165deg, var(--navy-800), var(--navy-950) 78%);
}
.brand { display: inline-flex; align-items: center; gap: 12px; }
.brand > span:last-child { display: flex; flex-direction: column; }
.brand strong { font-size: 20px; line-height: 1.1; letter-spacing: -.4px; }
.brand small { margin-top: 4px; color: rgba(255,255,255,.6); font-size: 10px; font-weight: 700; letter-spacing: 1.4px; text-transform: uppercase; }
.brand-mark {
    position: relative;
    display: inline-flex;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 13px;
    background: var(--orange);
    box-shadow: 0 9px 24px rgba(242,106,46,.3);
}
.brand-mark::before, .brand-mark::after, .brand-mark span {
    position: absolute;
    content: "";
    width: 6px;
    border-radius: 999px;
    background: white;
    transform: rotate(38deg);
}
.brand-mark::before { height: 25px; left: 13px; top: 7px; }
.brand-mark::after { height: 18px; right: 12px; bottom: 7px; }
.brand-mark span { width: 4px; height: 9px; left: 20px; top: 18px; opacity: .7; }
.brand-mark.large { width: 54px; height: 54px; border-radius: 17px; }
.app-custom-logo {
    display: grid;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    place-items: center;
    overflow: hidden;
    padding: 3px;
    border-radius: 13px;
    background: rgba(255,255,255,.96);
    box-shadow: 0 9px 24px rgba(7,24,39,.22);
}
.app-custom-logo img { display: block; width: 100%; height: 100%; object-fit: contain; }

.nav-caption { margin: 55px 12px 12px; color: rgba(255,255,255,.43); font-size: 10px; font-weight: 800; letter-spacing: 1.6px; text-transform: uppercase; }
.nav-caption.admin-caption { margin-top: 22px; }
.main-nav { display: grid; gap: 7px; }
.main-nav a { display: flex; align-items: center; gap: 12px; padding: 13px 12px; border-radius: 14px; color: rgba(255,255,255,.74); transition: .2s ease; }
.main-nav a:hover { color: #fff; background: rgba(255,255,255,.06); }
.main-nav a.active { color: #fff; background: rgba(255,255,255,.12); box-shadow: inset 3px 0 var(--orange); }
.main-nav a > span:last-child { display: flex; min-width: 0; flex-direction: column; }
.main-nav strong { font-size: 13px; }
.main-nav small { color: rgba(255,255,255,.45); font-size: 10px; white-space: nowrap; }
.nav-icon { display: grid; width: 34px; height: 34px; flex: 0 0 34px; place-items: center; border: 1px solid rgba(255,255,255,.18); border-radius: 11px; font-weight: 800; }
.active .nav-icon { border-color: transparent; color: var(--navy-900); background: #fff; }
.sidebar-foot { margin-top: auto; padding-top: 22px; border-top: 1px solid rgba(255,255,255,.1); }
.user-chip { display: flex; min-width: 0; align-items: center; gap: 10px; }
.user-chip > span { display: grid; width: 36px; height: 36px; flex: 0 0 36px; place-items: center; border-radius: 50%; color: var(--navy-900); background: #fff; font-weight: 800; }
.user-chip div { display: flex; min-width: 0; flex-direction: column; }
.user-chip strong, .user-chip small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip strong { font-size: 12px; }
.user-chip small { color: rgba(255,255,255,.5); font-size: 9px; }
.logout-button { width: 100%; margin-top: 14px; padding: 8px; border: 0; color: rgba(255,255,255,.55); background: transparent; font-size: 11px; cursor: pointer; }
.logout-button:hover { color: #fff; }

.content-shell { min-height: 100vh; margin-left: 264px; }
.page-content { width: min(100%, 1460px); margin: 0 auto; padding: 44px 42px 64px; }
.mobile-header, .bottom-nav { display: none; }

.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 26px; }
.page-header.compact { align-items: flex-start; }
.page-header h1 { margin: 3px 0 5px; font-size: clamp(28px, 3vw, 39px); line-height: 1.15; letter-spacing: -1.4px; }
.page-header p { max-width: 680px; margin: 0; color: var(--muted); }
.page-header-actions { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 9px; }
.eyebrow { display: block; color: var(--orange-dark); font-size: 10px; font-weight: 800; letter-spacing: 1.7px; text-transform: uppercase; }
.eyebrow.light { color: #ffb895; }
.back-link { display: block; margin-bottom: 12px; color: var(--navy-700); font-size: 12px; font-weight: 700; }

.button { display: inline-flex; min-height: 42px; align-items: center; justify-content: center; gap: 8px; padding: 10px 17px; border: 1px solid transparent; border-radius: 12px; font-size: 12px; font-weight: 800; cursor: pointer; transition: transform .15s ease, box-shadow .15s ease, background .15s ease; }
.button:hover { transform: translateY(-1px); }
.button-primary { color: #fff; background: var(--orange); box-shadow: 0 9px 19px rgba(242,106,46,.22); }
.button-primary:hover { background: var(--orange-dark); }
.button-secondary { border-color: var(--line); color: var(--navy-800); background: #fff; }
.button-danger-ghost { border-color: #f3cdd1; color: var(--red); background: #fff; }
.button-block { width: 100%; }
.text-link { padding: 8px; color: var(--navy-700); font-size: 12px; font-weight: 700; }

.flash { margin-bottom: 20px; padding: 14px 17px; border-radius: 13px; box-shadow: var(--shadow-sm); }
.flash-success { border: 1px solid #ccebdd; color: #176a49; background: var(--green-soft); }
.flash-error { border: 1px solid #f4cdd2; color: #8f2331; background: var(--red-soft); }
.flash ul { margin: 6px 0 0; padding-left: 18px; }

.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 22px; }
.stat-card { position: relative; min-height: 126px; overflow: hidden; padding: 20px; border: 1px solid var(--line-soft); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
.stat-card::after { position: absolute; right: -19px; bottom: -27px; width: 84px; height: 84px; border-radius: 50%; content: ""; background: currentColor; opacity: .07; }
.stat-card span, .stat-card small { display: block; color: var(--muted); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .7px; }
.stat-card strong { display: block; margin: 7px 0 0; font-size: 31px; line-height: 1.1; }
.stat-card small { margin-top: 5px; text-transform: none; letter-spacing: 0; font-weight: 500; }
.stat-card.navy { color: var(--navy-900); }
.stat-card.red { color: var(--red); }
.stat-card.orange { color: var(--amber); }
.stat-card.blue { color: var(--blue); }

.toolbar { display: flex; align-items: center; gap: 10px; margin: 0 0 20px; padding: 11px; border: 1px solid var(--line-soft); border-radius: 15px; background: rgba(255,255,255,.74); }
.toolbar.wrap { flex-wrap: wrap; }
.search-box { display: flex; min-width: 240px; flex: 1; align-items: center; gap: 8px; padding: 0 12px; border: 1px solid var(--line); border-radius: 11px; background: #fff; }
.search-box span { color: var(--muted); font-size: 22px; line-height: 1; }
.search-box input { width: 100%; height: 40px; border: 0; outline: 0; color: var(--ink); background: transparent; }
.select-box select { height: 42px; padding: 0 34px 0 12px; border: 1px solid var(--line); border-radius: 11px; color: var(--ink); background: #fff; }

.record-list { display: grid; gap: 15px; }
.record-card { padding: 22px; border: 1px solid var(--line-soft); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
.record-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.record-card h2 { margin: 0; font-size: 17px; line-height: 1.25; }
.record-card p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.person-title { display: flex; align-items: center; gap: 12px; }
.avatar { display: grid; width: 44px; height: 44px; flex: 0 0 44px; place-items: center; border-radius: 13px; color: #fff; background: var(--navy-800); font-size: 16px; font-weight: 800; }
.status-badge { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 5px; padding: 6px 9px; border-radius: 999px; font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .35px; }
.status-badge.good { color: #176c49; background: var(--green-soft); }
.status-badge.warning { color: #96600b; background: var(--amber-soft); }
.status-badge.critical, .status-badge.expired { color: #9a2837; background: var(--red-soft); }
.status-badge.missing { color: #657585; background: #eef2f5; }
.region-badge { display: inline-flex; align-items: center; padding: 4px 7px; border: 1px solid #c9dbe5; border-radius: 999px; color: var(--navy-700); background: #edf6fa; font-size: 8px; font-weight: 800; letter-spacing: .3px; text-transform: uppercase; white-space: nowrap; }
.region-badge-list { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.title-with-region { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }

.deadline-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 18px; }
.deadline-item { position: relative; min-width: 0; padding: 11px 12px 11px 15px; border: 1px solid var(--line-soft); border-radius: 11px; background: #fbfcfd; }
.deadline-item::before { position: absolute; inset: 10px auto 10px 0; width: 3px; border-radius: 3px; content: ""; background: #aab6bf; }
.deadline-item.good::before { background: var(--green); }
.deadline-item.warning::before { background: var(--amber); }
.deadline-item.critical::before, .deadline-item.expired::before { background: var(--red); }
.deadline-item span, .deadline-item small { display: block; overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.deadline-item strong { display: block; margin: 2px 0; font-size: 12px; }
.deadline-item.expired small, .deadline-item.critical small { color: var(--red); }
.deadline-item.warning small { color: var(--amber); }
.deadline-item.good small { color: var(--green); }
.source-dates { margin-top: 12px; padding: 0 4px; }
.source-dates summary { color: var(--navy-700); font-size: 10px; font-weight: 700; cursor: pointer; }
.source-dates > div { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 10px; padding: 12px; border-radius: 10px; color: var(--muted); background: #f6f8fa; font-size: 10px; }
.source-dates b { margin-left: 4px; color: var(--ink); }
.record-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 15px; padding-top: 15px; border-top: 1px solid var(--line-soft); }
.record-actions form { margin: 0; }

.quick-add { position: relative; }
.quick-add > summary { list-style: none; }
.quick-add > summary::-webkit-details-marker { display: none; }
.quick-add[open] > form { display: grid; }
.quick-add > form { position: absolute; z-index: 8; top: 52px; right: 0; display: none; width: 300px; gap: 12px; padding: 18px; border: 1px solid var(--line); border-radius: 15px; background: #fff; box-shadow: var(--shadow); }
.vehicle-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; }
.vehicle-card { padding: 20px; border: 1px solid var(--line-soft); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow-sm); }
.vehicle-card-head { display: block; }
.vehicle-card-identity { min-width: 0; width: 100%; }
.plate-date-line { display: flex; align-items: stretch; flex-wrap: wrap; gap: 8px; }
.vehicle-check-date { display: inline-flex; min-height: 25px; align-items: center; gap: 6px; padding: 4px 8px; border: 1px solid #dbe3e8; border-radius: 7px; color: var(--navy-800); background: #f6f8fa; line-height: 1; }
.vehicle-check-date small { color: var(--muted); font-size: 8px; font-weight: 700; text-transform: uppercase; }
.vehicle-check-date time, .vehicle-check-date strong { font-size: 10px; font-weight: 800; white-space: nowrap; }
.vehicle-check-date strong { color: #82909b; }
.vehicle-check-date.good { border-color: #ccebdd; color: #176c49; background: var(--green-soft); }
.vehicle-check-date.warning { border-color: #f2d49b; color: #96600b; background: var(--amber-soft); }
.vehicle-check-date.critical, .vehicle-check-date.expired { border-color: #f4cdd2; color: #9a2837; background: var(--red-soft); }
.vehicle-model-line { display: flex; min-height: 25px; align-items: center; justify-content: space-between; gap: 8px; margin-top: 9px; }
.plate { display: inline-flex; padding: 4px 8px; border: 2px solid #151a1e; border-radius: 6px; color: #111820; background: #fff; font-family: "Manrope", sans-serif; font-size: 13px; font-weight: 800; letter-spacing: .5px; line-height: 1; box-shadow: inset 0 0 0 2px #f6f6f6; }
.plate.large { margin: 8px 0 10px; padding: 7px 12px; font-size: 16px; }
.vehicle-card h2 { margin: 0; font-size: 13px; }
.progress-head { display: flex; justify-content: space-between; margin: 19px 0 6px; color: var(--muted); font-size: 10px; }
.progress-head strong { color: var(--navy-800); }
.progress { height: 7px; overflow: hidden; border-radius: 20px; background: #e7edf1; }
.progress i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--orange), #ff9c55); }
.kit-category-list { display: grid; gap: 7px; margin-top: 16px; }
.kit-category-list > div { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 8px; padding: 9px 10px; border-radius: 9px; background: #f7f9fa; font-size: 10px; }
.kit-category-list strong { color: var(--green); }
.kit-category-list small { min-width: 44px; color: var(--muted); text-align: right; }
.text-danger { color: var(--red) !important; }

.editor-card, .vehicle-edit-panel, .kit-editor, .danger-zone { border: 1px solid var(--line-soft); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow-sm); }
.form-section { padding: 24px; border-bottom: 1px solid var(--line-soft); }
.section-heading { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 18px; }
.section-heading > span { display: grid; width: 35px; height: 35px; flex: 0 0 35px; place-items: center; border-radius: 10px; color: #fff; background: var(--navy-800); font-size: 10px; font-weight: 800; }
.section-heading h2 { margin: 0; font-size: 16px; }
.section-heading p { margin: 2px 0 0; color: var(--muted); font-size: 10px; }
.form-grid { display: grid; gap: 15px; }
.form-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.form-grid.five { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.field { display: flex; min-width: 0; flex-direction: column; gap: 6px; }
.field > span { color: #405365; font-size: 10px; font-weight: 800; }
.field > span small { color: var(--muted); font-size: 9px; font-weight: 600; }
.field input, .field select, .field textarea { width: 100%; min-height: 43px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; outline: none; color: var(--ink); background: #fff; transition: border .15s, box-shadow .15s; }
.field textarea { resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: #77a8c6; box-shadow: 0 0 0 3px rgba(34,133,185,.1); }
.field > small { color: var(--muted); font-size: 8px; }
.static-field { justify-content: center; min-height: 69px; padding: 10px 12px; border: 1px dashed #b9cbd6; border-radius: 10px; background: #f6fafc; }
.static-field strong { font-size: 11px; }
.region-picker-field { grid-column: span 2; }
.region-multi-picker { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; padding: 8px; border: 1px solid var(--line); border-radius: 11px; background: #f7fafc; }
.region-multi-picker label { display: flex; min-width: 0; align-items: center; gap: 8px; padding: 8px 9px; border: 1px solid transparent; border-radius: 8px; color: #405365; background: #fff; cursor: pointer; font-size: 9px; font-weight: 700; }
.region-multi-picker label:has(input:checked) { border-color: #78abc7; color: var(--navy-800); background: #eaf6fb; box-shadow: 0 0 0 2px rgba(34,133,185,.08); }
.region-multi-picker input { width: 15px; min-height: 15px; margin: 0; accent-color: var(--orange); }
.region-multi-picker label span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.form-actions { display: flex; justify-content: flex-end; gap: 9px; padding: 20px 24px; }
.vehicle-edit-panel { margin-bottom: 15px; padding: 20px; }
.vehicle-edit-panel .button { align-self: end; }

.kit-editor { overflow: hidden; }
.checklist-section { padding: 24px; border-bottom: 1px solid var(--line-soft); }
.checklist-grid { display: grid; gap: 10px; }
.check-item { padding: 14px; border: 1px solid var(--line); border-left: 4px solid #b9c5cd; border-radius: 12px; background: #fcfdfe; }
.check-item[data-status="present"] { border-left-color: var(--green); }
.check-item[data-status="missing"], .check-item[data-status="expired"] { border-left-color: var(--red); }
.check-title { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 12px; }
.check-title > span { display: grid; width: 25px; height: 25px; flex: 0 0 25px; place-items: center; border-radius: 7px; color: var(--muted); background: #edf1f4; font-size: 8px; font-weight: 800; }
.check-title strong { font-size: 12px; }
.check-fields { grid-template-columns: 1.1fr .45fr 1fr 1fr 1.5fr; }
.field.notes { grid-column: auto; }
.sticky-actions { position: sticky; z-index: 5; bottom: 0; display: flex; justify-content: flex-end; gap: 9px; padding: 15px 24px; border-top: 1px solid var(--line); background: rgba(255,255,255,.94); backdrop-filter: blur(12px); }
.danger-zone { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 22px; padding: 20px; border-color: #f1cdd2; }
.danger-zone strong { color: var(--red); }
.danger-zone p { margin: 2px 0 0; color: var(--muted); font-size: 10px; }

.title-line { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; }
.season { display: inline-flex; padding: 5px 8px; border-radius: 999px; font-size: 9px; font-weight: 800; text-transform: uppercase; }
.season.summer { color: #9b5c00; background: #fff2cc; }
.season.winter { color: #246486; background: #e5f5fc; }
.season.all_season { color: #316c4f; background: #e9f7ef; }
.depth-ring { display: grid; width: 70px; height: 70px; flex: 0 0 70px; place-items: center; align-content: center; border: 6px solid #cfd8de; border-radius: 50%; line-height: 1; }
.depth-ring strong { font-size: 18px; }
.depth-ring small { margin-top: 3px; color: var(--muted); font-size: 8px; }
.depth-ring.good { border-color: #8dd8b7; }
.depth-ring.warning { border-color: #f1be70; }
.depth-ring.critical { border-color: #ef9da7; }
.tire-meta { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr 1fr; gap: 1px; overflow: hidden; margin-top: 18px; border: 1px solid var(--line-soft); border-radius: 11px; background: var(--line-soft); }
.tire-meta > div { min-width: 0; padding: 10px; background: #f9fbfc; }
.tire-meta span, .tire-meta small { display: block; color: var(--muted); font-size: 8px; }
.tire-meta strong { display: block; overflow: hidden; margin-top: 3px; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.tire-meta strong small { display: inline; }
.depth-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.depth-grid > div { padding: 10px; border-radius: 10px; text-align: center; background: var(--green-soft); }
.depth-grid > div.warning { background: var(--amber-soft); }
.depth-grid > div.critical { background: var(--red-soft); }
.depth-grid span { display: block; color: var(--muted); font-size: 8px; }
.depth-grid strong { font-size: 15px; }
.depth-grid small { margin-left: 2px; color: var(--muted); font-size: 8px; }
.record-note { padding: 10px 12px; border-radius: 10px; background: #f7f9fa; }

.pagination { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 22px; color: var(--muted); font-size: 10px; }
.pagination a, .pagination .disabled { padding: 8px 12px; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.pagination a { color: var(--navy-800); font-weight: 700; }
.pagination .disabled { opacity: .45; }
.empty-state { padding: 50px 20px; border: 1px dashed #bdcad2; border-radius: var(--radius); text-align: center; background: rgba(255,255,255,.65); }
.empty-state.full { grid-column: 1 / -1; }
.empty-state > span { display: grid; width: 50px; height: 50px; margin: 0 auto 12px; place-items: center; border-radius: 15px; color: #fff; background: var(--navy-800); font-weight: 800; }
.empty-state h2 { margin: 0; font-size: 17px; }
.empty-state p { margin: 5px 0 0; color: var(--muted); font-size: 11px; }

.dashboard-header { align-items: center; }
.dashboard-date { flex: 0 0 auto; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); background: rgba(255,255,255,.8); font-size: 10px; font-weight: 700; text-transform: capitalize; }
.dashboard-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.dashboard-module { position: relative; display: flex; min-height: 354px; flex-direction: column; overflow: hidden; padding: 22px; border: 1px solid var(--line-soft); border-radius: 22px; background: #fff; box-shadow: var(--shadow-sm); }
.dashboard-module::before { position: absolute; inset: 0 0 auto; height: 4px; content: ""; background: var(--module-color, var(--navy-800)); }
.drivers-module { --module-color: #2878a3; }
.kits-module { --module-color: var(--orange); }
.tires-module { --module-color: var(--green); }
.module-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.module-head > div { display: flex; align-items: center; gap: 11px; }
.module-head .module-icon { display: grid; width: 39px; height: 39px; flex: 0 0 39px; place-items: center; border-radius: 12px; color: #fff; background: var(--module-color); font-size: 13px; font-weight: 800; }
.module-head small { display: block; color: var(--muted); font-size: 8px; font-weight: 800; letter-spacing: .6px; text-transform: uppercase; }
.module-head h2 { margin: 1px 0 0; font-size: 16px; }
.module-head > a { color: var(--navy-700); font-size: 9px; font-weight: 800; white-space: nowrap; }
.module-primary { margin: 31px 0 24px; }
.module-primary strong { display: block; font-size: 46px; line-height: 1; letter-spacing: -2px; }
.module-primary span { color: var(--muted); font-size: 10px; }
.module-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.module-metrics > div { min-width: 0; padding: 11px 9px; border-radius: 10px; background: #f5f8fa; }
.module-metrics strong, .module-metrics span { display: block; }
.module-metrics strong { font-size: 17px; }
.module-metrics span { overflow: hidden; margin-top: 2px; color: var(--muted); font-size: 8px; line-height: 1.35; }
.module-metrics .warning { color: var(--amber); background: var(--amber-soft); }
.module-metrics .danger { color: var(--red); background: var(--red-soft); }
.module-action { display: flex; min-height: 40px; align-items: center; justify-content: center; margin-top: auto; padding: 9px 12px; border: 1px solid var(--line); border-radius: 11px; color: var(--navy-800); font-size: 10px; font-weight: 800; }
.module-action:hover { border-color: var(--module-color); color: var(--module-color); }
.admin-shortcuts { display: grid; grid-template-columns: minmax(260px, .7fr) minmax(0, 1.3fr); gap: 28px; margin-top: 22px; padding: 25px; border: 1px solid #d7e1e7; border-radius: 22px; background: linear-gradient(135deg, #eef4f7, #fff); }
.admin-shortcuts h2 { margin: 5px 0 6px; font-size: 21px; }
.admin-shortcuts p { margin: 0; color: var(--muted); font-size: 11px; }
.admin-shortcut-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.admin-shortcut-grid a { position: relative; display: grid; grid-template-columns: 36px 1fr; column-gap: 10px; align-content: center; padding: 16px; border: 1px solid var(--line-soft); border-radius: 14px; background: #fff; box-shadow: var(--shadow-sm); }
.shortcut-icon { display: grid; width: 36px; height: 36px; grid-row: span 3; place-items: center; border-radius: 10px; color: #fff; background: var(--navy-800); font-size: 11px; font-weight: 800; }
.admin-shortcut-grid strong { font-size: 12px; }
.admin-shortcut-grid small { color: var(--muted); font-size: 8px; }
.admin-shortcut-grid b { margin-top: 4px; color: var(--orange-dark); font-size: 8px; }
.dashboard-empty { min-height: 260px; display: grid; align-content: center; }

.user-list { display: grid; gap: 12px; }
.user-card { display: grid; grid-template-columns: minmax(240px, 1.15fr) minmax(220px, 1fr) auto; align-items: center; gap: 18px; padding: 18px 20px; border: 1px solid var(--line-soft); border-radius: 16px; background: #fff; box-shadow: var(--shadow-sm); }
.user-card-main { display: flex; min-width: 0; align-items: center; gap: 12px; }
.user-card-main > div { min-width: 0; }
.user-avatar { display: grid; width: 44px; height: 44px; flex: 0 0 44px; place-items: center; border-radius: 13px; color: #fff; background: var(--navy-800); font-weight: 800; }
.user-name-line { display: flex; min-width: 0; flex-wrap: wrap; align-items: center; gap: 6px; }
.user-name-line h2 { overflow: hidden; margin: 0; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.user-card-main p { overflow: hidden; margin: 3px 0 0; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.account-state, .admin-badge { display: inline-flex; padding: 4px 7px; border-radius: 999px; font-size: 7px; font-weight: 800; letter-spacing: .3px; text-transform: uppercase; }
.account-state.active { color: #176c49; background: var(--green-soft); }
.account-state.inactive { color: #8c2532; background: var(--red-soft); }
.admin-badge { color: #fff; background: var(--orange); }
.driver-badge { display: inline-flex; padding: 4px 7px; border-radius: 999px; color: #fff; background: var(--blue); font-size: 7px; font-weight: 800; letter-spacing: .3px; text-transform: uppercase; }
.permission-badges { display: flex; flex-wrap: wrap; gap: 5px; }
.permission-badges span { padding: 5px 7px; border-radius: 8px; color: var(--navy-700); background: #edf4f7; font-size: 8px; font-weight: 700; }
.permission-badges span.muted { color: var(--muted); background: #f2f4f5; }
.user-card-actions { display: flex; justify-content: flex-end; gap: 6px; }
.user-card-actions form { margin: 0; }
.user-editor { overflow: hidden; }
.toggle-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.toggle-card { display: flex; align-items: center; gap: 11px; padding: 16px; border: 1px solid var(--line); border-radius: 13px; background: #fbfcfd; cursor: pointer; }
.toggle-card input { width: 18px; height: 18px; accent-color: var(--green); }
.toggle-card.admin-toggle input { accent-color: var(--orange); }
.toggle-card.driver-toggle input { accent-color: var(--blue); }
.toggle-card span { display: flex; flex-direction: column; }
.toggle-card strong { font-size: 11px; }
.toggle-card small { margin-top: 2px; color: var(--muted); font-size: 8px; }
.role-region-grid { margin-top: 12px; }
.compact-toggle { min-height: 69px; padding: 11px 13px; }
.permission-picker { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.permission-picker label { position: relative; cursor: pointer; }
.permission-picker input { position: absolute; opacity: 0; pointer-events: none; }
.permission-picker span { display: flex; min-height: 88px; flex-direction: column; justify-content: center; padding: 15px; border: 1px solid var(--line); border-radius: 13px; background: #fff; transition: .15s ease; }
.permission-picker strong { font-size: 12px; }
.permission-picker small { margin-top: 3px; color: var(--muted); font-size: 8px; }
.permission-picker input:checked + span { border-color: #7ca8bf; background: #edf6fa; box-shadow: inset 0 0 0 1px #7ca8bf; }
.permission-picker input:focus-visible + span { outline: 3px solid rgba(34,133,185,.18); }

.trips-module { --module-color: #6f56b3; }
.trip-page-header { align-items: center; }
.start-trip-card, .active-trip-driver { overflow: hidden; padding: 24px; border: 1px solid var(--line-soft); border-radius: 22px; background: #fff; box-shadow: var(--shadow-sm); }
.driver-identity-card { display: flex; align-items: center; gap: 12px; margin: 22px 0; padding: 14px; border: 1px solid #d6e7ef; border-radius: 14px; background: #f2f8fb; }
.driver-identity-card > div { display: flex; flex-direction: column; }
.driver-identity-card small, .driver-identity-card span { color: var(--muted); font-size: 8px; }
.driver-identity-card strong { font-size: 14px; }
.trip-start-grid { align-items: start; }
.passenger-editor { margin-top: 22px; padding: 18px; border: 1px solid var(--line-soft); border-radius: 16px; background: #f8fafb; }
.passenger-editor-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.passenger-editor-head > div { display: flex; flex-direction: column; }
.passenger-editor-head strong { font-size: 13px; }
.passenger-editor-head small { color: var(--muted); font-size: 9px; }
.passenger-list { display: grid; gap: 8px; }
.passenger-row { display: grid; grid-template-columns: 1fr 38px; align-items: end; gap: 8px; }
.passenger-row > button { width: 38px; height: 42px; border: 1px solid #f0cbd0; border-radius: 10px; color: var(--red); background: #fff; font-size: 20px; cursor: pointer; }
.trip-start-button, .trip-finish-button { min-height: 52px; margin-top: 22px; font-size: 14px; }
.active-trip-driver { padding: 0; }
.active-trip-hero { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 26px; color: #fff; background: linear-gradient(135deg, #183b59, #0a2338); }
.active-trip-hero h2 { margin: 13px 0 3px; font-size: 34px; letter-spacing: -1px; }
.active-trip-hero p { max-width: 670px; margin: 0; color: rgba(255,255,255,.65); font-size: 11px; }
.live-pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 9px; border-radius: 999px; color: #176c49; background: #eaf8f1; font-size: 8px; font-weight: 800; letter-spacing: .3px; text-transform: uppercase; }
.live-pill i, .live-refresh i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(31,157,104,.14); animation: live-pulse 1.8s infinite; }
.trip-running-time { display: flex; min-width: 180px; flex-direction: column; align-items: flex-end; }
.trip-running-time small, .trip-running-time span { color: rgba(255,255,255,.55); font-size: 9px; }
.trip-running-time strong { font-size: 21px; }
.trip-passenger-summary { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; padding: 17px 26px; border-bottom: 1px solid var(--line-soft); }
.trip-passenger-summary > strong { margin-right: 5px; font-size: 11px; }
.trip-passenger-summary > span { padding: 5px 8px; border-radius: 8px; color: var(--navy-700); background: #eef4f7; font-size: 9px; }
.trip-passenger-summary > span.muted { color: var(--muted); }
.finish-trip-form { padding: 24px 26px 27px; }
.finish-trip-form .form-grid { margin-top: 20px; }
.driver-trip-history { margin-top: 28px; }
.section-title { display: flex; align-items: flex-end; justify-content: space-between; gap: 15px; margin-bottom: 14px; }
.section-title h2 { margin: 2px 0 0; font-size: 20px; }
.section-title > small { color: var(--muted); font-size: 9px; }
.trip-history-list { display: grid; gap: 10px; }
.trip-history-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 20px; padding: 16px 18px; border: 1px solid var(--line-soft); border-radius: 15px; background: #fff; box-shadow: var(--shadow-sm); }
.trip-history-route { display: grid; min-width: 0; grid-template-columns: 10px minmax(130px, 1fr) 28px minmax(130px, 1fr); align-items: center; gap: 9px; }
.trip-history-route > span { width: 9px; height: 9px; border: 2px solid var(--blue); border-radius: 50%; }
.trip-history-route > i { height: 1px; background: var(--line); }
.trip-history-route > div { min-width: 0; }
.trip-history-route small, .trip-history-route strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trip-history-route small { color: var(--muted); font-size: 8px; }
.trip-history-route strong { font-size: 11px; }
.trip-history-meta { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.trip-history-meta strong, .trip-history-meta span { padding: 5px 8px; border-radius: 8px; background: #f2f5f7; font-size: 8px; }
.trip-history-meta strong { color: #fff; background: var(--navy-800); }
.live-refresh { display: flex; align-items: flex-end; flex-direction: column; gap: 4px; }
.live-refresh > span { display: inline-flex; align-items: center; gap: 8px; color: #176c49; font-size: 11px; font-weight: 800; }
.live-refresh small { color: var(--muted); font-size: 8px; }
.trip-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.manager-trip-section { margin-top: 26px; }
.active-trip-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; }
.manager-trip-card { overflow: hidden; padding: 18px; border: 1px solid #cfe3dc; border-radius: 17px; background: #fff; box-shadow: var(--shadow-sm); }
.manager-trip-head { display: flex; align-items: center; gap: 10px; }
.manager-trip-head > div { min-width: 0; flex: 1; }
.manager-trip-head h3 { overflow: hidden; margin: 0; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.manager-trip-head p { margin: 2px 0 0; color: var(--muted); font-size: 8px; }
.live-dot { width: 10px; height: 10px; flex: 0 0 10px; border: 2px solid #fff; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.manager-trip-route { display: flex; min-height: 112px; flex-direction: column; justify-content: center; margin: 16px -18px; padding: 18px; border-block: 1px solid var(--line-soft); background: #f8fbfa; }
.manager-trip-route small, .manager-trip-route span { color: var(--muted); font-size: 8px; }
.manager-trip-route strong { margin: 4px 0; font-size: 14px; }
.manager-trip-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.manager-trip-metrics > div { padding: 9px; border-radius: 10px; background: #f3f6f8; }
.manager-trip-metrics small, .manager-trip-metrics strong { display: block; }
.manager-trip-metrics small { color: var(--muted); font-size: 8px; }
.manager-trip-metrics strong { font-size: 14px; }
.trip-passenger-details { margin-top: 11px; color: var(--navy-700); font-size: 8px; }
.trip-passenger-details summary { cursor: pointer; font-weight: 800; }
.trip-passenger-details div { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 7px; }
.trip-passenger-details span { padding: 4px 6px; border-radius: 6px; background: #edf4f7; }
.completed-trip-section { margin-top: 32px; }
.trip-filter-toolbar { display: grid; grid-template-columns: minmax(190px, 1.25fr) minmax(145px, .75fr) minmax(145px, .75fr) minmax(170px, 1fr) auto; align-items: end; gap: 10px; margin-bottom: 14px; padding: 15px; border: 1px solid var(--line-soft); border-radius: 15px; background: rgba(255,255,255,.8); }
.trip-filter-toolbar .field { min-width: 0; }
.trip-filter-actions { display: flex; gap: 7px; }
.trip-filter-actions .button { white-space: nowrap; }
.completed-trip-list { display: grid; gap: 8px; }
.completed-trip-row { display: grid; grid-template-columns: 1fr .7fr 1.8fr .8fr; align-items: center; gap: 15px; padding: 15px 17px; border: 1px solid var(--line-soft); border-radius: 14px; background: #fff; box-shadow: var(--shadow-sm); }
.completed-trip-row > div { min-width: 0; }
.completed-trip-row small, .completed-trip-row strong, .completed-trip-row span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.completed-trip-row small, .completed-trip-row span { color: var(--muted); font-size: 8px; }
.completed-trip-row strong { margin: 2px 0; font-size: 10px; }
@keyframes live-pulse { 50% { box-shadow: 0 0 0 7px rgba(31,157,104,0); } }

.region-create-card { display: grid; grid-template-columns: minmax(210px, .45fr) minmax(0, 1.55fr); gap: 24px; align-items: end; margin-bottom: 18px; padding: 21px; border: 1px solid var(--line-soft); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow-sm); }
.region-create-card h2 { margin: 0; font-size: 17px; }
.region-create-card p { margin: 4px 0 0; color: var(--muted); font-size: 10px; }
.region-create-grid { grid-template-columns: .7fr 1.2fr .8fr auto; align-items: end; }
.region-list { display: grid; gap: 10px; }
.region-card { display: flex; align-items: flex-end; gap: 8px; padding: 16px; border: 1px solid var(--line-soft); border-radius: 15px; background: #fff; box-shadow: var(--shadow-sm); }
.region-edit-form { display: grid; min-width: 0; flex: 1; grid-template-columns: 130px .7fr 1.25fr .7fr 1fr auto; align-items: end; gap: 10px; }
.region-code-block { display: flex; min-height: 69px; flex-direction: column; justify-content: center; align-items: flex-start; gap: 5px; }
.region-code-block small { color: var(--muted); font-size: 8px; }
.region-counts { display: flex; min-height: 69px; align-items: center; flex-wrap: wrap; gap: 6px; }
.region-counts span { padding: 6px 8px; border-radius: 8px; color: var(--muted); background: #f3f6f8; font-size: 8px; }
.region-counts strong { color: var(--ink); }

.settings-editor { overflow: hidden; }
.branding-editor { display: flex; align-items: center; gap: 18px; margin-bottom: 18px; padding: 16px; border: 1px solid var(--line-soft); border-radius: 14px; background: #f8fafb; }
.logo-preview { display: grid; width: 92px; height: 76px; flex: 0 0 92px; place-items: center; overflow: hidden; border: 1px solid var(--line); border-radius: 13px; background: var(--navy-900); }
.logo-preview img { display: block; max-width: 78px; max-height: 62px; object-fit: contain; }
.branding-fields { flex: 1; }
.remove-logo { margin: 10px 0 0; }
.login-custom-logo { display: grid; width: 70px; height: 58px; flex: 0 0 70px; place-items: center; overflow: hidden; border: 1px solid rgba(255,255,255,.15); border-radius: 14px; background: rgba(255,255,255,.08); }
.login-custom-logo img { display: block; max-width: 60px; max-height: 48px; object-fit: contain; }

.access-denied { max-width: 620px; margin: 9vh auto 0; padding: 50px 32px; border: 1px solid var(--line-soft); border-radius: 24px; text-align: center; background: #fff; box-shadow: var(--shadow); }
.access-denied > span { display: inline-flex; padding: 8px 13px; border-radius: 999px; color: var(--red); background: var(--red-soft); font-size: 12px; font-weight: 800; }
.access-denied h1 { margin: 17px 0 8px; font-size: 28px; }
.access-denied p { max-width: 480px; margin: 0 auto 22px; color: var(--muted); font-size: 11px; }

.login-page { display: grid; min-height: 100vh; grid-template-columns: minmax(420px, .9fr) minmax(480px, 1.1fr); background: #fff; }
.login-visual { position: relative; display: flex; min-height: 100vh; flex-direction: column; overflow: hidden; padding: 42px 50px; color: #fff; background: radial-gradient(circle at 20% 18%, #285f81, transparent 35%), linear-gradient(150deg, #173b58, #081b2b 72%); }
.login-brand { display: flex; align-items: center; gap: 13px; font-size: 22px; }
.login-copy { position: relative; z-index: 2; margin: auto 0; }
.login-copy h1 { margin: 11px 0 20px; font-size: clamp(48px, 6vw, 76px); line-height: .98; letter-spacing: -4px; }
.login-copy p { max-width: 470px; color: rgba(255,255,255,.68); font-size: 15px; }
.login-features { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 28px; }
.login-features span { padding: 7px 10px; border: 1px solid rgba(255,255,255,.13); border-radius: 999px; color: rgba(255,255,255,.7); background: rgba(255,255,255,.06); font-size: 9px; font-weight: 700; }
.road-art { position: absolute; right: -140px; bottom: -230px; width: 580px; height: 580px; border: 90px solid rgba(255,255,255,.035); border-radius: 50%; transform: rotate(-25deg); }
.road-art i { position: absolute; top: -81px; width: 75px; height: 7px; border-radius: 10px; background: rgba(255,255,255,.11); }
.road-art i:nth-child(1) { left: 40px; }.road-art i:nth-child(2) { left: 190px; }.road-art i:nth-child(3) { left: 340px; }
.login-panel { display: grid; min-height: 100vh; place-items: center; padding: 35px; }
.login-card { width: min(100%, 420px); }
.login-card h2 { margin: 8px 0 5px; font-size: 30px; letter-spacing: -1px; }
.login-card > p { margin: 0 0 30px; color: var(--muted); font-size: 12px; }
.login-card .field { margin-bottom: 16px; }
.check-field { display: flex; align-items: center; gap: 8px; margin: 5px 0 19px; color: var(--muted); font-size: 10px; }
.form-error { margin-bottom: 16px; padding: 11px 12px; border-radius: 10px; color: #922b38; background: var(--red-soft); font-size: 11px; }
.form-success { margin-bottom: 16px; padding: 11px 12px; border-radius: 10px; color: #176a49; background: var(--green-soft); font-size: 11px; }
.login-note { display: block; margin-top: 20px; color: #9aa6af; text-align: center; font-size: 9px; }
.otp-card > p strong { color: var(--navy-800); }
.otp-card form { margin: 0; }
.otp-input { text-align: center; font-size: 24px !important; font-weight: 800; letter-spacing: 10px; }
.otp-secondary-actions { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 14px; margin-top: 17px; }
.text-button { padding: 4px; border: 0; color: var(--navy-700); background: transparent; font-size: 9px; font-weight: 800; cursor: pointer; }
.text-button.muted { color: var(--muted); }
.text-button:disabled { opacity: .48; cursor: wait; }

@media (max-width: 1180px) {
    .dashboard-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dashboard-module:last-child:nth-child(odd) { grid-column: 1 / -1; }
    .user-card { grid-template-columns: minmax(220px, 1fr) minmax(180px, .8fr); }
    .user-card-actions { grid-column: 2; }
    .vehicle-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .deadline-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .form-grid.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .check-fields { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .field.notes { grid-column: span 2; }
    .tire-meta { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .region-create-card { grid-template-columns: 1fr; }
    .region-edit-form { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .active-trip-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .completed-trip-row { grid-template-columns: 1fr 1fr; }
    .region-code-block, .region-counts { min-height: auto; }
}

@media (max-width: 880px) {
    .sidebar { display: none; }
    .content-shell { margin-left: 0; }
    .mobile-header { position: sticky; z-index: 30; top: 0; display: flex; height: 66px; align-items: center; justify-content: space-between; padding: 0 20px; color: #fff; background: var(--navy-900); box-shadow: 0 7px 20px rgba(7,24,39,.2); }
    .mobile-header .brand strong { font-size: 15px; }
    .mobile-header .brand-mark { width: 34px; height: 34px; flex-basis: 34px; border-radius: 10px; transform: scale(.82); }
    .mobile-header .app-custom-logo { width: 34px; height: 34px; flex-basis: 34px; border-radius: 10px; }
    .mobile-header button { border: 0; color: rgba(255,255,255,.7); background: transparent; font-size: 10px; font-weight: 700; }
    .bottom-nav { position: fixed; z-index: 35; right: 12px; bottom: 12px; left: 12px; display: grid; grid-auto-columns: minmax(0, 1fr); grid-auto-flow: column; padding: 7px; border: 1px solid rgba(255,255,255,.15); border-radius: 18px; color: rgba(255,255,255,.62); background: rgba(10,31,48,.95); box-shadow: 0 12px 35px rgba(7,24,39,.3); backdrop-filter: blur(15px); }
    .bottom-nav a { display: flex; min-width: 0; flex-direction: column; align-items: center; gap: 2px; padding: 6px; border-radius: 12px; font-size: 8px; font-weight: 700; }
    .bottom-nav a span { display: grid; width: 26px; height: 26px; place-items: center; border-radius: 8px; font-size: 10px; }
    .bottom-nav a.active { color: #fff; background: rgba(255,255,255,.1); }
    .bottom-nav a.active span { color: var(--navy-900); background: #fff; }
    .page-content { padding: 28px 22px 105px; }
    .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .admin-shortcuts { grid-template-columns: 1fr; }
    .form-grid.five { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .trip-filter-toolbar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .trip-filter-actions { grid-column: 1 / -1; }
    .login-page { grid-template-columns: 1fr; background: var(--canvas); }
    .login-visual { min-height: 310px; padding: 28px; }
    .login-copy { margin: 48px 0 22px; }
    .login-copy h1 { font-size: 46px; letter-spacing: -2.5px; }
    .login-copy p, .login-features { display: none; }
    .login-panel { min-height: auto; padding: 34px 22px 55px; }
    .login-card { padding: 26px; border-radius: 18px; background: #fff; box-shadow: var(--shadow); }
}

@media (max-width: 640px) {
    .page-content { padding: 22px 14px 105px; }
    .page-header { align-items: flex-start; flex-direction: column; gap: 15px; margin-bottom: 20px; }
    .page-header > .button, .page-header > .quick-add, .quick-add > summary, .page-header-actions { width: 100%; }
    .page-header-actions .button, .page-header-actions .quick-add { flex: 1; }
    .quick-add > form { position: static; width: 100%; margin-top: 8px; }
    .page-header h1 { font-size: 30px; }
    .stats-grid { gap: 9px; }
    .dashboard-date { width: 100%; text-align: center; }
    .dashboard-grid { grid-template-columns: 1fr; }
    .dashboard-module:last-child:nth-child(odd) { grid-column: auto; }
    .dashboard-module { min-height: 330px; padding: 18px; border-radius: 17px; }
    .module-primary { margin: 24px 0 19px; }
    .admin-shortcuts { padding: 18px; }
    .admin-shortcut-grid { grid-template-columns: 1fr; }
    .stat-card { min-height: 110px; padding: 15px; border-radius: 14px; }
    .stat-card strong { font-size: 26px; }
    .toolbar { align-items: stretch; flex-wrap: wrap; }
    .search-box { min-width: 100%; }
    .toolbar .button { flex: 1; }
    .record-card { padding: 16px; border-radius: 15px; }
    .record-card-head { align-items: flex-start; }
    .person-title { align-items: flex-start; }
    .avatar { width: 38px; height: 38px; flex-basis: 38px; }
    .status-badge { max-width: 100px; text-align: center; white-space: normal; }
    .deadline-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
    .deadline-item { padding: 9px 8px 9px 11px; }
    .vehicle-grid { grid-template-columns: 1fr; }
    .user-card { grid-template-columns: 1fr; align-items: flex-start; padding: 16px; }
    .permission-badges, .user-card-actions { grid-column: auto; }
    .user-card-actions { width: 100%; }
    .user-card-actions .button { flex: 1; }
    .user-card-actions form { display: flex; flex: 1; }
    .user-card-actions form .button { width: 100%; }
    .toggle-grid, .permission-picker { grid-template-columns: 1fr; }
    .passenger-editor-head, .active-trip-hero { align-items: flex-start; flex-direction: column; }
    .passenger-editor-head .button { width: 100%; }
    .trip-running-time { align-items: flex-start; }
    .trip-history-card { grid-template-columns: 1fr; }
    .trip-history-route { grid-template-columns: 10px 1fr; }
    .trip-history-route > i { display: none; }
    .trip-history-meta { justify-content: flex-start; }
    .trip-stats, .active-trip-grid, .completed-trip-row { grid-template-columns: 1fr; }
    .trip-filter-toolbar { grid-template-columns: 1fr; }
    .trip-filter-actions { grid-column: auto; }
    .trip-filter-actions .button { flex: 1; }
    .live-refresh { align-items: flex-start; }
    .region-create-card { padding: 16px; }
    .region-create-grid, .region-edit-form { grid-template-columns: 1fr; }
    .region-card { align-items: stretch; flex-direction: column; }
    .region-card > form:last-child .button { width: 100%; }
    .branding-editor { align-items: flex-start; flex-direction: column; }
    .branding-fields { width: 100%; }
    .form-grid.two, .form-grid.three, .form-grid.four, .form-grid.five { grid-template-columns: 1fr; }
    .form-section, .checklist-section { padding: 18px 14px; }
    .form-actions { position: sticky; bottom: 80px; padding: 12px 14px; background: rgba(255,255,255,.95); }
    .check-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .field.notes { grid-column: 1 / -1; }
    .region-picker-field { grid-column: 1 / -1; }
    .region-multi-picker { grid-template-columns: 1fr; }
    .vehicle-edit-panel .form-grid { grid-template-columns: 1fr; }
    .sticky-actions { bottom: 80px; padding: 12px; }
    .sticky-actions .button { flex: 1; padding-inline: 9px; }
    .danger-zone { align-items: flex-start; flex-direction: column; }
    .tire-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .depth-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .depth-ring { width: 60px; height: 60px; flex-basis: 60px; }
    .pagination { gap: 7px; }
    .pagination a, .pagination .disabled { padding: 7px; }
    .login-visual { min-height: 260px; }
    .login-copy { margin-top: 35px; }
    .login-copy h1 { font-size: 39px; }
    .login-panel { margin-top: -22px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
