@font-face{font-family:"Inter";src:url("../assets/fonts/Inter-Regular.woff") format("woff");font-weight:400;font-display:swap}
@font-face{font-family:"Inter";src:url("../assets/fonts/Inter-Medium.woff") format("woff");font-weight:500;font-display:swap}
@font-face{font-family:"Inter";src:url("../assets/fonts/Inter-SemiBold.woff") format("woff");font-weight:600;font-display:swap}
@font-face{font-family:"Inter Display";src:url("../assets/fonts/InterDisplay-Bold.woff") format("woff");font-weight:700;font-display:swap}
@font-face{font-family:"Inter Display";src:url("../assets/fonts/InterDisplay-ExtraBold.woff") format("woff");font-weight:800;font-display:swap}

:root{
  --bg:#F6F5FB; --surface:#FFFFFF; --surface-2:#EFEDF7; --surface-3:#E6E3F2;
  --text:#15122B; --text-2:#55516B; --text-3:#68657D; --border:#E4E2EE; --border-2:#D3D0E2;
  --primary:#5B3DF5; --primary-hover:#4A2EE3; --primary-ink:#FFFFFF; --primary-soft:#ECE8FF; --primary-text:#4A2FE0;
  --lime:#B8F34A; --lime-ink:#1D2A05; --lime-bar:#7FB81E; --lime-soft:#EEFBD5;
  --good:#0D7340; --good-soft:#E3F6EA; --bad:#BF2E34; --bad-soft:#FDEBEC; --warn:#8A5400; --warn-soft:#FFF3D9;
  --tab-active-bg:var(--primary); --tab-active-ink:#FFFFFF;
  --chart-1:#5B3DF5; --chart-2:#7FB81E; --chart-3:#F2994A; --chart-4:#2D9CDB; --chart-5:#EB5797; --chart-6:#9B8AFB; --chart-7:#56CCB2; --chart-8:#B5B2C6;
  --radius:14px; --radius-sm:10px; --radius-lg:22px;
  --shadow:0 1px 2px rgba(21,18,43,.06),0 8px 24px rgba(21,18,43,.06);
  --font:"Inter",system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;
  --font-display:"Inter Display","Inter",system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;
  --safe-b:env(safe-area-inset-bottom,0px);
  color-scheme:light;
}
:root[data-theme="dark"]{
  --bg:#141417; --surface:#1C1C21; --surface-2:#25252B; --surface-3:#2E2E35;
  --text:#F2F1F7; --text-2:#B2B0BF; --text-3:#85839A; --border:#2C2C33; --border-2:#3A3A43;
  --primary:#6A50F8; --primary-hover:#7A62FF; --primary-ink:#FFFFFF; --primary-soft:#2A2550; --primary-text:#AFA2FF;
  --lime:#B8F34A; --lime-ink:#1D2A05; --lime-bar:#B8F34A; --lime-soft:#2B3417;
  --good:#4CD38A; --good-soft:#17301F; --bad:#FF6B6F; --bad-soft:#3A1C1E; --warn:#F5B94A; --warn-soft:#33290F;
  --tab-active-bg:var(--lime); --tab-active-ink:var(--lime-ink);
  --chart-1:#8069FF; --chart-2:#B8F34A; --chart-3:#F2994A; --chart-4:#56B4F0; --chart-5:#F27AAF; --chart-6:#B3A6FF; --chart-7:#5ED9BD; --chart-8:#6E6C80;
  --shadow:0 1px 2px rgba(0,0,0,.3),0 8px 24px rgba(0,0,0,.25);
  color-scheme:dark;
}

*,*::before,*::after{box-sizing:border-box}
html{-webkit-text-size-adjust:100%;text-size-adjust:100%}
body{margin:0;background:var(--bg);color:var(--text);font-family:var(--font);font-size:16px;line-height:1.5;-webkit-font-smoothing:antialiased;-webkit-tap-highlight-color:transparent}
img,svg,canvas{display:block;max-width:100%}
button,input,select,textarea{font:inherit;color:inherit}
a{color:var(--primary-text)}
h1,h2,h3,h4{font-family:var(--font-display);margin:0;line-height:1.12;letter-spacing:-.02em;font-weight:800}
h1{font-size:clamp(30px,8.4vw,46px)} h2{font-size:clamp(24px,6.4vw,32px)} h3{font-size:20px;font-weight:700} h4{font-size:16px;font-weight:700;letter-spacing:-.01em}
p{margin:0}
.num{font-variant-numeric:tabular-nums;font-feature-settings:"tnum"}
.muted{color:var(--text-2)} .faint{color:var(--text-3)} .small{font-size:14px} .tiny{font-size:12px}
.sr-only{position:absolute!important;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.hidden{display:none!important}

.btn{appearance:none;border:0;border-radius:999px;min-height:52px;padding:0 22px;display:inline-flex;align-items:center;justify-content:center;gap:8px;font-weight:600;font-size:16px;cursor:pointer;text-decoration:none;transition:transform .12s ease,background .15s ease,opacity .15s;white-space:nowrap;user-select:none}
.btn:active{transform:scale(.98)}
.btn-primary{background:var(--primary);color:var(--primary-ink)} .btn-primary:hover{background:var(--primary-hover)}
.btn-lime{background:var(--lime);color:var(--lime-ink)}
.btn-ghost{background:var(--surface-2);color:var(--text)}
.btn-line{background:transparent;color:var(--text);box-shadow:inset 0 0 0 1.5px var(--border-2)}
.btn-danger{background:var(--bad-soft);color:var(--bad)}
.btn-sm{min-height:40px;padding:0 16px;font-size:15px}
.btn-xs{min-height:40px;padding:0 14px;font-size:14px}
.btn-block{width:100%}
.btn[disabled]{opacity:.5;pointer-events:none}
.icon-btn{appearance:none;border:0;background:var(--surface-2);color:var(--text);width:44px;height:44px;border-radius:50%;display:inline-flex;align-items:center;justify-content:center;cursor:pointer;flex:none}
.icon-btn svg{width:20px;height:20px}
.link{background:none;border:0;padding:0;color:var(--primary-text);font-weight:600;cursor:pointer;text-decoration:none}

.field{display:flex;flex-direction:column;gap:6px;margin-bottom:14px}
.field>label,.label{font-size:14px;font-weight:600;color:var(--text-2)}
.input,select.input,textarea.input{width:100%;min-height:50px;border-radius:var(--radius-sm);border:1.5px solid var(--border-2);background:var(--surface);padding:12px 14px;font-size:16px;outline:none;transition:border-color .15s}
textarea.input{min-height:90px;resize:vertical}
.input:focus{border-color:var(--primary)}
.input.err{border-color:var(--bad)}
.err-msg{color:var(--bad);font-size:14px;font-weight:500;min-height:0}
.hint{font-size:13px;color:var(--text-3)}
.row{display:flex;gap:10px;align-items:center} .row>*{min-width:0}
.grid2{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.check{display:flex;gap:10px;align-items:flex-start;font-size:14px;color:var(--text-2);cursor:pointer}
.check input{width:20px;height:20px;accent-color:var(--primary);flex:none;margin-top:1px}

.card{background:var(--surface);border-radius:var(--radius);padding:18px;border:1px solid var(--border)}
.card-flat{background:var(--surface-2);border-radius:var(--radius);padding:16px}
.chip{display:inline-flex;align-items:center;gap:6px;height:38px;padding:0 14px;flex:none;border-radius:999px;background:var(--surface-2);color:var(--text-2);font-size:14px;font-weight:600;border:0;cursor:pointer;white-space:nowrap}
.chip.on{background:var(--primary);color:var(--primary-ink)}
.tag{display:inline-flex;align-items:center;height:24px;padding:0 9px;border-radius:999px;font-size:12px;font-weight:600;background:var(--surface-2);color:var(--text-2);white-space:nowrap}
.tag-good{background:var(--good-soft);color:var(--good)} .tag-bad{background:var(--bad-soft);color:var(--bad)} .tag-warn{background:var(--warn-soft);color:var(--warn)} .tag-pri{background:var(--primary-soft);color:var(--primary-text)} .tag-lime{background:var(--lime);color:var(--lime-ink)}
.progress{height:10px;border-radius:99px;background:var(--surface-3);overflow:hidden}
.progress>i{display:block;height:100%;border-radius:99px;background:var(--primary);transition:width .5s ease}
.progress.lime>i{background:var(--lime-bar)} .progress.bad>i{background:var(--bad)} .progress.warn>i{background:var(--warn)}
.divider{height:1px;background:var(--border);margin:14px 0}

/* toasts */
.toasts{position:fixed;left:0;right:0;top:max(12px,env(safe-area-inset-top));z-index:200;display:flex;flex-direction:column;align-items:center;gap:8px;pointer-events:none;padding:0 14px}
.toast{pointer-events:auto;background:var(--text);color:var(--bg);padding:12px 16px;border-radius:14px;font-size:15px;font-weight:500;max-width:440px;width:100%;box-shadow:var(--shadow);animation:tin .25s ease}
.toast.good{background:var(--good);color:#fff} .toast.bad{background:var(--bad);color:#fff}
@keyframes tin{from{opacity:0;transform:translateY(-8px)}to{opacity:1;transform:none}}

/* bottom sheet */
.sheet-wrap{position:fixed;inset:0;z-index:120;display:flex;align-items:flex-end;justify-content:center;background:rgba(10,8,25,.5);animation:fade .2s ease}
.sheet{background:var(--bg);width:100%;max-width:560px;max-height:92vh;max-height:92dvh;overflow:auto;border-radius:24px 24px 0 0;padding:10px 18px calc(22px + var(--safe-b));animation:up .25s cubic-bezier(.2,.8,.2,1);overscroll-behavior:contain}
.sheet .grab{width:42px;height:5px;border-radius:9px;background:var(--border-2);margin:0 auto 12px}
.sheet-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:14px}
.sheet-head h3{font-size:22px}
@keyframes up{from{transform:translateY(40px);opacity:.4}to{transform:none;opacity:1}}
@keyframes fade{from{opacity:0}to{opacity:1}}
@media (min-width:700px){.sheet-wrap{align-items:center}.sheet{border-radius:24px}}

/* list rows */
.list{display:flex;flex-direction:column}
.li{display:flex;align-items:center;gap:12px;padding:12px 0;border-bottom:1px solid var(--border);min-height:58px}
.li:last-child{border-bottom:0}
.li .ic{width:40px;height:40px;border-radius:12px;background:var(--surface-2);display:flex;align-items:center;justify-content:center;flex:none;color:var(--text-2)}
.li .ic svg{width:20px;height:20px}
.li .tx{flex:1;min-width:0}
.li .t1{font-weight:600;font-size:15px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.li .t2{font-size:13px;color:var(--text-3);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.li .val{font-weight:700;font-size:15px;white-space:nowrap;font-variant-numeric:tabular-nums}
.pos{color:var(--good)} .neg{color:var(--text)}
.empty{text-align:center;padding:28px 14px;color:var(--text-3)}
.empty h4{color:var(--text);margin-bottom:6px}

.seg{display:flex;background:var(--surface-2);border-radius:999px;padding:4px;gap:4px}
.seg button{flex:1;border:0;background:transparent;border-radius:999px;min-height:38px;font-weight:600;font-size:14px;color:var(--text-2);cursor:pointer;padding:0 8px;white-space:nowrap}
.seg button.on{background:var(--surface);color:var(--text);box-shadow:var(--shadow)}

.confetti{position:fixed;inset:0;pointer-events:none;z-index:300;overflow:hidden}
.confetti i{position:absolute;top:-12px;width:9px;height:14px;border-radius:2px;animation:fall 2.4s linear forwards}
@keyframes fall{to{transform:translateY(105vh) rotate(720deg);opacity:.8}}
@media (prefers-reduced-motion:reduce){*{animation-duration:.01ms!important;transition-duration:.01ms!important}}

/* acessibilidade */
:focus{outline:none}
:focus-visible{outline:3px solid var(--primary);outline-offset:2px}
:root[data-theme="dark"] :focus-visible{outline-color:var(--lime)}
.input:focus-visible{outline:none}
.link{min-height:44px;display:inline-flex;align-items:center}
p .link,.tiny .link,.small .link,.hint .link{min-height:0;display:inline}
.sec .link,.row>.link{padding:10px 6px;margin:-10px -6px}
.skip{position:absolute;left:12px;top:-60px;z-index:999;background:var(--primary);color:#fff;padding:10px 16px;border-radius:12px;text-decoration:none;font-weight:600}
.skip:focus{top:12px}
@media (forced-colors:active){.btn,.chip,.opt,.tab-ic{border:1px solid CanvasText}}
.sheet:focus,.sheet:focus-visible,[tabindex="-1"]:focus-visible{outline:none}
