:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --text: #1a2332;
  --text-muted: #5a6778;
  --border: #e3e7ec;
  --primary: #0b3d5c;         /* Baird-ish deep navy */
  --primary-hover: #0f4d72;
  --accent: #c9a961;          /* muted gold */
  --success: #2d6a4f;
  --hover: #f0f3f7;
  --shadow: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.06);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
}

.app {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

/* ============ Sidebar ============ */
.sidebar {
  background: var(--primary);
  color: #ffffff;
  display: flex;
  flex-direction: column;
  padding: 24px 0;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  padding: 0 24px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.12);
}
.brand-title {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.2px;
}
.brand-sub {
  font-size: 12px;
  color: rgba(255,255,255,0.7);
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.nav {
  display: flex;
  flex-direction: column;
  padding: 12px 0;
  flex: 1;
  overflow-y: auto;
}
.nav-section {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255,255,255,0.45);
  padding: 12px 24px 6px;
  font-weight: 600;
}
.nav-item {
  background: none;
  border: none;
  color: rgba(255,255,255,0.82);
  text-align: left;
  padding: 9px 24px;
  font-size: 14px;
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: all 0.15s ease;
  font-family: inherit;
}
.nav-item:hover { background: rgba(255,255,255,0.06); color: #fff; }
.nav-item.active {
  background: rgba(255,255,255,0.1);
  color: #fff;
  border-left-color: var(--accent);
  font-weight: 500;
}

.year-toggle {
  padding: 16px 24px;
  border-top: 1px solid rgba(255,255,255,0.12);
}
.year-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255,255,255,0.6);
  margin-bottom: 8px;
}
.year-buttons {
  display: flex;
  gap: 6px;
}
.year-btn {
  flex: 1;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.85);
  padding: 8px;
  font-size: 14px;
  font-weight: 500;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
}
.year-btn:hover { background: rgba(255,255,255,0.14); }
.year-btn.active {
  background: var(--accent);
  color: var(--primary);
  border-color: var(--accent);
}

.sidebar-footer {
  padding: 16px 24px 0;
  border-top: 1px solid rgba(255,255,255,0.12);
  font-size: 11px;
  color: rgba(255,255,255,0.55);
  line-height: 1.5;
}
.footer-item { margin-bottom: 6px; }
.disclaimer { font-style: italic; }

/* ============ Main ============ */
.main {
  padding: 32px 40px 60px;
  max-width: 1100px;
}
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--border);
}
.page-header h1 {
  margin: 0;
  font-size: 28px;
  font-weight: 600;
  color: var(--primary);
}
.year-pill {
  background: var(--primary);
  color: #fff;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
}
.year-pill.small { padding: 3px 10px; font-size: 12px; margin-left: 8px; }

.panel { display: block; }
.panel.hidden { display: none; }

/* ============ Cards ============ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}
.card h2 {
  margin: 0 0 4px;
  font-size: 18px;
  color: var(--primary);
  font-weight: 600;
}
.card h3 {
  margin: 20px 0 8px;
  font-size: 15px;
  color: var(--text);
  font-weight: 600;
}
.card .source {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
}
.card .source a { color: var(--primary); }
.card .note {
  background: #fff8e6;
  border-left: 3px solid var(--accent);
  padding: 10px 14px;
  margin: 12px 0;
  font-size: 13px;
  color: #5a4a14;
  border-radius: 3px;
}
.muted { color: var(--text-muted); font-size: 13px; }

/* ============ Tables ============ */
table.tax-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
  font-size: 14px;
}
table.tax-table th {
  background: var(--hover);
  text-align: left;
  padding: 8px 12px;
  font-weight: 600;
  font-size: 13px;
  color: var(--text-muted);
  border-bottom: 2px solid var(--border);
}
table.tax-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
}
table.tax-table tr:last-child td { border-bottom: none; }
table.tax-table td.num, table.tax-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.tax-table td.rate { font-weight: 600; color: var(--primary); }

.kv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
  margin-top: 8px;
}
.kv-item {
  padding: 12px 14px;
  background: var(--hover);
  border-radius: 6px;
  border-left: 3px solid var(--primary);
}
.kv-item .kv-label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}
.kv-item .kv-value {
  font-size: 16px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.kv-item .kv-note {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ============ Calculator ============ */
.calc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  margin-top: 16px;
}
.calc-col label {
  display: block;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 12px;
  font-weight: 500;
}
.calc-col input,
.calc-col select {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 8px 10px;
  font-size: 14px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-family: inherit;
  background: #fff;
  color: var(--text);
}
.calc-col input:focus,
.calc-col select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(11,61,92,0.1);
}

.result-table {
  margin-top: 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}
.result-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 14px;
  font-size: 14px;
  border-bottom: 1px solid var(--border);
  font-variant-numeric: tabular-nums;
}
.result-row:last-child { border-bottom: none; }
.result-row.section {
  background: var(--hover);
  font-weight: 600;
  color: var(--primary);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.result-row.total {
  background: var(--primary);
  color: #fff;
  font-weight: 600;
  font-size: 15px;
}
.result-row .label { color: var(--text-muted); }
.result-row.section .label { color: var(--primary); }
.result-row.total .label { color: #fff; }
.result-row .value { font-weight: 500; }

@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: relative; height: auto; }
  .main { padding: 24px; }
  .calc-grid { grid-template-columns: 1fr; }
}
