:root {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #17202a;
  background: #f4f6f8;
  --primary: #183b56;
  --accent: #d99a2b;
  --danger: #a93226;
  --success: #247a4d;
  --muted: #64748b;
  --border: #dbe2ea;
  --card: #ffffff;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
button, input, select { font: inherit; }
.app-header { display: flex; justify-content: space-between; gap: 24px; padding: 28px clamp(18px,4vw,54px); background: var(--primary); color: white; }
h1 { margin: 2px 0 8px; font-size: clamp(28px,4vw,44px); }
.eyebrow { margin: 0; color: #f1c46e; font-weight: 800; text-transform: uppercase; letter-spacing: .09em; font-size: 12px; }
.subtitle { margin: 0; max-width: 760px; color: #d8e3eb; }
.header-actions { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px; }
.button { border: 0; border-radius: 9px; padding: 10px 14px; cursor: pointer; font-weight: 750; }
.button.primary { background: var(--accent); color: #1f2933; }
.button.secondary { background: rgba(255,255,255,.12); color: white; border: 1px solid rgba(255,255,255,.25); }
.button.danger { background: #7b241c; color: white; }
.button.full { width: 100%; }
.file-button { display: inline-block; }
.tabs { display: flex; gap: 4px; overflow-x: auto; padding: 8px clamp(14px,4vw,54px); background: white; border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10; }
.tab { border: 0; background: transparent; padding: 12px 14px; white-space: nowrap; cursor: pointer; border-radius: 7px; font-weight: 750; color: #52606d; }
.tab.active { background: #e8eef3; color: var(--primary); }
main { padding: 24px clamp(14px,4vw,54px) 60px; }
.panel { display: none; }
.active-panel { display: block; }
.month-row { display: flex; justify-content: space-between; gap: 18px; align-items: end; margin-bottom: 18px; }
label { display: grid; gap: 6px; font-size: 13px; font-weight: 750; color: #334e68; }
input, select { width: 100%; border: 1px solid var(--border); border-radius: 8px; padding: 10px 11px; background: white; }
.metric-grid { display: grid; grid-template-columns: repeat(6,minmax(0,1fr)); gap: 12px; }
.metric { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 16px; box-shadow: 0 4px 14px rgba(15,23,42,.04); }
.metric span { display: block; color: var(--muted); font-size: 12px; margin-bottom: 8px; }
.metric strong { font-size: 23px; }
.two-column { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 18px; margin-top: 16px; box-shadow: 0 4px 14px rgba(15,23,42,.04); }
.card.narrow { max-width: 820px; }
.card-heading { display: flex; justify-content: space-between; gap: 16px; align-items: baseline; margin-bottom: 14px; }
.card-heading h2 { margin: 0; font-size: 19px; }
.card-heading span { color: var(--muted); font-size: 12px; text-align: right; }
.stack { display: grid; gap: 9px; }
.stack-row { display: flex; justify-content: space-between; gap: 18px; padding: 10px 0; border-bottom: 1px solid #edf2f7; }
.stack-row:last-child { border-bottom: 0; }
.stack-row small { color: var(--muted); display: block; margin-top: 3px; }
.requirement-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; }
.requirement-grid div { background: #f8fafc; border: 1px solid var(--border); border-radius: 10px; padding: 14px; }
.requirement-grid span, .requirement-grid small { display: block; color: var(--muted); }
.requirement-grid strong { display: block; margin: 6px 0; font-size: 22px; }
.form-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 13px; }
.form-grid.compact { grid-template-columns: repeat(3,1fr); }
.form-grid .full { grid-column: 1/-1; }
.available-banner { margin-top: 16px; background: #eef5f9; border-radius: 9px; padding: 14px; }
.summary-line { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid #edf2f7; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 10px 9px; border-bottom: 1px solid #e8edf2; text-align: left; white-space: nowrap; }
th { color: #52606d; background: #f8fafc; position: sticky; top: 0; }
.status-box { padding: 10px 13px; border-radius: 9px; font-weight: 800; }
.status-red { background: #fdecea; color: #922b21; }
.status-amber { background: #fff4df; color: #8a5a00; }
.status-green { background: #e8f6ee; color: #1e6b45; }
.badge { display: inline-flex; border-radius: 999px; padding: 4px 8px; font-size: 11px; font-weight: 800; background: #edf2f7; }
.badge.overdue { background: #fdecea; color: #922b21; }
.badge.partial { background: #fff4df; color: #8a5a00; }
.badge.paid { background: #e8f6ee; color: #1e6b45; }
.callout { border-left: 4px solid var(--accent); background: #fff9ed; padding: 13px; border-radius: 6px; }
.inline-input { width: 105px; padding: 7px; }
.toast { position: fixed; right: 18px; bottom: 18px; background: #17202a; color: white; padding: 12px 16px; border-radius: 9px; opacity: 0; transform: translateY(8px); pointer-events: none; transition: .2s; }
.toast.show { opacity: 1; transform: translateY(0); }
.muted { color: var(--muted); }
.negative { color: var(--danger); }
.positive { color: var(--success); }
@media (max-width: 1050px) { .metric-grid { grid-template-columns: repeat(3,1fr); } }
@media (max-width: 760px) {
  .app-header { flex-direction: column; }
  .metric-grid, .two-column, .requirement-grid, .form-grid, .form-grid.compact { grid-template-columns: 1fr; }
  .month-row, .card-heading { align-items: stretch; flex-direction: column; }
  .card-heading span { text-align: left; }
}
