* { box-sizing: border-box; }
[x-cloak] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--color-accent); text-decoration: none; }
a:hover { color: var(--color-accent-hover); }

h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0 0 var(--space-3) 0;
}
h1 { font-size: 1.9rem; letter-spacing: -0.02em; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1.1rem; }

p { margin: 0 0 var(--space-3) 0; }

label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-text-muted);
  margin-bottom: var(--space-2);
}

input, select, textarea {
  width: 100%;
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text);
  padding: var(--space-2) var(--space-3);
  font-family: inherit;
  font-size: 0.95rem;
}

input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--color-accent);
  outline-offset: 1px;
}

/* Tabular figures for anything a user scans down a column — mileage, dates,
   costs, MPG. Keeping this a deliberate opt-in class (not default on body)
   because prose numbers (VIN characters, notes) don't need it. */
.tabular-nums { font-variant-numeric: tabular-nums; }
.font-mono { font-family: var(--font-mono); }

.app-shell {
  display: flex;
  min-height: 100vh;
}

.app-main {
  flex: 1;
  padding: var(--space-6) var(--space-8) var(--space-8);
  max-width: 1180px;
  margin: 0 auto;
  width: 100%;
}

.app-nav {
  width: 232px;
  flex-shrink: 0;
  background: var(--color-bg-elevated);
  border-right: 1px solid var(--color-border);
  padding: var(--space-4) var(--space-3);
  display: flex;
  flex-direction: column;
}

.app-nav a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  color: var(--color-text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  margin-bottom: 2px;
}

.app-nav a:hover {
  background: var(--color-bg-elevated-2);
  color: var(--color-text);
}

.app-nav a.active {
  background: var(--color-accent-tint);
  color: var(--color-accent);
}

@media (max-width: 720px) {
  .app-shell { flex-direction: column; }
  .app-nav {
    width: 100%;
    flex-direction: row;
    overflow-x: auto;
    border-right: none;
    border-bottom: 1px solid var(--color-border);
  }
  .app-nav a { white-space: nowrap; }
}
