/* ==========================================================
   FINETUS — Design System
   ========================================================== */

:root {
  /* Verde-limão da marca — tema claro usa tom mais escuro p/ legibilidade */
  --green: #4E9A06;
  --green-dark: #3C7A04;
  --green-light: #EAF7D6;
  --gray-light: #F6F7F9;
  --gray-dark: #1F2937;
  --white: #FFFFFF;

  /* Semantic (light) */
  --bg: #F6F7F9;
  --bg-elev: #FFFFFF;
  --surface: rgba(255, 255, 255, 0.72);
  --border: #E6E9EE;
  --text: #111827;
  --text-soft: #6B7280;
  --text-faint: #9CA3AF;
  --accent: #4E9A06;
  --accent-soft: #E9F6D5;
  --pos: #4E9A06;
  --neg: #DC2626;
  --warn: #D97706;
  --shadow: 0 1px 2px rgba(16,24,40,.04), 0 8px 24px rgba(16,24,40,.06);
  --shadow-lg: 0 12px 40px rgba(16,24,40,.12);
  --radius: 16px;
  --radius-sm: 10px;
  --sidebar-w: 248px;
}

html.dark {
  --bg: #0B1220;
  --bg-elev: #121A2B;
  --surface: rgba(23, 33, 54, 0.6);
  --border: #24314B;
  --text: #E8EDF5;
  --text-soft: #9AA6BC;
  --text-faint: #6B7890;
  --green: #84CC16;
  --green-dark: #6FAE12;
  --green-light: #1a2e05;
  --accent: #A3E635;
  --accent-soft: rgba(163, 230, 53, 0.14);
  --pos: #A3E635;
  --neg: #F87171;
  --warn: #FBBF24;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 12px 30px rgba(0,0,0,.35);
  --shadow-lg: 0 18px 50px rgba(0,0,0,.5);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Poppins", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  transition: background .3s ease, color .3s ease;
}

/* Subtle ambient gradient */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(700px 400px at 12% -5%, rgba(14,122,75,.10), transparent 60%),
    radial-gradient(600px 500px at 100% 0%, rgba(14,122,75,.06), transparent 55%);
}
html.dark body::before {
  background:
    radial-gradient(700px 400px at 12% -5%, rgba(34,197,139,.12), transparent 60%),
    radial-gradient(700px 500px at 100% 0%, rgba(34,197,139,.06), transparent 55%);
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 8px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: var(--text-faint); background-clip: padding-box; }

/* ---------- Layout ---------- */
.app { display: flex; min-height: 100vh; position: relative; z-index: 1; }

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--bg-elev);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 40;
  transition: transform .28s cubic-bezier(.4,0,.2,1);
}
.sidebar-brand {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 18px 16px 14px;
}
/* Logo sem caixa. Escuro: transparente. Claro: inverte branco->preto. */
.brand-plate {
  width: 100%;
  display: grid; place-items: center;
  padding: 6px 0 2px;
}
.brand-plate img {
  width: 100%; max-width: 176px; height: auto; display: block;
}
/* troca a arte da logo conforme o tema */
html.dark .logo-light { display: none; }
html:not(.dark) .logo-dark { display: none; }
/* Marca N.ONE (SVG vetorial): "N." verde neon fixo; "ONE" inverte com o tema */
.brand-logo { width: 100%; max-width: 178px; height: auto; display: block; color: #141414; overflow: visible; }
html.dark .brand-logo { color: #ffffff; }
.brand-n { filter: drop-shadow(0 0 5px rgba(142,224,75,.9)) drop-shadow(0 0 14px rgba(142,224,75,.5)); }
.brand-halo { filter: blur(13px); opacity: .3; }
.brand-rings { stroke-width: 1.7px; filter: drop-shadow(0 0 3px rgba(143,224,75,.6)); }
.brand-sub { text-align: center; font-size: 11px; font-weight: 700; letter-spacing: .26em; margin: -2px 0 8px; color: #9aa0a8; text-transform: uppercase; }
.brand-sub .fin { color: #141414; }
.brand-sub b { color: #6CC229; font-weight: 700; }
html.dark .brand-sub .fin { color: #e9eaec; }
html.dark .brand-sub b { color: #8FE04B; }
.brand-tag { text-align: center; font-style: italic; font-weight: 500; font-size: 12.5px; color: var(--accent); margin: -18px 0 8px; letter-spacing: .01em; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(135deg, var(--green), var(--green-dark));
  display: grid; place-items: center; color: #fff;
  box-shadow: 0 6px 16px rgba(14,122,75,.35);
  font-weight: 800;
}
.brand-name { font-size: 18px; font-weight: 800; letter-spacing: -.02em; }
.brand-name span { color: var(--accent); }
.login-logo { width: 100%; max-width: 200px; margin: 0 auto; display: block; }
.login-plate { text-align: center; margin-bottom: 22px; }

.nav { padding: 6px 12px; overflow-y: auto; flex: 1; }
.nav-section { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; color: var(--text-faint); padding: 14px 12px 6px; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; border-radius: 10px;
  color: var(--text-soft); font-size: 13px; font-weight: 500;
  cursor: pointer; user-select: none;
  transition: background .15s, color .15s;
}
.nav-item:hover { background: var(--gray-light); color: var(--text); }
html.dark .nav-item:hover { background: rgba(255,255,255,.04); }
.nav-item.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.nav-item.active i { color: var(--accent); }
.nav-item i { width: 17px; height: 17px; }

.sidebar-foot { padding: 14px; border-top: 1px solid var(--border); }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 10px; }
.user-avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-weight: 700; font-size: 13px; }

/* ---------- Main ---------- */
.main { flex: 1; margin-left: var(--sidebar-w); min-width: 0; }

.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 14px;
  padding: 14px 26px;
  background: var(--surface);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.topbar h1 { font-size: 19px; font-weight: 700; margin: 0; letter-spacing: -.02em; }
.topbar .sub { font-size: 12.5px; color: var(--text-soft); margin-top: 1px; }
.topbar-spacer { flex: 1; }

.icon-btn {
  width: 38px; height: 38px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--bg-elev);
  color: var(--text-soft); display: grid; place-items: center; cursor: pointer;
  transition: all .15s;
}
.icon-btn:hover { color: var(--accent); border-color: var(--accent); }
.icon-btn i { width: 18px; height: 18px; }

/* switch liga/desliga */
.switch { width: 38px; height: 21px; border-radius: 999px; background: var(--border); position: relative; flex-shrink: 0; transition: background .18s; display: inline-block; }
.switch.on { background: var(--accent); }
.switch .switch-dot { position: absolute; top: 2px; left: 2px; width: 17px; height: 17px; border-radius: 50%; background: #fff; transition: left .18s; box-shadow: 0 1px 2px rgba(0,0,0,.25); }
.switch.on .switch-dot { left: 19px; }

.hamburger { display: none; }

.content { padding: 24px 26px 60px; max-width: 100%; }

/* ---------- Cards ---------- */
.card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card-pad { padding: 20px; }
.card-glass {
  background: var(--surface);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.grid { display: grid; gap: 16px; }
.g-2 { grid-template-columns: repeat(2, 1fr); }
.g-3 { grid-template-columns: repeat(3, 1fr); }
.g-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1180px){ .g-4{grid-template-columns:repeat(2,1fr);} .g-3{grid-template-columns:repeat(2,1fr);} }
@media (max-width: 720px){ .g-4,.g-3,.g-2{grid-template-columns:1fr;} }

/* KPI */
.kpi { padding: 18px; display: flex; flex-direction: column; gap: 10px; position: relative; overflow: hidden; }
.kpi .kpi-top { display: flex; align-items: center; justify-content: space-between; }
.kpi-label { font-size: 12.5px; color: var(--text-soft); font-weight: 500; }
.kpi-icon { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.kpi-icon i { width: 19px; height: 19px; }
.kpi-value { font-size: 26px; font-weight: 800; letter-spacing: -.02em; line-height: 1; }
.kpi-sub { font-size: 12px; color: var(--text-soft); display: flex; align-items: center; gap: 5px; }
.delta { display: inline-flex; align-items: center; gap: 3px; font-weight: 600; font-size: 12px; padding: 2px 7px; border-radius: 20px; }
.delta.up { color: var(--pos); background: color-mix(in srgb, var(--pos) 12%, transparent); }
.delta.down { color: var(--neg); background: color-mix(in srgb, var(--neg) 12%, transparent); }
.delta i { width: 13px; height: 13px; }

.section-title { font-size: 15px; font-weight: 700; letter-spacing: -.01em; }
.muted { color: var(--text-soft); }
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; gap: 12px; flex-wrap: wrap; }

/* ---------- Buttons / inputs ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 15px; border-radius: 10px; font-size: 13.5px; font-weight: 600;
  border: 1px solid var(--border); background: var(--bg-elev); color: var(--text);
  cursor: pointer; transition: all .15s; white-space: nowrap;
}
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn i { width: 16px; height: 16px; }
.btn-primary { background: var(--green); border-color: var(--green); color: #17300a; box-shadow: 0 6px 16px rgba(78,154,6,.28); }
.btn-primary:hover { background: var(--green-dark); border-color: var(--green-dark); color: #17300a; }
html.dark .btn-primary { color: #14210a; box-shadow: 0 6px 16px rgba(132,204,22,.22); }
.btn-sm { padding: 6px 11px; font-size: 12.5px; }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--gray-light); }
html.dark .btn-ghost:hover { background: rgba(255,255,255,.05); }

.input, .select {
  padding: 9px 12px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--bg-elev); color: var(--text); font-size: 13.5px; outline: none;
  transition: border .15s, box-shadow .15s; font-family: inherit;
}
.input:focus, .select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.search { position: relative; display: inline-flex; align-items: center; }
.search i { position: absolute; left: 11px; width: 16px; height: 16px; color: var(--text-faint); }
.search .input { padding-left: 34px; min-width: 230px; }

/* number: no spinners (Johnny) */
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input[type=number] { -moz-appearance: textfield; }

/* ---------- Table ---------- */
.table-wrap { overflow-x: auto; border-radius: var(--radius); }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
table.tbl thead th {
  text-align: left; padding: 12px 14px; font-size: 11.5px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .04em; color: var(--text-faint);
  border-bottom: 1px solid var(--border); white-space: nowrap; cursor: pointer; user-select: none;
  position: sticky; top: 0; background: var(--bg-elev);
}
table.tbl thead th.no-sort { cursor: default; }
table.tbl thead th .sort-i { opacity: .35; width: 12px; height: 12px; vertical-align: middle; margin-left: 3px; }
table.tbl thead th.sorted .sort-i { opacity: 1; color: var(--accent); }
table.tbl tbody td { padding: 12px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; }
table.tbl tbody tr { transition: background .12s; }
table.tbl tbody tr:hover { background: var(--gray-light); }
html.dark table.tbl tbody tr:hover { background: rgba(255,255,255,.03); }
.num { text-align: right; font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }
.tbl-foot { display: flex; align-items: center; justify-content: space-between; padding: 14px 4px 2px; flex-wrap: wrap; gap: 10px; }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 20px; font-size: 11.5px; font-weight: 600; }
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-green { color: var(--pos); background: color-mix(in srgb, var(--pos) 12%, transparent); }
.badge-red { color: var(--neg); background: color-mix(in srgb, var(--neg) 12%, transparent); }
.badge-amber { color: var(--warn); background: color-mix(in srgb, var(--warn) 14%, transparent); }
.badge-gray { color: var(--text-soft); background: color-mix(in srgb, var(--text-soft) 12%, transparent); }
.badge-blue { color: #2563EB; background: rgba(37,99,235,.12); }
html.dark .badge-blue { color: #60A5FA; }

/* multi-select */
.ms-wrap { position: relative; display: inline-block; }
.ms-btn { display: flex; align-items: center; gap: 8px; justify-content: space-between; min-width: 170px; max-width: 240px; cursor: pointer; }
.ms-panel { position: absolute; top: calc(100% + 6px); right: 0; z-index: 50; min-width: 220px; max-height: 320px; overflow: auto; background: var(--bg-elev); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; display: none; }
.ms-panel.open { display: block; }
.ms-item { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 8px; font-size: 13px; cursor: pointer; }
.ms-item:hover { background: var(--gray-light); }
html.dark .ms-item:hover { background: rgba(255,255,255,.04); }
.ms-item.on { color: var(--accent); font-weight: 600; }
.ms-check { width: 18px; height: 18px; border-radius: 5px; border: 1.5px solid var(--border); display: grid; place-items: center; flex-shrink: 0; }
.ms-item.on .ms-check { background: var(--accent); border-color: var(--accent); color: #fff; }

.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 20px; font-size: 12px; font-weight: 500; background: var(--gray-light); color: var(--text-soft); border: 1px solid var(--border); cursor: pointer; }
html.dark .chip { background: rgba(255,255,255,.04); }
.chip.active { background: var(--accent-soft); color: var(--accent); border-color: transparent; font-weight: 600; }

.pill-nav { display: inline-flex; padding: 4px; gap: 4px; background: var(--gray-light); border-radius: 12px; }
html.dark .pill-nav { background: rgba(255,255,255,.04); }
.pill-nav button { border: none; background: transparent; color: var(--text-soft); font-weight: 600; font-size: 13px; padding: 7px 14px; border-radius: 9px; cursor: pointer; transition: all .15s; }
.pill-nav button.active { background: var(--bg-elev); color: var(--accent); box-shadow: var(--shadow); }

/* ---------- Demonstrativo estruturado (DRE / DFC) ---------- */
.demo { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--bg-elev); }
.demo-row { display: grid; grid-template-columns: 1fr 150px 90px; align-items: center; gap: 10px; padding: 11px 18px; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.demo-row:last-child { border-bottom: 0; }
.demo-row .dv { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.demo-row .dp { text-align: right; font-size: 12px; color: var(--text-soft); }
.demo-row.head { color: var(--text-faint); font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.demo-row.linha .lbl { color: var(--text-soft); padding-left: 6px; }
.demo-row.neg .dv { color: var(--neg); }
/* subtotais coloridos */
.demo-row.sub { font-weight: 800; }
.demo-row.sub .lbl { letter-spacing: -.01em; }
.demo-row.sub-preto { background: #111827; color: #fff; }
.demo-row.sub-preto .dv, .demo-row.sub-preto .dp { color: #fff; }
.demo-row.sub-cinza { background: var(--gray-light); }
html.dark .demo-row.sub-cinza { background: rgba(255,255,255,.05); }
.demo-row.sub-verde { background: #16A34A; color: #fff; }
.demo-row.sub-verde .dv, .demo-row.sub-verde .dp { color: #fff; }
.demo-row.sub-azul  { background: #2563EB; color: #fff; }
.demo-row.sub-azul .dv, .demo-row.sub-azul .dp { color: #fff; }
.demo-row.saldo { background: var(--accent-soft); font-weight: 600; }

/* editor de estrutura */
.estr-item { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px; margin-bottom: 6px; background: var(--bg-elev); }
.estr-item.is-sub { background: var(--accent-soft); font-weight: 700; }
.estr-item .grip { color: var(--text-faint); }
.estr-item .nm { flex: 1; min-width: 0; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.estr-item.dragging { opacity: .35; }
.estr-item.dragover { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.estr-item .grip:active { cursor: grabbing; }

/* DRE table */
.dre-row { display: grid; grid-template-columns: 1.6fr repeat(var(--dre-cols,3), 1fr); align-items: center; padding: 11px 16px; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.dre-row.head { color: var(--text-faint); font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.dre-row.total { font-weight: 800; background: var(--accent-soft); border-radius: 10px; margin: 4px 0; }
.dre-row.sub { color: var(--text-soft); }
.dre-row.saldo { background: color-mix(in srgb, var(--accent-soft) 55%, transparent); font-weight: 700; }
/* coluna Previsto (em aberto) no Fluxo de Caixa — tom leve p/ separar do Realizado */
.dre-row .num.prev { color: var(--text-faint); font-weight: 500; opacity: .8; }
.dre-row.cat { padding-top: 5px; padding-bottom: 5px; font-size: 12.5px; }
.dre-row.cat .lbl { padding-left: 30px; color: var(--text-soft); }
.dre-row .lbl { display: flex; align-items: center; gap: 8px; }
/* seta (chevron) verde p/ expandir categorias — fica ANTES do nome, na mesma linha */
.dre-exp { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; flex-shrink: 0; border: 0; background: transparent; color: var(--accent); cursor: pointer; padding: 0; vertical-align: middle; }
.dre-exp:hover { opacity: .7; }
.dre-exp i, .dre-exp svg { width: 15px; height: 15px; }
.dre-exp-sp { width: 16px; flex-shrink: 0; display: inline-block; vertical-align: middle; }

/* DRE anual — meses lado a lado (tema do app) */
.dre-year { width: 100%; border-collapse: collapse; font-size: 12px; white-space: nowrap; }
.dre-year th, .dre-year td { padding: 8px 12px; text-align: right; border-bottom: 1px solid var(--border); }
.dre-year th.lbl, .dre-year td.lbl { text-align: left; position: sticky; left: 0; z-index: 1; background: var(--card); }
.dre-year thead th { background: var(--bg-elev); color: var(--text-faint); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; font-weight: 600; position: sticky; top: 0; }
.dre-year thead th.lbl { z-index: 2; background: var(--bg-elev); }
.dre-year td.tot { font-weight: 700; }
.dre-year th.prev, .dre-year td.prev { opacity: .6; font-style: italic; }
.dre-year tr.sub td { font-weight: 800; background: var(--accent-soft); }
.dre-year tr.sub td.lbl { background: var(--accent-soft); color: var(--accent); }
.dre-year tr.saldo td { font-weight: 700; background: color-mix(in srgb, var(--accent-soft) 55%, transparent); }
.dre-year tr.saldo td.lbl { background: color-mix(in srgb, var(--accent-soft) 55%, var(--card)); }
.dre-year tr.grand td { font-weight: 800; background: var(--accent-soft); color: var(--accent); border-top: 2px solid var(--accent); border-bottom: 2px solid var(--accent); }
.dre-year tr.grand td.lbl { background: var(--accent-soft); color: var(--accent); }
.dre-year tr.cat td { font-size: 11.5px; color: var(--text-soft); }
.dre-year tr.cat td.lbl { padding-left: 34px; }
.dre-year .lbl .dre-exp, .dre-year .lbl .dre-exp-sp { margin-right: 7px; vertical-align: middle; }
.bar-mini { height: 6px; border-radius: 4px; background: var(--border); overflow: hidden; }
.bar-mini > span { display: block; height: 100%; background: var(--accent); border-radius: 4px; }

/* progress list */
.prog-item { display: grid; grid-template-columns: 130px 1fr auto; gap: 12px; align-items: center; padding: 9px 0; }
.prog-track { height: 8px; border-radius: 6px; background: var(--gray-light); overflow: hidden; }
html.dark .prog-track { background: rgba(255,255,255,.06); }
.prog-fill { height: 100%; border-radius: 6px; }

/* ---------- Modal ---------- */
.modal-back { position: fixed; inset: 0; background: rgba(8,12,20,.5); backdrop-filter: blur(3px); z-index: 60; display: grid; place-items: center; padding: 20px; opacity: 0; pointer-events: none; transition: opacity .2s; }
.modal-back.open { opacity: 1; pointer-events: auto; }
.modal { width: 100%; max-width: 520px; background: var(--bg-elev); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow-lg); transform: translateY(8px) scale(.98); transition: transform .2s; max-height: 90vh; overflow: auto; }
.modal-back.open .modal { transform: none; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--border); }
.modal-body { padding: 20px; display: grid; gap: 14px; }
.modal-foot { padding: 16px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }
.field { display: grid; gap: 6px; }
.file-drop { border: 1px dashed var(--border); border-radius: 10px; padding: 11px 13px; cursor: pointer; transition: border .15s, background .15s; }
.file-drop:hover { border-color: var(--accent); background: var(--accent-soft); }
.file-state { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; }
.file-state i { width: 16px; height: 16px; color: var(--accent); }
.rateio-row { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.form-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 540px){ .form-2col { grid-template-columns: 1fr; } }

.import-type { display: flex; align-items: center; gap: 9px; padding: 12px 16px; border-radius: 12px; border: 1.5px solid var(--border); background: var(--bg-elev); color: var(--text-soft); font-weight: 600; font-size: 13.5px; cursor: pointer; transition: all .15s; }
.import-type:hover { border-color: var(--accent); color: var(--accent); }
.import-type i { width: 17px; height: 17px; }
.import-type.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.field label { font-size: 12.5px; font-weight: 600; color: var(--text-soft); }
.field .input, .field .select { width: 100%; }

/* toast */
.toast-wrap { position: fixed; bottom: 22px; right: 22px; z-index: 80; display: flex; flex-direction: column; gap: 10px; }
.toast { display: flex; align-items: center; gap: 10px; padding: 12px 16px; background: var(--gray-dark); color: #fff; border-radius: 12px; box-shadow: var(--shadow-lg); font-size: 13.5px; font-weight: 500; transform: translateX(120%); transition: transform .3s cubic-bezier(.2,.8,.2,1); }
.toast.show { transform: none; }
.toast i { width: 17px; height: 17px; }
.toast.ok { background: var(--green); }
.toast.err { background: #B91C1C; }

/* login */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; position: relative; z-index: 1; }
.login-card { width: 100%; max-width: 400px; }

.empty { text-align: center; padding: 50px 20px; color: var(--text-soft); }
.empty i { width: 40px; height: 40px; color: var(--text-faint); margin-bottom: 10px; }

.skeleton { background: linear-gradient(90deg, var(--border) 25%, var(--gray-light) 50%, var(--border) 75%); background-size: 200% 100%; animation: sk 1.3s infinite; border-radius: 8px; }
@keyframes sk { 0%{background-position:200% 0} 100%{background-position:-200% 0} }

/* ---------- Splash / Loading (marca N.ONE pulsando + barra verde) ---------- */
.fin-loader { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center;
  background: radial-gradient(130% 130% at 50% 28%, #16202b, #090d13 78%); }
.fin-loader { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 26px; }
.fin-mark { width: min(300px, 60vw); height: auto; display: block; overflow: visible;
  filter: drop-shadow(0 6px 22px rgba(0,0,0,.5)); animation: finPulse 2.4s ease-in-out infinite; }
.fin-mark .brand-n { filter: drop-shadow(0 0 6px rgba(142,224,75,.95)) drop-shadow(0 0 18px rgba(142,224,75,.55)); }
/* anéis de radar pulsando a partir do N (igual aos anéis da marca) */
.fin-ping circle { transform-box: fill-box; transform-origin: center; opacity: 0;
  animation: finPing 1.8s ease-out infinite; }
.fin-ping circle:nth-child(2) { animation-delay: .6s; }
.fin-ping circle:nth-child(3) { animation-delay: 1.2s; }
@keyframes finPing { 0% { transform: scale(.5); opacity: .5; } 80% { opacity: 0; } 100% { transform: scale(2.15); opacity: 0; } }
@keyframes finPulse { 0%,100% { transform: scale(.99); } 50% { transform: scale(1.015); } }
.fin-load-txt { color: #7b8794; font-size: 13px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; }
.fin-load-txt span { animation: finDots 1.4s infinite; opacity: 0; }
.fin-load-txt span:nth-child(2) { animation-delay: .2s; }
.fin-load-txt span:nth-child(3) { animation-delay: .4s; }
@keyframes finDots { 0%,80%,100% { opacity: 0; } 40% { opacity: 1; } }
.fin-loader.hide { opacity: 0; pointer-events: none; transition: opacity .35s ease; }

.fade-in { animation: fade .35s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px);} to { opacity:1; transform:none; } }

.legend-dot { width: 9px; height: 9px; border-radius: 3px; display: inline-block; }

/* backdrop for mobile sidebar */
.scrim { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 39; }

@media (max-width: 940px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: none; box-shadow: var(--shadow-lg); }
  .main { margin-left: 0; }
  .hamburger { display: grid; }
  .scrim.show { display: block; }
  .content { padding: 18px 16px 60px; }
  .topbar { padding: 12px 16px; }
}

/* ===== Modo somente-leitura (perfil sem "editar", ex.: Consulta) =====
   Esconde ações de escrita. As gravações também são bloqueadas no store (backstop). */
body.ro .section-head .btn-primary,
body.ro [data-edit],
body.ro [data-del] { display: none !important; }
body.ro [data-resumo] { pointer-events: none; opacity: .55; }
