:root {
  color-scheme: light;
  --ink: #12201b;
  --muted: #65716c;
  --paper: #f5f7f4;
  --surface: #ffffff;
  --line: #dce3de;
  --green: #164b3a;
  --green-soft: #e3efe9;
  --gold: #e3a72f;
  --gold-soft: #fff3d4;
  --red: #b83232;
  --shadow: 0 20px 60px rgba(22, 52, 42, .09);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font-size: 16px; }
button, input, select { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.auth-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(360px, 580px) 1fr; background: var(--surface); }
.auth-panel { padding: clamp(36px, 7vw, 96px); align-self: center; max-width: 620px; }
.auth-preview { min-height: 100vh; background: radial-gradient(circle at 75% 20%, #3b8069, transparent 35%), linear-gradient(145deg, #0f382c, #071e18); display: grid; place-items: center; padding: 56px; overflow: hidden; }
.brand-mark { width: 52px; height: 52px; display: inline-grid; place-items: center; border-radius: 15px; color: white; background: var(--green); font-weight: 800; letter-spacing: -.04em; }
.brand-mark.small { width: 34px; height: 34px; border-radius: 10px; margin-right: 10px; font-size: 14px; }
.eyebrow { color: var(--green); font-size: 13px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; margin: 28px 0 8px; }
h1 { font-size: clamp(34px, 4vw, 58px); letter-spacing: -.055em; line-height: .98; margin: 0; }
h2 { font-size: 28px; letter-spacing: -.035em; margin: 0; }
.auth-copy { color: var(--muted); line-height: 1.6; max-width: 500px; margin: 22px 0 28px; }
.auth-tabs { display: flex; gap: 4px; padding: 4px; background: var(--paper); border-radius: 12px; margin-bottom: 24px; }
.auth-tab { border: 0; padding: 10px 16px; flex: 1; color: var(--muted); background: transparent; border-radius: 9px; font-weight: 700; }
.auth-tab.active { color: var(--ink); background: white; box-shadow: 0 2px 8px rgba(20, 45, 36, .08); }
.auth-form { display: grid; gap: 16px; }
label { color: var(--muted); font-size: 14px; font-weight: 700; display: grid; gap: 7px; }
input, select { min-height: 42px; color: var(--ink); background: white; border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px; outline: none; }
input:focus, select:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(22, 75, 58, .11); }
.field-note { color: var(--muted); font-size: 13px; margin: -8px 0 0; }
.form-error { min-height: 24px; color: var(--red); font-size: 14px; }
.primary-button, .secondary-button, .text-button { min-height: 42px; border-radius: 10px; padding: 10px 16px; font-weight: 800; }
.primary-button { border: 1px solid var(--green); color: white; background: var(--green); box-shadow: 0 8px 20px rgba(22, 75, 58, .18); }
.primary-button:hover { background: #0e3d2f; }
.secondary-button { border: 1px solid var(--line); background: white; color: var(--ink); }
.text-button { border: 0; background: transparent; color: var(--green); }
.full { width: 100%; }
.preview-card { width: min(440px, 80%); padding: 34px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.2); border-radius: 24px; color: white; backdrop-filter: blur(18px); box-shadow: var(--shadow); }
.preview-card span, .preview-card small { display: block; color: #bdd7cd; }
.preview-card strong { display: block; font-size: 52px; margin: 18px 0 6px; letter-spacing: -.05em; }
.preview-bars { position: absolute; display: flex; align-items: end; gap: 12px; height: 140px; transform: translate(0, 180px); }
.preview-bars i { width: 34px; border-radius: 7px 7px 0 0; background: var(--gold); opacity: .85; }
.preview-bars i:nth-child(1) { height: 42%; }.preview-bars i:nth-child(2) { height: 55%; }.preview-bars i:nth-child(3) { height: 90%; }.preview-bars i:nth-child(4) { height: 48%; }.preview-bars i:nth-child(5) { height: 76%; }.preview-bars i:nth-child(6) { height: 30%; }
.topbar { height: 68px; padding: 0 clamp(20px, 4vw, 60px); display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.9); position: sticky; top: 0; z-index: 20; backdrop-filter: blur(16px); }
.topbar > div { display: flex; align-items: center; }
.topbar-actions { gap: 16px; }
.user-email, .save-status { color: var(--muted); font-size: 13px; }
main { padding: 48px clamp(20px, 4vw, 60px) 90px; max-width: 1800px; margin: auto; }
.hero-row, .section-heading { display: flex; justify-content: space-between; align-items: end; gap: 24px; }
.hero-row h1 { font-size: clamp(36px, 4vw, 54px); }
.hero-row p:not(.eyebrow), .section-heading > p { color: var(--muted); margin: 10px 0 0; }
.settings-card { margin-top: 34px; display: grid; grid-template-columns: repeat(4, minmax(150px, 1fr)) auto; gap: 16px; align-items: end; padding: 20px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: 0 8px 30px rgba(22,52,42,.05); }
.summary-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin: 18px 0 52px; }
.summary-grid.compact { grid-template-columns: repeat(3, 1fr); margin: 18px 0; }
.summary-grid article { padding: 20px; background: white; border: 1px solid var(--line); border-radius: 14px; }
.summary-grid span, .summary-grid small { display: block; color: var(--muted); font-size: 13px; }
.summary-grid strong { display: block; margin: 8px 0 5px; font-size: 26px; letter-spacing: -.035em; }
.summary-grid .warning-card { border-color: #efb5b5; background: #fff8f8; }
.content-section { margin-top: 46px; }
.table-scroll { overflow: auto; margin-top: 20px; border: 1px solid var(--line); border-radius: 16px; background: white; box-shadow: 0 12px 34px rgba(22,52,42,.05); }
table { border-collapse: separate; border-spacing: 0; width: 100%; min-width: 980px; }
th, td { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 8px; text-align: right; vertical-align: middle; }
th:last-child, td:last-child { border-right: 0; }
tbody tr:last-child > * { border-bottom: 0; }
thead th { position: sticky; top: 0; z-index: 3; padding: 12px; background: var(--green); color: white; text-align: center; font-size: 13px; }
thead th:first-child { text-align: left; min-width: 240px; left: 0; z-index: 4; }
thead th:nth-child(2) { min-width: 105px; } thead th:nth-child(3) { min-width: 115px; }
thead th span { display: block; color: #b8d2c8; font-size: 11px; margin-bottom: 3px; }
td input { width: 100%; min-width: 92px; border-color: transparent; background: transparent; text-align: right; }
.row-name { position: sticky; left: 0; z-index: 2; background: white; display: flex; align-items: center; min-width: 240px; }
.row-name input { text-align: left; min-width: 180px; }
.remove-row { border: 0; background: transparent; color: #a3aaa6; font-size: 22px; padding: 4px 7px; }
.remove-row:hover { color: var(--red); }
.small-number { min-width: 55px; max-width: 70px; }
.default-amount { min-width: 90px; }
.muted { color: var(--muted); font-size: 13px; text-align: center; }
.section-row th { position: sticky; left: 0; text-align: left; padding: 12px; background: var(--green-soft); color: var(--green); font-size: 13px; letter-spacing: .04em; text-transform: uppercase; }
.due-cell { background: var(--gold-soft); box-shadow: inset 0 3px 0 var(--gold); }
.total-row th { position: sticky; left: 0; z-index: 2; text-align: left; background: #f7f9f7; }
.total-row td { background: #f7f9f7; font-weight: 700; }
.total-row.available th, .total-row.available td { background: var(--green); color: white; font-size: 15px; }
.total-row.cash-flow td { color: var(--green); }
.add-row-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.debt-section { margin-top: 72px; }
.debt-table { min-width: 900px; }
.debt-table td { position: relative; }
.debt-table td input { min-width: 120px; }
.input-suffix { position: absolute; right: 15px; top: 21px; color: var(--muted); }
.promo { display: inline-block; margin-left: 7px; padding: 3px 7px; border-radius: 20px; font-size: 11px; font-weight: 800; }
.promo.expired { color: var(--red); background: #fee8e8; }.promo.soon { color: #7d5510; background: var(--gold-soft); }
.toast { position: fixed; right: 24px; bottom: 24px; background: var(--ink); color: white; padding: 13px 18px; border-radius: 10px; opacity: 0; transform: translateY(12px); transition: .2s; pointer-events: none; z-index: 50; }
.toast.show { opacity: 1; transform: translateY(0); }
@media (max-width: 1000px) {
  .auth-shell { grid-template-columns: 1fr; }.auth-preview { display: none; }
  .settings-card { grid-template-columns: repeat(2, 1fr); }
  .summary-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 650px) {
  .auth-panel { padding: 30px 22px; }.topbar { padding: 0 16px; }.user-email, .save-status { display: none; }
  main { padding: 28px 14px 70px; }.hero-row, .section-heading { align-items: flex-start; flex-direction: column; }
  .settings-card, .summary-grid, .summary-grid.compact { grid-template-columns: 1fr; }
  .summary-grid { margin-bottom: 40px; }.section-heading > p { font-size: 14px; }
}
