/* budget.zackswartz.com — black/white minimalist app UI (mockup, no logic yet) */

:root {
  --bg:      #ffffff;
  --surface: #fafafa;
  --surface2:#f4f4f4;
  --fg:      #111111;
  --fg-dim:  #6b6b6b;
  --muted:   #9a9a9a;
  --border:  #e6e6e6;
  --border2: #d8d8d8;
  --ok:      #1a7f37;
  --spacer:  #f0f0f0;
}
* { box-sizing: border-box; }
html, body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, "Helvetica Neue", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }

/* ── Top bar ─────────────────────────────────────────────────────────── */
.topbar {
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: rgba(255,255,255,0.9);
  backdrop-filter: saturate(180%) blur(10px); z-index: 50;
}
.topbar .inner {
  max-width: 1200px; margin: 0 auto; padding: 14px 24px;
  display: flex; align-items: center; justify-content: space-between;
}
.brand { font-weight: 800; letter-spacing: -0.3px; font-size: 16px; }
.brand .dim { color: var(--muted); font-weight: 600; }
.whoami { font-size: 13px; color: var(--fg-dim); }
.whoami b { color: var(--fg); }

/* ── Tabs (segmented control, below the ribbon) ──────────────────────── */
.tabnav {
  max-width: 1200px; margin: 24px auto 0; padding: 0 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
.segmented {
  display: inline-flex; background: var(--surface2); border: 1px solid var(--border);
  border-radius: 12px; padding: 4px; gap: 4px;
}
.seg {
  border: none; background: none; font-family: inherit; font-size: 13.5px; font-weight: 600;
  color: var(--fg-dim); padding: 9px 16px; border-radius: 9px; cursor: pointer; white-space: nowrap;
}
.seg:hover:not(:disabled) { color: var(--fg); }
.seg.active { background: #fff; color: var(--fg); box-shadow: 0 1px 3px rgba(0,0,0,0.10); }
.seg:disabled { color: var(--muted); cursor: not-allowed; opacity: .5; }
.demoflip {
  border: 1px dashed var(--border2); background: none; color: var(--muted); font-family: inherit;
  font-size: 11.5px; padding: 6px 10px; border-radius: 8px; cursor: pointer;
}
.demoflip:hover { color: var(--fg-dim); border-color: var(--fg-dim); }

/* ── Layout ──────────────────────────────────────────────────────────── */
.wrap { max-width: 1200px; margin: 0 auto; padding: 28px 24px 80px; }
.panel { display: none; }
.panel.active { display: block; }

.section-label {
  font-size: 12px; color: var(--muted); font-weight: 700; letter-spacing: 1.2px;
  text-transform: uppercase; margin-bottom: 10px;
}
h1 { font-size: 26px; font-weight: 800; letter-spacing: -0.4px; margin: 0 0 4px; }
h2 { font-size: 18px; font-weight: 700; margin: 0 0 12px; }
.lead { color: var(--fg-dim); font-size: 14px; margin: 0 0 24px; }

/* ── Cards ───────────────────────────────────────────────────────────── */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 20px 22px; margin-bottom: 20px;
}
.card > .head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.card h3 { font-size: 15px; font-weight: 700; margin: 0; }
.card .hint { font-size: 12px; color: var(--muted); }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 820px){ .grid2 { grid-template-columns: 1fr; } }

/* ── Form bits ───────────────────────────────────────────────────────── */
label.fld { display: block; font-size: 12px; color: var(--fg-dim); margin: 12px 0 5px; }
input[type=text], input[type=number], input[type=date], select {
  width: 100%; background: #fff; border: 1px solid var(--border2); border-radius: 8px;
  padding: 9px 11px; font-size: 14px; font-family: inherit; color: var(--fg);
}
input:focus, select:focus { outline: none; border-color: var(--fg); }

.btn {
  display: inline-flex; align-items: center; gap: 7px; background: var(--fg); color: #fff;
  border: 1px solid var(--fg); border-radius: 8px; padding: 9px 16px; font-size: 13px;
  font-weight: 600; cursor: pointer; font-family: inherit;
}
.btn:hover { opacity: .85; }
.btn.sm { padding: 6px 12px; font-size: 12px; }
.btn.ghost { background: transparent; color: var(--fg); border-color: var(--border2); }
.btn.ghost:hover { background: var(--surface2); opacity: 1; border-color: var(--fg); }

/* rows of name + amount */
.line { display: grid; grid-template-columns: 1fr 130px 28px; gap: 10px; align-items: center; margin-bottom: 8px; }
.line .x { color: var(--muted); cursor: pointer; text-align: center; font-size: 16px; }
.line .x:hover { color: var(--fg); }
.line-head { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; }

/* Unified account-row pattern (used across savings / shared / people / allocation) */
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.rowlist { margin: 4px 0 2px; }
.row { display: flex; align-items: center; gap: 10px; padding: 6px 2px; border-bottom: 1px solid var(--border); }
.row:last-child { border-bottom: none; }
.row input.name, .row .name.lbl { flex: 1; min-width: 0; }
.row input { border: 1px solid transparent; background: none; padding: 5px 7px; font-size: 14px; font-family: inherit; color: var(--fg); border-radius: 6px; }
.row input:hover { border-color: var(--border); background: #fff; }
.row input:focus { border-color: var(--fg); background: #fff; outline: none; }
.name.lbl { font-size: 14px; padding: 5px 7px; }
.money { display: flex; align-items: center; color: var(--fg-dim); font-size: 14px; }
.row .amt { width: 92px; text-align: right; font-variant-numeric: tabular-nums; }
.row .rx { color: var(--muted); cursor: pointer; width: 16px; text-align: center; font-size: 15px; }
.row .rx:hover { color: var(--fg); }
.row .tag { font-size: 11px; color: var(--muted); border: 1px solid var(--border2); border-radius: 999px; padding: 2px 9px; }
.rowgroup { font-size: 11px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); font-weight: 700; padding: 14px 0 3px; }
.rowgroup:first-child { padding-top: 2px; }
.ownertag { font-size: 12px; color: var(--muted); font-weight: 600; }

/* Drag-to-reorder */
.row .drag { cursor: grab; color: var(--muted); font-size: 13px; user-select: none; line-height: 1; padding: 2px; }
.row .drag:active { cursor: grabbing; }
.row .drag:hover { color: var(--fg); }
.row.dragging { opacity: .4; }
.row.drop-target { box-shadow: inset 0 2px 0 var(--fg); }
.row.alloc-spacer, .row.blank-row { border: none; }

/* Savings rows as aligned columns: drag | name | amount | expensable | remove */
.row.sav { display: grid; grid-template-columns: 18px 1fr 96px 18px; align-items: center; gap: 12px; }

/* Balance tab (locked numbers) */
.lock { cursor: pointer; font-size: 15px; user-select: none; }
.row.baltotal { background: var(--surface2); border: 1px solid var(--border2); border-radius: 9px; margin: 0 0 12px; padding: 12px 12px; }
.row.baltotal .name.lbl, .row.baltotal .amt-txt, .row.baltotal .money { font-size: 16px; font-weight: 800; color: var(--fg); }
.row.baltotal .name.lbl { text-transform: uppercase; letter-spacing: .5px; }
.balback { display: block; color: var(--fg-dim); font-size: 14px; cursor: pointer; margin: 0 0 24px; }
.balback:hover { color: var(--fg); }
.row.balrow .amt:disabled, .row.expbal .amt:disabled { background: none; color: var(--fg); border-color: transparent; opacity: 1; }
.row.expbal { display: grid; align-items: center; gap: 12px; }
.row.expbal .money { justify-content: flex-end; }
.row.expbal .col-h { justify-content: flex-end; font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; font-weight: 700; }
.row.sav .money { justify-content: flex-end; }
.row.sav.head-row { border-bottom: 1px solid var(--border); }
.row.sav.head-row span { font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; font-weight: 700; }
.col-amt { text-align: right; }
.col-exp { text-align: center; }
.yn { cursor: pointer; display: grid; place-items: center; width: 30px; height: 25px; border: 1px solid var(--border2); border-radius: 7px; font-size: 12px; font-weight: 700; color: var(--fg); margin: 0 auto; user-select: none; }
.yn:hover { border-color: var(--fg); }
.yn.no { background: var(--fg); color: #fff; border-color: var(--fg); }

/* Heading name inputs — plain text, not persistent boxes */
.head input.name { border: 1px solid transparent; background: none; padding: 3px 5px; border-radius: 6px; }
.head input.name:hover { background: var(--surface2); }
.head input.name:focus { background: #fff; border-color: var(--border2); outline: none; }

/* Expense tab */
.who { color: var(--muted); font-size: 12px; font-weight: 600; margin-left: 8px; }
.money .amt-txt { color: var(--fg); margin-left: 1px; font-variant-numeric: tabular-nums; }
.exp-for { font-size: 16px; font-weight: 700; padding: 6px 0; user-select: none; }

/* toggle */
.toggle { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--fg-dim); }
.switch { width: 38px; height: 22px; border-radius: 999px; background: var(--border2); position: relative; transition: background .15s; }
.switch.on { background: var(--fg); }
.switch::after { content:""; position:absolute; top:2px; left:2px; width:18px; height:18px; border-radius:50%; background:#fff; transition: left .15s; }
.switch.on::after { left: 18px; }

/* person block */
.person { border: 1px solid var(--border); border-radius: 12px; background:#fff; padding: 18px; margin-bottom: 16px; }
.person .ptitle { display:flex; align-items:center; justify-content:space-between; margin-bottom: 4px; }
.person .ptitle .name { font-size: 16px; font-weight: 700; }
.sub { font-size: 12px; font-weight:700; letter-spacing:.5px; text-transform:uppercase; color: var(--muted); margin: 16px 0 8px; }
.chip { display:inline-block; border:1px solid var(--border2); border-radius: 999px; padding: 5px 12px; font-size:12px; font-weight:600; margin: 0 6px 6px 0; background: var(--surface); }
.keep { border-color: var(--fg); }

/* allocation table */
table.alloc { width: 100%; border-collapse: collapse; margin-top: 8px; }
table.alloc th, table.alloc td { text-align: left; font-size: 13px; padding: 7px 8px; border-bottom: 1px solid var(--border); }
table.alloc th { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing:.5px; font-weight:700; }
table.alloc td.amt, table.alloc th.amt { text-align: right; width: 120px; font-variant-numeric: tabular-nums; }
table.alloc .grp { color: var(--fg-dim); font-weight:700; font-size:11px; text-transform:uppercase; letter-spacing:.5px; background: var(--surface2); }

/* ── Budget-paycheck choice ──────────────────────────────────────────── */
.choice { display:flex; gap:18px; margin-top: 20px; flex-wrap: wrap; }
.choice .opt {
  flex:1; min-width: 240px; border:1px solid var(--border2); border-radius: 14px; padding: 26px;
  cursor:pointer; background:#fff; transition: border-color .15s, transform .15s;
}
.choice .opt:hover { border-color: var(--fg); transform: translateY(-2px); }
.choice .opt h3 { font-size: 17px; margin: 0 0 6px; }
.choice .opt p { font-size: 13px; color: var(--fg-dim); margin: 0; line-height:1.5; }

.setupbar { display:flex; gap: 16px; align-items:flex-end; flex-wrap:wrap; margin: 18px 0 22px; }
.setupbar .fldwrap { min-width: 180px; }
.back { font-size: 13px; color: var(--fg-dim); cursor:pointer; }
.back:hover { color: var(--fg); }

/* ── Spreadsheet grid ────────────────────────────────────────────────── */
.sheetwrap { overflow-x: auto; border: 1px solid var(--border2); border-radius: 12px; }
table.sheet { border-collapse: collapse; font-size: 12.5px; min-width: 100%; }
table.sheet th, table.sheet td {
  border: 1px solid #ededed; padding: 8px 12px; text-align: left; white-space: nowrap;
}
table.sheet thead th { background: #fafafa; font-weight: 700; color: var(--fg); }
table.sheet .grouphdr {
  background: #f2f2f2; color: var(--fg); text-align: center;
  font-size: 11px; font-weight: 800; letter-spacing: 1.2px; text-transform: uppercase;
  border-bottom: 1px solid var(--border2);
}
table.sheet .subhdr {
  background: #fff; text-align: center; font-size: 10.5px; color: var(--muted);
  text-transform: uppercase; letter-spacing: .5px; font-weight: 700;
}
table.sheet .spacer { background: var(--spacer); border-top: none; border-bottom: none; width: 14px; min-width:14px; padding:0; }
table.sheet td.num { text-align: right; font-variant-numeric: tabular-nums; }
table.sheet td.input { background:#fff; }
table.sheet td.tbd { color: var(--muted); text-align:center; font-style: italic; }
table.sheet tbody tr:hover td:not(.spacer) { background: #fcfcfc; }
.legend { font-size: 12px; color: var(--muted); margin-top: 10px; }

/* Fixed bottom-right Save — hidden until the current page has changes */
.savebtn {
  display: none;
  position: fixed; bottom: 22px; right: 24px; z-index: 60;
  padding: 12px 24px; font-size: 14px; border-radius: 10px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.18);
}

.mock-note {
  margin-top: 26px; font-size: 12px; color: var(--muted); border-top:1px solid var(--border); padding-top: 14px;
}
