/* Painel da ACASE */

@font-face { font-family: "Montserrat"; src: url("../fonts/montserrat-var.ttf") format("truetype"); font-weight: 100 900; font-style: normal; font-display: swap; }

:root {
  --deep: #044D29;
  --deep-hover: #0A351D;
  --ink: #0A351D;
  --green-50: #F2F6F4;
  --green-100: #E6EDEA;
  --green-200: #B4CABF;
  --text: #333333;
  --muted: #595F5B;
  --line: #E9E9EA;
  --line-strong: #C3C6C4;
  --surface: #F6F7F6;
  --side: var(--green-50);
  --bg: #FAFBFA;
  --card: #FFFFFF;
  --ok: var(--deep); --ok-bg: var(--green-100);
  --warn: #8A5B0C; --warn-bg: #FBF1DC;
  --info: #0A736E; --info-bg: #E1F0EF;
  --danger: #AA3D27; --danger-bg: #F6E5DF;
  --radius: 10px;
  --topbar: 52px;
  --sidebar: 236px;
  --font: "Montserrat", system-ui, -apple-system, "Segoe UI", sans-serif;
  --focus: 0 0 0 3px rgba(4, 77, 41, .2);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 14px; line-height: 1.5; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }
a { color: var(--deep); }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, p { margin: 0; }
:focus-visible { outline: 2px solid var(--deep); outline-offset: 2px; }
[hidden] { display: none !important; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; padding: 10px 16px; background: #fff; color: var(--deep); font-weight: 700; border-radius: 6px; }
.skip:focus { top: 10px; }

.ai { width: 18px; height: 18px; flex: none; }
.ai--sm { width: 15px; height: 15px; }
.ai--lg { width: 40px; height: 40px; }

/* ---------- Top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px; height: var(--topbar); padding: 0 20px; background: var(--deep); color: #fff; }
.topbar__brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 800; font-size: 15px; letter-spacing: -.005em; }
.topbar__brand img { width: 26px; height: 26px; object-fit: contain; }
.topbar__menu { display: none; align-items: center; justify-content: center; width: 38px; height: 38px; margin-left: -8px; border: 0; border-radius: 8px; background: transparent; color: #fff; cursor: pointer; }
.topbar__menu:hover { background: rgba(255, 255, 255, .12); }
.topbar__actions { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.topbar__actions form { margin: 0; }
.topbar__actions a, .topbar__actions button { display: inline-flex; align-items: center; gap: 6px; padding: 7px 10px; border: 0; border-radius: 8px; background: transparent; color: #fff; font-size: 13px; font-weight: 600; text-decoration: none; cursor: pointer; }
.topbar__actions a:hover, .topbar__actions button:hover { background: rgba(255, 255, 255, .12); }
.topbar__actions .ai { width: 16px; height: 16px; }
.topbar :focus-visible { outline-color: #fff; }

/* ---------- Shell & sidebar ---------- */
.shell { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: calc(100vh - var(--topbar)); }
.sidebar { position: sticky; top: var(--topbar); align-self: start; height: calc(100vh - var(--topbar)); overflow-y: auto; padding: 14px 12px 32px; background: var(--side); border-right: 1px solid var(--line); scrollbar-width: thin; }
.sidebar__group { margin: 18px 10px 6px; font-size: 11.5px; font-weight: 600; color: var(--muted); }
.sidebar__group:first-child { margin-top: 4px; }
.sidebar ul { list-style: none; margin: 0; padding: 0; }
.sidebar a { display: flex; align-items: center; gap: 10px; padding: 7px 10px; margin-bottom: 1px; border-radius: 7px; color: var(--text); font-size: 13.5px; font-weight: 600; text-decoration: none; }
.sidebar a .ai { width: 17px; height: 17px; color: var(--deep); }
.sidebar a:hover { background: rgba(4, 77, 41, .07); }
.sidebar a.is-active { background: var(--deep); color: #fff; }
.sidebar a.is-active .ai { color: #fff; }
.sidebar__label { flex: 1; min-width: 0; }
.badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--deep); color: #fff; font-size: 11px; font-weight: 700; }
.sidebar a.is-active .badge { background: #fff; color: var(--deep); }
.scrim { display: none; }

.main { min-width: 0; padding: 28px clamp(18px, 3vw, 40px) 64px; max-width: 1240px; }
.main:focus { outline: none; }

/* ---------- Page head ---------- */
.page-head { margin-bottom: 22px; }
.back-link { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 10px; font-size: 13px; font-weight: 600; color: var(--muted); text-decoration: none; }
.back-link:hover { color: var(--deep); }
.back-link .ai { width: 15px; height: 15px; }
.page-head__row { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.page-head h1 { font-size: 26px; line-height: 1.15; font-weight: 800; letter-spacing: -.015em; color: var(--ink); }
.page-head__intro { max-width: 62ch; margin-top: 6px; font-size: 13.5px; color: var(--muted); }
.page-head__actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 38px; padding: 8px 18px; border: 1.5px solid transparent; border-radius: 999px; font-size: 13px; font-weight: 700; line-height: 1.2; text-decoration: none; cursor: pointer; white-space: nowrap; transition: background-color .15s, color .15s, border-color .15s; }
.btn .ai { width: 16px; height: 16px; }
.btn--primary { background: var(--deep); color: #fff; }
.btn--primary:hover { background: var(--deep-hover); }
.btn--outline { background: #fff; border-color: var(--deep); color: var(--deep); }
.btn--outline:hover { background: var(--green-50); }
.btn--text { background: transparent; color: var(--deep); padding-inline: 10px; }
.btn--text:hover { background: rgba(4, 77, 41, .07); }
.btn--danger { background: #fff; border-color: #E2B8AE; color: var(--danger); }
.btn--danger:hover { background: var(--danger-bg); border-color: var(--danger); }
.btn--sm { min-height: 30px; padding: 4px 12px; font-size: 12px; }
.btn--sm .ai { width: 14px; height: 14px; }
.btn--block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-icon { display: inline-grid; place-items: center; width: 30px; height: 30px; padding: 0; border: 1.5px solid var(--deep); border-radius: 999px; background: #fff; color: var(--deep); cursor: pointer; }
.btn-icon .ai { width: 14px; height: 14px; }
.btn-icon:hover { background: var(--green-50); }
.btn-icon:disabled { border-color: var(--line-strong); color: var(--line-strong); cursor: default; background: #fff; }

/* ---------- Alerts & pills ---------- */
.alert { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 18px; padding: 12px 14px; border-radius: 8px; border: 1px solid; font-size: 13.5px; }
.alert .ai { margin-top: 1px; }
.alert ul { margin: 4px 0 0; padding-left: 18px; }
.alert a { color: inherit; font-weight: 600; }
.alert--ok { background: var(--ok-bg); border-color: var(--green-200); color: var(--ink); }
.alert--error { background: var(--danger-bg); border-color: #EFC2B6; color: #7A2414; }
.alert:focus { outline: none; box-shadow: var(--focus); }
.pill { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700; white-space: nowrap; vertical-align: 1px; }
.pill--ok { background: var(--ok-bg); color: var(--ok); }
.pill--warn { background: var(--warn-bg); color: var(--warn); }
.pill--info { background: var(--info-bg); color: var(--info); }
.pill--danger { background: var(--danger-bg); color: var(--danger); }
.pill--muted { background: var(--line); color: var(--muted); }

/* ---------- Filters ---------- */
.filters { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.filters__field { display: grid; gap: 6px; min-width: 180px; }
.filters__field--grow { flex: 1 1 280px; max-width: 420px; }
.count { margin-bottom: 10px; font-size: 12.5px; color: var(--muted); }

/* ---------- Forms ---------- */
.field { display: grid; gap: 6px; margin-bottom: 18px; min-width: 0; }
.field:last-child { margin-bottom: 0; }
.field-section { margin: 28px 0 14px; padding-top: 20px; border-top: 1px solid var(--line); }
.field-section:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.field-section__title { margin: 0 0 4px; font-size: 15px; color: var(--deep); }
.field__label { font-size: 13px; font-weight: 700; color: var(--ink); }
.req { color: var(--danger); }
.field__help { font-size: 12.5px; color: var(--muted); line-height: 1.45; }
.field__error { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--danger); }
.input { width: 100%; min-height: 40px; padding: 8px 12px; border: 1px solid var(--line-strong); border-radius: 7px; background: #fff; font-size: 14px; line-height: 1.4; transition: border-color .15s, box-shadow .15s; }
.input:hover { border-color: #A4A8A5; }
.input:focus { outline: none; border-color: var(--deep); box-shadow: var(--focus); }
.input[aria-invalid="true"], .has-error .input { border-color: var(--danger); }
textarea.input { resize: vertical; min-height: 80px; }
select.input { padding-right: 34px; appearance: none; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23044D29' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center / 16px; cursor: pointer; }
.input--mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 13px; line-height: 1.6; }
.input--code { max-width: 220px; font-size: 24px; font-weight: 700; letter-spacing: .3em; text-align: center; }
.input-group { display: flex; align-items: stretch; }
.input-group__addon { display: flex; align-items: center; padding: 0 10px; border: 1px solid var(--line-strong); border-right: 0; border-radius: 7px 0 0 7px; background: var(--surface); color: var(--muted); font-size: 13px; white-space: nowrap; max-width: 55%; overflow: hidden; text-overflow: ellipsis; }
.input-group__addon + .input { border-radius: 0 7px 7px 0; }
.input-group--reveal .input { border-radius: 7px 0 0 7px; }
.input-group__btn { display: grid; place-items: center; width: 44px; border: 1px solid var(--line-strong); border-left: 0; border-radius: 0 7px 7px 0; background: #fff; color: var(--deep); cursor: pointer; }
.input-group__btn:hover { background: var(--green-50); }

.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 700; font-size: 13.5px; color: var(--ink); }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch__track { position: relative; flex: none; width: 40px; height: 22px; border-radius: 999px; background: var(--line-strong); transition: background-color .15s; }
.switch__track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .25); transition: transform .15s; }
.switch input:checked + .switch__track { background: var(--deep); }
.switch input:checked + .switch__track::after { transform: translateX(18px); }
.switch input:focus-visible + .switch__track { box-shadow: var(--focus); }

.check, .radio { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; cursor: pointer; }
.check input, .radio input { width: 16px; height: 16px; margin: 0; accent-color: var(--deep); }
.check--sm { font-size: 12.5px; color: var(--muted); }
.checks { margin: 0; padding: 0; border: 0; min-width: 0; }
.checks legend { margin-bottom: 10px; padding: 0; }
.checks__list { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px 20px; }
.card > .check { display: flex; margin-bottom: 18px; }
.radio-group { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 0 0 18px; padding: 0; border: 0; }
.radio-group legend { width: 100%; margin-bottom: 8px; padding: 0; }
.radio small { color: var(--muted); font-size: 12px; }

.fields-grid { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 0 20px; }
.field { align-content: start; }
.fields-grid > .field { flex: 1 1 100%; margin-bottom: 18px; }
.fields-grid > .field--half { flex: 1 1 calc(50% - 10px); min-width: 240px; }
.fields-grid--narrow { max-width: 460px; flex-direction: column; align-items: stretch; }

/* Upload */
.upload { display: grid; gap: 10px; }
.upload__preview { display: grid; place-items: center; aspect-ratio: 16 / 10; overflow: hidden; border: 1px dashed var(--line-strong); border-radius: 8px; background: var(--surface); }
.upload__preview img { width: 100%; height: 100%; object-fit: cover; }
.field--image .upload__preview:has(img[src$=".png"]) img { object-fit: contain; padding: 10px; }
.upload__empty { display: grid; justify-items: center; gap: 6px; color: var(--muted); font-size: 12.5px; }
.upload__empty .ai { width: 26px; height: 26px; color: var(--line-strong); }
.upload__actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.upload__pick { position: relative; overflow: hidden; }
.upload__input { position: absolute; inset: 0; opacity: 0; cursor: pointer; font-size: 0; }
.upload__pick:focus-within { box-shadow: var(--focus); }
.upload__name { font-size: 12.5px; color: var(--muted); }
.upload__name:empty { display: none; }
.upload__name.is-error { color: var(--danger); font-weight: 600; }
.upload.has-focus:has(.upload__preview img) .upload__preview { display: none; }

.focus__empty { margin: 0; font-size: 12.5px; color: var(--muted); }
.focus:not(.is-empty) .focus__empty, .focus.is-empty .focus__body { display: none; }
.focus__body { display: grid; gap: 10px; }
.focus__stage { position: relative; overflow: hidden; border-radius: 8px; background: var(--surface); cursor: crosshair; touch-action: none; user-select: none; }
.focus__stage:focus-visible { outline: none; box-shadow: var(--focus), 0 0 0 1px var(--deep); }
.focus__stage img { display: block; width: 100%; height: auto; pointer-events: none; -webkit-user-drag: none; }
.focus__dot { position: absolute; left: 50%; top: 50%; width: 26px; height: 26px; margin: -13px 0 0 -13px; border: 3px solid #fff; border-radius: 50%; background: rgba(4, 77, 41, .35); box-shadow: 0 0 0 1px rgba(0, 0, 0, .35), 0 2px 8px rgba(0, 0, 0, .35); cursor: grab; }
.focus__dot::after { content: ""; position: absolute; inset: 7px; border-radius: 50%; background: #fff; }
.focus__stage.is-dragging, .focus__stage.is-dragging .focus__dot { cursor: grabbing; }
.focus__hint { margin: 0; font-size: 12.5px; line-height: 1.45; color: var(--muted); }
.focus__frames { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
.focus__frame { margin: 0; display: grid; gap: 4px; }
.focus__crop { height: 72px; overflow: hidden; border-radius: 6px; background: var(--surface); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08); }
.focus__crop img { display: block; width: 100%; height: 100%; object-fit: cover; }
.focus__frame figcaption { font-size: 11.5px; font-weight: 600; color: var(--muted); }
.focus__foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.focus__readout { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.focus__open { justify-self: start; }

.preview-dialog { width: min(1240px, calc(100vw - 32px)); max-height: calc(100vh - 32px); padding: 0; border: 0; border-radius: 14px; background: var(--card, #fff); color: inherit; box-shadow: 0 24px 60px rgba(6, 34, 18, .35); }
.preview-dialog::backdrop { background: rgba(6, 34, 18, .55); }
.preview-dialog[open] { display: flex; flex-direction: column; }
.preview-dialog__head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.preview-dialog__title { margin: 0; font-size: 17px; }
.preview-dialog__body { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 24px; padding: 20px; overflow: auto; }
.preview-dialog__tools { display: grid; align-content: start; gap: 10px; }
.preview-dialog__tools .field__label { margin: 0; }
.preview-dialog__screens { display: flex; align-items: flex-start; gap: 20px; min-width: 0; }
.preview-dialog__foot { display: flex; justify-content: flex-end; padding: 14px 20px; border-top: 1px solid var(--line); }
.screen { margin: 0; display: grid; gap: 8px; }
.screen--desktop { flex: 1; min-width: 0; }
.screen--phone { flex: 0 0 210px; }
.screen__frame { position: relative; overflow: hidden; border-radius: 8px; background: var(--surface); box-shadow: 0 0 0 1px rgba(0, 0, 0, .1), 0 6px 18px rgba(6, 34, 18, .12); }
.screen--phone .screen__frame { border-radius: 18px; box-shadow: 0 0 0 6px #1d2420, 0 8px 20px rgba(6, 34, 18, .2); margin: 6px; }
.screen__frame iframe { position: absolute; top: 0; left: 0; border: 0; transform-origin: 0 0; pointer-events: none; }
.screen figcaption { font-size: 12px; font-weight: 600; color: var(--muted); text-align: center; }
@media (max-width: 960px) {
  .preview-dialog__body { grid-template-columns: minmax(0, 1fr); }
  .preview-dialog__tools .focus__stage { max-width: 360px; }
}
@media (max-width: 640px) {
  .preview-dialog__screens { flex-direction: column; align-items: stretch; }
  .screen--phone { flex: none; width: 210px; align-self: center; }
}
.file-field { display: grid; gap: 8px; justify-items: start; }
.file-field .input { width: 100%; }
.file-field__current { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 6px 10px; border-radius: 6px; background: var(--green-50); font-size: 13px; font-weight: 600; text-decoration: none; }
.file-field__current span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gallery-field { display: grid; gap: 10px; justify-items: start; }
.gallery-field__list { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; width: 100%; margin: 0; padding: 0; list-style: none; }
.gallery-field__list:empty { display: none; }
.gallery-field__list li { display: grid; gap: 4px; }
.gallery-field__list img { aspect-ratio: 4 / 3; width: 100%; object-fit: cover; border-radius: 6px; }
.gallery-field__list li:has(input:checked) img { opacity: .35; outline: 2px solid var(--danger); }
.gallery-field__remove { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); cursor: pointer; }

/* Rich text */
.rte { border: 1px solid var(--line-strong); border-radius: 7px; background: #fff; }
.rte:focus-within { border-color: var(--deep); box-shadow: var(--focus); }
.has-error .rte { border-color: var(--danger); }
.rte .rte__source { border: 0; border-radius: 7px; box-shadow: none; font-family: ui-monospace, Consolas, monospace; font-size: 13px; }
.rte.is-ready .rte__source { display: none; border-radius: 0 0 7px 7px; }
.rte.is-ready.is-source .rte__source { display: block; min-height: 360px; }
.rte.is-source .rte__area { display: none; }
.rte__bar { position: sticky; top: var(--topbar); z-index: 2; display: flex; flex-wrap: wrap; gap: 2px; padding: 6px; border-bottom: 1px solid var(--line); border-radius: 7px 7px 0 0; background: var(--surface); }
.rte__bar button { display: inline-grid; place-items: center; min-width: 32px; height: 32px; padding: 0 8px; border: 0; border-radius: 6px; background: transparent; color: var(--ink); font-size: 13px; font-weight: 700; cursor: pointer; }
.rte__bar button:hover { background: rgba(4, 77, 41, .08); }
.rte__bar button[aria-pressed="true"] { background: var(--deep); color: #fff; }
.rte__bar .sep { width: 1px; margin: 4px 4px; background: var(--line); }
.rte__area { min-height: 360px; max-height: 70vh; overflow-y: auto; padding: 16px 18px; font-size: 15px; line-height: 1.65; outline: none; }
.rte__area > :first-child { margin-top: 0; }
.rte__area p { margin: 0 0 1em; }
.rte__area h2 { margin: 1.4em 0 .5em; font-size: 20px; font-weight: 800; color: var(--deep); }
.rte__area h3 { margin: 1.2em 0 .4em; font-size: 17px; font-weight: 800; color: var(--deep); }
.rte__area blockquote { margin: 1em 0; padding: 4px 0 4px 16px; border-left: 3px solid var(--deep); color: var(--muted); font-style: italic; }
.rte__area img { height: auto; margin: 1em 0; border-radius: 6px; }
.rte__area a { color: var(--deep); text-decoration: underline; }
.rte__area ul, .rte__area ol { padding-left: 1.4em; margin: 0 0 1em; }

/* ---------- Cards & editor ---------- */
.card { padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
.card + .card, .card--section + .card--section { margin-top: 16px; }
.card__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.card__head .card__title { margin-bottom: 0; }
.card__title { margin-bottom: 18px; font-size: 16px; font-weight: 800; color: var(--ink); }
.card__title--sm { font-size: 14px; margin-bottom: 12px; }
.card__text { max-width: 70ch; margin: -8px 0 18px; font-size: 13.5px; color: var(--muted); }
.editor__grid { display: grid; gap: 16px; align-items: start; }
.editor__grid.has-side { grid-template-columns: minmax(0, 1fr) 320px; }
.editor__side { display: grid; gap: 16px; position: sticky; top: calc(var(--topbar) + 16px); }
.editor__side .card + .card { margin-top: 0; }
.editor__side form { margin: 0; }
.savebar { position: sticky; bottom: 0; z-index: 5; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 20px; padding: 14px 0; background: linear-gradient(to top, var(--bg) 70%, rgba(251, 250, 246, 0)); }
.savebar__end { margin-left: auto; }
.page-banners { margin-top: 28px; }
.page-banners__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.page-banners__title { margin: 0 0 6px; font-size: 16px; font-weight: 800; color: var(--ink); }
.page-banners__help { margin: 0; max-width: 62ch; font-size: 13.5px; color: var(--muted); }
.page-banners__empty { margin: 0; font-size: 13.5px; color: var(--muted); }
.page-banners__table { margin-top: 4px; }
.page-banners__foot { margin: 14px 0 0; font-size: 13px; }
.page-banners__foot a { color: var(--deep); }
.test-row { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-top: 4px; padding-top: 18px; border-top: 1px solid var(--line); }
.test-row .field { flex: 1 1 260px; max-width: 360px; margin: 0; }
.confirm-box { display: grid; gap: 14px; max-width: 520px; padding: 18px; border-radius: 8px; background: var(--green-50); }
.row-gap { display: flex; gap: 10px; flex-wrap: wrap; }
.stack { display: grid; gap: 8px; margin-top: 16px; }

.slide-card__grid { display: grid; grid-template-columns: minmax(240px, 380px) minmax(0, 1fr); gap: 24px; }

/* ---------- Tables ---------- */
.table-card { position: relative; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th { padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--surface); font-size: 12px; font-weight: 700; color: var(--ink); text-align: left; white-space: nowrap; }
.table td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--green-50); }
.col--thumb { width: 92px; }
.col--date { width: 1%; white-space: nowrap; color: var(--muted); }
.col--money, .col--num { text-align: right !important; white-space: nowrap; font-variant-numeric: tabular-nums; }
.col--bool, .col--file { width: 1%; white-space: nowrap; }
.col--actions { width: 1%; }
.row-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.row-actions .move { display: flex; gap: 4px; margin: 0 4px 0 0; }
.row-title { font-weight: 700; color: var(--ink); text-decoration: none; margin-right: 6px; }
a.row-title:hover { text-decoration: underline; color: var(--deep); }
.row-sub { display: block; margin-top: 2px; font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.row-sub a { color: inherit; }
.col--title { min-width: 240px; }
.col--sub { color: var(--muted); font-size: 13px; }
.thumb { width: 64px; height: 44px; object-fit: cover; border-radius: 5px; background: var(--line); }
.cover-thumb { width: 40px; height: 56px; object-fit: cover; object-position: top; border-radius: 3px; background: var(--line); box-shadow: 0 1px 3px rgba(10, 53, 29, .18); }
.thumb--empty, .avatar--empty, .logo-thumb--empty, .cover-thumb--empty { display: grid; place-items: center; color: var(--line-strong); }
.thumb--empty .ai, .avatar--empty .ai, .logo-thumb--empty .ai, .cover-thumb--empty .ai { width: 18px; height: 18px; }
.avatar { width: 44px; height: 44px; object-fit: cover; border-radius: 50%; background: var(--line); }
.logo-thumb { width: 72px; height: 44px; object-fit: contain; border-radius: 5px; background: #fff; border: 1px solid var(--line); padding: 4px; }
.file-link { display: inline-flex; align-items: center; gap: 5px; font-weight: 700; font-size: 12.5px; text-decoration: none; }
.is-unread .row-title { color: var(--deep); }
.dot { display: inline-block; width: 8px; height: 8px; margin-right: 8px; border-radius: 50%; background: var(--deep); vertical-align: 1px; }
.table--plain th { background: transparent; padding-left: 0; }
.table--plain td { padding-left: 0; }
.table--plain tfoot th, .table--plain tfoot td { border-bottom: 0; padding-top: 8px; padding-bottom: 0; font-weight: 600; text-align: right; color: var(--muted); }
.table--plain tfoot .total th, .table--plain tfoot .total td { padding-top: 12px; font-size: 16px; font-weight: 800; color: var(--ink); }

.empty { display: grid; justify-items: center; gap: 12px; padding: 48px 24px; border: 1px dashed var(--line-strong); border-radius: var(--radius); background: #fff; text-align: center; color: var(--muted); }
.empty .ai { color: var(--deep); }
.empty p { max-width: 52ch; }

.pager { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 18px; font-size: 13px; }
.pager a, .pager span[aria-disabled] { padding: 6px 14px; border: 1.5px solid var(--deep); border-radius: 999px; font-weight: 700; text-decoration: none; }
.pager span[aria-disabled] { border-color: var(--line); color: var(--line-strong); }
.pager__info { color: var(--muted); }

/* Facts */
.facts { display: grid; gap: 0; margin: 0; }
.facts > div { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.facts > div:last-child { border-bottom: 0; }
.facts dt { font-size: 12.5px; font-weight: 700; color: var(--muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.facts--stack > div { grid-template-columns: 1fr; gap: 2px; }
.facts__internal { display: inline-block; margin-left: 6px; padding: 0 7px; border-radius: 999px; background: #FDF3DC; color: #5C3D07; font-size: 11px; font-weight: 700; }
.message-body { font-size: 15px; line-height: 1.7; max-width: 70ch; overflow-wrap: anywhere; }
.history { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; font-size: 13px; }
.history li { display: flex; justify-content: space-between; gap: 10px; }
.history span { color: var(--muted); }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat { display: grid; gap: 2px; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.stat__label { font-size: 12px; font-weight: 700; color: var(--muted); }
.stat__value { font-size: 22px; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; }
.stat__sub { font-size: 12px; color: var(--muted); }

/* ---------- Login ---------- */
.auth { display: grid; place-items: center; align-content: center; gap: 18px; min-height: 100vh; padding: 24px; background: var(--side); }
.auth__card { width: min(420px, 100%); padding: 36px 32px 32px; border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: 0 1px 2px rgba(10, 53, 29, .05), 0 18px 40px rgba(10, 53, 29, .08); }
.auth__logo { width: 200px; height: auto; margin-bottom: 26px; }
.auth__title { font-size: 22px; font-weight: 800; color: var(--ink); letter-spacing: -.01em; }
.auth__lead { margin: 6px 0 20px; color: var(--muted); font-size: 14px; }
.auth__form { display: grid; gap: 8px; }
.auth__form .btn { margin-top: 12px; min-height: 44px; font-size: 14px; }
.auth__form .input { min-height: 44px; }
.auth__secondary { display: flex; align-items: center; gap: 4px; margin-top: 14px; font-size: 13px; color: var(--muted); }
.auth__secondary a { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; text-decoration: none; }
.auth__back a { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); text-decoration: none; }
.auth__back a:hover { color: var(--deep); }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .editor__grid.has-side { grid-template-columns: minmax(0, 1fr); }
  .editor__side { position: static; }
}
@media (max-width: 900px) {
  .topbar__menu { display: inline-flex; }
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; top: var(--topbar); left: 0; bottom: 0; z-index: 25; width: min(290px, 86vw); height: auto; align-self: auto; transform: translateX(-100%); visibility: hidden; transition: transform .22s ease, visibility 0s .22s; box-shadow: 0 10px 40px rgba(10, 53, 29, .2); }
  .is-nav-open .sidebar { transform: none; visibility: visible; transition: transform .22s ease; }
  .is-nav-open .scrim { display: block; position: fixed; inset: var(--topbar) 0 0; z-index: 20; background: rgba(10, 53, 29, .35); }
  .slide-card__grid { grid-template-columns: minmax(0, 1fr); }
  .facts > div { grid-template-columns: 1fr; gap: 2px; }
}
@media (max-width: 640px) {
  .main { padding-top: 20px; }
  .page-head h1 { font-size: 22px; }
  .topbar__actions span { display: none; }
  .topbar__brand { font-size: 14px; }
  .filters__field, .filters__field--grow { flex: 1 1 100%; max-width: none; }
  .table th.col--thumb, .table td.col--thumb, .table .col--date { display: none; }
  .row-actions .move { display: none; }
  .card { padding: 16px; }
  .savebar .btn--outline { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
