/* Brunx Design System v3 — kit CSS dos componentes.
   Base: Brunx POD em produção (moldura quase preta, sem barra superior,
   área de trabalho clara com cantos arredondados, botão preto).
   Toda cor, raio, sombra e espaço vem de tokens.css; o tema segue
   data-theme="light" | "dark" no <html> (veja ThemeToggle). */

/* ---------- Base ---------- */
html { color-scheme: light; }
html[data-theme="dark"] { color-scheme: dark; }
body {
    margin: 0;
    color: var(--ink);
    background: var(--bg);
    font-family: var(--font-sans);
    font-size: 13px;
    line-height: 1.6;
    font-synthesis: none;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}
*, *::before, *::after { box-sizing: border-box; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--selection); color: var(--ink); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.sidebar :focus-visible, .topbar :focus-visible { outline-color: var(--public-ink); }
h1, h2, h3 { font-family: var(--font-sans); letter-spacing: -.01em; color: var(--ink); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.text-link { color: var(--link); font-weight: 600; }
.text-link:hover { text-decoration: underline; }

/* ---------- Marca ---------- */
.brand-mark { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); line-height: 0; }
.brand-mark--light { color: var(--public-ink); }
.brand-mark__logo { display: block; width: auto; height: 15px; }
.brand-mark__name { font-size: 15px; line-height: 1; font-weight: 600; letter-spacing: -.01em; opacity: .7; }

.brunx-logo-spinner { display: inline-grid; place-items: center; width: 24px; height: 24px; color: var(--ink); perspective: 240px; vertical-align: middle; }
.brunx-logo-spinner__icon { width: 100%; height: auto; transform-style: preserve-3d; animation: brunx-logo-3d 1.15s cubic-bezier(.45, .05, .55, .95) infinite; }
.brunx-spinner--sm.brunx-logo-spinner { width: 16px; height: 16px; }
.brunx-spinner--md.brunx-logo-spinner { width: 28px; height: 28px; }
.btn--primary .brunx-logo-spinner { color: var(--on-action); }
@keyframes brunx-logo-3d {
    0% { transform: rotateY(0deg) rotateX(8deg); }
    50% { transform: rotateY(180deg) rotateX(-8deg); }
    100% { transform: rotateY(360deg) rotateX(8deg); }
}

/* ---------- Moldura: menu lateral + canvas ---------- */
.app { min-height: 100vh; background: var(--frame); }
.topbar { display: none; }
.sidebar { position: fixed; left: 0; top: 0; bottom: 0; z-index: 50; width: 220px; display: flex; flex-direction: column; background: var(--frame); color: var(--frame-ink); }
.sidebar__head { flex: 0 0 auto; display: grid; gap: 14px; padding: 20px 10px 10px; }
.sidebar__home { display: inline-flex; padding: 0 8px; color: var(--public-ink); }
.sidebar__home .brand-mark { color: var(--public-ink); }
.sidebar__home .brand-mark__logo { height: 13px; }
.sidebar__home .brand-mark__name { font-size: 13px; }
.global-search { position: relative; height: 34px; display: flex; align-items: center; gap: var(--space-2); padding: 0 10px; border: 1px solid var(--frame-field-border); border-radius: var(--radius-control); background: var(--frame-field); color: var(--frame-muted); }
.global-search:focus-within { border-color: var(--frame-muted); }
.global-search input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--frame-ink); font-size: 13px; }
.global-search input::placeholder { color: var(--frame-muted); }
.global-search svg { flex: 0 0 auto; }
.sidebar__nav { flex: 1; min-height: 0; padding: 6px 10px 12px; overflow-y: auto; scrollbar-width: none; }
.nav-group { margin: 1px 0; }
.nav-root { width: 100%; min-height: 32px; display: flex; align-items: center; gap: 10px; padding: 6px var(--space-2); border: 0; border-radius: var(--radius-control); background: transparent; color: var(--frame-ink); font-size: 13px; font-weight: 550; text-align: left; transition: background .14s ease, color .14s ease; }
.nav-root > svg:not(.nav-root__chevron) { flex: 0 0 auto; width: 18px; height: 18px; opacity: .9; }
.nav-root span { flex: 1; min-width: 0; }
.nav-root:hover { background: var(--frame-hover); color: var(--public-ink); }
.nav-root.is-active, .nav-root.has-active-child { background: var(--frame-active); color: var(--public-ink); font-weight: 650; }
.nav-root__chevron { margin-left: auto; opacity: .5; transition: transform .16s ease; }
.nav-group.is-open .nav-root__chevron { transform: rotate(180deg); }
.nav-children { display: grid; gap: 1px; padding: 2px 0 6px 28px; }
.nav-child { min-height: 30px; display: flex; align-items: center; padding: 5px var(--space-2); border-radius: var(--radius-control); color: var(--frame-muted); font-size: 13px; font-weight: 500; }
.nav-child:hover { background: var(--frame-hover); color: var(--public-ink); }
.nav-child.is-active { background: var(--frame-active); color: var(--public-ink); font-weight: 650; }
.sidebar__footer { display: grid; gap: 1px; padding: var(--space-2) 10px var(--space-3); border-top: 1px solid var(--frame-line); }
.sidebar__link { width: 100%; min-height: 32px; display: flex; align-items: center; gap: var(--space-2); padding: 7px var(--space-2); border: 0; border-radius: var(--radius-control); background: transparent; color: var(--frame-ink); font-size: 13px; font-weight: 550; line-height: 18px; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar__link:hover, .sidebar__link[aria-expanded="true"] { background: var(--frame-hover); color: var(--public-ink); }
.sidebar__link.is-active { background: var(--frame-active); color: var(--public-ink); font-weight: 650; }
.sidebar__link .profile-avatar { width: 22px; height: 22px; font-size: 10px; }
.sidebar__mobile-head { display: none; }
.sidebar-overlay { display: none; }

.app__main { min-width: 0; margin-left: 220px; background: var(--frame); }
.app__canvas { min-height: calc(100vh - 16px); margin: var(--space-2) var(--space-2) var(--space-2) 0; border-radius: var(--radius-card); background: var(--bg); }
.context-bar { min-height: 52px; display: flex; align-items: center; gap: var(--space-2); padding: 0 var(--space-6); color: var(--muted); font-size: 12px; font-weight: 500; }
.context-bar span::after { content: "›"; margin-left: var(--space-2); color: var(--muted); }
.context-bar b { color: var(--ink); font-size: 13px; font-weight: 650; }
.app__content { max-width: 1400px; margin: 0 auto; padding: 4px var(--space-6) var(--space-10); }

.profile-avatar { width: 28px; height: 28px; display: grid; place-items: center; flex: none; border-radius: 6px; background: var(--avatar); color: var(--avatar-ink); font-size: 10px; font-weight: 800; letter-spacing: .02em; }

/* Telas menores: barra superior só com o botão de menu; menu em gaveta. */
@media (max-width: 1024px) {
    .topbar { position: fixed; inset: 0 0 auto 0; z-index: 70; height: 56px; display: flex; align-items: center; gap: var(--space-2); padding: 0 var(--space-3); background: var(--frame); color: var(--frame-ink); }
    .topbar .brand-mark { color: var(--public-ink); }
    .topbar .brand-mark__logo { height: 12px; }
    .mobile-menu { width: 36px; height: 36px; display: grid; place-items: center; border: 0; border-radius: var(--radius-control); background: transparent; color: var(--frame-ink); }
    .mobile-menu:hover { background: var(--frame-hover); }
    .sidebar { top: 0; width: min(280px, 84vw); z-index: 90; transform: translateX(-100%); transition: transform .2s ease; }
    .sidebar.is-open { transform: none; box-shadow: var(--shadow-modal); }
    .sidebar__home { display: none; }
    .sidebar__mobile-head { display: flex; align-items: center; justify-content: space-between; height: 56px; padding: 0 var(--space-3) 0 var(--space-4); border-bottom: 1px solid var(--frame-line); color: var(--frame-ink); font-size: 13px; font-weight: 650; }
    .sidebar__close { width: 32px; height: 32px; display: grid; place-items: center; border: 0; border-radius: var(--radius-control); background: transparent; color: var(--frame-ink); }
    .sidebar__head { padding-top: var(--space-3); }
    .sidebar-overlay.is-open { display: block; position: fixed; inset: 0; z-index: 80; border: 0; background: var(--overlay); }
    .app__main { margin-left: 0; padding-top: 56px; }
    .app__canvas { margin: 0; border-radius: 0; min-height: calc(100vh - 56px); }
    .context-bar { padding: 0 var(--space-5); }
    .app__content { padding: 4px var(--space-5) 36px; }
    .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dash-top { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
    .context-bar { padding: 0 14px; }
    .app__content { padding: 4px 14px 30px; }
    .page-header { flex-direction: column; align-items: stretch; }
    .shortcuts { grid-template-columns: 1fr; }
}

/* ---------- Cabeçalho de página ---------- */
.eyebrow { margin: 0 0 6px; color: var(--muted); font-size: 12px; font-weight: 500; }
.page-header { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); margin-bottom: var(--space-6); }
.page-header h1 { margin: 0; font-size: 20px; font-weight: 700; line-height: 1.3; }
.page-header > div > p:not(.eyebrow) { max-width: 72ch; margin: var(--space-2) 0 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.page-header__actions { flex: none; display: flex; gap: var(--space-2); flex-wrap: wrap; }

/* Saudação do painel inicial + período */
.dash-hero { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--space-4) var(--space-6); flex-wrap: wrap; margin-bottom: var(--space-4); }
.dash-hero h1 { margin: 2px 0 4px; font-size: 22px; font-weight: 700; line-height: 1.25; }
.dash-hero p { margin: 0; color: var(--muted); font-size: 13px; }
.dash-hero__period { display: grid; justify-items: end; gap: 6px; }
.dash-hero__period small { color: var(--muted); font-size: 12px; }
.segmented { display: inline-flex; padding: 3px; gap: 2px; border: 1px solid var(--border); border-radius: var(--radius-item); background: var(--surface); }
.segmented button { border: 0; border-radius: 7px; background: none; padding: 6px 10px; color: var(--ink); font-size: 12px; font-weight: 550; white-space: nowrap; }
.segmented button:hover { background: var(--action-soft); }
.segmented button.is-active, .segmented button[aria-pressed="true"] { background: var(--action); color: var(--on-action); }
.section-title { display: flex; align-items: baseline; gap: 10px; margin: 22px 0 10px; font-size: 15px; font-weight: 700; }
.section-title small { color: var(--muted); font-size: 12px; font-weight: 500; }

/* ---------- Botões ---------- */
.btn { min-height: 32px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 6px var(--space-3); border: 0; border-radius: var(--radius-control); font-size: 12px; font-weight: 650; line-height: 1.2; white-space: nowrap; transition: background .14s ease; }
.btn--primary { background: var(--action); color: var(--on-action); box-shadow: var(--shadow-btn-primary); }
.btn--primary:hover { background: var(--action-hover); }
.btn--secondary { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-btn); }
.btn--secondary:hover { background: var(--surface-sunken); }
.btn--plain { background: transparent; color: var(--link); box-shadow: none; }
.btn--plain:hover { text-decoration: underline; }
.btn--danger { background: var(--danger-fill); color: var(--public-ink); box-shadow: var(--shadow-btn-danger); }
.btn--danger:hover { filter: brightness(.88); }
.btn--large { min-height: 40px; padding: var(--space-2) var(--space-4); font-size: 13px; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; box-shadow: none; cursor: not-allowed; }
.icon-btn { width: 32px; height: 32px; display: grid; place-items: center; padding: 0; border: 0; border-radius: var(--radius-control); background: var(--surface); color: var(--ink); box-shadow: var(--shadow-btn); }
.icon-btn:hover { background: var(--surface-sunken); }

/* ---------- Selos ---------- */
.badge { display: inline-flex; align-items: center; gap: 4px; min-height: 20px; padding: 2px var(--space-2); border-radius: var(--radius-control); background: var(--neutral-soft); color: var(--ink); font-size: 12px; font-weight: 550; line-height: 16px; white-space: nowrap; }
.badge--success { background: var(--success-soft); color: var(--success); }
.badge--warning { background: var(--warning-soft); color: var(--warning); }
.badge--danger { background: var(--danger-soft); color: var(--danger); }
.badge--info { background: var(--info-soft); color: var(--info); }

/* ---------- Cards ---------- */
.panel, .toolbar, .stat, .empty-card { border: 0; border-radius: var(--radius-card); background: var(--surface); box-shadow: var(--shadow-card); }
.panel { min-width: 0; overflow: hidden; }
.panel__header { min-height: 48px; display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: 0 var(--space-4); border-bottom: 1px solid var(--divider); }
.panel__header h2 { margin: 0; font-size: 14px; font-weight: 650; letter-spacing: 0; }
.panel__body { padding: var(--space-5); }
.panel__footer { display: flex; justify-content: flex-end; gap: var(--space-2); padding: var(--space-3) var(--space-4); border-top: 1px solid var(--divider); }

/* ---------- KPIs ---------- */
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-4); margin-bottom: var(--space-4); }
.stat { padding: 18px var(--space-5); }
.stat p { margin: 0 0 10px; color: var(--ink); font-size: 13px; font-weight: 600; }
.stat__label--help { display: inline-block; border-bottom: 1px dashed var(--control-border); cursor: help; }
.stat strong { display: block; color: var(--ink); font-size: 20px; font-weight: 700; line-height: 1.2; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.stat small { display: block; margin-top: 6px; color: var(--muted); font-size: 12px; }
.stat--interactive { transition: box-shadow .14s ease; }
.stat--interactive:hover, .stat--interactive:focus-visible { box-shadow: var(--shadow-card-hover); }

/* ---------- Avisos e atalhos do painel ---------- */
.dash-top { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: var(--space-3); margin-bottom: var(--space-4); align-items: stretch; }
.notice-list { display: grid; gap: var(--space-2); margin: 0; padding: var(--space-3) var(--space-4) var(--space-4); list-style: none; }
.notice { display: grid; grid-template-columns: 8px minmax(0, 1fr) auto; align-items: center; gap: var(--space-3); min-height: 44px; padding: 10px var(--space-3); border: 1px solid var(--border); border-radius: var(--radius-item); background: var(--surface-subtle); }
.notice > i { width: 8px; height: 8px; border-radius: 50%; background: var(--dot-info); }
.notice--warning > i { background: var(--dot-warning); }
.notice--danger > i { background: var(--dot-danger); }
.notice b { display: block; font-size: 13px; font-weight: 650; }
.notice small { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; line-height: 1.4; }
.shortcuts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-2); padding: var(--space-3) var(--space-4) var(--space-4); }
.shortcut { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: var(--space-2) var(--space-3); border: 1px solid var(--border); border-radius: var(--radius-item); background: var(--surface-subtle); color: var(--ink); font-size: 13px; font-weight: 600; transition: background .14s ease, border-color .14s ease, transform .14s ease; }
.shortcut:hover, .shortcut:focus-visible { background: var(--surface); border-color: var(--border-strong); transform: translateY(-1px); }
.shortcut svg { flex: 0 0 auto; color: var(--accent); }

/* ---------- Comunicado (card claro) ---------- */
.editorial-banner { display: flex; align-items: center; justify-content: space-between; gap: var(--space-6); margin-bottom: var(--space-4); padding: var(--space-4) var(--space-5); border-radius: var(--radius-card); background: var(--surface); box-shadow: var(--shadow-card); }
.editorial-banner__tag { display: inline-flex; padding: 2px var(--space-2); border-radius: var(--radius-control); background: var(--info-soft); color: var(--info); font-size: 12px; font-weight: 550; }
.editorial-banner h2 { margin: var(--space-2) 0 4px; font-size: 16px; font-weight: 650; }
.editorial-banner p { margin: 0; color: var(--muted); font-size: 13px; }

/* ---------- Toolbar, busca e filtros ---------- */
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap; margin-bottom: var(--space-5); padding: var(--space-3) var(--space-4); }
.toolbar__group { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }
.search-input { min-width: 260px; height: 32px; display: flex; align-items: center; gap: var(--space-2); padding: 0 10px; border: 1px solid var(--border); border-radius: var(--radius-control); background: var(--surface); color: var(--muted); }
.search-input input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 13px; }
.search-input input::placeholder { color: var(--muted); }
.search-input:focus-within { border-color: var(--focus); box-shadow: 0 0 0 1px var(--focus); }
.filter-select { height: 32px; padding: 0 30px 0 10px; border: 1px solid var(--border); border-radius: var(--radius-control); background: var(--surface) 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='%238a8a8a' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 9px center; color: var(--ink); font-size: 13px; -webkit-appearance: none; appearance: none; outline: none; }
.filter-select:focus-visible { border-color: var(--focus); box-shadow: 0 0 0 1px var(--focus); }
input[type="checkbox"], input[type="radio"] { accent-color: var(--action); width: 16px; height: 16px; }

/* ---------- Formulário ---------- */
.form-field { display: grid; gap: 6px; margin-bottom: var(--space-4); }
.form-field label { color: var(--ink); font-size: 13px; font-weight: 500; }
.form-field input, .form-field select, .form-field textarea { width: 100%; border: 1px solid var(--control-border); border-radius: var(--radius-control); background-color: var(--surface); color: var(--ink); font-size: 13px; outline: none; }
.form-field input, .form-field select { min-height: 36px; padding: 0 var(--space-3); }
.form-field textarea { min-height: 100px; padding: var(--space-2) var(--space-3); line-height: 1.55; resize: vertical; }
.form-field select { -webkit-appearance: none; appearance: none; padding-right: 32px; 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='%238a8a8a' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
.form-field input::placeholder, .form-field textarea::placeholder { color: var(--muted); }
.form-field input:focus, .form-field select:focus, .form-field textarea:focus { border-color: var(--focus); box-shadow: 0 0 0 1px var(--focus); }
.form-field__hint { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.form-field.is-invalid input, .form-field.is-invalid select, .form-field.is-invalid textarea { border-color: var(--danger); }
.form-field.is-invalid .form-field__hint { color: var(--danger); font-weight: 550; }

/* ---------- Tabela ---------- */
.data-table { width: 100%; border-collapse: collapse; background: var(--surface); font-size: 13px; }
.data-table th { padding: 10px 14px; border-bottom: 1px solid var(--divider); background: var(--surface-sunken); color: var(--muted); font-size: 12px; font-weight: 550; text-align: left; white-space: nowrap; }
.data-table td { padding: var(--space-3) 14px; border-bottom: 1px solid var(--divider); color: var(--ink); line-height: 1.45; vertical-align: middle; }
.data-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.data-table tbody tr:hover > td { background: var(--surface-sunken); }
.data-table tbody tr:has(a[href]) { cursor: pointer; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table a { color: var(--ink); font-weight: 650; }
.data-table code { padding: 2px 6px; border-radius: 5px; background: var(--neutral-soft); color: var(--ink); font: 600 11px/1.3 var(--font-mono); }
.table-sub { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; line-height: 1.45; }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-scroll > .data-table { min-width: 640px; }
.table-pagination { min-height: 48px; display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); padding: var(--space-2) var(--space-3); border-top: 1px solid var(--divider); background: var(--surface-sunken); }
.table-pagination__summary { color: var(--muted); font-size: 12px; }
.table-pagination__summary b { color: var(--ink); }
.table-pagination__controls { display: flex; gap: var(--space-1); }
.table-pagination__controls button { min-width: 30px; height: 30px; display: grid; place-items: center; border: 0; border-radius: var(--radius-control); background: var(--surface); color: var(--ink); font-size: 12px; font-weight: 650; box-shadow: var(--shadow-btn); }
.table-pagination__controls button.is-active { background: var(--action); color: var(--on-action); box-shadow: var(--shadow-btn-primary); }
.table-pagination__controls button:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- Abas ---------- */
.tabs { display: flex; gap: var(--space-1); padding: 6px var(--space-2); border-bottom: 1px solid var(--divider); background: var(--surface); overflow-x: auto; }
.tabs button { display: inline-flex; align-items: center; gap: 6px; padding: 6px var(--space-3); border: 0; border-radius: var(--radius-control); background: transparent; color: var(--muted); font-size: 13px; font-weight: 550; white-space: nowrap; }
.tabs button:hover { background: var(--action-soft); color: var(--ink); }
.tabs button.is-active { background: var(--tab-active); color: var(--ink); font-weight: 650; }
.tabs__count { min-width: 20px; padding: 1px 6px; border-radius: var(--radius-pill); background: var(--action-soft); color: var(--muted); font-size: 11px; font-weight: 650; text-align: center; }
.tabs button.is-active .tabs__count { background: var(--surface); color: var(--ink); }

/* ---------- Etapas e progresso ---------- */
.progress-flow { display: flex; margin-bottom: var(--space-4); border-radius: var(--radius-card); background: var(--surface); box-shadow: var(--shadow-card); overflow: hidden; overflow-x: auto; }
.progress-step { flex: 1; min-width: 120px; position: relative; padding: var(--space-3) var(--space-4); border-right: 1px solid var(--divider); }
.progress-step:last-child { border-right: 0; }
.progress-step span { display: block; color: var(--muted); font-size: 12px; }
.progress-step b { display: block; margin-top: 2px; font-size: 13px; font-weight: 650; }
.progress-step.is-done::after, .progress-step.is-current::after { content: ""; position: absolute; inset: auto 0 0 0; height: 3px; background: var(--success); }
.progress-step.is-current::after { background: var(--action); }
.progress-track { height: 8px; border-radius: var(--radius-pill); background: var(--action-soft); overflow: hidden; }
.progress-track > span { display: block; height: 100%; border-radius: inherit; background: var(--chart-1); }

/* ---------- Estado vazio ---------- */
.empty-state { padding: var(--space-10) var(--space-6); text-align: center; color: var(--muted); }
.empty-state svg { color: var(--muted); }
.empty-state h3 { margin: var(--space-3) 0 4px; font-size: 15px; font-weight: 650; }
.empty-state p { max-width: 420px; margin: 0 auto; font-size: 13px; line-height: 1.5; }
.empty-state .btn { margin-top: var(--space-4); }

/* ---------- Skeleton ---------- */
.skeleton { display: block; border-radius: 6px; background: linear-gradient(90deg, var(--skeleton) 0%, var(--skeleton-shine) 50%, var(--skeleton) 100%); background-size: 200% 100%; animation: skeleton-shine 1.3s ease-in-out infinite; }
.skeleton--text { height: 12px; }
.skeleton--title { height: 20px; width: 40%; }
.skeleton--block { height: 96px; border-radius: var(--radius-card); }
@keyframes skeleton-shine { from { background-position: 100% 0; } to { background-position: -100% 0; } }

/* ---------- Avisos inline e toast ---------- */
.alert { display: flex; align-items: flex-start; gap: 10px; margin-bottom: var(--space-3); padding: 10px var(--space-3); border-radius: var(--radius-control); background: var(--success-soft); color: var(--success); font-size: 13px; font-weight: 550; line-height: 1.45; }
.alert > svg { flex: none; margin-top: 1px; }
.alert--warning { background: var(--warning-soft); color: var(--warning); }
.alert--danger { background: var(--danger-soft); color: var(--danger); }
.alert--info { background: var(--info-soft); color: var(--info); }
.alert--toast { position: fixed; top: 20px; left: 50%; z-index: 1200; margin: 0; width: max-content; max-width: min(560px, calc(100vw - 32px)); padding: var(--space-3) var(--space-3) var(--space-3) var(--space-4); border-radius: var(--radius-card); box-shadow: var(--shadow-float); transform: translateX(-50%); animation: toast-in .28s ease-out, toast-out .35s ease-in 6s forwards; }
.alert--toast.alert--danger { animation: toast-in .28s ease-out; }
.alert__close { margin-left: auto; display: inline-flex; padding: 2px; border: 0; background: none; color: inherit; opacity: .7; }
.alert__close:hover { opacity: 1; }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, -10px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes toast-out { to { opacity: 0; visibility: hidden; transform: translate(-50%, -10px); } }

/* ---------- Modal ---------- */
.modal-backdrop { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: var(--space-4); background: var(--overlay); }
.modal { width: min(480px, 100%); border-radius: var(--radius-card); background: var(--surface-raised); box-shadow: var(--shadow-modal); overflow: hidden; }
.modal__header { display: flex; align-items: center; justify-content: space-between; min-height: 52px; padding: 0 var(--space-4); border-bottom: 1px solid var(--divider); }
.modal__header h2 { margin: 0; font-size: 14px; font-weight: 650; }
.modal__body { padding: var(--space-4); color: var(--ink); font-size: 13px; line-height: 1.6; }
.modal__body p { margin: 0; }
.modal__footer { display: flex; justify-content: flex-end; gap: var(--space-2); padding: var(--space-3) var(--space-4); border-top: 1px solid var(--divider); }

/* ---------- Kanban ---------- */
.kanban { display: grid; grid-template-columns: repeat(3, minmax(220px, 1fr)); gap: var(--space-3); align-items: start; }
.kanban__column { padding: var(--space-2); border-radius: var(--radius-card); background: var(--action-soft); }
.kanban__head { display: flex; align-items: center; justify-content: space-between; padding: 4px var(--space-2) var(--space-2); font-size: 13px; font-weight: 650; }
.kanban__head b { min-width: 20px; padding: 1px 6px; border-radius: var(--radius-pill); background: var(--surface); color: var(--muted); font-size: 11px; text-align: center; }
.kanban-card { display: grid; gap: 6px; margin-bottom: var(--space-2); padding: 10px var(--space-3); border-radius: var(--radius-item); background: var(--surface); box-shadow: var(--shadow-card); cursor: grab; }
.kanban-card:hover { box-shadow: var(--shadow-card-hover); }
.kanban-card__id { color: var(--muted); font: 600 11px/1 var(--font-mono); }
.kanban-card__title { margin: 0; font-size: 13px; font-weight: 600; line-height: 1.4; }
.kanban-card__meta { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); }
.kanban-card__meta .profile-avatar { width: 22px; height: 22px; }

/* ---------- Alternador de tema ---------- */
.theme-toggle { display: inline-flex; padding: 3px; gap: 2px; border: 1px solid var(--border); border-radius: var(--radius-item); background: var(--surface); }
.theme-toggle button { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border: 0; border-radius: 7px; background: none; color: var(--ink); font-size: 12px; font-weight: 550; }
.theme-toggle button:hover { background: var(--action-soft); }
.theme-toggle button[aria-pressed="true"] { background: var(--action); color: var(--on-action); }

/* ---------- Brunx IA ----------
   O ícone Brunx é a cara da Brunx IA: aparece só aqui (botão, avatar)
   e no Spinner — nunca no logo dos sistemas. */
.brunx-ai { position: fixed; right: 16px; bottom: 16px; z-index: 60; display: grid; justify-items: end; gap: 10px; }
.brunx-ai__symbol { width: 20px; height: auto; display: block; color: var(--ink); }
.brunx-ai__launcher { display: inline-flex; align-items: center; gap: var(--space-2); height: 42px; padding: 0 var(--space-4) 0 14px; border: 1px solid var(--border); border-radius: var(--radius-pill); background: var(--surface-raised); color: var(--ink); font-size: 13px; font-weight: 650; box-shadow: var(--shadow-launcher); }
.brunx-ai__launcher:hover, .brunx-ai__launcher.is-open { background: var(--surface-sunken); }
.brunx-ai__avatar { flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%; background: var(--ai-avatar); color: var(--public-ink); }
.brunx-ai__avatar svg { display: block; height: auto; }
.brunx-ai__avatar--small { width: 26px; height: 26px; }
.brunx-ai__avatar--small svg { width: 14px; }
.brunx-ai__avatar--large { width: 30px; height: 30px; }
.brunx-ai__avatar--large svg { width: 16px; }
.brunx-ai__panel { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; width: min(420px, calc(100vw - 32px)); height: min(640px, calc(100vh - 110px)); border: 1px solid var(--border); border-radius: var(--radius-panel); background: var(--surface-raised); box-shadow: var(--shadow-modal); overflow: hidden; animation: brunx-ai-in .18s ease-out; }
.brunx-ai__head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); padding: var(--space-3) 10px var(--space-3) var(--space-4); border-bottom: 1px solid var(--border); }
.brunx-ai__title { display: inline-flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 700; line-height: 1.2; }
.brunx-ai__title > span { display: grid; }
.brunx-ai__title small { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 11px; font-weight: 500; }
.brunx-ai__title small i { width: 7px; height: 7px; border-radius: 50%; background: var(--ai-online); }
.brunx-ai__close { width: 32px; height: 32px; display: grid; place-items: center; border: 0; border-radius: var(--radius-control); background: none; color: inherit; }
.brunx-ai__close:hover { background: var(--action-soft); }
.brunx-ai__log { display: grid; align-content: start; gap: var(--space-3); padding: 14px; overflow-y: auto; background: var(--ai-log); }
.brunx-ai__intro { padding: var(--space-4); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow-bubble); }
.brunx-ai__intro h2 { margin: 0 0 6px; font-size: 18px; font-weight: 700; }
.brunx-ai__intro p { margin: 0 0 14px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.brunx-ai__suggestions { display: grid; gap: var(--space-2); }
.brunx-ai__suggestions button { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; padding: 11px var(--space-3); border: 1px solid var(--border); border-radius: var(--radius-item); background: var(--surface); color: var(--ink); font-size: 13px; text-align: left; transition: border-color .15s, background .15s; }
.brunx-ai__suggestions button svg { flex: 0 0 auto; color: var(--muted); }
.brunx-ai__suggestions button:hover { border-color: var(--ink); background: var(--surface-subtle); }
.brunx-ai__row { display: flex; align-items: flex-start; gap: var(--space-2); max-width: 94%; }
.brunx-ai__turn { max-width: 86%; padding: 10px 13px; border-radius: var(--radius-bubble); font-size: 13.5px; line-height: 1.55; overflow-wrap: anywhere; }
.brunx-ai__row .brunx-ai__turn { max-width: none; }
.brunx-ai__turn p, .brunx-ai__turn ul { margin: 0 0 var(--space-2); }
.brunx-ai__turn > :last-child { margin-bottom: 0; }
.brunx-ai__turn ul { padding-left: 18px; }
.brunx-ai__turn small { display: block; margin-top: var(--space-2); padding-top: var(--space-2); border-top: 1px solid var(--border); color: var(--muted); font-size: 11.5px; }
.brunx-ai__turn a { color: var(--link); text-decoration: underline; }
.brunx-ai__turn--user { justify-self: end; border-bottom-right-radius: 5px; background: var(--action); color: var(--on-action); }
.brunx-ai__turn--assistant { justify-self: start; border-top-left-radius: 5px; background: var(--surface); box-shadow: var(--shadow-bubble); }
.brunx-ai__typing { display: inline-flex; gap: 4px; padding: 14px; }
.brunx-ai__typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: brunx-ai-dot 1.2s infinite ease-in-out; }
.brunx-ai__typing span:nth-child(2) { animation-delay: .15s; }
.brunx-ai__typing span:nth-child(3) { animation-delay: .3s; }
.brunx-ai__foot { display: grid; gap: var(--space-2); padding: 10px var(--space-3); border-top: 1px solid var(--border); background: var(--surface-raised); }
.brunx-ai__chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.brunx-ai__chips button { flex: 0 0 auto; padding: 6px var(--space-3); border: 1px solid var(--border); border-radius: var(--radius-pill); background: var(--surface); color: var(--ink); font-size: 12px; }
.brunx-ai__chips button:hover { border-color: var(--ink); }
.brunx-ai__form { display: flex; align-items: flex-end; gap: 6px; padding: 6px 6px 6px var(--space-3); border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.brunx-ai__form:focus-within { border-color: var(--ink); box-shadow: 0 0 0 3px var(--action-soft); }
.brunx-ai__form textarea { flex: 1; min-height: 34px; max-height: 120px; padding: 7px 0; border: 0; outline: 0; background: none; color: var(--ink); font-size: 13.5px; resize: none; }
.brunx-ai__send { flex: 0 0 auto; width: 34px; height: 34px; display: grid; place-items: center; border: 0; border-radius: 50%; background: var(--action); color: var(--on-action); }
.brunx-ai__send:disabled { background: var(--skeleton); color: var(--muted); cursor: default; }
.brunx-ai__note { margin: 0; color: var(--muted); font-size: 11px; text-align: center; }
@keyframes brunx-ai-in { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes brunx-ai-dot { 0%, 60%, 100% { opacity: .35; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }

/* ---------- Gráficos ---------- */
.chart-legend { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4); margin: 0 0 var(--space-3); padding: 0; list-style: none; color: var(--ink); font-size: 12px; }
.chart-legend li { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend i { width: 10px; height: 10px; border-radius: 3px; }

/* ---------- Atalho de teclado ---------- */
.kbd { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; border: 1px solid var(--border); border-radius: 5px; background: var(--surface-sunken); color: var(--muted); font: 600 11px/1 var(--font-sans); }
.global-search .kbd { margin-left: auto; border-color: var(--frame-field-border); background: transparent; color: var(--frame-muted); }

/* ---------- Busca global (CommandPalette) ---------- */
.palette-backdrop { position: fixed; inset: 0; z-index: 1000; display: grid; justify-items: center; align-content: start; padding: 12vh var(--space-4) var(--space-4); background: var(--overlay); }
.palette { width: min(var(--palette-width), 100%); max-height: min(520px, 76vh); display: grid; grid-template-rows: auto minmax(0, 1fr) auto; border-radius: var(--radius-card); background: var(--surface-raised); box-shadow: var(--shadow-modal); overflow: hidden; }
.palette:has(.palette__empty) { grid-template-rows: auto auto; }
.palette__input { display: flex; align-items: center; gap: var(--space-3); height: 52px; padding: 0 var(--space-4); border-bottom: 1px solid var(--divider); color: var(--muted); }
.palette__input input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 15px; }
.palette__input input::placeholder { color: var(--muted); }
.palette__list { margin: 0; padding: var(--space-2); overflow-y: auto; list-style: none; }
.palette__group { padding: var(--space-2) var(--space-3) 4px; color: var(--muted); font-size: 12px; font-weight: 550; }
.palette__item { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 var(--space-3); border-radius: var(--radius-control); color: var(--ink); font-size: 13px; font-weight: 550; cursor: pointer; }
.palette__item > svg { flex: none; color: var(--muted); }
.palette__item > span:not(.kbd) { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.palette__item small { margin-left: auto; color: var(--muted); font-size: 12px; font-weight: 400; white-space: nowrap; }
.palette__item .kbd { flex: none; }
.palette__item:hover { background: var(--action-soft); }
.palette__item[aria-selected="true"] { background: var(--tab-active); font-weight: 650; }
.palette__item[aria-selected="true"] > svg { color: var(--ink); }
.palette__item mark { background: transparent; color: inherit; font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
.palette__empty { margin: 0; padding: var(--space-6) var(--space-4); color: var(--muted); font-size: 13px; text-align: center; }
.palette__foot { display: flex; align-items: center; gap: var(--space-4); padding: 10px var(--space-4); border-top: 1px solid var(--divider); background: var(--surface-sunken); color: var(--muted); font-size: 12px; }
.palette__foot > span { display: inline-flex; align-items: center; gap: 6px; }
.palette__foot .kbd { background: var(--surface-raised); }

/* ---------- Log de atividade ---------- */
.activity-day { margin: 0; padding: 8px var(--space-4); border-bottom: 1px solid var(--divider); background: var(--surface-sunken); color: var(--muted); font-size: 12px; font-weight: 550; }
.activity-day:not(:first-of-type) { border-top: 1px solid var(--divider); }
.activity-list { margin: 0; padding: 0; list-style: none; }
.activity-item { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: var(--space-3); align-items: start; padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--divider); }
.activity-item:last-child { border-bottom: 0; }
.activity-actor { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 6px; background: var(--neutral-soft); color: var(--ink); }
.activity-actor--person { background: var(--avatar); color: var(--avatar-ink); font-size: 10px; font-weight: 800; letter-spacing: .02em; }
.activity-item__text { margin: 0; color: var(--ink); font-size: 13px; line-height: 1.5; }
.activity-item__text b { font-weight: 650; }
.activity-item__text a { color: var(--ink); font-weight: 650; text-decoration: underline; text-underline-offset: 2px; }
.activity-item__meta { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; margin-top: 4px; color: var(--muted); font-size: 12px; }
.activity-change { display: inline-flex; align-items: center; gap: 6px; font-variant-numeric: tabular-nums; }
.activity-item time { color: var(--muted); font-size: 12px; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ---------- Revisar alterações ---------- */
.review-summary { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--divider); color: var(--muted); font-size: 13px; }
.review-list { margin: 0; padding: 0; list-style: none; }
.review-item { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: var(--space-3); padding: var(--space-4); border-bottom: 1px solid var(--divider); }
.review-item:last-child { border-bottom: 0; }
.review-item h3 { margin: 0; font-size: 13px; font-weight: 650; }
.review-item p { margin: 2px 0 var(--space-3); color: var(--muted); font-size: 12px; }
.diff { display: grid; border: 1px solid var(--border); border-radius: var(--radius-control); overflow: hidden; font-size: 13px; }
.diff__row { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: var(--space-2); align-items: start; padding: 6px var(--space-3); line-height: 1.5; overflow-wrap: anywhere; }
.diff__row > b { font-weight: 700; text-align: center; }
.diff__row--remove { background: var(--danger-soft); color: var(--danger); }
.diff__row--add { background: var(--success-soft); color: var(--success); }
.review-footer { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap; padding: var(--space-3) var(--space-4); border-top: 1px solid var(--divider); background: var(--surface-sunken); }
.review-footer small { max-width: 52ch; color: var(--muted); font-size: 12px; line-height: 1.45; }

/* ---------- Checklist de pendências ---------- */
.checklist__progress { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--divider); }
.checklist__progress .progress-track { flex: 1; }
.checklist__progress > span { color: var(--muted); font-size: 12px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.checklist { margin: 0; padding: 0; list-style: none; }
.checklist__item { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; gap: var(--space-3); align-items: center; padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--divider); }
.checklist__item:last-child { border-bottom: 0; }
.checklist__icon { display: grid; place-items: center; color: var(--muted); }
.checklist__item.is-done .checklist__icon { color: var(--success); }
.checklist__item.is-blocked .checklist__icon { color: var(--danger); }
.checklist__item b { display: block; font-size: 13px; font-weight: 650; }
.checklist__item small { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; line-height: 1.4; }

/* ---------- Faixa de conectividade ---------- */
.conn-banner { display: flex; align-items: flex-start; gap: var(--space-3); margin-bottom: var(--space-3); padding: 10px var(--space-4); border-radius: var(--radius-item); background: var(--info-soft); color: var(--info); font-size: 13px; }
.conn-banner > svg { flex: none; margin-top: 1px; }
.conn-banner__text { flex: 1; min-width: 0; }
.conn-banner__text b { display: block; font-weight: 650; }
.conn-banner__text > span { display: block; margin-top: 2px; font-weight: 400; line-height: 1.45; }
.conn-banner__actions { flex: none; display: flex; align-items: center; gap: var(--space-2); }
.conn-banner--offline { background: var(--danger-soft); color: var(--danger); }
.conn-banner--degraded { background: var(--warning-soft); color: var(--warning); }
.conn-banner--online { background: var(--success-soft); color: var(--success); }
.conn-services { display: flex; flex-wrap: wrap; gap: 4px var(--space-4); margin: var(--space-2) 0 0; padding: 0; list-style: none; font-size: 12px; font-weight: 550; }
.conn-services li { display: inline-flex; align-items: center; gap: 6px; }
.conn-services i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.conn-services .is-down i { border-radius: 2px; }

/* ---------- Histórico de versões ---------- */
.versions { margin: 0; padding: 0; list-style: none; }
.version { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-3); align-items: center; padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--divider); }
.version:last-child { border-bottom: 0; }
.version.is-current { background: var(--surface-subtle); }
.version b { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; font-size: 13px; font-weight: 650; }
.version small { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; line-height: 1.4; }
.version__actions { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }

@media (max-width: 760px) {
    .activity-item { grid-template-columns: 28px minmax(0, 1fr); }
    .activity-item time { grid-column: 2; }
    .checklist__item { grid-template-columns: 20px minmax(0, 1fr); }
    .checklist__item > .btn { grid-column: 2; justify-self: start; }
    .conn-banner { flex-wrap: wrap; }
    .conn-banner__actions:has(.btn) { width: 100%; padding-left: 30px; }
    .version { grid-template-columns: 1fr; }
    .palette-backdrop { padding-top: 8vh; }
}

/* ---------- Opções em cards (OptionTiles) ---------- */
.option-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: var(--space-2); margin: 0; padding: 0; border: 0; min-width: 0; }
.option-tile { position: relative; display: grid; gap: 4px; padding: var(--space-3) var(--space-4); border: 1px solid var(--control-border); border-radius: var(--radius-item); background: var(--surface); color: var(--ink); cursor: pointer; transition: background .14s ease; }
.option-tile input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: inherit; }
.option-tile b { display: flex; align-items: center; gap: var(--space-2); font-size: 13px; font-weight: 650; }
.option-tile small { color: var(--muted); font-size: 12px; line-height: 1.4; }
.option-tile__check { flex: none; width: 16px; height: 16px; display: grid; place-items: center; border: 1.5px solid var(--control-border); border-radius: 50%; color: var(--on-action); }
.option-tile__check svg { display: none; }
.option-tile:hover { background: var(--surface-subtle); }
.option-tile:has(input:checked) { border-color: var(--action); box-shadow: 0 0 0 1px var(--action); background: var(--surface-subtle); }
.option-tile:has(input:checked) .option-tile__check { border-color: var(--action); background: var(--action); }
.option-tile:has(input:checked) .option-tile__check svg { display: block; }
.option-tile:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 1px; }
.option-tile:has(input:disabled) { opacity: .5; cursor: not-allowed; }
.option-tile:has(input:disabled):hover { background: var(--surface); }

/* ---------- Anotações em gráficos (ChartAnnotation) ---------- */
.chart-frame { position: relative; }
.chart-pin { display: inline-grid; place-items: center; flex: none; width: 20px; height: 20px; border-radius: 50%; background: var(--action); color: var(--on-action); font: 700 11px/1 var(--font-sans); box-shadow: 0 0 0 2px var(--surface); }
.chart-frame > .chart-pin { position: absolute; transform: translate(-50%, -50%); }
.chart-notes { display: grid; gap: var(--space-2); margin: var(--space-3) 0 0; padding: 0; list-style: none; }
.chart-notes li { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 10px; align-items: start; color: var(--ink); font-size: 12px; line-height: 1.5; }
.chart-notes time { color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------- Resumo de erros (FormErrorSummary) ---------- */
.error-summary { margin-bottom: var(--space-4); padding: var(--space-3) var(--space-4); border-radius: var(--radius-item); background: var(--danger-soft); color: var(--danger); }
.error-summary:focus-visible { outline-offset: 2px; }
.error-summary h2 { margin: 0 0 4px; color: inherit; font-size: 13px; font-weight: 650; letter-spacing: 0; }
.error-summary ul { margin: 0; padding-left: 18px; font-size: 13px; }
.error-summary a { color: inherit; font-weight: 650; text-decoration: underline; text-underline-offset: 2px; }
.form-field__error { display: flex; align-items: center; gap: 6px; margin: 0; color: var(--danger); font-size: 12px; font-weight: 550; line-height: 1.45; }
.form-field__error svg { flex: none; }

/* ---------- Edição no lugar (InlineEdit) ---------- */
.meta-list { display: grid; margin: 0; }
.meta-row { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: var(--space-3); align-items: center; min-height: 48px; padding: 6px var(--space-4); border-bottom: 1px solid var(--divider); }
.meta-row:last-child { border-bottom: 0; }
.meta-row dt { color: var(--muted); font-size: 12px; font-weight: 550; }
.meta-row dd { margin: 0; min-width: 0; font-size: 13px; }
.inline-edit__value { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; min-height: 32px; margin: 0 0 0 -8px; padding: 4px 8px; border: 0; border-radius: var(--radius-control); background: transparent; color: var(--ink); font: inherit; text-align: left; }
.inline-edit__value svg { flex: none; color: var(--muted); }
.inline-edit__value:hover { background: var(--action-soft); }
.inline-edit__form { display: flex; align-items: center; gap: var(--space-2); }
.inline-edit__form input { flex: 1; min-width: 0; max-width: 320px; min-height: 36px; padding: 0 var(--space-3); border: 1px solid var(--focus); border-radius: var(--radius-control); background: var(--surface); color: var(--ink); font-size: 13px; outline: none; box-shadow: 0 0 0 1px var(--focus); }

/* ---------- Dispositivos (DeviceStatus) ---------- */
.device-list { margin: 0; padding: 0; list-style: none; }
.device { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto auto; gap: var(--space-3); align-items: center; padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--divider); }
.device:last-child { border-bottom: 0; }
.device__icon { width: 32px; height: 32px; display: grid; place-items: center; border-radius: var(--radius-control); background: var(--neutral-soft); color: var(--ink); }
.device b { display: block; font-size: 13px; font-weight: 650; }
.device small { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; line-height: 1.4; }

/* ---------- Envio de arquivo (FileDrop) ---------- */
.file-drop { position: relative; display: grid; justify-items: center; gap: var(--space-2); padding: var(--space-6) var(--space-4); border: 1.5px dashed var(--control-border); border-radius: var(--radius-card); background: var(--surface-subtle); color: var(--muted); font-size: 13px; text-align: center; cursor: pointer; }
.file-drop b { color: var(--ink); font-size: 13px; font-weight: 650; }
.file-drop small { color: var(--muted); font-size: 12px; }
.file-drop .btn { margin-top: var(--space-1); }
.file-drop:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; }
.file-drop.is-over { border-style: solid; border-color: var(--focus); background: var(--info-soft); }
.file-result { margin: 0; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.file-result b { color: var(--ink); font-weight: 700; }

@media (max-width: 760px) {
    .meta-row { grid-template-columns: 1fr; gap: 2px; padding-top: 10px; padding-bottom: 10px; }
    .device { grid-template-columns: 32px minmax(0, 1fr); }
    .device > .badge, .device > .btn { grid-column: 2; justify-self: start; }
}

/* ---------- Confirmação animada (ConfirmationCheck) ---------- */
.confirm { display: grid; justify-items: center; gap: var(--space-2); padding: var(--space-10) var(--space-6); text-align: center; }
.confirm__mark { width: 56px; height: 56px; margin-bottom: var(--space-2); animation: confirm-pop .5s ease-out both; }
.confirm__mark circle { fill: var(--success-soft); stroke: var(--success); stroke-width: 2; stroke-dasharray: 1; stroke-dashoffset: 1; animation: confirm-draw .5s ease-out forwards; }
.confirm__mark path { fill: none; stroke: var(--success); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; animation: confirm-draw .35s ease-out .4s forwards; }
.confirm h2 { margin: 0; font-size: 15px; font-weight: 700; }
.confirm p { max-width: 420px; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.confirm__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-2); margin-top: var(--space-3); }
@keyframes confirm-draw { to { stroke-dashoffset: 0; } }
@keyframes confirm-pop { from { transform: scale(.88); } to { transform: scale(1); } }

/* ---------- Páginas públicas (login/landing) ---------- */
.lp { min-height: 100vh; background: var(--public-bg); color: var(--public-ink); font-family: var(--font-sans); }
.lp-pill { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); height: 44px; padding: 0 22px; border: 1.5px solid transparent; border-radius: var(--radius-pill); font: 600 15px/1 var(--font-sans); white-space: nowrap; cursor: pointer; transition: background .18s ease; }
.lp-pill--lg { height: 54px; padding: 0 28px; font-size: 17px; }
.lp-pill--light { background: var(--public-ink); color: var(--public-bg); }
.lp-pill--light:hover { opacity: .9; }
.lp-pill--ghost { background: transparent; color: var(--public-ink); border-color: rgba(255, 255, 255, .9); }
.lp-pill--ghost:hover { background: rgba(255, 255, 255, .12); }

@media (prefers-reduced-motion: reduce) {
    .brunx-logo-spinner__icon { animation-duration: 2.6s; }
    .skeleton { animation: none; }
    .brunx-ai__panel, .brunx-ai__typing span { animation: none; }
    .alert--toast { animation-duration: .01ms; }
    .confirm__mark { animation: none; }
    .confirm__mark circle, .confirm__mark path { animation: none; stroke-dashoffset: 0; }
    * { transition-duration: .01ms !important; }
}
