:root {
  color-scheme: light;
  --background: #f6f7f2;
  --surface: #fff;
  --ink: #182a25;
  --muted: #52655c;
  --border: #dfe6df;
  --green: #1b6045;
  --green-dark: #154934;
  --green-soft: #e5f0e8;
  --amber: #884b14;
  --red: #953d31;
  --radius: 18px;
  font-family: "Instrument Sans", "Inter", "Segoe UI", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  color: var(--ink);
  background: var(--background);
}
/* Public account flow */
.public-page { min-height: 100vh; background: #f1f6f5; }
.public-header { max-width: 1280px; margin: auto; display: flex; justify-content: space-between; align-items: center; padding: 30px 36px; gap: 20px; }
.public-header .brand { display: block; }
.public-header .brand small { font-size: .875rem; }
.public-tag, .eyebrow { color: var(--green); font-size: .875rem; font-weight: 650; }
.welcome-layout { max-width: 1280px; margin: auto; padding: 45px 46px 70px; display: grid; grid-template-columns: 1.2fr 1fr; gap: clamp(30px,6vw,100px); align-items: start; }
.welcome-copy { padding-block: 30px; }
.welcome-copy h1 { font-size: clamp(2.5rem,4.6vw,4.4rem); line-height: 1.08; margin: 20px 0; letter-spacing: -.055em; }
.welcome-copy > p { color: var(--muted); max-width: 490px; line-height: 1.65; }
.welcome-features { list-style: none; padding: 0; margin: 28px 0; display: grid; gap: 14px; }
.welcome-features li::before { content: '✓'; color: var(--green); margin-right: 10px; font-weight: 700; }
.welcome-copy .welcome-note { margin-top: 12px; font-size: .875rem; }
.auth-card { background: white; border: 1px solid var(--border); border-radius: 22px; padding: clamp(22px,3vw,36px); box-shadow: 0 14px 50px #18382c08; }
.auth-card h2 { font-size: 1.65rem; margin-bottom: 18px; }
.auth-card p { line-height: 1.6; color: var(--muted); margin-bottom: 14px; }
.auth-card p + p { margin-top: 8px; }
.auth-tabs { display: flex; gap: 8px; background: #f1f6f3; padding: 5px; border-radius: 12px; margin-bottom: 22px; }
.auth-tabs button { border: 0; border-radius: 8px; background: transparent; padding: 10px; flex: 1; font-size: .95rem; }
.auth-tabs [aria-pressed="true"] { color: var(--green); background: white; font-weight: 700; box-shadow: 0 1px 4px #18382c10; }
.auth-form { display: grid; gap: 16px; }
.auth-form .field { gap: 8px; }
.auth-form input { min-height: 46px; width: 100%; font-size: 1rem; }
.auth-form .field span, .auth-form small, .auth-form .check-field, .auth-form .text-link { font-size: .875rem; line-height: 1.5; }
.auth-form .check-field input { min-height: 18px; width: 18px; flex-shrink: 0; }
.auth-form > button.primary { min-height: 46px; font-size: 1rem; }
.auth-form .text-link { justify-self: center; }
.auth-form small { color: var(--muted); }
.auth-form .auth-message { background: #edf4ee; color: #194d36; padding: 12px; border-radius: 10px; margin: 0; font-size: .95rem; }
.public-footer { max-width: 1280px; margin: auto; padding: 24px 46px; color: var(--muted); border-top: 1px solid #d5e0da; font-size: .875rem; display: flex; gap: 20px; justify-content: space-between; }
.public-footer details { max-width: 530px; }
.public-footer details p { margin-top: 12px; line-height: 1.7; }
.public-footer summary { cursor: pointer; }
#account-label { overflow-wrap: anywhere; font-size: .875rem; margin: 12px 0; }
#account-tools { display: grid; gap: 8px; margin-bottom: 8px; }
.sidebar-footer #logout-button, .sidebar-footer #exit-demo { font-size: .875rem; }
button:disabled { opacity: .55; cursor: not-allowed; }
.sidebar-footer { overflow-y: auto; }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='10'%3E%3Cpath d='m2 2 5 5 5-5' fill='none' stroke='%2352655c' stroke-width='2'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }
@media (max-width: 760px) {
  .welcome-layout { grid-template-columns: 1fr; padding: 15px 20px 40px; gap: 24px; }
  .welcome-copy { padding-block: 15px; }
  .public-header { padding: 22px 20px; }
  .public-tag { display: none; }
  .public-footer { padding: 22px 20px; display: grid; }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 320px; }
h1, h2, h3, p, dl, dd { margin: 0; }
a { color: inherit; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button, a, input, select { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid #3e8c68; outline-offset: 3px; }
main:focus { outline: none; }
.icon { width: 20px; height: 20px; flex: 0 0 auto; vertical-align: middle; }
.layout { display: grid; grid-template-columns: 218px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; display: flex; flex-direction: column; height: 100vh; padding: 31px 16px 19px; background: #fcfdf9; border-right: 1px solid var(--border); }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 10px; text-decoration: none; font-weight: 750; font-size: 1.22rem; letter-spacing: -.05em; }
.brand small { display: block; color: var(--muted); font-size: .74rem; font-weight: 550; letter-spacing: 0; margin-top: 2px; }
.brand-mark { width: 40px; height: 40px; flex-shrink: 0; display: flex; align-items: end; justify-content: center; padding: 0 0 10px; gap: 3px; background: var(--green); border-radius: 12px; }
.brand-mark i { width: 4px; height: 8px; border-radius: 1px; background: white; }
.brand-mark i:nth-child(2) { height: 13px; opacity: .85; }
.brand-mark i:nth-child(3) { height: 20px; opacity: .7; }
nav { display: flex; flex-direction: column; gap: 6px; margin-top: 40px; }
nav a { display: flex; align-items: center; gap: 11px; border-radius: 10px; padding: 11px 12px; color: var(--muted); text-decoration: none; font-size: .92rem; font-weight: 650; }
nav a:hover, nav [aria-current="page"] { background: var(--green-soft); color: var(--green-dark); }
.sidebar-footer { margin-top: auto; }
.sidebar-footer button { width: 100%; font-size: .8rem; }
.sidebar-footer p { color: var(--muted); margin-top: 12px; text-align: center; font-size: .71rem; }
.local-dot { display: inline-block; height: 7px; width: 7px; background: #5b9175; border-radius: 50%; margin-right: 3px; }
.main { width: min(100%, 1420px); margin-inline: auto; padding: 38px clamp(20px, 4vw, 55px) 46px; }
.page-header { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 24px; }
h1 { line-height: 1.05; font-size: clamp(1.9rem, 3.5vw, 3.25rem); letter-spacing: -.064em; font-weight: 770; }
.page-header p, .panel-header p { margin-top: 7px; color: var(--muted); font-size: .91rem; }
.header-actions, .dialog-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.button { border: 1px solid transparent; padding: 10px 12px; border-radius: 10px; font-size: .85rem; white-space: nowrap; text-decoration: none; font-weight: 660; display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 40px; }
.button .icon { width: 17px; height: 17px; }
.primary { background: var(--green); color: white; }
.primary:hover { background: var(--green-dark); }
.secondary { background: var(--surface); color: var(--green-dark); border-color: var(--border); }
.secondary:hover { background: var(--green-soft); }
.danger { color: var(--red) !important; background: none; }
.danger:hover { background: #f9ebe7; }
.panel, .metric { border: 1px solid var(--border); background: var(--surface); border-radius: var(--radius); min-width: 0; }
.metrics { display: grid; gap: 12px; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 19px; }
.metric { padding: 14px 15px 16px; }
.metric.featured { background: #e9f2e9; border-color: #d1e3d4; }
.metric-head { display: flex; justify-content: space-between; align-items: center; gap: 4px; color: var(--muted); font-size: .82rem; font-weight: 650; min-height: 37px; }
.metric strong { display: block; margin: 6px 0 3px; font-size: clamp(1.25rem, 2.65vw, 2.25rem); letter-spacing: -.055em; line-height: 1.05; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.metric small { color: var(--muted); font-size: .72rem; }
.icon-box { width: 33px; height: 33px; flex: 0 0 auto; border-radius: 9px; background: #ecf3ed; color: var(--green); display: inline-grid; place-items: center; }
.icon-box .icon { width: 17px; height: 17px; }
.dashboard-grid, .calendar-layout { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); align-items: start; gap: 16px; }
.panel-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 18px 19px 14px; }
h2 { font-size: 1.11rem; letter-spacing: -.025em; line-height: 1.22; }
.panel-header p { margin-top: 4px; font-size: .8rem; }
.panel-header > strong { font-size: .85rem; color: var(--green); text-align: right; }
.text-link { display: inline-flex; align-items: center; gap: 5px; color: var(--green); font-size: .81rem; font-weight: 700; text-decoration: none; padding: 2px; border: 0; background: none; }
.text-link:hover { text-decoration: underline; }
.text-link .icon { width: 14px; height: 14px; }
.payment-list, .movement-list { padding: 0 16px 12px; }
.payment-row, .movement-row, .cut-row { padding: 11px 3px; border: 0; border-top: 1px solid #edf0ea; width: 100%; background: transparent; color: inherit; display: grid; align-items: center; grid-template-columns: auto minmax(0, 1fr) auto auto auto; gap: 9px; text-align: left; }
button.payment-row:hover, button.movement-row:hover { background: #f5f8f3; }
.movement-row { grid-template-columns: auto minmax(0, 1fr) auto auto; }
.cut-row { grid-template-columns: auto minmax(0, 1fr); }
.payment-name { min-width: 0; }
.payment-name strong, .cut-row strong { display: block; font-size: .88rem; overflow-wrap: anywhere; }
.payment-name small, .cut-row small { display: block; color: var(--muted); font-size: .73rem; margin-top: 4px; }
.row-amount { font-size: .87rem; text-align: right; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.payment-row > .icon { width: 14px; height: 14px; color: var(--muted); }
.positive { color: var(--green); }
.pill { padding: 4px 7px; background: #edf1ed; color: #42574c; border-radius: 50px; font-size: .7rem; font-weight: 700; white-space: nowrap; }
.pill.overdue { background: #fae9e3; color: var(--red); }
.pill.partial { background: #fbf0d8; color: var(--amber); }
.pill.paid { background: var(--green-soft); color: var(--green-dark); }
.empty { min-height: 152px; display: grid; justify-items: center; align-content: center; text-align: center; gap: 7px; padding: 17px; }
.empty p { font-size: .82rem; color: var(--muted); }
.empty strong { font-size: .9rem; }
.empty .icon-box { margin-bottom: 3px; }
.breakdown-values { display: grid; gap: 15px; padding: 5px 19px 20px; }
.bar-label { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 7px; font-size: .84rem; }
.bar-track { border-radius: 8px; height: 8px; background: #eef2eb; overflow: hidden; }
.bar-track div { height: 100%; background: var(--green); }
.bar-track .variable { background: #6d987a; }
.breakdown > a { margin: 0 19px 17px; }
.calendar-layout { grid-template-columns: minmax(0, 2.65fr) minmax(230px, 1fr); }
.calendar-header { border-bottom: 1px solid var(--border); }
.month-controls { display: flex; align-items: center; gap: 9px; }
.month-controls h2 { min-width: 155px; text-align: center; }
.icon-button { display: inline-grid; place-items: center; flex: 0 0 auto; width: 37px; height: 36px; border-radius: 9px; border: 1px solid var(--border); color: var(--green-dark); background: var(--surface); }
.icon-button:hover { background: var(--green-soft); }
.calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.weekday { padding: 9px 5px; text-align: center; color: var(--muted); font-size: .75rem; font-weight: 650; }
.calendar-day, .calendar-blank { min-width: 0; min-height: 79px; text-align: left; padding: 5px; border: 0; border-right: 1px solid #edf1eb; border-top: 1px solid #edf1eb; background: white; color: var(--ink); }
.calendar-day { display: block; }
.calendar-day:hover, .calendar-day.selected { background: #edf6ed; }
.calendar-day:focus-visible { outline-offset: -3px; }
.calendar-blank { background: #f9faf7; }
.calendar-day:nth-child(7n), .calendar-blank:nth-child(7n) { border-right: none; }
.day-number { border-radius: 50%; width: 22px; height: 22px; display: grid; place-items: center; font-size: .78rem; font-weight: 700; }
.today .day-number { background: var(--green); color: white; }
.day-events { min-height: 41px; display: grid; align-content: start; gap: 2px; margin-top: 4px; }
.calendar-event { font-size: .63rem; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; padding: 2px 4px; background: var(--green-soft); color: var(--green-dark); border-radius: 3px; }
.is-overdue { background: #fae9e3; color: var(--red); }
.is-cut { background: #e9ecfa; color: #434778; }
.is-paid { background: #e9ede8; color: #53655a; }
.day-events small { font-size: .62rem; color: var(--muted); }
.calendar-footer { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; border-top: 1px solid var(--border); padding: 13px 17px; font-size: .75rem; color: var(--muted); }
.calendar-footer span, .calendar-footer label { display: inline-flex; gap: 5px; align-items: center; }
.calendar-footer label { margin-left: auto; }
.calendar-footer i { display: inline-block; height: 8px; width: 8px; border-radius: 50%; background: #6b9a7e; }
.calendar-footer .cut-dot { background: #8187bd; }
.day-panel > .button { margin: 0 15px 16px; }
.day-panel .payment-row { grid-template-columns: auto minmax(0, 1fr) auto; }
.day-panel .payment-row > .pill { display: none; }
.day-panel .payment-row > .icon { display: none; }
.tabs { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; }
.tabs button { background: transparent; color: var(--muted); border: 1px solid var(--border); border-radius: 30px; padding: 6px 11px; font-size: .77rem; font-weight: 650; }
.tabs button:hover, .tabs button[aria-pressed="true"] { background: var(--green-soft); color: var(--green-dark); border-color: #d0e6d3; }
.filter-bar { padding: 0 19px 14px; }
.demo-banner { border: 1px solid #e8d7ad; background: #fcf2dd; color: #694b1d; border-radius: 9px; font-size: .82rem; font-weight: 620; padding: 9px 12px; margin-bottom: 17px; }
dialog { color: var(--ink); width: min(calc(100% - 24px), 520px); margin: auto; border: 1px solid var(--border); border-radius: 18px; padding: 0; box-shadow: 0 15px 60px #122c263a; max-height: calc(100% - 24px); }
dialog::backdrop { background: #142a2580; }
.dialog-inner { padding: 19px; }
.dialog-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; }
.dialog-head h2 { font-size: 1.25rem; overflow-wrap: anywhere; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.wide { grid-column: 1 / -1; }
.field { display: grid; gap: 5px; }
.field span { font-size: .82rem; font-weight: 700; }
.field input, .field select { width: 100%; min-width: 0; color: var(--ink); background: #fbfcf9; border: 1px solid var(--border); border-radius: 8px; padding: 8px; min-height: 40px; font-size: 1rem; }
.wide small { font-size: .73rem; color: var(--muted); }
.check-field { display: flex; align-items: center; gap: 8px; font-size: .83rem; margin-top: 12px; }
input[type="checkbox"] { accent-color: var(--green); width: 17px; height: 17px; margin: 0; }
.dialog-actions { margin-top: 16px; justify-content: end; }
.form-error { font-size: .82rem; color: var(--red); margin-top: 9px; }
.detail-date { font-size: .85rem; color: var(--muted); }
.detail-amounts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.detail-amounts div { background: #f0f5ef; border-radius: 9px; padding: 8px 9px; }
.detail-amounts dt { color: var(--muted); font-size: .75rem; margin-bottom: 3px; }
.detail-amounts dd { font-size: 1rem; font-weight: 730; overflow-wrap: anywhere; }
.detail-status { margin: 13px 0; display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.history { margin: 13px 0; font-size: .8rem; }
.history h3 { font-size: .89rem; margin-bottom: 6px; }
.history div { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 5px 0; border-top: 1px solid var(--border); }
.plan-actions { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 14px; padding-top: 8px; border-top: 1px solid var(--border); }
.plan-actions .button { font-size: .76rem; min-height: 34px; }
.toast { position: fixed; z-index: 10; bottom: 16px; right: 17px; max-width: calc(100% - 34px); color: white; background: var(--green-dark); border-radius: 10px; box-shadow: 0 4px 18px #0d241537; padding: 10px 15px; font-size: .85rem; }
@media (max-width: 1060px) {
  .layout { grid-template-columns: 178px minmax(0, 1fr); }
  .sidebar { padding-inline: 10px; }
  .dashboard-grid, .calendar-layout { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 750px) {
  .layout { display: block; }
  .sidebar { position: static; height: auto; padding: 12px 12px 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; border-right: none; border-bottom: 1px solid var(--border); }
  .brand { padding: 0; font-size: 1rem; }
  .brand-mark { width: 35px; height: 35px; padding-bottom: 7px; }
  .brand small { font-size: .67rem; }
  .sidebar-footer { grid-column: 2; grid-row: 1; margin: 0; }
  .sidebar-footer button { padding: 6px 8px; min-height: 31px; font-size: .69rem; }
  .sidebar-footer p { margin-top: 4px; font-size: .63rem; }
  nav { grid-column: 1 / -1; flex-direction: row; justify-content: space-between; margin: 0; gap: 2px; }
  nav a { flex: 1 1 auto; flex-direction: column; justify-content: center; gap: 2px; padding: 7px 4px; border-radius: 7px 7px 0 0; font-size: .70rem; }
  nav .icon { width: 17px; height: 17px; }
  .main { padding: 21px 12px 33px; }
  .page-header { align-items: flex-start; flex-direction: column; gap: 10px; margin-bottom: 15px; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
  .metric { padding: 10px; }
  .metric-head { min-height: 29px; }
  .metric-head .icon-box { width: 26px; height: 26px; }
  .panel-header { padding: 13px 11px 11px; }
  .filter-bar { padding-inline: 11px; }
  .payment-list, .movement-list { padding-inline: 9px; }
  .payment-row, .movement-row { gap: 5px; }
  .payment-row .icon-box, .movement-row .icon-box { width: 27px; height: 27px; }
  .calendar-day, .calendar-blank { min-height: 66px; padding: 3px; }
  .day-events { min-height: 34px; margin-top: 2px; }
  .calendar-event { font-size: .59rem; padding: 1px 2px; }
  .month-controls { gap: 4px; }
  .month-controls h2 { min-width: 130px; font-size: .95rem; }
  .calendar-footer { padding: 10px 7px; gap: 8px; }
}
