/* Miramar Learn. Mesma linguagem visual do MDocs, com a cor própria do MLearn (verde-azulado). */
:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-2: #f2f5f9;
  --surface-3: #e9eef4;
  --text: #182437;
  --muted: #627187;
  --border: #e2e8f0;
  --brand: #0d8a7a;
  --brand-strong: #0a6e62;
  --brand-soft: #e3f4f1;
  --brand-text: #ffffff;
  --danger: #c23b52;
  --danger-soft: #fbe9ec;
  --ok: #1f7f5c;
  --ok-soft: #e3f3ec;
  --warn: #9a5f12;
  --warn-soft: #fbf1e1;
  --info: #3858d6;
  --info-soft: #e9eefc;
  --public: #1f7f5c;
  --booked: #3858d6;
  --inhouse: #c23b52;
  --series-a: #3858d6;
  --series-b: #0d8a7a;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 2px 6px rgba(24, 36, 55, .035), 0 12px 32px rgba(24, 36, 55, .045);
  --sidebar: 252px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1620;
    --surface: #17212d;
    --surface-2: #1e2a38;
    --surface-3: #263445;
    --text: #e8edf5;
    --muted: #a3b1c2;
    --border: #2b394b;
    --brand: #3fcdb6;
    --brand-strong: #6fe0cd;
    --brand-soft: #173a37;
    --brand-text: #08201c;
    --danger: #ff8597;
    --danger-soft: #3a2129;
    --ok: #63cc9f;
    --ok-soft: #173426;
    --warn: #f1b35e;
    --warn-soft: #3a2c17;
    --info: #91a5ff;
    --info-soft: #1f2a4a;
    --public: #63cc9f;
    --booked: #91a5ff;
    --inhouse: #ff8597;
    --series-a: #8ea2ff;
    --series-b: #3fcdb6;
    --shadow: 0 2px 6px rgba(0, 0, 0, .25), 0 12px 32px rgba(0, 0, 0, .2);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.55 Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  letter-spacing: -.01em;
}
body { background-image: radial-gradient(ellipse at 18% 0, color-mix(in srgb, var(--brand) 6%, transparent), transparent 34rem); }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { letter-spacing: -.03em; }
h2 { margin: 0 0 14px; font-size: 17px; }
h3 { margin: 0 0 10px; font-size: 14px; }
code, kbd, pre { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.boot { padding: 48px; color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.meta { color: var(--muted); font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.push { margin-left: auto; }

/* Carregando */
.loading { display: flex; align-items: center; gap: 10px; padding: 28px 4px; color: var(--muted); }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--border); border-top-color: var(--brand); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Estrutura ── */
.shell { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  display: flex; flex-direction: column; gap: 18px;
  padding: 20px 14px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  border-right: 1px solid var(--border);
  backdrop-filter: blur(16px);
}
.brand { display: flex; align-items: center; gap: 11px; padding: 2px 6px; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand strong { display: block; font-size: 15px; letter-spacing: -.025em; }
.brand small { display: block; color: var(--muted); font-size: 11px; }
.logo {
  display: grid; place-items: center; flex: none;
  width: 36px; height: 36px; border-radius: 11px;
  color: #fff; font-weight: 800; font-size: 17px;
  background: linear-gradient(145deg, #14a38f, #0b6f63);
  box-shadow: 0 5px 12px rgba(13, 138, 122, .28);
}
.logo.big { width: 46px; height: 46px; border-radius: 14px; font-size: 21px; margin-bottom: 22px; }
.sidebar nav { display: flex; flex-direction: column; gap: 14px; flex: 1; }
.nav-group { display: flex; flex-direction: column; gap: 2px; }
.nav-title { margin: 0 0 4px; padding: 0 10px; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.sidebar nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 9px;
  color: var(--muted); font-weight: 600; font-size: 13px;
  transition: background .15s ease, color .15s ease;
}
.sidebar nav a:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
.sidebar nav a[aria-current="page"] { color: var(--brand); background: var(--brand-soft); }
.nav-icon { width: 18px; text-align: center; font-size: 14px; opacity: .9; }
.nav-label { flex: 1; }
.nav-badge { min-width: 20px; padding: 1px 6px; border-radius: 999px; background: var(--brand); color: var(--brand-text); font-size: 11px; font-weight: 700; text-align: center; }
.nav-badge.failed { background: var(--danger); color: #fff; }
.nav-badge[hidden] { display: none; }
.sidebar-foot { border-top: 1px solid var(--border); padding-top: 14px; display: flex; flex-direction: column; gap: 10px; }
.who { display: flex; align-items: center; gap: 10px; padding: 6px; border-radius: 10px; color: var(--text); }
.who:hover, .who[aria-current="page"] { background: var(--surface-2); text-decoration: none; }
.who strong { display: block; font-size: 13px; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who small { color: var(--muted); font-size: 11px; }
.avatar { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--surface-3); font-weight: 700; flex: none; }
.foot-links { display: flex; justify-content: space-between; padding: 0 6px; font-size: 12.5px; }

.content { min-width: 0; padding: 34px clamp(20px, 3.4vw, 48px) 64px; outline: none; max-width: 1560px; width: 100%; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap; margin: 0 0 24px; }
.eyebrow { margin: 0 0 7px; color: var(--brand); font-size: 10px; font-weight: 750; letter-spacing: .13em; }
.page-heading h1 { margin: 0; font-size: clamp(24px, 2.6vw, 30px); line-height: 1.2; letter-spacing: -.045em; }
.page-description { margin: 8px 0 0; max-width: 720px; color: var(--muted); }
.heading-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ── Cartões e grades ── */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; min-width: 0; }
.card.flush { padding: 0; overflow: hidden; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.card-head h2 { margin: 0; }
.card-head .meta { margin: 4px 0 0; }
.spaced { margin-top: 18px; }
.page > * + * { margin-top: 18px; }
.sub-title { margin: 22px 0 10px; font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.grid-2.inner { margin-top: 4px; }
.grid-side { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
.grid-side.wide-left { grid-template-columns: minmax(0, 1.6fr) minmax(260px, 1fr); }
.stack-col { display: flex; flex-direction: column; gap: 18px; }

/* Números */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(176px, 1fr)); gap: 14px; }
.stats.four { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.card .stats { margin-bottom: 6px; }
.stat { display: block; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; color: var(--text); }
.card .stat { box-shadow: none; background: var(--surface-2); border-color: transparent; }
a.stat:hover { text-decoration: none; border-color: color-mix(in srgb, var(--brand) 45%, var(--border)); transform: translateY(-1px); }
a.stat { transition: transform .15s ease, border-color .15s ease; }
.stat-label { margin: 0; color: var(--muted); font-size: 12px; font-weight: 600; }
.stat-value { margin: 4px 0 0; font-size: 26px; font-weight: 750; letter-spacing: -.04em; line-height: 1.2; overflow-wrap: anywhere; }
.stat-hint { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.stat-delta { margin: 6px 0 0; font-size: 12px; font-weight: 600; }
.stat-delta.up { color: var(--ok); } .stat-delta.down { color: var(--danger); } .stat-delta.flat { color: var(--muted); }
.stat.accent { border-color: color-mix(in srgb, var(--brand) 40%, var(--border)); background: linear-gradient(160deg, var(--brand-soft), var(--surface) 70%); }
.stat.accent .stat-value { color: var(--brand); }
.stat.bad .stat-value { color: var(--danger); }
.stat.warn .stat-value { color: var(--warn); }
.stat.good .stat-value { color: var(--ok); }

/* ── Botões e formulários ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  padding: 8px 14px; border-radius: 9px; cursor: pointer;
  font-weight: 650; font-size: 13px; line-height: 1.3; white-space: nowrap;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.btn:hover { background: var(--surface-2); text-decoration: none; transform: translateY(-1px); }
.btn.primary { background: var(--brand); color: var(--brand-text); border-color: var(--brand); box-shadow: 0 4px 10px color-mix(in srgb, var(--brand) 22%, transparent); }
.btn.primary:hover { background: var(--brand-strong); border-color: var(--brand-strong); }
.btn.danger { color: var(--danger); }
.btn.danger:hover { background: var(--danger-soft); }
.btn.danger-solid { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.small { padding: 5px 10px; font-size: 12.5px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.link { border: 0; background: none; padding: 0; color: var(--brand); cursor: pointer; font-weight: 600; font-size: 12.5px; }
.link:hover { text-decoration: underline; }
label, .label { display: block; margin: 14px 0 6px; font-size: 12px; font-weight: 650; color: var(--text); }
.label-row { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.label-row .label { margin-bottom: 6px; }
.hint { margin: 6px 0 0; color: var(--muted); font-size: 12px; }
.field { min-width: 0; }
input, select, textarea {
  width: 100%; min-height: 40px; padding: 8px 12px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); transition: border-color .15s ease, box-shadow .15s ease;
}
textarea { min-height: 0; resize: vertical; line-height: 1.55; }
textarea.small { font-size: 13px; }
input[type=checkbox], input[type=radio] { width: auto; min-height: 0; accent-color: var(--brand); }
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible, [tabindex]:focus-visible {
  outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent);
}
input[readonly], textarea[readonly] { background: var(--surface-2); }
select.compact { width: auto; min-height: 34px; padding: 5px 10px; font-size: 12.5px; }
.title-input { font-size: 19px; font-weight: 700; letter-spacing: -.03em; padding: 8px 12px; margin-top: 10px; }
.content-input { font-size: 14px; }
.row { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 160px; }
.row.tight { gap: 8px; align-items: center; }
.row.tight > * { flex: 0 0 auto; min-width: 0; }
.actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; flex-wrap: wrap; }
.actions.start { justify-content: flex-start; }
.actions.center { justify-content: center; }

.msg { margin: 12px 0 0; padding: 11px 14px; border-radius: var(--radius-sm); font-size: 13.5px; border: 1px solid color-mix(in srgb, currentColor 14%, transparent); }
.msg p { margin: 2px 0; }
.msg ul { margin: 6px 0 0; padding-left: 18px; }
.msg.error { background: var(--danger-soft); color: var(--danger); }
.msg.ok { background: var(--ok-soft); color: var(--ok); }
.msg.warn { background: var(--warn-soft); color: var(--warn); }
.msg.info { background: var(--info-soft); color: var(--info); }
.secret { display: block; font-size: 12px; background: var(--surface-2); padding: 8px 10px; border-radius: 8px; word-break: break-all; user-select: all; }

/* Segmentado (filtros e períodos) */
.segmented { display: inline-flex; gap: 2px; padding: 3px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 11px; flex-wrap: nowrap; }
.segmented.wrap { flex-wrap: wrap; }
.seg { display: inline-flex; align-items: center; padding: 5px 11px; border-radius: 8px; border: 0; background: transparent; color: var(--muted); font-weight: 650; font-size: 12.5px; cursor: pointer; white-space: nowrap; list-style: none; }
.seg::-webkit-details-marker { display: none; }
.seg:hover { color: var(--text); text-decoration: none; }
.seg[aria-pressed="true"], .seg.on { background: var(--surface); color: var(--brand); box-shadow: 0 1px 3px rgba(24, 36, 55, .12); }
.popover { position: relative; }
.popover-body { position: absolute; right: 0; top: calc(100% + 8px); z-index: 20; width: 300px; padding: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 20px 40px rgba(0, 0, 0, .15); }
.popover-body label { margin-top: 0; }

/* Chips e etiquetas */
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--text); font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.chip.outline { background: transparent; border: 1px solid var(--border); }
.chip.muted { color: var(--muted); }
.chip.accent { background: var(--brand-soft); color: var(--brand); }
.chip.warn, .chip.urg-same_day { background: var(--warn-soft); color: var(--warn); }
.chip.ok, .chip.sent-understanding { background: var(--ok-soft); color: var(--ok); }
.chip.bad, .chip.urg-immediate, .chip.sent-frustrated { background: var(--danger-soft); color: var(--danger); }
.chip.urg-flexible, .chip.sent-neutral { background: var(--surface-2); color: var(--muted); }
.chip.conf-high { background: var(--ok-soft); color: var(--ok); }
.chip.conf-medium { background: var(--warn-soft); color: var(--warn); }
.chip.conf-low { background: var(--danger-soft); color: var(--danger); }
.chip.status-pending_review, .chip.status-pending, .chip.status-processing { background: var(--warn-soft); color: var(--warn); }
.chip.status-approved { background: var(--info-soft); color: var(--info); }
.chip.status-published, .chip.status-completed { background: var(--ok-soft); color: var(--ok); }
.chip.status-rejected, .chip.status-failed { background: var(--danger-soft); color: var(--danger); }
.chip.status-wont_publish, .chip.status-skipped { background: var(--surface-2); color: var(--muted); }
.tag { display: inline-flex; font-size: 10.5px; font-weight: 700; padding: 1px 7px; border-radius: 999px; border: 1px solid currentColor; white-space: nowrap; letter-spacing: .02em; }
.tag.public { color: var(--public); } .tag.booked { color: var(--booked); } .tag.inhouse { color: var(--inhouse); }

/* ── Listas ── */
.item-list { display: flex; flex-direction: column; gap: 10px; }
.item-list > .btn { align-self: flex-start; }
.item-card { display: block; padding: 14px 16px; border: 1px solid var(--border); border-radius: 12px; color: var(--text); transition: border-color .15s ease, background .15s ease; }
.item-card:hover { text-decoration: none; border-color: color-mix(in srgb, var(--brand) 45%, var(--border)); background: color-mix(in srgb, var(--surface-2) 50%, var(--surface)); }
.item-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.item-top strong { font-size: 14px; line-height: 1.35; }
.item-summary { margin: 4px 0 0; color: var(--muted); font-size: 13px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.item-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; }
.empty { padding: 40px 20px; text-align: center; color: var(--muted); }
.empty-title { margin: 0 0 6px; color: var(--text); font-weight: 700; font-size: 15px; }
.empty p { margin: 0 auto; max-width: 460px; }

/* Lista + detalhe (Fila, Conversas) */
.split-view { display: grid; grid-template-columns: minmax(300px, 400px) minmax(0, 1fr); gap: 18px; align-items: start; }
.list-col { position: sticky; top: 18px; max-height: calc(100vh - 36px); display: flex; flex-direction: column; }
.list-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.list-head.stacked { flex-direction: column; align-items: stretch; }
.list-head .filters { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.list-head .filters input:first-child { grid-column: 1 / -1; }
.list-head .filters input { min-height: 34px; padding: 5px 10px; font-size: 12.5px; }
.list-count { margin: 0; padding: 8px 16px; border-bottom: 1px solid var(--border); }
.check { display: inline-flex; margin: 0; }
.bulk { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 16px; background: var(--brand-soft); border-bottom: 1px solid var(--border); font-weight: 600; font-size: 13px; }
.queue { list-style: none; margin: 0; padding: 6px; overflow-y: auto; flex: 1; }
.queue > li { margin: 0; }
.queue-item { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border-radius: 10px; cursor: pointer; color: var(--text); border: 1px solid transparent; }
.queue-item:hover { background: var(--surface-2); text-decoration: none; }
.queue-item[aria-selected="true"], .queue-item[aria-current="true"] { background: var(--brand-soft); border-color: color-mix(in srgb, var(--brand) 30%, transparent); }
.queue-item input { margin-top: 3px; }
.queue-body { flex: 1; min-width: 0; }
.queue-body .item-summary { -webkit-line-clamp: 2; }
.kbd-help { margin: 0; padding: 10px 16px; border-top: 1px solid var(--border); color: var(--muted); font-size: 11.5px; }
kbd { display: inline-block; min-width: 18px; padding: 0 5px; border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 5px; background: var(--surface); font-size: 11px; text-align: center; }
.detail-col { min-width: 0; }
.detail { display: flex; flex-direction: column; }
.detail > * + * { margin-top: 12px; }
.detail .label { margin-bottom: 0; }
.detail-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.detail-title { margin: 6px 0 0; font-size: 20px; }
.lead { margin: 0; color: var(--muted); font-size: 14px; }
.reasoning { padding: 12px 14px; border-radius: var(--radius-sm); background: var(--surface-2); }
.reasoning .label { margin: 0 0 4px; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.reasoning p, .reasoning ul { margin: 0; }
.reasoning ul { padding-left: 18px; }
.checks > * + * { margin-top: 8px; }
.sticky-actions { position: sticky; bottom: 0; z-index: 2; display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; margin: 16px -22px -22px; padding: 14px 22px; background: color-mix(in srgb, var(--surface) 94%, transparent); border-top: 1px solid var(--border); border-radius: 0 0 var(--radius) var(--radius); backdrop-filter: blur(8px); }
.back-mobile { display: none; }
.block { padding-top: 14px; border-top: 1px solid var(--border); }
.block h3 { margin-bottom: 8px; }
.suggestion-box { padding: 14px; border: 1px solid var(--border); border-radius: 12px; }
.quotes { margin: 6px 0 0; padding-left: 18px; color: var(--muted); font-style: italic; }

/* Fatos (dl) */
.facts { display: grid; grid-template-columns: minmax(130px, max-content) 1fr; gap: 8px 16px; margin: 0; }
.facts dt { color: var(--muted); font-size: 12.5px; }
.facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.facts dd p { margin: 4px 0 0; }
.facts.grid { grid-template-columns: repeat(2, minmax(110px, max-content) minmax(0, 1fr)); }

/* Recolhíveis */
.collapse { border: 1px solid var(--border); border-radius: 12px; }
.collapse > summary { padding: 11px 14px; cursor: pointer; font-weight: 650; list-style: none; display: flex; align-items: center; gap: 8px; }
.collapse > summary::-webkit-details-marker { display: none; }
.collapse > summary::before { content: "▸"; color: var(--muted); transition: transform .15s ease; }
.collapse[open] > summary::before { transform: rotate(90deg); }
.collapse-body, .collapse > .feedback { padding: 0 14px 14px; }
.collapse-body > input[type=search] { margin-bottom: 8px; }

/* Feedback */
.feedback .label { margin-top: 10px; }
.feedback textarea { margin-top: 0; }
.chips-select { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-toggle { padding: 4px 10px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; font-size: 12px; font-weight: 600; }
.chip-toggle[aria-pressed="true"] { background: var(--brand-soft); color: var(--brand); border-color: color-mix(in srgb, var(--brand) 45%, var(--border)); }
.segmented .seg[aria-pressed="false"] { background: transparent; }

/* Conversa em balões */
.chat { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.bubble { max-width: 82%; padding: 9px 12px; border-radius: 14px; background: var(--surface-2); align-self: flex-start; border: 1px solid transparent; }
.bubble p { margin: 3px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.bubble-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); }
.bubble-meta strong { color: var(--text); }
.bubble.ai_agent { align-self: flex-end; background: var(--brand-soft); border-bottom-right-radius: 4px; }
.bubble.human_agent { align-self: flex-end; background: var(--info-soft); border-bottom-right-radius: 4px; }
.bubble.guest { border-bottom-left-radius: 4px; }
.bubble.system { align-self: center; max-width: 92%; background: transparent; border: 1px dashed var(--border); font-size: 12.5px; color: var(--muted); }
.bubble.private { border: 1px dashed var(--warn); background: var(--warn-soft); }
.attachment { font-size: 13px; }

/* Linha do tempo */
.timeline { list-style: none; margin: 4px 0 0; padding: 0 0 0 4px; }
.tl { position: relative; display: flex; gap: 12px; padding: 0 0 14px; }
.tl::before { content: ""; position: absolute; left: 5px; top: 14px; bottom: 0; width: 2px; background: var(--border); }
.tl:last-child::before { display: none; }
.tl > div { min-width: 0; }
.tl strong { font-size: 13px; }
.tl p { margin: 2px 0 0; }
.tl-dot { flex: none; width: 12px; height: 12px; margin-top: 4px; border-radius: 50%; background: var(--muted); box-shadow: 0 0 0 3px var(--surface); position: relative; z-index: 1; }
.tl.webhook_received .tl-dot { background: var(--info); }
.tl.ai_processing_started .tl-dot { background: var(--warn); }
.tl.ai_processing_completed .tl-dot, .tl.approved .tl-dot { background: var(--ok); }
.tl.ai_processing_failed .tl-dot, .tl.rejected .tl-dot { background: var(--danger); }
.tl.published .tl-dot { background: var(--brand); }
.tl.content_edited .tl-dot, .tl.retry_requested .tl-dot { background: var(--series-a); }
.timeline.big .tl { padding-bottom: 18px; }
.tl-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px; }
.legend-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
.tl-legend { display: flex; align-items: center; gap: 10px; }
.tl-legend .tl-dot { margin: 0; box-shadow: none; }
.tl-legend.webhook_received .tl-dot { background: var(--info); }
.tl-legend.ai_processing_started .tl-dot { background: var(--warn); }
.tl-legend.ai_processing_completed .tl-dot, .tl-legend.approved .tl-dot { background: var(--ok); }
.tl-legend.ai_processing_failed .tl-dot, .tl-legend.rejected .tl-dot { background: var(--danger); }
.tl-legend.published .tl-dot { background: var(--brand); }
.tl-legend.content_edited .tl-dot, .tl-legend.retry_requested .tl-dot { background: var(--series-a); }
.link-list { display: flex; flex-direction: column; gap: 8px; font-weight: 600; }

/* ── Publicar ── */
.publish-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.publish-form h2 { margin-bottom: 0; }
.preview { position: sticky; top: 18px; max-height: calc(100vh - 36px); overflow-y: auto; }
.preview h2 { margin-bottom: 4px; }
.radio-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.radio-card { position: relative; display: flex; flex-direction: column; gap: 4px; margin: 0; padding: 12px; border: 1px solid var(--border); border-radius: 12px; cursor: pointer; font-weight: 400; transition: border-color .15s ease, background .15s ease; }
.radio-card input { position: absolute; opacity: 0; pointer-events: none; }
.radio-card:hover { background: var(--surface-2); }
.radio-card:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 1px var(--brand) inset; }
.radio-card:has(input:focus-visible) { box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 22%, transparent); }
.radio-title { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-weight: 700; }
.tabs { display: flex; gap: 4px; margin: 12px 0; border-bottom: 1px solid var(--border); }
.tabs button { padding: 8px 12px; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--muted); font-weight: 650; cursor: pointer; margin-bottom: -1px; }
.tabs button[aria-selected="true"] { color: var(--brand); border-bottom-color: var(--brand); }
.tabs button:disabled { opacity: .45; cursor: not-allowed; }
.page-text { margin: 10px 0 0; padding: 14px; max-height: 58vh; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; background: var(--surface-2); border-radius: var(--radius-sm); font: 13px/1.6 Inter, ui-sans-serif, system-ui, sans-serif; }
.page-text.small { max-height: 260px; font-size: 12.5px; }
mark.added { background: color-mix(in srgb, var(--ok) 18%, transparent); color: inherit; border-radius: 4px; padding: 1px 2px; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.check-list { max-height: 240px; overflow-y: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 4px; margin-top: 8px; }
.check-row { display: flex; align-items: center; gap: 8px; margin: 0; padding: 6px 8px; border-radius: 8px; font-weight: 400; cursor: pointer; }
.check-row:hover { background: var(--surface-2); }
.check-row.strong { font-weight: 650; margin-top: 12px; }

/* Diferenças */
.diff-stats { display: flex; gap: 12px; margin: 0 0 8px; font-size: 12.5px; font-weight: 650; }
.diff-stats .add { color: var(--ok); } .diff-stats .del { color: var(--danger); }
.diff { margin: 0; max-height: 58vh; overflow: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 12.5px; line-height: 1.55; }
.diff-line { display: block; padding: 0 10px; white-space: pre-wrap; overflow-wrap: anywhere; }
.diff-line .sign { display: inline-block; width: 16px; color: var(--muted); user-select: none; }
.diff-line.add { background: color-mix(in srgb, var(--ok) 14%, transparent); }
.diff-line.del { background: color-mix(in srgb, var(--danger) 13%, transparent); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--danger) 50%, transparent); }
.diff-line.skip { color: var(--muted); background: var(--surface-2); text-align: center; font-style: italic; }

/* ── Gráficos ── */
.bars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.bar-row { display: grid; grid-template-columns: minmax(110px, 170px) minmax(0, 1fr) auto; align-items: center; gap: 12px; width: 100%; padding: 6px 8px; border: 0; border-radius: 8px; background: none; text-align: left; font-size: 13px; }
button.bar-row { cursor: pointer; }
button.bar-row:hover { background: var(--surface-2); }
.bar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { height: 10px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.card .bar-track { background: var(--surface-3); }
.bar-fill { display: block; height: 100%; border-radius: 999px; background: var(--brand); }
.bar-fill.warn { background: var(--warn); }
.bar-fill.public { background: var(--public); } .bar-fill.booked { background: var(--booked); } .bar-fill.inhouse { background: var(--inhouse); }
.bar-value { min-width: 74px; text-align: right; color: var(--muted); font-size: 12px; white-space: nowrap; }
.stack { display: flex; height: 18px; border-radius: 999px; overflow: hidden; background: var(--surface-2); gap: 2px; }
.stack-seg { display: block; height: 100%; }
.good { --tone: var(--ok); } .mid { --tone: var(--muted); } .bad { --tone: var(--danger); }
.stack-seg.good, .dot.good { background: var(--ok); }
.stack-seg.mid, .dot.mid { background: color-mix(in srgb, var(--muted) 60%, var(--surface-3)); }
.stack-seg.bad, .dot.bad { background: var(--danger); }
.dot.a { background: var(--series-a); } .dot.b { background: var(--series-b); }
.legend { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.legend li > button, .legend li { display: flex; align-items: center; gap: 10px; width: 100%; padding: 5px 8px; border: 0; border-radius: 8px; background: none; font-size: 13px; text-align: left; }
.legend li > button { cursor: pointer; padding: 0; }
.legend li:has(> button) { padding: 5px 8px; }
.legend li:has(> button):hover { background: var(--surface-2); }
.legend strong { margin-left: auto; }
.legend.inline { flex-direction: row; flex-wrap: wrap; gap: 4px 14px; margin-top: 8px; }
.legend.inline li { width: auto; padding: 0; color: var(--muted); font-size: 12px; }
.dot { flex: none; width: 10px; height: 10px; border-radius: 3px; }
.chart-wrap { min-width: 0; }
.chart-holder { width: 100%; min-height: 190px; overflow: hidden; }
.chart { display: block; }
.chart .grid { stroke: var(--border); stroke-width: 1; }
.chart .axis { fill: var(--muted); font-size: 10px; font-family: inherit; }
.chart .col.a { fill: var(--series-a); } .chart .col.b { fill: var(--series-b); } .chart .col.bad { fill: var(--danger); }
.chart .line { fill: none; stroke: var(--brand); stroke-width: 2.5; vector-effect: non-scaling-stroke; }
.chart .area { fill: color-mix(in srgb, var(--brand) 14%, transparent); }
.chart .point { fill: var(--surface); stroke: var(--brand); stroke-width: 2; vector-effect: non-scaling-stroke; }

/* Passos (Painel) */
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.steps li { display: flex; gap: 12px; align-items: flex-start; }
.steps p { margin: 2px 0 0; }
.step-n { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); font-weight: 750; font-size: 13px; }

/* Tabelas */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 11px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 11px 13px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { background: var(--surface-2); color: var(--muted); font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: color-mix(in srgb, var(--surface-2) 55%, transparent); }
td .chip { margin: 0 4px 4px 0; }
.sub-row td { background: var(--surface-2); color: var(--muted); font-size: 12.5px; }
.sub-row p { margin: 2px 0; }

/* Checklist (Saúde do sistema) */
.checklist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.checklist li { display: flex; gap: 10px; align-items: flex-start; }
.checklist p { margin: 0; }
.check-icon { flex: none; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; font-size: 12px; font-weight: 800; }
.checklist .ok .check-icon { background: var(--ok-soft); color: var(--ok); }
.checklist .off .check-icon { background: var(--warn-soft); color: var(--warn); }

/* Diálogos e avisos */
dialog.dialog { border: 1px solid var(--border); border-radius: 16px; background: var(--surface); color: var(--text); padding: 22px; width: min(460px, calc(100vw - 32px)); box-shadow: 0 24px 60px rgba(0, 0, 0, .28); }
dialog.dialog.wide { width: min(1100px, calc(100vw - 32px)); max-height: calc(100vh - 48px); }
dialog.dialog h2 { margin-top: 0; padding-right: 30px; }
dialog::backdrop { background: rgba(10, 15, 20, .5); }
.dialog-close { position: absolute; top: 12px; right: 14px; border: 0; background: none; font-size: 22px; line-height: 1; color: var(--muted); cursor: pointer; }
.audit-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.toasts { position: fixed; right: 18px; bottom: 18px; z-index: 50; display: flex; flex-direction: column; gap: 8px; max-width: min(420px, calc(100vw - 36px)); }
.toast { padding: 12px 16px; border-radius: 12px; background: var(--text); color: var(--bg); box-shadow: 0 12px 30px rgba(0, 0, 0, .25); font-weight: 600; font-size: 13px; transition: opacity .3s ease, transform .3s ease; }
.toast.error { background: var(--danger); color: #fff; }
.toast.out { opacity: 0; transform: translateY(6px); }

/* Acesso */
.auth-wrap { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px 16px; }
.auth { width: min(440px, 100%); padding: 34px; }
.auth h1 { margin: 0 0 6px; font-size: 25px; letter-spacing: -.035em; }
.auth .sub { margin: 0 0 18px; color: var(--muted); line-height: 1.6; }
.auth-foot { margin-top: 18px; color: var(--muted); font-size: 12px; }

/* Relatório da unidade (imprime como PDF) */
.report { max-width: 1040px; margin: 0 auto; }
.report > * + * { margin-top: 18px; }
.report-tools { display: flex; justify-content: space-between; gap: 10px; }
.report-head { display: flex; gap: 16px; align-items: center; }
.report-head h1 { margin: 0; font-size: 26px; }
.report-head p { margin: 4px 0 0; }
.report-list { margin: 0; padding-left: 18px; }
.report-list li + li { margin-top: 8px; }
.report-list p { margin: 2px 0 0; }

/* ── Responsivo ── */
@media (max-width: 1180px) {
  .split-view { grid-template-columns: minmax(280px, 340px) minmax(0, 1fr); }
  .grid-side { grid-template-columns: 1fr; }
}
@media (max-width: 960px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: sticky; top: 0; z-index: 30; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 10px 16px; border-right: 0; border-bottom: 1px solid var(--border); }
  .brand small { display: none; }
  .sidebar nav { order: 3; flex-basis: 100%; flex-direction: row; gap: 4px; overflow-x: auto; scrollbar-width: none; }
  .nav-group { flex-direction: row; gap: 4px; }
  .nav-title { display: none; }
  .sidebar nav a { padding: 7px 10px; white-space: nowrap; }
  .nav-icon { display: none; }
  .sidebar-foot { flex-direction: row; align-items: center; margin-left: auto; padding: 0; border: 0; }
  .who strong, .who small { display: none; }
  .who { padding: 0; }
  .content { padding: 22px 16px 48px; }
  .split-view, .publish-grid, .grid-2, .grid-side, .grid-side.wide-left { grid-template-columns: minmax(0, 1fr); }
  .list-col, .preview { position: static; max-height: none; }
  .queue { max-height: 46vh; }
  .split-view.has-detail .list-col { display: none; }
  .back-mobile { display: inline-flex; }
  .audit-grid { grid-template-columns: 1fr; }
  .facts.grid { grid-template-columns: minmax(110px, max-content) minmax(0, 1fr); }
}
@media (max-width: 560px) {
  .page-heading { align-items: stretch; }
  .heading-actions { width: 100%; }
  .heading-actions .segmented { overflow-x: auto; max-width: 100%; }
  .stats, .stats.four { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat { padding: 12px 14px; }
  .stat-value { font-size: 21px; }
  .card { padding: 16px; }
  .sticky-actions { margin: 14px -16px -16px; padding: 12px 16px; }
  .sticky-actions .btn { flex: 1; }
  .bar-row { grid-template-columns: minmax(90px, 120px) minmax(0, 1fr) auto; gap: 8px; }
  .facts { grid-template-columns: 1fr; gap: 2px; }
  .facts dd { margin-bottom: 8px; }
  .facts.grid { grid-template-columns: 1fr; }
  .bubble { max-width: 94%; }
  .auth { padding: 26px 22px; }
  .foot-links a { display: none; }
  .popover-body { right: auto; left: 0; width: min(300px, calc(100vw - 32px)); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* Impressão: só o relatório */
@media print {
  :root { color-scheme: light; --bg: #fff; --surface: #fff; --surface-2: #f3f5f8; --surface-3: #e7ebf0; --text: #111; --muted: #555; --border: #d9dee5; --shadow: none; }
  body { background: #fff; }
  .sidebar, .no-print, .heading-actions, .toasts { display: none !important; }
  .content { padding: 0; max-width: none; }
  .card, .stat { box-shadow: none; break-inside: avoid; }
  .table-wrap { overflow: visible; }
  a { color: inherit; }
}
