/* Nexo — identidade Imérico: azul-marinho #11283F, dourado #B99A58, marfim #F7F5F0, cinzento #65717D. */
:root {
  --navy: #0b1d2e;
  --navy-2: #11283F;
  --primary: #11283F;
  --primary-soft: #e9edf2;
  --gold: #B99A58;
  --gold-2: #9c7f3f;
  --gold-soft: #f4eee1;
  --orange: #11283F;          /* acento principal (mantém os nomes usados nos componentes) */
  --orange-2: #0b1d2e;
  --orange-soft: #e9edf2;
  --teal: #9c7f3f;            /* acento secundário: dourado escuro (legível sobre o marfim) */
  --teal-soft: #f4eee1;
  --bg: #F7F5F0;
  --surface: #ffffff;
  --surface-2: #fbfaf6;
  --text: #14273a;
  --muted: #65717D;
  --border: #e6e1d6;
  --border-2: #d6cfc0;
  --green: #0f7b5f;
  --green-soft: #e3f6ef;
  --red: #c0262d;
  --red-soft: #fdeced;
  --amber: #9a5b00;
  --amber-soft: #fff5e0;
  --series-1: #11283F;
  --series-2: #9c7f3f;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 4px 14px rgba(15, 23, 42, .05);
  --sidebar: 256px;
  --topbar: 58px;
  font-family: "Segoe UI Variable Text", "Segoe UI", Inter, Roboto, system-ui, -apple-system, sans-serif;
  font-size: 14px;
  color: var(--text);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); }
body { line-height: 1.45; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.25; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
.boot { display: grid; place-items: center; height: 100vh; color: var(--muted); }
.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: .85em; }
.right { text-align: right; }
.center { text-align: center; }
.hidden { display: none !important; }
.nowrap { white-space: nowrap; }
.pos { color: var(--green); }
.neg { color: var(--red); }

/* ---------- login ---------- */
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-hero { background: linear-gradient(180deg, rgba(185, 154, 88, .10), transparent 40%), #11283F; color: #F7F5F0; border-right: 3px solid var(--gold);
  padding: 56px; display: flex; flex-direction: column; justify-content: center; gap: 18px; }
.login-hero h1 { font-size: 2.1rem; max-width: 460px; }
.login-hero p { opacity: .9; max-width: 440px; font-size: 1.05rem; }
.login-hero ul { margin: 0; padding-left: 18px; opacity: .92; }
.login-box { display: grid; place-items: center; padding: 32px 16px; }
.login-card { width: 100%; max-width: 380px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.15rem; }
.brand-mark { width: 34px; height: 34px; border-radius: 6px; background: #11283F; display: grid; place-items: center; color: #F7F5F0; }
.login-hero .brand-mark { background: #F7F5F0; color: #11283F; }
.brand { letter-spacing: .14em; text-transform: uppercase; }
.login-hero h1 { letter-spacing: -.01em; } .login-hero h1::after { content: ""; display: block; width: 52px; height: 2px; background: var(--gold); margin-top: 18px; }
.login-hero li::marker { color: var(--gold); }
.brand-mark svg { width: 22px; height: 22px; }
@media (max-width: 860px) { .login-wrap { grid-template-columns: 1fr; } .login-hero { display: none; } }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: var(--sidebar) 1fr; grid-template-rows: var(--topbar) 1fr; min-height: 100vh; }
.shell.collapsed { --sidebar: 64px; }
.topbar { grid-column: 1 / -1; background: rgba(255,255,255,.88); backdrop-filter: saturate(1.4) blur(10px); color: var(--text);
  display: flex; align-items: center; gap: 12px; padding: 0 16px; position: sticky; top: 0; z-index: 30; border-bottom: 1px solid var(--border); }
.topbar .icon-btn { color: var(--muted); }
.topbar .brand-sm { display: flex; align-items: center; gap: 8px; font-weight: 800; letter-spacing: -.01em; color: var(--text); margin-right: 6px; }
.topbar .brand-sm .brand-mark { width: 28px; height: 28px; border-radius: 8px; }
.topbar .brand-sm .brand-mark svg { width: 17px; height: 17px; }
.topbar .tabs { display: flex; gap: 4px; margin-left: 4px; background: var(--surface-2); border: 1px solid var(--border); padding: 3px; border-radius: 10px; }
.topbar .tab { display: flex; align-items: center; gap: 8px; padding: 6px 14px; color: var(--muted); font-weight: 600; border-radius: 8px; font-size: .9rem; }
.topbar .tab:hover { color: var(--text); text-decoration: none; }
.topbar .tab.active { color: var(--primary); background: #fff; box-shadow: 0 1px 3px rgba(15,23,42,.1); }
.topbar .tab svg { width: 17px; height: 17px; flex: none; }
.topbar .spacer { flex: 1; }
.export-btns { display: flex; gap: 4px; }
.export-btns .btn { padding: 5px 10px; }
@media (max-width: 700px) { .export-btns .btn span { display: none; } }
.topbar .emp-chip { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: .88rem; color: var(--text); }
.topbar select { background: var(--surface-2); border: 1px solid var(--border-2); color: var(--text); border-radius: 8px; padding: 4px 8px; }
.topbar .search { background: var(--surface-2); border: 1px solid var(--border); border-radius: 9px; color: var(--text); padding: 7px 12px; width: 260px; }
.topbar .search::placeholder { color: var(--muted); }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: #11283F; box-shadow: inset 0 0 0 2px var(--gold); color: #F7F5F0; display: grid; place-items: center;
  font-weight: 700; font-size: .8rem; border: 0; cursor: pointer; }
.bell { position: relative; }
.bell .dot { position: absolute; top: 2px; right: 2px; min-width: 16px; height: 16px; border-radius: 8px; background: #e11d48;
  color: #fff; font-size: 10px; display: grid; place-items: center; padding: 0 4px; }

.sidebar { background: var(--surface); border-right: 1px solid var(--border); overflow-y: auto; height: calc(100vh - var(--topbar));
  position: sticky; top: var(--topbar); display: flex; flex-direction: column; }
.nav { list-style: none; margin: 0; padding: 12px 10px; }
.nav-item > a, .nav-item > button { display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 11px; border-radius: 9px;
  color: #334155; background: none; border: 0; cursor: pointer; text-align: left; font-size: .9rem; font-weight: 500; }
.nav-item > a:hover, .nav-item > button:hover { background: var(--surface-2); text-decoration: none; color: var(--text); }
.nav-item.active > a, .nav-item.active > button { background: var(--primary-soft); color: var(--primary); font-weight: 600; box-shadow: inset 3px 0 0 var(--gold); }
.nav-item.open > button { color: var(--primary); font-weight: 600; }
.nav-item svg { width: 19px; height: 19px; flex: none; }
.nav-item .chev { margin-left: auto; width: 14px; height: 14px; transition: transform .15s; }
.nav-item.open .chev { transform: rotate(180deg); }
.subnav { list-style: none; margin: 2px 0 6px; padding: 0 0 0 31px; display: none; }
.nav-item.open .subnav { display: block; }
.subnav a { display: block; padding: 6px 10px; border-radius: 6px; color: var(--muted); font-size: .88rem; }
.subnav a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.subnav a.active { color: var(--orange-2); font-weight: 600; background: var(--orange-soft); }
.nav-extra { margin-top: auto; border-top: 1px solid var(--border); padding: 8px; }
.nav-extra a { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 7px; color: var(--navy); font-weight: 600; font-size: .88rem; }
.nav-extra a:hover, .nav-extra a.active { background: var(--primary-soft); text-decoration: none; }
.nav-extra svg { width: 18px; height: 18px; }
.shell.collapsed .nav-label, .shell.collapsed .chev, .shell.collapsed .subnav, .shell.collapsed .nav-extra span { display: none !important; }
.shell.collapsed .nav-item > a, .shell.collapsed .nav-item > button { justify-content: center; }

.main { padding: 20px; min-width: 0; }
.page { max-width: 1400px; margin: 0 auto; }
.page-card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; margin-bottom: 18px; border: 1px solid var(--border); }
.page-head { background: var(--surface); color: var(--text); padding: 16px 20px 14px; font-weight: 700; font-size: 1.12rem; letter-spacing: -.01em;
  display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--border); }
.page-head::before { content: ""; width: 4px; height: 20px; border-radius: 4px; background: linear-gradient(180deg, var(--primary), var(--teal)); }
.page-head .spacer { flex: 1; }
.page-body { padding: 18px; }
.subtitle-bar { display: flex; justify-content: flex-end; gap: 8px; align-items: center; color: var(--muted); font-size: .85rem; margin: -8px 0 12px; }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: var(--topbar); width: 260px; z-index: 40; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow); }
  .shell.mobile-open .sidebar { transform: none; }
  .shell.collapsed { --sidebar: 0; }
  .topbar .tab span, .topbar .search, .topbar .emp-chip .emp-name { display: none; }
  .main { padding: 12px; }
}

/* ---------- componentes ---------- */
.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid transparent; border-radius: 9px; padding: 8px 14px; transition: background .15s, box-shadow .15s;
  cursor: pointer; font-weight: 600; font-size: .86rem; background: var(--surface); border-color: var(--border-2); color: var(--text); white-space: nowrap; }
.btn:hover { filter: brightness(.97); text-decoration: none; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn svg { width: 15px; height: 15px; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 1px 2px rgba(17,40,63,.3); }
.btn.primary:hover { filter: none; background: #0b1d2e; }
.btn.blue { background: #0f172a; border-color: #0f172a; color: #fff; }
.btn.pulse { box-shadow: 0 0 0 3px rgba(17,40,63,.25); border-color: var(--primary); color: var(--primary); }
.btn.danger { background: var(--surface); border-color: #f0b4b4; color: var(--red); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--primary); }
.btn.sm { padding: 4px 9px; font-size: .8rem; }
.btn.block { width: 100%; justify-content: center; padding: 10px; }
.icon-btn { background: none; border: 0; cursor: pointer; padding: 6px; border-radius: 6px; display: inline-grid; place-items: center; color: var(--muted); }
.icon-btn:hover { background: rgba(127,127,127,.12); }
.icon-btn svg { width: 19px; height: 19px; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.toolbar .spacer { flex: 1; }

.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field > label, .label { font-weight: 600; font-size: .82rem; color: #3a4357; }
.input, .field input:not([type=checkbox]):not([type=radio]):not([type=file]), .field select, .field textarea, select.input {
  border: 1px solid var(--border-2); border-radius: 6px; padding: 7px 9px; background: var(--surface); width: 100%; min-width: 0; }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--primary-soft); border-color: var(--primary); }
.field textarea { resize: vertical; min-height: 60px; }
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.span2 { grid-column: span 2; }
.span-all { grid-column: 1 / -1; }
@media (max-width: 900px) { .g3, .g4, .g5 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .g2, .g3, .g4, .g5 { grid-template-columns: 1fr; } .span2 { grid-column: auto; } }
.check { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; font-size: .88rem; }
.switch { position: relative; width: 36px; height: 20px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; background: #c3cad8; border-radius: 10px; transition: .15s; cursor: pointer; }
.switch span::after { content: ""; position: absolute; width: 16px; height: 16px; left: 2px; top: 2px; background: #fff; border-radius: 50%; transition: .15s; }
.switch input:checked + span { background: var(--primary); }
.switch input:checked + span::after { transform: translateX(16px); }
.seg { display: inline-flex; border: 1px solid var(--border-2); border-radius: 7px; overflow: hidden; }
.seg button { border: 0; background: var(--surface); padding: 7px 16px; cursor: pointer; font-weight: 600; }
.seg button.on { background: var(--navy); color: #fff; }
.hr { border: 0; border-top: 1px solid var(--border); margin: 16px 0; }

.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
table.t { width: 100%; border-collapse: collapse; font-size: .86rem; }
table.t th { background: var(--surface-2); color: #475569; text-align: left; font-weight: 700; padding: 10px 10px; font-size: .74rem; border-bottom: 1px solid var(--border);
  text-transform: uppercase; letter-spacing: .02em; white-space: nowrap; position: sticky; top: 0; }
table.t td { padding: 8px 10px; border-top: 1px solid var(--border); vertical-align: middle; }
table.t tbody tr:hover td { background: #fafbfe; }
table.t tr.lvl1 td { background: #e9edf7; font-weight: 700; }
table.t tr.lvl2 td { background: #f4f6fb; font-weight: 600; }
table.t tr.total td, table.t tfoot td { background: #eef1f8; font-weight: 700; border-top: 2px solid var(--border-2); }
table.t tr.clickable { cursor: pointer; }
table.t .actions { white-space: nowrap; text-align: right; }
table.t input.input, table.t select.input { padding: 5px 7px; }
.empty { padding: 28px; text-align: center; color: var(--muted); }

.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-size: .74rem; font-weight: 700;
  background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); white-space: nowrap; }
.badge.green { background: var(--green-soft); color: var(--green); border-color: transparent; }
.badge.red { background: var(--red-soft); color: var(--red); border-color: transparent; }
.badge.amber { background: var(--amber-soft); color: var(--amber); border-color: transparent; }
.badge.blue { background: var(--primary-soft); color: var(--primary); border-color: transparent; }
.sync-ind { text-decoration: none; white-space: nowrap; margin-right: 6px; }
.sync-ind.hidden { display: none; }
.sync-ind .sync-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.sync-ind.blue .sync-dot { animation: sync-pulso 1.2s ease-in-out infinite; }
@keyframes sync-pulso { 50% { opacity: .25; } }
@media (max-width: 700px) { .sync-ind { font-size: 0; gap: 0; padding: 5px; } }
.badge.orange { background: var(--orange-soft); color: var(--orange-2); border-color: transparent; }

.cards { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin-bottom: 18px; }
.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; min-width: 0; }
.card h3 { font-size: 1rem; }
.stat .label { color: var(--muted); font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; }
.stat .value { font-size: 1.6rem; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; }
.stat .sub { color: var(--muted); font-size: .82rem; margin-top: 2px; }
.hero-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 18px; }
.hero { border-radius: var(--radius); padding: 22px; color: #fff; display: flex; align-items: center; gap: 16px; box-shadow: var(--shadow); }
.hero.orange { background: #11283F; box-shadow: inset 0 -3px 0 var(--gold); }
.hero.blue { background: linear-gradient(120deg, #8a6f35, #B99A58); }
.hero { text-decoration: none !important; transition: transform .15s, box-shadow .15s; }
.hero:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(15,23,42,.15); }
.hero .ic { width: 44px; height: 44px; border-radius: 10px; background: rgba(255,255,255,.2); display: grid; place-items: center; flex: none; }
.hero .ic svg { width: 22px; height: 22px; }
.hero .t { font-weight: 700; font-size: 1.05rem; }
.hero .s { opacity: .9; font-size: .85rem; }
.hero .go { margin-left: auto; color: #fff; font-weight: 700; display: flex; align-items: center; gap: 6px; }
@media (max-width: 760px) { .hero-cards { grid-template-columns: 1fr; } }
.progress { height: 8px; border-radius: 4px; background: #e7ebf3; overflow: hidden; margin-top: 10px; }
.progress > i { display: block; height: 100%; background: var(--orange); border-radius: 4px; }
.bars-h .row { display: grid; grid-template-columns: 130px 1fr 60px; gap: 10px; align-items: center; margin: 8px 0; font-size: .86rem; }
.bars-h .track { height: 8px; background: #e7ebf3; border-radius: 4px; overflow: hidden; }
.bars-h .track i { display: block; height: 100%; background: var(--orange); border-radius: 0 4px 4px 0; }

.tabs-line { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 16px; overflow-x: auto; }
.tabs-line button { background: none; border: 0; padding: 9px 14px; cursor: pointer; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs-line button.on { color: var(--orange-2); border-bottom-color: var(--orange); }
.side-tabs { display: grid; grid-template-columns: 190px 1fr; gap: 20px; }
.side-tabs nav { display: flex; flex-direction: column; border-right: 1px solid var(--border); padding-right: 8px; }
.side-tabs nav button { background: none; border: 0; text-align: left; padding: 9px 10px; cursor: pointer; color: var(--text); border-radius: 6px; }
.side-tabs nav button.on { color: var(--orange-2); font-weight: 600; background: var(--orange-soft); }
@media (max-width: 760px) { .side-tabs { grid-template-columns: 1fr; } .side-tabs nav { flex-direction: row; overflow-x: auto; border: 0; } }

/* grelha de lançamento */
.grid-lanc td { padding: 5px 6px; }
.grid-lanc .conta-cell { display: flex; gap: 4px; }
.grid-lanc .conta-cell input { width: 120px; }
.grid-lanc .nome { color: var(--muted); font-size: .84rem; min-width: 160px; }
.totais-bar { display: flex; gap: 22px; justify-content: flex-end; align-items: center; padding: 12px 6px 0; font-weight: 600; flex-wrap: wrap; }
.totais-bar .diff { color: var(--red); }
.totais-bar [hidden] { display: none !important; }
.totais-bar .ok { color: var(--green); }
.doc-block { border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; margin-bottom: 14px; background: var(--surface-2); }

/* modal & toast */
.modal-back { position: fixed; inset: 0; background: rgba(10, 20, 45, .45); display: grid; place-items: center; z-index: 100; padding: 16px; }
.modal { background: var(--surface); border-radius: 10px; width: 100%; max-width: 620px; max-height: calc(100vh - 32px); display: flex; flex-direction: column; box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.modal.lg { max-width: 980px; }
.modal.xl { max-width: 1240px; }
.modal.sm { max-width: 420px; }
.modal-h { padding: 14px 18px; border-bottom: 1px solid var(--border); display: flex; align-items: center; font-weight: 700; }
.modal-h .x { margin-left: auto; }
.modal-b { padding: 18px; overflow-y: auto; }
.modal-f { padding: 12px 18px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; }
#toast-root { position: fixed; bottom: 18px; right: 18px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--text); color: #fff; padding: 10px 14px; border-radius: 8px; box-shadow: var(--shadow); max-width: 380px; font-size: .9rem; }
.toast.ok { background: var(--green); }
.toast.err { background: var(--red); }
.menu-pop { position: absolute; background: var(--surface); color: var(--text); border-radius: 8px; box-shadow: 0 10px 30px rgba(0,0,0,.18);
  min-width: 220px; padding: 6px; z-index: 50; border: 1px solid var(--border); }
.menu-pop a, .menu-pop button { display: flex; width: 100%; gap: 8px; padding: 8px 10px; border-radius: 6px; color: var(--text); background: none; border: 0; cursor: pointer; text-align: left; }
.menu-pop a:hover, .menu-pop button:hover { background: var(--surface-2); text-decoration: none; }
.menu-pop .head { padding: 8px 10px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.lang-sw { display: inline-flex; border: 1px solid var(--border); border-radius: 999px; padding: 2px; gap: 2px; }
.lang-sw button, .menu-pop .lang-sw button { width: auto; padding: 2px 10px; border: 0; border-radius: 999px; background: none; color: var(--muted); font-size: 12px; font-weight: 600; cursor: pointer; }
.lang-sw button.on, .menu-pop .lang-sw button.on { background: var(--primary); color: #fff; }
.menu-pop .lang-row { display: flex; align-items: center; gap: 8px; padding: 6px 10px; }
.menu-pop .lang-row .lang-sw { margin-left: auto; }
.notif-item { padding: 8px 10px; border-radius: 6px; }
.notif-item.unread { background: var(--primary-soft); }

/* gráficos */
.chart { width: 100%; height: auto; display: block; }
.chart .grid-l { stroke: var(--border); }
.chart .axis-t { fill: var(--muted); font-size: 11px; }
.chart rect.bar:hover { opacity: .8; }
.legend { display: flex; gap: 16px; font-size: .84rem; color: var(--muted); margin-top: 6px; flex-wrap: wrap; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }

/* demonstrações */
.fin { width: 100%; border-collapse: collapse; font-size: .9rem; }
.fin td, .fin th { padding: 7px 10px; border-bottom: 1px solid var(--border); }
.fin th { text-align: right; color: var(--muted); font-size: .8rem; text-transform: uppercase; }
.fin th:first-child { text-align: left; }
.fin .sec td { background: var(--primary-soft); color: var(--navy); font-weight: 700; }
.fin .sub td { font-weight: 700; background: #f6f8fc; }
.fin .tot td { font-weight: 800; background: #e9edf7; border-top: 2px solid var(--navy); }
.fin td.l { padding-left: 24px; }
.kanban { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.kanban .col { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px; min-height: 200px; }
.kanban .col h4 { display: flex; justify-content: space-between; font-size: .86rem; text-transform: uppercase; color: var(--muted); }
.kcard { background: var(--surface); border: 1px solid var(--border); border-radius: 7px; padding: 10px; margin-bottom: 8px; box-shadow: var(--shadow); }
.kcard .tt { font-weight: 600; margin-bottom: 4px; }
.kcard .meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; font-size: .78rem; color: var(--muted); }
@media (max-width: 860px) { .kanban { grid-template-columns: 1fr; } }
/* Balancete Geral (formato Primavera) */
.bal-cab { display: grid; grid-template-columns: 1fr 1.4fr 1fr; gap: 10px; align-items: end; margin-bottom: 10px; padding-bottom: 8px; border-bottom: 2px solid var(--text); }
table.bal-geral tr.sub td { background: #fff; font-weight: 600; border-top: 1px dashed var(--border-2); color: #334155; }
table.bal-geral tr.lvl2 td { background: var(--surface-2); }
table.bal-geral td:first-child { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Relatório e Contas */
.rc-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.rc-head h1 { font-size: 1.7rem; margin: 2px 0 8px; letter-spacing: -.02em; }
.eyebrow { font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--teal); }
.rc-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 999px; font-size: .78rem; font-weight: 600;
  background: var(--surface); border: 1px solid var(--border); color: var(--muted); }
.chip svg { width: 13px; height: 13px; }
.chip.ok { background: var(--green-soft); color: var(--green); border-color: transparent; }
.chip.warn { background: var(--amber-soft); color: var(--amber); border-color: transparent; }
.chip.err { background: var(--red-soft); color: var(--red); border-color: transparent; }
.callout { display: flex; gap: 12px; align-items: flex-start; background: linear-gradient(90deg, var(--primary-soft), var(--teal-soft)); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px; margin-bottom: 16px; }
.callout svg { width: 22px; height: 22px; color: var(--primary); flex: none; }
.rc-grid { display: grid; grid-template-columns: minmax(380px, 1fr) minmax(0, 1.15fr); gap: 16px; align-items: start; }
.rc-editor { max-height: calc(100vh - 210px); overflow: auto; }
.rc-preview { position: sticky; top: calc(var(--topbar) + 12px); background: #e2e8f0; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); }
.rc-prev-bar { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; background: var(--surface); border-bottom: 1px solid var(--border);
  font-weight: 600; font-size: .85rem; color: var(--muted); }
.rc-preview iframe { width: 100%; height: calc(100vh - 230px); border: 0; display: block; }
@media (max-width: 1100px) { .rc-grid { grid-template-columns: 1fr; } .rc-editor { max-height: none; } .rc-preview { position: static; } }
details.nota-ed { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; background: var(--surface-2); }
details.nota-ed summary { cursor: pointer; display: flex; gap: 8px; align-items: center; }
details.nota-ed textarea { margin-top: 10px; }
.sig-card h3 { margin-bottom: 10px; }
.sig-box { height: 110px; border: 1px dashed var(--border-2); border-radius: 10px; display: grid; place-items: center; background: #fff; margin: 10px 0; }
.sig-box img { max-height: 96px; max-width: 90%; }
.sig-box.sm { height: 74px; } .sig-box.sm img { max-height: 62px; }
.gest { border-bottom: 1px solid var(--border); padding-bottom: 10px; margin-bottom: 10px; }

.recibo { border: 1px solid var(--border-2); border-radius: 8px; padding: 16px; margin-bottom: 16px; break-inside: avoid; background: #fff; }
.recibo h4 { display: flex; justify-content: space-between; }
.print-only { display: none; }

@media print {
  .topbar, .sidebar, .toolbar, .no-print, #toast-root, .btn, .nav-extra { display: none !important; }
  .shell { display: block; }
  .main { padding: 0; }
  .page-card { box-shadow: none; }
  .page-head { background: #fff; color: #000; border-bottom: 2px solid #000; }
  .print-only { display: block; }
  body { background: #fff; }
  table.t th { position: static; }
}

/* Licença */
.lic-bar { display: flex; align-items: center; gap: 10px; padding: 8px 16px; font-size: 13px; border-bottom: 1px solid; }
.lic-bar svg { width: 16px; height: 16px; flex: none; } .lic-bar span { flex: 1; }
.lic-bar.info { background: #e9edf2; border-color: #c9d3de; color: #0b1d2e; }
.lic-bar.warn { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.lic-bar.err { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.lic-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.lic-kv { display: grid; grid-template-columns: 140px 1fr; gap: 6px 10px; font-size: 13px; } .lic-kv dt { color: var(--muted, #64748b); }
.lic-id { font: 600 15px ui-monospace, Consolas, monospace; letter-spacing: .04em; }
.lic-mod { display: flex; align-items: center; gap: 8px; padding: 4px 0; font-size: 13px; } .lic-mod.off { color: #94a3b8; text-decoration: line-through; }
.lic-chave { width: 100%; min-height: 90px; font: 12px ui-monospace, Consolas, monospace; word-break: break-all; }

/* Selecção múltipla / eliminação em massa */
.sel-bar { display: flex; align-items: center; gap: 12px; margin: 4px 0 8px; min-height: 30px; }
.sel-bar .check { font-size: 13px; }
th.sel-cell, td.sel-cell { width: 34px; text-align: center; padding-left: 8px !important; padding-right: 4px !important; }
.sel-cell input, .sel-bar input { width: 16px; height: 16px; cursor: pointer; accent-color: var(--primary, #11283F); }
tr.sel-on td { background: color-mix(in srgb, var(--primary, #11283F) 7%, transparent); }
.sel-progresso { position: fixed; right: 18px; bottom: 18px; z-index: 9999; }
@media print { .sel-cell, .sel-bar { display: none !important; } }

/* Licença — plano actual e planos (identidade Nexo) */
.nx-actual { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; padding: 20px 24px; border-radius: 16px; margin-bottom: 22px; color: #fff;
  background: #11283F; border-bottom: 3px solid var(--gold); box-shadow: 0 10px 30px rgba(17, 40, 63, .25); }
.nx-actual.aviso { background: linear-gradient(120deg, #78350f, #d97706); } .nx-actual.mau { background: linear-gradient(120deg, #7f1d1d, #dc2626); }
.nx-anel { --p: 0; width: 86px; height: 86px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: conic-gradient(#5eead4 calc(var(--p) * 1%), rgba(255, 255, 255, .18) 0); }
.nx-anel > div { width: 68px; height: 68px; border-radius: 50%; background: rgba(15, 23, 42, .35); display: grid; place-items: center; align-content: center; text-align: center; }
.nx-anel b { font-size: 20px; line-height: 1; } .nx-anel span { font-size: 10px; opacity: .8; text-transform: uppercase; letter-spacing: .06em; }
.nx-actual-info { flex: 1; min-width: 220px; } .nx-actual-info h2 { margin: 6px 0 4px; font-size: 22px; color: #fff; } .nx-actual-info p { margin: 0; opacity: .9; }
.nx-chip { display: inline-block; padding: 2px 10px; border-radius: 99px; background: rgba(255, 255, 255, .18); font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.nx-actual-btns { display: flex; gap: 10px; flex-wrap: wrap; }
.nx-btn-claro { background: transparent !important; color: #fff !important; border: 1.5px solid rgba(255, 255, 255, .7) !important; }
.nx-btn-solido { background: #fff !important; color: #11283F !important; border-color: #fff !important; font-weight: 700; }
.nx-planos-cab { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.nx-planos-cab h3 { margin: 0 0 2px; } .nx-planos-cab p { margin: 0; }
.nx-periodos { display: inline-flex; background: #e9edf2; border-radius: 99px; padding: 4px; gap: 2px; }
.nx-periodos button { border: 0; background: transparent; padding: 7px 16px; border-radius: 99px; font: 600 13px inherit; color: #11283F; cursor: pointer; }
.nx-periodos button.on { background: #11283F; color: #fff; box-shadow: 0 2px 8px rgba(17, 40, 63, .35); }
.nx-planos { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; align-items: start; }
.nx-plano { --c1: #65717D; --c2: #8a96a2; border-radius: 18px; overflow: hidden; background: #fff; box-shadow: 0 6px 22px rgba(15, 23, 42, .08); transition: transform .15s; }
.nx-plano:hover { transform: translateY(-3px); }
.nx-profissional { --c1: #11283F; --c2: #1d3b5a; } .nx-escritorio { --c1: #8a6f35; --c2: #B99A58; }
.nx-plano.destaque { box-shadow: 0 14px 34px rgba(17, 40, 63, .28); outline: 2px solid #B99A58; }
.nx-plano.actual { outline: 2px solid #d4bc86; }
.nx-topo { position: relative; padding: 22px 22px 18px; color: #fff; background: linear-gradient(135deg, var(--c1), var(--c2)); }
.nx-fita { position: absolute; top: 14px; right: 14px; background: rgba(255, 255, 255, .22); padding: 3px 10px; border-radius: 99px; font-size: 11px; font-weight: 700; }
.nx-nome { font-size: 13px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; opacity: .9; }
.nx-valor { margin-top: 10px; display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; } .nx-valor b { font-size: 30px; font-weight: 800; } .nx-valor span { opacity: .85; font-size: 13px; }
.nx-mensal { font-size: 12px; opacity: .9; margin-top: 2px; } .nx-mensal b { color: #fde68a; }
.nx-corpo { padding: 16px 22px 22px; } .nx-corpo > p { color: #64748b; font-size: 13px; margin: 0 0 12px; min-height: 38px; }
.nx-limites { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.nx-limites div { background: #f8fafc; border-radius: 10px; padding: 8px; text-align: center; } .nx-limites b { display: block; font-size: 20px; color: var(--c1); } .nx-limites span { font-size: 11px; color: #64748b; }
.nx-corpo ul { list-style: none; margin: 0 0 16px; padding: 0; }
.nx-corpo li { position: relative; padding: 5px 0 5px 22px; font-size: 13.5px; }
.nx-corpo li::before { content: ''; position: absolute; left: 4px; top: 11px; width: 8px; height: 8px; border-radius: 50%; background: var(--c2); }
.nx-corpo li.nao { color: #cbd5e1; text-decoration: line-through; } .nx-corpo li.nao::before { background: #e2e8f0; }
/* renovação com pagamento */
.nx-compra .label { margin: 12px 0 6px; } .nx-compra .label:first-child { margin-top: 0; }
.nx-opcoes { display: flex; gap: 8px; flex-wrap: wrap; }
.nx-opcoes button { flex: 1; min-width: 110px; border: 1.5px solid var(--border); background: var(--surface); border-radius: 10px; padding: 9px 10px; font: 600 13px inherit; color: var(--text); cursor: pointer; display: flex; flex-direction: column; gap: 2px; align-items: center; }
.nx-opcoes button small { font-weight: 500; color: var(--muted); font-size: 11.5px; }
.nx-opcoes button.on { border-color: var(--primary); background: #e9edf2; color: var(--primary); }
.nx-metodos { display: grid; gap: 8px; }
.nx-metodos label { display: flex; align-items: center; gap: 10px; border: 1.5px solid var(--border); border-radius: 10px; padding: 10px 12px; cursor: pointer; font-size: 13.5px; }
.nx-metodos label.on { border-color: var(--primary); background: #e9edf2; } .nx-metodos input { display: none; } .nx-metodos svg { width: 20px; height: 20px; color: var(--primary); flex: none; }
.nx-total { display: flex; justify-content: space-between; align-items: baseline; margin-top: 14px; padding: 12px 14px; border-radius: 12px; background: #11283F; border-left: 4px solid var(--gold); color: #F7F5F0; }
.nx-total b { font-size: 22px; }
.nx-pag { border-radius: 16px; background: var(--surface); box-shadow: 0 6px 22px rgba(15, 23, 42, .08); border-left: 5px solid #B99A58; padding: 18px 20px; margin-bottom: 22px; }
.nx-pag.fechado { border-left-color: #dc2626; }
.nx-pag-cab { display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap; } .nx-pag-cab h3 { margin: 6px 0 2px; } .nx-pag-cab p { margin: 0; color: var(--muted); font-size: 13px; }
.nx-pag .nx-chip { background: #e9edf2; color: #11283F; }
.nx-pag-estado { display: flex; align-items: center; gap: 10px; max-width: 360px; font-size: 13px; background: #f8fafc; border-radius: 10px; padding: 10px 12px; align-self: flex-start; }
.nx-pag-estado svg { width: 18px; color: #dc2626; flex: none; }
.nx-pulso { width: 10px; height: 10px; border-radius: 50%; background: #B99A58; flex: none; animation: nxpulso 1.4s infinite; }
@keyframes nxpulso { 0% { box-shadow: 0 0 0 0 rgba(185, 154, 88, .55); } 100% { box-shadow: 0 0 0 12px rgba(185, 154, 88, 0); } }
.nx-pag-corpo { margin: 14px 0 6px; display: grid; gap: 6px; max-width: 560px; }
.nx-pag-l { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 10px; background: #f8fafc; }
.nx-pag-l span { width: 110px; color: var(--muted); font-size: 12.5px; flex: none; } .nx-pag-l b { font-size: 15px; letter-spacing: .02em; word-break: break-all; flex: 1; }
.nx-pag-l .icon-btn { width: 28px; height: 28px; }
.nx-cta { display: flex !important; justify-content: center; width: 100%; background: linear-gradient(135deg, var(--c1), var(--c2)) !important; color: #fff !important; border: 0 !important; font-weight: 700; padding: 10px !important; border-radius: 10px !important; }