/* ==========================================================================
   CARNEIRO NEXUS — design system "Glass" v1.0.019
   Base: tokens da marca (assets/brand/css/brand.css). Vidro moderado, blur onde
   ajuda, superfícies sólidas para números/tabelas/formulários, fallback sem blur.
   ========================================================================== */

:root {
  --font: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 20px;
  --radius-pill: 999px;

  --sidebar-w: 264px;
  --topbar-h: 64px;
  --tabbar-h: 64px;
  --content-max: 1440px;
  --gutter: 28px;

  --ease: cubic-bezier(.2,.7,.2,1);
  --t-fast: 140ms;
  --t: 220ms;

  /* Vidro — tema claro */
  --glass-bg: rgba(255,255,255,.72);
  --glass-bg-strong: rgba(255,255,255,.86);
  --glass-border: rgba(21,23,25,.08);
  --glass-shadow: 0 1px 2px rgba(21,23,25,.04), 0 12px 32px -16px rgba(21,23,25,.18);
  --glass-blur: 18px;
  --solid: #FFFFFF;
  --solid-2: #F9FAFB;
  --ink: #151719;
  --ink-2: #3C434D;
  --ink-3: #667085;
  --ink-4: #98A2B3;
  --line: #D8DDE5;
  --line-2: #E9ECF1;
  --canvas: #F0F2F5;
  --red: #E21B23;
  --red-text: #C5161E;
  --red-soft: rgba(226,27,35,.08);
  --ok: #087F5B;  --ok-soft: rgba(8,127,91,.10);
  --warn: #925A00; --warn-soft: rgba(146,90,0,.12);
  --info: #175CD3; --info-soft: rgba(23,92,211,.10);
  --err: #B42318;  --err-soft: rgba(180,35,24,.10);
  --focus: #175CD3;
  --mesh-a: rgba(226,27,35,.07);
  --mesh-b: rgba(23,92,211,.06);
  --mesh-c: rgba(21,23,25,.04);
  color-scheme: light;
}

:root[data-theme="dark"] {
  --glass-bg: rgba(31,35,41,.66);
  --glass-bg-strong: rgba(31,35,41,.86);
  --glass-border: rgba(255,255,255,.08);
  --glass-shadow: 0 1px 2px rgba(0,0,0,.3), 0 16px 40px -20px rgba(0,0,0,.6);
  --solid: #1F2329;
  --solid-2: #252B33;
  --ink: #FFFFFF;
  --ink-2: #D5DAE2;
  --ink-3: #B8C0CC;
  --ink-4: #7C8595;
  --line: #3B424D;
  --line-2: #2C323B;
  --canvas: #151719;
  --red-text: #FF646B;
  --red-soft: rgba(255,100,107,.14);
  --ok: #34D399;  --ok-soft: rgba(52,211,153,.14);
  --warn: #F2B84B; --warn-soft: rgba(242,184,75,.16);
  --info: #7CB4FF; --info-soft: rgba(124,180,255,.14);
  --err: #FF8075;  --err-soft: rgba(255,128,117,.14);
  --focus: #7CB4FF;
  --mesh-a: rgba(226,27,35,.12);
  --mesh-b: rgba(23,92,211,.10);
  --mesh-c: rgba(255,255,255,.03);
  color-scheme: dark;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; height: 100%; }
body {
  margin: 0; min-height: 100%; font-family: var(--font); font-size: 15px; line-height: 1.5;
  color: var(--ink); background: var(--canvas);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "cv11", "ss01";
}
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(900px 600px at 8% -10%, var(--mesh-a), transparent 60%),
    radial-gradient(800px 500px at 100% 0%, var(--mesh-b), transparent 60%),
    radial-gradient(700px 500px at 50% 110%, var(--mesh-c), transparent 60%);
}
h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -.015em; line-height: 1.2; }
h1 { font-size: 26px; } h2 { font-size: 20px; } h3 { font-size: 16px; } h4 { font-size: 14px; }
p { margin: 0 0 .75em; }
a { color: var(--red-text); text-decoration: none; text-underline-offset: 3px; }
a:hover { text-decoration: underline; }
img, svg { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
small { font-size: 12.5px; }
hr { border: 0; border-top: 1px solid var(--line-2); margin: 20px 0; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
::selection { background: var(--red); color: #fff; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.num, .money, td.money, th.money { font-variant-numeric: tabular-nums lining-nums; }
.money { white-space: nowrap; }
.muted { color: var(--ink-3); }
.small { font-size: 13px; }
.mono { font-family: var(--font-mono); font-size: .92em; }
.text-ok { color: var(--ok); } .text-warn { color: var(--warn); } .text-err { color: var(--err); } .text-info { color: var(--info); }
.right { text-align: right; } .center { text-align: center; }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Vidro ---------- */
.glass, .card {
  background: var(--glass-bg); border: 1px solid var(--glass-border); border-radius: var(--radius);
  box-shadow: var(--glass-shadow);
}
@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass, .sidebar, .topbar, .tabbar, .modal__panel, .tour__card, .toast { -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(160%); backdrop-filter: blur(var(--glass-blur)) saturate(160%); }
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass, .card, .sidebar, .topbar, .tabbar, .modal__panel, .tour__card, .toast { background: var(--glass-bg-strong); }
}
.card { background: var(--glass-bg-strong); }
.card--solid { background: var(--solid); }
.card__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px 0; }
.card__title { font-size: 15px; font-weight: 650; }
.card__sub { font-size: 13px; color: var(--ink-3); margin-top: 2px; }
.card__body { padding: 16px 20px 20px; }
.card__body--flush { padding: 0; }
.card__foot { padding: 12px 20px 16px; border-top: 1px solid var(--line-2); display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }

/* ---------- Estrutura da aplicação ---------- */
.app { min-height: 100vh; display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); grid-template-rows: auto 1fr; }
.sidebar {
  grid-row: 1 / span 2; position: sticky; top: 0; height: 100vh; overflow: auto;
  background: var(--glass-bg); border-right: 1px solid var(--glass-border);
  display: flex; flex-direction: column; padding: 18px 14px; gap: 6px;
}
.sidebar__brand { display: block; padding: 6px 8px 18px; }
.sidebar__brand .cn-brand { --cn-brand-width: 100%; --cn-brand-max-height: 44px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav__group { margin: 12px 8px 4px; font-size: 11.5px; font-weight: 650; color: var(--ink-4); letter-spacing: .02em; }
.nav__item {
  display: flex; align-items: center; gap: 11px; padding: 9px 11px; border-radius: var(--radius-sm);
  color: var(--ink-2); font-weight: 530; font-size: 14px; position: relative; transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.nav__item:hover { background: rgba(21,23,25,.05); color: var(--ink); text-decoration: none; }
:root[data-theme="dark"] .nav__item:hover { background: rgba(255,255,255,.06); }
.nav__item[aria-current="page"] { background: var(--solid); color: var(--ink); box-shadow: 0 1px 2px rgba(21,23,25,.06); }
.nav__item[aria-current="page"]::before { content: ""; position: absolute; left: 0; top: 9px; bottom: 9px; width: 3px; border-radius: 3px; background: var(--red); }
.nav__item svg { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; opacity: .9; }
.nav__badge { margin-left: auto; font-size: 11.5px; font-weight: 650; padding: 1px 7px; border-radius: var(--radius-pill); background: var(--red-soft); color: var(--red-text); }
.sidebar__foot { margin-top: auto; padding: 14px 8px 4px; font-size: 12px; color: var(--ink-4); display: flex; justify-content: space-between; align-items: center; gap: 8px; }

.topbar {
  position: sticky; top: 0; z-index: 30; height: var(--topbar-h);
  display: flex; align-items: center; gap: 14px; padding: 0 var(--gutter);
  background: var(--glass-bg); border-bottom: 1px solid var(--glass-border);
}
.topbar__title { font-size: 15px; font-weight: 650; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar__title small { display: block; font-weight: 450; color: var(--ink-3); font-size: 12.5px; }
.topbar__spacer { flex: 1; }
.topbar__actions { display: flex; align-items: center; gap: 8px; }
.topbar__brand { display: none; }

.main { padding: 26px var(--gutter) 48px; max-width: var(--content-max); width: 100%; min-width: 0; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head__text p { color: var(--ink-3); margin: 4px 0 0; max-width: 70ch; }
.page-head__actions { display: flex; gap: 10px; flex-wrap: wrap; }
.breadcrumb { font-size: 13px; color: var(--ink-3); margin-bottom: 8px; display: flex; gap: 6px; flex-wrap: wrap; }
.breadcrumb a { color: var(--ink-3); }

.tabbar { display: none; }
.sheet { display: none; }

/* ---------- Botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 0 16px; border-radius: var(--radius-sm); border: 1px solid var(--line);
  background: var(--solid); color: var(--ink); font-weight: 600; font-size: 14px; line-height: 1;
  text-decoration: none; white-space: nowrap; transition: transform var(--t-fast) var(--ease), background var(--t-fast), border-color var(--t-fast), box-shadow var(--t-fast);
  box-shadow: 0 1px 1px rgba(21,23,25,.04);
}
.btn:hover { text-decoration: none; background: var(--solid-2); border-color: var(--ink-4); }
.btn:active { transform: translateY(1px); }
.btn svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn--primary { background: var(--red); border-color: var(--red); color: #fff; }
.btn--primary:hover { background: #C5161E; border-color: #C5161E; }
.btn--dark { background: var(--ink); border-color: var(--ink); color: var(--canvas); }
:root[data-theme="dark"] .btn--dark { background: #fff; border-color: #fff; color: #151719; }
.btn--ghost { background: transparent; border-color: transparent; box-shadow: none; }
.btn--ghost:hover { background: rgba(21,23,25,.05); border-color: transparent; }
:root[data-theme="dark"] .btn--ghost:hover { background: rgba(255,255,255,.07); }
.btn--danger { color: var(--err); border-color: color-mix(in srgb, var(--err) 35%, transparent); }
.btn--danger:hover { background: var(--err-soft); }
.btn--sm { min-height: 32px; padding: 0 11px; font-size: 13px; border-radius: 8px; }
.btn--lg { min-height: 48px; padding: 0 22px; font-size: 15px; }
.btn--block { width: 100%; }
.btn--icon { padding: 0; width: 40px; }
.btn--icon.btn--sm { width: 32px; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; pointer-events: none; }
.btn-group { display: inline-flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Formulários ---------- */
.form { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.form > [class*="col-"] { grid-column: 1 / -1; }
.form-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 14px 16px; }
.col-12 { grid-column: span 12; } .col-2 { grid-column: span 2; } .col-8 { grid-column: span 8; } .col-6 { grid-column: span 6; }
.col-4 { grid-column: span 4; } .col-3 { grid-column: span 3; } .col-9 { grid-column: span 9; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field__label { font-size: 13.5px; font-weight: 600; color: var(--ink-2); display: block; line-height: 20px; }
.field__label .help-tip { margin-left: 6px; vertical-align: top; margin-top: 1px; }
.field__label .req { color: var(--red-text); }
.field__help { font-size: 12.5px; color: var(--ink-3); line-height: 1.4; }
/* Linhas do formulário sempre alinhadas: rótulo e controle ocupam as mesmas trilhas em todos os campos da linha, mesmo que um rótulo quebre. */
@supports (grid-template-rows: subgrid) {
  .form-grid > .field:not(.field--check) { display: grid; grid-template-rows: subgrid; grid-row: span 2; row-gap: 6px; align-content: start; }
  .form-grid > .field > .field__label { align-self: end; }
}
.field__body { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field__error { font-size: 12.5px; color: var(--err); font-weight: 550; }
.input, .select, .textarea {
  width: 100%; min-height: 42px; padding: 9px 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--solid); color: var(--ink);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.input:hover, .select:hover, .textarea:hover { border-color: var(--ink-4); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 22%, transparent); }
.input[aria-invalid="true"], .select[aria-invalid="true"], .textarea[aria-invalid="true"] { border-color: var(--err); }
.input::placeholder, .textarea::placeholder { color: var(--ink-4); }
.input[type="file"] { padding: 0; height: 42px; overflow: hidden; cursor: pointer; color: var(--ink-3); font-size: 14px; }
.input[type="file"]::file-selector-button { height: 40px; margin: 0 12px 0 0; padding: 0 16px; border: 0; border-right: 1px solid var(--line); background: var(--solid-2); color: var(--ink-2); font: inherit; font-weight: 600; cursor: pointer; transition: background var(--t-fast), color var(--t-fast); }
.input[type="file"]:hover::file-selector-button { background: var(--red-soft); color: var(--red-text); }
.input--money { text-align: right; font-variant-numeric: tabular-nums; }
.textarea { min-height: 96px; resize: vertical; line-height: 1.45; }
.select { appearance: none; -webkit-appearance: none; padding-right: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23667085' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
.pw { position: relative; }
.pw .input { padding-right: 46px; }
.pw__toggle { position: absolute; top: 0; right: 0; bottom: 0; width: 44px; border: 0; background: none; color: var(--ink-3); display: grid; place-items: center; cursor: pointer; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; transition: color var(--t-fast) var(--ease); }
.pw__toggle:hover { color: var(--ink); }
.pw__toggle:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.pw__toggle svg { width: 19px; height: 19px; display: block; }
.pw__toggle span { display: grid; place-items: center; }
.pw__off { display: none !important; }
.pw__toggle[aria-pressed="true"] .pw__off { display: grid !important; }
.pw__toggle[aria-pressed="true"] .pw__on { display: none; }
.input-group { display: flex; align-items: stretch; }
.input-group .input { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.input-group__addon { display: flex; align-items: center; padding: 0 12px; border: 1px solid var(--line); border-left: 0; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; background: var(--solid-2); color: var(--ink-3); font-size: 13px; white-space: nowrap; }
.check { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--red); flex: none; }
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch__track { width: 40px; height: 24px; border-radius: 12px; background: var(--line); position: relative; transition: background var(--t-fast); flex: none; }
.switch__track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform var(--t-fast) var(--ease); }
.switch input:checked + .switch__track { background: var(--ok); }
.switch input:checked + .switch__track::after { transform: translateX(16px); }
.switch input:focus-visible + .switch__track { outline: 3px solid var(--focus); outline-offset: 2px; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; padding-top: 6px; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend { font-weight: 650; font-size: 15px; padding: 0; margin-bottom: 12px; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 16px; }
.filters .field { min-width: 160px; flex: 1 1 160px; max-width: 260px; }
.filters .field--sm { flex: 0 1 140px; min-width: 120px; }
.filters .btn { min-height: 42px; }

/* ---------- Tabelas ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--radius); }
.table { width: 100%; border-collapse: collapse; font-size: 14px; background: var(--solid); }
.table th, .table td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table th { font-size: 12.5px; font-weight: 650; color: var(--ink-3); background: var(--solid-2); white-space: nowrap; position: sticky; top: 0; z-index: 1; }
.table tbody tr:hover { background: color-mix(in srgb, var(--info) 4%, var(--solid)); }
.table tr:last-child td { border-bottom: 0; }
.table td.money, .table th.money, .table .right { text-align: right; }
.table tfoot td { font-weight: 650; background: var(--solid-2); border-top: 1px solid var(--line); }
.table .row-link { color: inherit; font-weight: 600; }
.table--compact th, .table--compact td { padding: 8px 10px; font-size: 13px; }
.table-empty { padding: 40px 20px; text-align: center; color: var(--ink-3); }
.table-actions { display: flex; gap: 6px; justify-content: flex-end; }

/* ---------- Estado / etiquetas ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: var(--radius-pill); font-size: 12px; font-weight: 650; line-height: 1.3; white-space: nowrap; background: var(--line-2); color: var(--ink-2); }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.badge--ok { background: var(--ok-soft); color: var(--ok); }
.badge--warn { background: var(--warn-soft); color: var(--warn); }
.badge--info { background: var(--info-soft); color: var(--info); }
.badge--err { background: var(--err-soft); color: var(--err); }
.badge--red { background: var(--red-soft); color: var(--red-text); }
.badge--muted { color: var(--ink-3); }
.badge--plain::before { display: none; }

.alert { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius-sm); border: 1px solid; font-size: 14px; margin-bottom: 16px; }
.alert svg { width: 18px; height: 18px; flex: none; margin-top: 1px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.alert--ok { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 30%, transparent); color: var(--ok); }
.alert--warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 30%, transparent); color: var(--warn); }
.alert--info { background: var(--info-soft); border-color: color-mix(in srgb, var(--info) 30%, transparent); color: var(--info); }
.alert--err { background: var(--err-soft); border-color: color-mix(in srgb, var(--err) 30%, transparent); color: var(--err); }
.alert strong { font-weight: 650; }
.alert a { color: inherit; text-decoration: underline; }

.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 90; display: flex; flex-direction: column; gap: 10px; max-width: min(420px, calc(100vw - 40px)); }
.toast { padding: 12px 16px; border-radius: var(--radius); border: 1px solid var(--glass-border); background: var(--glass-bg-strong); box-shadow: var(--glass-shadow); font-size: 14px; display: flex; gap: 10px; align-items: flex-start; }
.toast--ok { border-left: 3px solid var(--ok); } .toast--err { border-left: 3px solid var(--err); } .toast--warn { border-left: 3px solid var(--warn); } .toast--info { border-left: 3px solid var(--info); }
.toast__close { margin-left: auto; background: none; border: 0; color: var(--ink-3); padding: 0 2px; }

/* ---------- Indicadores (KPI) ---------- */
.kpi-grid { display: grid; grid-template-columns: repeat(12, minmax(0,1fr)); gap: 14px; }
.kpi { grid-column: span 3; padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; min-width: 0; position: relative; }
.kpi--hero { grid-column: span 6; padding: 20px 22px; }
.kpi__label { font-size: 13px; color: var(--ink-3); font-weight: 550; display: flex; align-items: center; gap: 6px; }
.kpi__value { font-size: 26px; font-weight: 650; letter-spacing: -.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi--hero .kpi__value { font-size: 34px; }
.kpi__sub { font-size: 13px; color: var(--ink-3); display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.kpi__delta { font-weight: 650; font-size: 12.5px; }
.kpi__delta--up { color: var(--ok); } .kpi__delta--down { color: var(--err); } .kpi__delta--none { color: var(--ink-4); font-weight: 500; }
.kpi__bar { height: 6px; border-radius: 3px; background: var(--line-2); overflow: hidden; margin-top: 4px; }
.kpi__bar span { display: block; height: 100%; background: var(--ok); border-radius: 3px; transition: width 600ms var(--ease); }
.kpi__help { position: absolute; top: 12px; right: 12px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: transparent; color: var(--ink-4); display: grid; place-items: center; }
.kpi__help:hover { background: var(--line-2); color: var(--ink-2); }
.kpi__help svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; }
.kpi a.kpi__link { position: absolute; inset: 0; border-radius: inherit; }
.kpi a.kpi__link:focus-visible { outline-offset: -3px; }
.kpi__split { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; margin-top: 6px; }
.kpi__split div { font-size: 13px; color: var(--ink-3); }
.kpi__split strong { display: block; color: var(--ink); font-size: 16px; font-variant-numeric: tabular-nums; }
.btn--mask .mk { display: inline-flex; align-items: center; gap: 8px; }
.btn--mask .mk--show { display: none; }
.btn--mask[aria-pressed="true"] .mk--hide { display: none; }
.btn--mask[aria-pressed="true"] .mk--show { display: inline-flex; }
.btn--mask[aria-pressed="true"] { background: var(--red-soft); border-color: transparent; color: var(--red-text); }
.kpi--masked .kpi__value, .kpi--masked .kpi__split strong { filter: blur(7px); user-select: none; }

/* ---------- Gráficos ---------- */
.chart { width: 100%; }
.chart svg { width: 100%; height: auto; display: block; font-family: var(--font); }
.chart__legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-3); margin: 8px 0 0; }
.chart__legend span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; background: var(--c); }
.chart__legend .dashed::before { background: repeating-linear-gradient(90deg, var(--c) 0 3px, transparent 3px 5px); height: 3px; vertical-align: 2px; }
.chart .axis text { fill: var(--ink-4); font-size: 11px; }
.chart .grid line { stroke: var(--line-2); }
.chart .axis line { stroke: var(--line); }
.chart .bar { transition: opacity var(--t-fast); }
.chart .bar:hover { opacity: .8; }
.chart .tip { pointer-events: none; }
.chart__empty { padding: 36px 16px; text-align: center; color: var(--ink-3); font-size: 14px; }
.chart-toggle { display: inline-flex; gap: 2px; padding: 3px; background: var(--line-2); border-radius: var(--radius-sm); }
.chart-toggle button { border: 0; background: transparent; padding: 5px 11px; border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--ink-3); }
.chart-toggle button[aria-pressed="true"] { background: var(--solid); color: var(--ink); box-shadow: 0 1px 2px rgba(21,23,25,.08); }
.chart-table { margin-top: 10px; }
.chart-table summary { cursor: pointer; font-size: 13px; color: var(--ink-3); font-weight: 550; }

/* ---------- Grid de página / painéis ---------- */
.grid { display: grid; gap: 16px; }
.grid--2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.grid--12 { grid-template-columns: repeat(12, minmax(0,1fr)); }
.span-8 { grid-column: span 8; } .span-4 { grid-column: span 4; } .span-6 { grid-column: span 6; } .span-12 { grid-column: span 12; } .span-7 { grid-column: span 7; } .span-5 { grid-column: span 5; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row--between { justify-content: space-between; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; } .mb-2 { margin-bottom: 16px; } .mb-1 { margin-bottom: 8px; }

/* Lista de definição (detalhes) */
.dl { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; font-size: 14px; margin: 0; }
.dl dt { color: var(--ink-3); } .dl dd { margin: 0; font-weight: 550; min-width: 0; overflow-wrap: anywhere; }

/* Lista de pendências / ações */
.action-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.action-list li { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line-2); font-size: 14px; }
.action-list li:last-child { border-bottom: 0; }
.action-list .count { font-size: 18px; font-weight: 650; min-width: 36px; text-align: right; font-variant-numeric: tabular-nums; }
.action-list .count--zero { color: var(--ink-4); }
.action-list .label { flex: 1; min-width: 0; }
.action-list .label small { display: block; color: var(--ink-3); }
.action-list a.btn { flex: none; }

/* Timeline de histórico */
.timeline { list-style: none; margin: 0; padding: 0 0 0 18px; border-left: 2px solid var(--line-2); display: flex; flex-direction: column; gap: 14px; }
.timeline li { position: relative; font-size: 14px; }
.timeline li::before { content: ""; position: absolute; left: -24px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--ink-4); border: 2px solid var(--solid); }
.timeline li.is-ok::before { background: var(--ok); } .timeline li.is-err::before { background: var(--err); } .timeline li.is-warn::before { background: var(--warn); }
.timeline time { display: block; font-size: 12px; color: var(--ink-3); }

/* Stepper (processos em etapas) */
.steps { display: flex; gap: 6px; list-style: none; padding: 0; margin: 0 0 20px; counter-reset: s; flex-wrap: wrap; }
.steps li { counter-increment: s; display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-3); padding: 6px 12px 6px 6px; border-radius: var(--radius-pill); background: var(--line-2); }
.steps li::before { content: counter(s); width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--solid); font-weight: 650; font-size: 12px; color: var(--ink-2); }
.steps li.is-active { background: var(--ink); color: var(--canvas); } .steps li.is-active::before { background: var(--red); color: #fff; }
.steps li.is-done { color: var(--ok); } .steps li.is-done::before { background: var(--ok); color: #fff; content: "✓"; }

/* ---------- Estado vazio ---------- */
.empty { text-align: center; padding: 48px 20px; color: var(--ink-3); }
.empty__icon { width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 16px; background: var(--line-2); display: grid; place-items: center; }
.empty__icon svg { width: 26px; height: 26px; stroke: var(--ink-3); fill: none; stroke-width: 1.8; }
.empty h3 { color: var(--ink); margin-bottom: 6px; }
.empty p { max-width: 48ch; margin: 0 auto 16px; }

/* ---------- Dropdown / menu ---------- */
.menu { position: relative; }
.menu__panel { position: absolute; right: 0; top: calc(100% + 6px); min-width: 220px; padding: 6px; z-index: 40; border-radius: var(--radius); display: none; }
.menu[open] .menu__panel, .menu.is-open .menu__panel { display: block; }
.menu__item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 11px; border: 0; background: none; border-radius: 8px; font-size: 14px; color: var(--ink); text-align: left; }
.menu__item:hover { background: rgba(21,23,25,.05); text-decoration: none; }
:root[data-theme="dark"] .menu__item:hover { background: rgba(255,255,255,.07); }
.menu__item svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; }
.menu__sep { border-top: 1px solid var(--line-2); margin: 6px 4px; }
summary.btn { list-style: none; } summary.btn::-webkit-details-marker { display: none; }

/* ---------- Modal / diálogo ---------- */
.modal { position: fixed; inset: 0; z-index: 80; display: none; align-items: center; justify-content: center; padding: 20px; background: rgba(21,23,25,.4); }
.modal.is-open { display: flex; }
.modal__panel { width: min(560px, 100%); max-height: calc(100vh - 40px); overflow: auto; border-radius: var(--radius-lg); background: var(--glass-bg-strong); border: 1px solid var(--glass-border); box-shadow: var(--glass-shadow); padding: 22px 24px; }
.modal__title { font-size: 18px; margin-bottom: 6px; }
.modal__body { font-size: 14px; color: var(--ink-2); }
.modal__actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; flex-wrap: wrap; }
dialog.modal { border: 0; padding: 20px; max-width: none; max-height: none; width: 100%; height: 100%; color: inherit; }
dialog.modal::backdrop { background: rgba(21,23,25,.4); }
dialog.modal[open] { display: flex; }

/* ---------- Tour ---------- */
.tour__backdrop { position: fixed; inset: 0; z-index: 95; background: rgba(21,23,25,.45); overflow: hidden; }
.tour__spot { position: absolute; border-radius: 12px; box-shadow: 0 0 0 9999px rgba(21,23,25,.5); pointer-events: none; transition: all 260ms var(--ease); border: 2px solid rgba(255,255,255,.7); }
.tour__card { position: fixed; z-index: 96; width: min(360px, calc(100vw - 32px)); padding: 18px 20px; border-radius: var(--radius-lg); background: var(--glass-bg-strong); border: 1px solid var(--glass-border); box-shadow: var(--glass-shadow); }
.tour__step { font-size: 12px; color: var(--ink-3); margin-bottom: 4px; font-weight: 600; }
.tour__title { font-size: 16px; margin-bottom: 6px; }
.tour__text { font-size: 14px; color: var(--ink-2); }
.tour__progress { height: 4px; border-radius: 2px; background: var(--line-2); margin: 14px 0; overflow: hidden; }
.tour__progress span { display: block; height: 100%; background: var(--red); transition: width 260ms var(--ease); }
.tour__actions { display: flex; gap: 8px; justify-content: flex-end; align-items: center; }
.tour__actions .btn--ghost { margin-right: auto; }

/* ---------- Aviso de atualização ---------- */
.update-banner { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 85; width: min(640px, calc(100vw - 32px)); padding: 14px 18px; border-radius: var(--radius-lg); display: flex; gap: 14px; align-items: center; flex-wrap: wrap; border-left: 4px solid var(--red); }
.update-banner p { margin: 0; flex: 1 1 240px; font-size: 14px; }
.update-banner .btn-group { margin-left: auto; }

/* ---------- Paginação ---------- */
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; font-size: 13px; color: var(--ink-3); flex-wrap: wrap; }
.pagination__links { display: flex; gap: 4px; }
.pagination__links a, .pagination__links span { min-width: 32px; height: 32px; padding: 0 8px; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; color: var(--ink-2); font-weight: 600; }
.pagination__links a:hover { background: var(--line-2); text-decoration: none; }
.pagination__links .is-current { background: var(--ink); color: var(--canvas); }

/* ---------- Tooltip ajuda ---------- */
.help-tip { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; border: 0; background: var(--line-2); color: var(--ink-3); font-size: 11px; font-weight: 700; cursor: help; vertical-align: -3px; }
.help-tip:hover { background: var(--ink-4); color: #fff; }

/* ---------- Login ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth__side { position: relative; overflow: hidden; background: #151719; color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; }
.auth__side::before { content: ""; position: absolute; inset: -20% -10%; background: radial-gradient(600px 400px at 20% 20%, rgba(226,27,35,.45), transparent 60%), radial-gradient(500px 500px at 90% 90%, rgba(226,27,35,.18), transparent 60%); }
.auth__side > * { position: relative; }
.auth__side h1 { font-size: clamp(28px, 3.2vw, 40px); max-width: 16ch; line-height: 1.12; letter-spacing: -.025em; margin: 18px 0 14px; }
.auth__side p { color: rgba(255,255,255,.72); max-width: 44ch; font-size: 15px; }
.auth__stroke { position: absolute; right: -8%; top: 10%; width: 48%; height: 80%; background: linear-gradient(160deg, transparent 46%, rgba(226,27,35,.9) 46.5%, rgba(226,27,35,.9) 53%, transparent 53.5%); opacity: .55; pointer-events: none; }
.auth__main { position: relative; display: flex; align-items: center; justify-content: center; padding: 32px 24px; }
.auth__ver { font-size: 12.5px; color: rgba(255,255,255,.5); }
.auth__theme { position: absolute; top: 20px; right: 20px; display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: var(--radius-pill); background: var(--solid); }
.auth__theme button { width: 34px; height: 34px; border: 0; background: none; border-radius: var(--radius-pill); color: var(--ink-3); display: grid; place-items: center; cursor: pointer; transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease); }
.auth__theme button:hover { color: var(--ink); }
.auth__theme button[aria-pressed="true"] { background: var(--red-soft); color: var(--red-text); }
.auth__theme button:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.auth__theme svg { width: 17px; height: 17px; }
/* Tela de entrada no tema claro: painel lateral claro */
:root[data-theme="light"] .auth__side { background: linear-gradient(160deg, #fff 0%, #EEF0F4 100%); color: var(--ink); border-right: 1px solid var(--line-2); }
:root[data-theme="light"] .auth__side::before { background: radial-gradient(600px 400px at 20% 20%, rgba(226,27,35,.13), transparent 60%), radial-gradient(500px 500px at 90% 90%, rgba(226,27,35,.07), transparent 60%); }
:root[data-theme="light"] .auth__side p { color: var(--ink-2); }
:root[data-theme="light"] .auth__side .auth__ver { color: var(--ink-3); }
:root[data-theme="light"] .auth__stroke { opacity: .4; }
.auth__box { width: min(420px, 100%); }
.auth__box .cn-brand { margin-bottom: 26px; --cn-brand-width: 220px; }
.auth__box h2 { font-size: 22px; margin-bottom: 4px; }
.auth__box .lead { color: var(--ink-3); margin-bottom: 22px; }
.auth__foot { margin-top: 26px; font-size: 12.5px; color: var(--ink-4); display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.code-input { font-family: var(--font-mono); font-size: 22px; letter-spacing: .35em; text-align: center; }
.recovery-codes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; font-family: var(--font-mono); font-size: 15px; padding: 14px; background: var(--solid-2); border: 1px dashed var(--line); border-radius: var(--radius-sm); }
.qr { width: 196px; height: 196px; padding: 10px; background: #fff; border-radius: var(--radius-sm); border: 1px solid var(--line); margin: 0 auto 12px; }
.qr svg, .qr canvas, .qr img { width: 100%; height: 100%; }

/* ---------- Impressão ---------- */
.print-only { display: none; }
/* Voltar sempre visível (barra superior) */
.topbar__back { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 14px 0 10px; border: 1px solid var(--line); border-radius: var(--radius-pill); background: var(--solid); color: var(--ink); font-size: 14px; font-weight: 600; text-decoration: none; flex: none; transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease); }
.topbar__back:hover { background: var(--solid-2); border-color: var(--ink-4); text-decoration: none; }
.topbar__back svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.topbar__back.is-disabled { opacity: .45; pointer-events: none; }
.topbar__back:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
/* Visualizador de impressão / PDF: sobrepõe só o conteúdo; menu lateral e barra superior continuam visíveis */
.pmodal { position: fixed; z-index: 70; top: var(--topbar-h); left: var(--sidebar-w); right: 0; bottom: 0; display: flex; flex-direction: column; background: var(--canvas); border-left: 1px solid var(--line-2); }
.pmodal__bar { height: 64px; flex: none; display: flex; align-items: center; gap: 14px; padding: 0 var(--gutter); background: var(--solid); border-bottom: 1px solid var(--line-2); }
.pmodal__bar .btn { height: 40px; flex: none; }
.pmodal__bar .btn svg { width: 18px; height: 18px; }
.pmodal__title { flex: 1; min-width: 0; font-size: 15px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pmodal__stage { flex: 1; min-height: 0; overflow: auto; padding: 22px var(--gutter) 28px; display: flex; justify-content: center; }
.pmodal__loading { align-self: center; color: var(--ink-3); font-size: 14px; }
.pmodal__frame { width: min(1040px, 100%); min-height: 100%; height: 100%; border: 0; border-radius: var(--radius-sm); background: #fff; box-shadow: var(--glass-shadow); }
@media (max-width: 1023px) { .pmodal { left: 0; bottom: var(--tabbar-h); border-left: 0; } }
@media (max-width: 639px) { .pmodal__bar { height: 56px; gap: 10px; padding: 0 14px; } .pmodal__stage { padding: 12px 10px 16px; } .topbar__back span { display: none; } .topbar__back { width: 40px; padding: 0; justify-content: center; } .pmodal__bar .btn--primary { padding: 0 12px; font-size: 13px; } }
@media print { .pmodal { display: none !important; } }

@media print {
  body { background: #fff; color: #000; font-size: 11pt; }
  body::before, .sidebar, .topbar, .tabbar, .page-head__actions, .filters, .btn, .toasts, .update-banner, .no-print, .kpi__help { display: none !important; }
  .app { display: block; }
  .main { padding: 0; max-width: none; }
  .card, .glass { box-shadow: none; border: 1px solid #ccc; background: #fff; backdrop-filter: none; }
  .print-only { display: block; }
  .table th { position: static; background: #f2f2f2; color: #000; }
  a { color: inherit; }
  @page { size: A4; margin: 14mm; }
}

/* ---------- Movimento reduzido ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ==========================================================================
   Responsivo — celular não é desktop encolhido
   ========================================================================== */
@media (max-width: 1180px) {
  :root { --sidebar-w: 232px; --gutter: 22px; }
  .kpi { grid-column: span 4; }
  .kpi--hero { grid-column: span 6; }
  .span-8, .span-4, .span-7, .span-5 { grid-column: span 12; }
}

@media (max-width: 1023px) {
  :root { --gutter: 18px; --topbar-h: 58px; }
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar { display: none; }
  .topbar__brand { display: block; width: 40px; }
  .topbar__brand .cn-brand { --cn-brand-width: 40px; --cn-brand-symbol-size: 34px; }
  .topbar__brand .cn-brand__variant--horizontal, .topbar__brand .cn-brand__variant--compacto { display: none; }
  .topbar__brand .cn-brand__variant--simbolo { display: block; }
  .main { padding-bottom: calc(var(--tabbar-h) + 28px); }
  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    height: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
    background: var(--glass-bg); border-top: 1px solid var(--glass-border);
  }
  .tabbar a, .tabbar button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11px; font-weight: 600; color: var(--ink-3); border: 0; background: none; text-decoration: none; padding: 6px 2px; min-height: 48px; }
  .tabbar svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .tabbar [aria-current="page"] { color: var(--red-text); }
  .kpi { grid-column: span 6; }
  .kpi--hero { grid-column: span 12; }
  .grid--3 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .col-8, .col-4, .col-3, .col-9, .col-2 { grid-column: span 6; }
  .sheet { position: fixed; inset: 0; z-index: 70; display: none; }
  .sheet.is-open { display: block; }
  .sheet__backdrop { position: absolute; inset: 0; background: rgba(21,23,25,.4); }
  .sheet__panel { position: absolute; left: 0; right: 0; bottom: 0; max-height: 82vh; overflow: auto; border-radius: 20px 20px 0 0; padding: 12px 14px calc(16px + env(safe-area-inset-bottom)); background: var(--glass-bg-strong); }
  .sheet__handle { width: 40px; height: 4px; border-radius: 2px; background: var(--line); margin: 0 auto 12px; }
  .sheet .nav__item { min-height: 48px; font-size: 15px; }
}

@media (max-width: 639px) {
  :root { --gutter: 16px; }
  body { font-size: 15px; }
  h1 { font-size: 22px; }
  .main { padding-top: 18px; }
  .page-head { margin-bottom: 16px; }
  .page-head__actions { width: 100%; }
  .page-head__actions .btn { flex: 1 1 auto; }
  .kpi { grid-column: span 6; padding: 14px 14px; }
  .kpi__value { font-size: 21px; }
  .kpi__label { font-size: 12.5px; }
  .kpi__sub { font-size: 12px; }
  .kpi--hero .kpi__value { font-size: 30px; }
  .grid--2, .grid--3 { grid-template-columns: 1fr; }
  .col-8, .col-6, .col-4, .col-3, .col-9, .col-2 { grid-column: span 12; }
  .form-grid { gap: 12px; }
  .input, .select, .textarea, .btn { min-height: 46px; }
  .btn--sm { min-height: 36px; }
  .filters .field { max-width: none; flex-basis: 100%; }
  .filters.filters--collapsed > .field:nth-of-type(n+2), .filters.filters--collapsed > .btn:not(.filters__toggle), .filters.filters--collapsed > a { display: none; }
  .filters__toggle { flex-basis: 100%; }
  .card__head { padding: 14px 16px 0; flex-wrap: wrap; } .card__body { padding: 12px 16px 16px; }
  .toasts { left: 16px; right: 16px; bottom: calc(var(--tabbar-h) + 12px); max-width: none; }
  .update-banner { bottom: calc(var(--tabbar-h) + 12px); }
  .dl { grid-template-columns: 1fr; gap: 2px 0; } .dl dt { margin-top: 8px; font-size: 12.5px; }
  .modal { padding: 0; align-items: flex-end; }
  .modal__panel { width: 100%; border-radius: 20px 20px 0 0; max-height: 92vh; }
  /* Tabelas responsivas: cada linha vira um cartão com rótulos (data-label) */
  .table--cards thead { display: none; }
  .table--cards, .table--cards tbody, .table--cards tr, .table--cards td { display: block; width: 100%; }
  .table--cards tr { padding: 10px 14px; border-bottom: 1px solid var(--line-2); }
  .table--cards td { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; border: 0; text-align: right; }
  .table--cards td::before { content: attr(data-label); color: var(--ink-3); font-size: 12.5px; font-weight: 600; text-align: left; flex: none; }
  .table--cards td.td-title { font-weight: 650; font-size: 15px; justify-content: flex-start; text-align: left; padding-bottom: 6px; }
  .table--cards td.td-title::before { display: none; }
  .table--cards td.td-actions { justify-content: flex-end; padding-top: 8px; } .table--cards td.td-actions::before { display: none; }
  .table--cards tfoot { display: none; }
  .steps { gap: 4px; } .steps li { padding: 4px 8px 4px 4px; font-size: 12px; }
}

@media (min-width: 640px) and (max-width: 1023px) {
  .kpi { grid-column: span 6; }
}

/* Contraste alto / modo forçado */
@media (forced-colors: active) {
  .glass, .card, .btn, .input, .select, .textarea { border: 1px solid CanvasText; }
  .nav__item[aria-current="page"]::before { background: Highlight; }
}

/* ---------- Assistente bancário ---------- */
.wiz { display: grid; gap: 12px; }
.wiz-steps a { color: inherit; text-decoration: none; }
.wiz__step { padding: 0; overflow: hidden; }
.wiz__head { display: flex; align-items: center; gap: 14px; min-height: 64px; padding: 12px 18px; cursor: pointer; list-style: none; }
.wiz__head::-webkit-details-marker { display: none; }
.wiz__num { flex: 0 0 32px; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-weight: 650; font-size: 14px; background: var(--line-2); color: var(--ink-2); }
.wiz__num--ok { background: var(--ok); color: #fff; } .wiz__num--erro { background: var(--red); color: #fff; }
.wiz__title { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.wiz__title .small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wiz__body { padding: 4px 18px 20px 64px; border-top: 1px solid var(--line-2); padding-top: 16px; }
.wiz__body .form-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-start; }
.copybox { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--solid); }
.copybox code { flex: 1; min-width: 0; word-break: break-all; font-size: 13px; }
@media (max-width: 639px) { .wiz__body { padding: 14px 16px 18px; } .wiz__head { padding: 10px 14px; gap: 10px; } }

/* ---------- Centros de custo padrão ---------- */
.cc-padroes .card__head { align-items: center; gap: 16px; flex-wrap: wrap; }
.cc-areas { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; }
@media (min-width: 1000px) { .cc-area--destaque { grid-column: span 2; } }
.cc-area { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; background: var(--solid-2); display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.cc-area--destaque { background: var(--red-soft); border-color: color-mix(in srgb, var(--red-text) 28%, transparent); }
.cc-area__head { display: flex; align-items: center; gap: 8px; min-height: 28px; font-size: 14px; }
.cc-area__ico { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--solid); color: var(--red-text); border: 1px solid var(--line); flex: none; }
.cc-area__ico svg { width: 16px; height: 16px; }
.cc-area__head form { margin-left: auto; }
.cc-area__all { border: 0; background: none; padding: 0; color: var(--red-text); font-weight: 600; font-size: 12.5px; cursor: pointer; }
.cc-area__all:hover { text-decoration: underline; }
.cc-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.cc-chips form { display: contents; }
.cc-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 12px; border-radius: var(--radius-pill); border: 1px solid var(--line); background: var(--solid); color: var(--ink); font: inherit; font-size: 13.5px; font-weight: 550; line-height: 1; white-space: nowrap; max-width: 100%; cursor: pointer; transition: border-color var(--t-fast), background var(--t-fast), color var(--t-fast), transform var(--t-fast); }
.cc-chip svg { width: 14px; height: 14px; flex: none; }
button.cc-chip:hover { border-color: var(--red-text); color: var(--red-text); transform: translateY(-1px); }
button.cc-chip:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.cc-chip.is-done { background: transparent; border-style: dashed; color: var(--ink-3); cursor: default; }

/* ---------- Acesso e segurança (Configurações) ---------- */
.acesso-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 24px; }
.opt-group { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.opt-group legend { padding: 0; margin-bottom: 4px; }
.opt { min-height: 84px; box-sizing: border-box; display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--solid); cursor: pointer; transition: border-color var(--t-fast), background var(--t-fast); }
.opt:hover { border-color: var(--ink-4); }
.opt input { margin-top: 3px; accent-color: var(--red-text); flex: none; }
.opt span { display: flex; flex-direction: column; gap: 2px; font-size: 14px; }
.opt small { color: var(--ink-3); font-size: 12.5px; line-height: 1.4; }
.opt.is-on, .opt:has(input:checked) { border-color: var(--red-text); background: var(--red-soft); }
.opt--warn.is-on, .opt--warn:has(input:checked) { border-color: var(--warn, #b7791f); background: color-mix(in srgb, var(--warn, #b7791f) 12%, var(--solid)); }
.alert--testmode { margin-bottom: 16px; }

/* ---------- Cadastro rápido (v1.0.011): “+ Novo” ao lado do campo, janela e menu do topo ---------- */
.quick-add { float: right; display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 9px 0 6px; border: 0; border-radius: 10px; background: var(--red-soft); color: var(--red-text); font: inherit; font-size: 12px; font-weight: 700; line-height: 20px; cursor: pointer; white-space: nowrap; }
.quick-add svg { width: 12px; height: 12px; stroke: currentColor; fill: none; stroke-width: 2.6; flex: none; }
.quick-add:hover { background: var(--red-text); color: #fff; }
.quick-add:focus-visible { outline: 2px solid var(--red-text); outline-offset: 2px; }
.qm__panel { width: min(680px, 100%); padding: 0; overflow: auto; }
.qm__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px 0 22px; }
.qm__head .modal__title { margin: 0; }
.qm__body { padding: 10px 22px 20px; }
.qm__alert { margin: 0 0 12px; padding: 10px 14px; border-radius: var(--radius-sm); background: var(--err-soft, #fde8e8); color: var(--err, #b42318); font-size: 13.5px; font-weight: 600; }
.qm__hint { display: flex; align-items: flex-start; gap: 8px; margin: 0; font-size: 12.5px; color: var(--ink-3); line-height: 1.45; }
.qm__hint svg { width: 15px; height: 15px; flex: none; margin-top: 1px; stroke: currentColor; fill: none; stroke-width: 2; }
.qm__actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.menu__head { display: flex; flex-direction: column; padding: 8px 11px 6px; font-size: 13.5px; font-weight: 700; }
.menu__head small { font-size: 12px; font-weight: 500; color: var(--ink-3); }
.menu--novo .menu__panel { background: var(--solid); min-width: 240px; box-shadow: 0 16px 40px -12px rgba(21,23,25,.28); }
.menu--novo > summary svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 2.6; }
@media (max-width: 639px) {
  .menu--novo > summary span { display: none; }
  .menu--novo > summary { width: 40px; padding: 0; justify-content: center; min-height: 40px; }
  .quick-add { height: 26px; line-height: 26px; margin: -3px 0; }
  .qm__body { padding: 8px 16px calc(18px + env(safe-area-inset-bottom)); }
  .qm__head { padding: 14px 12px 0 16px; }
  .qm__actions .btn { flex: 1 1 auto; }
}

/* ---------- CEP com busca automática (v1.0.011): ícone de estado dentro do campo, sem alterar a altura da linha ---------- */
.field__body--cep { position: relative; }
.field__body--cep > .input[data-mask="cep"] { padding-right: 38px; }
.cep-ind { position: absolute; right: 12px; top: 0; height: 42px; width: 18px; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.cep-ind[data-state="load"]::before { content: ""; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--focus); animation: cep-spin .7s linear infinite; }
.cep-ind[data-state="ok"]::before { content: "✓"; color: var(--ok); font-weight: 700; font-size: 15px; line-height: 1; }
.cep-ind[data-state="warn"]::before, .cep-ind[data-state="err"]::before { content: "!"; color: var(--warn); font-weight: 800; font-size: 15px; line-height: 1; pointer-events: auto; cursor: pointer; }
.cep-ind[data-state="err"]::before { color: var(--err); }
.cep-ind[data-state="warn"], .cep-ind[data-state="err"] { pointer-events: auto; cursor: pointer; }
@keyframes cep-spin { to { transform: rotate(360deg); } }
.is-autofilled { animation: cep-fill 1.4s ease-out 1; }
@keyframes cep-fill { 0% { background: var(--ok-soft); border-color: var(--ok); } 100% { background: var(--solid); } }
@media (prefers-reduced-motion: reduce) { .cep-ind[data-state="load"]::before { animation-duration: 1.6s; } .is-autofilled { animation: none; } }

/* ===== Usuários: formulário guiado, lista com busca e ações (v1.0.019) ===== */
.uf { display: grid; gap: 16px; max-width: 920px; }
.uf__actions { padding-top: 0; }
.role-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.role-opt { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; min-height: 92px; border: 1.5px solid var(--line); border-radius: var(--radius-sm); background: var(--solid); cursor: pointer; transition: border-color var(--t-fast), background var(--t-fast); }
.role-opt:hover { border-color: var(--ink-4); }
.role-opt input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.role-opt__t { font-weight: 650; font-size: 14.5px; color: var(--ink); }
.role-opt__d { font-size: 12.5px; line-height: 1.4; color: var(--ink-3); }
.role-opt.is-on { border-color: var(--red); background: var(--red-soft); }
.role-opt:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }
.emp-list { display: grid; gap: 8px; }
.adv > summary, .pg > summary { cursor: pointer; list-style: none; }
.adv > summary::-webkit-details-marker, .pg > summary::-webkit-details-marker { display: none; }
.adv > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; }
.adv > summary::after { content: "▾"; color: var(--ink-3); transition: transform var(--t-fast); }
.adv[open] > summary::after { transform: rotate(180deg); }
.adv[open] > summary { border-bottom: 1px solid var(--line-2); }
.pg { border-bottom: 1px solid var(--line-2); padding: 4px 0; }
.pg > summary { display: flex; align-items: center; gap: 8px; padding: 9px 0; font-weight: 600; font-size: 13.5px; }
.pg > summary::before { content: "▸"; color: var(--ink-3); width: 12px; }
.pg[open] > summary::before { content: "▾"; }
.pg__row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 0 6px 20px; }
.pg__row .select { width: 124px; min-height: 34px; padding: 3px 28px 3px 8px; font-size: 13px; flex: none; }
.ul-bar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line-2); }
.ul-bar .input { flex: 1 1 260px; min-width: 0; }
.ul-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border: 1px solid var(--line); border-radius: var(--radius-pill); background: var(--solid); color: var(--ink-2); font: inherit; font-size: 13.5px; font-weight: 550; cursor: pointer; }
.chip span { color: var(--ink-3); font-weight: 500; }
.chip.is-on { background: var(--ink); border-color: var(--ink); color: var(--solid); }
.chip.is-on span { color: inherit; opacity: .75; }
.acts { display: grid; gap: 0; }
.acts__g { margin: 14px 0 4px; font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); font-weight: 650; }
.acts__g:first-child { margin-top: 0; }
.act { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--line-2); }
.act > div { min-width: 0; display: grid; gap: 2px; }
.act b { font-size: 14px; font-weight: 600; }
.act span { font-size: 12.5px; line-height: 1.4; color: var(--ink-3); }
.act .btn { flex: none; min-width: 104px; justify-content: center; }
@media (max-width: 640px) {
  .role-grid { grid-template-columns: 1fr 1fr; }
  .act { flex-wrap: wrap; }
  .act .btn { width: 100%; }
  .pg__row { padding-left: 8px; }
  .adv > summary { padding: 14px 16px; }
}
@media (max-width: 640px) { .role-opt:last-child:nth-child(odd) { grid-column: 1 / -1; } }

/* ===== Comunicados (admin): prévia ao vivo ===== */
.cm-prev { border: 1px solid var(--line-2); border-left: 4px solid var(--info); border-radius: var(--radius-sm); background: var(--solid-2); padding: 16px 18px; }
.cm-prev__meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.cm-prev__t { margin: 0 0 6px; font-size: 16px; line-height: 1.3; overflow-wrap: anywhere; }
.cm-prev__c { margin: 0; font-size: 14px; line-height: 1.55; color: var(--ink-2); white-space: pre-line; overflow-wrap: anywhere; }
.cm-prev .is-empty { color: var(--ink-4); font-weight: 450; }
