:root {
  --navy-900: #0a2240;
  --navy-800: #0f2f52;
  --navy-700: #163d66;
  --teal-700: #0f5c63;
  --teal-600: #137a7f;
  --teal-400: #2bb3a3;
  --teal-100: #d9f1ee;
  --ink: #101828;
  --ink-soft: #475467;
  --line: #e4e7ec;
  --bg: #f5f7fa;
  --card: #ffffff;
  --danger: #b42318;
  --danger-bg: #fef3f2;
  --ok: #067647;
  --ok-bg: #ecfdf3;
  --warn-bg: #fffaeb;
  --warn: #b54708;
  --radius: 12px;
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { background: var(--bg); color: var(--ink); font-size: 15px; line-height: 1.5; }
a { color: var(--teal-700); }
h1, h2, h3 { margin: 0; line-height: 1.2; }

/* ---------- Sign-in page ---------- */
.auth { display: grid; grid-template-columns: 1.1fr 1fr; min-height: 100vh; background: #fbfbf9; }
.auth-hero {
  position: relative; overflow: hidden; color: #fff; padding: 72px 64px;
  background: linear-gradient(165deg, rgba(11,42,74,.88) 0%, rgba(10,34,64,.72) 55%, rgba(11,31,56,.86) 100%),
              url('../images/image01.jpg') center / cover no-repeat,
              #0a2240;
  display: flex; flex-direction: column; justify-content: center;
}
.auth-hero h1 { font-size: clamp(34px, 4.2vw, 56px); font-weight: 800; letter-spacing: -0.02em; max-width: 620px; }
.auth-hero h1 .dot { color: var(--teal-400); }
.auth-hero p { margin: 22px 0 0; font-size: 20px; max-width: 480px; color: #c9d6e6; }
.auth-hero svg.wave { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 46%; opacity: .9; pointer-events: none; }
.auth-panel { display: flex; align-items: center; justify-content: center; padding: 48px 32px; }
.auth-card { width: 100%; max-width: 480px; }
.brand { display: flex; align-items: center; justify-content: center; gap: 12px; margin-bottom: 56px; }
.brand-mark { width: 44px; height: 32px; }
.brand-name { font-weight: 800; letter-spacing: .22em; font-size: 22px; color: var(--navy-900); }
.auth-card h2 { font-size: 34px; font-weight: 800; letter-spacing: -0.02em; }
.auth-card .sub { margin: 6px 0 32px; color: var(--ink-soft); font-size: 18px; }
label { display: block; font-weight: 600; margin: 0 0 6px; color: #344054; }
.field { margin-bottom: 20px; }
input[type=email], input[type=password], input[type=text], input[type=file], textarea {
  width: 100%; padding: 13px 14px; border: 1px solid #d0d5dd; border-radius: 8px; background: #fff;
  font: inherit; color: var(--ink);
}
input:focus, textarea:focus { outline: 2px solid var(--teal-400); outline-offset: 1px; border-color: var(--teal-600); }
.check { display: flex; align-items: center; gap: 8px; font-weight: 500; color: var(--ink-soft); margin: -4px 0 22px; }
.check input { width: 16px; height: 16px; }
.btn {
  display: inline-block; border: 0; border-radius: 8px; padding: 13px 18px; font: inherit; font-weight: 700;
  background: var(--teal-700); color: #fff; cursor: pointer; text-decoration: none; text-align: center;
}
.btn:hover { background: #0c4a50; }
.btn-block { width: 100%; font-size: 17px; padding: 15px; }
.btn-ghost { background: transparent; color: var(--ink); border: 1px solid #d0d5dd; font-weight: 600; padding: 9px 14px; }
.btn-ghost:hover { background: #f2f4f7; }
.btn-danger { background: transparent; color: var(--danger); border: 1px solid #fda29b; padding: 7px 12px; font-weight: 600; }
.btn-danger:hover { background: var(--danger-bg); }
.btn-sm { padding: 7px 12px; font-size: 14px; }
.auth-foot { margin-top: 36px; padding-top: 22px; border-top: 1px solid var(--line); display: flex; justify-content: center; gap: 10px; color: var(--ink-soft); font-size: 14px; }
.alert { padding: 12px 14px; border-radius: 8px; margin-bottom: 20px; font-size: 14px; }
.alert-error { background: var(--danger-bg); color: var(--danger); border: 1px solid #fecdca; }
.alert-info { background: #eff8ff; color: #175cd3; border: 1px solid #b2ddff; }
.alert-ok { background: var(--ok-bg); color: var(--ok); border: 1px solid #abefc6; }
.field-error { color: var(--danger); font-size: 13px; margin-top: 6px; }

/* ---------- App shell ---------- */
.shell { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--navy-900); color: #cbd5e1; padding: 24px 14px; display: flex; flex-direction: column; gap: 6px; }
.side .side-brand { color: #fff; font-weight: 800; letter-spacing: .14em; font-size: 20px; padding: 4px 12px 22px; }
.side .side-brand span { color: var(--teal-400); }
.side a { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 10px; color: #cbd5e1; text-decoration: none; font-weight: 600; }
.side a:hover { background: rgba(255,255,255,.06); color: #fff; }
.side a.active { background: var(--navy-700); color: #fff; box-shadow: inset 3px 0 0 var(--teal-400); }
.side .ico { width: 18px; height: 18px; flex: none; }
.side .side-foot { margin-top: auto; font-size: 12px; color: #8ea2bb; padding: 12px; }
.main { min-width: 0; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 22px 32px 6px; flex-wrap: wrap; }
.topbar h1 { font-size: 30px; font-weight: 800; letter-spacing: -0.02em; }
.topbar .lede { color: var(--ink-soft); margin-top: 2px; }
.who { display: flex; align-items: center; gap: 14px; }
.chip { background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 7px 14px; font-size: 14px; font-weight: 600; color: var(--navy-800); }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--teal-100); color: var(--teal-700); font-weight: 800; display: grid; place-items: center; }
.who .name { font-weight: 700; line-height: 1.1; }
.who .role { font-size: 12px; color: var(--ink-soft); }
.content { padding: 18px 32px 40px; display: grid; gap: 18px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: 0 1px 2px rgba(16,24,40,.04); }
.card h3 { font-size: 17px; margin-bottom: 12px; }
.stat .label { color: var(--ink-soft); font-weight: 600; font-size: 14px; }
.stat .value { font-size: 30px; font-weight: 800; letter-spacing: -0.02em; margin-top: 4px; }
.stat .hint { color: var(--ink-soft); font-size: 13px; margin-top: 2px; }
.badges { display: flex; flex-wrap: wrap; gap: 8px; }
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; background: var(--teal-100); color: var(--teal-700); font-size: 12.5px; font-weight: 700; }
.badge-muted { background: #f2f4f7; color: #475467; }
.badge-ok { background: var(--ok-bg); color: var(--ok); }
.badge-off { background: var(--danger-bg); color: var(--danger); }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 13px; color: var(--ink-soft); background: #f8fafc; padding: 10px 12px; border-bottom: 1px solid var(--line); }
td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
.table-wrap { overflow-x: auto; }
.muted { color: var(--ink-soft); }
.small { font-size: 13px; }
.mono { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: 12.5px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.upload { display: grid; grid-template-columns: 1fr 1fr auto; gap: 12px; align-items: end; }
.note { background: var(--warn-bg); color: var(--warn); border: 1px solid #fedf89; padding: 12px 14px; border-radius: 8px; font-size: 14px; }
.inline-form { display: inline; margin: 0; }

.error-page { min-height: 100vh; display: grid; place-items: center; padding: 32px; }
.error-card { max-width: 520px; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 40px; text-align: center; }
.error-card .code { font-size: 54px; font-weight: 800; color: var(--navy-800); }
.error-card p { color: var(--ink-soft); }

@media (max-width: 960px) {
  .auth { grid-template-columns: 1fr; }
  .auth-hero { padding: 40px 28px; min-height: 280px; }
  .shell { grid-template-columns: 1fr; }
  .side { flex-direction: row; flex-wrap: wrap; padding: 12px; }
  .side .side-brand { width: 100%; padding-bottom: 6px; }
  .side .side-foot { display: none; }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .upload { grid-template-columns: 1fr; }
  .content, .topbar { padding-left: 16px; padding-right: 16px; }
}

/* ---------- Overview (mockup layout) ---------- */
.side .nav-off { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 10px; color: #6f86a3; font-weight: 600; cursor: not-allowed; }
.side .nav-off em { margin-left: auto; font-style: normal; font-size: 10.5px; letter-spacing: .04em; text-transform: uppercase; background: rgba(255,255,255,.08); color: #8ea2bb; padding: 2px 7px; border-radius: 999px; }
.kpi { display: flex; gap: 16px; align-items: center; }
.kpi .ico-wrap { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.kpi .ico-wrap svg { width: 26px; height: 26px; }
.kpi .value.empty { color: #98a2b3; }
.ico-green { background: #d8f3ee; color: #0f7a6e; } .ico-blue { background: #dbeafe; color: #2563eb; }
.ico-orange { background: #ffedd5; color: #ea7a12; } .ico-purple { background: #ede9fe; color: #7c3aed; }
.ico-red { background: #fee4e2; color: #d92d20; }
.grid-main { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 16px; }
.card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; gap: 12px; }
.card-head h3 { margin: 0; font-size: 19px; }
.card-head .legend { color: var(--ink-soft); font-size: 13px; display: flex; gap: 14px; align-items: center; }
.dot-sq { display: inline-block; width: 10px; height: 10px; border-radius: 2px; background: var(--teal-700); margin-right: 6px; }
.dot-ln { display: inline-block; width: 14px; height: 3px; border-radius: 2px; background: #f5b301; margin-right: 6px; vertical-align: middle; }
.chart-empty { height: 250px; position: relative; border-radius: 10px; background: repeating-linear-gradient(to bottom, transparent 0 49px, #eef1f5 49px 50px); display: grid; place-items: center; text-align: center; color: var(--ink-soft); }
.chart-empty strong { display: block; color: var(--ink); margin-bottom: 4px; }
.attn { display: flex; gap: 14px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit; }
.attn:last-child { border-bottom: 0; }
.attn .ico-wrap { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.attn .ico-wrap svg { width: 20px; height: 20px; }
.attn b { display: block; } .attn span { color: var(--ink-soft); font-size: 13.5px; }
.empty-note { padding: 22px 8px; text-align: center; color: var(--ink-soft); font-size: 14px; }
.grid-bottom { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 16px; }
@media (max-width: 960px) { .grid-main, .grid-bottom { grid-template-columns: 1fr; } }
.chart-empty .msg { background: #fff; padding: 10px 18px; border-radius: 10px; }
.kpi .hint { white-space: nowrap; }

/* ---------- Refinement after PM review: proportions to match the reference ---------- */
.shell { grid-template-columns: 228px minmax(0, 1fr); }
.side { padding: 22px 10px; gap: 4px; }
.side .side-brand { font-size: 27px; letter-spacing: .01em; padding: 2px 14px 26px; }
.side a, .side .nav-off { padding: 12px 14px; font-size: 16px; gap: 14px; }
.side .ico { width: 22px; height: 22px; }
.side .nav-off em { font-size: 10px; padding: 2px 6px; }
.side .side-foot { font-size: 11.5px; }
.content { gap: 16px; padding-top: 14px; }
.card { padding: 16px 20px; }
.kpi { gap: 14px; }
.kpi .ico-wrap { width: 52px; height: 52px; }
.kpi .ico-wrap svg { width: 24px; height: 24px; }
.stat .value { font-size: 32px; line-height: 1.1; margin-top: 2px; }
.stat .hint { margin-top: 0; }
.chart-empty { height: 140px; background: repeating-linear-gradient(to bottom, transparent 0 34px, #eef1f5 34px 35px); }
.card-head { margin-bottom: 8px; }
.attn { padding: 10px 0; }
.empty-note { padding: 14px 8px; }

/* ---------- User dropdown ---------- */
.usermenu { position: relative; }
.usermenu summary { list-style: none; display: flex; align-items: center; gap: 6px; cursor: pointer; padding: 3px 6px 3px 3px; border-radius: 999px; }
.usermenu summary::-webkit-details-marker { display: none; }
.usermenu summary:hover, .usermenu[open] summary { background: #eef2f6; }
.usermenu .caret { width: 16px; height: 16px; color: var(--ink-soft); }
.usermenu .menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 230px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 28px rgba(16,24,40,.14); z-index: 20; overflow: hidden; }
.usermenu .menu-head { padding: 14px 16px; border-bottom: 1px solid var(--line); }
.usermenu .menu-head .name { font-weight: 700; }
.usermenu .menu-head .role { font-size: 12.5px; color: var(--ink-soft); }
.usermenu .menu-item { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 12px 16px; font: inherit; font-weight: 600; color: var(--ink); cursor: pointer; }
.usermenu .menu-item:hover { background: #f2f4f7; }

.top-logo { height: 38px; width: auto; display: block; border-radius: 6px; }
.top-logo { mix-blend-mode: multiply; }

/* ---------- Loading feedback (see public/js/app.js) ---------- */
.topbar-progress { position: fixed; top: 0; left: 0; height: 3px; width: 0; z-index: 1000; background: linear-gradient(90deg, var(--teal-400), var(--teal-600)); box-shadow: 0 0 8px rgba(43,179,163,.45); opacity: 0; pointer-events: none; }
.topbar-progress.active { opacity: 1; transition: width 8s cubic-bezier(.1,.6,.2,1), opacity .15s; }
.topbar-progress.done { transition: width .15s ease-out, opacity .2s .1s; opacity: 0; }
.spinner { display: inline-block; width: 15px; height: 15px; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: fleet-spin .7s linear infinite; vertical-align: -2px; margin-right: 8px; }
.spinner-dark { border-color: rgba(15,92,99,.25); border-top-color: var(--teal-700); }
.btn-ghost .spinner, .btn-danger .spinner, .menu-item .spinner { border-color: rgba(16,24,40,.2); border-top-color: var(--teal-700); }
.btn.is-busy, .menu-item.is-busy { opacity: .85; cursor: progress; }
.btn:disabled, .menu-item:disabled { cursor: progress; }
[data-loading-region] { position: relative; transition: opacity .15s; }
.is-loading[data-loading-region], .is-loading { opacity: .55; pointer-events: none; }
.is-loading[data-loading-region]::after { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: linear-gradient(90deg, transparent, var(--teal-400), transparent); background-size: 50% 100%; background-repeat: no-repeat; animation: fleet-slide 1s ease-in-out infinite; }
.export-status { position: fixed; right: 24px; bottom: 24px; z-index: 1000; display: flex; align-items: center; gap: 4px; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; box-shadow: 0 12px 28px rgba(16,24,40,.14); font-weight: 600; }
@keyframes fleet-spin { to { transform: rotate(360deg); } }
@keyframes fleet-slide { from { background-position: -50% 0; } to { background-position: 150% 0; } }
@media (prefers-reduced-motion: reduce) {
  .topbar-progress.active, .topbar-progress.done { transition: none; }
  .topbar-progress.active { width: 100% !important; opacity: .7; }
  .spinner { animation: none; border-top-color: rgba(255,255,255,.4); border-right-color: #fff; }
  .spinner-dark, .btn-ghost .spinner, .btn-danger .spinner, .menu-item .spinner { border-top-color: rgba(15,92,99,.25); border-right-color: var(--teal-700); }
  .is-loading[data-loading-region]::after { animation: none; background: var(--teal-400); background-size: 100% 100%; }
}
.top-default { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; letter-spacing: .16em; color: var(--navy-800); font-size: 15px; }
.top-default .brand-mark { width: 30px; height: 22px; }
.top-logo { mix-blend-mode: multiply; }

/* ---------- Vehicle register (V2) ---------- */
.badge-info { background: #dbeafe; color: #1d4ed8; }
.badge-warn { background: var(--warn-bg); color: var(--warn); }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 4px 0 14px; }
.toolbar input[type=text] { flex: 1 1 240px; min-width: 200px; width: auto; padding: 10px 12px; }
.toolbar select { padding: 10px 12px; border: 1px solid #d0d5dd; border-radius: 8px; background: #fff; font: inherit; color: var(--ink); max-width: 100%; width: auto; }
.toolbar select:disabled { background: #f2f4f7; color: #98a2b3; cursor: not-allowed; }
.btn-off, .btn-off:hover { background: #f2f4f7; color: #98a2b3; border: 1px dashed #d0d5dd; cursor: not-allowed; box-shadow: none; }
.btn-off em { font-style: normal; font-size: 11px; margin-left: 6px; }
.veh { display: flex; gap: 12px; align-items: center; }
.veh-ico { width: 38px; height: 38px; border-radius: 10px; background: var(--teal-100); color: var(--teal-700); display: grid; place-items: center; flex: none; }
.veh-ico svg { width: 20px; height: 20px; }
.pager { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding-top: 14px; }
.pages { display: flex; gap: 6px; flex-wrap: wrap; }
.pg { padding: 6px 12px; border: 1px solid #d0d5dd; border-radius: 8px; text-decoration: none; color: var(--ink); font-size: 14px; background: #fff; }
.pg.on { background: var(--teal-700); color: #fff; border-color: var(--teal-700); font-weight: 700; }
.pg.off { color: #98a2b3; background: #f8fafc; }
a.pg:hover { background: #f2f4f7; }
.foot-note { margin-top: 10px; }
.kpi .value a { color: inherit; text-decoration: none; }
#register { position: relative; }

/* ---------- Vehicle forms and detail (V3) ---------- */
.vform { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.vform-main { display: grid; gap: 16px; }
.fgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.fgrid .span2 { grid-column: span 2; }
.fgrid .field { margin-bottom: 14px; }
.field .hint { color: var(--ink-soft); font-size: 12.5px; margin-top: 5px; }
.field [hidden], .fgrid [hidden] { display: none !important; }
select { padding: 12px 14px; border: 1px solid #d0d5dd; border-radius: 8px; background: #fff; font: inherit; color: var(--ink); width: 100%; }
select:focus { outline: 2px solid var(--teal-400); outline-offset: 1px; border-color: var(--teal-600); }
textarea { resize: vertical; min-height: 80px; }
input[aria-invalid=true], .field-error + input { border-color: var(--danger); }
.form-actions { justify-content: flex-end; }
.plain { padding-left: 18px; display: grid; gap: 8px; color: var(--ink-soft); font-size: 14px; }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 20px; }
.facts dt { color: var(--ink-soft); font-size: 13px; }
.facts dd { font-weight: 600; margin: 0; }
.facts .wide { grid-column: span 2; }
.stack { display: grid; gap: 8px; }
.stack.sep { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.stack label { font-weight: 600; font-size: 14px; }
.stack input[type=text] { padding: 10px 12px; }
.card-head .btn { text-decoration: none; }
a.btn { text-decoration: none; display: inline-block; }
/* Add / Edit Vehicle: one card with titled sections, a guidance panel and the actions at the bottom of the side column */
.vform { grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; }
.vform-main.card { padding: 22px 26px 8px; gap: 0; }
.vsec + .vsec { margin-top: 22px; }
.sec-title { font-size: 19px; font-weight: 800; margin: 0 0 14px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.vform select { width: 100%; padding: 13px 14px; border: 1px solid #d0d5dd; border-radius: 8px; background: #fff; font: inherit; color: var(--ink); }
.hint-row { margin: -8px 0 6px; }
.info-line { display: flex; gap: 8px; align-items: flex-start; color: var(--ink-soft); font-size: 13.5px; margin-top: -4px; }
.ico-info { width: 18px; height: 18px; flex: none; color: #2e90fa; margin-top: 1px; }
.vform-side-col { display: flex; flex-direction: column; gap: 16px; align-self: stretch; justify-content: space-between; }
.vform-side { background: #f1faf8; border-color: #cfe9e5; }
.side-title { display: flex; align-items: center; gap: 10px; font-size: 19px; font-weight: 800; margin-bottom: 16px; }
.ico-badge { width: 30px; height: 30px; color: var(--teal-600); flex: none; }
.checks { list-style: none; padding: 0; margin: 0; display: grid; gap: 18px; }
.checks li { display: flex; gap: 12px; align-items: flex-start; }
.ico-check { width: 28px; height: 28px; flex: none; color: var(--teal-600); }
.checks b { display: block; color: var(--ink); }
.checks span { display: block; color: var(--ink-soft); font-size: 14px; margin-top: 2px; }
.form-actions { justify-content: flex-end; gap: 12px; padding-top: 16px; border-top: 1px solid var(--line); }
.crumbs { display: flex; gap: 8px; font-size: 14px; color: var(--ink-soft); margin-bottom: 8px; }
.crumbs a { color: #1570ef; text-decoration: none; }
.crumbs span[aria-current] { color: var(--ink); font-weight: 600; }
@media (max-width: 900px) { .vform { grid-template-columns: 1fr; } .vform-side-col { justify-content: flex-start; } }
@media (max-width: 900px) { .vform { grid-template-columns: 1fr; } .fgrid { grid-template-columns: 1fr; } .fgrid .span2 { grid-column: auto; } .facts { grid-template-columns: 1fr; } .facts .wide { grid-column: auto; } }
.vlink { color: inherit; text-decoration: none; } .vlink:hover { text-decoration: underline; color: var(--teal-700); }

/* ---------- Odometer and service plan (V4) ---------- */
.rec { display: grid; grid-template-columns: 1fr 2fr auto; gap: 12px; align-items: end; margin-bottom: 16px; }
.rec label { font-weight: 600; font-size: 14px; display: block; margin-bottom: 4px; }
.rec input[type=text] { padding: 10px 12px; }
.rec .span-all { grid-column: 1 / -1; }
.rec .check { margin: 0; }
details > summary.btn { list-style: none; cursor: pointer; display: inline-block; }
details > summary.btn::-webkit-details-marker { display: none; }
@media (max-width: 900px) { .rec { grid-template-columns: 1fr; } }

/* V5: export menu */
.head-actions { display: flex; align-items: center; gap: 8px; }
.export-menu { position: relative; }
.export-menu > summary { list-style: none; cursor: pointer; }
.export-menu > summary::-webkit-details-marker { display: none; }
.export-list { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; min-width: 250px; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 6px; box-shadow: 0 12px 28px rgba(16,24,40,.14); display: flex; flex-direction: column; }
.export-list a { padding: 9px 12px; border-radius: 8px; color: inherit; text-decoration: none; font-weight: 600; }
.export-list a:hover, .export-list a:focus { background: #f2f4f7; }
.export-list small { padding: 6px 12px 4px; color: #667085; }

/* Register row actions: icon buttons with a tooltip on hover and on keyboard focus */
.row-actions { display: flex; gap: 6px; align-items: center; flex-wrap: nowrap; }
.icon-btn { position: relative; display: inline-grid; place-items: center; width: 36px; height: 36px; border: 1px solid #d0d5dd; border-radius: 8px; background: #fff; color: var(--ink); text-decoration: none; cursor: pointer; }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn:hover, .icon-btn:focus-visible { background: #f2f4f7; }
.icon-btn:focus-visible { outline: 2px solid var(--teal-400); outline-offset: 2px; }
.icon-btn.icon-danger { color: var(--danger); border-color: #fecdca; }
.icon-btn.icon-danger:hover, .icon-btn.icon-danger:focus-visible { background: var(--danger-bg); }
.icon-btn.icon-ok { color: #067647; border-color: #abefc6; }
.icon-btn.icon-ok:hover, .icon-btn.icon-ok:focus-visible { background: #ecfdf3; }
.icon-btn.is-disabled { color: #98a2b3; background: #f2f4f7; cursor: not-allowed; }
.icon-btn[data-tip]::after { content: attr(data-tip); position: absolute; right: 0; bottom: calc(100% + 8px); z-index: 30; width: max-content; max-width: 240px; padding: 6px 10px; border-radius: 6px; background: #101828; color: #fff; font-size: 12px; font-weight: 600; line-height: 1.35; text-align: left; white-space: normal; opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .12s; }
.icon-btn[data-tip]:hover::after, .icon-btn[data-tip]:focus-visible::after { opacity: 1; visibility: visible; }
/* the form a row action opens is highlighted so the user sees where to type the reason */
#retire:target, #restore:target { outline: 2px solid var(--teal-400); outline-offset: 6px; border-radius: 8px; }
.vform label { font-size: 14px; font-weight: 600; margin-bottom: 5px; }
.vform input[type=text], .vform select, .vform textarea { padding: 10px 14px; }
.vform .fgrid .field { margin-bottom: 12px; }
.vform .sec-title { font-size: 18px; }
.side-title, .checks b { font-size: 16px; }
.side-title { font-size: 19px; }

/* ---------- Drivers register (Trips T1) ---------- */
.vform input[type=date] { width: 100%; padding: 10px 14px; border: 1px solid #d0d5dd; border-radius: 8px; background: #fff; font: inherit; color: var(--ink); }
.row-actions form { display: inline-flex; margin: 0; }
.row-actions button.icon-btn { padding: 0; font: inherit; }

/* ---- Trips (T2) ---- */
.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; }
.avatar.sm { width: 32px; height: 32px; font-size: 12px; flex: none; }
.toolbar .date-range { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-weight: 400; }
.toolbar input[type=date] { padding: 9px 10px; border: 1px solid #d0d5dd; border-radius: 8px; background: #fff; font: inherit; color: var(--ink); width: auto; }
.filter-pop { position: relative; }
.filter-pop > summary .count { display: inline-grid; place-items: center; min-width: 18px; height: 18px; margin-left: 6px; border-radius: 999px; background: var(--teal-700); color: #fff; font-size: 11px; }
.filter-panel { position: absolute; z-index: 20; top: calc(100% + 6px); left: 0; display: grid; gap: 12px; width: 280px; padding: 14px; background: #fff; border: 1px solid #d0d5dd; border-radius: 10px; box-shadow: 0 8px 24px rgba(16, 24, 40, .12); }
.filter-panel label { display: grid; gap: 4px; font-size: 13px; font-weight: 600; }
.filter-panel label.check { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.filter-panel select { width: 100%; padding: 9px 10px; border: 1px solid #d0d5dd; border-radius: 8px; background: #fff; font: inherit; }
th a.sort { color: inherit; text-decoration: none; white-space: nowrap; }
th a.sort:hover, th a.sort:focus-visible { text-decoration: underline; }
.info-strip { display: flex; align-items: center; gap: 10px; margin-top: 12px; padding: 10px 14px; background: #eef7f6; border-radius: 8px; color: var(--ink-soft); font-size: 14px; }
.info-strip svg { width: 18px; height: 18px; flex: none; color: var(--teal-700); }
.info-box { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; margin-bottom: 18px; background: #e8f6f3; border-radius: 10px; color: var(--ink); font-size: 14px; }
.info-box svg { width: 20px; height: 20px; flex: none; margin-top: 2px; color: var(--teal-700); }
.info-box strong { display: block; }
.info-box span { display: block; color: var(--ink); }
.info-box.small-box { margin: 18px 0 0; }
.hint-text { color: var(--ink-soft); font-size: 13px; margin-top: 6px; }
.conflict-box { padding: 12px 14px; margin-bottom: 18px; background: var(--warn-bg); color: var(--ink); border: 1px solid #fedf89; border-left: 4px solid #f79009; border-radius: 8px; font-size: 14px; }
.conflict-box[hidden] { display: none; }
.conflict-box ul { margin: 6px 0; padding-left: 20px; }
.flow { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.flow li { display: flex; gap: 12px; align-items: flex-start; }
.flow .num { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: #e4e7ec; color: var(--ink-soft); font-weight: 800; font-size: 14px; }
.flow li.now .num { background: var(--teal-700); color: #fff; }
.flow b { display: block; }
.flow span { display: block; color: var(--ink-soft); font-size: 14px; margin-top: 2px; }
.trip-form .form-actions { margin-top: 8px; }
.trip-form textarea, .narrow textarea { width: 100%; padding: 10px 14px; border: 1px solid #d0d5dd; border-radius: 8px; font: inherit; color: var(--ink); }
.narrow { max-width: 640px; }
.trip-show { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.trip-side { display: grid; gap: 16px; }
.history { list-style: none; margin: 0; padding: 0 0 0 14px; border-left: 2px solid var(--line); display: grid; gap: 14px; }
.history li { position: relative; }
.history li::before { content: ""; position: absolute; left: -21px; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: var(--teal-700); }
.preline { white-space: pre-line; }
@media (max-width: 900px) { .trip-show { grid-template-columns: 1fr; } .filter-panel { left: auto; right: 0; } }

/* Trip form: date-time inputs as wide as the other fields */
.vform input[type=datetime-local] { width: 100%; padding: 10px 14px; border: 1px solid #d0d5dd; border-radius: 8px; background: #fff; font: inherit; color: var(--ink); }

/* T3: the checks run now on an approval, and the history details */
.checks { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; font-size: 14px; }
.checks li { display: flex; gap: 8px; align-items: flex-start; }
.checks .mark { flex: 0 0 auto; width: 18px; height: 18px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 12px; font-weight: 700; color: #fff; background: #12b76a; }
.checks .mark.bad { background: #d92d20; }
.history .detail { font-size: 13px; color: var(--ink-soft); margin-top: 2px; }

/* Driver UX: scope tabs on the Trips list, and a fixed (read-only) field */
.scope-tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.scope-tabs a { padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--ink-soft); font-weight: 600; font-size: 14px; text-decoration: none; }
.scope-tabs a.active { background: var(--teal-700); border-color: var(--teal-700); color: #fff; }
select.is-fixed { background: #f2f4f7; color: var(--ink); pointer-events: none; -webkit-appearance: none; appearance: none; }

/* Projects: list and form layout (Batch 32 UI) */
.page-actions { display: flex; justify-content: flex-end; margin: 0 0 16px; }
a.btn.btn-icon-text, .btn.btn-icon-text { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 18px; }
.ptable { min-width: 640px; }
.ptable .col-actions { text-align: right; width: 96px; white-space: nowrap; }
.table-foot { padding: 12px 12px 0; border-top: 1px solid var(--line); margin-top: 4px; }
.view-btn { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 50%; color: var(--ink-soft); background: #f2f4f7; text-decoration: none; }
.view-btn:hover, .view-btn:focus-visible { background: #e4e7ec; color: var(--ink); }
.view-btn:focus-visible { outline: 2px solid var(--teal-400); outline-offset: 2px; }
.view-btn::after { content: attr(data-tip); position: absolute; right: calc(100% + 8px); top: 50%; transform: translateY(-50%); background: #101828; color: #fff; font-size: 13px; font-weight: 600; padding: 6px 10px; border-radius: 6px; white-space: nowrap; width: max-content; line-height: 1.35; opacity: 0; visibility: hidden; pointer-events: none; z-index: 20; transition: opacity .12s; }
.view-btn:hover::after, .view-btn:focus-visible::after { opacity: 1; visibility: visible; }
.pform.card { max-width: 900px; width: 100%; padding: 24px; }
.pform-title { font-size: 20px; font-weight: 800; margin: 0 0 18px; }
.pform-alert { max-width: 900px; }
.pgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 20px; }
.pgrid .span2 { grid-column: 1 / -1; }
.pgrid .field { margin-bottom: 18px; }
.pgrid input, .pgrid select { width: 100%; height: 46px; padding: 0 14px; border: 1px solid #d0d5dd; border-radius: 8px; background: #fff; font: inherit; color: var(--ink); }
.pgrid input[aria-invalid=true], .pgrid select[aria-invalid=true] { border-color: var(--danger); }
.pgrid .hint { color: var(--ink-soft); font-size: 13px; margin-top: 6px; }
.pgrid .field-error { margin-top: 6px; }
.pgrid .fixed-value { min-height: 46px; display: flex; align-items: center; gap: 8px; }
.req { color: var(--danger); }
.pform-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding-top: 18px; border-top: 1px solid var(--line); }
.pform-buttons { display: inline-flex; gap: 12px; margin-left: auto; }
.pform-buttons .btn { min-height: 46px; display: inline-flex; align-items: center; justify-content: center; padding: 0 22px; }
@media (max-width: 640px) {
  .pgrid { grid-template-columns: 1fr; }
  .pform.card { padding: 18px 16px; }
  .pform-buttons { width: 100%; }
  .pform-buttons .btn { flex: 1; }
  .page-actions .btn { width: 100%; justify-content: center; }
}

/* Phones and narrow windows: the side menu becomes a wrapped bar above the page (the later 228px rule had undone the 960px one) */
@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { flex-direction: row; flex-wrap: wrap; align-items: center; padding: 10px 12px; gap: 4px; }
  .side .side-brand { width: 100%; padding: 2px 8px 8px; font-size: 18px; }
  .side a, .side .nav-off { padding: 8px 12px; font-size: 14px; }
  .side .side-foot { display: none; }
  .topbar { padding-left: 16px; padding-right: 16px; }
  .content { padding-left: 16px; padding-right: 16px; }
}

/* A wide child (a table) scrolls inside its own wrapper instead of stretching the page */
.content { grid-template-columns: minmax(0, 1fr); }

/* Side menu: the company logo (white plate, because the logo is drawn on white) replaces the product name when the company has one */
.side a.side-logo { display: block; background: #fff; border-radius: 12px; padding: 10px 12px; margin: 0 4px 14px; box-shadow: none; }
.side a.side-logo:hover { background: #fff; }
.side a.side-logo:focus-visible { outline: 2px solid var(--teal-400); outline-offset: 2px; }
.side a.side-logo img { display: block; width: 100%; max-height: 64px; height: auto; object-fit: contain; }
@media (max-width: 900px) { .side a.side-logo { width: 100%; margin: 0 0 6px; padding: 8px 12px; } .side a.side-logo img { max-width: 220px; max-height: 48px; margin: 0 auto; } }

/* Drivers → Add driver: one form with a login choice */
.pform .pgrid + .pform-title { margin-top: 8px; padding-top: 18px; border-top: 1px solid var(--line); }
.pmodes { border: 0; padding: 0; margin: 0 0 14px; display: grid; gap: 10px; }
.pmode { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border: 1px solid #d0d5dd; border-radius: 8px; background: #fff; cursor: pointer; font-weight: 400; margin: 0; }
.pmode:has(input:checked) { border-color: var(--teal-600); background: #f1faf8; }
.pmode:has(input:focus-visible) { outline: 2px solid var(--teal-400); outline-offset: 2px; }
.pmode input { margin-top: 4px; width: 18px; height: 18px; flex: none; }
.pmode b { display: block; font-weight: 700; color: var(--ink); }
.pmode small { display: block; color: var(--ink-soft); font-size: 13px; margin-top: 2px; }
.pmodes-error { margin: -6px 0 14px; }
.pmode-panel[hidden] { display: none; }
.pgrid select { width: 100%; height: 46px; padding: 0 12px; }
.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; }
.dshow { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; }
.dshow dt { color: var(--ink-soft); font-size: 13px; margin-top: 14px; }
.dshow dd { margin: 2px 0 0; font-weight: 600; }
@media (max-width: 640px) { .dshow { grid-template-columns: 1fr; } }

/* Move vehicle / driver: who is moved and where it is now */
.move-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 20px; background: #f6f8fb; border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; margin-bottom: 20px; }
.move-summary > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.move-label { font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-soft); }
.pform .info-box { margin: 4px 0 20px; }
@media (max-width: 640px) { .move-summary { grid-template-columns: 1fr; } }
.move-summary .badge { align-self: flex-start; margin-top: 4px; }
.vlink { white-space: nowrap; }

/* Fuel list on a phone: the card header and the filter toolbar wrap instead of pushing buttons outside the card */
.card-head { flex-wrap: wrap; row-gap: 8px; }
.head-actions { flex-wrap: wrap; }
.toolbar .date-range { flex-wrap: wrap; max-width: 100%; }
.toolbar input[type=date] { min-width: 0; max-width: 100%; }
@media (max-width: 560px) {
    .toolbar input[type=text], .toolbar select { flex: 1 1 100%; min-width: 0; width: 100%; }
    .head-actions { width: 100%; }
    .head-actions .btn { flex: 1 1 auto; text-align: center; }
}
.pgrid .check input[type=checkbox] { width: 16px; height: 16px; padding: 0; flex: none; }
.pgrid .check-field .check { margin: 0; }

/* Fuel purchase detail page */
.fx-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; padding: 4px 0 16px; }
.fx-stat { background: #f6f8fb; border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.fx-label { color: var(--ink-soft); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.fx-big { font-size: 20px; font-weight: 700; color: var(--ink); overflow-wrap: anywhere; }
.fx-diff { background: #fff8e6; border: 1px solid #f1d58a; border-radius: 8px; padding: 10px 14px; margin-bottom: 16px; font-size: 14px; line-height: 1.5; }
.fx-title { margin: 8px 0 0; padding-top: 14px; border-top: 1px solid var(--line); font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-soft); }
.fx-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px 24px; margin: 0; padding: 14px 0 18px; }
.fx-grid > div { min-width: 0; }
.fx-grid dt { margin: 0 0 3px; color: var(--ink-soft); font-size: 12px; }
.fx-grid dd { margin: 0; font-size: 15px; color: var(--ink); overflow-wrap: anywhere; }
.fx-grid .fx-wide { grid-column: 1 / -1; }
.fx-timeline { list-style: none; margin: 0; padding: 4px 0 0 18px; border-left: 2px solid var(--line); }
.fx-timeline li { position: relative; margin: 0 0 14px; padding-left: 14px; }
.fx-timeline li::before { content: ""; position: absolute; left: -25px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--brand, #1d4ed8); border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line); }
@media (max-width: 860px) { .fx-summary, .fx-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .fx-summary, .fx-grid { grid-template-columns: 1fr; } }

/* Fuel pages: same type scale as Trips and Vehicles */
body:has(.fuel-page) .topbar h1 { font-size: 24px; }
body:has(.fuel-page) .topbar .lede { font-size: 14px; }
.fuel-page .card-head h3, .fuel-page .card h3 { font-size: 16px; }
.fuel-page .stat .value { font-size: 22px; line-height: 1.15; }
.fuel-page .stat .label { font-size: 12.5px; }
.fuel-page .kpi { gap: 12px; }
.fuel-page .kpi .ico-wrap { width: 42px; height: 42px; }
.fuel-page .kpi .ico-wrap svg { width: 20px; height: 20px; }
.fuel-page table, .fuel-page td, .fuel-page .btn, .fuel-page input, .fuel-page select, .fuel-page textarea { font-size: 14px; }
.fuel-page th, .fuel-page .small, .fuel-page .hint, .fuel-page .muted.small, .fuel-page .badge { font-size: 12.5px; }
.fuel-page .btn-sm { font-size: 13px; }
.fuel-page .pgrid input, .fuel-page .pgrid select { height: 40px; }
.fuel-page .pgrid label, .fuel-page .field label { font-size: 13.5px; }
.fuel-page .fx-big { font-size: 18px; }
.fuel-page .fx-grid dd { font-size: 14px; }
.fuel-page .fx-label, .fuel-page .fx-grid dt { font-size: 12px; }
.fuel-page .fx-title { font-size: 12px; }
.fuel-page .row-actions { flex-wrap: nowrap; gap: 4px; }
.fuel-page .icon-btn { width: 32px; height: 32px; }
.fuel-page .icon-btn svg { width: 16px; height: 16px; }
.fuel-page td, .fuel-page th { padding: 10px 8px; }
.fuel-page td:first-child, .fuel-page td:nth-child(7), .fuel-page td:nth-child(8), .fuel-page td:last-child { white-space: nowrap; }
.fuel-page .grid-4 { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)) !important; }
.fuel-page .stat .value { font-size: 22px; white-space: nowrap; }
.fuel-page .stat .label { line-height: 1.3; }

/* ONE type scale for every module (Overview, Trips, Vehicles, Drivers, Projects, Fuel, Team, Audit log, Settings).
   Scoped to the signed-in layout (.topbar / .content) so the login pages keep their own sizes. */
.topbar h1 { font-size: 24px; letter-spacing: -0.01em; }
.topbar .lede { font-size: 14px; }
.content .card h3, .content .card-head h3 { font-size: 16px; }
.content .sec-title { font-size: 16px; }
.content .stat .label { font-size: 12.5px; line-height: 1.3; }
.content .stat .value { font-size: 22px; line-height: 1.15; }
.content .stat .hint { font-size: 12.5px; }
.content .kpi { gap: 12px; }
.content .kpi .ico-wrap { width: 42px; height: 42px; }
.content .kpi .ico-wrap svg { width: 20px; height: 20px; }
.content table, .content td, .content .btn, .content input, .content select, .content textarea, .content label, .content p { font-size: 14px; }
.content th, .content .small, .content .hint, .content .field .hint, .content .badge, .content .muted.small, .content .field-error, .content .info-line { font-size: 12.5px; }
.content .btn-sm { font-size: 13px; }
.content .alert, .content .note { font-size: 14px; }
.content td, .content th { padding: 10px 8px; }
.content .icon-btn { width: 32px; height: 32px; }
.content .icon-btn svg { width: 16px; height: 16px; }
.content .row-actions { gap: 4px; }

/* Shared desktop navigation: the header sits in .main, so no top offset is needed. */
@media (min-width: 901px) {
  .shell { grid-template-columns: 228px minmax(0, 1fr); }
  .side {
    position: sticky;
    top: 0;
    align-self: start;
    height: 100vh;
    height: 100dvh;
    min-width: 0;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    flex-direction: column;
    flex-wrap: nowrap;
  }
  .side > * { flex-shrink: 0; }
  .side .side-foot {
    display: block;
    position: sticky;
    bottom: -22px;
    background: var(--navy-900);
    margin-bottom: -22px;
    padding-bottom: 22px;
  }
  .side-logout { margin: 12px 0 0; }
  .side-logout button {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #6f86a3;
    border-radius: 8px;
    background: transparent;
    color: #fff;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
  }
  .side-logout button:hover { background: var(--navy-700); }
  .side-logout button:focus-visible { outline: 2px solid var(--teal-400); outline-offset: 2px; }
}

/* One brand per viewport; keep navigation and the desktop sticky sidebar intact. */
.header-brand { display: none; }
@media (max-width: 900px) {
  .side a.side-logo, .side .side-brand { display: none; }
  .header-brand { display: inline-flex; align-items: center; flex: none; order: -1; }
  .header-brand .top-logo { width: auto; height: auto; max-width: 120px; max-height: 32px; object-fit: contain; }
  .header-brand .top-default { font-size: 13px; letter-spacing: .08em; }
  .topbar .who { gap: 12px; }
}

/* Shared header palette; navigation and page content retain their existing styles. */
.topbar {
  background: #E7F3F3;
  border-bottom: 1px solid #CFE3E4;
  padding-bottom: 22px;
}
.topbar h1,
.topbar .notification-bell > summary,
.topbar .usermenu > summary {
  color: #0D2542;
}
.topbar .notification-count { background: #008B87; }

/* Sidebar/session review delta. */
.sidebar-toggle,.mobile-nav-toggle{border:1px solid #CFE3E4;border-radius:8px;background:transparent;color:inherit;min-width:44px;height:44px;cursor:pointer;font-size:22px}
.mobile-nav-toggle{display:none;color:#0D2542}
.side .sidebar-toggle{color:white;align-self:flex-end}
.nav-label{min-width:0}
.drawer-backdrop{display:none}
#idle-warning{max-width:420px;width:calc(100% - 32px);padding:24px;border:1px solid #CFE3E4;border-radius:14px;color:#0D2542}
#idle-warning::backdrop{background:#0D254288}
@media(min-width:901px){
 .shell.sidebar-collapsed{grid-template-columns:76px minmax(0,1fr)}
 .sidebar-collapsed .side{padding-left:12px;padding-right:12px}
 .sidebar-collapsed .side .nav-label,.sidebar-collapsed .side-brand{display:none}
 .sidebar-collapsed .side a:not(.side-logo){justify-content:center;min-height:44px;padding:10px}
 .sidebar-collapsed .side-logo{width:52px;padding:3px;overflow:hidden}
 .sidebar-collapsed .side-logo img{width:46px;height:auto;object-fit:contain}
 .sidebar-collapsed .side-logout button{font-size:0}

}
@media(max-width:900px){
 .shell{display:block}
 .mobile-nav-toggle{display:inline-flex;align-items:center;justify-content:center}
 .shell .side{position:fixed;z-index:101;top:0;left:0;bottom:0;width:min(280px,85vw);height:100dvh;display:flex;flex-direction:column;flex-wrap:nowrap;align-items:stretch;overflow-y:auto;transform:translateX(-105%);visibility:hidden}
 .shell.drawer-open .side{transform:none;visibility:visible}
 .shell.drawer-open .side a.side-logo{display:flex}
 .shell.drawer-open .side .side-brand{display:block}
 .shell.drawer-open .header-brand{visibility:hidden}
 .shell.drawer-open .drawer-backdrop{display:block;position:fixed;inset:0;z-index:100;background:#0D254288;border:0;width:100%;height:100%}
 body.drawer-active{overflow:hidden}
 .shell .side .side-foot{display:block;margin-top:auto;width:100%}
 .side .sidebar-toggle{flex-shrink:0}
}

@media(max-width:900px){.side-logout button{width:100%;min-height:44px;border:1px solid #6f86a3;border-radius:8px;background:transparent;color:white;font:inherit;cursor:pointer}.side>*{flex-shrink:0}}

.logout-icon{display:none}
@media(min-width:901px){.sidebar-collapsed .side .side-foot{padding-left:0;padding-right:0}.sidebar-collapsed .side-logout button{display:flex;align-items:center;justify-content:center;min-height:44px;padding:10px 4px}.sidebar-collapsed .logout-text{display:none}.sidebar-collapsed .logout-icon{display:block}}

/* Compact shared brand header: a single row in every navigation state. */
.side .sidebar-brand-row { display:flex; align-items:center; gap:8px; min-width:0; margin:0 0 16px; }
.side .sidebar-brand-row .side-logo { display:flex; align-items:center; flex:1 1 auto; min-width:0; width:auto; margin:0; padding:7px; border-radius:8px; }
.sidebar-logo-frame { display:block; width:100%; overflow:hidden; }
.side .sidebar-brand-row .side-logo img { display:block; width:100%; height:auto; max-height:none; margin:0; object-fit:contain; }
.side .sidebar-brand-row .side-brand { flex:1; min-width:0; margin:0; padding:0; font-size:17px; overflow-wrap:anywhere; }
.side .sidebar-brand-row .sidebar-toggle { display:inline-flex; align-items:center; justify-content:center; align-self:center; flex:0 0 40px; width:40px; min-width:40px; height:40px; padding:0; }
.sidebar-toggle:focus-visible { outline:2px solid var(--teal-400); outline-offset:2px; }
.sidebar-close-icon { display:none; }
@media(min-width:901px) {
 .shell.sidebar-collapsed { grid-template-columns:96px minmax(0,1fr); }
 .sidebar-collapsed .side { padding-left:8px; padding-right:8px; }
 .sidebar-collapsed .sidebar-brand-row { gap:8px; }
 .sidebar-collapsed .side .sidebar-brand-row .side-logo { flex:0 0 32px; width:32px; padding:4px; }
 .sidebar-collapsed .sidebar-logo-frame { width:24px; height:28px; }
 /* Show the existing emblem at the left of the original wordmark, without stretching. */
 .sidebar-collapsed .side .sidebar-brand-row .side-logo img { width:160px; max-width:none; height:auto; }
 .sidebar-collapsed .side .sidebar-brand-row .side-brand { display:block; font-size:10px; }
}
@media(max-width:900px) {
 .shell.drawer-open .side .sidebar-brand-row .side-logo { display:flex; }
 .sidebar-menu-icon { display:none; }
 .sidebar-close-icon { display:block; }
}

/* Reserve branding before image decode; only navigation scrolls inside the rail. */
.side .sidebar-brand-row { height:64px; flex:0 0 64px; }
.side .sidebar-brand-row .side-logo { height:54px; box-sizing:border-box; }
.sidebar-logo-frame { aspect-ratio:352 / 97; }
.side .sidebar-brand-row .side-logo img { aspect-ratio:352 / 97; }
.side .sidebar-nav { display:flex; flex-direction:column; gap:4px; flex:1 1 auto; min-height:0; overflow-y:auto; overflow-x:hidden; overscroll-behavior:contain; }
.shell .side { overflow:hidden; }
.shell .side .side-foot { position:static; flex:0 0 auto; margin:0; padding-bottom:0; }
@media(min-width:901px) {
 .sidebar-collapsed .side .sidebar-brand-row .side-logo { height:36px; }
 .sidebar-collapsed .sidebar-logo-frame { aspect-ratio:auto; }
}
/* No shell/brand load transitions. Preference is applied synchronously above the rail. */
.shell,.side,.sidebar-brand-row,.sidebar-logo-frame { transition:none; }

/* Approved shared shell: one header toggle, personal profile and flow footer. */
.main { display:flex; flex-direction:column; min-height:100vh; min-height:100dvh; }
.main > .content { flex:1 0 auto; align-content:start; width:100%; box-sizing:border-box; }
.topbar { min-height:72px; padding:12px 28px; flex-wrap:nowrap; box-sizing:border-box; }
.topbar .mobile-nav-toggle { display:inline-flex; align-items:center; justify-content:center; flex:none; }
.topbar .who { margin-left:auto; min-width:0; }
.side .sidebar-brand-row .sidebar-toggle { display:none; }
.page-intro h1 { font-size:28px; line-height:1.25; letter-spacing:-.02em; }
.page-intro .lede { color:var(--ink-soft); font-size:14px; margin-top:5px; }
.avatar { flex:none; overflow:hidden; }
.avatar img { width:100%; height:100%; object-fit:cover; border-radius:50%; }
.account-name { max-width:200px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:14px; }
.usermenu .menu { width:260px; max-width:calc(100vw - 24px); }
.usermenu .menu-head { overflow-wrap:anywhere; }
.usermenu .menu-item { text-decoration:none; }
.usermenu summary:focus-visible,.mobile-nav-toggle:focus-visible { outline:2px solid #008B87; outline-offset:3px; }
.app-footer { display:flex; justify-content:space-between; gap:12px 24px; flex-wrap:wrap; padding:18px 28px; border-top:1px solid #CFE3E4; background:#fff; color:#0D2542; font-size:12px; line-height:1.6; }
.developer-name { color:#008B87; font-weight:600; }
.profile-card { max-width:560px; width:100%; box-sizing:border-box; }
.profile-card form { display:grid; gap:16px; }
.profile-card .profile-photo { width:88px; height:88px; border-radius:50%; object-fit:cover; }
.profile-card label { display:block; margin-bottom:6px; font-weight:600; }
.profile-card input { width:100%; min-height:44px; box-sizing:border-box; }
.profile-card .profile-identity { display:grid; gap:6px; margin-bottom:20px; overflow-wrap:anywhere; }
.profile-card .profile-actions { display:flex; gap:12px; flex-wrap:wrap; margin-top:16px; }
@media(min-width:901px) {
 .shell.sidebar-collapsed { grid-template-columns:76px minmax(0,1fr); }
 .sidebar-collapsed .sidebar-brand-row { justify-content:center; }
}
@media(max-width:900px) {
 .topbar { display:grid; grid-template-columns:minmax(0,1fr) auto minmax(0,1fr); gap:8px; padding:10px 12px; }
 .topbar .header-brand { order:initial; display:flex; justify-content:center; min-width:0; }
 .header-brand .top-logo { max-width:112px; max-height:32px; width:auto; height:auto; }
 .topbar .who { gap:6px; margin:0; justify-self:end; }
 .account-name,.usermenu summary .caret { display:none; }
 .topbar .notification-bell > summary { width:32px; height:36px; }
 .side .sidebar-brand-row .sidebar-toggle { display:inline-flex; }
 .page-intro h1 { font-size:26px; }
 .app-footer { justify-content:center; text-align:center; padding:16px 20px; gap:4px; }
 .app-footer > span { width:100%; }
 .main .content .grid-4,.main .content .kpi-grid { grid-template-columns:minmax(0,1fr); }
 .content .table-wrap { max-width:100%; min-width:0; overflow-x:auto; }
}

.profile-card input[type="file"] { border:1px solid var(--line); border-radius:8px; padding:8px; background:#fff; font:inherit; }
.profile-card input[type="file"]::file-selector-button { border:0; border-radius:6px; padding:8px 12px; margin-right:10px; background:var(--teal-100); color:var(--navy-900); font:inherit; cursor:pointer; }

@media(max-width:900px) {
 .topbar .mobile-nav-toggle { width:44px; justify-self:start; }
 .main .content .kpi { min-height:94px; padding:16px; }
}

@media(max-width:900px) {
 .main .topbar .who { flex-wrap:nowrap; }
 .topbar .avatar { width:34px; height:34px; }
}

.content .grid-main > *, .content .grid-bottom > * { min-width:0; }
@media(max-width:900px) {
 .main .content .grid-main,.main .content .grid-bottom { grid-template-columns:minmax(0,1fr); }
}
/* Hide navigation scrollbar while preserving scrolling */
.side .sidebar-nav {
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.side .sidebar-nav::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}
