/* ═══════════════════════════════════════════════════════════════
   ISODocs — Design System v2 (claro / escuro)
   ═══════════════════════════════════════════════════════════════ */
:root, [data-bs-theme="light"] {
  --brand: #1a56db;
  --brand-600: #1748b8;
  --brand-50: #eef4ff;
  --brand-100: #dbe7ff;
  --gold: #f59e0b;
  --gold-50: #fff7e6;
  --ok: #16a34a;   --ok-50: #eafaf0;
  --warn: #d97706; --warn-50: #fff6e5;
  --bad: #dc2626;  --bad-50: #fdecec;
  --info: #0891b2; --info-50: #e7f8fb;
  --violet: #7c3aed; --violet-50: #f3edff;

  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --surface-3: #f1f5f9;
  --border: #e5e9f0;
  --border-strong: #d5dbe5;
  --text: #0f172a;
  --text-2: #475569;
  --text-3: #8a94a6;
  --sidebar-bg: #ffffff;
  --sidebar-text: #475569;
  --sidebar-active-bg: #eef4ff;
  --sidebar-active-text: #1a56db;
  --shadow-sm: 0 1px 2px rgba(15,23,42,.05);
  --shadow: 0 1px 3px rgba(15,23,42,.06), 0 6px 16px -6px rgba(15,23,42,.08);
  --shadow-lg: 0 20px 45px -12px rgba(15,23,42,.18);
  --radius: 14px;
  --radius-sm: 10px;
  --sidebar-w: 264px;
  --sidebar-w-mini: 76px;
  --topbar-h: 64px;

  --bs-body-bg: var(--bg);
  --bs-body-color: var(--text);
  --bs-border-color: var(--border);
  --bs-primary: #1a56db;
  --bs-primary-rgb: 26,86,219;
  --bs-link-color: #1a56db;
  --bs-link-color-rgb: 26,86,219;
  --bs-secondary-color: var(--text-2);
  --bs-tertiary-bg: var(--surface-2);
  --bs-font-sans-serif: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

[data-bs-theme="dark"] {
  --brand: #4f8bff;
  --brand-600: #6b9dff;
  --brand-50: rgba(79,139,255,.12);
  --brand-100: rgba(79,139,255,.22);
  --gold: #fbbf24;
  --gold-50: rgba(251,191,36,.12);
  --ok: #34d399;   --ok-50: rgba(52,211,153,.12);
  --warn: #fbbf24; --warn-50: rgba(251,191,36,.12);
  --bad: #f87171;  --bad-50: rgba(248,113,113,.12);
  --info: #22d3ee; --info-50: rgba(34,211,238,.12);
  --violet: #a78bfa; --violet-50: rgba(167,139,250,.14);

  --bg: #0b1120;
  --surface: #111a2e;
  --surface-2: #0f172a;
  --surface-3: #172238;
  --border: #1f2b44;
  --border-strong: #2a3957;
  --text: #e6ebf5;
  --text-2: #a3b0c7;
  --text-3: #6b7a95;
  --sidebar-bg: #0d1526;
  --sidebar-text: #a3b0c7;
  --sidebar-active-bg: rgba(79,139,255,.14);
  --sidebar-active-text: #8fb4ff;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.3);
  --shadow: 0 1px 3px rgba(0,0,0,.35), 0 8px 24px -8px rgba(0,0,0,.45);
  --shadow-lg: 0 24px 50px -12px rgba(0,0,0,.6);

  --bs-body-bg: var(--bg);
  --bs-body-color: var(--text);
  --bs-border-color: var(--border);
  --bs-primary: #4f8bff;
  --bs-primary-rgb: 79,139,255;
  --bs-link-color: #6b9dff;
  --bs-link-color-rgb: 107,157,255;
  --bs-secondary-color: var(--text-2);
  --bs-tertiary-bg: var(--surface-2);
  --bs-secondary-bg: var(--surface-3);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; }
body {
  font-family: var(--bs-font-sans-serif);
  background: var(--bg);
  color: var(--text);
  font-size: .925rem;
  letter-spacing: -.003em;
}
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-600); }
h1,h2,h3,h4,h5,h6 { color: var(--text); letter-spacing: -.02em; font-weight: 700; }
.text-muted, .text-secondary { color: var(--text-2) !important; }
.text-3 { color: var(--text-3) !important; }
.fw-800 { font-weight: 800; }
::selection { background: var(--brand-100); }

/* ── Shell ─────────────────────────────────────────────────────── */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 1040;
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  transition: width .22s ease, transform .22s ease;
}
.sidebar-brand {
  height: var(--topbar-h);
  display: flex; align-items: center; gap: .7rem;
  padding: 0 1.25rem; flex-shrink: 0;
  color: var(--text); font-weight: 800; font-size: 1.12rem; letter-spacing: -.03em;
}
.sidebar-brand:hover { color: var(--text); }
.sidebar-brand small { display:block; font-size:.66rem; font-weight:600; color: var(--text-3); letter-spacing:.04em; text-transform: uppercase; margin-top:-2px }
.sidebar-nav { flex: 1; overflow-y: auto; padding: .5rem .75rem 1rem; scrollbar-width: thin; }
.nav-section {
  font-size: .68rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--text-3); padding: 1rem .75rem .4rem; white-space: nowrap;
}
.nav-item-link {
  display: flex; align-items: center; gap: .75rem;
  padding: .58rem .75rem; margin: 1px 0;
  border-radius: 10px; color: var(--sidebar-text);
  font-weight: 500; font-size: .89rem; white-space: nowrap;
  position: relative; transition: background .15s, color .15s;
}
.nav-item-link i { width: 20px; text-align: center; font-size: .95rem; opacity: .9; flex-shrink: 0; }
.nav-item-link:hover { background: var(--surface-3); color: var(--text); }
.nav-item-link.active { background: var(--sidebar-active-bg); color: var(--sidebar-active-text); font-weight: 600; }
.nav-item-link.active::before { content:''; position:absolute; left:-.75rem; top:20%; bottom:20%; width:3px; border-radius:0 3px 3px 0; background: var(--brand); }
.nav-item-link .nav-badge {
  margin-left: auto; font-size: .68rem; font-weight: 700;
  background: var(--bad); color: #fff; border-radius: 99px; padding: .1rem .45rem;
}
.nav-item-link .nav-pill {
  margin-left: auto; font-size: .62rem; font-weight: 700; letter-spacing: .03em;
  background: var(--gold-50); color: var(--warn); border-radius: 99px; padding: .12rem .45rem;
}
.sidebar-foot { padding: .9rem; border-top: 1px solid var(--border); }

.access-mini {
  border-radius: 12px; padding: .85rem; background: var(--surface-2);
  border: 1px solid var(--border);
}
.access-mini .bar { height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; margin: .5rem 0 .35rem; }
.access-mini .bar span { display:block; height:100%; border-radius: 99px; background: linear-gradient(90deg, var(--brand), #60a5fa); }

.main { flex: 1; min-width: 0; margin-left: var(--sidebar-w); display: flex; flex-direction: column; transition: margin-left .22s ease; }
.topbar {
  position: sticky; top: 0; z-index: 1030;
  height: var(--topbar-h);
  display: flex; align-items: center; gap: .75rem;
  padding: 0 1.5rem;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.content { padding: 1.75rem 1.75rem 3rem; flex: 1; width: 100%; max-width: 1440px; margin: 0 auto; }

.icon-btn {
  width: 40px; height: 40px; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-2);
  position: relative; transition: all .15s; flex-shrink: 0;
}
.icon-btn:hover { color: var(--text); border-color: var(--border-strong); background: var(--surface-2); }
.icon-btn .dot { position: absolute; top: 8px; right: 9px; width: 8px; height: 8px; border-radius: 50%; background: var(--bad); box-shadow: 0 0 0 2px var(--surface); }

.top-search {
  flex: 1; max-width: 460px; position: relative;
}
.top-search input {
  width: 100%; height: 40px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface);
  padding: 0 .9rem 0 2.4rem; color: var(--text); font-size: .88rem;
}
.top-search input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-50); }
.top-search > i { position: absolute; left: .9rem; top: 50%; transform: translateY(-50%); color: var(--text-3); font-size: .85rem; }
.top-search kbd { position:absolute; right:.6rem; top:50%; transform:translateY(-50%); background: var(--surface-3); color: var(--text-3); border:1px solid var(--border); font-size:.68rem; padding:.1rem .35rem; border-radius:5px; }

.user-chip { display: flex; align-items: center; gap: .6rem; padding: .25rem .5rem .25rem .25rem; border-radius: 12px; border: 1px solid transparent; color: var(--text); }
.user-chip:hover { background: var(--surface); border-color: var(--border); color: var(--text); }
.avatar {
  width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .8rem; color: #fff;
  background: linear-gradient(135deg, #3b82f6, #1e40af);
}
.avatar.lg { width: 56px; height: 56px; border-radius: 14px; font-size: 1.1rem; }
.avatar.sm { width: 30px; height: 30px; border-radius: 8px; font-size: .7rem; }

/* Sidebar recolhida (desktop) */
.sidebar-mini .sidebar { width: var(--sidebar-w-mini); }
.sidebar-mini .main { margin-left: var(--sidebar-w-mini); }
.sidebar-mini .sidebar .hide-mini { display: none !important; }
.sidebar-mini .sidebar .nav-section { font-size: 0; padding: .6rem 0; border-top: 1px solid var(--border); margin: .4rem .5rem 0; }
.sidebar-mini .sidebar .nav-item-link { justify-content: center; padding: .65rem; }
.sidebar-mini .sidebar .nav-item-link i { font-size: 1.05rem; }
.sidebar-mini .sidebar .nav-item-link .nav-badge { position: absolute; top: 3px; right: 6px; padding: .05rem .32rem; font-size: .58rem; }
.sidebar-mini .sidebar .sidebar-brand { justify-content: center; padding: 0; }

.sidebar-backdrop { display: none; }
@media (max-width: 991.98px) {
  .sidebar { transform: translateX(-100%); width: var(--sidebar-w) !important; box-shadow: var(--shadow-lg); }
  .sidebar-open .sidebar { transform: none; }
  .main, .sidebar-mini .main { margin-left: 0 !important; }
  .sidebar-mini .sidebar .hide-mini { display: initial !important; }
  .sidebar-open .sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(2,6,23,.5); z-index: 1035; }
  .content { padding: 1.25rem 1rem 2.5rem; }
  .topbar { padding: 0 1rem; }
}

/* ── Componentes ───────────────────────────────────────────────── */
.card, .panel {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
  --bs-card-bg: var(--surface); --bs-card-border-color: var(--border);
  color: var(--text);
}
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.1rem 1.25rem; border-bottom: 1px solid var(--border); }
.panel-head h3, .panel-head h5, .panel-head .title { margin: 0; font-size: 1rem; font-weight: 700; }
.panel-body { padding: 1.25rem; }
.card-hover { transition: transform .18s ease, box-shadow .18s ease, border-color .18s; }
.card-hover:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--border-strong); }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.page-head h1 { font-size: 1.6rem; margin: 0; font-weight: 800; letter-spacing: -.03em; }
.page-head p { margin: .3rem 0 0; color: var(--text-2); }
.eyebrow { font-size: .72rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--brand); }

.kpi { padding: 1.15rem 1.25rem; }
.kpi .kpi-label { color: var(--text-2); font-size: .8rem; font-weight: 600; display:flex; align-items:center; gap:.5rem }
.kpi .kpi-value { font-size: 1.75rem; font-weight: 800; letter-spacing: -.03em; line-height: 1.15; margin-top: .35rem; color: var(--text); }
.kpi .kpi-foot { font-size: .78rem; color: var(--text-3); margin-top: .3rem; }
.kpi-icon { width: 40px; height: 40px; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center; font-size: 1rem; flex-shrink: 0; }

.tone-brand  { background: var(--brand-50);  color: var(--brand); }
.tone-ok     { background: var(--ok-50);     color: var(--ok); }
.tone-warn   { background: var(--warn-50);   color: var(--warn); }
.tone-bad    { background: var(--bad-50);    color: var(--bad); }
.tone-info   { background: var(--info-50);   color: var(--info); }
.tone-violet { background: var(--violet-50); color: var(--violet); }
.tone-gold   { background: var(--gold-50);   color: var(--gold); }

.chip { display: inline-flex; align-items: center; gap: .35rem; font-size: .72rem; font-weight: 600; padding: .22rem .6rem; border-radius: 99px; white-space: nowrap; }
.chip-dot::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.progress-thin { height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.progress-thin > span { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--brand), #60a5fa); transition: width .6s ease; }
.progress-thin.ok > span { background: linear-gradient(90deg, #16a34a, #4ade80); }

.ring { --p: 0; --c: var(--brand); --size: 120px; width: var(--size); height: var(--size); border-radius: 50%;
  background: conic-gradient(var(--c) calc(var(--p) * 1%), var(--surface-3) 0);
  display: grid; place-items: center; position: relative; flex-shrink: 0; }
.ring::after { content: ''; position: absolute; inset: 10px; border-radius: 50%; background: var(--surface); }
.ring > * { position: relative; z-index: 1; text-align: center; }

.empty { text-align: center; padding: 3rem 1rem; color: var(--text-2); }
.empty .empty-icon { width: 64px; height: 64px; border-radius: 18px; display: inline-flex; align-items: center; justify-content: center; font-size: 1.5rem; margin-bottom: 1rem; }

/* Botões */
.btn { font-weight: 600; border-radius: 10px; font-size: .88rem; padding: .55rem 1rem; }
.btn-sm { border-radius: 8px; font-size: .8rem; padding: .35rem .7rem; }
.btn-lg { border-radius: 12px; padding: .8rem 1.4rem; font-size: 1rem; }
.btn-primary { --bs-btn-bg: #1a56db; --bs-btn-border-color: #1a56db; --bs-btn-hover-bg: #1748b8; --bs-btn-hover-border-color: #1748b8; --bs-btn-active-bg: #133c9a; box-shadow: 0 1px 2px rgba(26,86,219,.3), inset 0 1px 0 rgba(255,255,255,.12); }
.btn-soft { background: var(--brand-50); color: var(--brand); border: 1px solid transparent; }
.btn-soft:hover { background: var(--brand-100); color: var(--brand); }
.btn-ghost { background: transparent; color: var(--text-2); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); border-color: var(--border-strong); }
.btn-gold { background: linear-gradient(135deg, #f59e0b, #d97706); color: #fff; border: 0; box-shadow: 0 6px 18px -6px rgba(217,119,6,.6); }
.btn-gold:hover { color: #fff; filter: brightness(1.05); }
.btn-pix { background: #32bcad; color: #fff; border: 0; }
.btn-pix:hover { background: #2aa395; color: #fff; }

/* Formulários */
.form-control, .form-select {
  border-radius: 10px; border-color: var(--border); background-color: var(--surface);
  color: var(--text); font-size: .9rem; padding: .58rem .85rem;
}
.form-control:focus, .form-select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-50); background-color: var(--surface); color: var(--text); }
.form-control::placeholder { color: var(--text-3); }
.form-label { font-weight: 600; font-size: .82rem; color: var(--text-2); margin-bottom: .35rem; }
.input-group-text { background: var(--surface-2); border-color: var(--border); color: var(--text-3); border-radius: 10px; }
.form-check-input { border-color: var(--border-strong); }
.form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }

/* Tabelas */
.table { --bs-table-bg: transparent; --bs-table-color: var(--text); --bs-table-border-color: var(--border); --bs-table-hover-bg: var(--surface-2); --bs-table-hover-color: var(--text); margin: 0; }
.table > thead th { font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); background: var(--surface-2); border-bottom: 1px solid var(--border); padding: .75rem 1rem; white-space: nowrap; }
.table > tbody td { padding: .85rem 1rem; vertical-align: middle; border-color: var(--border); font-size: .875rem; }
.table-wrap { overflow-x: auto; }

/* Dropdowns, modais, alerts no tema */
.dropdown-menu { --bs-dropdown-bg: var(--surface); --bs-dropdown-border-color: var(--border); --bs-dropdown-link-color: var(--text); --bs-dropdown-link-hover-bg: var(--surface-2); --bs-dropdown-link-hover-color: var(--text); --bs-dropdown-header-color: var(--text-3); --bs-dropdown-divider-bg: var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); padding: .4rem; font-size: .88rem; }
.dropdown-item { border-radius: 8px; padding: .5rem .7rem; }
.modal-content { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; color: var(--text); }
.modal-header, .modal-footer { border-color: var(--border); }
.alert { border-radius: 12px; border: 1px solid transparent; font-size: .88rem; }
.alert-success { background: var(--ok-50); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 25%, transparent); }
.alert-danger  { background: var(--bad-50); color: var(--bad); border-color: color-mix(in srgb, var(--bad) 25%, transparent); }
.alert-warning { background: var(--warn-50); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 25%, transparent); }
.alert-info    { background: var(--info-50); color: var(--info); border-color: color-mix(in srgb, var(--info) 25%, transparent); }
.badge { font-weight: 600; border-radius: 6px; }
.nav-tabs { border-color: var(--border); }
.nav-tabs .nav-link { color: var(--text-2); border: 0; border-bottom: 2px solid transparent; font-weight: 600; }
.nav-tabs .nav-link.active { color: var(--brand); background: transparent; border-bottom-color: var(--brand); }
.list-group { --bs-list-group-bg: var(--surface); --bs-list-group-border-color: var(--border); --bs-list-group-color: var(--text); --bs-list-group-action-hover-bg: var(--surface-2); }
[data-bs-theme="dark"] .bg-light { background-color: var(--surface-2) !important; }
[data-bs-theme="dark"] .bg-white { background-color: var(--surface) !important; }
[data-bs-theme="dark"] .text-dark { color: var(--text) !important; }
[data-bs-theme="dark"] .border-light { border-color: var(--border) !important; }
[data-bs-theme="dark"] .btn-light { --bs-btn-bg: var(--surface-3); --bs-btn-border-color: var(--border); --bs-btn-color: var(--text); --bs-btn-hover-bg: var(--border); --bs-btn-hover-color: var(--text); }
[data-bs-theme="dark"] .btn-outline-secondary { --bs-btn-color: var(--text-2); --bs-btn-border-color: var(--border-strong); }
[data-bs-theme="dark"] .table-light { --bs-table-bg: var(--surface-2); --bs-table-color: var(--text-2); }

/* Toast */
.toast-stack { position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 2000; display: flex; flex-direction: column; gap: .5rem; }
.toast-item { background: var(--text); color: var(--bg); padding: .75rem 1rem; border-radius: 12px; box-shadow: var(--shadow-lg); font-size: .86rem; font-weight: 500; display: flex; align-items: center; gap: .6rem; animation: toastIn .25s ease; }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* Tema toggle */
.theme-toggle .fa-sun { display: none; }
[data-bs-theme="dark"] .theme-toggle .fa-sun { display: inline-block; }
[data-bs-theme="dark"] .theme-toggle .fa-moon { display: none; }

/* Hero / banners */
.hero-card {
  position: relative; overflow: hidden; border-radius: 18px; padding: 1.75rem;
  background: radial-gradient(1200px 300px at 100% 0%, rgba(96,165,250,.35), transparent 60%), linear-gradient(135deg, #1a56db 0%, #1e3a8a 100%);
  color: #fff; border: 0;
}
.hero-card h2, .hero-card h1 { color: #fff; }
.hero-card .muted { color: rgba(255,255,255,.75); }
.hero-card::after { content: ''; position: absolute; right: -60px; bottom: -80px; width: 260px; height: 260px; border-radius: 50%; background: rgba(255,255,255,.06); }
.lock-banner { border-radius: 16px; padding: 1.25rem 1.5rem; background: linear-gradient(135deg, var(--gold-50), var(--surface)); border: 1px solid color-mix(in srgb, var(--gold) 35%, transparent); }

/* Biblioteca */
.doc-card { display: flex; flex-direction: column; height: 100%; padding: 1.1rem; }
.doc-type { width: 44px; height: 44px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; font-size: 1.3rem; flex-shrink: 0; }
.doc-code { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: .72rem; font-weight: 600; color: var(--text-3); }
.cat-pill { display: inline-flex; align-items: center; gap: .45rem; padding: .45rem .85rem; border-radius: 99px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font-weight: 600; font-size: .82rem; white-space: nowrap; transition: all .15s; }
.cat-pill:hover { border-color: var(--border-strong); color: var(--text); }
.cat-pill.active { background: var(--text); color: var(--bg); border-color: var(--text); }
.cat-pill .count { font-size: .7rem; opacity: .7; }
.scroll-x { display: flex; gap: .5rem; overflow-x: auto; padding-bottom: .25rem; scrollbar-width: none; }
.scroll-x::-webkit-scrollbar { display: none; }

/* Academia */
.module-card { padding: 1.25rem; display: flex; flex-direction: column; gap: .75rem; height: 100%; }
.module-num { width: 48px; height: 48px; border-radius: 14px; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 1.1rem; }
.lesson-row { display: flex; align-items: center; gap: .85rem; padding: .75rem 1rem; border-radius: 12px; color: var(--text); border: 1px solid transparent; }
.lesson-row:hover { background: var(--surface-2); border-color: var(--border); color: var(--text); }
.lesson-row .state { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--border-strong); display: inline-flex; align-items: center; justify-content: center; font-size: .7rem; flex-shrink: 0; color: transparent; }
.lesson-row.done .state { background: var(--ok); border-color: var(--ok); color: #fff; }
.lesson-row.current .state { border-color: var(--brand); color: var(--brand); }
.lesson-row.current { background: var(--brand-50); }
.clause-tag { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: .72rem; font-weight: 700; padding: .15rem .45rem; border-radius: 6px; background: var(--surface-3); color: var(--text-2); }

.lesson-layout { display: grid; grid-template-columns: minmax(0,1fr) 340px; gap: 1.5rem; align-items: start; max-width: 1280px; }
.lesson-main { min-width: 0; }
.lesson-body { padding: clamp(1.5rem, 4vw, 3.5rem) clamp(1.25rem, 5vw, 4rem); }
.lesson-body > * , .lesson-body .prose > * { max-width: 760px; }
.lesson-side { position: sticky; top: calc(var(--topbar-h) + 1rem); max-height: calc(100vh - var(--topbar-h) - 2rem); grid-template-rows: auto auto minmax(0,1fr); }
.side-tabs { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.side-tab-nav { display: flex; border-bottom: 1px solid var(--border); padding: 0 .5rem; flex-shrink: 0; }
.side-tab-nav button { flex: 1; background: none; border: 0; border-bottom: 2px solid transparent; padding: .85rem .5rem; font-size: .82rem; font-weight: 600; color: var(--text-2); display: inline-flex; align-items: center; justify-content: center; white-space: nowrap; }
.side-tab-nav button.active { color: var(--brand); border-bottom-color: var(--brand); }
.side-tab { overflow-y: auto; min-height: 0; }
.reading-progress { height: 4px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.reading-progress span { display: block; height: 100%; width: 0; background: var(--brand); transition: width .15s; }
.reading-tools .btn { padding: .25rem .55rem; }
.reading-tools sup { font-size: .6em; }
/* Modo leitura */
.reading-focus .sidebar, .reading-focus .lesson-side { display: none !important; }
.reading-focus .main { margin-left: 0 !important; }
.reading-focus .lesson-layout { grid-template-columns: minmax(0,1fr); max-width: 900px; margin: 0 auto; }
@media (max-width: 1199.98px) { .lesson-layout { grid-template-columns: 1fr; } .lesson-side { position: static; max-height: none; } .side-tabs { max-height: 380px; } .lesson-side .reading-progress { display: none; } }

.prose { font-size: 1rem; line-height: 1.75; color: var(--text); }
.prose h2 { font-size: 1.3rem; margin: 2rem 0 .75rem; font-weight: 800; }
.prose h3 { font-size: 1.08rem; margin: 1.5rem 0 .5rem; font-weight: 700; }
.prose p { margin: 0 0 1rem; }
.prose ul, .prose ol { padding-left: 1.3rem; margin-bottom: 1rem; }
.prose li { margin-bottom: .4rem; }
.prose li::marker { color: var(--brand); }
.prose strong { color: var(--text); font-weight: 700; }
.prose blockquote { border-left: 3px solid var(--brand); background: var(--brand-50); padding: .9rem 1.1rem; border-radius: 0 12px 12px 0; margin: 1.25rem 0; color: var(--text); }
.callout { display: flex; gap: .9rem; padding: 1rem 1.15rem; border-radius: 14px; margin: 1.25rem 0; border: 1px solid; }
.callout > i { font-size: 1.1rem; margin-top: .2rem; }
.callout.tip { background: var(--ok-50); border-color: color-mix(in srgb, var(--ok) 25%, transparent); }
.callout.tip > i { color: var(--ok); }
.callout.warn { background: var(--warn-50); border-color: color-mix(in srgb, var(--warn) 25%, transparent); }
.callout.warn > i { color: var(--warn); }
.callout.info { background: var(--brand-50); border-color: color-mix(in srgb, var(--brand) 25%, transparent); }
.callout.info > i { color: var(--brand); }
.callout .callout-title { font-weight: 700; margin-bottom: .25rem; font-size: .92rem; }
.callout ul { margin: .25rem 0 0; padding-left: 1.1rem; }
.callout p:last-child, .callout ul:last-child { margin-bottom: 0; }

.note-item { padding: .8rem .9rem; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-2); font-size: .86rem; white-space: pre-wrap; word-break: break-word; }
.note-item.amarelo { border-left: 3px solid #f59e0b; }
.note-item.azul { border-left: 3px solid #3b82f6; }
.note-item.verde { border-left: 3px solid #10b981; }
.note-item.rosa { border-left: 3px solid #ec4899; }

.quiz-opt { display: block; width: 100%; text-align: left; padding: .8rem 1rem; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--text); margin-bottom: .5rem; font-size: .9rem; transition: all .15s; }
.quiz-opt:hover:not(:disabled) { border-color: var(--brand); background: var(--brand-50); }
.quiz-opt.right { border-color: var(--ok); background: var(--ok-50); }
.quiz-opt.wrong { border-color: var(--bad); background: var(--bad-50); }

/* Kanban */
.kanban { display: grid; grid-template-columns: repeat(3, minmax(260px, 1fr)); gap: 1rem; overflow-x: auto; }
.kanban-col { background: var(--surface-2); border: 1px solid var(--border); border-radius: 14px; padding: .75rem; min-height: 300px; }
.kanban-col.drag-over { border-color: var(--brand); background: var(--brand-50); }
.kanban-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: .8rem; margin-bottom: .6rem; cursor: grab; box-shadow: var(--shadow-sm); }
.kanban-card:active { cursor: grabbing; }

/* Matriz de risco */
.risk-grid { display: grid; grid-template-columns: 34px repeat(5, 1fr); gap: 4px; }
.risk-cell { aspect-ratio: 1.6; border-radius: 8px; display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 3px; font-size: .7rem; font-weight: 700; color: rgba(0,0,0,.55); padding: 3px; }
.risk-cell .rdot { width: 20px; height: 20px; border-radius: 50%; background: #0f172a; color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: .62rem; }
.risk-axis { display: flex; align-items: center; justify-content: center; font-size: .72rem; color: var(--text-3); font-weight: 700; }

/* Pix */
.pix-box { max-width: 980px; margin: 0 auto; }
.qr-frame { background: #fff; padding: 14px; border-radius: 18px; display: inline-block; box-shadow: var(--shadow); border: 1px solid var(--border); }
.qr-frame img, .qr-frame canvas { display: block; width: 240px; height: 240px; }
.copy-field { display: flex; gap: .5rem; }
.copy-field input { font-family: ui-monospace, Menlo, monospace; font-size: .75rem; }
.step-list { list-style: none; padding: 0; margin: 0; counter-reset: s; }
.step-list li { counter-increment: s; display: flex; gap: .75rem; padding: .45rem 0; color: var(--text-2); font-size: .88rem; }
.step-list li::before { content: counter(s); width: 24px; height: 24px; border-radius: 50%; background: var(--brand-50); color: var(--brand); font-weight: 700; font-size: .75rem; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.pulse { width: 10px; height: 10px; border-radius: 50%; background: var(--warn); box-shadow: 0 0 0 0 rgba(217,119,6,.6); animation: pulse 1.6s infinite; display: inline-block; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(217,119,6,.55); } 70% { box-shadow: 0 0 0 10px rgba(217,119,6,0); } 100% { box-shadow: 0 0 0 0 rgba(217,119,6,0); } }

/* Utilitários */
.gap-row > * { margin-bottom: 1.25rem; }
.mono { font-family: ui-monospace, 'SF Mono', Menlo, monospace; }
.truncate-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.divider { height: 1px; background: var(--border); margin: 1rem 0; }
.fade-in { animation: fadeIn .35s ease; }
@keyframes fadeIn { from { transform: translateY(6px); } to { transform: none; } }
.skeleton { background: linear-gradient(90deg, var(--surface-3), var(--surface-2), var(--surface-3)); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 8px; }
@keyframes sk { to { background-position: -200% 0; } }

.app-footer { border-top: 1px solid var(--border); padding: 1rem 1.75rem; color: var(--text-3); font-size: .8rem; display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem; }
.app-footer a { color: var(--text-3); }
.app-footer a:hover { color: var(--text); }

/* Legacy (páginas antigas do admin) */
.admin-card, .stat-card, .admin-table { background: var(--surface) !important; border: 1px solid var(--border) !important; border-radius: var(--radius) !important; box-shadow: var(--shadow-sm) !important; color: var(--text); }
.admin-card .card-header-custom, .admin-table .table-header { padding: 1.1rem 1.25rem; border-bottom: 1px solid var(--border); font-weight: 700; color: var(--text); display:flex; align-items:center; justify-content:space-between; gap:.75rem; flex-wrap:wrap }
.admin-card .card-body-custom { padding: 1.25rem; }
.stat-card { padding: 1.2rem; position: relative; overflow: hidden; }
.stat-card .stat-icon { width: 46px; height: 46px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; }
.stat-card .stat-value { font-size: 1.7rem; font-weight: 800; color: var(--text); line-height: 1.1; }
.stat-card .stat-label { font-size: .8rem; color: var(--text-2); }
.stat-card .stat-change { font-size: .76rem; margin-top: .4rem; }
.stat-card .stat-change.up { color: var(--ok); } .stat-card .stat-change.down { color: var(--bad); }
.page-header { margin-bottom: 1.5rem; }
.page-header h1 { font-size: 1.5rem; font-weight: 800; margin: 0; letter-spacing: -.03em; }
.chart-container { position: relative; height: 280px; }

@media print {
  .sidebar, .topbar, .app-footer, .no-print { display: none !important; }
  .main { margin: 0 !important; }
  .content { padding: 0; }
}
.ring.ring-light::after { background: #fff; }

/* ===== Diálogos personalizados ===== */
.ui-dialog-wrap { position: fixed; inset: 0; z-index: 2000; display: flex; align-items: center; justify-content: center; padding: 1rem; background: rgba(15, 23, 42, .45); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); opacity: 0; transition: opacity .18s ease; }
.ui-dialog-wrap.show { opacity: 1; }
.ui-dialog { position: relative; width: 100%; max-width: 420px; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 20px; padding: 2rem 1.75rem 1.5rem; text-align: center; box-shadow: 0 24px 64px rgba(15, 23, 42, .28); transform: translateY(12px) scale(.96); transition: transform .2s cubic-bezier(.2, .9, .3, 1.2); }
.ui-dialog-wrap.show .ui-dialog { transform: none; }
.ui-dialog-x { position: absolute; top: .75rem; right: .75rem; width: 32px; height: 32px; border: 0; border-radius: 10px; background: transparent; color: var(--text-3); }
.ui-dialog-x:hover { background: var(--surface-2); color: var(--text); }
.ui-dialog-icon { width: 64px; height: 64px; margin: 0 auto 1rem; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.6rem; }
.ui-dialog.info .ui-dialog-icon    { background: rgba(26, 86, 219, .12); color: #1a56db; box-shadow: 0 0 0 8px rgba(26, 86, 219, .06); }
.ui-dialog.success .ui-dialog-icon { background: rgba(16, 185, 129, .14); color: #059669; box-shadow: 0 0 0 8px rgba(16, 185, 129, .07); }
.ui-dialog.warning .ui-dialog-icon { background: rgba(245, 158, 11, .15); color: #d97706; box-shadow: 0 0 0 8px rgba(245, 158, 11, .07); }
.ui-dialog.danger .ui-dialog-icon  { background: rgba(220, 38, 38, .12); color: #dc2626; box-shadow: 0 0 0 8px rgba(220, 38, 38, .06); }
.ui-dialog h3 { font-size: 1.2rem; font-weight: 800; letter-spacing: -.02em; margin: 0 0 .5rem; }
.ui-dialog p { color: var(--text-2); font-size: .95rem; line-height: 1.55; margin: 0 0 1.25rem; }
.ui-dialog-actions { display: flex; gap: .6rem; justify-content: center; margin-top: 1.25rem; }
.ui-dialog-actions .btn { flex: 1; padding: .7rem 1rem; font-weight: 600; border-radius: 12px; }
.ui-dialog-progress { height: 8px; border-radius: 8px; background: var(--surface-3); overflow: hidden; margin: 0 0 .25rem; }
.ui-dialog-progress span { display: block; height: 100%; background: linear-gradient(90deg, #10b981, #059669); border-radius: 8px; transition: width .6s ease; }
[data-bs-theme="dark"] .ui-dialog-wrap { background: rgba(2, 6, 23, .65); }
@media (max-width: 480px) { .ui-dialog-actions { flex-direction: column-reverse; } }

/* ===== Resultado do pagamento com cartão ===== */
.card-result { text-align: center; padding: 2rem 1rem; border-radius: 16px; margin-bottom: 1rem; border: 1px solid var(--border); }
.card-result h3 { font-weight: 800; font-size: 1.25rem; margin: .25rem 0 .4rem; }
.card-result p { color: var(--text-2); max-width: 480px; margin: 0 auto 1.25rem; }
.card-result-icon { width: 68px; height: 68px; border-radius: 50%; margin: 0 auto .75rem; display: flex; align-items: center; justify-content: center; font-size: 1.8rem; }
.card-result.ok { background: var(--ok-50); } .card-result.ok .card-result-icon { background: rgba(22,163,74,.15); color: var(--ok); }
.card-result.warn { background: var(--warn-50); } .card-result.warn .card-result-icon { background: rgba(217,119,6,.15); color: var(--warn); }
.card-result.bad { background: color-mix(in srgb, var(--bad) 8%, transparent); } .card-result.bad .card-result-icon { background: color-mix(in srgb, var(--bad) 15%, transparent); color: var(--bad); }
.card-result.bad p { margin-bottom: 0; }

/* ===== Paginação ===== */
.pager { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-top: 1rem; }
.pager-info { color: var(--text-3); font-size: .82rem; }
.pager-nav { display: flex; gap: .3rem; flex-wrap: wrap; }
.pager-nav a, .pager-nav span { min-width: 36px; height: 36px; padding: 0 .6rem; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; font-size: .85rem; font-weight: 600; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); }
.pager-nav a:hover { border-color: var(--brand); color: var(--brand); }
.pager-nav .cur { background: var(--brand); border-color: var(--brand); color: #fff; }
.pager-nav .off { opacity: .4; }
.pager-nav .gap { border: 0; background: none; min-width: 20px; }

/* ===== Chamados ===== */
.ticket-list { display: grid; }
.ticket-row { display: flex; align-items: center; gap: 1rem; padding: 1rem 1.25rem; border-bottom: 1px solid var(--border); color: var(--text); }
.ticket-row:last-child { border-bottom: 0; }
.ticket-row:hover { background: var(--surface-2); color: var(--text); }
.ticket-row.unread { background: color-mix(in srgb, var(--brand) 5%, transparent); }
.row-unread td { background: color-mix(in srgb, var(--brand) 4%, transparent) !important; }
.cat-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .5rem; }
.cat-opt input { position: absolute; opacity: 0; pointer-events: none; }
.cat-opt span { display: flex; align-items: center; gap: .6rem; padding: .7rem .9rem; border: 1px solid var(--border); border-radius: 12px; cursor: pointer; font-size: .87rem; font-weight: 600; color: var(--text-2); transition: all .15s; }
.cat-opt span i { color: var(--text-3); width: 18px; text-align: center; }
.cat-opt span:hover { border-color: var(--border-strong); }
.cat-opt input:checked + span { border-color: var(--brand); background: var(--brand-50); color: var(--brand); }
.cat-opt input:checked + span i { color: var(--brand); }
.cat-opt input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.thread { display: grid; gap: 1rem; margin-bottom: 1rem; }
.msg { display: flex; gap: .75rem; align-items: flex-start; }
.msg.me { flex-direction: row-reverse; }
.msg-avatar { width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: .8rem; background: var(--surface-3); color: var(--text-2); }
.msg-avatar.staff { background: var(--brand); color: #fff; }
.msg-bubble { max-width: min(640px, 85%); background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: .85rem 1rem; box-shadow: var(--shadow-sm); }
.msg.me .msg-bubble { background: var(--brand-50); border-color: color-mix(in srgb, var(--brand) 25%, transparent); }
.msg.note .msg-bubble { background: var(--warn-50); border-style: dashed; border-color: color-mix(in srgb, var(--warn) 45%, transparent); }
.msg-meta { display: flex; justify-content: space-between; gap: 1rem; font-size: .75rem; color: var(--text-3); margin-bottom: .35rem; }
.msg-meta strong { color: var(--text); }
.msg-text { font-size: .93rem; line-height: 1.6; word-wrap: break-word; }
.msg-file { display: inline-flex; align-items: center; gap: .5rem; margin-top: .6rem; padding: .45rem .7rem; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); font-size: .82rem; color: var(--text); max-width: 100%; }
.msg-file span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-file small { color: var(--text-3); }
.thread-sys { text-align: center; font-size: .75rem; color: var(--text-3); }
.stars-input { display: inline-flex; flex-direction: row-reverse; gap: .25rem; }
.stars-input input { display: none; }
.stars-input label { font-size: 1.7rem; color: var(--border-strong); cursor: pointer; transition: color .1s; }
.stars-input label:hover, .stars-input label:hover ~ label, .stars-input input:checked ~ label { color: var(--gold); }
.active-row { background: var(--brand-50) !important; box-shadow: inset 3px 0 0 var(--brand); }

/* ===== Estatísticas ===== */
.live-pill { display: inline-flex; align-items: center; gap: .5rem; padding: .45rem .85rem; border-radius: 99px; background: var(--ok-50); color: var(--ok); font-weight: 700; font-size: .82rem; border: 1px solid color-mix(in srgb, var(--ok) 25%, transparent); }
.live-pill .pulse { width: 8px; height: 8px; }
.funnel-bar { height: 26px; border-radius: 8px; background: var(--surface-2); overflow: hidden; }
.funnel-bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), #60a5fa); border-radius: 8px; }
.heat-wrap { overflow-x: auto; }
.heat { border-collapse: separate; border-spacing: 3px; width: 100%; min-width: 560px; }
.heat th { font-size: .68rem; color: var(--text-3); font-weight: 600; text-align: center; padding: 0 2px; }
.heat tbody th { text-align: right; padding-right: 6px; width: 34px; }
.heat td { height: 22px; border-radius: 5px; background: color-mix(in srgb, var(--brand) calc(var(--a) * 100%), var(--surface-2)); }
.live-pill .pulse { background: var(--ok); box-shadow: none; }

/* ===== Guia de uso ===== */
.guide-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 1.5rem; align-items: start; max-width: 1200px; }
.guide-toc { position: sticky; top: calc(var(--topbar-h) + 1rem); }
.guide-toc .nav-item-link { font-size: .86rem; }
.guide-search { position: relative; }
.guide-search i { position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); color: #64748b; }
.guide-search input { width: 100%; border: 0; border-radius: 14px; padding: .95rem 1rem .95rem 2.6rem; font-size: .95rem; background: #fff; color: #0f172a; box-shadow: 0 10px 30px -10px rgba(0,0,0,.35); outline: none; }
.guide-shot { margin: 0 0 1.25rem; border-radius: 12px; overflow: hidden; border: 1px solid var(--border); box-shadow: var(--shadow-sm); max-height: 340px; }
.guide-shot img { width: 100%; display: block; object-fit: cover; object-position: top; }
.guide-item h3 { font-size: 1rem; font-weight: 700; margin: 0 0 .35rem; }
.small-prose { font-size: .93rem; line-height: 1.65; color: var(--text-2); }
.small-prose ol, .small-prose ul { margin-bottom: 0; }
.guide-sec { scroll-margin-top: calc(var(--topbar-h) + 1rem); }
kbd { background: var(--surface-3); color: var(--text); border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 6px; padding: .05rem .4rem; font-size: .78em; }
@media (max-width: 991.98px) { .guide-layout { grid-template-columns: 1fr; } }

/* ===== Páginas públicas de conteúdo (SEO) ===== */
body.pub { background: var(--bg); }
.pub-wrap { max-width: 1180px; margin: 0 auto; padding-left: 16px; padding-right: 16px; }
.pub-top { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.pub-top > .pub-wrap { height: 64px; }
.pub-brand { font-size: 1.1rem; }
.pub-nav { gap: .25rem; }
.pub-nav a { padding: .45rem .8rem; border-radius: 10px; color: var(--text-2); font-weight: 600; font-size: .9rem; white-space: nowrap; }
.pub-nav a:hover, .pub-nav a.active { background: var(--brand-50); color: var(--brand); }
.pub-nav-m { display: flex; overflow-x: auto; padding: 0 12px 10px; scrollbar-width: none; }
.pub-crumbs { font-size: .82rem; color: var(--text-3); display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.pub-crumbs a { color: var(--text-3); }
.pub-hero { margin-bottom: 2rem; max-width: 860px; }
.pub-hero h1, .pub-article h1 { font-size: clamp(1.7rem, 4vw, 2.6rem); font-weight: 800; letter-spacing: -.03em; line-height: 1.15; margin: .35rem 0 .75rem; }
.pub-hero .lead, .pub-article .lead { color: var(--text-2); font-size: 1.1rem; }
.pub-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 2rem; align-items: start; }
.pub-side { position: sticky; top: 84px; }
.pub-mod { margin-bottom: 2.5rem; scroll-margin-top: 84px; }
.pub-mod h2 { font-size: 1.35rem; font-weight: 800; letter-spacing: -.02em; display: flex; align-items: center; gap: .65rem; margin-bottom: .4rem; }
.pub-list { display: grid; gap: .5rem; margin-top: .75rem; }
.pub-item { display: flex; align-items: center; gap: .85rem; padding: .85rem 1rem; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); color: var(--text); transition: all .15s; }
.pub-item:hover { border-color: var(--brand); color: var(--text); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.pub-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .9rem; margin-top: .9rem; }
.pub-card { display: block; padding: 1.1rem; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); color: var(--text); transition: all .15s; }
.pub-card:hover { border-color: var(--brand); color: var(--text); box-shadow: var(--shadow-sm); }
.pub-card h3 { font-size: 1rem; font-weight: 700; margin: 0 0 .35rem; }
.pub-card p { font-size: .85rem; color: var(--text-2); margin-bottom: .5rem; }
.pub-article { min-width: 0; }
.pub-article .prose { font-size: 1.06rem; }
.pub-locked { position: relative; margin-top: -1.5rem; }
.pub-locked-fade { height: 90px; background: linear-gradient(to bottom, transparent, var(--bg)); }
.pub-locked-box { text-align: center; padding: 2rem 1.25rem; border: 1px solid var(--border); border-radius: 18px; background: var(--surface); box-shadow: var(--shadow-sm); }
.pub-locked-box li { margin-bottom: .4rem; }
.pub-toc { display: grid; gap: 1px; max-height: 60vh; overflow-y: auto; font-size: .8rem; }
.pub-toc a { padding: .35rem .5rem; border-radius: 8px; color: var(--text-2); }
.pub-toc a:hover, .pub-toc a.active { background: var(--brand-50); color: var(--brand); }
.pub-toc .mono { font-size: .72rem; color: var(--text-3); margin-right: .25rem; }
.pub-checks { list-style: none; padding: 0; display: grid; gap: .5rem; }
.pub-checks li { display: flex; gap: .6rem; } .pub-checks li::before { content: '\f058'; font-family: 'Font Awesome 6 Free'; font-weight: 900; color: var(--ok); }
.pub-faq { border: 1px solid var(--border); border-radius: 14px; background: var(--surface); padding: .9rem 1.1rem; margin-bottom: .6rem; }
.pub-faq summary { font-weight: 700; cursor: pointer; }
.pub-faq p { margin: .6rem 0 0; color: var(--text-2); }
.pub-dl { display: grid; gap: .6rem; }
.pub-dl > div { padding: .9rem 1.1rem; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); scroll-margin-top: 84px; }
.pub-dl dt { font-weight: 700; } .pub-dl dd { margin: .2rem 0 0; color: var(--text-2); }
.pub-cta { margin: 3rem 0 1rem; padding: 2rem; border-radius: 20px; color: #fff; background: linear-gradient(135deg, #1a56db, #1e3a8a); display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; }
.pub-foot { border-top: 1px solid var(--border); padding: 2.5rem 0; margin-top: 2rem; background: var(--surface); }
.pub-foot a { display: block; color: var(--text-2); font-size: .87rem; margin-bottom: .35rem; }
@media (max-width: 991.98px) { .pub-grid { grid-template-columns: 1fr; } .pub-side { position: static; } }

/* ── Biblioteca: categorias, filtros e paginação ─────────────────── */
.form-select { padding-right: 2.4rem; background-position: right .8rem center; }
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .6rem; }
.cat-card { display: flex; align-items: center; gap: .7rem; padding: .7rem .85rem; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); color: var(--text); min-width: 0; transition: border-color .15s, box-shadow .15s, transform .15s; }
.cat-card:hover { border-color: color-mix(in srgb, var(--cc) 55%, var(--border)); color: var(--text); transform: translateY(-1px); box-shadow: 0 4px 14px rgba(15, 23, 42, .06); }
.cat-card .cat-ic { width: 38px; height: 38px; flex-shrink: 0; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center; font-size: 1rem; color: var(--cc); background: color-mix(in srgb, var(--cc) 12%, transparent); }
.cat-card .cat-tx { display: flex; flex-direction: column; min-width: 0; }
.cat-card .cat-nm { font-weight: 700; font-size: .84rem; line-height: 1.2; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cat-card .cat-qt { font-size: .72rem; color: var(--text-3); margin-top: .1rem; }
.cat-card.active { border-color: var(--cc); background: color-mix(in srgb, var(--cc) 8%, var(--surface)); box-shadow: 0 0 0 1px var(--cc) inset; }
.cat-card.active .cat-ic { background: var(--cc); color: #fff; }
.bib-filtros { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .75rem; container-type: inline-size; }
.bib-busca { flex: 1 1 260px; }
@container (max-width: 780px) { .bib-busca { flex-basis: 100%; } }
.bib-campo { display: flex; flex-direction: column; gap: .2rem; margin: 0; }
.bib-campo > span { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text-3); }
.bib-campo .form-select { min-width: 190px; }
.bib-vis { margin-left: auto; align-self: center; }
@media (max-width: 575.98px) {
  .cat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
  .cat-card { padding: .6rem .65rem; gap: .55rem; }
  .cat-card .cat-ic { width: 32px; height: 32px; font-size: .85rem; }
  .bib-filtros { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: .6rem; }
  .bib-busca { grid-column: 1 / 3; grid-row: 1; min-width: 0; }
  .bib-vis { grid-column: 3; grid-row: 1; margin-left: 0; }
  .bib-campo { grid-row: 2; min-width: 0; }
  .bib-campo:last-of-type { grid-column: 2 / 4; }
  .bib-campo .form-select { min-width: 0; width: 100%; font-size: .85rem; padding-left: .7rem; }
}
/* Documento: lateral não estoura com títulos longos */
.doc-lateral { grid-template-columns: minmax(0, 1fr); }
.doc-lateral > * { min-width: 0; }
.rel-doc { align-items: flex-start; }
.rel-doc > i { width: 18px; flex-shrink: 0; margin-top: .2rem; }
.rel-tx { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
/* Aviso de parcelamento na página do cartão */
.parcel-hint { padding: .75rem .9rem; border-radius: 12px; background: var(--brand-50); color: var(--text); border: 1px solid color-mix(in srgb, var(--brand) 25%, transparent); font-size: .85rem; line-height: 1.45; }
.parcel-hint > i { color: var(--brand); }

/* ── Transição ISO 9001:2026 ─────────────────────────────────────── */
.t26-timeline { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; position: relative; }
.t26-step { position: relative; padding-top: 1.6rem; }
.t26-step::before { content: ""; position: absolute; top: 9px; left: 22px; right: -1rem; height: 2px; background: var(--border); }
.t26-step:last-child::before { display: none; }
.t26-step.feito::before { background: var(--ok); }
.t26-dot { position: absolute; top: 0; left: 0; width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--border-strong); background: var(--surface); display: flex; align-items: center; justify-content: center; font-size: .6rem; color: #fff; z-index: 1; }
.t26-step.feito .t26-dot { background: var(--ok); border-color: var(--ok); }
.t26-step.proximo .t26-dot { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-50); }
.t26-date { font-size: .72rem; font-weight: 800; color: var(--brand); letter-spacing: .02em; }
.t26-step.feito .t26-date { color: var(--ok); }
.t26-compare { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.t26-compare > div { padding: .75rem .85rem; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); }
.t26-compare .t26-new { background: var(--brand-50); border-color: color-mix(in srgb, var(--brand) 25%, transparent); }
.t26-lab { font-size: .66rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); margin-bottom: .25rem; }
.t26-item.respondido { border-color: color-mix(in srgb, var(--ok) 30%, var(--border)); }
.t26-card { border-radius: 16px; padding: 1.25rem 1.35rem; background: linear-gradient(135deg, #0f172a, #1e3a8a); color: #fff; position: relative; overflow: hidden; }
.t26-card .muted { color: rgba(255,255,255,.72); }
.t26-card .t26-count { font-size: 2rem; font-weight: 800; line-height: 1; color: #fbbf24; }
@media (max-width: 767.98px) {
  .t26-timeline { grid-template-columns: 1fr 1fr; row-gap: 1.25rem; }
  .t26-step::before { display: none; }
  .t26-compare { grid-template-columns: 1fr; }
}
.t26-box { border: 1px solid color-mix(in srgb, var(--brand) 30%, var(--border)); border-radius: 16px; padding: 1rem 1.1rem 1.1rem; background: linear-gradient(180deg, var(--brand-50), transparent 70%); }
.t26-box-head { display: flex; gap: .75rem; align-items: center; margin-bottom: .85rem; }
.t26-box-ic { width: 38px; height: 38px; border-radius: 11px; background: var(--brand); color: #fff; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.t26-box-item + .t26-box-item { margin-top: 1rem; padding-top: 1rem; border-top: 1px dashed var(--border); }

/* ── Programa de afiliados ───────────────────────────────── */
.af-faixa-teste{background:var(--warn-50);color:var(--warn);border:1px dashed var(--warn);border-radius:var(--radius-sm);padding:.6rem .9rem;font-size:.82rem;margin-bottom:1rem}
.af-faixa-admin{background:var(--brand-50);color:var(--brand);border:1px solid var(--brand-100);border-radius:var(--radius-sm);padding:.55rem .9rem;font-size:.82rem;margin-bottom:1rem}
.af-abas{display:flex;gap:.35rem;flex-wrap:wrap;border-bottom:1px solid var(--border, #e5e7eb);padding-bottom:.5rem}
.af-abas a{padding:.45rem .8rem;border-radius:999px;font-size:.84rem;font-weight:600;color:var(--text-2, #475569);text-decoration:none}
.af-abas a:hover{background:var(--surface-3)}
.af-abas a.active{background:var(--brand);color:#fff}
.af-switch{display:flex;align-items:center;justify-content:space-between;gap:1rem;padding:.8rem 0;border-bottom:1px solid var(--border, #e5e7eb)}
.af-switch:last-child{border-bottom:0}
.af-amb{border:2px solid var(--border, #e5e7eb);border-radius:var(--radius);padding:1rem 1.1rem;height:100%}
.af-amb.on{border-color:var(--brand);background:var(--brand-50)}
.af-amb.on.prod{border-color:var(--ok);background:var(--ok-50)}
.btn-emergencia{background:var(--bad);color:#fff;font-weight:800;letter-spacing:.02em}
.btn-emergencia:hover{background:#b91c1c;color:#fff}

/* ── Biblioteca: trilhas ISO 9001:2026 × Transição ── */
.trilhas { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.trilha { display: flex; gap: .9rem; align-items: center; padding: 1rem 1.1rem; border-radius: 14px; border: 1.5px solid var(--border); background: var(--surface); color: inherit; text-decoration: none; transition: border-color .15s, box-shadow .15s; }
.trilha:hover { border-color: color-mix(in srgb, var(--brand) 45%, var(--border)); }
.trilha.on { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 14%, transparent); }
.trilha-ic { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; flex: none; font-size: 1.15rem; color: var(--tc); background: color-mix(in srgb, var(--tc) 13%, transparent); }
.trilha-k { display: block; font-size: .68rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3, #64748b); }
.trilha-t { display: block; font-weight: 800; font-size: 1.02rem; line-height: 1.25; }
.trilha-s { display: block; font-size: .8rem; color: var(--text-3, #64748b); }
.transicao-box { border-left: 4px solid #d97706; }
.transicao-box .passo { display: flex; gap: .7rem; align-items: center; padding: .65rem .8rem; border-radius: 10px; background: color-mix(in srgb, #d97706 7%, transparent); color: inherit; text-decoration: none; height: 100%; }
.transicao-box .passo b { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: #d97706; color: #fff; flex: none; }
.transicao-box .passo small { display: block; color: var(--text-3, #64748b); }
.mud-lista { background: color-mix(in srgb, #f59e0b 9%, transparent); border-radius: 8px; padding: .5rem .6rem; }
.mud-k { font-size: .66rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #b45309; margin-bottom: .2rem; }
@media (max-width: 640px) { .trilhas { grid-template-columns: 1fr; } }

/* Página pública: transição ISO 9001:2026 */
.t26p-marcos { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: .75rem; }
.t26p-marco { border: 1px solid var(--border); border-left: 4px solid var(--warn); border-radius: 12px; padding: .85rem 1rem; background: var(--surface); }
.t26p-marco.ok { border-left-color: var(--ok); }
.t26p-data { font-size: .75rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--warn); margin-bottom: .2rem; }
.t26p-marco.ok .t26p-data { color: var(--ok); }
.t26p-n { width: 34px; height: 34px; border-radius: 10px; background: var(--brand-50); color: var(--brand); font-weight: 800; display: flex; align-items: center; justify-content: center; margin-bottom: .6rem; }
