:root {
  --navy: #012e5a;
  --teal: #118291;
  --teal-ink: #086673;
  --orange: #eb752e;
  --olive: #9ab161;
  --ink: #181617;
  --muted: #596777;
  --paper: #fff;
  --bg: #f3f6fa;
  --line: #dce5ee;
  --light-teal: #e5f5f5;
  --shadow: 0 4px 18px #012e5a08;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  color: var(--ink);
  background: var(--bg);
  font-synthesis: none;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-width: 300px; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { color: inherit; cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--teal); outline-offset: 3px; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { color: var(--navy); letter-spacing: -.035em; }
h1 { font-size: clamp(2rem, 4vw, 2.8rem); line-height: 1.08; }
h2 { font-size: 1.26rem; line-height: 1.25; }
h3 { font-size: 1.02rem; }
small, .small { font-size: .875rem; }
.muted, .help { color: var(--muted); }
strong, b { font-weight: 700; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.shell { display: grid; grid-template-columns: 226px minmax(0, 1fr); min-height: 100dvh; }
.sidebar {
  position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column;
  padding: 30px 16px 20px; background: var(--paper); border-right: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 8px; padding: 3px 8px 30px; color: var(--navy); }
.brand img { flex: none; border: 1px solid var(--line); border-radius: 11px; }
.brand b, .brand span { display: block; white-space: nowrap; }
.brand b { font-size: 1rem; letter-spacing: -.03em; }
.brand span { font-size: .77rem; color: var(--muted); margin-top: 2px; }
.sidebar nav { display: grid; gap: 4px; }
.nav-link {
  position: relative; display: flex; align-items: center; gap: 12px; min-height: 46px;
  border-radius: 9px; padding: 9px 13px; font-size: .94rem; font-weight: 630; color: #46596c;
}
.nav-link:hover { background: #f2f7fb; color: var(--navy); }
.nav-link.active { background: #e8f2f8; color: var(--navy); }
.nav-link.active::before { content: ""; position: absolute; width: 3px; height: 20px; left: 0; border-radius: 5px; background: var(--teal); }
.nav-mark { width: 14px; height: 14px; flex: none; border: 1.6px solid currentColor; border-radius: 3px; position: relative; }
.nav-home .nav-mark { border-radius: 4px; box-shadow: inset 0 -5px #e0e8f1; }
.nav-agenda .nav-mark::before { content: ""; height: 1.6px; background: currentColor; position: absolute; inset: 3px 0 auto; }
.nav-finance .nav-mark { height: 11px; border-radius: 3px; }
.nav-finance .nav-mark::after { content: ""; position: absolute; width: 3px; height: 3px; background: currentColor; border-radius: 50%; right: 2px; top: 2px; }
.nav-goals .nav-mark, .nav-history .nav-mark, .nav-settings .nav-mark { border-radius: 50%; }
.nav-goals .nav-mark::after { content: ""; position: absolute; inset: 3px; border-radius: 50%; background: currentColor; }
.nav-history .nav-mark::after { content: ""; position: absolute; left: 5px; top: 2px; width: 4px; height: 4px; border-left: 1px solid; border-bottom: 1px solid; }
.nav-bookmarks .nav-mark { width: 10px; margin: 0 2px; border-radius: 2px; }
.nav-settings .nav-mark { border-style: dotted; }
.sidebar-foot { margin-top: auto; }
.profile { display: flex; align-items: center; gap: 9px; margin-top: 17px; border-top: 1px solid var(--line); padding: 15px 7px 1px; }
.profile-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; font-weight: 650; font-size: .88rem; }
.avatar { display: grid; place-items: center; flex: 0 0 34px; border-radius: 50%; height: 34px; background: var(--navy); color: white; font-weight: 700; }
.plain { background: transparent; border: 0; color: var(--teal-ink); padding: 6px 0; font-weight: 650; font-size: .875rem; }

.workspace { width: 100%; max-width: 1480px; padding: 35px clamp(20px, 4vw, 54px) 50px; margin-inline: auto; }
.hero {
  min-height: 186px; display: flex; justify-content: space-between; align-items: end; gap: 20px;
  padding: clamp(24px, 4vw, 38px); border-radius: 20px; color: white;
  background: radial-gradient(ellipse at 108% -40%, #187783 0%, #084c75 34%, transparent 66%),
              linear-gradient(112deg, #012e5a 37%, #063f65 100%);
  box-shadow: 0 9px 28px #012e5a1c;
}
.hero h1 { color: white; font-size: clamp(2.35rem, 5vw, 3.7rem); }
.hero-date { font-size: .95rem; color: #d9edf4; margin-bottom: 10px; }
.hero-progress { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin-top: 19px; color: #e5f2f5; font-size: .875rem; }
meter { width: 80px; height: 9px; -webkit-appearance: none; }
meter::-webkit-meter-bar { background: #ffffff32; border: 0; border-radius: 10px; }
meter::-webkit-meter-optimum-value { background: #b8d782; border-radius: 10px; }
.page-head { display: flex; justify-content: space-between; gap: 16px; align-items: end; margin-bottom: 24px; }
.page-head p { color: var(--muted); margin-top: 7px; line-height: 1.45; }
.button {
  display: inline-flex; justify-content: center; align-items: center; gap: 5px;
  min-height: 42px; padding: 8px 14px; border-radius: 8px; border: 1px solid transparent;
  font-size: .875rem; line-height: 1.25; font-weight: 690; white-space: nowrap;
}
.button.primary { background: var(--navy); color: white; }
.button.primary:hover { background: #0d4d77; }
.button.hero-button { background: white; color: var(--navy); flex: none; }
.button.hero-button:hover { background: #e8f7f7; }
.button.secondary, .button.quiet { background: white; color: var(--navy); border-color: var(--line); }
.button.quiet { min-height: 34px; padding: 5px 10px; }
.button.secondary:hover, .button.quiet:hover { background: #f4f8fc; border-color: #b5c7d9; }
.text-link { color: var(--teal-ink); font-weight: 700; font-size: .875rem; white-space: nowrap; }
.text-link:hover, .plain:hover, .row-title:hover, .item h2 a:hover { text-decoration: underline; text-underline-offset: 3px; }

.summary-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 205px), 1fr)); gap: 13px; margin: 17px 0 21px; }
.metric { display: flex; flex-direction: column; gap: 8px; background: white; border: 1px solid var(--line); border-radius: 13px; padding: 17px 19px; box-shadow: var(--shadow); border-top: 3px solid #bac8d7; min-width: 0; }
a.metric:hover { border-color: #8ca8be; }
.metric-agenda { border-top-color: var(--teal); }
.metric-finance { border-top-color: var(--orange); }
.metric-goals { border-top-color: var(--olive); }
.metric > span { font-weight: 650; color: #41546a; font-size: .9rem; }
.metric b { font-size: 1.75rem; color: var(--navy); letter-spacing: -.04em; overflow-wrap: anywhere; }
.metric small { color: var(--muted); font-weight: 520; letter-spacing: 0; line-height: 1.35; }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.24fr) minmax(0, .96fr); gap: 17px; align-items: start; }
.card { min-width: 0; background: white; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
.card-pad { padding: clamp(15px, 2vw, 23px); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 15px; }
.card-head p { margin-top: 4px; color: var(--muted); font-size: .875rem; }
.week-strip { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; margin-bottom: 9px; }
.day-chip { min-height: 59px; min-width: 0; display: grid; place-content: center; text-align: center; gap: 1px; border-radius: 9px; border: 1px solid #e4ebf3; background: #f7f9fc; color: var(--navy); }
.day-chip small { font-size: .78rem; color: #52667d; text-transform: capitalize; }
.day-chip b { font-size: 1.16rem; }
.day-chip.selected { color: white; background: var(--navy); border-color: var(--navy); }
.day-chip.selected small { color: #e8f3fa; }
.day-chip:not(.selected):hover { border-color: #86a9c2; background: #eaf3f9; }
.task-row, .payment-row { display: flex; align-items: center; gap: 11px; min-height: 63px; padding: 10px 0; border-bottom: 1px solid #edf0f3; }
.task-row:last-child, .payment-row:last-child { border-bottom: 0; }
.task-row form { margin: 0; }
.task-check { display: grid; place-items: center; min-width: 26px; min-height: 26px; padding: 0; background: white; border: 1.5px solid #9aafc3; border-radius: 7px; color: white; font-size: 1rem; }
.task-check:hover { background: #e5f4f4; border-color: var(--teal); }
.done .task-check { background: var(--teal-ink); border-color: var(--teal-ink); }
.task-main, .payment-main { min-width: 0; flex: 1; overflow-wrap: anywhere; }
.task-title, .row-title { font-weight: 660; }
.task-title:hover { color: var(--teal-ink); }
.done .task-title { text-decoration: line-through; color: var(--muted); }
.row-meta { display: flex; flex-wrap: wrap; gap: 5px 9px; color: var(--muted); font-size: .875rem; }
.row-meta:not(:empty) { margin-top: 4px; }
.collection-list { list-style: none; margin: 0; padding-block: 5px; }
.collection-row .row-meta { gap: 3px 12px; line-height: 1.35; }
.collection-details { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px 14px; }
.payment-icon { flex: 0 0 38px; height: 38px; display: grid; place-items: center; background: #fff1e8; color: #7c3815; border-radius: 9px; font-size: .73rem; font-weight: 750; }
.payment-main strong, .payment-main small, td small { display: block; }
.payment-main strong { font-size: .9rem; }
.payment-main small, td small { color: var(--muted); margin-top: 3px; }
.payment-row:hover strong { color: var(--teal-ink); }
.amount { font-variant-numeric: tabular-nums; color: var(--navy); font-weight: 710; white-space: nowrap; font-size: .9rem; }
.account-preview { padding: 16px 0 0; margin-top: 12px; border-top: 1px solid var(--line); }
.account-preview .card-head { margin-bottom: 7px; }
.account-preview p { display: flex; gap: 10px; justify-content: space-between; font-size: .875rem; color: var(--muted); line-height: 1.45; }
.account-preview strong { color: var(--navy); }

.tabs { display: flex; flex-wrap: wrap; gap: 6px; padding: 5px; margin: 0 0 16px; width: fit-content; max-width: 100%; border: 1px solid var(--line); background: #e9eff5; border-radius: 10px; }
.tabs a { min-height: 37px; display: flex; align-items: center; gap: 6px; border-radius: 7px; color: #42576b; font-size: .875rem; padding: 6px 12px; font-weight: 650; }
.tabs a:hover, .tabs a.selected { background: white; color: var(--navy); }
.tabs a.selected { box-shadow: 0 1px 3px #012e5a19; }
.tabs span { color: var(--teal-ink); font-weight: 750; }
.filters { display: flex; flex-wrap: wrap; align-items: end; gap: 9px; margin-bottom: 18px; }
.filters label { display: grid; gap: 5px; color: #3d5066; font-size: .875rem; font-weight: 640; min-width: 108px; max-width: 100%; }
.filters select { max-width: 245px; }
.filters button { margin-top: 5px; }
input:not([type="hidden"]), textarea, select {
  min-height: 42px; width: 100%; min-width: 0; background: white; border: 1px solid #becddd; border-radius: 8px;
  padding: 8px 10px; color: #132b41;
}
select { appearance: none; padding-right: 28px; background: white; padding-inline-end: 12px; }
textarea { resize: vertical; }
input:disabled, select:disabled { background: #edf1f5; }
.calendar-card { margin-bottom: 16px; max-width: 720px; }
.calendar-card .week-strip { margin-bottom: 0; }
.agenda-group { margin-bottom: 13px; }
.week-layout, .account-grid, .item-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.week-layout .agenda-group { margin: 0; }
.empty { color: var(--muted); padding: 17px 0; line-height: 1.55; }
.empty.compact { padding: 2px 0; }
.tag { display: inline-flex; align-items: center; min-height: 24px; border-radius: 6px; background: #eaf0f6; color: #41546b; font-size: .8rem; font-weight: 670; padding: 3px 7px; line-height: 1.28; }
.tag + .tag { margin-left: 4px; }
.tag.teal { background: var(--light-teal); color: var(--teal-ink); }
.tag.good { background: #e8f1db; color: #3b541f; }
.tag.warm { background: #fff0e5; color: #813b17; }
.callout, .notice { border-radius: 8px; color: #643712; background: #fff3e6; border: 1px solid #f2d8bf; padding: 10px 13px; margin-bottom: 15px; font-size: .9rem; }
.notice.success { background: var(--light-teal); border-color: #c3e1e4; color: #0a5260; }
.notice.error, .errorlist { color: #8a2d22; }
.source-line { color: var(--muted); font-size: .875rem; line-height: 1.4; margin-bottom: 14px; overflow-wrap: anywhere; }
.date-proposal { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; justify-content: space-between; }
.account-amounts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin: 2px 0 18px; }
.account-amounts > div { border: 1px solid #e2ebf4; border-radius: 8px; background: #f7fafd; padding: 9px; overflow-wrap: anywhere; }
.account-amounts small, .account-amounts strong { display: block; }
.account-amounts small { color: var(--muted); margin-bottom: 3px; }
.account-amounts strong { color: var(--navy); font-variant-numeric: tabular-nums; }
.pockets-head { margin-bottom: 7px; }
.pocket-row, .balanced-row { display: flex; justify-content: space-between; padding: 9px 0; align-items: baseline; gap: 10px; border-bottom: 1px solid #edf1f5; }
.pocket-row strong, .balanced-row strong { color: var(--navy); }
.pocket-row:hover { color: var(--teal-ink); }

.table-wrap { overflow: auto; }
table { border-collapse: collapse; width: 100%; text-align: left; }
th { font-size: .875rem; color: #41546b; font-weight: 660; background: #f4f7fa; }
th, td { padding: 11px 9px; vertical-align: middle; }
td { border-bottom: 1px solid #e9eff4; font-size: .91rem; }
tr:last-child td { border-bottom: 0; }
td:first-child { overflow-wrap: anywhere; }
td.table-action { text-align: right; }
.row-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 5px; }
.agenda-task-row .row-actions { flex: 0 0 auto; }
.capture-connection { margin-bottom: 16px; }
.capture-connection .card-head { margin-bottom: 0; flex-wrap: wrap; }
td[data-label="Estado"] .tag { margin-bottom: 2px; }
.voided td:not(.table-action) { color: var(--muted); }
.voided strong, .voided .amount { text-decoration: line-through; }

.item-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.item { display: flex; flex-direction: column; gap: 9px; overflow-wrap: anywhere; }
.item h2 { font-size: 1.08rem; letter-spacing: -.02em; }
.item-meta { font-size: .82rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 8px; }
.item-meta span:first-child { color: var(--teal-ink); font-weight: 670; }
.item-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px; margin-top: auto; padding-top: 5px; }
.pagination { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 14px; font-size: .875rem; color: var(--muted); }
.history-layout { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 15px; align-items: start; }
.history-aside { display: grid; gap: 15px; }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { display: grid; grid-template-columns: 14px minmax(0, 1fr) auto; align-items: start; gap: 9px; min-height: 65px; padding: 10px 0; border-bottom: 1px solid #edf1f5; }
.timeline li:last-child { border-bottom: 0; }
.timeline li.empty { display: block; }
.timeline-dot { width: 8px; height: 8px; background: #91a7be; border-radius: 50%; margin: 8px 2px; }
.timeline-task { background: var(--teal); }.timeline-goal { background: var(--olive); }.timeline-movement, .timeline-bill { background: var(--orange); }
.timeline-body { overflow-wrap: anywhere; }
.timeline-body p { margin-bottom: 4px; }
.timeline-body .tag { margin-left: 7px; }
.timeline-date { text-align: right; color: var(--muted); display: grid; gap: 3px; font-size: .84rem; }
.plain-list { margin-bottom: 0; padding-left: 20px; }
.plain-list li + li { margin-top: 5px; }

.form-card { max-width: 760px; }
.entry-form { display: grid; gap: 12px; }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px 16px; }
.field { min-width: 0; display: grid; align-content: start; gap: 5px; }
.field.full { grid-column: 1 / -1; }
.entry-form label { display: block; font-size: .91rem; font-weight: 670; color: #213a54; }
.field label span { color: var(--teal-ink); }
.help, .errorlist { margin: 0; line-height: 1.4; font-size: .875rem; }
.help ul, .errorlist { padding-left: 18px; }
.inline-actions, .form-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.inline-actions { margin-bottom: 15px; }
.form-actions { margin-top: 3px; }
.logout-setting { margin-top: 16px; }

.sign-in { display: grid; justify-items: center; align-items: center; min-height: 100dvh; padding: 22px; background: radial-gradient(ellipse at 50% 0, #dcecf1, var(--bg) 65%); }
.sign-card { width: min(440px, 100%); background: white; border: 1px solid var(--line); border-radius: 19px; padding: clamp(22px, 5vw, 41px); box-shadow: 0 18px 70px #012e5a16; }
.full-logo { display: block; max-width: 70%; height: auto; margin-bottom: 26px; }
.sign-card h1 { font-size: 2.1rem; }
.sign-card > p { margin: 9px 0 20px; }
.sign-card .button { width: 100%; }
.login-alternate { color: var(--teal-ink); margin-top: 14px; }
.login-alternate summary { cursor: pointer; font-size: .875rem; }
.login-alternate form { margin-top: 15px; }

@media (max-width: 1120px) {
  .shell { grid-template-columns: 188px minmax(0, 1fr); }
  .item-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sidebar { padding-inline: 10px; }
  .workspace { padding-inline: 23px; }
}
@media (max-width: 880px) {
  .dashboard-grid, .history-layout { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 690px) {
  .shell { display: block; }
  .sidebar { position: static; height: auto; padding: 10px 12px 8px; border-right: 0; border-bottom: 1px solid var(--line); }
  .brand { padding: 0 0 10px; }
  .brand img { width: 34px; height: 34px; }
  .brand span { display: none; }
  .sidebar nav { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
  .sidebar nav .nav-link { justify-content: center; }
  .nav-link { min-height: 40px; gap: 5px; padding: 7px 10px; flex: none; font-size: .875rem; }
  .nav-link.active::before { display: none; }
  .nav-mark { display: none; }
  .sidebar-foot { position: absolute; top: 8px; right: 12px; }
  .profile { display: none; }
  .workspace { padding: 17px 12px 38px; }
  .hero { align-items: start; flex-direction: column; border-radius: 15px; padding: 20px; gap: 15px; }
  .hero h1 { font-size: 2.45rem; }
  .hero-progress { margin-top: 13px; }
  .page-head { flex-wrap: wrap; align-items: start; gap: 10px; margin-bottom: 17px; }
  .summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 12px 0 14px; }
  .metric { padding: 10px 11px; }
  .metric b { font-size: 1.45rem; }
  .dashboard-grid, .account-grid, .week-layout { grid-template-columns: minmax(0, 1fr); gap: 11px; }
  .item-grid { gap: 9px; }
  .card-pad { padding: 14px; }
  .collection-list { padding-block: 4px; }
  .collection-row { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: start; gap: 4px 10px; }
  .collection-row > form { grid-row: 1 / span 2; }
  .collection-row .task-check { min-width: 32px; min-height: 32px; }
  .collection-details { grid-column: 2; justify-content: flex-start; }
  .agenda-task-row { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: start; }
  .agenda-task-row > form { grid-row: 1 / span 2; }
  .agenda-task-row .row-actions { grid-column: 2; }
  .tabs a { padding-inline: 9px; }
  .table-wrap { overflow: visible; }
  table, tbody, tr, td { display: block; width: 100%; }
  thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  tr { margin: 7px 0 11px; border: 1px solid var(--line); border-radius: 9px; padding: 7px 9px; }
  td { display: grid; grid-template-columns: minmax(80px, .8fr) minmax(0, 1.5fr); align-items: baseline; gap: 2px 6px; border: 0; padding: 4px 0; font-size: .9rem; overflow-wrap: anywhere; }
  td::before { content: attr(data-label); font-size: .83rem; color: var(--muted); grid-row: 1 / span 3; white-space: nowrap; }
  td small { grid-column: 2; }
  td .tag { justify-self: start; }
  td .tag + .tag { margin-left: 0; grid-column: 2; }
  td.table-action, td.empty { display: block; text-align: left; padding-top: 8px; }
  .row-actions { justify-content: flex-start; }
}
@media (max-width: 420px) {
  .item-grid, .fields { grid-template-columns: minmax(0, 1fr); }
  .week-strip { gap: 4px; }
  .day-chip { min-height: 51px; }
  .payment-row { gap: 8px; }
  .payment-icon { flex-basis: 34px; height: 34px; }
  .payment-main strong { font-size: .875rem; }
  .amount { white-space: normal; }
  .filters select { max-width: 160px; }
  .task-row { gap: 8px; }
  .summary-grid > :last-child:nth-child(odd) { grid-column: 1 / -1; }
}
