/* Finanças — design system (estilo Apple Store + Liquid Glass) */
:root {
  --bg: #f5f5f7; --ink: #1d1d1f; --ink2: #6e6e73; --ink3: #86868b;
  --line: rgba(0, 0, 0, .07); --line2: rgba(0, 0, 0, .12);
  --blue: #0071e3; --blue-dark: #0060bf; --green: #1d8a3a; --purple: #8e44c9; --red: #e30000; --orange: #bf4800; --teal: #0e8a8a;
  --glass: rgba(255, 255, 255, .58); --glass-strong: rgba(255, 255, 255, .78); --glass-border: rgba(255, 255, 255, .78);
  --shadow: 0 12px 34px rgba(31, 38, 135, .10), 0 1px 2px rgba(0, 0, 0, .04);
  --radius: 22px; --radius-sm: 14px;
  --font: "Inter", "SF Pro Text", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-display: "Inter Display", "SF Pro Display", "Inter", -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { background: var(--bg); -webkit-text-size-adjust: 100%; }
body {
  color: var(--ink); font-family: var(--font); font-size: 16px; line-height: 1.47; -webkit-font-smoothing: antialiased; min-height: 100vh;
  background:
    radial-gradient(1100px 620px at 8% -8%, rgba(0, 113, 227, .20), transparent 62%),
    radial-gradient(900px 560px at 92% 4%, rgba(142, 68, 201, .18), transparent 60%),
    radial-gradient(900px 520px at 55% 38%, rgba(29, 138, 58, .09), transparent 60%),
    radial-gradient(800px 500px at 20% 78%, rgba(0, 113, 227, .09), transparent 60%),
    radial-gradient(700px 480px at 85% 86%, rgba(142, 68, 201, .10), transparent 60%),
    var(--bg);
  background-attachment: fixed;
}
h1, h2, h3, .display { font-family: var(--font-display); letter-spacing: -.012em; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { width: min(1320px, 100% - 32px); margin: 0 auto; }
.muted { color: var(--ink2); }
.small { font-size: 13px; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }

/* ---- vidro ---- */
.glass, .card {
  position: relative; background: var(--glass); -webkit-backdrop-filter: blur(30px) saturate(170%); backdrop-filter: blur(30px) saturate(170%);
  border: 1px solid var(--glass-border); box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, .95), inset 0 -1px 0 rgba(255, 255, 255, .35);
}
.card { border-radius: var(--radius); }
.card::before { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; background: linear-gradient(135deg, rgba(255, 255, 255, .62) 0%, rgba(255, 255, 255, .14) 34%, rgba(255, 255, 255, 0) 60%); }
.card > * { position: relative; }
.card.pad { padding: 24px 28px; }

/* ---- navegação ---- */
.nav { padding-top: 14px; font-size: 13px; }
.nav .wrap { display: flex; align-items: center; height: 48px; gap: 14px; }
.pillbar { display: flex; align-items: center; height: 44px; padding: 0 8px; border-radius: 980px; background: rgba(255, 255, 255, .55); -webkit-backdrop-filter: blur(26px) saturate(180%); backdrop-filter: blur(26px) saturate(180%); border: 1px solid rgba(255, 255, 255, .8); box-shadow: 0 8px 24px rgba(31, 38, 135, .10), inset 0 1px 0 rgba(255, 255, 255, .95); }
.nav .brand { padding: 0 16px 0 10px; display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 15px; letter-spacing: -.01em; color: var(--ink); }
.nav .brand .mark { width: 22px; height: 22px; border-radius: 7px; background: linear-gradient(135deg, #0071e3, #8e44c9); display: inline-block; }
.nav ul { display: flex; list-style: none; padding: 0 4px; gap: 2px; }
.nav ul a { display: block; padding: 8px 14px; border-radius: 980px; color: var(--ink); opacity: .85; }
.nav ul a:hover { text-decoration: none; opacity: 1; background: rgba(255, 255, 255, .5); }
.nav ul a.on { background: rgba(255, 255, 255, .9); color: var(--blue); opacity: 1; box-shadow: 0 1px 4px rgba(0, 0, 0, .08); }
.nav .user { margin-left: auto; padding: 0 6px 0 16px; gap: 10px; color: var(--ink2); display: flex; align-items: center; }
.nav .user a { color: var(--ink2); }
.avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--ink); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; }
.nav .menu-btn { display: none; }

/* ---- cabeçalhos ---- */
.hero { padding: 40px 0 22px; }
.hero h1 { font-size: 44px; line-height: 1.1; font-weight: 600; }
.hero h1 span { color: var(--ink2); }
.hero .date { margin-top: 10px; color: var(--ink3); font-size: 15px; }
h2.sec { font-size: 26px; font-weight: 600; margin: 44px 0 18px; line-height: 1.2; }
h2.sec span { color: var(--ink2); }
h2.sec:first-child { margin-top: 0; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head h1 { font-size: 36px; font-weight: 600; line-height: 1.1; }
.page-head h1 span { color: var(--ink2); }
.page-head .actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---- grades ---- */
.grid4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.grid2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; }
.grid2 > *, .grid3 > *, .grid4 > * { min-width: 0; }

/* ---- indicadores ---- */
.kpi { padding: 20px 24px 18px; }
.kpi .lbl { font-size: 13px; color: var(--ink2); font-weight: 500; }
.kpi .val { font-size: 28px; font-weight: 600; letter-spacing: -.02em; margin-top: 4px; line-height: 1.15; font-family: var(--font-display); }
.kpi .val.red { color: var(--red); }
.kpi .meta { font-size: 12px; color: var(--ink3); margin-top: 6px; }

/* ---- gráfico ---- */
.chart-card { padding: 24px 26px 18px; }
.chart-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.legend { display: flex; gap: 20px; font-size: 13px; flex-wrap: wrap; }
.legend span { display: inline-flex; align-items: center; gap: 8px; }
.legend i, .dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; }
.controls { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.seg { display: inline-flex; background: rgba(120, 120, 128, .14); border-radius: 9px; padding: 2px; font-size: 12px; font-weight: 500; border: 1px solid rgba(255, 255, 255, .5); }
.seg a, .seg span { padding: 5px 12px; border-radius: 7px; color: var(--ink2); text-decoration: none; }
.seg .on { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.summary { margin-top: 12px; font-size: 14px; color: var(--ink2); }
.summary b { color: var(--ink); font-weight: 600; }
.chart-wrap { position: relative; margin-top: 8px; }
.chart-wrap svg { width: 100%; height: auto; display: block; }
.chart-wrap .bar-hit { fill: transparent; cursor: pointer; }
.chart-wrap .bar-hit:hover { fill: rgba(120, 120, 128, .10); }
.tip { position: absolute; z-index: 5; width: 300px; background: rgba(255, 255, 255, .80); -webkit-backdrop-filter: blur(28px) saturate(180%); backdrop-filter: blur(28px) saturate(180%); border: 1px solid rgba(255, 255, 255, .85); border-radius: 16px; box-shadow: 0 14px 40px rgba(31, 38, 135, .18), inset 0 1px 0 rgba(255, 255, 255, .95); padding: 11px 14px 10px; font-size: 13px; pointer-events: none; }
.tip .m { color: var(--ink2); font-weight: 500; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.tip .total { font-size: 21px; font-weight: 600; letter-spacing: -.02em; margin: 1px 0 6px; font-family: var(--font-display); }
.tip .row { display: flex; align-items: center; justify-content: space-between; padding: 3px 0; border-top: 1px solid var(--line); }
.tip .row span { display: inline-flex; align-items: center; gap: 8px; }
.tip .row i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.tip .net { margin-top: 6px; padding-top: 7px; border-top: 1px solid var(--line); font-size: 12px; color: var(--ink2); display: flex; justify-content: space-between; gap: 14px; white-space: nowrap; }
.tip .net b { color: var(--ink); }
.chart-empty { padding: 60px 20px; text-align: center; color: var(--ink3); }

/* ---- ações ---- */
.action { padding: 26px 28px 24px; display: flex; flex-direction: column; min-height: 196px; color: var(--ink); }
.action .ic { width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin-bottom: 14px; border: 1px solid rgba(255, 255, 255, .8); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9), 0 4px 12px rgba(0, 0, 0, .06); }
.action .ic.g { background: rgba(29, 138, 58, .14); } .action .ic.r { background: rgba(227, 0, 0, .11); } .action .ic.b { background: rgba(0, 113, 227, .14); }
.action p { font-size: 17px; line-height: 1.35; font-weight: 500; letter-spacing: -.005em; }
.action p .g { color: var(--green); } .action p .r { color: var(--red); } .action p .b { color: var(--blue); }
.action .foot { margin-top: auto; padding-top: 18px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.action .hint { font-size: 12px; color: var(--ink3); }

/* ---- botões ---- */
.pill, button.pill { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border-radius: 980px; padding: 8px 16px; font-size: 14px; font-weight: 500; color: #fff; background: linear-gradient(180deg, rgba(255, 255, 255, .34), rgba(255, 255, 255, .04) 55%, rgba(0, 0, 0, .05)), var(--blue); border: 1px solid rgba(255, 255, 255, .55); box-shadow: 0 6px 16px rgba(0, 113, 227, .28), inset 0 1px 0 rgba(255, 255, 255, .55); font-family: inherit; cursor: pointer; text-decoration: none; line-height: 1.3; white-space: nowrap; }
.pill:hover { text-decoration: none; filter: brightness(1.05); }
.pill:active { transform: translateY(1px); }
.pill.g { background: linear-gradient(180deg, rgba(255, 255, 255, .34), rgba(255, 255, 255, .04) 55%, rgba(0, 0, 0, .05)), var(--green); box-shadow: 0 6px 16px rgba(29, 138, 58, .28), inset 0 1px 0 rgba(255, 255, 255, .55); }
.pill.r { background: linear-gradient(180deg, rgba(255, 255, 255, .34), rgba(255, 255, 255, .04) 55%, rgba(0, 0, 0, .05)), var(--red); box-shadow: 0 6px 16px rgba(227, 0, 0, .24), inset 0 1px 0 rgba(255, 255, 255, .55); }
.pill.o { background: rgba(255, 255, 255, .55); color: var(--blue); border: 1px solid rgba(0, 113, 227, .45); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9); padding: 5px 12px; font-size: 12px; }
.pill.o.danger { color: var(--red); border-color: rgba(227, 0, 0, .4); }
.pill.o.neutral { color: var(--ink); border-color: var(--line2); }
.pill.lg { padding: 11px 22px; font-size: 15px; }
.pill[disabled] { opacity: .5; cursor: default; }
.linkbtn { background: none; border: 0; color: var(--blue); font: inherit; cursor: pointer; padding: 0; }
.linkbtn.danger { color: var(--red); }

/* ---- barra de ações ---- */
.actionbar { margin-top: 20px; padding: 14px 22px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.actionbar-title { font-family: var(--font-display); font-weight: 600; font-size: 19px; letter-spacing: -.012em; margin-right: 6px; }
.actionbar .pill { padding: 9px 18px; font-size: 14px; }
.actionbar-hint { margin-left: auto; font-size: 12px; color: var(--ink3); }

/* ---- listas ---- */
.list { padding: 22px 26px 8px; display: flex; flex-direction: column; }
.list ul { flex: 1; }
.list-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.list-head h3 { font-size: 20px; font-weight: 600; }
.list-head .sub { font-size: 13px; color: var(--ink2); margin-top: 2px; overflow-wrap: anywhere; }
.list-head .sub b { font-weight: 600; color: var(--red); }
.list-head a { font-size: 14px; margin-top: 4px; white-space: nowrap; }
.list ul { list-style: none; }
.list li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
.dot.red { background: var(--red); } .dot.org { background: var(--orange); } .dot.gray { background: #c7c7cc; } .dot.green { background: var(--green); }
.list .t { flex: 1; min-width: 0; }
.list .title { font-size: 15px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list .meta { font-size: 12px; color: var(--ink3); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list .meta .red { color: var(--red); font-weight: 500; } .list .meta .org { color: var(--orange); font-weight: 500; }
.list .amt { font-size: 15px; font-weight: 600; letter-spacing: -.01em; white-space: nowrap; min-width: 96px; text-align: right; font-variant-numeric: tabular-nums; }
.list .amt.red { color: var(--red); }
.list .tot { display: flex; justify-content: space-between; padding: 12px 0 10px; font-size: 13px; color: var(--ink2); border-top: 1px solid var(--line2); }
.list .tot b { color: var(--ink); font-weight: 600; }
.list .empty { padding: 26px 0; color: var(--ink3); text-align: center; font-size: 14px; }

/* ---- tabelas ---- */
.table-card { padding: 8px 0 4px; overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-size: 12px; font-weight: 500; color: var(--ink3); padding: 10px 14px; border-bottom: 1px solid var(--line2); white-space: nowrap; }
.tbl td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr:hover td { background: rgba(255, 255, 255, .35); }
.tbl td.num, .tbl th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl .desc { font-weight: 500; }
.tbl .sub { color: var(--ink3); font-size: 12px; }
.tbl .acts { white-space: nowrap; text-align: right; }
.tbl .acts form { display: inline; }
.tbl .acts .pill.o { margin-left: 4px; }
.pos { color: var(--green); } .neg { color: var(--red); }
.badge { display: inline-block; font-size: 11px; font-weight: 500; padding: 2px 8px; border-radius: 980px; background: rgba(120, 120, 128, .14); color: var(--ink2); white-space: nowrap; }
.badge.red { background: rgba(227, 0, 0, .10); color: var(--red); } .badge.org { background: rgba(191, 72, 0, .12); color: var(--orange); } .badge.green { background: rgba(29, 138, 58, .12); color: var(--green); } .badge.blue { background: rgba(0, 113, 227, .12); color: var(--blue); }
.catchip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink2); }

/* ---- formulários ---- */
.form { padding: 26px 28px 24px; max-width: 760px; }
.form h2 { font-size: 22px; font-weight: 600; margin-bottom: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label, .lbl { font-size: 12px; font-weight: 500; color: var(--ink2); }
.help, .field .help { font-size: 12px; color: var(--ink3); }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=number], input[type=search], select, textarea {
  width: 100%; font: inherit; font-size: 15px; color: var(--ink); background: rgba(255, 255, 255, .72); border: 1px solid var(--line2); border-radius: 12px; padding: 10px 12px; outline: none; transition: box-shadow .15s, border-color .15s; -webkit-appearance: none; appearance: none;
}
select { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path d='M1 1l5 5 5-5' fill='none' stroke='%236e6e73' stroke-width='1.6' stroke-linecap='round'/></svg>"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }
input:focus, select:focus, textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(0, 113, 227, .18); }
input.money { text-align: right; font-variant-numeric: tabular-nums; }
textarea { min-height: 80px; resize: vertical; }
.check { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.check input { width: 18px; height: 18px; accent-color: var(--blue); }
.form-actions { display: flex; align-items: center; gap: 12px; margin-top: 18px; flex-wrap: wrap; }
.form-actions .spacer { flex: 1; }
.typeswitch { display: flex; gap: 8px; margin-bottom: 18px; }
.typeswitch a { flex: 1; text-align: center; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line2); background: rgba(255, 255, 255, .5); color: var(--ink); font-weight: 500; font-size: 14px; }
.typeswitch a:hover { text-decoration: none; }
.typeswitch a.on.income { background: rgba(29, 138, 58, .12); border-color: var(--green); color: var(--green); }
.typeswitch a.on.expense { background: rgba(227, 0, 0, .09); border-color: var(--red); color: var(--red); }
.typeswitch a.on.transfer { background: rgba(0, 113, 227, .12); border-color: var(--blue); color: var(--blue); }
.deductions { border: 1px dashed var(--line2); border-radius: 14px; padding: 14px; margin-bottom: 14px; background: rgba(255, 255, 255, .35); }
.deductions h4 { font-size: 14px; font-weight: 600; margin-bottom: 8px; display: flex; justify-content: space-between; align-items: center; }
.deductions .drow { display: grid; grid-template-columns: 1.4fr 2fr 1.4fr 1fr auto; gap: 8px; align-items: center; margin-bottom: 8px; }
.deductions .net { font-size: 13px; color: var(--ink2); margin-top: 6px; }
.deductions .net b { color: var(--ink); }
.recur-box { border: 1px solid var(--line2); border-radius: 14px; padding: 14px; margin-bottom: 14px; background: rgba(255, 255, 255, .35); }
.alert { padding: 12px 16px; border-radius: 14px; font-size: 14px; margin-bottom: 16px; border: 1px solid; }
.alert.error { background: rgba(227, 0, 0, .07); border-color: rgba(227, 0, 0, .25); color: #b00000; }
.alert.ok { background: rgba(29, 138, 58, .09); border-color: rgba(29, 138, 58, .3); color: #156b2c; }
.alert.info { background: rgba(0, 113, 227, .08); border-color: rgba(0, 113, 227, .25); color: #0050a8; }

/* ---- filtros ---- */
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; padding: 16px 20px; margin-bottom: 16px; }
.filters .field { margin: 0; min-width: 140px; }
.filters input, .filters select { padding: 8px 10px; font-size: 14px; }

/* ---- diálogos ---- */
dialog { border: 0; padding: 0; background: transparent; max-width: 100%; }
dialog::backdrop { background: rgba(29, 29, 31, .35); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
dialog .card { width: min(480px, 92vw); padding: 24px 26px; background: rgba(255, 255, 255, .86); }
dialog h3 { font-size: 20px; font-weight: 600; margin-bottom: 10px; }
dialog p { color: var(--ink2); font-size: 14px; margin-bottom: 14px; }

/* ---- login ---- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth .card { width: min(420px, 100%); padding: 34px 32px 30px; }
.auth h1 { font-size: 30px; font-weight: 600; margin-bottom: 4px; }
.auth .sub { color: var(--ink2); margin-bottom: 22px; font-size: 15px; }
.auth .brand { display: flex; align-items: center; gap: 10px; font-weight: 600; margin-bottom: 22px; }
.auth .brand .mark { width: 28px; height: 28px; border-radius: 9px; background: linear-gradient(135deg, #0071e3, #8e44c9); }
.auth .pill { width: 100%; padding: 12px; font-size: 15px; }
.code-input { font-size: 26px !important; letter-spacing: .3em; text-align: center; font-variant-numeric: tabular-nums; }

footer.foot { padding: 40px 0 36px; font-size: 12px; color: var(--ink3); display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; border-top: 1px solid var(--line); margin-top: 56px; }

/* ---- responsivo ---- */
@media (max-width: 1100px) {
  .grid4 { grid-template-columns: 1fr 1fr; }
  .grid3 { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .wrap { width: calc(100% - 32px); }
  .grid2, .grid4, .row, .row3 { grid-template-columns: 1fr; }
  .hero h1 { font-size: 30px; } h2.sec { font-size: 22px; margin-top: 32px; }
  .page-head h1 { font-size: 28px; }
  .nav .menu-btn { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .7); margin-left: auto; cursor: pointer; }
  .nav .user { margin-left: 0; }
  .nav ul { display: none; position: absolute; left: 16px; right: 16px; top: 66px; z-index: 20; flex-direction: column; padding: 8px; border-radius: 18px; background: rgba(255, 255, 255, .9); -webkit-backdrop-filter: blur(26px); backdrop-filter: blur(26px); box-shadow: var(--shadow); }
  .nav ul.open { display: flex; }
  .nav .wrap { position: relative; }
  .list { padding: 18px 18px 6px; } .list .amt { min-width: 80px; }
  .chart-card { padding: 18px 14px 12px; }
  .tip { width: 260px; }
  .deductions .drow { grid-template-columns: 1fr 1fr; }
  .form { padding: 20px 18px; }
  .actionbar-hint { display: none; }
}
