/* Inter (SIL OFL 1.1, ver fonts/LICENSE-Inter.txt), hospedada no próprio servidor por causa da CSP. */
@font-face { font-family: "Inter"; font-style: normal; font-display: swap; font-weight: 100 900; src: url(../fonts/inter-latin-wght-normal.woff2) format("woff2-variations"), url(../fonts/inter-latin-wght-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; font-style: normal; font-display: swap; font-weight: 100 900; src: url(../fonts/inter-latin-ext-wght-normal.woff2) format("woff2-variations"), url(../fonts/inter-latin-ext-wght-normal.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
:root {
  --bg: #f4f6f5;
  --surface: #ffffff;
  --surface-2: #eef2f0;
  --border: #dde3e0;
  --text: #17201d;
  --muted: #5f6d68;
  --primary: #0f5c4d;
  --primary-2: #137a66;
  --primary-soft: #e3f1ed;
  --on-primary: #ffffff;
  --ok: #1d7a46;   --ok-soft: #e2f4e9;
  --warn: #8a5700; --warn-soft: #fdf1d8;
  --danger: #b42318; --danger-soft: #fde7e5; --on-danger: #ffffff;
  --info: #1f5fa8; --info-soft: #e4eefa;
  --radius: 12px;
  /* Escala única de tipografia e só dois raios (Etapa 3 UX) */
  --fs-12: 12px; --fs-13: 13px; --fs-15: 15px; --fs-18: 18px; --fs-24: 24px; --fs-32: 32px;
  --r-ctl: 8px; --r-card: 12px;
  --shadow: 0 1px 2px rgba(16, 24, 20, .06), 0 2px 8px rgba(16, 24, 20, .05);
  --sidebar: 264px;
  --content-max: 1440px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1412; --surface: #151d1a; --surface-2: #1c2622; --border: #2a3632; --text: #e6eeeb; --muted: #94a59f;
    --primary: #3fb59a; --primary-2: #56c7ac; --primary-soft: #183a32; --on-primary: #06221b;
    --ok: #5fd08f; --ok-soft: #173826; --warn: #f0b54a; --warn-soft: #3a2c10; --danger: #ff7b6e; --danger-soft: #3d1a17; --on-danger: #2a0b08; --info: #7fb1f0; --info-soft: #162a42;
    --shadow: 0 1px 2px rgba(0,0,0,.4);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e1412; --surface: #151d1a; --surface-2: #1c2622; --border: #2a3632; --text: #e6eeeb; --muted: #94a59f;
  --primary: #3fb59a; --primary-2: #56c7ac; --primary-soft: #183a32; --on-primary: #06221b;
  --ok: #5fd08f; --ok-soft: #173826; --warn: #f0b54a; --warn-soft: #3a2c10; --danger: #ff7b6e; --danger-soft: #3d1a17; --on-danger: #2a0b08; --info: #7fb1f0; --info-soft: #162a42;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  background: var(--bg); color: var(--text);
  font: 15px/1.5 "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; line-height: 1.25; }
h1 { font-size: var(--fs-24); letter-spacing: -.01em; }
h2 { font-size: var(--fs-18); }
h3 { font-size: var(--fs-15); }
p { margin: .4em 0; }
.muted { color: var(--muted); }
.small, small { font-size: var(--fs-13); }
.pre { white-space: pre-wrap; word-break: break-word; }
.right { text-align: right; }
.icon { flex: none; }
code.secret { display: block; padding: 12px; margin: 8px 0; background: var(--surface-2); border-radius: var(--r-ctl); font-size: var(--fs-18); letter-spacing: .05em; word-break: break-all; user-select: all; }
:focus-visible { outline: 2px solid var(--primary-2); outline-offset: 2px; }

/* ---------- auth */
.auth { min-height: 100%; display: grid; place-items: center; padding: 24px 16px; background: linear-gradient(160deg, var(--primary-soft), var(--bg)); }
.auth-card { width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); padding: 28px 24px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 12px; }
.auth-card.legal-card { max-width: 780px; }
.legal-card .card { border: 0; box-shadow: none; padding: 0; background: none; }
.legal-doc h3 { margin: 18px 0 6px; font-size: 1rem; }
.legal-doc p, .legal-doc li { line-height: 1.6; }
.center-screen { min-height: 100%; display: grid; place-content: center; gap: 12px; padding: 16px; }
.brand { display: flex; gap: 12px; align-items: center; }
.brand strong { display: block; }
.brand small { color: var(--muted); }
.brand-logo { width: 44px; height: 44px; border-radius: var(--r-card); display: grid; place-items: center; background: var(--primary); color: var(--on-primary); }
.steps { padding-left: 20px; }

/* ---------- shell */
.shell { display: flex; min-height: 100%; }
.sidebar {
  width: var(--sidebar); flex: none; background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; padding: calc(16px + var(--safe-t)) 12px 12px;
}
.sidebar .brand { padding: 0 6px 14px; border-bottom: 1px solid var(--border); margin-bottom: 8px; }
.sidebar .brand-logo { width: 38px; height: 38px; }
.nav-scroll { flex: 1; overflow-y: auto; }
.nav-group { padding: 6px 0; }
.nav-group-label { font-size: var(--fs-12); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 8px 10px 4px; font-weight: 600; }
.nav-link {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border-radius: var(--r-ctl); color: var(--text);
  background: none; border: 0; font: inherit; cursor: pointer; text-align: left;
}
.nav-link:hover { background: var(--surface-2); text-decoration: none; }
.nav-link.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.nav-foot { border-top: 1px solid var(--border); padding-top: 8px; }
.main-col { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: none; }
.content { flex: 1; padding: 24px 28px 40px; max-width: var(--content-max); margin: 0 auto; width: 100%; outline: none; }
.bottom-nav, .scrim, .menu-toggle { display: none; }
.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: var(--r-ctl); border: 0; background: none; color: var(--text); cursor: pointer; position: relative; }
.icon-btn:hover { background: var(--surface-2); }
.bell-count { position: absolute; top: 4px; right: 2px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: var(--r-ctl); background: var(--danger); color: #fff; font-size: var(--fs-12); display: grid; place-items: center; font-weight: 700; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--primary); color: var(--on-primary); display: grid; place-items: center; font-size: var(--fs-13); font-weight: 700; }
.avatar:hover { text-decoration: none; }

@media (min-width: 901px) {
  /* Barra do topo alinhada ao conteúdo centralizado (e não presa no canto da tela). */
  .topbar { display: flex; justify-content: flex-end; gap: 6px; align-items: center; max-width: var(--content-max); margin: 0 auto; width: 100%; padding: 12px 28px 0; }
  .topbar .topbar-title, .topbar .topbar-search { display: none; }
  .content { padding-top: 8px; }
}

@media (max-width: 900px) {
  .sidebar { position: fixed; z-index: 40; left: 0; top: 0; bottom: 0; transform: translateX(-102%); transition: transform .2s ease; box-shadow: var(--shadow); }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 30; }
  .topbar { display: flex; align-items: center; gap: 6px; padding: calc(8px + var(--safe-t)) 10px 8px; background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 20; }
  .menu-toggle { display: inline-grid; }
  .topbar-title { flex: 1; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .content { padding: 16px 16px calc(88px + var(--safe-b)); }
  .bottom-nav {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 20; background: var(--surface); border-top: 1px solid var(--border);
    padding: 6px 4px calc(6px + var(--safe-b));
  }
  .bottom-link { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: var(--fs-12); color: var(--muted); background: none; border: 0; font-family: inherit; padding: 4px 0; cursor: pointer; }
  .bottom-link.active { color: var(--primary); }
  .bottom-link:hover { text-decoration: none; }
}

/* ---------- page */
.page { display: flex; flex-direction: column; gap: 16px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.page-title { display: flex; gap: 10px; align-items: flex-start; }
.page-title .back { margin-top: 2px; color: var(--muted); }
.page-actions, .row-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.row-actions.wrap { margin-top: 12px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); min-width: 0; }
.card-title { margin-bottom: 10px; }
.card > header, .card > footer { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.card > footer { margin-top: 10px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
@media (max-width: 480px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }
.feed { display: flex; flex-direction: column; gap: 12px; }
.announcement h3 { margin: 8px 0 4px; }
.announcement.pinned { border-left: 4px solid var(--warn); }
.announcement.unread h3::after { content: " •"; color: var(--primary); }
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; justify-content: space-between; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.list li:last-child { border-bottom: 0; }
.list a { display: inline-flex; gap: 6px; align-items: center; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.toolbar > * { flex: 0 1 auto; }
.search { display: flex; align-items: center; gap: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-ctl); padding: 0 10px; min-width: 220px; flex: 1 1 220px; max-width: 420px; color: var(--muted); }
.search input { border: 0; outline: 0; background: none; padding: 9px 0; flex: 1; font: inherit; color: var(--text); min-width: 0; }

/* ---------- stats */
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.stat { display: flex; gap: 12px; align-items: flex-start; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; color: var(--text); box-shadow: var(--shadow); }
a.stat:hover { text-decoration: none; border-color: var(--primary-2); }
.stat-icon { width: 40px; height: 40px; border-radius: var(--r-ctl); display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); flex: none; }
.stat-label { font-size: var(--fs-13); color: var(--muted); }
.stat-value { font-size: var(--fs-18); font-weight: 700; font-variant-numeric: tabular-nums; } /* menor que o título da página (24) */
.stat-hint { font-size: var(--fs-13); color: var(--muted); }
.stat-ok .stat-icon { background: var(--ok-soft); color: var(--ok); }
.stat-warn .stat-icon { background: var(--warn-soft); color: var(--warn); }
.stat-danger .stat-icon { background: var(--danger-soft); color: var(--danger); }
.stat-info .stat-icon { background: var(--info-soft); color: var(--info); }
@media (max-width: 480px) { .stats { grid-template-columns: 1fr 1fr; } .stat { flex-direction: column; gap: 6px; } .stat-value { font-size: var(--fs-18); } }

.quick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.quick { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; padding: 14px 8px; border-radius: var(--r-ctl); background: var(--surface-2); color: var(--text); font-size: var(--fs-13); }
.quick:hover { text-decoration: none; background: var(--primary-soft); color: var(--primary); }

/* ---------- table */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card .table-wrap { box-shadow: none; }
.table { width: 100%; border-collapse: collapse; font-size: var(--fs-15); }
.table th { text-align: left; font-size: var(--fs-12); text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; padding: 10px 12px; border-bottom: 1px solid var(--border); background: var(--surface-2); white-space: nowrap; }
.table td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table .right { text-align: right; font-variant-numeric: tabular-nums; }
.table-click tbody tr { cursor: pointer; }
.table-click tbody tr:hover { background: var(--surface-2); }
@media (max-width: 700px) {
  .table-wrap { border: 0; background: none; box-shadow: none; overflow: visible; }
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tr { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 10px; padding: 6px 12px; box-shadow: var(--shadow); }
  .table td { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px dashed var(--border); text-align: right; }
  .table td::before { content: attr(data-label); color: var(--muted); font-size: var(--fs-13); text-align: left; flex: none; max-width: 45%; }
  .table td[data-label=""]::before { content: none; }
  /* Cartão compacto: título na 1ª linha, sem rótulo; campos vazios e a caixa de seleção não ocupam linhas. */
  .table tr { position: relative; padding: 8px 12px; }
  .table td { padding: 4px 0; border-bottom: 0; }
  .table td.td-empty { display: none; }
  .table td.td-title { justify-content: flex-start; text-align: left; font-weight: 600; font-size: var(--fs-15); padding-right: 48px; }
  .table td.td-title::before { content: none; }
  .table td.td-check { position: absolute; top: 0; right: 0; width: 48px !important; height: 48px; padding: 0; justify-content: center !important; align-items: center; }
  .table td.td-check::before { content: none; }
  .table td.td-check input { width: 22px; height: 22px; }
  .table tr:has(.td-check) .td-title { padding-right: 48px; }
  /* Filtros num painel que abre e fecha */
  .toolbar-filters { width: 100%; }
  .toolbar-filters > summary { list-style: none; width: 100%; justify-content: flex-start; border: 1px solid var(--border); }
  .toolbar-filters > summary::-webkit-details-marker { display: none; }
  .toolbar-filters[open] > summary { margin-bottom: 8px; }
  .toolbar-filters > .toolbar > * { flex: 1 1 100%; }
  .table td:last-child { border-bottom: 0; }
  .table .right { text-align: right; }
}

/* ---------- badges, alerts */
.badge { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 999px; font-size: var(--fs-12); font-weight: 600; white-space: nowrap; background: var(--surface-2); color: var(--muted); }
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-info { background: var(--info-soft); color: var(--info); }
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r-ctl); }
.alert-danger { background: var(--danger-soft); color: var(--danger); }
.alert-info { background: var(--info-soft); color: var(--info); }
.alert-warn { background: var(--warn-soft); color: var(--warn); }
.alert-ok { background: var(--ok-soft); color: var(--ok); }
.empty { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 32px 16px; color: var(--muted); text-align: center; }
.empty p { margin: 0; max-width: 46ch; }
.empty .empty-title { color: var(--text); font-weight: 600; }
.empty > .btn, .empty > a.btn { margin-top: 8px; }
.loading { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 40px; color: var(--muted); }
.spinner { width: 20px; height: 20px; border: 2px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 14px; border-radius: var(--r-ctl); border: 1px solid transparent; font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap; min-height: 40px; }
.btn-sm { padding: 5px 10px; min-height: 32px; font-size: var(--fs-13); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: var(--on-primary); }
.btn-primary:hover:not(:disabled) { background: var(--primary-2); }
.btn-ghost { background: var(--surface-2); color: var(--text); }
.btn-ghost:hover:not(:disabled) { background: var(--border); }
.btn-outline { background: var(--surface); border-color: var(--primary); color: var(--primary); }
.btn-outline:hover:not(:disabled) { background: var(--primary-soft); }
.btn-danger { background: var(--danger); color: var(--on-danger); }
.vote-options { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }

/* ---------- forms */
.form { display: flex; flex-direction: column; gap: 12px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px 14px; }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: var(--fs-13); font-weight: 600; }
.field .req { color: var(--danger); }
.field input, .field select, .field textarea, .select, .date-input .date-text {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--r-ctl); background: var(--surface); color: var(--text); font: inherit; min-height: 42px;
}
.select { width: auto; min-width: 160px; }
.field textarea { resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus, .select:focus { outline: none; border-color: var(--primary-2); box-shadow: 0 0 0 3px var(--primary-soft); }
.field-check label { display: flex; gap: 8px; align-items: center; font-weight: 500; cursor: pointer; }
.field-check input { width: 18px; height: 18px; min-height: 0; accent-color: var(--primary); }
.hint { color: var(--muted); font-size: var(--fs-12); }
.field-error, .form-error { color: var(--danger); font-size: var(--fs-13); min-height: 0; }
.form-error:empty, .field-error:empty { display: none; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.form-inline .form-actions { justify-content: flex-start; }

/* ---------- modal, toast */
.modal-overlay { position: fixed; inset: 0; background: rgba(6, 10, 9, .62); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); z-index: 100; display: grid; place-items: center; padding: 16px; animation: fade .15s ease; }
.modal { background: var(--surface); border-radius: var(--r-card); width: 100%; max-width: 520px; max-height: calc(100vh - 32px); display: flex; flex-direction: column; box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.modal-wide { max-width: 760px; }
.modal-xl { max-width: min(1180px, 96vw); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px 10px 20px; border-bottom: 1px solid var(--border); }
.modal-body { padding: 16px 20px; overflow-y: auto; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px 16px; border-top: 1px solid var(--border); }
@media (max-width: 600px) {
  .modal-overlay { place-items: end center; padding: 0; }
  .modal, .modal-wide { max-width: 100%; border-radius: var(--r-card) var(--r-card) 0 0; max-height: 92vh; padding-bottom: var(--safe-b); }
}
@keyframes fade { from { opacity: 0; } }
#toasts { position: fixed; z-index: 200; left: 50%; transform: translateX(-50%); bottom: calc(80px + var(--safe-b)); display: flex; flex-direction: column; gap: 8px; width: min(92vw, 420px); }
.toast { display: flex; gap: 8px; align-items: center; padding: 12px 14px; border-radius: var(--r-card); background: var(--text); color: var(--bg); box-shadow: 0 8px 24px rgba(0,0,0,.2); transition: opacity .4s, transform .4s; }
.toast-error { background: var(--danger); color: var(--on-danger); }
.toast > span { flex: 1; }
.toast-x { flex: none; margin: -6px -6px -6px 4px; width: 32px; height: 32px; display: grid; place-items: center; border: 0; border-radius: var(--r-ctl); background: transparent; color: inherit; cursor: pointer; }
.toast-x:hover { background: rgba(0,0,0,.12); }
.toast.hide { opacity: 0; transform: translateY(8px); }

/* ---------- tabs, details, bars, notifications */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; margin-bottom: 14px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
/* flex: none — no Safari/iOS o item flexível dentro de faixa com rolagem horizontal encolhia abaixo do texto (nowrap) e os rótulos se sobrepunham. */
.tab { flex: none; padding: 10px 14px; background: none; border: 0; border-bottom: 2px solid transparent; font: inherit; color: var(--muted); cursor: pointer; white-space: nowrap; font-weight: 600; }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-body { display: flex; flex-direction: column; gap: 14px; }
.details { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; }
.details dt { color: var(--muted); font-size: var(--fs-15); }
.details dd { margin: 0; word-break: break-word; }
.bars, .poll-results { display: flex; flex-direction: column; gap: 8px; margin: 8px 0; }
.bar-row { display: grid; grid-template-columns: minmax(80px, 160px) 1fr auto; gap: 10px; align-items: center; font-size: var(--fs-15); }
.bar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { height: 10px; background: var(--surface-2); border-radius: var(--r-ctl); overflow: hidden; }
.bar-fill { height: 100%; background: var(--primary); border-radius: var(--r-ctl); min-width: 2px; }
/* No celular: rótulo e valor na primeira linha, barra inteira embaixo (valores longos como fração ideal não espremem a barra). */
@media (max-width: 600px) {
  .bar-row { grid-template-columns: 1fr auto; row-gap: 4px; }
  .bar-row .bar-track { grid-column: 1 / -1; grid-row: 2; }
  .bar-label { white-space: normal; }
}
.bar-ok { background: var(--ok); } .bar-warn { background: var(--warn); } .bar-danger { background: var(--danger); } .bar-info { background: var(--info); }
.bar-value { font-variant-numeric: tabular-nums; color: var(--muted); }
.notif-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.notif-list a { display: block; padding: 12px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); }
.notif-list a:hover { text-decoration: none; border-color: var(--primary-2); }
.notif-list li.unread a { border-left: 4px solid var(--primary); }
.notif-list p { margin: 2px 0; color: var(--muted); }
.prose ul { padding-left: 20px; }
.timeline { list-style: none; padding: 0; margin: 0; border-left: 2px solid var(--border); }
.timeline li { padding: 0 0 12px 14px; position: relative; }
.timeline li::before { content: ""; position: absolute; left: -6px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--primary); }
.calendar { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.calendar .cal-head { font-size: var(--fs-12); color: var(--muted); text-align: center; font-weight: 600; text-transform: uppercase; }
.calendar .cal-day { min-height: 64px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-ctl); padding: 4px; font-size: var(--fs-12); overflow: hidden; }
.calendar .cal-day.other { opacity: .4; }
.calendar .cal-day.today { border-color: var(--primary); }
.calendar .cal-ev { display: block; background: var(--primary-soft); color: var(--primary); border-radius: var(--r-ctl); padding: 1px 4px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 600px) { .calendar .cal-day { min-height: 44px; } .calendar .cal-ev { font-size: 0; height: 6px; padding: 0; } }
.code-big { font-family: ui-monospace, Menlo, monospace; font-size: var(--fs-32); letter-spacing: .2em; text-align: center; padding: 12px; background: var(--surface-2); border-radius: var(--r-ctl); }
@media print { .sidebar, .topbar, .bottom-nav, .page-actions, .toolbar { display: none !important; } .content { padding: 0; } }
[hidden] { display: none !important; }
@media (min-width: 901px) { .menu-toggle { display: none !important; } }

.license-banner { margin: 12px 28px 0; }
@media (max-width: 900px) { .license-banner { margin: 12px 16px 0; } }

.brand-img { object-fit: cover; background: var(--surface-2); }
.avatar { overflow: hidden; }
.avatar-inner { display: grid; place-items: center; width: 100%; height: 100%; border-radius: 50%; overflow: hidden; }
.avatar-inner img { width: 100%; height: 100%; object-fit: cover; }
.avatar-lg { width: 72px; height: 72px; background: var(--primary); color: var(--on-primary); font-size: var(--fs-24); font-weight: 700; flex: none; }
.photo-row { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.photo-row .brand-logo { width: 72px; height: 72px; border-radius: var(--r-card); }

/* ---------- Assembleia virtual ---------- */
.vote-btn { min-height: 56px; flex: 1 1 140px; font-size: var(--fs-18); justify-content: center; }
.live-item { border-left: 4px solid var(--warn); }
.msg-hidden { opacity: .45; }
.room-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.minutes-pre { white-space: pre-wrap; font: inherit; margin: 0; }
.poll-results { margin-top: 10px; }
@media print { .sidebar, .topbar, .bottom-nav, .room-actions, button { display: none !important; } .minutes-pre { font-size: 11pt; } }
/* ---------- CRM de cobrança / pagamento automático ---------- */
.terms-box { max-height: 40vh; overflow: auto; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); }
tr.overdue-promise td { background: var(--danger-soft); }
/* ---------- QR Code (v1.5) ---------- */
.qr-panel { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.qr-panel .code-big { width: 100%; max-width: 280px; }
.qr-frame { background: #ffffff; padding: 8px; border-radius: var(--r-card); border: 1px solid var(--border); line-height: 0; }
.qr-svg { display: block; width: min(232px, 70vw); height: auto; image-rendering: pixelated; }
.qr-actions, .qr-validate-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.qr-validate-actions { justify-content: flex-start; margin-top: 10px; }
.qr-scan { position: relative; width: 100%; max-width: 420px; margin: 0 auto; aspect-ratio: 1; background: #000; border-radius: var(--r-card); overflow: hidden; }
.qr-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.qr-scan-target { position: absolute; inset: 18%; border: 3px solid rgba(255, 255, 255, .85); border-radius: var(--r-card); box-shadow: 0 0 0 999px rgba(0, 0, 0, .25); z-index: 1; pointer-events: none; }
.qr-verdict { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 28px 16px; border-radius: var(--r-card); }
.qr-verdict-ok { background: var(--ok-soft); color: var(--ok); }
.qr-verdict-danger { background: var(--danger-soft); color: var(--danger); }
.qr-verdict-title { font-size: clamp(1.6rem, 6vw, 2.6rem); font-weight: 800; line-height: 1.15; color: var(--text); word-break: break-word; }
.qr-verdict-line { font-size: clamp(1.05rem, 3.6vw, 1.4rem); color: var(--text); }
/* ---------- Assembleia (v1.5) ---------- */
.asm-hero-slot { display: grid; gap: 12px; margin-bottom: 12px; }
.asm-hero-slot:empty { display: none; }
.asm-hero { display: flex; gap: 14px; align-items: flex-start; padding: 16px 18px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow); border-left: 6px solid var(--info); min-width: 0; }
.asm-hero > svg { flex: none; margin-top: 2px; }
.asm-hero h2 { font-size: var(--fs-18); margin: 0 0 6px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.asm-hero p { margin: 0 0 6px; }
.asm-hero-body, .asm-hero > div { flex: 1; min-width: 0; }
.asm-hero-wait { border-left-color: var(--warn); background: var(--warn-soft); }
.asm-hero-wait > svg { color: var(--warn); }
.asm-hero-go { border-left-color: var(--primary); background: var(--primary-soft); }
.asm-hero-ok { border-left-color: var(--ok); background: var(--ok-soft); }
.asm-hero-ok h2 { color: var(--ok); }
.asm-hero-live { border-left-color: var(--warn); }
.asm-hero-info > svg { color: var(--info); }
.asm-hero-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.asm-btn-xl { min-height: 52px; padding: 12px 22px; font-size: var(--fs-18); }
.asm-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.asm-chip { background: var(--surface-2); border-radius: 999px; padding: 4px 10px; font-size: var(--fs-13); }
.asm-otp-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); font-size: var(--fs-15); }
.asm-otp-line.danger { color: var(--danger); }
.asm-otp-line > span { flex: 1 1 220px; }
.asm-voting { border-left: 4px solid var(--warn); }
.asm-voting .vote-options .btn { flex: 1 1 140px; min-height: 56px; font-size: var(--fs-18); white-space: normal; }
.asm-live-card { border-left: 4px solid var(--warn); }
.asm-receipt { display: block; font-family: ui-monospace, Menlo, monospace; opacity: .85; word-break: break-all; }
.asm-composer textarea:disabled { background: var(--surface-2); }
.asm-note { display: flex; gap: 6px; align-items: flex-start; color: var(--info); margin: 0 0 6px; }
.asm-note.warn { color: var(--warn); }
.asm-otp, .asm-scan, .asm-qr-box { display: grid; gap: 8px; }
.asm-otp-input, .asm-scan-input { font: inherit; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--r-ctl); background: var(--surface); color: var(--text); width: 100%; box-sizing: border-box; }
.asm-otp-input { font-family: ui-monospace, Menlo, monospace; font-size: var(--fs-24); letter-spacing: .4em; text-align: center; }
.asm-scan-area { min-height: 60px; border-radius: var(--r-ctl); overflow: hidden; }
.asm-scan-area video { width: 100%; max-height: 50vh; object-fit: cover; }
.asm-qr { display: flex; justify-content: center; padding: 8px; background: #fff; border-radius: var(--r-ctl); }
.asm-qr svg { max-width: 100%; height: auto; }
.asm-token, .asm-hash, .asm-mono { font-family: ui-monospace, Menlo, monospace; word-break: break-all; }
.asm-token { display: block; text-align: center; padding: 8px; background: var(--surface-2); border-radius: var(--r-ctl); }
.asm-accept { display: flex; gap: 8px; align-items: center; font-weight: 600; cursor: pointer; }
.asm-accept input { width: 20px; height: 20px; accent-color: var(--primary); }
.asm-sign-list { margin-top: 10px; }
.asm-sign-row { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.center { text-align: center; }
.asm-auth .details { grid-template-columns: minmax(0, 40%) minmax(0, 1fr); }
.asm-auth .details dd { min-width: 0; overflow-wrap: anywhere; }
.asm-auth .badge { white-space: normal; }
@media (max-width: 600px) {
  .asm-hero { flex-direction: column; padding: 14px; }
  .asm-hero-actions .btn, .asm-hero-actions a.btn { flex: 1 1 100%; white-space: normal; }
  .asm-otp-line .btn { flex: 1 1 100%; }
}

/* ---------- Contabilidade (v1.5) ---------- */
/* Conselho fiscal: comentários e pareceres */
.ctb-thread { margin-top: 16px; border-top: 1px solid var(--border); padding-top: 12px; }
.ctb-thread-title { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 0 0 8px; font-size: var(--fs-15); }
.ctb-comments { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 8px; }
.ctb-comment { border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 12px; background: var(--surface); }
.ctb-comment-query { border-left: 4px solid var(--warn); }
.ctb-comment-reply { margin-left: 18px; background: var(--surface-2); }
.ctb-comment-head { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; }
.ctb-comment-body { margin: 6px 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.ctb-composer, .ctb-vote { display: grid; gap: 8px; margin-top: 8px; }
.ctb-composer textarea, .ctb-vote textarea, .ctb-vote select { width: 100%; box-sizing: border-box; }
.ctb-check, .ctb-file { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ctb-file input { max-width: 100%; }
.ctb-cmt-ind { display: inline-flex; gap: 4px; align-items: center; flex-wrap: wrap; color: var(--primary); }
.ctb-opinion { white-space: pre-wrap; font: inherit; margin: 0; line-height: 1.5; max-height: 60vh; overflow: auto; }
.ctb-status-line { margin-bottom: 12px; }
.ctb-sub { margin: 14px 0 6px; font-size: var(--fs-15); }
/* Fotos */
.ctb-thumb-btn { border: 1px solid var(--border); border-radius: var(--r-ctl); padding: 0; background: var(--surface-2); cursor: zoom-in; width: 56px; height: 56px; overflow: hidden; flex: none; }
.ctb-thumb { width: 100%; height: 100%; object-fit: cover; display: block; }
.ctb-photo-box { text-align: center; }
.ctb-photo-full { max-width: 100%; max-height: 70vh; border-radius: var(--r-ctl); }
/* Leitura de medidores (pensada primeiro para o celular) */
.ctb-read { display: grid; gap: 12px; max-width: 720px; }
.ctb-read-controls { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.ctb-seg { display: flex; flex-wrap: wrap; gap: 6px; }
.ctb-seg-btn { display: inline-flex; gap: 6px; align-items: center; justify-content: center; min-height: 44px; padding: 8px 14px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--text); font: inherit; cursor: pointer; }
.ctb-seg-btn.active { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.ctb-comp { display: flex; gap: 6px; align-items: center; }
.ctb-progress-box { display: grid; gap: 6px; }
.ctb-progress { height: 12px; border-radius: 999px; background: var(--surface-2); overflow: hidden; border: 1px solid var(--border); }
.ctb-progress-fill { height: 100%; background: var(--ok); transition: width .3s; }
.ctb-unit-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; margin: 8px 0; }
.ctb-unit-grid.ctb-condo { grid-template-columns: 1fr; }
.ctb-unit-btn { display: inline-flex; gap: 4px; align-items: center; justify-content: center; min-height: 48px; padding: 6px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); font: inherit; font-weight: 600; cursor: pointer; }
.ctb-unit-btn.read { background: var(--ok-soft); color: var(--ok); border-color: var(--ok); }
.ctb-unit-btn.pending { background: var(--warn-soft); color: var(--warn); border-color: var(--warn); }
.ctb-unit-btn.anomaly { background: var(--danger-soft); color: var(--danger); border-color: var(--danger); }
.ctb-read-panel { display: grid; gap: 10px; }
.ctb-read-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ctb-read-head h2 { margin: 0; font-size: var(--fs-18); flex: 1 1 auto; }
.ctb-read-form { display: grid; gap: 10px; }
.ctb-photo-preview { min-height: 120px; border: 2px dashed var(--border); border-radius: var(--radius); display: grid; place-items: center; overflow: hidden; background: var(--surface-2); }
.ctb-photo-preview img { width: 100%; max-height: 320px; object-fit: contain; display: block; }
.ctb-reading-label { display: grid; gap: 4px; font-weight: 600; }
.ctb-reading-input { font-size: var(--fs-32); padding: 10px 12px; border: 2px solid var(--border); border-radius: var(--radius); width: 100%; box-sizing: border-box; font-variant-numeric: tabular-nums; background: var(--surface); color: var(--text); }
.ctb-reading-input:focus { border-color: var(--primary); outline: none; }
.ctb-calc { display: grid; gap: 6px; }
.ctb-calc-value { font-size: var(--fs-18); }
.ctb-read-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.ctb-read-actions .btn { flex: 1 1 160px; justify-content: center; min-height: 48px; }
.ctb-anomaly { color: var(--danger); display: inline-flex; gap: 2px; align-items: flex-start; }
@media (max-width: 600px) {
  .ctb-seg-btn { flex: 1 1 0; padding: 8px 6px; }
  .ctb-read-controls .ctb-seg { width: 100%; }
  .ctb-comment-reply { margin-left: 8px; }
}

/* ---------- Etapa 1 UX (v1.6): paginação, valores, links de linha ---------- */
.pager { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin: 12px 0 4px; }
.pager .select-sm, .select-sm { min-width: 0; padding: 6px 30px 6px 10px; font-size: var(--fs-13); background-position: right 8px center; }
.neg, .stat-value.neg { color: var(--danger); }
.stat > div { min-width: 0; } /* valores longos (datas) quebram; "R$ 1.234,56" não, pelo espaço não separável */
td.right { white-space: nowrap; }
.row-link { color: inherit; text-decoration: none; font-weight: inherit; }
.row-link:hover { text-decoration: underline; }
.table-click tbody tr:focus-visible { outline: 2px solid var(--primary-2); outline-offset: -2px; }
.btn-danger-outline { background: transparent; color: var(--danger); border: 1px solid var(--danger); }
.btn-danger-outline:hover { background: var(--danger-soft); }
.actions-split { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; width: 100%; }
.modal-actions { flex-wrap: wrap; }
.modal-actions > .btn-danger-outline:first-child { margin-right: auto; } /* ação destrutiva afastada das demais */
.month-nav { display: flex; align-items: center; gap: 4px; }
.month-nav-label { min-width: 150px; text-align: center; }

/* ---------- Etapa 2 UX (v1.6): menu em grupos, menu fininho, tema, painéis, busca, tabelas ---------- */
.sidebar { transition: width .25s ease; z-index: 10; }
.sidebar .brand { position: relative; }
.brand-text { min-width: 0; }
.brand-text strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-collapse { position: absolute; right: -24px; top: 10px; width: 24px; height: 24px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface); color: var(--muted); display: grid; place-items: center; cursor: pointer; box-shadow: var(--shadow); transition: transform .25s ease; z-index: 2; }
.nav-collapse:hover { color: var(--primary); border-color: var(--primary-2); }
.nav-search { display: flex; align-items: center; gap: 10px; width: 100%; margin: 4px 0 6px; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--r-ctl); background: var(--surface-2); color: var(--muted); font: inherit; font-size: var(--fs-15); cursor: pointer; text-align: left; }
.nav-search:hover { border-color: var(--primary-2); }
.nav-search kbd { margin-left: auto; font: 600 .7rem/1 system-ui, sans-serif; padding: 3px 5px; border: 1px solid var(--border); border-radius: var(--r-ctl); background: var(--surface); }
.nav-text { transition: opacity .2s ease; white-space: nowrap; }
.nav-group { padding: 1px 0; }
.nav-group-head { position: relative; display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; border-radius: var(--r-ctl); background: none; color: var(--text); font: inherit; font-size: var(--fs-15); font-weight: 600; cursor: pointer; text-align: left; }
.nav-group-head:hover { background: var(--surface-2); }
.nav-group-head .icon { color: var(--muted); transition: color .2s; }
.nav-chev { margin-left: auto; display: grid; color: var(--muted); transition: transform .25s ease; }
.nav-group.open > .nav-group-head { background: var(--surface-2); box-shadow: inset 3px 0 0 var(--primary); }
.nav-group.open > .nav-group-head .icon, .nav-group.current > .nav-group-head .icon { color: var(--primary); }
.nav-group.open > .nav-group-head .nav-chev { transform: rotate(180deg); }
.nav-dot { display: none; width: 7px; height: 7px; border-radius: 50%; background: var(--primary); }
.nav-group.current:not(.open) .nav-dot { display: block; }
.nav-sub { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .25s ease; }
.nav-group.open > .nav-sub { grid-template-rows: 1fr; }
.nav-sub-inner { overflow: hidden; min-height: 0; }
.nav-fly-title { display: none; }
.nav-sub .nav-link { padding: 7px 10px 7px 40px; font-size: var(--fs-15); color: var(--muted); }
.nav-sub .nav-link:hover { color: var(--text); }
.nav-sub .nav-link.active { background: none; color: var(--primary); font-weight: 700; }
.nav-group-solo .nav-sub .nav-link { padding-left: 10px; color: var(--text); font-size: inherit; }
.nav-group-solo .nav-sub .nav-link.active { background: var(--primary-soft); }
.nav-group-solo > .nav-group-head { font-size: var(--fs-12); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 8px 10px 4px; font-weight: 700; box-shadow: none; background: none; }
.nav-group-solo > .nav-group-head > .icon { display: none; }
.nav-tip { position: fixed; left: 70px; transform: translateY(-50%); background: var(--text); color: var(--bg); font-size: var(--fs-13); padding: 5px 9px; border-radius: var(--r-ctl); pointer-events: none; z-index: 60; white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { .nav-sub, .nav-chev, .sidebar, .nav-text, .nav-collapse { transition: none; } }

/* Menu fininho (só acima de 900px; no celular há gaveta e barra inferior) */
@media (min-width: 901px) {
  .nav-mini { --sidebar: 62px; }
  .nav-mini .sidebar { padding-left: 8px; padding-right: 8px; }
  .nav-mini .nav-text, .nav-mini .nav-chev, .nav-mini .nav-group-solo > .nav-group-head { opacity: 0; width: 0; overflow: hidden; padding: 0; margin: 0; }
  .nav-mini .nav-group-solo > .nav-group-head { height: 0; }
  .nav-mini .nav-collapse { transform: rotate(180deg); }
  .nav-mini .sidebar .brand { justify-content: center; padding-left: 0; padding-right: 0; }
  .nav-mini .nav-search { justify-content: center; padding: 8px 0; }
  .nav-mini .nav-search kbd { display: none; }
  .nav-mini .nav-link.solo, .nav-mini .nav-group-head { justify-content: center; padding: 9px 0; gap: 0; }
  .nav-mini .nav-group-solo > .nav-sub { grid-template-rows: 1fr; }
  .nav-mini .nav-group:not(.nav-group-solo) > .nav-sub { grid-template-rows: 0fr; }
  .nav-mini .nav-group.open > .nav-group-head { box-shadow: none; }
  .nav-mini .nav-group.current > .nav-group-head { background: var(--primary-soft); }
  .nav-mini .nav-dot { display: none !important; }
  .nav-mini .nav-group.fly > .nav-sub { position: fixed; left: 62px; display: block; min-width: 220px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-ctl); box-shadow: 0 12px 30px rgba(0,0,0,.18); padding: 6px; z-index: 50; }
  .nav-mini .nav-group.fly .nav-sub-inner { overflow: visible; }
  .nav-mini .nav-group.fly .nav-fly-title { display: flex; align-items: center; gap: 8px; font-weight: 700; padding: 6px 10px 8px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
  .nav-mini .nav-group.fly .nav-sub .nav-link { padding-left: 10px; }
}
@media (max-width: 900px) { .nav-collapse { display: none; } }

/* Topo: tema, sino, avatar e painéis suspensos */
.avatar-btn { border: 0; background: none; padding: 0; cursor: pointer; border-radius: 50%; display: grid; }
.avatar-btn:focus-visible { outline: 2px solid var(--primary-2); outline-offset: 2px; }
.theme-btn .icon { transition: transform .3s ease; }
.theme-btn:hover .icon { transform: rotate(15deg); }
html { transition: background-color .25s ease; }
body, .sidebar, .card, .stat, .table-wrap, .topbar, .bottom-nav { transition: background-color .25s ease, border-color .25s ease, color .25s ease; }
.popover { position: fixed; z-index: 90; width: min(360px, calc(100vw - 16px)); max-height: min(70vh, 560px); display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); box-shadow: 0 16px 40px rgba(0,0,0,.2); overflow: hidden; animation: fade .12s ease; }
.pop-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.link-btn { border: 0; background: none; color: var(--primary); font: inherit; font-size: var(--fs-13); cursor: pointer; padding: 0; }
.link-btn:hover { text-decoration: underline; }
.notif-pop-list { overflow-y: auto; }
.notif-pop-item { display: flex; flex-direction: column; gap: 2px; padding: 10px 14px; border-bottom: 1px solid var(--border); color: var(--text); }
.notif-pop-item:hover { background: var(--surface-2); text-decoration: none; }
.notif-pop-item.unread { box-shadow: inset 3px 0 0 var(--primary); }
.pop-foot { display: block; text-align: center; padding: 10px; font-weight: 600; font-size: var(--fs-15); }
.avatar-pop { width: min(300px, calc(100vw - 16px)); }
.pop-user { display: flex; flex-direction: column; padding: 14px; border-bottom: 1px solid var(--border); }
.pop-menu { display: flex; flex-direction: column; padding: 6px; }
.pop-link { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--r-ctl); color: var(--text); border: 0; background: none; font: inherit; cursor: pointer; text-align: left; width: 100%; }
.pop-link:hover { background: var(--surface-2); text-decoration: none; }
.pop-link.danger { color: var(--danger); margin: 0 6px 6px; width: auto; }
.pop-theme { display: flex; flex-direction: column; gap: 6px; padding: 8px 14px 12px; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: var(--r-ctl); background: var(--surface-2); border: 1px solid var(--border); flex-wrap: wrap; }
.seg-btn { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; color: var(--muted); font: inherit; font-size: var(--fs-13); font-weight: 600; padding: 6px 10px; border-radius: var(--r-ctl); cursor: pointer; }
.seg-btn.on { background: var(--surface); color: var(--primary); box-shadow: var(--shadow); }

/* Busca no menu (Ctrl+K) */
.palette { display: flex; flex-direction: column; gap: 8px; }
.palette-input { width: 100%; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--r-ctl); background: var(--surface); color: var(--text); font: inherit; font-size: var(--fs-15); }
.palette-input:focus { outline: none; border-color: var(--primary-2); box-shadow: 0 0 0 3px var(--primary-soft); }
.palette-list { list-style: none; margin: 0; padding: 0; max-height: 50vh; overflow-y: auto; }
.palette-list li { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: var(--r-ctl); cursor: pointer; }
.palette-list li small { margin-left: auto; }
.palette-list li.on { background: var(--primary-soft); color: var(--primary); }

/* Tabelas: cabeçalho fixo, ordenação, seleção, filtros em etiquetas e ações em lote */
.table-scroll { max-height: calc(100vh - 150px); overflow: auto; }
.table-scroll .table thead th { position: sticky; top: 0; z-index: 2; }
.th-sort { display: inline-flex; align-items: center; gap: 4px; border: 0; background: none; padding: 0; font: inherit; color: inherit; text-transform: inherit; letter-spacing: inherit; cursor: pointer; }
.th-sort:hover, .th-sort.active { color: var(--primary); }
.th-arrow { font-size: .85em; opacity: .55; }
.th-sort.active .th-arrow { opacity: 1; }
.th-check, .td-check { width: 36px; }
.th-check input, .td-check input { width: 17px; height: 17px; accent-color: var(--primary); cursor: pointer; }
.table tbody tr.selected td { background: var(--primary-soft); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 4px 3px 10px; border-radius: 999px; background: var(--primary-soft); color: var(--primary); font-size: var(--fs-13); font-weight: 600; }
.chip-x { display: grid; place-items: center; width: 20px; height: 20px; border: 0; border-radius: 50%; background: none; color: inherit; cursor: pointer; }
.chip-x:hover { background: var(--surface); }
.chip-clear { border: 0; background: none; color: var(--muted); font: inherit; font-size: var(--fs-13); cursor: pointer; text-decoration: underline; }
.selection-bar { position: sticky; bottom: 12px; z-index: 15; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 14px; border-radius: var(--r-card); background: var(--text); color: var(--bg); box-shadow: 0 10px 30px rgba(0,0,0,.25); }
.selection-bar .btn-ghost { background: rgba(255,255,255,.14); color: inherit; }
.selection-bar .btn-ghost:hover:not(:disabled) { background: rgba(255,255,255,.24); }
.selection-bar .sel-total { margin-left: auto; font-variant-numeric: tabular-nums; }
.totals-line { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: var(--fs-15); color: var(--muted); }
.totals-line strong { color: var(--text); font-variant-numeric: tabular-nums; }
.fees-tag { display: inline-flex; align-items: center; gap: 4px; color: var(--warn); font-size: var(--fs-13); font-weight: 600; cursor: help; }
@media (max-width: 900px) {
  .selection-bar { bottom: calc(76px + var(--safe-b)); }
  .topbar .theme-btn, .topbar .topbar-search { display: inline-grid; }
}
@media (max-width: 700px) {
  .table-scroll { max-height: none; overflow: visible; }
  .td-check { justify-content: flex-start !important; }
}
/* Uma cor por etapa do fluxo e prioridade como ponto (fora da paleta dos badges de situação) */
:root { --violet: #6d3fc0; --violet-soft: #efe8fb; --teal: #0e7490; --teal-soft: #e0f3f7; --orange: #b45309; --orange-soft: #fdeedc; }
:root[data-theme="dark"] { --violet: #b69cf5; --violet-soft: #2b2140; --teal: #5cc8dc; --teal-soft: #12313a; --orange: #f5a25a; --orange-soft: #3b2512; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --violet: #b69cf5; --violet-soft: #2b2140; --teal: #5cc8dc; --teal-soft: #12313a; --orange: #f5a25a; --orange-soft: #3b2512; } }
.badge-violet { background: var(--violet-soft); color: var(--violet); }
.badge-teal { background: var(--teal-soft); color: var(--teal); }
.badge-orange { background: var(--orange-soft); color: var(--orange); }
.prio { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-15); white-space: nowrap; }
.prio-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); flex: none; }
.prio-urgente .prio-dot { background: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
.prio-alta .prio-dot { background: var(--orange); }
.prio-media .prio-dot { background: var(--muted); }
.prio-baixa .prio-dot { background: transparent; border: 2px solid var(--border); }
.sla-late { display: inline-flex; align-items: center; gap: 4px; color: var(--danger); font-weight: 600; white-space: nowrap; }
.check-line { display: flex; align-items: center; gap: 8px; margin-top: 12px; cursor: pointer; font-size: var(--fs-15); }
.check-line input { width: 17px; height: 17px; accent-color: var(--primary); }
.nav-sub .nav-link .nav-text { white-space: normal; }
.nav-group-solo.open > .nav-group-head { box-shadow: none; background: none; }
.totals-line strong.neg { color: var(--danger); }
@media (min-width: 901px) {
  .nav-mini .nav-group.fly .nav-sub .nav-text { opacity: 1; width: auto; overflow: visible; }
  .nav-mini .nav-group.fly .nav-sub .nav-link { justify-content: flex-start; padding: 7px 10px; }
}
@media (min-width: 901px) {
  .nav-mini .nav-text, .nav-mini .nav-sub .nav-link .nav-text { white-space: nowrap; }
  .nav-mini .nav-group.fly .nav-sub .nav-link .nav-text { white-space: normal; }
  .nav-mini .nav-group.fly > .nav-sub { max-height: calc(100vh - 16px); overflow-y: auto; }
}
.avatar-pop .seg { display: flex; flex-wrap: nowrap; }
.avatar-pop .seg-btn { flex: 1; justify-content: center; padding: 6px 4px; font-size: var(--fs-13); gap: 4px; }
@media (max-width: 900px) { .sidebar { z-index: 40; } .nav-search kbd { display: none; } }

/* ---------- Etapa 3 UX (v1.6): Início, cards por status ---------- */
.stat { height: 100%; }
.stat .stat-icon, .stat-ok .stat-icon, .stat-warn .stat-icon, .stat-danger .stat-icon, .stat-info .stat-icon { background: var(--surface-2); color: var(--muted); }
.stat-attn { border-color: var(--warn); box-shadow: inset 3px 0 0 var(--warn), var(--shadow); }
.stat-attn.stat-danger { border-color: var(--danger); box-shadow: inset 3px 0 0 var(--danger), var(--shadow); }
.stat-danger:not(.stat-zero) .stat-value { color: var(--danger); }
.stat-attn.stat-warn:not(.stat-zero) .stat-value { color: var(--warn); }
.stat-zero { padding: 10px 14px; }
.stat-zero .stat-value { color: var(--muted); font-size: var(--fs-18); }
.stat-zero .stat-icon { width: 32px; height: 32px; }
.home-banner { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: var(--radius); background: var(--primary-soft); color: var(--primary); border: 1px solid var(--primary-2); }
.home-banner:hover { text-decoration: none; filter: brightness(.98); }
.home-banner > div { flex: 1; min-width: 0; }
.home-banner.live { background: var(--warn-soft); color: var(--warn); border-color: var(--warn); }
.attn-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; color: var(--warn); }
.attn-head h2 { color: var(--text); }
.attn-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; }
.attn-item { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--r-ctl); background: var(--surface-2); color: var(--text); border-left: 3px solid var(--warn); }
.attn-item:hover { text-decoration: none; background: var(--warn-soft); }
.attn-item.danger { border-left-color: var(--danger); }
.attn-item.danger .attn-value { color: var(--danger); }
.attn-item > span:nth-child(2) { display: flex; flex-direction: column; min-width: 0; }
.attn-value { font-size: var(--fs-18); font-weight: 700; color: var(--warn); min-width: 2ch; text-align: center; font-variant-numeric: tabular-nums; }
.home-group { display: flex; flex-direction: column; gap: 8px; }
.home-group-title { font-size: var(--fs-13); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
details.home-group > summary { display: flex; align-items: center; gap: 10px; cursor: pointer; list-style: none; min-height: 32px; font-weight: 600; }
details.home-group > summary::-webkit-details-marker { display: none; }
details.home-group > summary > .muted { text-transform: none; letter-spacing: 0; font-weight: 400; }
details.home-group > summary > svg { margin-left: auto; transition: transform .15s; }
details.home-group[open] > summary > svg { transform: rotate(180deg); }
details.home-group > .stats { margin-top: 2px; }
/* Primeiros passos (implantação) */
.onb-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.onb-head h2 { margin: 0 0 2px; }
.onb-bar { height: 8px; border-radius: 99px; background: var(--border); overflow: hidden; margin: 12px 0 8px; }
.onb-bar > span { display: block; height: 100%; background: var(--primary); border-radius: inherit; }
.onb-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.onb-step { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--border); }
.onb-step > a { flex: 1; display: flex; flex-direction: column; gap: 2px; color: var(--text); text-decoration: none; min-width: 0; }
.onb-step > a:hover strong { text-decoration: underline; }
.onb-check { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--border); color: var(--muted); }
.onb-step.done .onb-check { background: var(--ok); border-color: transparent; color: var(--surface); }
.onb-step.done strong { color: var(--muted); text-decoration: line-through; }
/* Aparência e marca da empresa (white-label) */
.brand-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 1000px) { .brand-grid { grid-template-columns: 1fr; } }
.swatches { display: flex; flex-wrap: wrap; gap: 6px; }
.swatch { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--text); font: inherit; font-size: var(--fs-13); cursor: pointer; }
.swatch.on { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-soft); font-weight: 600; }
.swatch-dot { width: 16px; height: 16px; border-radius: 50%; }
.swatch input[type=color] { width: 22px; height: 22px; padding: 0; border: 0; background: none; cursor: pointer; }
.logo-row { display: flex; gap: 10px; flex-wrap: wrap; }
.logo-box { flex: 1 1 180px; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px; border: 1px dashed var(--border); border-radius: var(--r-card); background: #f4f6f5; color: #17201d; text-align: center; }
.logo-box.dark { background: #0e1412; color: #e6eeeb; border-color: #2a3632; }
.brand-preview { display: grid; gap: 10px; }
.bp { display: grid; grid-template-columns: 120px 1fr; border: 1px solid var(--border); border-radius: var(--r-card); overflow: hidden; background: var(--bg); color: var(--text); font-size: var(--fs-12); }
.bp-side { background: var(--surface); border-right: 1px solid var(--border); padding: 8px; display: flex; flex-direction: column; gap: 3px; }
.bp-brand { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; min-width: 0; }
.bp-brand strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bp-logo { width: 20px; height: 20px; border-radius: var(--r-ctl); display: grid; place-items: center; background: var(--primary); color: var(--on-primary); flex: none; }
.bp-item, .bp-sub { padding: 3px 6px; border-radius: var(--r-ctl); color: var(--muted); }
.bp-item.on { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.bp-group { display: flex; gap: 4px; align-items: center; padding: 3px 6px; border-radius: var(--r-ctl); background: var(--surface-2); box-shadow: inset 3px 0 0 var(--primary); font-weight: 600; }
.bp-group .icon { color: var(--primary); }
.bp-sub { padding-left: 22px; }
.bp-sub.on { color: var(--primary); font-weight: 700; }
.bp-main { padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.bp-card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-ctl); padding: 8px; }
.bp-card small { color: var(--muted); }
.bp-row { display: flex; gap: 8px; align-items: center; }
.bp-btn { background: var(--primary); color: var(--on-primary); border-radius: var(--r-ctl); padding: 4px 10px; font-weight: 600; }
.bp-badge { background: var(--primary-soft); color: var(--primary); border-radius: 999px; padding: 1px 8px; font-weight: 600; }
.bp-link { color: var(--primary); }
/* Componentes próprios: select com seta, seletor de mês, arrastar e soltar, rolagem fina */
.select, .field select { appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235f6d68' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 34px; }
/* Seta das listas no tema escuro (a cor da seta clara some no fundo escuro). */
:root[data-theme="dark"] .select, :root[data-theme="dark"] .field select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a59f' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .select, :root:not([data-theme="light"]) .field select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a59f' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); }
}
input.select, .month-btn { background-image: none; padding-right: 12px; }
.field select[multiple] { background-image: none; padding-right: 12px; }
.month-input { position: relative; display: inline-flex; }
.field .month-input { display: flex; }
.month-btn { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; text-align: left; min-width: 150px; width: 100%; }
.month-btn span { flex: 1; }
.month-btn .icon { color: var(--muted); }
.month-pop { position: absolute; z-index: 95; top: calc(100% + 6px); left: 0; width: 248px; padding: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); box-shadow: 0 16px 40px rgba(0,0,0,.2); }
.mp-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.mp-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.mp-m { border: 0; background: none; padding: 8px 0; border-radius: var(--r-ctl); font: inherit; font-size: var(--fs-13); color: var(--text); cursor: pointer; text-transform: capitalize; }
.mp-m:hover:not(:disabled) { background: var(--surface-2); }
.mp-m.now { box-shadow: inset 0 0 0 1px var(--primary-2); }
.mp-m.on { background: var(--primary); color: var(--on-primary); font-weight: 600; }
.mp-m:disabled { opacity: .35; cursor: default; }
.mp-foot { display: flex; justify-content: space-between; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border); }
.field-label { font-size: var(--fs-13); font-weight: 600; }
.dropzone { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 18px 14px; border: 2px dashed var(--border); border-radius: var(--r-card); background: var(--surface-2); color: var(--muted); text-align: center; cursor: pointer; position: relative; transition: border-color .15s, background-color .15s; }
.dropzone strong { color: var(--text); }
.dropzone:hover, .dropzone.over, .dropzone:focus-within { border-color: var(--primary-2); background: var(--primary-soft); }
.drop-input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.drop-preview { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: center; color: var(--text); }
.drop-preview img { max-width: 120px; max-height: 90px; border-radius: var(--r-ctl); object-fit: cover; border: 1px solid var(--border); }
* { scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: var(--r-ctl); }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-button { display: none; height: 0; width: 0; }
/* Calendário: eventos sem corte (até 2 linhas; o texto completo aparece ao passar o mouse) */
.calendar .cal-ev { white-space: normal; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.25; padding: 2px 4px; }
@media (max-width: 600px) { .calendar .cal-ev { display: block; -webkit-line-clamp: unset; } }

/* Quem pediu menos movimento ao sistema operacional: sem animações nem transições (WCAG 2.3.3). */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* Meus boletos: o que pagar no topo; PIX com QR Code */
.pay-banner { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 14px 16px; border-radius: var(--r-card); background: var(--primary-soft); border: 1px solid var(--primary); }
.pay-banner.overdue { background: var(--danger-soft); border-color: var(--danger); }
.pay-banner strong { font-size: var(--fs-18); }
#em-aberto { scroll-margin-top: 80px; }
.pix-box { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.pix-box .details, .pix-box code { align-self: stretch; text-align: left; }

/* Somente para leitores de tela */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Toque: alvos de pelo menos 44 px no celular (WCAG 2.5.8) */
@media (max-width: 700px) {
  .icon-btn { width: 44px; height: 44px; }
  .avatar-btn { padding: 5px; margin: -5px; }
  .btn, .btn-sm { min-height: 44px; }
  .chip { min-height: 36px; }
  .chip-x { width: 36px; height: 36px; margin-right: -8px; }
  details > summary { min-height: 44px; display: flex; align-items: center; }
  .pager .select-sm { min-height: 44px; }
  .field input[type=checkbox] { width: 22px; height: 22px; }
  .field-check label { min-height: 44px; display: flex; align-items: center; gap: 10px; }
}

/* Calendário: passados apagados, pendentes mais claros, dia tocável no celular */
.calendar .cal-day.past { opacity: .55; }
.calendar .cal-ev.pending { opacity: .7; border: 1px dashed currentColor; }
.calendar .cal-tap { cursor: pointer; }
.calendar .cal-tap:active { background: var(--surface-2); }
@media (max-width: 600px) { .calendar .cal-ev { height: 8px; border-radius: 99px; } }

/* Acessibilidade: títulos dos cartões em h2 (ordem de títulos), links dentro de texto sublinhados, atalho para o conteúdo */
.feed-title { font-size: var(--fs-18); margin: 8px 0 4px; }
p a, .prose a, .small a, .alert a, .list li > a:not(.btn) { text-decoration: underline; text-underline-offset: 2px; }
.skip-link { position: fixed; left: 8px; top: -60px; z-index: 300; padding: 10px 14px; border-radius: var(--r-ctl); background: var(--primary); color: var(--on-primary); font-weight: 600; text-decoration: none; }
.skip-link:focus { top: 8px; }
.form-dirty { display: inline-flex; align-items: center; gap: 4px; margin-right: auto; color: var(--warn); font-size: var(--fs-13); font-weight: 600; }
.form-dirty[hidden] { display: none; }

/* Campo de data dd/mm/aaaa com botão de calendário */
.date-input { position: relative; display: flex; align-items: stretch; min-width: 0; }
.date-input .date-text { flex: 1; min-width: 0; padding-right: 44px; }
.date-input .date-btn { position: absolute; right: 2px; top: 50%; transform: translateY(-50%); width: 40px; height: 36px; display: grid; place-items: center; border: 0; border-radius: var(--r-ctl); background: transparent; color: var(--muted); cursor: pointer; }
.date-input .date-btn:hover { background: var(--surface-2); color: var(--text); }
.date-input .date-native { position: absolute; right: 0; bottom: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; border: 0; padding: 0; }
.toolbar .date-input .date-text { width: 9.5em; }
/* ---------- uso do sistema: barra de progresso pequena nos Primeiros passos e cartaz A4 com QR Code ---------- */
.onb-bar-sm { display: block; height: 6px; margin-top: 6px; max-width: 240px; }
.poster-wrap { max-width: 820px; margin: 0 auto; }
.poster-actions { margin-bottom: 12px; }
.poster { background: #ffffff; color: #111111; border: 1px solid var(--border); border-radius: var(--r-card); padding: 40px 48px; text-align: center; }
.poster-kicker { text-transform: uppercase; letter-spacing: .08em; font-weight: 700; color: #555555; margin: 0; }
.poster h1 { font-size: 40px; line-height: 1.1; margin: 8px 0 12px; color: #111111; }
.poster-lead { font-size: 18px; margin: 0 auto 20px; max-width: 560px; }
.poster-qr { display: inline-block; padding: 12px; border: 3px solid #111111; border-radius: 16px; line-height: 0; }
.poster-qr .qr-svg { width: 300px; }
.poster-url { font-size: 20px; font-weight: 700; margin: 12px 0 20px; word-break: break-all; }
.poster-steps { text-align: left; font-size: 18px; max-width: 600px; margin: 0 auto 20px; display: grid; gap: 10px; }
.poster-foot { font-size: 16px; color: #333333; margin: 0; }
@media print {
  .poster-actions { display: none !important; }
  .poster { border: none; padding: 0; }
  .poster-wrap { max-width: none; }
  @page { size: A4; margin: 16mm; }
}
/* ---------- modo essencial do menu (síndico) ---------- */
.nav-mode { padding: 8px 0 4px; border-top: 1px solid var(--border); margin-top: 6px; }
.nav-mode-btn { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: none; border-radius: var(--r-ctl); background: transparent; color: var(--muted); font: inherit; font-size: var(--fs-14, 14px); cursor: pointer; text-align: left; }
.nav-mode-btn:hover { background: var(--surface-2); color: var(--text); }
.nav-mini .nav-mode-btn { justify-content: center; padding: 8px 0; }
/* ---------- reserva: grade de horários com legenda ---------- */
.slot-legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: var(--fs-13); color: var(--muted); margin-bottom: 10px; }
.slot-legend span { display: inline-flex; align-items: center; gap: 6px; }
.slot-dot { display: inline-block; width: 14px; height: 14px; border-radius: 4px; border: 1px solid var(--border); }
.slot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 8px; }
.slot { display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 44px; padding: 6px 4px; border-radius: var(--r-ctl); border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-weight: 600; cursor: pointer; }
.slot small { font-weight: 400; font-size: var(--fs-12); color: var(--muted); }
.slot-livre, .slot-dot.slot-livre { border-color: var(--ok, #2e7d32); background: var(--ok-soft, #e8f5e9); }
.slot-ocupado, .slot-dot.slot-ocupado { background: var(--surface-2); color: var(--muted); text-decoration: line-through; cursor: not-allowed; }
.slot-bloqueado, .slot-dot.slot-bloqueado { background: repeating-linear-gradient(45deg, var(--danger-soft) 0 6px, var(--surface) 6px 12px); color: var(--danger); cursor: not-allowed; }
.slot.slot-escolhido, .slot-dot.slot-escolhido { background: var(--primary); border-color: var(--primary); color: var(--on-primary); text-decoration: none; }
.slot.slot-escolhido small { color: var(--on-primary); }
.slot:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.slot-summary { margin: 10px 0 0; font-weight: 600; }
/* ---------- histórico por mês e informe anual ---------- */
.month-groups { display: grid; gap: 8px; }
.month-group { border: 1px solid var(--border); border-radius: var(--r-ctl); padding: 6px 10px; }
.month-group > summary { cursor: pointer; padding: 6px 0; display: list-item; }
.month-group > summary > * { display: inline; }
.informe { background: #ffffff; color: #111111; border: 1px solid var(--border); border-radius: var(--r-card); padding: 32px; }
.informe h1 { font-size: 24px; margin: 0 0 6px; color: #111111; }
.informe h2 { font-size: 16px; margin: 20px 0 8px; color: #111111; }
.informe-total { font-size: 18px; font-weight: 700; margin: 16px 0 8px; }
@media print { .informe { border: none; padding: 0; } }
/* ---------- esqueletos de carregamento ---------- */
.sk { display: block; border-radius: 8px; background: linear-gradient(90deg, var(--surface-2) 25%, var(--border) 37%, var(--surface-2) 63%); background-size: 400% 100%; animation: sk-shine 1.4s ease infinite; }
.sk-block { display: grid; gap: 10px; padding: 16px 0; }
.sk-line { height: 12px; }
.sk-page { display: grid; gap: 14px; padding: 4px 0; }
.sk-title { height: 28px; width: 40%; }
.sk-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.sk-card { height: 88px; border-radius: var(--r-card); }
.sk-list { display: grid; gap: 8px; }
.sk-row { height: 44px; }
@keyframes sk-shine { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
@media (prefers-reduced-motion: reduce) { .sk { animation: none; } }
.guia-list { display: grid; gap: 10px; padding-left: 20px; }
.guia-list li a { display: block; color: inherit; }
.guia-list li span { display: block; color: #333333; }
.label-reader { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px; margin-bottom: 8px; border: 1px dashed var(--border); border-radius: var(--r-ctl); background: var(--surface-2); }
.kb-ask { display: flex; gap: 8px; flex-wrap: wrap; }
.kb-ask .search { flex: 1 1 260px; max-width: none; }
.kb-answer { margin-top: 12px; display: grid; gap: 8px; }
.kb-text { font-size: var(--fs-15); margin: 0; }
.kb-sources { display: grid; gap: 4px; }
.kb-sources summary { cursor: pointer; font-weight: 600; }
pre.terms-box { white-space: pre-wrap; word-break: break-word; overflow-x: hidden; font-family: inherit; }
.modal select.input { width: 100%; }
.text-danger { color: var(--danger); }
.bench-good { color: var(--ok); font-weight: 700; }
.bench-bad { color: var(--danger); font-weight: 700; }
