:root {
  --navy: #143b5d;
  --navy-dark: #0c2b45;
  --blue: #0b65a4;
  --blue-hover: #084f82;
  --blue-light: #e9f3fa;
  --green: #24734a;
  --green-light: #e9f5ee;
  --amber: #9a6200;
  --amber-light: #fff3d6;
  --red: #a52a2a;
  --red-light: #fbeaea;
  --ink: #222a31;
  --muted: #5f6b75;
  --border: #d5dee5;
  --control-border: #7f909d;
  --background: #f4f7f9;
  --surface: #fff;
  --sidebar: 252px;
  --topbar: 68px;
  --radius: 11px;
  --radius-small: 8px;
  --shadow: 0 8px 24px rgba(21, 46, 66, .09);
  --shadow-raised: 0 18px 48px rgba(12, 43, 69, .18);
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 22px;
  --space-6: 28px;
  --duration-fast: 150ms;
  --duration: 220ms;
  --ease-out: cubic-bezier(.2, .8, .2, 1);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, Helvetica, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { min-width: 320px; scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; color: var(--ink); background: radial-gradient(circle at 90% 0, #eaf2f7 0, transparent 28rem), var(--background); font-size: 15px; line-height: 1.5; }
button, input, select, textarea { font: inherit; }
button, a, select { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
a { color: var(--blue); text-underline-offset: 3px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; z-index: 3000; top: 8px; left: 8px; padding: 11px 16px; transform: translateY(-160%); color: var(--navy); background: #fff; border: 2px solid var(--blue); border-radius: var(--radius-small); box-shadow: var(--shadow); font-weight: 700; transition: transform var(--duration-fast) var(--ease-out); }
.skip-link:focus { transform: none; }
:focus-visible { outline: 3px solid #0067b8; outline-offset: 3px; }
.topbar :focus-visible, .sidebar nav a[aria-current="page"]:focus-visible { outline-color: #fff; box-shadow: 0 0 0 5px #0067b8; }
.ui-icon { width: 18px; height: 18px; display: block; flex: 0 0 auto; align-self: center; overflow: visible; color: inherit; pointer-events: none; shape-rendering: geometricPrecision; }
.ui-icon > svg { width: 100%; height: 100%; display: block; overflow: visible; }

.auth-pending { overflow: hidden; }
.auth-pending > .skip-link,
.auth-pending > .topbar,
.auth-pending > .app-shell,
.auth-pending > dialog,
.auth-pending > .toast { visibility: hidden; }
.auth-loading { position: fixed; z-index: 2000; inset: 0; display: none; place-items: center; padding: 24px; background: var(--background); }
.auth-pending .auth-loading { display: grid; }
.auth-loading-card { width: min(100%, 360px); display: grid; justify-items: center; padding: 34px 28px; text-align: center; }
.auth-loading-logo { width: 50px; height: 50px; display: grid; place-items: center; margin-bottom: 28px; color: #fff; background: var(--navy); border-radius: 12px; box-shadow: 0 8px 20px rgba(20,59,93,.2); font-size: 18px; font-weight: 800; }
.auth-spinner { width: 34px; height: 34px; margin-bottom: 20px; border: 3px solid #ced8e1; border-top-color: var(--blue); border-radius: 50%; animation: auth-spin .8s linear infinite; }
.auth-loading-card strong { color: var(--ink); font-size: 18px; }
.auth-loading-card p { margin: 7px 0 0; color: var(--muted); }
.auth-loading-card .button { margin-top: 22px; }
.auth-loading.is-error .auth-spinner { display: none; }
.auth-loading.is-error .auth-loading-logo { margin-bottom: 20px; }
@keyframes auth-spin { to { transform: rotate(360deg); } }

.topbar { position: fixed; z-index: 1000; inset: 0 0 auto; height: var(--topbar); display: flex; align-items: center; justify-content: space-between; padding: 0 22px; color: #fff; background: linear-gradient(110deg, var(--navy-dark), var(--navy)); border-bottom: 1px solid var(--navy-dark); box-shadow: 0 2px 14px rgba(12,43,69,.16); }
.portal-brand { display: inline-flex; align-items: center; gap: 11px; color: #fff; text-decoration: none; }
.portal-logo { width: 40px; height: 40px; display: grid; place-items: center; background: #fff; color: var(--navy); border-radius: 10px; box-shadow: 0 4px 12px rgba(4,25,40,.16); font-weight: 800; }
.portal-brand > span:last-child { display: flex; flex-direction: column; line-height: 1.15; }
.portal-brand strong { font-size: 17px; }
.portal-brand small { margin-top: 2px; color: #cbd8e4; font-size: 11px; }
.user-menu { position: relative; display: flex; align-items: center; gap: 18px; }
.company-name { padding-right: 18px; color: #dce6ef; border-right: 1px solid rgba(255,255,255,.25); font-size: 13px; }
.user-button { min-height: 46px; display: flex; align-items: center; gap: 9px; padding: 4px 8px; color: #fff; background: transparent; border: 1px solid transparent; border-radius: 9px; text-align: left; transition: background-color var(--duration-fast), border-color var(--duration-fast); }
.user-button:hover { background: rgba(255,255,255,.1); }
.user-button[aria-expanded="true"] { background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.2); }
.avatar { width: 34px; height: 34px; display: grid; place-items: center; color: var(--navy); background: #fff; border-radius: 50%; font-size: 12px; font-weight: 700; }
.user-copy { display: flex; flex-direction: column; line-height: 1.2; }
.user-copy strong { font-size: 13px; }
.user-copy small { margin-top: 2px; color: #ccd9e5; font-size: 11px; }
.user-chevron { width: 16px; height: 16px; transition: transform var(--duration-fast) var(--ease-out); }
.user-button[aria-expanded="true"] .user-chevron { transform: rotate(180deg); }
.user-dropdown { position: absolute; z-index: 10; top: 54px; right: 0; width: 280px; padding: 8px; color: var(--ink); background: #fff; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-raised); animation: dropdown-in var(--duration-fast) var(--ease-out); transform-origin: top right; }
.user-dropdown button, .user-dropdown a { width: 100%; min-height: 44px; display: flex; align-items: center; gap: 10px; padding: 9px 11px; color: var(--ink); background: transparent; border: 0; border-radius: var(--radius-small); text-align: left; text-decoration: none; transition: color var(--duration-fast), background-color var(--duration-fast); }
.user-dropdown button:hover, .user-dropdown a:hover { background: var(--background); }
.user-dropdown hr { margin: 8px 0; border: 0; border-top: 1px solid var(--border); }
.account-switcher { display: grid; gap: 5px; padding: 7px 8px 9px; }
.account-switcher span { color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; }
.account-switcher select { width: 100%; min-height: 40px; padding: 7px 9px; }

.app-shell { min-height: 100vh; padding-top: var(--topbar); }
.sidebar { position: fixed; z-index: 900; inset: var(--topbar) auto 0 0; width: var(--sidebar); display: flex; flex-direction: column; justify-content: space-between; padding: 18px 12px; background: rgba(255,255,255,.96); border-right: 1px solid var(--border); box-shadow: 3px 0 18px rgba(21,46,66,.035); overflow-y: auto; }
.sidebar nav { display: grid; gap: 4px; }
.sidebar nav a { position: relative; min-height: 48px; display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; align-items: center; gap: 9px; padding: 9px 12px; color: #354653; border: 1px solid transparent; border-radius: var(--radius-small); text-decoration: none; font-weight: 650; transition: color var(--duration-fast), background-color var(--duration-fast), border-color var(--duration-fast), transform var(--duration-fast) var(--ease-out); }
.sidebar nav a:hover { color: var(--navy); background: #edf4f8; }
.sidebar nav a[aria-current="page"] { color: var(--navy); background: var(--blue-light); border-color: #c7deed; }
.sidebar nav a[aria-current="page"]::before { content: ""; position: absolute; inset: 9px auto 9px -5px; width: 3px; background: var(--blue); border-radius: 999px; }
.sidebar nav a > .ui-icon { width: 19px; height: 19px; justify-self: center; }
.nav-count { min-width: 24px; padding: 1px 7px; color: #fff; background: var(--amber); border-radius: 10px; font-size: 11px; text-align: center; }
.sidebar nav a[aria-current="page"] .nav-count { color: #fff; background: var(--blue); }
.sidebar-help { margin: 24px 4px 4px; padding: 14px; background: var(--background); border: 1px solid var(--border); border-radius: var(--radius); }
.sidebar-help strong { display: block; margin-bottom: 8px; font-size: 13px; }
.sidebar-help a { min-height: 28px; display: flex; align-items: center; margin-top: 4px; font-size: 12px; }

.main-content { margin-left: var(--sidebar); padding: 30px clamp(22px, 3vw, 48px) 52px; }
.page { max-width: 1320px; margin: 0 auto; }
.page:not([hidden]) { animation: page-in var(--duration) var(--ease-out); }
.page-heading { min-height: 72px; display: flex; align-items: flex-end; justify-content: space-between; gap: var(--space-6); margin-bottom: var(--space-5); }
.page-heading h1 { margin: 2px 0 5px; color: #1f2b34; font-size: clamp(27px, 3vw, 36px); line-height: 1.15; }
.page-heading p { margin: 0; color: var(--muted); }
.eyebrow { margin: 0 !important; color: var(--blue) !important; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }

.button { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 16px; border: 1px solid transparent; border-radius: var(--radius-small); font-weight: 700; line-height: 1.2; text-decoration: none; white-space: nowrap; transition: color var(--duration-fast), background-color var(--duration-fast), border-color var(--duration-fast), box-shadow var(--duration-fast), transform var(--duration-fast) var(--ease-out); }
.button-primary { color: #fff; background: var(--blue); border-color: #105b99; }
.button-primary:hover { background: var(--blue-hover); border-color: var(--blue-hover); box-shadow: 0 5px 14px rgba(11,101,164,.18); }
.button-secondary { color: #26343e; background: #fff; border-color: var(--control-border); }
.button-secondary:hover { background: #f0f3f5; }
.button-danger { color: #8a2020; background: #fff; border-color: #a52a2a; }
.button-danger:hover { color: #fff; background: #9b2828; }
.button:disabled { color: #66747e; background: #e6eaed; border-color: #c9d0d6; box-shadow: none; opacity: 1; }
.text-button { min-height: 44px; display: inline-flex; align-items: center; padding: 8px 4px; color: var(--blue); background: transparent; border: 0; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.icon-button { width: 44px; height: 44px; display: inline-grid; place-items: center; padding: 0; color: #46545f; background: transparent; border: 1px solid transparent; border-radius: var(--radius-small); line-height: 1; transition: color var(--duration-fast), background-color var(--duration-fast), border-color var(--duration-fast), transform var(--duration-fast) var(--ease-out); }
.icon-button .ui-icon { width: 20px; height: 20px; margin: 0; }
.icon-button:hover { background: var(--background); border-color: var(--border); }

.summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-4); margin-bottom: var(--space-5); }
.overview-summary { grid-template-columns: repeat(4, 1fr); }
.summary-card { min-width: 0; min-height: 98px; display: flex; align-items: center; gap: 15px; padding: 18px; background: rgba(255,255,255,.96); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 3px 12px rgba(21,39,54,.045); transition: border-color var(--duration), box-shadow var(--duration), transform var(--duration) var(--ease-out); }
.summary-icon { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 14px; }
.summary-icon .ui-icon { width: 23px; height: 23px; }
.summary-icon.blue { color: var(--blue); background: var(--blue-light); }
.summary-icon.green { color: var(--green); background: var(--green-light); }
.summary-icon.amber { color: var(--amber); background: var(--amber-light); }
.summary-icon.red { color: var(--red); background: var(--red-light); }
.summary-card div { min-width: 0; display: flex; flex-direction: column; }
.summary-card strong { font-size: 25px; line-height: 1; }
.summary-card span:last-child { margin-top: 6px; color: var(--muted); font-size: 13px; }

.panel { min-width: 0; background: rgba(255,255,255,.98); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 4px 16px rgba(21,39,54,.045); overflow: clip; }
.panel-heading { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 15px 20px; border-bottom: 1px solid var(--border); }
.panel-heading.compact { min-height: 68px; }
.panel-heading.compact h2 { margin-bottom: 7px; }
.panel-heading h2, .help-card h2 { margin: 0; color: #27343d; font-size: 18px; }
.panel-heading p { margin: 3px 0 0; color: var(--muted); font-size: 13px; }
.vehicle-list { display: grid; }
.vehicle-row { min-height: 88px; display: grid; grid-template-columns: minmax(210px, 1.25fr) minmax(160px, 1fr) minmax(190px, 1fr) auto; align-items: center; gap: 22px; padding: 15px 20px; border-bottom: 1px solid var(--border); }
.vehicle-row:last-child { border-bottom: 0; }
.vehicle-identity { display: grid; grid-template-columns: 48px 1fr; align-items: center; gap: 12px; }
.train-symbol { width: 48px; height: 48px; display: grid; place-items: center; color: var(--navy); background: #edf4f8; border: 1px solid #d5e2ea; border-radius: 12px; }
.train-symbol .ui-icon { width: 24px; height: 24px; }
.vehicle-identity strong, .vehicle-cell strong { display: block; }
.vehicle-identity > div span, .vehicle-cell span { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; }
.vehicle-actions { display: flex; gap: 8px; }
.small-button { min-height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 7px 11px; color: var(--blue); background: #fff; border: 1px solid var(--control-border); border-radius: var(--radius-small); font-weight: 700; line-height: 1.2; transition: color var(--duration-fast), background-color var(--duration-fast), border-color var(--duration-fast), transform var(--duration-fast) var(--ease-out); }
.small-button.icon-only { width: 40px; padding: 0; }
.small-button:hover { background: var(--blue-light); border-color: #5d7f96; }
.two-column { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin-top: 22px; }
.window-card { min-height: 138px; display: grid; grid-template-columns: 66px 1fr auto; align-items: center; gap: 16px; padding: 20px; }
.window-card > .empty-state { grid-column: 1 / -1; width: 100%; padding: 30px 20px; line-height: 1.65; }
.calendar-block { width: 60px; overflow: hidden; text-align: center; border: 1px solid #aeb9c2; border-radius: 4px; }
.calendar-block strong { display: block; padding: 6px 0 3px; font-size: 24px; }
.calendar-block span { display: block; padding: 3px; color: #fff; background: var(--navy); font-size: 10px; font-weight: 800; }
.window-card > div:nth-child(2) { display: flex; flex-direction: column; }
.window-card > div:nth-child(2) span { margin-top: 3px; color: var(--muted); font-size: 12px; }
.activity-list { list-style: none; margin: 0; padding: 8px 20px 15px; }
.activity-list li { position: relative; min-height: 52px; padding: 10px 0 10px 24px; border-bottom: 1px solid #edf0f2; }
.activity-list li:last-child { border-bottom: 0; }
.activity-list li::before { content: ""; position: absolute; left: 1px; top: 18px; width: 8px; height: 8px; background: var(--blue); border-radius: 50%; }
.activity-list strong { display: block; font-size: 13px; }
.activity-list span { color: var(--muted); font-size: 11px; }

.status { display: inline-flex; align-items: center; width: max-content; min-height: 26px; padding: 3px 9px; border: 1px solid transparent; border-radius: 999px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.status::before { content: ""; width: 6px; height: 6px; margin-right: 5px; border-radius: 50%; background: currentColor; }
.status-green { color: var(--green); background: var(--green-light); }
.status-blue { color: #17639c; background: var(--blue-light); }
.status-amber { color: var(--amber); background: var(--amber-light); }
.status-red { color: var(--red); background: var(--red-light); }
.status-gray { color: #55636d; background: #edf0f2; }

.table-toolbar { min-height: 68px; display: flex; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.search-field { width: min(420px, 60%); min-height: 44px; display: flex; align-items: center; gap: 9px; padding: 0 12px; color: #53636f; background: #fff; border: 1px solid var(--control-border); border-radius: var(--radius-small); transition: border-color var(--duration-fast), box-shadow var(--duration-fast); }
.search-field:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(11,101,164,.14); }
.search-field input { width: 100%; min-height: 42px; padding: 0; border: 0; outline: 0; }
select, input, textarea { color: var(--ink); background: #fff; border: 1px solid var(--control-border); border-radius: var(--radius-small); transition: border-color var(--duration-fast), box-shadow var(--duration-fast), background-color var(--duration-fast); }
select:hover, input:hover, textarea:hover { border-color: #788b99; }
select:focus-visible, input:focus-visible, textarea:focus-visible { border-color: var(--blue); outline: 3px solid rgba(0,103,184,.24); outline-offset: 1px; }
.table-toolbar select { height: 44px; padding: 0 32px 0 11px; }
.filter-group { display: flex; gap: 10px; }
.user-summary { grid-template-columns: repeat(4, 1fr); }
.user-audit-panel { margin-top: 22px; }
.test-data-panel { margin-top: 22px; }
.test-data-body { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 24px; padding: 20px; }
.test-data-body > div:first-child { min-width: 0; flex: 1 1 340px; }
.test-data-body p { max-width: 760px; margin: 5px 0 0; color: var(--muted); }
.test-data-actions { max-width: 100%; display: flex; flex: none; flex-wrap: wrap; justify-content: flex-end; gap: 9px; }
.test-account-list { display: grid; gap: 5px; margin: 15px 0 0; padding: 0; list-style: none; }
.test-account-list li { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.test-account-list code { padding: 2px 6px; background: #f1f4f6; border: 1px solid var(--border); border-radius: 3px; }
.test-data-notice { margin: 0 20px 20px; }
.test-credential-list { display: grid; gap: 12px; }
.test-credential { padding: 13px 14px; background: #f6f8f9; border: 1px solid var(--border); border-radius: 4px; }
.test-credential strong, .test-credential code { display: block; }
.test-credential code { margin-top: 5px; overflow-wrap: anywhere; font-size: 13px; }
.user-name-cell, .user-cell { display: grid; grid-template-columns: 38px 1fr; align-items: center; gap: 10px; }
.user-name-cell .avatar, .user-cell .avatar { color: #fff; background: var(--navy); }
.user-name-cell strong, .user-name-cell span, .user-cell strong, .user-cell small { display: block; }
.user-cell small { color: var(--muted); }
.scope-summary { max-width: 210px; color: var(--muted); font-size: 12px; }
.status-invited { color: var(--amber); background: var(--amber-light); }
.status-suspended { color: var(--red); background: var(--red-light); }
.table-scroll { position: relative; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th { padding: 11px 16px; color: #53616b; background: #f6f8f9; border-bottom: 1px solid var(--border); font-size: 11px; letter-spacing: .03em; text-transform: uppercase; white-space: nowrap; }
td { padding: 15px 16px; border-bottom: 1px solid #e6eaed; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background-color var(--duration-fast); }
tbody tr:hover { background: #f7fafc; }
.table-vehicle strong { display: block; }
.table-vehicle span, .muted { color: var(--muted); font-size: 12px; }
.empty-state { margin: 0; padding: 32px 20px; color: var(--muted); text-align: center; }
.notice { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 20px; padding: 14px 16px; border: 1px solid; border-radius: var(--radius); }
.notice > span { width: 28px; height: 28px; display: grid; place-items: center; flex: none; border-radius: 9px; }
.notice > span .ui-icon { width: 17px; height: 17px; }
.notice p { margin: 3px 0 0; font-size: 13px; }
.notice-info { color: #194f78; background: #eaf4fb; border-color: #b9d7eb; }
.notice-info > span { color: #fff; background: #286d9f; }
.notice-danger { color: #772020; background: var(--red-light); border-color: #dfaaaa; }
.notice-danger > span { color: #fff; background: var(--red); }
.priority-high { color: var(--red); font-weight: 700; }
.priority-normal { color: #42515c; }
.heading-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }
.agreements-panel, .calendar-list-panel { margin-top: 22px; }
.task-overview-panel { margin-bottom: 22px; }
.task-card-list { display: grid; }
.task-card { width: 100%; min-height: 70px; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 13px 20px; color: var(--ink); background: #fff; border: 0; border-bottom: 1px solid var(--border); text-align: left; transition: background-color var(--duration-fast), padding-left var(--duration-fast) var(--ease-out); }
.task-card:last-child { border-bottom: 0; }
.task-card:hover { background: #f7fafc; }
.task-card > span:first-child { min-width: 0; }
.task-card strong, .task-card small { display: block; }
.task-card small { margin-top: 4px; color: var(--muted); }

.calendar-toolbar { min-height: 74px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.calendar-toolbar h2 { margin: 0; font-size: 20px; text-align: center; text-transform: capitalize; }
.calendar-navigation { display: flex; gap: 7px; }
.calendar-navigation .small-button:first-child, .calendar-navigation .small-button:last-child { min-width: 40px; line-height: 1; }
.calendar-filter { justify-self: end; }
.calendar-filter select { min-height: 40px; padding: 7px 30px 7px 10px; }
.calendar-weekdays { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); background: #f6f8f9; border-bottom: 1px solid var(--border); }
.calendar-weekdays span { padding: 9px 8px; color: var(--muted); border-right: 1px solid var(--border); font-size: 11px; font-weight: 800; text-align: center; text-transform: uppercase; }
.calendar-weekdays span:last-child { border-right: 0; }
.month-calendar { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.calendar-day { min-height: 128px; padding: 7px; background: #fff; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.calendar-day:nth-child(7n) { border-right: 0; }
.calendar-day.is-outside { background: #f7f8f9; }
.calendar-day.is-today { box-shadow: inset 0 0 0 2px var(--blue); }
.calendar-day.is-drop-target { background: var(--blue-light); box-shadow: inset 0 0 0 2px var(--blue); }
.calendar-day-number { display: block; margin-bottom: 6px; color: #53616b; font-size: 12px; font-weight: 700; text-align: right; }
.calendar-day.is-outside .calendar-day-number { color: #65737d; }
.calendar-event { width: 100%; min-height: 28px; display: block; margin: 4px 0; padding: 5px 6px; overflow: hidden; color: #fff; background: var(--navy); border: 0; border-left: 4px solid #6ea7d1; border-radius: 5px; font-size: 11px; line-height: 1.25; text-align: left; text-overflow: ellipsis; white-space: nowrap; }
.calendar-event.status-confirmed { background: var(--green); border-left-color: #86c5a3; }
.calendar-event.status-open { background: var(--amber); border-left-color: #f0c363; }
.calendar-event.status-cancelled, .calendar-event.status-closed { color: #394750; background: #dfe4e8; border-left-color: #9ea9b1; text-decoration: line-through; }
.calendar-event[draggable="true"] { cursor: grab; }
.calendar-event[draggable="true"]:active { cursor: grabbing; }
.calendar-more { display: block; padding: 4px; color: var(--blue); font-size: 11px; font-weight: 700; }
.calendar-help { margin: 0; padding: 10px 18px; color: var(--muted); background: #f7f8f9; border-top: 1px solid var(--border); font-size: 12px; }
.help-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-4); }
.help-card { min-height: 220px; padding: 22px; }
.help-card > span { width: 34px; height: 34px; display: grid; place-items: center; margin-bottom: 18px; color: #fff; background: var(--navy); border-radius: 50%; font-weight: 800; }
.help-card h2 { font-size: 19px; }
.help-card p { min-height: 72px; margin: 10px 0 8px; color: var(--muted); }

.dialog { width: min(610px, calc(100% - 28px)); max-height: calc(100vh - 28px); padding: 0; color: var(--ink); background: #fff; border: 1px solid rgba(255,255,255,.4); border-radius: 14px; box-shadow: var(--shadow-raised); overflow: auto; transition: opacity var(--duration), transform var(--duration) var(--ease-out), overlay var(--duration) allow-discrete, display var(--duration) allow-discrete; }
.dialog::backdrop { background: rgba(12, 28, 41, .64); backdrop-filter: blur(2px); transition: opacity var(--duration), overlay var(--duration) allow-discrete, display var(--duration) allow-discrete; }
@starting-style { .dialog[open] { opacity: 0; transform: translateY(10px) scale(.985); } .dialog[open]::backdrop { opacity: 0; } }
.dialog-heading { min-height: 82px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 17px 22px; border-bottom: 1px solid var(--border); }
.dialog-heading h2 { margin: 0; font-size: 22px; }
.dialog-heading p { margin: 3px 0 0; color: var(--muted); font-size: 13px; }
.form-body { display: grid; gap: 17px; padding: 22px; }
.field { display: grid; gap: 6px; }
.field > span, .field > label { font-weight: 700; }
.field b { color: var(--red); }
.field input, .field select, .field textarea { width: 100%; min-height: 44px; padding: 9px 11px; }
.field textarea { resize: vertical; }
.field small { color: var(--muted); font-size: 11px; }
.field [aria-invalid="true"] { border: 2px solid var(--red); }
.location-entry-control { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 9px; }
.location-entry-control .button { min-height: 43px; white-space: nowrap; }
.location-confirmation { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 11px; margin-top: -7px; padding: 11px 12px; background: #eef7f2; border: 1px solid #a9cbb8; border-radius: var(--radius-small); }
.location-confirmation > span { width: 30px; height: 30px; display: grid; place-items: center; color: #fff; background: var(--green); border-radius: 50%; font-size: 18px; }
.location-confirmation strong, .location-confirmation small { display: block; }
.location-confirmation small { margin-top: 2px; color: var(--muted); }
.form-guidance { margin: 0; padding: 12px 14px; color: #3f5565; background: #eef5fa; border-left: 3px solid var(--blue); font-size: 12px; }
.form-guidance a { font-weight: 800; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.quick-entry { min-width: 0; margin: 0; padding: 14px; background: #f6f8f9; border: 1px solid var(--border); border-radius: 4px; }
.quick-entry legend { padding: 0 5px; font-weight: 700; }
.quick-entry p { margin: 0 0 10px; color: var(--muted); font-size: 12px; }
.quick-entry-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.quick-entry-grid button { min-height: 44px; padding: 9px 11px; color: #24445f; background: #fff; border: 1px solid var(--control-border); border-radius: var(--radius-small); font-weight: 700; text-align: left; transition: color var(--duration-fast), background-color var(--duration-fast), border-color var(--duration-fast), box-shadow var(--duration-fast); }
.quick-entry-grid button:hover { background: var(--blue-light); border-color: #5d7f96; }
.quick-entry-grid button[aria-pressed="true"] { color: #fff; background: var(--navy); border-color: var(--navy); }
.permission-box { min-width: 0; margin: 0; padding: 14px; border: 1px solid var(--border); border-radius: 4px; }
.permission-box legend { padding: 0 5px; font-weight: 700; }
.permission-list { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; }
.permission-line, .permission-list label, .radio-line, .vehicle-scope-list label { min-height: 44px; display: flex; align-items: flex-start; gap: 9px; padding: 8px; border-radius: var(--radius-small); }
.permission-line:hover, .permission-list label:hover, .radio-line:hover, .vehicle-scope-list label:hover { background: #f5f7f8; }
.permission-line input, .permission-list input, .radio-line input, .vehicle-scope-list input { width: 18px; height: 18px; flex: none; margin: 2px 0 0; accent-color: var(--blue); }
.permission-line span, .permission-list span, .radio-line span { display: flex; flex-direction: column; }
.permission-line small, .permission-list small, .radio-line small { margin-top: 2px; color: var(--muted); }
.vehicle-scope-list { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin: 8px 0 0 27px; padding: 8px; background: #f6f8f9; border-radius: 3px; }
.agreement-vehicle-box { display: grid; gap: 8px; }
.agreement-vehicle-guidance { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.agreement-vehicle-list { max-height: 210px; margin-left: 0; overflow: auto; }
.agreement-vehicle-list label.is-unavailable { color: #687782; background: #edf0f2; }
.agreement-vehicle-list label.is-unavailable input { cursor: not-allowed; }
.agreement-vehicle-list label span { display: grid; gap: 2px; }
.agreement-vehicle-list label small { color: var(--muted); font-size: 11px; }
.commercial-test-guidance { margin-bottom: 22px; }
.scope-empty { grid-column: 1 / -1; margin: 0; padding: 8px; color: var(--muted); font-size: 12px; }
.account-state { padding-top: 2px; }
.user-dialog { width: min(720px, calc(100% - 28px)); }
.user-dialog-actions { justify-content: space-between; }
.user-dialog-actions > div { display: flex; gap: 10px; }
.coordinate-help { display: block; margin-top: -10px; color: var(--muted); }
.fleet-summary { grid-template-columns: repeat(4, 1fr); }
.fleet-layout { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(280px, .65fr); gap: 22px; margin-bottom: 22px; }
.fleet-table-panel { margin-top: 0; }
.coordinate-map { position: relative; height: 380px; overflow: hidden; background: #eaf1f5; border-bottom: 1px solid var(--border); }
.coordinate-map, .interactive-map, .location-picker-map { position: relative; z-index: 0; isolation: isolate; }
.coordinate-map.large { min-height: 520px; }
.map-attribution { margin: 0; padding: 8px 12px; color: var(--muted); background: #f7f9fa; font-size: 10px; }
.map-empty-overlay { position: absolute; z-index: 800; left: 50%; top: 50%; transform: translate(-50%,-50%); padding: 10px 14px; color: var(--ink); background: rgba(255,255,255,.94); border: 1px solid var(--border); border-radius: 4px; box-shadow: var(--shadow); pointer-events: none; }
.fleet-map-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: #f7f9fa; }
.fleet-map-footer .map-attribution { text-align: right; }
.fleet-map-legend { display: flex; flex-wrap: wrap; gap: 14px; padding: 8px 12px; color: var(--muted); font-size: 10px; white-space: nowrap; }
.fleet-map-legend span { display: inline-flex; align-items: center; gap: 5px; }
.map-legend-dot { width: 10px; height: 10px; display: inline-block; background: var(--navy); border: 2px solid #fff; border-radius: 50%; box-shadow: 0 0 0 1px #9aaaba; }
.map-legend-dot.attention { background: var(--red); }
.attention-list { list-style: none; margin: 0; padding: 8px 18px 18px; }
.attention-list li { padding: 13px 0; border-bottom: 1px solid #e7ebee; }
.attention-list li:last-child { border-bottom: 0; }
.attention-list button { width: 100%; padding: 0; color: inherit; background: transparent; border: 0; text-align: left; }
.attention-list strong, .attention-list span { display: block; }
.attention-list span { margin-top: 3px; color: var(--muted); font-size: 12px; }
.location-layout { display: grid; grid-template-columns: minmax(370px, .82fr) minmax(0, 1.18fr); gap: 22px; }
.location-flow { display: grid; grid-template-columns: repeat(3,1fr); gap: 1px; margin: 0 0 22px; padding: 0; overflow: hidden; list-style: none; background: var(--border); border: 1px solid var(--border); border-radius: 5px; }
.location-flow li { min-width: 0; padding: 13px 16px; background: #fff; }
.location-flow strong, .location-flow span { display: block; }
.location-flow strong { color: var(--navy); font-size: 13px; }
.location-flow span { margin-top: 3px; color: var(--muted); font-size: 11px; }
.location-directory { align-self: start; }
.address-search-block { padding-top: 12px; background: #f7f9fa; border-bottom: 1px solid var(--border); }
.address-search-block > strong { display: block; padding: 0 16px; color: var(--ink); font-size: 12px; }
.geocode-search { display: grid; grid-template-columns: 1fr auto; gap: 10px; padding: 9px 16px 13px; }
.geocode-search .search-field { width: 100%; }
.geocode-results { padding: 8px 16px; border-bottom: 1px solid var(--border); }
.geocode-result { width: 100%; min-height: 44px; display: grid; grid-template-columns: 1fr auto; gap: 12px; padding: 10px 4px; color: var(--ink); background: transparent; border: 0; border-bottom: 1px solid #dfe6eb; text-align: left; }
.geocode-result:last-child { border-bottom: 0; }
.geocode-result:hover { color: var(--blue); }
.geocode-result span { color: var(--muted); font-size: 11px; }
.interactive-map { width: 100%; height: 520px; display: block; border: 0; border-bottom: 1px solid var(--border); background: #eaf1f5; }
.coordinate-actions { display: flex; justify-content: flex-end; margin-top: -8px; }
.location-picker-dialog { width: min(1080px, calc(100% - 28px)); overflow: hidden; }
.location-picker-layout { min-height: 610px; display: grid; grid-template-columns: minmax(330px, .78fr) minmax(440px, 1.22fr); }
.location-picker-search { min-width: 0; border-right: 1px solid var(--border); }
.picker-search-form { padding: 16px; background: #eef5fa; border-bottom: 1px solid var(--border); }
.location-search-control { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.location-search-control input { width: 100%; min-height: 43px; padding: 9px 10px; }
.location-search-control .button { white-space: nowrap; }
.picker-filter-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 16px; border-bottom: 1px solid var(--border); }
.picker-filter-row select { min-width: 190px; min-height: 38px; padding: 7px 8px; }
.picker-filter-row span { color: var(--muted); font-size: 11px; font-weight: 800; }
.picker-search-state { min-height: 47px; margin: 0; padding: 10px 16px; color: var(--muted); background: #f8f9fa; border-bottom: 1px solid var(--border); font-size: 11px; }
.location-picker-results { max-height: 446px; overflow-y: auto; list-style: none; margin: 0; padding: 0; }
.location-picker-results li { border-bottom: 1px solid #e5eaed; }
.picker-result { width: 100%; min-height: 66px; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 11px 16px; color: var(--ink); background: #fff; border: 0; text-align: left; }
.picker-result:hover, .picker-result:focus-visible { background: var(--blue-light); }
.picker-result strong, .picker-result small { display: block; }
.picker-result small { margin-top: 3px; color: var(--muted); }
.picker-result code { color: #536573; font-size: 10px; }
.picker-result-group { padding: 8px 16px; color: var(--blue); background: #f3f7fa; font-size: 10px; font-weight: 900; letter-spacing: .06em; }
.picker-results-note { padding: 15px 16px; color: var(--muted); font-size: 12px; }
.location-picker-preview { min-width: 0; background: #f6f8f9; }
.picker-preview-heading { padding: 11px 15px; background: #fff; border-bottom: 1px solid var(--border); }
.picker-preview-heading strong, .picker-preview-heading span { display: block; }
.picker-preview-heading strong { color: var(--navy); }
.picker-preview-heading span { margin-top: 3px; color: var(--muted); font-size: 11px; }
.location-picker-map { width: 100%; height: 350px; background: #dfe9ef; cursor: crosshair; }
.leaflet-container { font-family: "Segoe UI", Arial, sans-serif; }
.leaflet-container .leaflet-control-attribution { font-size: 9px; }
.map-picker-help { margin: 0; padding: 9px 15px; color: #405767; background: #e7f1f7; border-bottom: 1px solid var(--border); font-size: 11px; }
.picker-selection { min-height: 79px; display: flex; align-items: center; padding: 13px 17px; background: #fff; border-bottom: 1px solid var(--border); }
.picker-selection strong, .picker-selection small { display: block; }
.picker-selection strong { margin-top: 3px; }
.picker-selection small { margin-top: 4px; color: var(--muted); }
.picker-selection-kicker { color: var(--blue); font-size: 9px; font-weight: 900; letter-spacing: .07em; }
.manual-location-box { margin: 13px 16px 16px; background: #fff; border: 1px solid var(--border); border-radius: 4px; }
.manual-location-box summary { min-height: 44px; padding: 11px 13px; cursor: pointer; font-weight: 800; }
.manual-location-fields { display: grid; gap: 11px; padding: 2px 13px 14px; }
.manual-location-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.manual-location-fields > small { color: var(--muted); }
.picker-map-marker { background: transparent; border: 0; }
.picker-map-marker span { width: 26px; height: 26px; display: block; transform: rotate(45deg); background: var(--red); border: 3px solid #fff; border-radius: 50% 50% 50% 0; box-shadow: 0 2px 7px rgba(0,0,0,.4); }
.location-picker-map .leaflet-control-attribution { font-size: 9px; }
.location-search-box { display: grid; grid-template-columns: 1fr 150px; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.location-search-box .search-field { width: 100%; }
.location-search-box select { width: 100%; min-height: 42px; padding: 7px 8px; }
.location-api-state { padding: 14px 18px; color: var(--muted); }
.location-results { max-height: 600px; overflow-y: auto; list-style: none; margin: 0; padding: 0; }
.location-results li { border-bottom: 1px solid #e6eaed; }
.location-result-button { width: 100%; min-height: 68px; display: grid; grid-template-columns: 1fr auto; gap: 12px; padding: 12px 18px; color: var(--ink); background: #fff; border: 0; text-align: left; }
.location-result-button:hover, .location-result-button[aria-current="true"] { background: var(--blue-light); }
.location-result-button strong, .location-result-button span { display: block; }
.location-result-button span { margin-top: 3px; color: var(--muted); font-size: 11px; }
.location-result-button code { align-self: center; color: #50606b; font-size: 11px; }
.load-more { margin: 14px 18px 18px; }
.selected-location { display: grid; grid-template-columns: 1fr auto; gap: 14px; padding: 16px 18px; border-top: 1px solid var(--border); }
.selected-location strong, .selected-location span { display: block; }
.selected-location span { margin-top: 4px; color: var(--muted); font-size: 12px; }
.selected-location code { align-self: center; padding: 7px 9px; background: #edf1f3; border-radius: 3px; }
.safety-check { display: flex; gap: 11px; padding: 14px; background: var(--amber-light); border: 1px solid #e2bd68; border-radius: 4px; }
.safety-check input { width: 20px; height: 20px; flex: none; margin: 1px 0 0; accent-color: var(--red); }
.safety-check span { display: flex; flex-direction: column; }
.safety-check small { margin-top: 3px; color: #6b531e; }
.form-error { padding: 10px 12px; color: #7c1f1f; background: var(--red-light); border: 1px solid #e2b1b1; border-radius: 4px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 22px; background: #f6f8f9; border-top: 1px solid var(--border); }
.management-dialog-actions { justify-content: space-between; }
.management-dialog-actions > div { display: flex; gap: 10px; }
.detail-dialog { width: min(680px, calc(100% - 28px)); }
.check-detail-dialog { width: min(790px, calc(100% - 28px)); }
.check-detail-dialog h3 { margin: 0 0 10px; font-size: 16px; }
.check-description, .check-workflow, .check-resolution, .check-comments { display: grid; gap: 12px; padding-top: 2px; }
.check-description p, .check-resolution p { margin: 0; color: #3f4d57; }
.check-workflow { padding: 17px; background: #f5f8fa; border: 1px solid var(--border); border-radius: 4px; }
.workflow-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.check-comment-list { display: grid; gap: 8px; list-style: none; margin: 0; padding: 0; }
.check-comment-list li { padding: 11px 13px; background: #f7f9fa; border: 1px solid var(--border); border-radius: 4px; }
.check-comment-list li > div { display: flex; justify-content: space-between; gap: 12px; }
.check-comment-list li span { color: var(--muted); font-size: 11px; }
.check-comment-list li p { margin: 6px 0 0; }
.check-comment-form { display: grid; gap: 10px; margin-top: 4px; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border: 1px solid var(--border); border-radius: 4px; overflow: hidden; }
.detail-item { padding: 13px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.detail-item:nth-child(even) { border-right: 0; }
.detail-item span { display: block; color: var(--muted); font-size: 11px; text-transform: uppercase; }
.detail-item strong { display: block; margin-top: 4px; }
.toast { position: fixed; z-index: 1100; right: 24px; bottom: 24px; max-width: 410px; min-height: 48px; padding: 14px 18px; color: #fff; background: #193d2b; border: 1px solid rgba(255,255,255,.18); border-radius: var(--radius); box-shadow: var(--shadow-raised); font-weight: 700; animation: toast-in var(--duration) var(--ease-out); }
.toast.is-urgent { background: #8b2020; }
.table-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.small-button.danger { color: #8b2020; border-color: #a52a2a; }
.small-button.danger:hover { background: #fff1f1; border-color: #9b2828; }
.notice-warning { color: #674c16; background: var(--amber-light); border-color: #e0bf73; }
.notice-warning > span { color: #fff; background: #9a6b12; }
.device-actions { min-width: 190px; }
.device-api-panel { margin-top: 18px; }
.device-endpoint-list { display: flex; flex-wrap: wrap; gap: 9px; padding: 0 20px 20px; }
.device-endpoint-list code { padding: 9px 11px; color: #21465e; background: #eef4f7; border: 1px solid var(--border); border-radius: 4px; font-size: 12px; }
.device-credential-body input, .device-credential-body textarea { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }
.manual-panel, .reference-panel { margin-top: 18px; }
.manual-link-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; padding: 0 20px 20px; }
.manual-link-grid a { min-height: 112px; display: flex; flex-direction: column; gap: 7px; padding: 17px; color: var(--ink); background: #f6f9fb; border: 1px solid var(--border); border-radius: 4px; text-decoration: none; }
.manual-link-grid a:hover, .manual-link-grid a:focus-visible { background: var(--blue-light); border-color: #9bb8cb; }
.manual-link-grid strong { color: var(--blue); font-size: 15px; }
.manual-link-grid span, .reference-list span { color: var(--muted); font-size: 12px; line-height: 1.45; }
.reference-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; list-style: none; margin: 0; padding: 0 20px 20px; }
.reference-list a { display: flex; flex-direction: column; gap: 4px; min-height: 77px; padding: 12px 14px; color: var(--ink); background: #fafbfc; border: 1px solid var(--border); border-radius: 4px; text-decoration: none; }
.reference-list a:hover, .reference-list a:focus-visible { border-color: #8cabbf; }
.report-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 20px; }
.report-card { min-height: 170px; display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; align-items: start; gap: 16px; padding: 20px; transition: border-color var(--duration), box-shadow var(--duration), transform var(--duration) var(--ease-out); }
.report-card-icon { width: 48px; height: 48px; display: grid; place-items: center; color: var(--navy); background: var(--blue-light); border: 1px solid #c9dceb; border-radius: 13px; }
.report-card-icon .ui-icon { width: 24px; height: 24px; }
.report-card h2 { margin: 1px 0 7px; font-size: 17px; }
.report-card p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.report-card small { display: block; margin-top: 12px; color: var(--blue); font-size: 11px; font-weight: 800; text-transform: uppercase; }
.report-card .button { align-self: end; grid-column: 3; grid-row: 1; }
.report-footnote { margin: 18px 2px 0; color: var(--muted); font-size: 12px; }
.button.is-exporting { cursor: wait; }
.button.is-exporting .ui-icon { animation: auth-spin .8s linear infinite; }
.technical-record-dialog { width: min(1050px, calc(100% - 28px)); max-height: calc(100vh - 28px); }
.technical-record-body { gap: 18px; }
.technical-record-notice { display: flex; flex-direction: column; gap: 4px; padding: 13px 15px; color: #674c16; background: var(--amber-light); border: 1px solid #e0bf73; border-radius: 4px; }
.technical-record-notice span { font-size: 12px; line-height: 1.45; }
.technical-section { display: grid; gap: 12px; padding: 16px; background: #f7f9fa; border: 1px solid var(--border); border-radius: 4px; }
.technical-section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; }
.technical-section-heading h3 { margin: 0; font-size: 16px; }
.technical-section-heading p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.technical-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.technical-add-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 10px; padding: 12px; background: #eef4f7; border-radius: 4px; }
.technical-item-list { display: grid; gap: 10px; }
.revision-filters { align-items: end; }
.revision-filters .field { min-width: min(100%, 220px); margin: 0; }
.revision-operation-list { gap: 10px; }
.revision-operation-row { display: grid; grid-template-columns: minmax(240px, 1.7fr) auto minmax(180px, 1fr); gap: 14px; align-items: center; }
.revision-operation-row.is-section { display: block; padding: 12px 16px; background: var(--surface-muted, #f4f7f9); border-color: var(--border); }
.revision-operation-choice { display: flex; gap: 8px; border: 0; padding: 0; margin: 0; }
.revision-operation-choice label { min-height: 44px; min-width: 64px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid var(--border); border-radius: 4px; cursor: pointer; }
.revision-operation-choice label:has(input:checked) { border-color: var(--blue); background: var(--blue-light); color: var(--blue); font-weight: 700; }
.service-case-flow { display: grid; gap: 14px; padding: 16px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-muted, #f4f7f9); }
.service-case-steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.service-case-step { display: flex; gap: 10px; align-items: flex-start; min-width: 0; }
.service-case-step > span { display: inline-grid; place-items: center; flex: 0 0 28px; height: 28px; border-radius: 50%; color: #fff; background: var(--navy); font-weight: 800; }
.service-case-step div { display: grid; gap: 3px; min-width: 0; }
.service-case-step small { color: var(--muted); overflow-wrap: anywhere; }

.maintenance-workspace-section { max-width: 1320px; margin: 24px auto 0; }
.maintenance-workspace-section > .page-heading { min-height: 0; margin-bottom: 16px; padding-top: 20px; border-top: 1px solid var(--border); }
.maintenance-workspace-section > .panel + .panel { margin-top: var(--space-5); }
[data-route="maintenance"] > .notice { margin: var(--space-5) 0; }
.page-heading h2 { margin: 2px 0 5px; color: #1f2b34; font-size: clamp(22px, 2.4vw, 29px); line-height: 1.2; }
.dossier-state-flow { display: grid; grid-template-columns: repeat(7, minmax(118px, 1fr)); gap: 0; margin: 0 0 22px; padding: 0; overflow-x: auto; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); list-style: none; }
.dossier-state-flow li { position: relative; display: grid; grid-template-columns: 30px minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 8px; min-height: 82px; padding: 14px 10px; border-right: 1px solid var(--border); }
.dossier-state-flow li:last-child { border-right: 0; }
.dossier-state-flow li > span { display: inline-grid; grid-row: 1 / 3; place-items: center; align-self: start; width: 28px; height: 28px; border-radius: 50%; color: #fff; background: var(--navy); font-weight: 800; }
.dossier-state-flow strong { align-self: end; font-size: 12px; line-height: 1.25; }
.dossier-state-flow small { align-self: start; color: var(--muted); font-size: 10px; line-height: 1.3; }
.dossier-summary { grid-template-columns: repeat(4, 1fr); }
.technical-item { padding: 13px; background: #fff; border: 1px solid var(--border); border-radius: 4px; box-shadow: 0 1px 1px rgba(20,45,60,.04); }
.technical-item-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 11px; }
.technical-item-heading strong { color: #25475d; }
.icon-button.small { width: 36px; height: 36px; min-height: 36px; }
.technical-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.measurement-main-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.technical-wide { grid-column: 1 / -1; }
.technical-item-details { margin-top: 10px; padding-top: 9px; border-top: 1px solid #e5eaed; }
.technical-item-details summary { min-height: 44px; display: flex; align-items: center; color: var(--blue); cursor: pointer; font-size: 11px; font-weight: 800; }
.technical-item-details[open] summary { margin-bottom: 10px; }
.technical-reference-fieldset { min-width: 0; margin: 0; padding: 14px 16px 16px; border: 1px solid var(--border); border-radius: 4px; }
.technical-reference-fieldset legend { padding: 0 7px; font-weight: 800; }
.technical-reference-fieldset > p { margin: 0 0 12px; color: var(--muted); font-size: 12px; }
.technical-reference-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.technical-reference-list label { display: flex; align-items: flex-start; gap: 10px; padding: 11px; background: #f7f9fa; border: 1px solid var(--border); border-radius: 4px; }
.technical-reference-list input { width: 18px; height: 18px; flex: none; margin-top: 1px; accent-color: var(--blue); }
.technical-reference-list span, .technical-reference-list strong, .technical-reference-list small { display: block; }
.technical-reference-list small { margin-top: 3px; color: var(--muted); }
.technical-reference-list a { min-height: 24px; display: inline-flex; align-items: center; margin-top: 5px; font-size: 11px; }

@keyframes page-in {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: none; }
}
@keyframes dropdown-in {
  from { opacity: 0; transform: translateY(-5px) scale(.985); }
  to { opacity: 1; transform: none; }
}
@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

@media (hover: hover) and (pointer: fine) {
  .button:not(:disabled):hover, .small-button:not(:disabled):hover { transform: translateY(-1px); }
  .summary-card:hover, .report-card:hover { border-color: #b9cbd8; box-shadow: 0 8px 24px rgba(21,46,66,.08); }
  .sidebar nav a:hover { transform: translateX(2px); }
  .task-card:hover { padding-left: 23px; }
}

@media (max-width: 1050px) {
  :root { --sidebar: 218px; }
  .vehicle-row { grid-template-columns: 1.2fr 1fr 1fr; }
  .vehicle-actions { grid-column: 1 / -1; padding-left: 60px; }
  .two-column, .report-grid { grid-template-columns: 1fr; }
  .summary-grid, .help-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fleet-layout, .location-layout { grid-template-columns: 1fr; }
  .help-card { min-height: auto; }
  .calendar-day { min-height: 105px; }
  .help-card p { min-height: 0; }
  .manual-link-grid { grid-template-columns: 1fr; }
  .technical-grid, .measurement-main-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dossier-summary { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 760px) {
  :root { --topbar: 62px; }
  .topbar { padding: 0 12px; }
  .company-name, .user-copy { display: none; }
  .sidebar { position: fixed; inset: var(--topbar) 0 auto; width: auto; height: 72px; display: block; padding: 5px 6px; border-right: 0; border-bottom: 1px solid var(--border); overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; }
  .sidebar nav { min-width: max-content; display: flex; gap: 3px; }
  .sidebar nav a { position: relative; width: 104px; min-height: 61px; display: flex; flex: 0 0 104px; flex-direction: column; gap: 3px; justify-content: center; padding: 6px 4px; font-size: 9px; line-height: 1.15; text-align: center; white-space: normal; }
  .sidebar nav a > .ui-icon { width: 19px; height: 19px; }
  .sidebar nav a[aria-current="page"]::before { inset: auto 12px -3px; width: auto; height: 3px; }
  .sidebar nav a .nav-count { position: absolute; top: 2px; right: 3px; min-width: 19px; padding: 0 5px; font-size: 9px; }
  .sidebar-help { display: none; }
  .main-content { margin-left: 0; padding: 106px 14px 40px; }
  .page-heading { display: grid; align-items: start; gap: 16px; }
  .page-heading .button { justify-self: start; }
  .heading-actions { justify-content: flex-start; }
  .summary-grid { grid-template-columns: 1fr; gap: 9px; }
  .help-grid { grid-template-columns: 1fr; }
  .dossier-summary { grid-template-columns: 1fr; }
  .dossier-state-flow { grid-template-columns: repeat(7, 142px); }
  .summary-card { min-height: 75px; padding: 13px; }
  .vehicle-row { grid-template-columns: 1fr; gap: 13px; }
  .vehicle-actions { grid-column: auto; padding-left: 0; }
  .window-card { grid-template-columns: 60px 1fr; }
  .window-card .status { grid-column: 2; }
  .table-toolbar { align-items: stretch; flex-direction: column; }
  .search-field { width: 100%; }
  .table-toolbar select { width: 100%; }
  .filter-group { display: grid; grid-template-columns: 1fr 1fr; }
  .test-data-body { display: grid; }
  .test-data-actions { justify-content: stretch; }
  .test-data-actions .button { width: 100%; }
  .test-account-list li { align-items: flex-start; flex-wrap: wrap; }
  .calendar-toolbar { grid-template-columns: 1fr; justify-items: stretch; }
  .calendar-toolbar h2 { grid-row: 1; text-align: left; }
  .calendar-navigation { grid-row: 2; }
  .calendar-filter { grid-row: 3; justify-self: stretch; }
  .calendar-filter select { width: 100%; }
  .calendar-weekdays, .month-calendar, .calendar-help { display: none; }
  .location-flow { grid-template-columns: 1fr; }
  .fleet-map-footer { align-items: flex-start; flex-direction: column; }
  .fleet-map-footer .map-attribution { text-align: left; }
  .location-search-box { grid-template-columns: 1fr; }
  .geocode-search { grid-template-columns: 1fr; }
  .location-entry-control, .location-search-control { grid-template-columns: 1fr; }
  .location-picker-dialog { overflow: auto; }
  .location-picker-layout { min-height: 0; grid-template-columns: 1fr; }
  .location-picker-search { border-right: 0; border-bottom: 1px solid var(--border); }
  .location-picker-results { max-height: 330px; }
  .location-picker-map { height: 360px; }
  .picker-filter-row { align-items: stretch; flex-direction: column; }
  .picker-filter-row select { width: 100%; }
  .manual-location-actions { display: grid; grid-template-columns: 1fr; }
  .location-confirmation { grid-template-columns: 34px minmax(0, 1fr); }
  .location-confirmation .small-button { grid-column: 1 / -1; width: 100%; }
  .interactive-map { height: 390px; min-height: 390px; }
  .coordinate-map { height: 350px; }
  .coordinate-map.large { min-height: 390px; }
  .table-scroll { overflow: visible; }
  .table-scroll table, .table-scroll tbody, .table-scroll tr, .table-scroll td { display: block; width: 100%; }
  .table-scroll thead { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
  .table-scroll tbody tr { padding: 12px 14px; border-bottom: 1px solid var(--border); }
  .table-scroll tbody tr:last-child { border-bottom: 0; }
  .table-scroll td { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 12px; padding: 6px 0; border: 0; }
  .table-scroll td::before { content: attr(data-label); color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; }
  .table-scroll tbody tr:hover { background: transparent; }
  .form-row, .detail-grid, .quick-entry-grid, .permission-list, .vehicle-scope-list { min-width: 0; grid-template-columns: minmax(0, 1fr); }
  .form-row > *, .technical-section, .technical-section-heading, .technical-section-heading > *, .technical-item-list { min-width: 0; max-width: 100%; }
  .revision-filters .field { width: 100%; min-width: 0; }
  .revision-operation-row { grid-template-columns: minmax(0, 1fr); }
  .vehicle-scope-list { margin-left: 0; }
  .user-dialog-actions { align-items: stretch; flex-direction: column-reverse; }
  .user-dialog-actions > div { display: grid; grid-template-columns: 1fr; width: 100%; }
  .detail-item { border-right: 0; }
  .dialog-actions { align-items: stretch; flex-direction: column-reverse; }
  .dialog-actions .button { width: 100%; }
  .management-dialog-actions > div { display: grid; grid-template-columns: 1fr; width: 100%; }
  .workflow-actions { display: grid; grid-template-columns: 1fr; }
  .workflow-actions .button { width: 100%; }
  .technical-add-row, .technical-grid, .measurement-main-grid, .technical-reference-list, .reference-list { grid-template-columns: 1fr; }
  .technical-section-heading { flex-direction: column; }
  .technical-actions, .technical-section-heading > .small-button { width: 100%; }
  .technical-actions .small-button, .technical-section-heading > .small-button { width: 100%; }
  .manual-link-grid, .reference-list { padding-right: 14px; padding-left: 14px; }
  .report-card { grid-template-columns: 46px minmax(0, 1fr); }
  .report-card .button { width: 100%; grid-column: 1 / -1; grid-row: auto; }
  .toast { right: 12px; bottom: 12px; left: 12px; max-width: none; }
}

@media (max-width: 430px) {
  .service-case-steps { grid-template-columns: 1fr; }
  .portal-brand small { display: none; }
  .panel-heading { align-items: flex-start; }
  .vehicle-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .vehicle-actions .small-button { width: 100%; }
}

.telemetry-explorer { margin-bottom: var(--space-5); }
.telemetry-toolbar { align-items: flex-end; }
.telemetry-controls { display: flex; align-items: flex-end; gap: 14px; }
.telemetry-controls label, .telemetry-section-heading label { display: grid; gap: 6px; color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.telemetry-controls select { min-width: 240px; }
.range-switch { display: inline-flex; padding: 3px; border: 1px solid var(--border); border-radius: 9px; background: #f3f6f8; }
.range-switch button { min-height: 38px; padding: 0 13px; color: #405261; font: inherit; font-weight: 700; border: 0; border-radius: 6px; background: transparent; cursor: pointer; }
.range-switch button[aria-pressed="true"] { color: #fff; background: var(--navy); box-shadow: 0 2px 6px rgba(19,58,91,.2); }
.range-switch button:focus-visible { outline: 3px solid #79b8ed; outline-offset: 2px; }
.telemetry-loading, .telemetry-empty { padding: 36px 20px; color: var(--muted); text-align: center; }
.telemetry-empty { display: grid; gap: 5px; }
.telemetry-summary { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); border-bottom: 1px solid var(--border); background: #f8fafb; }
.telemetry-summary div { display: grid; gap: 2px; padding: 16px 20px; border-right: 1px solid var(--border); }
.telemetry-summary div:last-child { border-right: 0; }
.telemetry-summary strong { color: var(--navy); font-size: 24px; }
.telemetry-summary span { color: var(--muted); font-size: 12px; }
.telemetry-map-section, .telemetry-explorer [aria-labelledby="telemetry-charts-title"] { padding: 20px; border-bottom: 1px solid var(--border); }
.telemetry-explorer [aria-labelledby="telemetry-charts-title"] { border-bottom: 0; }
.telemetry-section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.telemetry-section-heading h3 { margin: 0; color: #27343d; font-size: 17px; }
.telemetry-section-heading p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.telemetry-map { position: relative; z-index: 0; width: 100%; height: 360px; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: #e9eff3; }
.telemetry-map .leaflet-pane, .telemetry-map .leaflet-control { z-index: auto; }
.telemetry-map-caption { min-height: 20px; margin: 9px 0 0; color: var(--muted); font-size: 12px; }
.telemetry-chart-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
.telemetry-chart-card { position: relative; min-width: 0; padding: 16px; border: 1px solid var(--border); border-radius: 10px; background: #fff; }
.telemetry-chart-card header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.telemetry-chart-card h4 { margin: 5px 0 2px; color: #27343d; font-size: 15px; }
.telemetry-chart-card header p, .telemetry-chart-card footer { margin: 0; color: var(--muted); font-size: 11px; }
.telemetry-chart-card footer { margin-top: 10px; padding-top: 9px; border-top: 1px solid #edf1f3; }
.telemetry-source, .chart-kind { display: inline-flex; min-height: 22px; align-items: center; padding: 0 7px; border-radius: 999px; color: #27516f; background: #e7f2fa; font-size: 10px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.telemetry-source.custom { color: #684c14; background: #fff3d7; }
.chart-kind { flex: 0 0 auto; color: #52626d; background: #edf1f3; }
.telemetry-svg { display: block; width: 100%; min-height: 200px; overflow: visible; }
.telemetry-svg line { stroke: #c7d2da; stroke-width: 1; }
.telemetry-svg polyline { fill: none; stroke: #1769aa; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.telemetry-svg circle { fill: transparent; stroke: transparent; cursor: help; }
.telemetry-svg circle:focus, .telemetry-svg circle:hover { fill: #fff; stroke: #1769aa; stroke-width: 3; }
.telemetry-svg text { fill: #667783; font-size: 10px; }
.telemetry-bars rect { fill: #1769aa; rx: 4; cursor: help; }
.telemetry-bars rect:hover, .telemetry-bars rect:focus { fill: #0d4f84; outline: none; }
.telemetry-bar-scroll { overflow-x: auto; }
.telemetry-pie-layout { display: grid; grid-template-columns: 160px minmax(0,1fr); align-items: center; gap: 20px; min-height: 200px; }
.telemetry-pie { width: 160px; aspect-ratio: 1; margin: auto; overflow: visible; transform: rotate(-90deg); }
.telemetry-pie-track { stroke: #edf1f3; }
.telemetry-pie-segment { cursor: help; transition: opacity .15s ease, stroke-width .15s ease; }
.telemetry-pie-segment:hover, .telemetry-pie-segment:focus { stroke-width: 10; outline: none; }
.telemetry-pie-layout .telemetry-color-0 { stroke: #1769aa; background: #1769aa; }
.telemetry-pie-layout .telemetry-color-1 { stroke: #2a8c68; background: #2a8c68; }
.telemetry-pie-layout ul { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.telemetry-pie-layout li { display: grid; grid-template-columns: 10px minmax(0,1fr) auto; align-items: center; gap: 8px; cursor: help; }
.telemetry-pie-layout li i { width: 10px; height: 10px; border-radius: 3px; }
.telemetry-pie-layout li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.telemetry-events { min-height: 200px; margin: 0; padding: 0; list-style: none; }
.telemetry-events li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid #edf1f3; }
.telemetry-events time { color: var(--muted); }
.telemetry-tooltip { position: absolute; z-index: 5; max-width: calc(100% - 20px); padding: 7px 9px; color: #fff; background: #182c3d; border-radius: 6px; box-shadow: 0 4px 12px rgba(10,28,43,.25); font-size: 11px; font-weight: 700; pointer-events: none; }
.telemetry-tooltip::after { position: absolute; top: 100%; left: 50%; width: 0; height: 0; border: 5px solid transparent; border-top-color: #182c3d; content: ""; transform: translateX(-50%); }

@media (max-width: 900px) {
  .telemetry-toolbar, .telemetry-section-heading { align-items: stretch; flex-direction: column; }
  .telemetry-controls { align-items: stretch; flex-direction: column; width: 100%; }
  .telemetry-controls select { width: 100%; min-width: 0; }
  .range-switch { display: grid; grid-template-columns: repeat(3,1fr); }
  .telemetry-summary { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .telemetry-summary div:nth-child(2) { border-right: 0; }
  .telemetry-summary div:nth-child(-n+2) { border-bottom: 1px solid var(--border); }
  .telemetry-chart-grid { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  .telemetry-summary { grid-template-columns: 1fr; }
  .telemetry-summary div { border-right: 0; border-bottom: 1px solid var(--border); }
  .telemetry-summary div:last-child { border-bottom: 0; }
  .telemetry-map-section, .telemetry-explorer [aria-labelledby="telemetry-charts-title"] { padding: 14px; }
  .telemetry-map { height: 300px; }
  .telemetry-pie-layout { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; transition-delay: 0ms !important; }
  .auth-spinner { animation: none !important; border-color: var(--blue); }
}

@media (prefers-contrast: more) {
  :root { --border: #81909b; }
  .panel, .summary-card, .button-secondary, .small-button, select, input, textarea, .search-field { border-width: 2px; }
  .status { border-color: currentColor; }
  .sidebar nav a[aria-current="page"] { box-shadow: inset 0 0 0 1px var(--navy); }
}
