/* =========================================================
   FinControl · Controle Financeiro Pessoal
   Design system + layout
   ========================================================= */

:root{
  --font:"Plus Jakarta Sans",-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;

  --bg:#f4f6fb;
  --surface:#ffffff;
  --surface-2:#f8fafc;
  --surface-3:#eef2f7;
  --border:#e5e9f2;
  --border-strong:#d6dcea;

  --text:#0f172a;
  --text-2:#475569;
  --muted:#5f6b80;

  --brand:#4f46e5;
  --brand-600:#4338ca;
  --brand-soft:#eef0ff;
  --brand-grad:linear-gradient(135deg,#6366f1 0%,#4f46e5 55%,#4338ca 100%);
  --brand-ink:#4f46e5;

  /* "ink" = cor usada como TEXTO (garante contraste AA); soft = fundo */
  --green:#047857;
  --green-soft:#e7f7f0;
  --red:#be123c;
  --red-soft:#fdecef;
  --blue:#1d4ed8;
  --blue-soft:#e8f0fe;
  --amber:#b45309;
  --amber-soft:#fdf3e3;
  --purple:#6d28d9;
  --purple-soft:#f2ebff;
  --danger-btn:#e11d48;

  --sidebar:#0b1220;
  --sidebar-2:#111a2e;
  --sidebar-text:#cbd5e1;

  --radius:16px;
  --radius-sm:10px;
  --shadow:0 1px 2px rgba(16,24,40,.04),0 8px 24px -12px rgba(16,24,40,.16);
  --shadow-lg:0 24px 60px -24px rgba(16,24,40,.35);
  --ring:0 0 0 3px rgba(79,70,229,.18);
}

[data-theme="dark"]{
  --bg:#0a0f1c;
  --surface:#111827;
  --surface-2:#0f1626;
  --surface-3:#1b2438;
  --border:#1f2a3f;
  --border-strong:#2b3752;
  --text:#e8edf7;
  --text-2:#a9b6cc;
  --muted:#7f8ca3;
  --brand:#6366f1;
  --brand-soft:#1c2144;
  --brand-ink:#a5b4fc;
  --green:#34d399;
  --green-soft:#0d2a22;
  --red:#fb7185;
  --red-soft:#2c1220;
  --blue:#60a5fa;
  --blue-soft:#101f3d;
  --amber:#fbbf24;
  --amber-soft:#2c2111;
  --purple:#a78bfa;
  --purple-soft:#20173a;
  --danger-btn:#e11d48;
  --shadow:0 1px 2px rgba(0,0,0,.4),0 10px 30px -18px rgba(0,0,0,.8);
  --ring:0 0 0 3px rgba(99,102,241,.28);
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;font-family:var(--font);background:var(--bg);color:var(--text);
  -webkit-font-smoothing:antialiased;font-size:15px;line-height:1.5;
}
h1,h2,h3,h4{margin:0;letter-spacing:-.02em;font-weight:800}
p{margin:0}
a{color:var(--brand-ink);text-decoration:none;font-weight:600}
a:hover{text-decoration:underline}
code{background:var(--surface-3);padding:1px 6px;border-radius:6px;font-size:.86em}
.is-hidden{display:none !important}
.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.muted{color:var(--muted)}
.small{font-size:12.5px}
.link{font-size:13px}
svg{display:block}
button{font-family:inherit}

/* ---------------- BOTÕES ---------------- */
.btn{
  display:inline-flex;align-items:center;justify-content:center;gap:8px;
  border:1px solid transparent;border-radius:11px;padding:11px 18px;
  font-size:14px;font-weight:700;cursor:pointer;transition:.16s ease;
  background:var(--surface-3);color:var(--text);white-space:nowrap;
}
.btn:hover{transform:translateY(-1px)}
.btn:active{transform:translateY(0)}
.btn:focus-visible{outline:none;box-shadow:var(--ring)}
.btn--primary{background:var(--brand-grad);color:#fff;box-shadow:0 8px 20px -10px rgba(79,70,229,.9)}
.btn--primary:hover{filter:brightness(1.06)}
.btn--soft{background:var(--brand-soft);color:var(--brand-ink);border-color:transparent}
.btn--soft:hover{filter:brightness(.98)}
.btn--ghost{background:transparent;border-color:var(--border-strong);color:var(--text-2)}
.btn--ghost:hover{border-color:var(--brand);color:var(--brand-ink)}
.btn--danger{background:var(--danger-btn);color:#fff}
.btn--block{width:100%}
.btn--sm{padding:8px 14px;font-size:13px;border-radius:9px}
.btn[disabled]{opacity:.6;pointer-events:none}
.icon-btn{
  display:inline-flex;align-items:center;justify-content:center;width:38px;height:38px;
  border-radius:10px;border:1px solid var(--border);background:var(--surface);color:var(--text-2);
  cursor:pointer;transition:.16s;
}
.icon-btn svg{width:19px;height:19px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.icon-btn:hover{border-color:var(--brand);color:var(--brand-ink)}

/* ---------------- FORMULÁRIOS ---------------- */
.field{display:flex;flex-direction:column;gap:6px;min-width:0}
.field>span{font-size:12.5px;font-weight:700;color:var(--text-2);letter-spacing:.01em}
.field .opc{font-weight:500;color:var(--muted);text-transform:none}
input,select,textarea{
  font-family:inherit;font-size:14.5px;color:var(--text);background:var(--surface-2);
  border:1px solid var(--border-strong);border-radius:11px;padding:11px 13px;width:100%;
  transition:.15s;
}
input:focus,select:focus,textarea:focus{outline:none;border-color:var(--brand);box-shadow:var(--ring);background:var(--surface)}
input::placeholder,textarea::placeholder{color:var(--muted)}
input:disabled,input[readonly]{background:var(--surface-3);color:var(--muted);cursor:not-allowed}
textarea{resize:vertical;min-height:64px}
select{appearance:none;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237b879b' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat:no-repeat;background-position:right 11px center;background-size:16px;padding-right:34px;cursor:pointer}
.field__help{font-size:12px;color:var(--muted)}
.field__pw{position:relative}
.field__pw input{padding-right:74px}
.pw-toggle{position:absolute;right:8px;top:50%;transform:translateY(-50%);background:var(--surface-3);
  border:none;border-radius:8px;padding:5px 9px;font-size:11.5px;font-weight:700;color:var(--text-2);cursor:pointer}
.check{display:flex;gap:9px;align-items:flex-start;font-size:13.5px;color:var(--text-2);cursor:pointer}
.check input{width:16px;height:16px;margin-top:2px;accent-color:var(--brand);flex:0 0 auto}
.row2{display:grid;grid-template-columns:1fr 1fr;gap:14px}
.form-grid{display:flex;flex-direction:column;gap:14px}
.form-error{background:var(--red-soft);color:var(--red);font-size:13px;padding:10px 12px;border-radius:10px;font-weight:600}
.color{padding:4px;height:44px;cursor:pointer}
.note{font-size:13px}

/* segmented */
.seg{display:inline-flex;background:var(--surface-3);border-radius:11px;padding:4px;gap:4px}
.seg__b{border:none;background:transparent;color:var(--text-2);font-weight:700;font-size:13px;
  padding:8px 16px;border-radius:8px;cursor:pointer;transition:.15s}
.seg__b.is-active{background:var(--surface);color:var(--brand-ink);box-shadow:var(--shadow)}
.seg--tipo{width:100%}
.seg--tipo .seg__b{flex:1}
.seg--tipo .seg__b.is-active[data-tipo="Receita"]{color:var(--green)}
.seg--tipo .seg__b.is-active[data-tipo="Despesa"]{color:var(--red)}
.seg--tipo .seg__b.is-active[data-tipo="Transferência"]{color:var(--blue)}

/* ---------------- TOASTS ---------------- */
.toasts{position:fixed;top:18px;right:18px;z-index:200;display:flex;flex-direction:column;gap:10px;max-width:340px}
.toast{
  background:var(--surface);border:1px solid var(--border);border-left:4px solid var(--brand);
  border-radius:12px;padding:12px 14px;box-shadow:var(--shadow-lg);font-size:13.5px;font-weight:600;
  display:flex;gap:10px;align-items:flex-start;animation:slideIn .28s cubic-bezier(.2,.9,.3,1.4);
}
.toast small{display:block;font-weight:500;color:var(--muted);margin-top:2px}
.toast--ok{border-left-color:var(--green)}
.toast--err{border-left-color:var(--red)}
.toast--warn{border-left-color:var(--amber)}
@keyframes slideIn{from{opacity:0;transform:translateX(40px)}to{opacity:1;transform:none}}

/* =========================================================
   AUTENTICAÇÃO
   ========================================================= */
.auth{min-height:100vh;display:grid;grid-template-columns:1.05fr .95fr}
.auth__hero{
  position:relative;overflow:hidden;color:#eef2ff;padding:56px clamp(28px,5vw,72px);
  background:radial-gradient(1100px 600px at 15% 10%,#312e81 0%,transparent 60%),
             radial-gradient(900px 700px at 90% 90%,#0f766e33 0%,transparent 55%),
             linear-gradient(150deg,#0b1220 0%,#111a2e 55%,#151c33 100%);
  display:flex;align-items:center;
}
.auth__glow{position:absolute;width:520px;height:520px;border-radius:50%;right:-160px;top:-140px;
  background:radial-gradient(circle,#6366f1aa 0%,transparent 65%);filter:blur(10px);pointer-events:none}
.auth__hero-inner{position:relative;max-width:560px;margin:auto;z-index:1}
.auth__title{font-size:clamp(30px,3.6vw,46px);line-height:1.1;margin:26px 0 16px;color:#fff}
.auth__title em{font-style:normal;background:linear-gradient(100deg,#a5b4fc,#5eead4);-webkit-background-clip:text;background-clip:text;color:transparent}
.auth__sub{color:#b6c2da;font-size:16.5px;max-width:470px}
.auth__feats{list-style:none;padding:0;margin:30px 0 0;display:flex;flex-direction:column;gap:13px}
.auth__feats li{display:flex;align-items:center;gap:11px;color:#d5ddec;font-size:14.5px;font-weight:500}
.dot{width:9px;height:9px;border-radius:50%;flex:0 0 auto;box-shadow:0 0 0 4px rgba(255,255,255,.07)}
.dot--green{background:#34d399}.dot--blue{background:#60a5fa}.dot--purple{background:#a78bfa}.dot--amber{background:#fbbf24}
.auth__quote{margin-top:34px;padding:18px 20px;border-left:3px solid #6366f1;background:rgba(255,255,255,.05);
  border-radius:0 14px 14px 0;backdrop-filter:blur(6px)}
.auth__quote p{color:#dbe3f5;font-size:14.5px;font-style:italic}
.auth__quote span{display:block;margin-top:8px;font-size:12px;color:#8fa0bd;text-transform:uppercase;letter-spacing:.08em}

.auth__panel{display:flex;align-items:center;justify-content:center;padding:36px 24px;background:var(--bg)}
.auth__card{width:100%;max-width:430px;background:var(--surface);border:1px solid var(--border);
  border-radius:22px;padding:30px 30px 26px;box-shadow:var(--shadow-lg)}
.auth__tabs{display:grid;grid-template-columns:repeat(3,1fr);gap:4px;background:var(--surface-3);
  border-radius:12px;padding:4px;margin-bottom:26px}
.auth__tab{border:none;background:transparent;padding:9px 6px;border-radius:9px;font-size:13px;
  font-weight:700;color:var(--text-2);cursor:pointer;transition:.15s}
.auth__tab.is-active{background:var(--surface);color:var(--brand-ink);box-shadow:var(--shadow)}
.auth__form{display:flex;flex-direction:column;gap:15px;animation:fadeUp .3s ease}
.auth__form h2{font-size:22px}
.auth__form .muted{font-size:13.5px;margin-top:-8px}
.auth__hint{font-size:13px;color:var(--muted);text-align:center;margin-top:2px}
.auth__badge{margin-top:20px;text-align:center;font-size:11.5px;color:var(--muted);
  background:var(--surface-3);border-radius:20px;padding:7px 12px}
@keyframes fadeUp{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}
.brand{display:flex;align-items:center;gap:10px}
.brand__mark{width:36px;height:36px;border-radius:11px;background:var(--brand-grad);color:#fff;
  display:grid;place-items:center;box-shadow:0 8px 18px -8px rgba(79,70,229,.9)}
.brand__name{font-weight:800;letter-spacing:-.03em;font-size:17px}
.brand--lg .brand__mark{width:46px;height:46px;border-radius:14px}
.brand--lg .brand__name{font-size:23px;color:#fff}

/* =========================================================
   LAYOUT DO APP
   ========================================================= */
.app{display:grid;grid-template-columns:262px 1fr;min-height:100vh}
.sidebar{
  background:linear-gradient(180deg,var(--sidebar) 0%,var(--sidebar-2) 100%);
  color:var(--sidebar-text);display:flex;flex-direction:column;position:sticky;top:0;height:100vh;
  border-right:1px solid rgba(255,255,255,.06);z-index:60;
}
.sidebar__head{display:flex;align-items:center;justify-content:space-between;padding:20px 18px 14px}
.sidebar__head .brand__name{color:#fff}
.sidebar__close{display:none;background:rgba(255,255,255,.06);border-color:rgba(255,255,255,.1);color:#cbd5e1}
.sidebar__nav{flex:1;overflow-y:auto;padding:6px 12px 12px}
.sidebar__label{font-size:10.5px;text-transform:uppercase;letter-spacing:.11em;color:#93a3bd;
  font-weight:700;margin:18px 8px 7px}
.navitem{display:flex;align-items:center;gap:11px;padding:10px 12px;border-radius:11px;
  color:var(--sidebar-text);font-size:14px;font-weight:600;transition:.15s;margin-bottom:2px}
.navitem svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;opacity:.85}
.navitem:hover{background:rgba(255,255,255,.06);color:#fff;text-decoration:none}
.navitem.is-active{background:var(--brand-grad);color:#fff;box-shadow:0 10px 22px -14px #6366f1}
.sidebar__foot{padding:14px;border-top:1px solid rgba(255,255,255,.07);display:flex;flex-direction:column;gap:10px}
.userchip{display:flex;align-items:center;gap:10px;padding:8px;border-radius:12px;background:rgba(255,255,255,.05)}
.avatar{width:34px;height:34px;border-radius:10px;background:var(--brand-grad);color:#fff;
  display:grid;place-items:center;font-weight:800;font-size:14px;flex:0 0 auto}
.userchip__txt{min-width:0;display:flex;flex-direction:column;line-height:1.25}
.userchip__txt strong{color:#fff;font-size:13.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.userchip__txt small{color:#8494ad;font-size:11.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.sidebar__foot .btn--ghost{border-color:rgba(255,255,255,.16);color:#cbd5e1}
.sidebar__foot .btn--ghost:hover{border-color:#f87171;color:#fca5a5}
.scrim{display:none}

.shell{display:flex;flex-direction:column;min-width:0}
.topbar{
  position:sticky;top:0;z-index:50;display:flex;align-items:center;gap:16px;
  padding:14px clamp(16px,3vw,30px);background:color-mix(in srgb,var(--bg) 85%,transparent);
  backdrop-filter:blur(12px);border-bottom:1px solid var(--border);
}
.topbar__menu{display:none}
.topbar__title{flex:1;min-width:0}
.topbar__title h1{font-size:19px}
.topbar__title p{font-size:12.5px;color:var(--muted)}
.topbar__actions{display:flex;align-items:center;gap:10px}
.ico-moon{display:none}
[data-theme="dark"] .ico-sun{display:none}
[data-theme="dark"] .ico-moon{display:block}

.content{padding:clamp(16px,2.6vw,30px);display:flex;flex-direction:column;gap:22px;max-width:1500px;width:100%}
.view{display:flex;flex-direction:column;gap:22px;animation:fadeUp .28s ease}

/* ---------------- CARDS / GRID ---------------- */
.card{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);
  padding:20px;box-shadow:var(--shadow)}
.card__head{display:flex;align-items:flex-start;justify-content:space-between;gap:14px;margin-bottom:16px}
.card__head h2{font-size:15.5px}
.card__head .muted{font-size:12.5px;margin-top:2px}
.grid{display:grid;gap:22px}
.grid--2{grid-template-columns:1fr 1fr}
.legend{display:flex;gap:14px;flex-wrap:wrap}
.legend__i{display:flex;align-items:center;gap:6px;font-size:12px;color:var(--muted);font-weight:600}
.sw{width:10px;height:10px;border-radius:3px}
.sw--green{background:#059669}.sw--red{background:#e11d48}.sw--blue{background:#2563eb}

/* boas-vindas */
.welcome{display:flex;align-items:center;gap:18px;background:
  linear-gradient(120deg,var(--brand-soft),transparent 70%),var(--surface);
  border-color:color-mix(in srgb,var(--brand) 26%,var(--border))}
.welcome__ico{font-size:30px;background:var(--surface);border:1px solid var(--border);
  border-radius:14px;padding:12px;line-height:1;flex:0 0 auto}
.welcome__txt{flex:1;min-width:0}
.welcome__txt h2{font-size:16px;margin-bottom:4px}
.welcome__txt p{font-size:13.5px;color:var(--text-2)}
.welcome__acts{display:flex;gap:9px;flex-wrap:wrap;flex:0 0 auto}

/* KPIs */
.kpis{display:grid;grid-template-columns:repeat(auto-fit,minmax(210px,1fr));gap:18px}
.kpi{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);
  padding:18px;box-shadow:var(--shadow);position:relative;overflow:hidden}
.kpi::after{content:"";position:absolute;inset:0 auto 0 0;width:3px;background:var(--brand)}
.kpi--green::after{background:var(--green)}.kpi--red::after{background:var(--red)}
.kpi--blue::after{background:var(--blue)}.kpi--amber::after{background:var(--amber)}
.kpi__top{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:10px}
.kpi__label{font-size:12px;font-weight:700;color:var(--muted);text-transform:uppercase;letter-spacing:.06em}
.kpi__ico{width:32px;height:32px;border-radius:10px;display:grid;place-items:center;font-size:15px;
  background:var(--brand-soft)}
.kpi--green .kpi__ico{background:var(--green-soft)}
.kpi--red .kpi__ico{background:var(--red-soft)}
.kpi--blue .kpi__ico{background:var(--blue-soft)}
.kpi--amber .kpi__ico{background:var(--amber-soft)}
.kpi__value{font-size:clamp(21px,2.1vw,27px);font-weight:800;letter-spacing:-.03em;line-height:1.15}
.kpi__foot{margin-top:7px;font-size:12px;color:var(--muted);display:flex;align-items:center;gap:6px}
.tag{font-weight:800;font-size:11.5px;padding:2px 7px;border-radius:6px}
.tag--up{background:var(--green-soft);color:var(--green)}
.tag--down{background:var(--red-soft);color:var(--red)}

.charts{position:relative}
.chart{position:relative;height:290px}
.chart--donut{height:230px}

.catlist{display:flex;flex-direction:column;gap:9px;margin-top:14px}
.catlist__row{display:grid;grid-template-columns:1fr auto;gap:6px 12px;align-items:center;font-size:13px}
.catlist__name{display:flex;align-items:center;gap:8px;font-weight:600;min-width:0}
.catlist__name i{width:9px;height:9px;border-radius:50%;flex:0 0 auto}
.catlist__name span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.catlist__val{font-weight:700;font-variant-numeric:tabular-nums}
.catlist__bar{grid-column:1/-1;height:6px;background:var(--surface-3);border-radius:99px;overflow:hidden}
.catlist__bar b{display:block;height:100%;border-radius:99px}

/* linhas (últimos / pendências) */
.rows{display:flex;flex-direction:column;gap:2px}
.rowl{display:flex;align-items:center;gap:12px;padding:11px 8px;border-radius:11px;transition:.14s}
.rowl:hover{background:var(--surface-2)}
.rowl+.rowl{border-top:1px solid var(--border)}
.rowl__ico{width:36px;height:36px;border-radius:11px;display:grid;place-items:center;font-size:15px;flex:0 0 auto;
  background:var(--surface-3)}
.rowl__txt{flex:1;min-width:0}
.rowl__txt strong{display:block;font-size:13.7px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.rowl__txt small{color:var(--muted);font-size:12px}
.rowl__val{font-weight:800;font-variant-numeric:tabular-nums;font-size:14px;white-space:nowrap}
.pos{color:var(--green)}.neg{color:var(--red)}
.rowl__act{display:flex;gap:4px}
.mini{border:none;background:var(--surface-3);color:var(--muted);width:28px;height:28px;border-radius:8px;
  cursor:pointer;font-size:13px;transition:.14s}
.mini:hover{background:var(--brand-soft);color:var(--brand-ink)}
.mini--del:hover{background:var(--red-soft);color:var(--red)}

/* pills / chips */
.pill{background:var(--surface-3);color:var(--text-2);font-size:11.5px;font-weight:800;padding:4px 10px;border-radius:99px;white-space:nowrap}
.pill--warn{background:var(--amber-soft);color:var(--amber)}
.pill--green{background:var(--green-soft);color:var(--green)}
.pill--red{background:var(--red-soft);color:var(--red)}
.pill--blue{background:var(--blue-soft);color:var(--blue)}
.chips{display:flex;gap:9px;flex-wrap:wrap}
.chip{background:var(--surface-2);border:1px solid var(--border);border-radius:99px;padding:6px 13px;
  font-size:12.5px;font-weight:700;color:var(--text-2)}
.chip b{color:var(--text)}

/* ---------------- TOOLBAR / TABELA ---------------- */
.toolbar{display:flex;gap:12px;flex-wrap:wrap;align-items:center;justify-content:space-between;margin-bottom:14px}
.toolbar__search{position:relative;flex:1;min-width:230px}
.toolbar__search svg{position:absolute;left:12px;top:50%;transform:translateY(-50%);width:17px;height:17px;
  fill:none;stroke:var(--muted);stroke-width:2}
.toolbar__search input{padding-left:38px}
.toolbar__filters{display:flex;gap:9px;flex-wrap:wrap;align-items:center}
.toolbar__filters .select{width:auto;min-width:150px}
.select{background-color:var(--surface-2);width:auto}
.field .select{width:100%}
.select--sm{padding:8px 30px 8px 12px;font-size:13px;font-weight:600;border-radius:9px;min-width:132px}

.table-wrap{overflow-x:auto;border:1px solid var(--border);border-radius:13px}
.table{width:100%;border-collapse:collapse;font-size:13.8px;min-width:720px}
.table th{
  text-align:left;font-size:11.5px;text-transform:uppercase;letter-spacing:.06em;color:var(--muted);
  font-weight:800;padding:12px 14px;background:var(--surface-2);border-bottom:1px solid var(--border);
  position:sticky;top:0;z-index:1;white-space:nowrap;
}
.table td{padding:12px 14px;border-bottom:1px solid var(--border);vertical-align:middle}
.table tbody tr:last-child td{border-bottom:none}
.table tbody tr{transition:.12s}
.table tbody tr:hover{background:var(--surface-2)}
.table .num{text-align:right;font-variant-numeric:tabular-nums;font-weight:700;white-space:nowrap}
.table .th-acoes{text-align:right;width:96px}
.table .td-acoes{text-align:right;white-space:nowrap}
.table--sm{min-width:560px;font-size:13px}
.table--sm th,.table--sm td{padding:9px 12px}
.table--bar{min-width:560px}
.barcell{position:relative;height:9px;background:var(--surface-3);border-radius:99px;min-width:110px;overflow:hidden}
.barcell b{position:absolute;inset:0 auto 0 0;border-radius:99px;display:block}
.data-cell{white-space:nowrap;color:var(--text-2);font-weight:600}
.desc-cell strong{display:block;font-weight:700}
.desc-cell small{color:var(--muted);font-size:11.5px;display:block;max-width:330px;white-space:nowrap;
  overflow:hidden;text-overflow:ellipsis}
.badge{display:inline-flex;align-items:center;gap:6px;font-size:12px;font-weight:800;padding:4px 10px;border-radius:99px;white-space:nowrap}
.badge--Receita{background:var(--green-soft);color:var(--green)}
.badge--Despesa{background:var(--red-soft);color:var(--red)}
.badge--Transferência{background:var(--blue-soft);color:var(--blue)}
.badge::before{content:"";width:6px;height:6px;border-radius:50%;background:currentColor}
.st{font-size:12px;font-weight:700;padding:4px 9px;border-radius:7px;white-space:nowrap}
.st--Pago{background:var(--blue-soft);color:var(--blue)}
.st--Recebido{background:var(--green-soft);color:var(--green)}
.st--Pendente{background:var(--amber-soft);color:var(--amber)}
.st--Cancelado{background:var(--surface-3);color:var(--text-2);text-decoration:line-through}

.pager{display:flex;align-items:center;justify-content:space-between;gap:12px;padding-top:14px;flex-wrap:wrap}
.pager__info{font-size:12.5px;color:var(--muted);font-weight:600}
.pager__btns{display:flex;gap:6px;align-items:center}
.pg{min-width:32px;height:32px;border-radius:9px;border:1px solid var(--border);background:var(--surface);
  color:var(--text-2);font-size:13px;font-weight:700;cursor:pointer}
.pg.is-active{background:var(--brand-grad);color:#fff;border-color:transparent}
.pg[disabled]{opacity:.4;cursor:not-allowed}

.empty{text-align:center;padding:44px 20px}
.empty__ico{font-size:36px;margin-bottom:8px}
.empty h2{font-size:16px;margin-bottom:5px}
.empty p{color:var(--muted);font-size:13.5px;margin-bottom:16px}

/* ---------------- CATEGORIAS / IMPORT ---------------- */
.tags{display:flex;flex-wrap:wrap;gap:9px}
.tag-cat{display:inline-flex;align-items:center;gap:8px;background:var(--surface-2);border:1px solid var(--border);
  border-radius:99px;padding:7px 8px 7px 13px;font-size:13.5px;font-weight:700}
.tag-cat i{width:9px;height:9px;border-radius:50%}
.tag-cat em{font-style:normal;font-size:11px;color:var(--muted);font-weight:700}
.tag-cat button{border:none;background:var(--red-soft);color:var(--red);width:22px;height:22px;border-radius:50%;
  cursor:pointer;font-size:12px;line-height:1}
.drop{border:2px dashed var(--border-strong);border-radius:15px;padding:26px 20px;text-align:center;
  background:var(--surface-2);transition:.18s}
.drop.is-over{border-color:var(--brand);background:var(--brand-soft)}
.drop__ico{font-size:30px;margin-bottom:6px}
.drop p{font-size:14px;margin-bottom:5px}
.drop__btns{display:flex;gap:10px;justify-content:center;margin-top:14px;flex-wrap:wrap}
.preview{margin-top:16px;display:flex;flex-direction:column;gap:12px}
.preview__head{display:flex;align-items:center;justify-content:space-between;gap:10px;font-size:14px}
.preview__actions{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}
.stack{display:flex;flex-direction:column;gap:12px}
.opt{display:flex;align-items:center;justify-content:space-between;gap:14px;background:var(--surface-2);
  border:1px solid var(--border);border-radius:13px;padding:14px 16px}
.opt strong{font-size:14px}
.opt--sep{margin-top:12px}
.opt--danger{border-color:color-mix(in srgb,var(--red) 30%,var(--border))}
.warnbox,.infobox{margin-top:16px;background:var(--amber-soft);border:1px solid color-mix(in srgb,var(--amber) 25%,transparent);
  border-radius:13px;padding:14px 16px;font-size:13px;color:var(--text-2)}
.warnbox strong{color:var(--amber);display:block;margin-bottom:4px;font-size:13.5px}
.infobox{background:var(--surface-2);border-color:var(--border);display:flex;flex-direction:column;gap:12px;padding:8px}
.infobox .opt{border:none;background:transparent;padding:8px}

/* ---------------- MODAL ---------------- */
.modal{position:fixed;inset:0;z-index:120;display:none;align-items:center;justify-content:center;padding:20px;
  background:rgba(8,12,22,.55);backdrop-filter:blur(4px)}
.modal.is-open{display:flex;animation:fadeUp .2s ease}
.modal__dialog{width:100%;max-width:560px;background:var(--surface);border:1px solid var(--border);
  border-radius:20px;box-shadow:var(--shadow-lg);overflow:hidden;max-height:92vh;overflow-y:auto}
.modal__dialog--sm{max-width:420px}
.modal__head{display:flex;align-items:center;justify-content:space-between;padding:18px 22px;
  border-bottom:1px solid var(--border)}
.modal__head h2{font-size:16.5px}
.modal__body{padding:20px 22px 22px}
.modal__foot{display:flex;justify-content:flex-end;gap:10px;margin-top:6px}

/* ---------------- RESPONSIVO ---------------- */
@media (max-width:1180px){
  .kpis{grid-template-columns:repeat(2,1fr)}
}
@media (max-width:1024px){
  .grid--2{grid-template-columns:1fr}
  .app{grid-template-columns:1fr}
  .sidebar{position:fixed;left:0;top:0;width:270px;transform:translateX(-100%);transition:.25s cubic-bezier(.3,.9,.4,1);
    box-shadow:0 0 60px rgba(0,0,0,.5)}
  .sidebar.is-open{transform:none}
  .sidebar__close{display:inline-flex}
  .scrim{display:block;position:fixed;inset:0;background:rgba(8,12,22,.5);z-index:55;opacity:0;pointer-events:none;transition:.2s}
  .scrim.is-open{opacity:1;pointer-events:auto}
  .topbar__menu{display:inline-flex}
}
@media (max-width:900px){
  .auth{grid-template-columns:1fr}
  .auth__hero{padding:40px 26px}
  .auth__feats,.auth__quote{display:none}
  .auth__title{margin:20px 0 12px;font-size:30px}
}
@media (max-width:720px){
  .kpis{grid-template-columns:1fr 1fr;gap:12px}
  .kpi{padding:14px}
  .kpi__value{font-size:20px}
  .row2{grid-template-columns:1fr}
  .topbar{flex-wrap:wrap;gap:10px;padding:12px 16px}
  .topbar__title{order:2;flex:1 1 100%}
  .topbar__actions{order:3;width:100%}
  .topbar__actions .select--sm{flex:1}
  .btn--novo-label{display:none}
  .content{padding:16px 14px 34px}
  .card{padding:16px}
  .toasts{left:14px;right:14px;max-width:none}
}
@media (max-width:420px){
  .kpis{grid-template-columns:1fr}
  .auth__card{padding:22px 18px}
}

/* =========================================================
   v1.1 · card de juros, novos filtros, métricas e PIX
   ========================================================= */
.seg--tipo .seg__b.is-active[data-tipo="PIX"]{color:var(--blue)}
.badge--PIX{background:var(--blue-soft);color:var(--blue)}

/* card · melhores juros do dia (v1.1: fica depois de Pendências) */
.card--juros .pill--blue{font-size:15px;font-weight:800;padding:7px 15px;white-space:nowrap}
.juros-lista{list-style:none;margin:11px 0 0;padding:0;display:flex;flex-direction:column;gap:7px}
.juros-lista--row{display:grid;grid-template-columns:repeat(auto-fit,minmax(230px,1fr));gap:9px;margin:0}
.juros-lista li{display:flex;align-items:center;justify-content:space-between;gap:10px;
  font-size:13px;padding:7px 10px;background:var(--surface-2);border:1px solid var(--border);border-radius:10px}
.juros-lista li em{font-style:normal;color:var(--muted);font-size:11px}
.juros-lista b{font-size:14px;font-weight:800;color:var(--green);white-space:nowrap}
.juros__nome{display:flex;flex-direction:column;gap:1px;line-height:1.25}
.juros__nome small{font-size:11px;color:var(--muted)}
.kpi--juros .kpi__foot{display:block;margin-top:9px;line-height:1.45}

/* filtros extras de lançamentos (período + ordenação) */
.toolbar__filters--extra{flex-basis:100%;width:100%;padding-top:2px;border-top:1px dashed var(--border)}
.field--inline{flex-direction:row;align-items:center;gap:8px;font-size:12.5px;color:var(--muted);font-weight:600}
.input-sm{font-family:inherit;font-size:13.5px;color:var(--text);background:var(--surface-2);
  border:1px solid var(--border);border-radius:10px;padding:8px 10px;min-width:150px;transition:border-color .15s}
.input-sm:focus{outline:none;border-color:var(--blue)}

/* card · ritmo do mês */
.metrica{display:flex;align-items:center;justify-content:space-between;gap:12px;
  padding:10px 0;border-bottom:1px dashed var(--border)}
.metrica:last-child{border-bottom:none}
.metrica span{display:flex;flex-direction:column;gap:1px;font-size:13.5px;color:var(--muted)}
.metrica span small{font-size:11.5px;opacity:.85}
.metrica b{font-size:15px;font-weight:800;text-align:right}
.metrica .tag{font-size:12px}

/* =========================================================
   v1.2 — contas/carteiras, metas, orçamento, simuladores,
   sugestão de categoria, glossário
   ========================================================= */

/* KPI consolidado */
.kpi--purple::after{background:var(--purple)}
.kpi--purple .kpi__ico{background:var(--purple-soft)}

/* formulário do lançamento: check "repetir todo mês" */
.field--static{display:flex;flex-direction:column;gap:6px}
.field--static>span{font-size:12.5px;font-weight:700;color:var(--muted)}

/* sugestão automática de categoria */
.sugestao{margin-top:-4px;font-size:13px;color:var(--text-2);background:var(--purple-soft);
  border:1px dashed var(--purple);border-radius:10px;padding:8px 12px;animation:fadeUp .18s ease}
.sug-btn{border:1px solid var(--purple);background:var(--surface);color:var(--purple);
  border-radius:8px;padding:3px 10px;font:inherit;font-size:12.5px;font-weight:700;cursor:pointer;margin-left:6px;
  transition:transform .12s,box-shadow .12s}
.sug-btn:hover{transform:translateY(-1px);box-shadow:var(--shadow)}

/* contas e carteiras */
.contas-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:16px}
.conta{background:var(--surface-2);border:1px solid var(--border);border-radius:14px;padding:16px;
  display:flex;flex-direction:column;gap:8px;position:relative}
.conta__top{display:flex;align-items:center;justify-content:space-between;gap:8px}
.conta__nome{display:inline-flex;align-items:center;gap:8px;font-weight:800;font-size:14.5px}
.conta__nome i{width:10px;height:10px;border-radius:50%;flex:0 0 auto}
.conta__saldo{font-size:21px;font-weight:800;letter-spacing:-.02em}
.conta__saldo.neg{color:var(--red)}.conta__saldo.pos{color:var(--green)}
.conta__acoes{display:flex;gap:6px;margin-top:2px}
.conta--total{background:var(--brand-soft);border-color:var(--brand);grid-column:1/-1}

/* metas / caixinhas */
.metas-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(280px,1fr));gap:16px}
.meta{background:var(--surface-2);border:1px solid var(--border);border-radius:14px;padding:16px;
  display:flex;flex-direction:column;gap:10px}
.meta__top{display:flex;align-items:center;justify-content:space-between;gap:8px}
.meta__top strong{display:inline-flex;align-items:center;gap:8px;font-size:14.5px}
.meta__top strong i{width:10px;height:10px;border-radius:50%;flex:0 0 auto}
.meta__pct{font-weight:800;font-size:15px;color:var(--text-2)}
.meta__pct.pos{color:var(--green)}
.meta__bar{height:10px;border-radius:99px;background:var(--surface-3);overflow:hidden}
.meta__fill{height:100%;border-radius:99px;background:var(--brand);transition:width .35s ease}

/* orçamento (painel) */
.orc{padding:10px 0;border-bottom:1px dashed var(--border)}
.orc:last-child{border-bottom:none}
.orc__top{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap;margin-bottom:7px;font-size:13.5px}
.orc__top span:first-child{display:inline-flex;align-items:center;gap:8px;font-weight:700}
.orc__top i{width:9px;height:9px;border-radius:50%}
.orc__val{color:var(--muted);font-size:12.5px}
.orc__val.strong{color:var(--text-2)}
.orc__val.orc--warn{color:var(--amber)}
.orc__val.orc--over{color:var(--red)}
.orc__bar{height:10px;border-radius:99px;background:var(--surface-3);overflow:hidden}
.orc__fill{height:100%;border-radius:99px;transition:width .35s ease}
.orc__fill.orc--ok{background:var(--green)}
.orc__fill.orc--warn{background:var(--amber)}
.orc__fill.orc--over{background:var(--red)}

/* orçamento (configuração em Categorias) */
.orc-cfg{display:grid;grid-template-columns:repeat(auto-fit,minmax(230px,1fr));gap:10px}
.orc-cfg__row{display:flex;align-items:center;justify-content:space-between;gap:10px;
  background:var(--surface-2);border:1px solid var(--border);border-radius:10px;padding:8px 12px;font-size:13.5px}
.orc-cfg__row span{display:inline-flex;align-items:center;gap:8px;font-weight:700}
.orc-cfg__row i{width:9px;height:9px;border-radius:50%}
.orc-cfg__input{display:inline-flex;align-items:center;gap:5px;color:var(--muted);font-size:12.5px}
.orc-cfg__input .input-sm{min-width:110px;text-align:right}

/* simuladores */
.resultado{margin-top:14px;padding-top:14px;border-top:1px dashed var(--border);animation:fadeUp .22s ease}
.sim-res{display:flex;flex-direction:column;gap:3px;align-items:flex-start;
  background:var(--surface-2);border:1px solid var(--border);border-radius:12px;padding:14px}
.sim-res__big{font-size:clamp(20px,2vw,26px);font-weight:800;letter-spacing:-.02em}
.sim-res__big.pos{color:var(--green)}.sim-res__big.neg{color:var(--red)}
.sim-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:12px;margin:12px 0}
.sim-grid>div{display:flex;flex-direction:column;gap:2px}
.sim-grid strong{font-size:15px}

/* glossário */
.glossario{display:flex;flex-direction:column;gap:8px}
.glossario details{background:var(--surface-2);border:1px solid var(--border);border-radius:12px;padding:11px 14px}
.glossario summary{font-weight:800;font-size:14px;cursor:pointer;list-style:none;display:flex;align-items:center;justify-content:space-between;gap:8px}
.glossario summary::after{content:"+";font-size:17px;color:var(--muted);transition:transform .18s}
.glossario details[open] summary::after{transform:rotate(45deg)}
.glossario p{margin-top:8px;font-size:13.5px;color:var(--text-2);line-height:1.6}
