:root {
  --navy: #112e4d;
  --muted: #678093;
  --aqua: #73d8d5;
  --aqua-dark: #25aeb2;
  --aqua-pale: #ddf8f5;
  --coral: #ff6d79;
  --coral-pale: #ffe5e7;
  --butter: #ffd77b;
  --butter-pale: #fff4d4;
  --purple: #84236b;
  --white: #fffefa;
  --line: #e8eff1;
  --shadow: 0 16px 38px rgba(22, 80, 96, 0.12);
}

* { box-sizing: border-box; }
html { background: #dff8f6; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--navy);
  background:
    radial-gradient(circle at 8% 3%, rgba(255,255,255,.95) 0 5%, transparent 18%),
    linear-gradient(165deg, #b8f1ed 0, #f9fbf7 32%, #fff9f2 100%);
  font-family: ui-rounded, "SF Pro Rounded", "Arial Rounded MT Bold", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; }
button { color: inherit; }
.app-shell { width: min(100%, 560px); min-height: 100vh; margin: 0 auto; background: rgba(255,255,255,.57); position: relative; overflow: hidden; box-shadow: 0 0 70px rgba(19, 78, 92, .12); }
.topbar { display: flex; align-items: center; justify-content: space-between; padding: calc(14px + env(safe-area-inset-top)) 20px 12px; }
.brand { display: flex; align-items: center; gap: 11px; }
.brand-icon { width: 54px; height: 54px; border-radius: 18px; object-fit: cover; box-shadow: 0 8px 18px rgba(36, 119, 126, .2); }
.eyebrow { margin: 0 0 3px; font-size: 10px; font-weight: 900; letter-spacing: .15em; color: var(--aqua-dark); }
h1 { margin: 0; font-size: 22px; line-height: 1; letter-spacing: -.03em; }
h2 { margin: 0; font-size: 24px; letter-spacing: -.035em; }
.icon-button, .close-button { border: 0; width: 42px; height: 42px; border-radius: 15px; background: var(--white); box-shadow: 0 8px 22px rgba(21,73,86,.12); font-size: 23px; font-weight: 900; }
main { padding: 8px 18px calc(102px + env(safe-area-inset-bottom)); }
.view { display: none; animation: fade-in .2s ease; }
.view.active { display: block; }
@keyframes fade-in { from { opacity: 0; transform: translateY(4px); } }

.vehicle-card { width: 100%; border: 0; display: grid; grid-template-columns: 62px 1fr auto; align-items: center; gap: 13px; padding: 15px; text-align: left; background: linear-gradient(135deg, #84236b, #b53b7c); color: #fff; border-radius: 28px; box-shadow: 0 17px 32px rgba(98,32,93,.26); position: relative; overflow: hidden; }
.vehicle-card::after { content: ""; position: absolute; width: 110px; height: 110px; border: 22px solid rgba(255,255,255,.08); border-radius: 50%; right: -54px; top: -54px; }
.vehicle-art { width: 62px; height: 62px; display: grid; place-items: center; background: #fff6e4; border-radius: 21px; font-size: 34px; }
.vehicle-copy { display: flex; flex-direction: column; min-width: 0; }
.vehicle-label { font-size: 9px; font-weight: 900; letter-spacing: .16em; color: #ffd2ea; }
.vehicle-copy strong { margin: 2px 0; font-size: 19px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vehicle-copy span:last-child { font-size: 11px; color: #f7d9eb; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vehicle-mileage { text-align: right; display: flex; flex-direction: column; padding-right: 3px; z-index: 1; }
.vehicle-mileage strong { font-size: 21px; }
.vehicle-mileage small { font-size: 9px; font-weight: 900; letter-spacing: .1em; color: #ffd2ea; }

.status-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin: 15px 0 24px; }
.status-card { min-height: 116px; padding: 13px; border-radius: 23px; display: flex; flex-direction: column; box-shadow: 0 12px 26px rgba(22,80,96,.08); }
.status-card.coral { background: var(--coral-pale); color: #b83148; }
.status-card.aqua { background: var(--aqua-pale); color: #168c91; }
.status-card.butter { background: var(--butter-pale); color: #9d6a00; }
.status-icon { align-self: flex-start; width: 25px; height: 25px; border-radius: 10px; background: rgba(255,255,255,.8); display: grid; place-items: center; font-weight: 1000; font-size: 13px; }
.status-card strong { font-size: 25px; margin-top: auto; line-height: 1.1; overflow: hidden; text-overflow: ellipsis; }
.status-card > span:last-child { font-size: 10px; font-weight: 800; opacity: .78; }

.section-block { margin-top: 4px; }
.section-heading, .sheet-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.section-heading h2 { font-size: 21px; }
.text-button { border: 0; background: transparent; color: var(--coral); font-size: 12px; font-weight: 900; padding: 10px 0 10px 12px; }
.maintenance-list { display: grid; gap: 10px; }
.maintenance-item { display: grid; grid-template-columns: 47px 1fr auto; align-items: center; gap: 11px; padding: 12px; background: var(--white); border: 1px solid rgba(223,235,236,.85); border-radius: 22px; box-shadow: 0 9px 22px rgba(25,78,89,.07); }
.maintenance-icon { width: 47px; height: 47px; display: grid; place-items: center; border-radius: 16px; font-size: 23px; background: var(--aqua-pale); }
.maintenance-copy { min-width: 0; }
.maintenance-copy strong { display: block; font-size: 14px; margin-bottom: 3px; }
.maintenance-copy span { display: block; font-size: 10px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.maintenance-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 7px; }
.status-pill { font-size: 9px; font-weight: 900; padding: 5px 8px; border-radius: 999px; text-transform: uppercase; letter-spacing: .04em; }
.status-pill.overdue { color: #ba3046; background: var(--coral-pale); }
.status-pill.soon { color: #9b6500; background: var(--butter-pale); }
.status-pill.good { color: #13898e; background: var(--aqua-pale); }
.status-pill.untracked { color: #786a73; background: #f4eef4; }
.done-button { border: 0; border-radius: 11px; background: var(--navy); color: white; font-size: 10px; font-weight: 900; padding: 7px 10px; }
.empty-state { padding: 28px 18px; border-radius: 24px; background: rgba(255,255,255,.7); text-align: center; color: var(--muted); }
.empty-state strong { display: block; color: var(--navy); margin-bottom: 4px; }
.tip-card, .data-card { margin-top: 15px; display: flex; gap: 12px; align-items: flex-start; padding: 15px; border-radius: 23px; background: #e9f7ff; border: 1px dashed #acddeb; }
.tip-card > span { font-size: 25px; }
.tip-card strong, .data-card strong { font-size: 13px; }
.tip-card p, .data-card p { margin: 3px 0 0; font-size: 10px; line-height: 1.5; color: var(--muted); }

.page-heading { margin: 8px 2px 18px; }
.page-heading p:last-child { margin: 6px 0 0; color: var(--muted); font-size: 12px; }
.filter-row { display: flex; gap: 7px; overflow-x: auto; padding: 0 0 12px; scrollbar-width: none; }
.filter-row::-webkit-scrollbar { display: none; }
.filter-chip { flex: 0 0 auto; border: 0; padding: 9px 13px; border-radius: 999px; background: rgba(255,255,255,.8); font-size: 11px; font-weight: 850; }
.filter-chip.active { background: var(--navy); color: white; }
.full-list { margin-bottom: 12px; }
.add-button { width: 100%; border: 2px dashed #9bdedc; background: rgba(226,249,246,.75); color: #178e93; border-radius: 21px; padding: 14px; font-weight: 900; }
.add-button span { font-size: 18px; vertical-align: -1px; }

.spend-card { background: linear-gradient(135deg, #1b4d6f, #17344f); color: white; border-radius: 27px; padding: 20px; box-shadow: var(--shadow); display: flex; flex-direction: column; margin-bottom: 14px; }
.spend-card > span { font-size: 11px; color: #bce8e8; }
.spend-card strong { font-size: 34px; margin: 7px 0; }
.spend-card strong small { font-size: 16px; color: var(--aqua); }
.history-list { display: grid; gap: 10px; }
.history-item { padding: 14px; background: var(--white); border-radius: 21px; display: grid; grid-template-columns: 1fr auto; gap: 10px; box-shadow: 0 9px 22px rgba(25,78,89,.07); }
.history-item strong { font-size: 14px; }
.history-item p { grid-column: 1 / -1; margin: -2px 0 0; color: var(--muted); font-size: 10px; }
.history-meta { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; }
.history-cost { font-weight: 950; color: var(--purple); }

.form-card { background: var(--white); padding: 16px; border-radius: 25px; box-shadow: var(--shadow); }
.sheet-form, .vehicle-form { display: grid; gap: 12px; }
label { display: grid; gap: 6px; font-size: 10px; font-weight: 900; color: #546c7d; }
input, select, textarea { width: 100%; border: 1px solid #dce8e8; color: var(--navy); background: #fbfdfb; border-radius: 14px; padding: 12px 13px; outline: none; font-size: 14px; }
input:focus, select:focus, textarea:focus { border-color: var(--aqua-dark); box-shadow: 0 0 0 3px rgba(115,216,213,.2); }
textarea { resize: vertical; }
.split-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.primary-button { border: 0; border-radius: 16px; padding: 14px; background: linear-gradient(135deg, var(--coral), #f04e7c); color: white; font-weight: 950; box-shadow: 0 10px 20px rgba(239,76,112,.24); }
.data-card { display: block; background: var(--butter-pale); border-color: #efd38c; }
.data-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 13px; }
.data-actions button, .import-label { display: grid; place-items: center; border: 0; border-radius: 13px; padding: 11px; background: white; color: var(--navy); font-size: 10px; font-weight: 900; cursor: pointer; }
.import-label input { display: none; }

.bottom-nav { position: fixed; z-index: 20; bottom: 0; left: 50%; transform: translateX(-50%); width: min(100%, 560px); display: grid; grid-template-columns: repeat(4, 1fr); padding: 9px 10px calc(8px + env(safe-area-inset-bottom)); background: rgba(255,255,255,.94); border-top: 1px solid rgba(220,234,235,.9); backdrop-filter: blur(18px); }
.nav-button { border: 0; background: transparent; display: flex; flex-direction: column; align-items: center; gap: 3px; color: #8a9da7; font-size: 9px; font-weight: 850; padding: 5px; }
.nav-button span { width: 30px; height: 26px; display: grid; place-items: center; border-radius: 10px; font-size: 18px; }
.nav-button.active { color: var(--purple); }
.nav-button.active span { background: #ffe0ef; }

.modal { display: none; position: fixed; inset: 0; z-index: 50; }
.modal.open { display: block; }
.modal-backdrop { position: absolute; inset: 0; border: 0; background: rgba(15,43,62,.48); backdrop-filter: blur(3px); }
.bottom-sheet { position: absolute; left: 50%; bottom: 0; transform: translateX(-50%); width: min(100%, 560px); max-height: 92vh; overflow-y: auto; padding: 9px 20px calc(24px + env(safe-area-inset-bottom)); background: #fffefa; border-radius: 30px 30px 0 0; animation: slide-up .22s ease; }
@keyframes slide-up { from { transform: translate(-50%, 30px); opacity: .7; } }
.sheet-handle { width: 42px; height: 5px; border-radius: 999px; margin: 0 auto 17px; background: #d9e2e2; }
.sheet-heading h2 { font-size: 21px; }
.close-button { box-shadow: none; background: #eef5f4; }
.toast { position: fixed; z-index: 80; left: 50%; bottom: calc(92px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); background: var(--navy); color: #fff; padding: 11px 16px; border-radius: 999px; font-size: 11px; font-weight: 850; opacity: 0; pointer-events: none; transition: .2s ease; white-space: nowrap; box-shadow: var(--shadow); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (min-width: 700px) {
  body { padding: 20px 0; }
  .app-shell { min-height: calc(100vh - 40px); border-radius: 34px; }
  .bottom-nav { bottom: 20px; border-radius: 0 0 34px 34px; }
  .bottom-sheet { bottom: 20px; border-radius: 30px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
