
/* -----------------------------------------
   Family Garage — base styles
----------------------------------------- */

:root {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #202938;
  background: #f3f5f8;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;

  --color-primary: #2459a9;
  --color-primary-dark: #194680;
  --color-border: #dce2ea;
  --color-muted: #647184;
  --color-surface: #ffffff;
  --color-background: #f3f5f8;
  --color-danger: #a82e36;
  --radius: 12px;
  --shadow: 0 3px 12px rgb(26 39 58 / 6%);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: var(--color-background);
}

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

button {
  min-height: 40px;
  padding: 9px 14px;
  border: 1px solid var(--color-primary);
  border-radius: 8px;
  background: var(--color-primary);
  color: #ffffff;
  font-weight: 600;
  cursor: pointer;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    transform 0.15s ease;
}

button:hover:not(:disabled) {
  background: var(--color-primary-dark);
  border-color: var(--color-primary-dark);
}

button:active:not(:disabled) {
  transform: translateY(1px);
}

button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgb(36 89 169 / 25%);
  outline-offset: 2px;
}

input,
select,
textarea {
  width: 100%;
  min-width: 0;
  padding: 10px 11px;
  border: 1px solid #cbd3df;
  border-radius: 8px;
  background: #ffffff;
  color: #202938;
}

textarea {
  resize: vertical;
}

input::placeholder,
textarea::placeholder {
  color: #8993a2;
}

h1,
h2,
h3,
h4,
h5,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 8px;
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  letter-spacing: -0.04em;
}

h2 {
  margin-bottom: 16px;
  font-size: 1.35rem;
}

h3 {
  margin-bottom: 8px;
  font-size: 1.2rem;
}

h4 {
  margin-bottom: 14px;
  font-size: 1.05rem;
}

h5 {
  margin-bottom: 10px;
  font-size: 0.98rem;
}

p {
  line-height: 1.55;
}

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

/* -----------------------------------------
   Main page layout
----------------------------------------- */

header,
main,
footer {
  width: min(1120px, calc(100% - 40px));
  margin-right: auto;
  margin-left: auto;
}

header {
  padding: 38px 0 24px;
}

header p {
  max-width: 680px;
  margin-bottom: 0;
  color: var(--color-muted);
}

main {
  padding-bottom: 48px;
}

main > section {
  margin-bottom: 24px;
}

footer {
  padding: 20px 0 32px;
  border-top: 1px solid var(--color-border);
  color: var(--color-muted);
  font-size: 0.9rem;
}

/* -----------------------------------------
   Dashboard summary
----------------------------------------- */

.dashboard,
.dashboard-summary,
.dashboard-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.dashboard-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.dashboard-heading h2 {
  margin-bottom: 8px;
  font-size: clamp(1.6rem, 3vw, 2.15rem);
  letter-spacing: -0.035em;
}

.dashboard-heading > div > p:last-child {
  margin-bottom: 0;
  color: var(--color-muted);
}

.primary-link {
  display: inline-flex;
  min-height: 48px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  border: 1px solid var(--color-primary);
  border-radius: 9px;
  background: var(--color-primary);
  color: #ffffff;
  font-weight: 700;
  text-decoration: none;
}

.primary-link:hover {
  background: var(--color-primary-dark);
  color: #ffffff;
}

.dashboard-card,
.summary-card,
.stat-card {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
  box-shadow: var(--shadow);
}

.summary-card {
  display: flex;
  min-height: 132px;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
}

.summary-card--overdue {
  border-top: 4px solid #b84949;
}

.summary-card--due-soon {
  border-top: 4px solid #c58a23;
}

.summary-label {
  color: var(--color-muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.summary-detail {
  margin-top: 5px;
  color: var(--color-muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.dashboard-card p,
.summary-card p,
.stat-card p {
  margin-bottom: 6px;
  color: var(--color-muted);
  font-size: 0.9rem;
}

.dashboard-card strong,
.summary-card strong,
.stat-card strong {
  display: block;
  margin-top: 4px;
  font-size: 2rem;
  line-height: 1.2;
}

/* -----------------------------------------
   General sections and forms
----------------------------------------- */

section {
  min-width: 0;
}

#vehicle-form,
.vehicle-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  padding: 22px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
  box-shadow: var(--shadow);
}

#vehicle-form label,
.vehicle-form label,
.profile-field label {
  display: block;
  margin-bottom: 6px;
  color: #364255;
  font-size: 0.9rem;
  font-weight: 650;
}

#vehicle-form button,
#vehicle-form .form-actions,
.vehicle-form button,
.vehicle-form .form-actions {
  align-self: end;
}

#vehicle-form button[type="submit"] {
  justify-self: start;
}

#form-message {
  margin-top: 12px;
  color: var(--color-primary-dark);
  font-weight: 600;
}

#form-message:empty {
  display: none;
}

.add-vehicle-panel {
  padding: 24px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
  box-shadow: var(--shadow);
}

.add-vehicle-panel .panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.add-vehicle-panel .panel-heading h2 {
  margin-bottom: 0;
}

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

/* -----------------------------------------
   Backup and restore
----------------------------------------- */

.backup-controls {
  margin-bottom: 22px;
  padding: 18px 20px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
}

.backup-controls h3 {
  margin-bottom: 8px;
}

.backup-controls p {
  margin-bottom: 14px;
  color: var(--color-muted);
}

.vehicle-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.backup-controls .vehicle-actions {
  align-items: center;
}

/* -----------------------------------------
   Garage list and vehicle cards
----------------------------------------- */

#vehicle-list,
.vehicle-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 16px;
}

.vehicle-card {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 20px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
  box-shadow: var(--shadow);
}

.vehicle-card > h3 {
  margin-bottom: 4px;
  font-size: 1.4rem;
}

.vehicle-card > p {
  margin-bottom: 8px;
  color: var(--color-muted);
  overflow-wrap: anywhere;
}

.vehicle-card .vehicle-description {
  min-height: 1.5em;
  color: #364255;
  font-weight: 650;
}

.vehicle-card .vehicle-summary-meta {
  font-size: 0.9rem;
}

.vehicle-card .vehicle-vin {
  margin-top: auto;
  font-size: 0.78rem;
  letter-spacing: 0.025em;
}

.open-vehicle-button {
  width: 100%;
  min-height: 48px;
  margin-top: 8px;
}

.remove-button {
  border-color: #e2b8bb;
  background: #fff5f5;
  color: var(--color-danger);
}

.remove-button:hover:not(:disabled) {
  border-color: var(--color-danger);
  background: #fae5e6;
  color: #85232a;
}

.empty-state {
  grid-column: 1 / -1;
  padding: 28px;
  border: 1px dashed #b9c4d3;
  border-radius: var(--radius);
  background: #ffffff;
  color: var(--color-muted);
  text-align: center;
}

/* -----------------------------------------
   Vehicle tab navigation
----------------------------------------- */

.vehicle-workspace {
  min-width: 0;
}

.workspace-shell {
  min-width: 0;
  padding: clamp(16px, 3vw, 28px);
  border: 1px solid var(--color-border);
  border-radius: 16px;
  background: var(--color-surface);
  box-shadow: var(--shadow);
}

.workspace-header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.workspace-title-block {
  min-width: 0;
}

.workspace-title-block h2 {
  margin-bottom: 4px;
  font-size: clamp(1.5rem, 3vw, 2rem);
  overflow-wrap: anywhere;
}

.workspace-title-block p {
  margin-bottom: 0;
  color: var(--color-muted);
  overflow-wrap: anywhere;
}

.back-to-garage {
  min-height: 48px;
  border-color: var(--color-border);
  background: #ffffff;
  color: var(--color-primary-dark);
}

.back-to-garage:hover:not(:disabled) {
  border-color: var(--color-primary);
  background: #edf4ff;
  color: var(--color-primary-dark);
}

.workspace-actions {
  justify-content: flex-end;
}

#vehicle-workspace-view[hidden],
#dashboard-view[hidden] {
  display: none !important;
}

.vehicle-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 6px;
  border: 1px solid var(--color-border);
  border-radius: 10px 10px 0 0;
  background: #edf1f6;
}

.vehicle-tab {
  min-height: 48px;
  padding: 10px 16px;
  border-color: transparent;
  background: transparent;
  color: #4b586b;
  font-weight: 650;
}

.vehicle-tab:hover:not(:disabled) {
  border-color: #d0d9e6;
  background: #ffffff;
  color: #26374f;
}

.vehicle-tab.active,
.vehicle-tab[aria-selected="true"] {
  border-color: var(--color-primary);
  background: var(--color-primary);
  color: #ffffff;
}

.vehicle-tab-panel {
  min-width: 0;
  padding: 24px;
  border: 1px solid var(--color-border);
  border-top: 0;
  border-radius: 0 0 10px 10px;
  background: #ffffff;
}

.vehicle-tab-panel[hidden] {
  display: none !important;
}

.vehicle-tab-panel > h4:first-child {
  margin-top: 0;
}

.vehicle-tab-panel > p {
  color: #465367;
}

/* -----------------------------------------
   Vehicle profile
----------------------------------------- */

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

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

.profile-field:has(textarea) {
  grid-column: 1 / -1;
}

.vehicle-profile > button {
  justify-self: start;
}

/* -----------------------------------------
   Maintenance planner
----------------------------------------- */

.maintenance-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 16px 0 24px;
  padding: 18px;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  background: #f8fafd;
}

.maintenance-form .profile-field:has(textarea) {
  grid-column: 1 / -1;
}

.maintenance-form button[type="submit"] {
  justify-self: start;
}

.maintenance-task-list {
  display: grid;
  gap: 14px;
}

.maintenance-task {
  min-width: 0;
  padding: 20px;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  background: #ffffff;
}

.maintenance-task h5 {
  overflow-wrap: anywhere;
}

.maintenance-task > .maintenance-status {
  display: inline-block;
  margin-bottom: 12px;
  padding: 4px 9px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
}

.maintenance-status--overdue {
  color: #8b1e1e;
  background: #fde8e8;
}

.maintenance-status--due-soon {
  color: #795000;
  background: #fff1cc;
}

.maintenance-status--on-track,
.maintenance-status--completed {
  color: var(--color-muted);
  background: #edf0f3;
}

.maintenance-task > p {
  margin-bottom: 10px;
  color: var(--color-muted);
  font-size: 0.92rem;
}

.maintenance-task > .profile-field {
  margin-bottom: 14px;
}

.maintenance-task .vehicle-actions {
  margin-top: 16px;
}

.maintenance-task .profile-field:has(textarea) {
  margin-top: 8px;
}

/* -----------------------------------------
   VIN decoding and review
----------------------------------------- */

.decoded-details {
  min-width: 0;
}

.decode-status {
  padding: 10px 12px;
  border-radius: 8px;
  background: #edf4ff;
  color: #234e88;
  overflow-wrap: anywhere;
}

.decoded-row {
  min-width: 0;
  margin-top: 14px;
  padding: 16px;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  background: #ffffff;
}

.decoded-row h5 {
  margin-bottom: 12px;
}

.decoded-row p {
  margin-bottom: 8px;
  overflow-wrap: anywhere;
}

.decoded-row input {
  margin: 8px 0 10px;
}

.decoded-row .vehicle-actions {
  margin-bottom: 12px;
}

.verify-field-button {
  margin-top: 6px;
}

.verify-field-button[aria-pressed="true"] {
  border-color: #8bb9a0;
  background: #edf8f0;
  color: #215c39;
}

.verify-field-button[aria-pressed="true"]:hover:not(:disabled) {
  border-color: #639879;
  background: #dff0e5;
  color: #17472b;
}

.verification-note {
  margin-top: 14px;
  color: var(--color-muted);
  font-size: 0.9rem;
}

/* -----------------------------------------
   Responsive layout
----------------------------------------- */

@media (max-width: 760px) {
  header,
  main,
  footer {
    width: min(100% - 28px, 1120px);
  }

  header {
    padding-top: 26px;
  }

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

  .dashboard-heading {
    align-items: flex-start;
  }

  #vehicle-form,
  .vehicle-form {
    grid-template-columns: 1fr;
    padding: 18px;
  }

  .vehicle-card {
    padding: 16px;
  }

  .vehicle-tab-panel {
    padding: 18px;
  }

  .vehicle-profile,
  .maintenance-form {
    grid-template-columns: 1fr;
  }

  .profile-field:has(textarea),
  .maintenance-form .profile-field:has(textarea) {
    grid-column: auto;
  }

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

  .vehicle-tab {
    width: 100%;
    padding-right: 8px;
    padding-left: 8px;
  }

  .vehicle-actions button {
    max-width: 100%;
  }

  .workspace-header {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .workspace-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
}

@media (max-width: 420px) {
  header,
  main,
  footer {
    width: calc(100% - 20px);
  }

  .vehicle-card {
    padding: 16px;
  }

  .vehicle-tab-panel {
    padding: 16px;
  }

  .vehicle-tabs {
    gap: 4px;
    padding: 4px;
  }

  .vehicle-tab {
    min-height: 48px;
    padding-right: 5px;
    padding-left: 5px;
    font-size: 0.82rem;
  }

  .vehicle-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .vehicle-actions button {
    width: 100%;
  }

  .maintenance-task {
    padding: 16px;
  }

  .dashboard-heading {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
  }

  .dashboard-heading .primary-link {
    width: 100%;
  }

  .summary-card {
    min-height: 118px;
    padding: 14px;
  }

  .summary-detail {
    font-size: 0.75rem;
  }

  .workspace-shell {
    padding: 14px;
  }

  .workspace-header {
    grid-template-columns: 1fr;
    align-items: stretch;
    gap: 12px;
  }

  .workspace-header .back-to-garage {
    justify-self: start;
  }

  .workspace-actions {
    grid-column: auto;
    flex-direction: column;
  }

  .workspace-actions button {
    width: 100%;
  }

  .add-vehicle-panel {
    padding: 18px;
  }
}

/* Header layout fix */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 0;
}

.brand h1 {
  margin: 4px 0 0;
}

.local-label {
  flex-shrink: 0;
  padding: 6px 10px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  color: var(--color-muted);
  font-size: 0.85rem;
}


.main-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  width: 100%;
  margin: 0 auto 24px;
}

.main-nav a {
  display: inline-block;
  padding: 10px 16px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-surface);
  color: var(--color-primary);
  text-decoration: none;
  font-weight: 600;
  transition: background 0.2s ease, color 0.2s ease;
}

.main-nav a:hover {
  background: var(--color-primary);
  color: #ffffff;
  text-decoration: none;
}

/* Clickable dashboard maintenance summary cards */
.dashboard-maintenance-link {
  cursor: pointer;
}

.dashboard-maintenance-link:focus-visible {
  outline: 3px solid var(--color-primary, currentColor);
  outline-offset: 3px;
}

/* Application shell */
:root {
  --color-primary: #3d7b75;
  --color-primary-dark: #2d615c;
  --color-border: #e2e7e7;
  --color-muted: #687779;
  --color-background: #f4f7f6;
  --color-danger: #a74444;
  --shadow: 0 8px 24px rgb(24 48 47 / 5%);
}

body {
  overflow-x: hidden;
  background: var(--color-background);
}

button {
  min-height: 44px;
  border-radius: 10px;
}

input,
select,
textarea {
  min-height: 44px;
  border-color: #d6dfde;
  border-radius: 9px;
}

.app-shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: 252px minmax(0, 1fr);
}

.app-sidebar {
  position: sticky;
  z-index: 30;
  top: 0;
  display: flex;
  height: 100vh;
  flex-direction: column;
  padding: 26px 16px 18px;
  background: #202d30;
  color: #f4f8f7;
}

.sidebar-brand {
  display: flex;
  min-height: 56px;
  align-items: center;
  gap: 12px;
  padding: 0 8px;
  color: #f4f8f7;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 13px;
  background: #4b8b83;
  color: #ffffff;
  font-size: 0.94rem;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.sidebar-brand-copy {
  display: grid;
  gap: 4px;
}

.sidebar-brand-copy strong {
  font-size: 1.02rem;
  letter-spacing: -0.02em;
}

.sidebar-brand-copy small {
  color: #aab9b8;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.sidebar-section-label {
  margin: 42px 10px 12px;
  color: #91a2a1;
  font-size: 0.67rem;
  font-weight: 750;
  letter-spacing: 0.13em;
}

.app-sidebar .main-nav {
  display: grid;
  width: 100%;
  justify-content: stretch;
  gap: 6px;
  margin: 0;
}

.app-sidebar .main-nav a {
  display: flex;
  min-height: 48px;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: #c4d0cf;
  font-size: 0.91rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.app-sidebar .main-nav a:hover {
  background: #2b3b3e;
  color: #ffffff;
}

.app-sidebar .main-nav a.active,
.app-sidebar .main-nav a[aria-current="page"] {
  border-color: rgb(126 181 171 / 16%);
  background: #314748;
  color: #ffffff;
}

.nav-icon {
  display: grid;
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  place-items: center;
  color: #9fb6b2;
  font-size: 1.15rem;
}

.main-nav a.active .nav-icon,
.main-nav a[aria-current="page"] .nav-icon {
  color: #a3d2c9;
}

.sidebar-bottom {
  display: grid;
  gap: 22px;
  margin-top: auto;
}

.sidebar-add-link {
  display: flex;
  min-height: 48px;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid #477d76;
  border-radius: 10px;
  background: #376c66;
  color: #ffffff;
  font-weight: 700;
  text-decoration: none;
}

.sidebar-add-link:hover {
  background: #438078;
}

.sidebar-add-link > span:first-child {
  font-size: 1.35rem;
  line-height: 1;
}

.sidebar-local-status {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 10px 2px;
  border-top: 1px solid #3a494b;
}

.status-indicator {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  margin-top: 5px;
  border-radius: 50%;
  background: #87c49b;
  box-shadow: 0 0 0 4px rgb(135 196 155 / 12%);
}

.sidebar-local-status span:last-child {
  display: grid;
  gap: 4px;
}

.sidebar-local-status strong {
  color: #e7efed;
  font-size: 0.78rem;
}

.sidebar-local-status small {
  color: #a0b0af;
  font-size: 0.73rem;
}

.app-main {
  display: flex;
  min-width: 0;
  min-height: 100vh;
  flex-direction: column;
}

.app-main > .topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  width: 100%;
  min-height: 74px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0;
  padding: 12px clamp(20px, 4vw, 52px);
  border-bottom: 1px solid #e7eceb;
  background: rgb(255 255 255 / 94%);
  backdrop-filter: blur(12px);
}

.topbar-context {
  display: grid;
  gap: 3px;
  margin-right: auto;
}

.topbar-kicker {
  color: #899796;
  font-size: 0.65rem;
  font-weight: 750;
  letter-spacing: 0.13em;
}

#topbar-page-title {
  color: #28383a;
  font-size: 0.96rem;
  font-weight: 700;
}

.app-main > .topbar .local-label {
  padding: 7px 11px;
  border-color: #e1e8e7;
  background: #f6f9f8;
  color: #637471;
}

.sidebar-toggle {
  display: none;
  width: 46px;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  border-color: #e1e8e7;
  background: #ffffff;
  color: #354647;
  font-size: 1.2rem;
}

.sidebar-backdrop {
  display: none;
}

.app-main > main {
  width: min(100%, 1500px);
  flex: 1;
  margin: 0 auto;
  padding: clamp(24px, 4vw, 52px) clamp(20px, 4vw, 52px) 56px;
}

.app-main > footer {
  display: flex;
  width: 100%;
  justify-content: space-between;
  gap: 16px;
  padding: 20px clamp(20px, 4vw, 52px);
  border-color: #e3e9e8;
  font-size: 0.78rem;
}

.app-main > footer p {
  margin: 0;
}

.dashboard-heading {
  margin-bottom: 28px;
}

.dashboard-heading h2 {
  color: #243638;
  font-size: clamp(1.8rem, 3vw, 2.35rem);
}

.dashboard-heading > div > p:last-child,
.section-description {
  color: #71807f;
}

.primary-link,
.open-vehicle-button {
  border-color: #3d7b75;
  background: #3d7b75;
}

.primary-link:hover,
.open-vehicle-button:hover:not(:disabled) {
  border-color: #2d615c;
  background: #2d615c;
}

.summary-card,
.vehicle-card,
.workspace-shell,
.add-vehicle-panel,
.backup-controls {
  border-color: #e4eae9;
  box-shadow: 0 8px 24px rgb(32 53 52 / 4%);
}

.summary-card {
  min-height: 142px;
}

.summary-card--overdue {
  border-top-color: #b84c4c;
}

.summary-card--due-soon {
  border-top-color: #c08b37;
}

.summary-card strong {
  color: #283a3b;
  font-size: 2.25rem;
  letter-spacing: -0.04em;
}

.summary-card--overdue strong {
  color: #a43f3f;
}

.summary-card--due-soon strong {
  color: #9a6a1b;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.section-heading h2,
.add-vehicle-panel h2 {
  color: #293a3b;
}

.add-vehicle-back {
  border-color: #d6e1df;
  background: #ffffff;
  color: #3e5552;
}

.add-vehicle-back:hover:not(:disabled) {
  border-color: #b8cbc7;
  background: #f3f8f6;
  color: #2d4643;
}

.section-heading > span {
  color: #72817f;
  font-size: 0.84rem;
  font-weight: 650;
}

.add-vehicle-panel {
  margin: 30px 0;
  padding: clamp(20px, 3vw, 30px);
}

#vehicle-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  padding: 22px;
  border-color: #edf0ef;
  background: #fbfcfc;
  box-shadow: none;
}

.vehicle-entry-field {
  min-width: 0;
}

.vehicle-entry-field label {
  display: block;
  margin-bottom: 7px;
  color: #425251;
  font-size: 0.84rem;
  font-weight: 700;
}

#vehicle-form .form-actions,
#vehicle-form > p,
#vin-decode-review {
  grid-column: 1 / -1;
}

#vehicle-form .form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

#vehicle-form [aria-live="polite"] {
  margin: 0;
  color: #647472;
  font-size: 0.87rem;
}

#vin-decode-review {
  padding: 18px;
  border: 1px solid #dfe9e6;
  border-radius: 12px;
  background: #f5f9f7;
}

#vin-decode-review h3 {
  color: #2e4947;
}

.backup-controls {
  padding: 20px;
}

.backup-controls h3 {
  color: #344647;
}

.workspace-shell {
  padding: clamp(18px, 3vw, 32px);
  border-radius: 16px;
}

.workspace-header {
  padding-bottom: 22px;
  border-bottom: 1px solid #e9eeed;
}

.workspace-title-block h2 {
  color: #293b3c;
}

.workspace-title-block p {
  color: #73817f;
  font-size: 0.88rem;
}

.vehicle-tab-panel {
  padding: clamp(18px, 3vw, 30px);
  border-color: #e5ebea;
}

.vehicle-tabs {
  gap: 5px;
  border-color: #e5ebea;
  background: #f1f5f4;
}

.vehicle-tab {
  color: #5d6e6c;
}

.vehicle-tab.active,
.vehicle-tab[aria-selected="true"] {
  border-color: #3d7b75;
  background: #3d7b75;
  box-shadow: 0 3px 8px rgb(61 123 117 / 17%);
}

.maintenance-form {
  border-color: #e7edeb;
  background: #f7faf9;
}

.maintenance-task {
  border-color: #e5ebea;
  box-shadow: 0 4px 14px rgb(32 53 52 / 3%);
}

.maintenance-status--overdue {
  color: #923c3c;
  background: #fbecec;
}

.maintenance-status--due-soon {
  color: #805c1e;
  background: #fbf2df;
}

.dashboard-maintenance-link {
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.dashboard-maintenance-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 26px rgb(32 53 52 / 8%);
}

@media (max-width: 900px) {
  .app-shell {
    display: block;
  }

  .app-sidebar {
    position: fixed;
    left: 0;
    width: min(286px, calc(100vw - 52px));
    transform: translateX(-102%);
    transition: transform 0.2s ease;
    box-shadow: 18px 0 40px rgb(10 24 25 / 18%);
  }

  .sidebar-open .app-sidebar {
    transform: translateX(0);
  }

  .sidebar-open .sidebar-backdrop {
    position: fixed;
    z-index: 25;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
    border-radius: 0;
    background: rgb(18 31 32 / 42%);
  }

  .sidebar-toggle {
    display: inline-flex;
  }

  .app-main > .topbar {
    min-height: 68px;
    padding-right: 24px;
    padding-left: 24px;
  }

  .app-main > main {
    padding: 30px 24px 44px;
  }

  .app-main > footer {
    padding-right: 24px;
    padding-left: 24px;
  }
}

@media (max-width: 600px) {
  .app-main > .topbar {
    min-height: 62px;
    gap: 12px;
    padding: 9px 16px;
  }

  .app-main > .topbar .local-label {
    max-width: 126px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.72rem;
  }

  .app-main > main {
    padding: 24px 16px 36px;
  }

  .app-main > footer {
    flex-direction: column;
    gap: 4px;
    padding: 16px;
  }

  .dashboard-heading {
    gap: 18px;
  }

  .dashboard-summary {
    gap: 10px;
  }

  .summary-card {
    min-height: 118px;
    padding: 14px;
  }

  .summary-card strong {
    font-size: 1.85rem;
  }

  .summary-detail {
    font-size: 0.71rem;
  }

  #vehicle-form {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
    padding: 16px;
  }

  #vehicle-form .form-actions {
    flex-direction: column;
  }

  #vehicle-form .form-actions button {
    width: 100%;
  }

  .workspace-shell {
    padding: 14px;
  }

  .workspace-header {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }

  .workspace-header .back-to-garage {
    justify-self: start;
  }

  .workspace-actions,
  .workspace-actions button {
    width: 100%;
  }

  .vehicle-tabs {
    position: sticky;
    z-index: 10;
    top: 62px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .vehicle-tab-panel {
    padding: 16px;
  }
}

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