/* Nil — sistema visual do painel.
   Nil Full / Connect: verde #163C2B · lima #B9FF3B · grafite #2A2A2A
   Nil/H (HojeAntes):  azul #0A1F8F (principal) · marinho #051361 · azul claro #9ACAF8 · grafite #2A2A2A
   Os nomes das variáveis (--green, --lime) são papéis: "cor principal" e "destaque". */
:root {
  --green: #163C2B;
  --green-2: #1F5139;
  --lime: #B9FF3B;
  --graphite: #2A2A2A;
  --ink: #1A1C1A;
  --muted: #667066;
  --bg: #F1F3EE;
  --card: #FFFFFF;
  --line: #E2E6DD;
  --line-strong: #CBD2C5;
  --lime-soft: #EDFBCB;
  --green-soft: #E4EEE7;
  --warn-soft: #FFF1CC;
  --warn: #7A5200;
  --danger: #B42318;
  --danger-soft: #FDE7E4;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(22, 60, 43, .05), 0 6px 20px rgba(22, 60, 43, .05);
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas, monospace;
  --sidebar-w: 264px;
  --accent-rgb: 185 255 59;
  --accent-hover: #C8FF63;
  --ok-ink: #2B5210;
  --ok-dot: #5FBF1F;
  --info-ink: #1D4532;
  --choice-bg: #F7FCEB;
  --active-border: #A9D95A;
  --core-text: #C2D4C9;
  --core-title: #86A795;
  --core-sub: #A9C2B4;
  --side-step: #8FB09E;
  --side-text: #C9DBD0;
  --side-strong: #D5E4DB;
  --side-tag: #E6EFE9;
}

/* Nil/H — distribuição HojeAntes. Mesmo Core e mesmos componentes; só a identidade muda. */
:root[data-edition="h"] {
  --green: #0A1F8F;
  --green-2: #051361;
  --lime: #9ACAF8;
  --lime-soft: #E3F0FD;
  --green-soft: #E6EAF7;
  --bg: #F0F2F8;
  --line: #DFE3EE;
  --line-strong: #C6CCDD;
  --muted: #5E6680;
  --ink: #161A2B;
  --accent-rgb: 154 202 248;
  --accent-hover: #B5D9FB;
  --ok-ink: #0A1F8F;
  --ok-dot: #3D8EE8;
  --info-ink: #051361;
  --choice-bg: #F2F7FE;
  --active-border: #9ACAF8;
  --core-text: #C4CBEA;
  --core-title: #8E99CF;
  --core-sub: #AEB7E0;
  --side-step: #8E99CF;
  --side-text: #C4CBEA;
  --side-strong: #DDE2F5;
  --side-tag: #E6EAF7;
}
:root[data-edition="h"] .shell-site .sidebar,
:root[data-edition="h"] .login-site .login-side { background: var(--green-2); color: var(--core-text); }
:root[data-edition="h"] .shell-site .nav-title { color: var(--core-title); }
:root[data-edition="h"] .shell-site .nav-sub { color: var(--core-sub); }
.powered { font-size: 11.5px; letter-spacing: .02em; opacity: .7; }
.powered strong { font-weight: 600; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.5; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
h1, h2, h3, p, ul, ol, dl, dd, figure, blockquote { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: var(--green); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
code { font-family: var(--mono); font-size: .88em; background: #EEF1EA; padding: 1px 6px; border-radius: 6px; word-break: break-word; }
img { max-width: 100%; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.icon { flex: none; }
.flip { transform: rotate(180deg); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; justify-content: center; }
.block { display: block; }
.mono { font-family: var(--mono); font-size: 13px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.stack { display: grid; gap: 8px; margin: 14px 0; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.center-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; }

/* ── Botões ─────────────────────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line-strong); background: #fff; font-weight: 600; font-size: 14px; white-space: nowrap; text-decoration: none; color: var(--ink); transition: background .15s, border-color .15s, transform .05s; }
.btn:hover { background: #F6F8F3; border-color: #B4BDAD; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--green); border-color: var(--green); color: var(--lime); }
.btn-primary:hover { background: var(--green-2); border-color: var(--green-2); }
.btn-accent { background: var(--lime); border-color: var(--lime); color: var(--green); }
.btn-accent:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn-ghost:hover { background: rgba(22, 60, 43, .07); border-color: transparent; color: var(--ink); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: #981B12; border-color: #981B12; }
.btn-outline-light { background: transparent; border-color: rgba(255, 255, 255, .35); color: #fff; }
.btn-outline-light:hover { background: rgba(255, 255, 255, .1); border-color: #fff; }
.btn-sm { min-height: 32px; padding: 0 12px; font-size: 13px; }
.btn-lg { min-height: 48px; padding: 0 24px; font-size: 15px; }
.btn.block { display: flex; width: 100%; }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; border: 0; background: transparent; color: var(--muted); text-decoration: none; }
.icon-btn:hover { background: rgba(22, 60, 43, .08); color: var(--ink); }
.icon-btn.danger:hover { background: var(--danger-soft); color: var(--danger); }
.spinner { width: 15px; height: 15px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; display: inline-block; flex: none; }
.spinner-lg { width: 22px; height: 22px; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 48px; color: var(--muted); }

/* ── Cartões, estatísticas, selos ───────────────────────────────────────── */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px 0; }
.card-head h2 { font-size: 16px; font-weight: 650; letter-spacing: -.01em; }
.card-body { padding: 18px 22px 22px; }
.card-head + div:not(.card-body) { margin-top: 12px; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; min-width: 0; }
.stat-label { font-size: 13px; color: var(--muted); font-weight: 500; }
.stat-value { font-size: 34px; line-height: 1.15; font-weight: 700; letter-spacing: -.03em; margin-top: 6px; font-variant-numeric: tabular-nums; }
.stat-hint { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.stat-icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--green-soft); color: var(--green); flex: none; }
.stat-lime { background: var(--green); border-color: var(--green); color: #fff; }
.stat-lime .stat-label, .stat-lime .stat-hint { color: rgba(255, 255, 255, .72); }
.stat-lime .stat-value { color: var(--lime); }
.stat-lime .stat-icon { background: var(--lime); color: var(--green); }
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; white-space: nowrap; background: #EEF1EA; color: #485048; }
.badge-ok { background: var(--lime-soft); color: var(--ok-ink); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-green { background: var(--green); color: var(--lime); }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.page-head h1 { font-size: 28px; line-height: 1.15; font-weight: 700; letter-spacing: -.025em; }
.page-head p { color: var(--muted); margin-top: 4px; }
.page-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.empty { text-align: center; padding: 44px 24px; display: grid; justify-items: center; gap: 8px; }
.empty h3 { font-size: 17px; }
.empty p { color: var(--muted); max-width: 46ch; }
.empty .btn { margin-top: 10px; }
.empty-icon { width: 56px; height: 56px; border-radius: 18px; background: var(--lime-soft); color: var(--green); display: grid; place-items: center; margin-bottom: 6px; }
.note { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: var(--radius-sm); font-size: 14px; margin: 14px 0; }
.note .icon { margin-top: 2px; }
.note-info { background: var(--green-soft); color: var(--info-ink); }
.note-danger { background: var(--danger-soft); color: var(--danger); justify-content: space-between; align-items: center; }
.tabs { max-width: 100%; overflow-x: auto; display: inline-flex; gap: 4px; padding: 4px; background: #E7EBE2; border-radius: 999px; margin-bottom: 16px; }
.tab { flex: none; border: 0; background: transparent; padding: 6px 14px; border-radius: 999px; font-weight: 600; font-size: 13.5px; color: var(--muted); display: inline-flex; gap: 7px; align-items: center; }
.tab.active { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }
.tab-count { font-size: 11.5px; background: rgba(22, 60, 43, .1); padding: 0 7px; border-radius: 999px; }
.code { position: relative; background: var(--graphite); border-radius: var(--radius-sm); margin: 10px 0; }
.code pre { margin: 0; padding: 16px 18px; padding-right: 110px; overflow-x: auto; color: #E8EDE4; font-family: var(--mono); font-size: 13px; line-height: 1.6; white-space: pre-wrap; word-break: break-word; }
.code code { background: none; padding: 0; font-size: inherit; }
.code .btn { position: absolute; top: 10px; right: 10px; background: #3A3A3A; border-color: #4A4A4A; color: #fff; }
.code .btn:hover { background: #474747; }
.kv { display: grid; gap: 10px; margin-top: 14px; }
.kv > div { display: grid; grid-template-columns: minmax(120px, 34%) 1fr; gap: 12px; font-size: 14px; }
.kv dt { color: var(--muted); }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #B9C0B4; flex: none; }
.dot-ok { background: var(--ok-dot); box-shadow: 0 0 0 4px rgb(var(--accent-rgb) / .4); }
.dot-warn { background: #E0A100; }

/* ── Modal, toasts ──────────────────────────────────────────────────────── */
.modal-backdrop { position: fixed; inset: 0; z-index: 50; background: rgba(20, 26, 22, .55); display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px; overflow-y: auto; }
.modal { background: #fff; border-radius: 20px; width: 100%; max-width: 480px; box-shadow: 0 24px 80px rgba(0, 0, 0, .3); }
.modal-wide { max-width: 680px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 16px 6px 24px; }
.modal-head h2 { font-size: 19px; letter-spacing: -.01em; }
.modal-body { padding: 8px 24px 20px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 24px 20px; border-top: 1px solid var(--line); }
.confirm-text { color: #3D453D; }
.toasts { position: fixed; z-index: 60; bottom: 20px; left: 50%; transform: translateX(-50%); display: grid; gap: 8px; width: min(92vw, 460px); pointer-events: none; }
.toast { display: flex; align-items: center; gap: 10px; background: var(--graphite); color: #fff; padding: 12px 16px; border-radius: 14px; font-size: 14px; box-shadow: 0 10px 30px rgba(0, 0, 0, .25); animation: rise .2s ease-out; }
.toast-ok .icon { color: var(--lime); }
.toast-danger { background: var(--danger); }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

/* ── Formulários ────────────────────────────────────────────────────────── */
.field { margin-bottom: 16px; min-width: 0; }
.field > label, .field-title { display: block; font-weight: 600; font-size: 13.5px; margin-bottom: 6px; }
.req { color: var(--danger); }
.field-help { font-size: 12.5px; color: var(--muted); margin-top: 5px; }
.field-error { font-size: 12.5px; color: var(--danger); margin-top: 5px; font-weight: 500; }
.field-inline { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.field-inline .field-title { margin: 0; }
.input { width: 100%; min-height: 42px; padding: 9px 13px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: #fff; transition: border-color .15s, box-shadow .15s; }
textarea.input { resize: vertical; line-height: 1.5; }
select.input { appearance: none; padding-right: 34px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23667066' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
.input:hover { border-color: #AAB3A3; }
.input:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px rgb(var(--accent-rgb) / .55); }
.input:disabled { background: #F3F5F0; color: var(--muted); }
.has-error .input { border-color: var(--danger); }
.input-sm { min-height: 34px; padding: 5px 10px; font-size: 13px; }
.input-narrow { max-width: 160px; }
.toggle { width: 44px; height: 26px; border-radius: 999px; border: 0; background: #C5CCBF; position: relative; flex: none; transition: background .15s; padding: 0; }
.toggle span { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .15s; }
.toggle.on { background: var(--green); }
.toggle.on span { transform: translateX(18px); background: var(--lime); }
.toggle:disabled { opacity: .5; }
.image-input { display: flex; gap: 14px; align-items: flex-start; }
.image-preview { width: 92px; height: 92px; border-radius: 12px; overflow: hidden; background: #EEF1EA; flex: none; display: grid; place-items: center; color: #9AA395; border: 1px solid var(--line); }
.image-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.image-controls { flex: 1; min-width: 0; display: grid; gap: 8px; }
.gallery-input { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 10px; }
.gallery-thumb { position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); }
.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery-thumb button { position: absolute; top: 5px; right: 5px; width: 24px; height: 24px; border-radius: 50%; border: 0; background: rgba(20, 20, 20, .75); color: #fff; display: grid; place-items: center; }
.gallery-add { aspect-ratio: 1; border-radius: 12px; border: 1.5px dashed var(--line-strong); background: #FAFBF8; display: grid; place-content: center; justify-items: center; gap: 4px; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.gallery-add:hover { border-color: var(--green); color: var(--green); }
.tags-input { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px 8px; min-height: 42px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: #fff; }
.tags-input:focus-within { border-color: var(--green); box-shadow: 0 0 0 3px rgb(var(--accent-rgb) / .55); }
.tags-input input { flex: 1; min-width: 120px; border: 0; outline: 0; padding: 4px; background: transparent; }
.chip { display: inline-flex; align-items: center; gap: 4px; background: var(--green-soft); color: var(--green); font-size: 13px; font-weight: 600; padding: 3px 4px 3px 10px; border-radius: 999px; }
.chip button { border: 0; background: transparent; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; color: inherit; }
.chip button:hover { background: rgba(22, 60, 43, .15); }
.color-input { display: flex; align-items: center; gap: 8px; }
.color-input .input { max-width: 150px; font-family: var(--mono); font-size: 13.5px; }
.swatch { width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--line-strong); flex: none; position: relative; overflow: hidden; cursor: pointer; }
.swatch.none { background: repeating-conic-gradient(#E3E7DE 0 25%, #fff 0 50%) 0 0 / 14px 14px; }
.swatch input { position: absolute; inset: -8px; width: 200%; height: 200%; opacity: 0; cursor: pointer; }
.checks { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 14px; display: grid; gap: 6px; margin: 0 0 8px; }
.checks legend { font-size: 13px; font-weight: 600; padding: 0 6px; }
.checks label, .check { display: flex; align-items: center; gap: 9px; font-size: 14px; }
.check { margin: 6px 0 16px; font-weight: 500; }
input[type=checkbox] { width: 17px; height: 17px; accent-color: var(--green); }
.form-section { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; margin: 20px 0 12px; padding-top: 16px; border-top: 1px solid var(--line); }
.test-result { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 600; }
.test-result.ok { color: #2B6A12; }
.test-result.fail { color: var(--danger); }

/* ── Moldura: sidebar + topo ────────────────────────────────────────────── */
.shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; }
.sidebar { background: var(--graphite); color: #C6CCC3; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: 22px 14px 14px; }
.shell-core .sidebar { background: var(--green); color: var(--core-text); }
.brand { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 0 10px 22px; }
.brand-mark { font-size: 26px; font-weight: 800; letter-spacing: -.06em; color: #fff; display: inline-flex; align-items: baseline; gap: 3px; line-height: 1; }
.brand-mark i { width: .3em; height: .3em; border-radius: 50%; background: var(--lime); display: inline-block; }
.brand-mark.big { font-size: 40px; }
.brand-context { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--graphite); background: var(--lime); padding: 3px 8px; border-radius: 999px; }
.shell-core .brand-context { color: var(--green); }
.sidebar nav { flex: 1; }
.sidebar > .powered { padding: 10px 12px 0; }
.nav-group { margin-bottom: 18px; }
.nav-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: #8A9187; padding: 0 12px 8px; }
.shell-core .nav-title { color: var(--core-title); }
.nav-link { display: flex; align-items: center; gap: 11px; width: 100%; padding: 9px 12px; border: 0; border-radius: 11px; background: transparent; color: inherit; text-decoration: none; font-weight: 550; font-size: 14.5px; text-align: left; }
.nav-link > span:first-of-type { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-link:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.nav-link.active { background: rgb(var(--accent-rgb) / .14); color: var(--lime); }
.nav-link.active-parent { color: #fff; }
.nav-link:focus-visible, .nav-sub:focus-visible, .sidebar .icon-btn:focus-visible { outline-color: var(--lime); }
.nav-badge { font-size: 11.5px; font-weight: 700; background: var(--lime); color: var(--green); padding: 0 7px; border-radius: 999px; min-width: 22px; text-align: center; }
.nav-caret { transition: transform .15s; opacity: .6; }
.nav-caret.open { transform: rotate(180deg); }
.nav-tree { margin: 2px 0 6px 21px; border-left: 1px solid rgba(255, 255, 255, .2); }
.nav-tree li { position: relative; }
.nav-tree li::before { content: ""; position: absolute; left: 0; top: 50%; width: 12px; border-top: 1px solid rgba(255, 255, 255, .2); }
.nav-sub { display: block; margin-left: 16px; padding: 7px 10px; border-radius: 9px; color: #A9B0A6; text-decoration: none; font-size: 14px; }
.shell-core .nav-sub { color: var(--core-sub); }
.nav-sub:hover { color: #fff; background: rgba(255, 255, 255, .06); }
.nav-sub.active { color: var(--lime); background: rgb(var(--accent-rgb) / .12); font-weight: 600; }
.sidebar-foot { display: flex; align-items: center; gap: 10px; padding: 12px 8px 4px; margin-top: 12px; border-top: 1px solid rgba(255, 255, 255, .12); }
.sidebar-foot .icon-btn { color: inherit; }
.sidebar-foot .icon-btn:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--lime); color: var(--green); display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: none; }
.who { flex: 1; min-width: 0; display: grid; }
.who strong { color: #fff; font-size: 13.5px; }
.who strong, .who span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who span { font-size: 12px; opacity: .75; }
.scrim { display: none; }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 12px; height: 64px; padding: 0 32px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); position: sticky; top: 0; z-index: 10; border-bottom: 1px solid var(--line); }
.topbar-context { display: flex; align-items: baseline; gap: 10px; min-width: 0; flex: 1; font-size: 14.5px; }
.topbar-context > * { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.menu-btn { display: none; }
.content { padding: 28px 32px 56px; max-width: 1280px; width: 100%; }

/* ── Tabelas e gerenciador de conteúdo ──────────────────────────────────── */
.table-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px 4px; }
.table-tools .tabs { margin: 0; }
.search { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line-strong); border-radius: 999px; padding: 0 14px; height: 38px; color: var(--muted); background: #fff; }
.search:focus-within { border-color: var(--green); box-shadow: 0 0 0 3px rgb(var(--accent-rgb) / .55); }
.search input { border: 0; outline: 0; background: transparent; width: 180px; color: var(--ink); }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; padding: 14px 18px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 12px 18px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #FAFBF8; }
.table small { font-size: 12.5px; }
.col-actions { text-align: right; white-space: nowrap; width: 1%; }
.cell-title { display: flex; align-items: center; gap: 12px; font-weight: 600; color: var(--ink); text-decoration: none; min-width: 0; }
a.cell-title:hover span:last-child { text-decoration: underline; }
.thumb { width: 40px; height: 40px; border-radius: 10px; background: var(--green-soft); color: var(--green); overflow: hidden; display: grid; place-items: center; flex: none; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.table-empty { text-align: center; padding: 28px; }
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); text-decoration: none; font-weight: 600; font-size: 13.5px; margin-bottom: 10px; }
.back:hover { color: var(--green); }
.editor { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.editor-side { display: grid; gap: 16px; position: sticky; top: 80px; }
.editor-side .btn { width: 100%; }

/* ── Artigos (base de conhecimento) ─────────────────────────────────────── */
.article-list { display: grid; gap: 12px; }
.article { display: flex; gap: 12px; padding: 18px 16px 18px 22px; }
.article-main { flex: 1; min-width: 0; }
.article h3 { font-size: 16px; letter-spacing: -.01em; }
.article p { color: #4A524A; font-size: 14px; margin: 4px 0 10px; white-space: pre-line; }
.article-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.article-actions { display: flex; flex: none; }

/* ── Visão geral ────────────────────────────────────────────────────────── */
.dash-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.dash-side { display: grid; gap: 16px; }
.recent li + li { border-top: 1px solid var(--line); }
.recent a { display: flex; align-items: center; gap: 14px; padding: 13px 22px; text-decoration: none; color: inherit; }
.recent a:hover { background: #FAFBF8; }
.recent li:last-child a { border-radius: 0 0 var(--radius) var(--radius); }
.recent-icon, .skill-icon { width: 44px; height: 44px; border-radius: 13px; background: var(--green); color: var(--lime); display: grid; place-items: center; flex: none; }
.recent-icon, .skill-icon.sm { width: 36px; height: 36px; border-radius: 10px; }
.recent-text { flex: 1; min-width: 0; display: grid; }
.recent-text strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent-text span { font-size: 13px; color: var(--muted); }
.status-line { display: flex; gap: 14px; align-items: center; margin-bottom: 12px; }
.status-line div { display: grid; }
.status-line span:not(.dot) { font-size: 13px; color: var(--muted); }
.site-url { display: flex; align-items: center; gap: 6px; font-size: 13.5px; margin-bottom: 14px; word-break: break-all; }
.skill-mini { display: grid; gap: 12px; }
.skill-mini li { display: flex; align-items: center; gap: 12px; }
.skill-mini li > span:nth-child(2) { flex: 1; display: grid; min-width: 0; }
.mini-link { font-size: 13.5px; font-weight: 600; text-decoration: none; }
.mini-link:hover { text-decoration: underline; }

/* ── Skills ─────────────────────────────────────────────────────────────── */
.skill-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 16px; }
.skill-card { padding: 22px; display: flex; flex-direction: column; gap: 14px; }
.skill-card.is-active { border-color: var(--active-border); box-shadow: 0 0 0 3px rgb(var(--accent-rgb) / .35), var(--shadow); }
.skill-card header { display: flex; align-items: center; gap: 14px; }
.skill-title { flex: 1; min-width: 0; display: grid; }
.skill-title h3 { font-size: 18px; letter-spacing: -.015em; }
.skill-desc { color: #454D45; font-size: 14.5px; }
.skill-provides { display: flex; flex-wrap: wrap; gap: 6px; }
.skill-provides li { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: #485048; background: #F1F3EE; padding: 4px 10px; border-radius: 999px; }
.skill-card footer { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.switch-row { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 600; }

/* ── Configurações de Skill ─────────────────────────────────────────────── */
.settings-layout { display: grid; grid-template-columns: minmax(300px, 400px) minmax(0, 1fr); gap: 16px; align-items: start; }
.settings-groups { display: grid; gap: 16px; }
.settings-fields .field:last-child { margin-bottom: 0; }
.preview-card { position: sticky; top: 80px; }
.preview-stage { border: 1px dashed var(--line-strong); border-radius: 12px; padding: 18px; margin-bottom: 10px; max-height: 70vh; overflow: auto; background: #FCFDFB; }
.grid-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; align-items: start; }
.integration { display: grid; gap: 16px; max-width: 860px; }
.details { margin-top: 12px; font-size: 14px; }
.details summary { cursor: pointer; font-weight: 600; color: var(--green); }
.inst-list { display: grid; gap: 10px; margin: 14px 0; }
.inst-list li { display: flex; align-items: center; gap: 12px; }
.inst-list li > span:nth-child(2) { flex: 1; min-width: 0; }
.inst-form { margin-top: 14px; flex-wrap: nowrap; }

/* ── Chat ───────────────────────────────────────────────────────────────── */
.chat-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.chat-card { display: flex; flex-direction: column; height: calc(100vh - 230px); min-height: 440px; }
.chat-card > div { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.chat-scroll { flex: 1; overflow-y: auto; padding: 22px; display: flex; flex-direction: column; gap: 14px; }
.chat-empty { margin: auto; text-align: center; display: grid; justify-items: center; gap: 8px; max-width: 520px; }
.chat-empty p { color: var(--muted); }
.suggestions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 12px; }
.suggestions button { border: 1px solid var(--line-strong); background: #fff; border-radius: 999px; padding: 8px 14px; font-size: 13.5px; text-align: left; }
.suggestions button:hover { border-color: var(--green); background: var(--lime-soft); }
.msg { display: flex; gap: 10px; max-width: 84%; }
.msg-user { align-self: flex-end; }
.msg-user p { background: var(--green); color: #fff; padding: 10px 16px; border-radius: 18px 18px 4px 18px; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg-avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--lime); color: var(--green); display: grid; place-items: center; flex: none; }
.msg-unsure .msg-avatar { background: var(--warn-soft); color: var(--warn); }
.msg-body { background: #F3F5F0; padding: 12px 16px; border-radius: 4px 18px 18px 18px; min-width: 0; display: grid; gap: 10px; }
.msg-unsure .msg-body { background: #FFF8E5; }
.msg-body blockquote { background: #fff; border-left: 3px solid var(--lime); border-radius: 0 10px 10px 0; padding: 10px 14px; display: grid; gap: 4px; justify-items: start; }
.msg-body blockquote p { font-size: 14px; color: #3D453D; overflow-wrap: anywhere; }
.msg-body blockquote .badge { margin-top: 4px; }
.chat-input { display: flex; gap: 10px; padding: 14px; border-top: 1px solid var(--line); }
.chat-input input { flex: 1; min-width: 0; height: 44px; border-radius: 999px; border: 1px solid var(--line-strong); padding: 0 18px; background: #fff; }
.chat-input input:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px rgb(var(--accent-rgb) / .55); }
.chat-side .card-body { display: grid; gap: 12px; }
.sources { display: grid; gap: 8px; }
.sources li { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; }
.sources strong { font-variant-numeric: tabular-nums; background: var(--green-soft); color: var(--green); border-radius: 999px; padding: 0 9px; }

/* ── Instalador e login ─────────────────────────────────────────────────── */
.install, .login { display: grid; grid-template-columns: minmax(300px, 400px) minmax(0, 1fr); min-height: 100vh; background: #fff; }
.install-side, .login-side { background: var(--green); color: var(--side-text); padding: 40px 36px; display: flex; flex-direction: column; gap: 28px; }
.login-site .login-side { background: var(--graphite); color: #C6CCC3; }
.install-tag { font-size: 16px; color: var(--side-tag); }
.install-side .brand-context { align-self: flex-start; }
.steps { display: grid; gap: 4px; flex: 1; align-content: start; counter-reset: s; }
.steps li { display: flex; align-items: center; gap: 12px; padding: 9px 0; font-weight: 550; color: var(--side-step); }
.step-dot { width: 28px; height: 28px; border-radius: 50%; border: 1.5px solid currentColor; display: grid; place-items: center; font-size: 12.5px; font-weight: 700; flex: none; }
.steps li.current { color: #fff; }
.steps li.current .step-dot { background: var(--lime); border-color: var(--lime); color: var(--green); }
.steps li.done { color: var(--side-strong); }
.steps li.done .step-dot { background: rgb(var(--accent-rgb) / .18); border-color: transparent; color: var(--lime); }
.install-foot, .login-foot { font-size: 12.5px; opacity: .75; }
.install-main, .login-main { display: grid; place-items: center; padding: 40px 24px; }
.install-form { width: 100%; max-width: 580px; }
.eyebrow { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-bottom: 10px; }
.install-form h1 { font-size: 32px; line-height: 1.12; letter-spacing: -.03em; }
.lead { color: var(--muted); font-size: 16px; margin: 8px 0 26px; }
.choices { display: grid; gap: 10px; margin-bottom: 20px; }
.choice { display: flex; align-items: flex-start; gap: 14px; text-align: left; padding: 16px; border-radius: 14px; border: 1.5px solid var(--line-strong); background: #fff; width: 100%; }
.choice:hover { border-color: #9FAA97; }
.choice.selected { border-color: var(--green); background: var(--choice-bg); box-shadow: 0 0 0 3px rgb(var(--accent-rgb) / .45); }
.choice-icon { width: 40px; height: 40px; border-radius: 12px; background: var(--green-soft); color: var(--green); display: grid; place-items: center; flex: none; }
.choice.selected .choice-icon { background: var(--green); color: var(--lime); }
.choice-text { flex: 1; display: grid; gap: 2px; }
.choice-text strong { font-size: 15.5px; }
.choice-text em { font-style: normal; font-size: 11.5px; font-weight: 700; background: var(--lime-soft); color: var(--ok-ink); padding: 2px 8px; border-radius: 999px; margin-left: 8px; vertical-align: 1px; }
.choice-text span { color: var(--muted); font-size: 14px; }
.choice-check { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--line-strong); display: grid; place-items: center; color: transparent; flex: none; margin-top: 2px; }
.choice.selected .choice-check { background: var(--green); border-color: var(--green); color: var(--lime); }
.review { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; margin-bottom: 16px; }
.review > div { display: grid; grid-template-columns: 150px 1fr; gap: 12px; padding: 13px 18px; }
.review > div + div { border-top: 1px solid var(--line); }
.review dt { color: var(--muted); font-size: 14px; }
.review dd { font-weight: 600; overflow-wrap: anywhere; }
.install-nav { display: flex; justify-content: space-between; align-items: center; margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line); }
.install-done { grid-column: 1 / -1; background: var(--green); color: var(--side-strong); display: grid; place-content: center; justify-items: center; text-align: center; gap: 14px; padding: 40px 24px; }
.install-done h1 { color: #fff; font-size: 44px; letter-spacing: -.035em; }
.install-done p { max-width: 46ch; font-size: 17px; }
.install-done strong { color: #fff; }
.install-done .row { margin-top: 14px; }
.done-mark { width: 72px; height: 72px; border-radius: 50%; background: var(--lime); color: var(--green); display: grid; place-items: center; }
.login-side { justify-content: space-between; }
.login-kicker { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--lime); margin-bottom: 12px; }
.login-side h1 { color: #fff; font-size: 38px; line-height: 1.08; letter-spacing: -.035em; margin-bottom: 14px; }
.login-side h1 em { font-style: normal; color: var(--lime); }
.login-form { width: 100%; max-width: 380px; display: grid; }
.login-form h2 { font-size: 28px; letter-spacing: -.025em; }
.login-form > .muted { margin: 4px 0 22px; }
.login-form .btn { margin: 6px 0 18px; }

/* ── Responsivo ─────────────────────────────────────────────────────────── */
@media (max-width: 1180px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-grid, .chat-layout, .editor, .settings-layout { grid-template-columns: minmax(0, 1fr); }
  .editor-side, .preview-card { position: static; }
  .chat-card { height: 62vh; }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; z-index: 40; left: 0; top: 0; width: min(86vw, var(--sidebar-w)); transform: translateX(-100%); transition: transform .2s ease; }
  .drawer-open .sidebar { transform: none; }
  .drawer-open .scrim { display: block; position: fixed; inset: 0; z-index: 30; background: rgba(0, 0, 0, .45); }
  .menu-btn { display: inline-grid; }
  .topbar { padding: 0 16px; }
  .content { padding: 20px 16px 48px; }
  .hide-sm { display: none !important; }
  .page-head h1 { font-size: 24px; }
  .install, .login { grid-template-columns: minmax(0, 1fr); }
  .install-side, .login-side { padding: 24px 20px; gap: 16px; }
  .steps { display: flex; flex-wrap: wrap; gap: 4px 14px; }
  .steps li { padding: 2px 0; font-size: 13px; gap: 6px; }
  .steps li:not(.current) { font-size: 0; gap: 0; }
  .install-foot, .login-side > div > p, .install-tag { display: none; }
  .login-side h1 { font-size: 26px; margin: 0; }
  .install-main, .login-main { padding: 28px 16px 40px; place-items: start center; }
  .install-form h1 { font-size: 26px; }
  .skill-grid { grid-template-columns: minmax(0, 1fr); }
  .grid-cards { grid-template-columns: minmax(0, 1fr); }
  .msg { max-width: 96%; }
  .search { flex: 1; min-width: 0; }
  .search input { width: 100%; min-width: 0; }
  .table-tools > * { min-width: 0; }
  .table th, .table td { padding-left: 12px; padding-right: 12px; }
}
@media (max-width: 560px) {
  .stats { grid-template-columns: minmax(0, 1fr); }
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .image-input { flex-direction: column; }
  .review > div, .kv > div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .inst-form { flex-wrap: wrap; }
  .code pre { padding-right: 18px; padding-top: 50px; }
  .article { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) { * { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

.inbox-message { white-space: pre-wrap; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); line-height: 1.65; }
