.nfse-btn-xs {
  font-size: 11px !important;
  padding: 2px 6px !important;
}

.nfse-client-table {
  font-size: 12px;
}

.nfse-error-textarea {
  width: 520px;
  height: 60px;
  resize: none;
  overflow: auto;
  font-size: 12px;
}

.nfse-client-invoice-alert {
  font-size: 12px;
  line-height: 1.4;
}

.nfse-client-invoice-alert a {
  font-size: 11px;
}

.nfse-client-summary {
  font-size: 12px;
  line-height: 1.5;
}

.nfse-client-summary-line {
  margin-top: 3px;
}

.nfse-client-actions {
  margin-top: 10px !important;
}

.nfse-action-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.nfse-action-row form {
  display: inline-flex;
  align-items: center;
  margin: 0;
}

.nfse-action-row .btn {
  margin: 0 !important;
}

.nfse-status-ok {
  color: #3c763d;
  font-weight: 700;
}

.nfse-status-error {
  color: #a94442;
  font-weight: 700;
}

.nfse-chave {
  word-break: break-all;
  overflow-wrap: anywhere;
  display: inline-block;
  max-width: 100%;
  font-size: 12px;
}

.nfse-chave-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
}

.nfse-chave-short {
  display: inline-block;
  max-width: 100%;
  font-size: 12px;
  white-space: nowrap;
}

.nfse-copy-btn {
  margin-left: 0;
}

.nfse-chave-line {
  padding-bottom: 10px !important;
}

.nfse-chave-wrap {
  margin-bottom: 10px !important;
}

.nfse-chave-line {
  display: block;
  margin-bottom: 10px !important;
}

.nfse-mt-6 {
  margin-top: 6px !important;
}

.nfse-mt-8 {
  margin-top: 8px !important;
}

.nfse-mt-10 {
  margin-top: 10px !important;
}

.nfse-mt-15 {
  margin-top: 15px !important;
}

.nfse-ml-6 {
  margin-left: 6px !important;
}

.nfse-ml-10 {
  margin-left: 10px !important;
}

.nfse-mb-10 {
  margin-bottom: 10px !important;
}

/* ==========================================================================
   OpenNfse UI — tokens e componentes (prefixo nfse-, sem colidir com o Bootstrap do WHMCS).
   Valores de tokens.json. Sem @import de fonte externa: este CSS também carrega na área do
   cliente; a pilha de fallback de --font-sans basta.
   ========================================================================== */

.nfse-ui {
  --brand-green: #00954b;
  --brand-yellow: #fec900;
  --brand-blue: #083795;
  --surface-page: #f4f6f9;
  --surface-card: #ffffff;
  --surface-subtle: #f0f3f7;
  --border: #e1e6ed;
  --border-strong: #cfd6e0;
  --divider: #edf0f4;
  --ink: #1d2433;
  --ink-2: #3c4655;
  --muted: #5b6472;
  --zero: #8a93a0;
  --on-dark: #ffffff;
  --accent: #1f5fbf;
  --accent-hover: #163f7d;
  --accent-soft: #a9c0e6;
  --series-canceled: #c2560c;
  --series-error: #7a3fc4;
  --heat-1: #e6eefa;
  --heat-2: #b9cdee;
  --heat-3: #7fa3dd;
  --heat-4: #3f73c6;
  --heat-5: #1a4c9c;
  --ok-bg: #eef8f1;
  --ok-ink: #1e6b3f;
  --warn-bg: #fff7e8;
  --warn-border: #f0cf8c;
  --warn-ink: #6b4300;
  --danger-bg: #fdecea;
  --danger-border: #f1b3ab;
  --danger-ink: #8b2216;
  --badge-emitida-bg: #e8f0fb;
  --badge-emitida-ink: #163f7d;
  --badge-cancelada-bg: #fdf0e6;
  --badge-cancelada-ink: #8f3f08;
  --badge-erro-bg: #f2ebfb;
  --badge-erro-ink: #5a2a99;
  --badge-neutro-bg: #eceff3;
  --badge-neutro-ink: #3c4655;
  --font-sans: Inter, "Segoe UI", system-ui, -apple-system, sans-serif;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --radius-sm: 3px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-xl: 12px;
  --radius-pill: 999px;
  --shadow-pop: 0 4px 12px rgba(29, 36, 51, 0.16);
}

/* Componentes (components/bundle.css do OpenNfse UI) */

.nfse-ui { font-family: var(--font-sans); font-size: 13px; line-height: 20px; color: var(--ink); background: transparent; }
.nfse-ui *, .nfse-ui *::before, .nfse-ui *::after { box-sizing: border-box; }
.nfse-ui a { color: var(--accent); }
.nfse-ui a:hover { color: var(--accent-hover); }
.nfse-ui :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.nfse-num { font-variant-numeric: tabular-nums; }

.nfse-page { display: flex; flex-direction: column; gap: var(--space-4); padding-block: var(--space-6); }

.nfse-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3); }
.nfse-header__brand { display: flex; align-items: center; gap: var(--space-3); }
.nfse-logo { width: 40px; height: 40px; border-radius: var(--radius-lg); display: block; }
.nfse-title { margin: 0; font-size: 22px; line-height: 28px; font-weight: 600; }
.nfse-subtitle { font-size: 13px; color: var(--muted); }
.nfse-header__tools { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.nfse-period { min-width: 140px; text-align: center; font-size: 15px; font-weight: 600; }

.nfse-btn { font: inherit; font-size: 13px; line-height: 20px; min-height: 36px; padding: var(--space-2) var(--space-3); border: 1px solid var(--border-strong); border-radius: var(--radius-lg); background: var(--surface-card); color: var(--ink); display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); cursor: pointer; text-decoration: none; }
.nfse-btn:hover { background: var(--surface-subtle); }
.nfse-btn--primary { background: var(--accent); border-color: var(--accent); color: var(--on-dark); font-weight: 600; }
.nfse-btn--primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.nfse-btn--icon { width: 36px; padding: 0; }
.nfse-btn--danger { background: var(--surface-card); border-color: var(--danger-border); color: var(--danger-ink); }
.nfse-btn svg { width: 16px; height: 16px; }

.nfse-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.nfse-chip { font: inherit; font-size: 12px; line-height: 16px; min-height: 30px; padding: 6px var(--space-3); border-radius: var(--radius-pill); border: 1px solid var(--border-strong); background: var(--surface-card); color: var(--ink); cursor: pointer; }
.nfse-chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--on-dark); }
.nfse-chip__count { margin-left: 4px; color: var(--muted); }
.nfse-chip[aria-pressed="true"] .nfse-chip__count { color: var(--on-dark); }

.nfse-badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; line-height: 14px; font-weight: 600; letter-spacing: 0.02em; padding: 3px var(--space-2); border-radius: var(--radius-pill); text-transform: uppercase; white-space: nowrap; background: var(--badge-neutro-bg); color: var(--badge-neutro-ink); }
.nfse-badge--emitida { background: var(--badge-emitida-bg); color: var(--badge-emitida-ink); }
.nfse-badge--cancelada { background: var(--badge-cancelada-bg); color: var(--badge-cancelada-ink); }
.nfse-badge--erro { background: var(--badge-erro-bg); color: var(--badge-erro-ink); }
.nfse-badge--ok { background: var(--ok-bg); color: var(--ok-ink); }
.nfse-badge--danger { background: var(--danger-bg); color: var(--danger-ink); }
.nfse-badge--version { text-transform: none; font-weight: 500; letter-spacing: 0; }

.nfse-card { background: var(--surface-card); border: 1px solid var(--border); border-radius: var(--radius-xl); }
.nfse-card--pad { padding: var(--space-5); }
.nfse-card__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2); padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--divider); }
.nfse-card__title { margin: 0; font-size: 14px; line-height: 20px; font-weight: 600; }
.nfse-section-title { margin: 0; font-size: 16px; line-height: 22px; font-weight: 600; }
.nfse-card__summary { font-size: 13px; color: var(--muted); }

.nfse-health { display: flex; flex-wrap: wrap; border: 1px solid var(--border); border-radius: var(--radius-xl); overflow: hidden; background: var(--surface-card); }
.nfse-health__item { flex: 1 1 260px; display: flex; align-items: center; gap: var(--space-3); padding: 14px var(--space-4); }
.nfse-health__item + .nfse-health__item { border-left: 1px solid var(--border); }
.nfse-health__item svg { width: 22px; height: 22px; flex: none; }
.nfse-health__title { font-size: 14px; line-height: 20px; font-weight: 600; }
.nfse-health__text { font-size: 12px; line-height: 16px; }
.nfse-health__body { flex: 1; min-width: 0; }
.nfse-health__item--ok { background: var(--ok-bg); color: var(--ok-ink); }
.nfse-health__item--warn { background: var(--warn-bg); color: var(--warn-ink); }
.nfse-health__item--danger { background: var(--danger-bg); color: var(--danger-ink); }
.nfse-health__item--danger + .nfse-health__item, .nfse-health__item + .nfse-health__item--danger { border-left-color: var(--danger-border); }
.nfse-health__item a { color: inherit; font-weight: 600; font-size: 13px; }

.nfse-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); background: var(--surface-card); border: 1px solid var(--border); border-radius: var(--radius-xl); overflow: hidden; }
.nfse-kpi { padding: 14px var(--space-4); border-right: 1px solid var(--divider); }
.nfse-kpi__label { font-size: 12px; line-height: 16px; color: var(--muted); }
.nfse-kpi__value { font-size: 24px; line-height: 30px; font-weight: 700; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.nfse-kpi__value--zero { color: var(--zero); }
.nfse-kpi__value--ok { color: var(--ok-ink); }

.nfse-table-wrap { overflow-x: auto; }
.nfse-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.nfse-table th { text-align: left; font-size: 12px; font-weight: 500; color: var(--muted); padding: 10px var(--space-2); border-bottom: 1px solid var(--divider); white-space: nowrap; }
.nfse-table td { padding: 10px var(--space-2); border-top: 1px solid var(--divider); vertical-align: middle; }
.nfse-table th:first-child, .nfse-table td:first-child { padding-left: var(--space-4); }
.nfse-table th:last-child, .nfse-table td:last-child { padding-right: var(--space-4); }
.nfse-table tbody tr:hover { background: var(--surface-subtle); }
.nfse-table .nfse-right { text-align: right; font-variant-numeric: tabular-nums; }
.nfse-table .nfse-dim { color: var(--muted); white-space: nowrap; }

.nfse-feed__row { display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; gap: var(--space-3); align-items: center; padding: 10px var(--space-4); border-top: 1px solid var(--divider); font-size: 13px; }
.nfse-feed__dot { width: 10px; height: 10px; border-radius: var(--radius-pill); justify-self: center; background: var(--accent); }
.nfse-feed__dot--cancelada { background: var(--series-canceled); }
.nfse-feed__dot--erro { background: var(--series-error); }
.nfse-feed__title { font-weight: 500; }
.nfse-feed__meta { color: var(--muted); }
.nfse-feed__when { color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }

.nfse-legend { display: flex; flex-wrap: wrap; gap: var(--space-4); font-size: 12px; line-height: 16px; color: var(--ink-2); }
.nfse-legend__item { display: inline-flex; align-items: center; gap: 6px; }
.nfse-swatch { width: 12px; height: 12px; border-radius: var(--radius-sm); background: var(--accent); }
.nfse-swatch--soft { background: var(--accent-soft); }
.nfse-swatch--cancelada { background: var(--series-canceled); }
.nfse-swatch--erro { background: var(--series-error); border-radius: var(--radius-pill); }

.nfse-strips { display: grid; grid-template-columns: 110px minmax(0, 1fr) 48px; column-gap: var(--space-3); row-gap: 10px; align-items: end; min-width: 640px; }
.nfse-strip__label { font-size: 12px; color: var(--ink-2); }
.nfse-strip__total { font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.nfse-strip { display: flex; align-items: flex-end; gap: var(--space-1); border-bottom: 1px solid var(--divider); }
.nfse-strip--main { height: 80px; border-bottom-color: var(--zero); }
.nfse-strip--minor { height: 28px; }
.nfse-strip__bar { flex: 1; border-radius: var(--radius-sm) var(--radius-sm) 0 0; background: var(--accent); }
.nfse-strip__bar--weekend { background: var(--accent-soft); }
.nfse-strip__bar--cancelada { background: var(--series-canceled); }
.nfse-strip__bar--erro { background: var(--series-error); }
.nfse-strip__axis { display: flex; gap: var(--space-1); font-size: 11px; line-height: 14px; color: var(--muted); }
.nfse-strip__axis span { flex: 1; text-align: center; }

.nfse-cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.nfse-cal__dow { font-size: 11px; line-height: 14px; color: var(--muted); }
.nfse-cal__cell { height: 64px; border-radius: var(--radius-md); padding: 6px var(--space-2); display: flex; flex-direction: column; justify-content: space-between; color: var(--ink); border: 0; font: inherit; text-align: left; cursor: pointer; }
.nfse-cal__cell--empty { background: transparent; cursor: default; }
.nfse-cal__cell[aria-pressed="true"] { outline: 2px solid var(--ink); outline-offset: 0; }
.nfse-cal__top { display: flex; justify-content: space-between; align-items: center; font-size: 11px; line-height: 14px; }
.nfse-cal__count { font-size: 18px; line-height: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.nfse-cal__marks { display: flex; gap: 3px; }
.nfse-mark { min-width: 14px; height: 14px; padding: 0 3px; border-radius: var(--radius-sm); font-size: 10px; line-height: 14px; font-weight: 600; text-align: center; color: var(--on-dark); background: var(--series-canceled); }
.nfse-mark--erro { background: var(--series-error); border-radius: var(--radius-pill); }
.nfse-heat-1 { background: var(--heat-1); }
.nfse-heat-2 { background: var(--heat-2); }
.nfse-heat-3 { background: var(--heat-3); }
.nfse-heat-4 { background: var(--heat-4); color: var(--on-dark); }
.nfse-heat-5 { background: var(--heat-5); color: var(--on-dark); }
.nfse-heat-scale { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); }
.nfse-heat-scale span[class^="nfse-heat-"] { width: 16px; height: 16px; border-radius: var(--radius-sm); }

.nfse-hbar { display: grid; grid-template-columns: 36px minmax(0, 1fr) 40px; gap: var(--space-2); align-items: center; font-size: 12px; }
.nfse-hbar__track { height: 14px; background: var(--surface-subtle); border-radius: var(--radius-sm); }
.nfse-hbar__fill { height: 100%; background: var(--accent); border-radius: var(--radius-sm); }
.nfse-hbar__fill--weekend { background: var(--accent-soft); }
.nfse-hbar__value { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }

.nfse-tooltip { display: inline-block; background: var(--ink); color: var(--on-dark); font-size: 12px; line-height: 18px; padding: var(--space-2) 10px; border-radius: var(--radius-md); box-shadow: var(--shadow-pop); }
.nfse-tooltip strong { display: block; }

/* Complementos da Dashboard (partes que o protótipo C fazia com style inline) */

.nfse-ui a.nfse-badge { text-decoration: none; }
.nfse-badge--warn { background: var(--warn-bg); color: var(--warn-ink); border: 1px solid var(--warn-border); }
.nfse-ui a.nfse-badge--warn, .nfse-ui a.nfse-badge--warn:hover { color: var(--warn-ink); }
.nfse-ui a.nfse-btn, .nfse-ui a.nfse-btn:hover { color: var(--ink); text-decoration: none; }
.nfse-ui a.nfse-btn--primary, .nfse-ui a.nfse-btn--primary:hover { color: var(--on-dark); }
.nfse-btn[aria-disabled="true"] { opacity: 0.45; cursor: default; }
.nfse-btn[aria-disabled="true"]:hover { background: var(--surface-card); }
.nfse-ui a.nfse-chip, .nfse-ui a.nfse-chip:hover { color: var(--ink); text-decoration: none; display: inline-flex; align-items: center; }
.nfse-chip:hover { background: var(--surface-subtle); }
.nfse-chip[aria-current="true"], .nfse-ui a.nfse-chip[aria-current="true"],
.nfse-chip[aria-pressed="true"]:hover { background: var(--ink); border-color: var(--ink); color: var(--on-dark); }
.nfse-ui form.nfse-chips, .nfse-ui form.nfse-cal, .nfse-ui form.nfse-custom__panel { margin: 0; }

.nfse-custom { position: relative; }
.nfse-custom > summary { list-style: none; display: inline-flex; align-items: center; }
.nfse-custom > summary::-webkit-details-marker { display: none; }
.nfse-custom__panel { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--space-2); width: max-content; max-width: calc(100vw - 32px); padding: var(--space-3); background: var(--surface-card); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-pop); }
.nfse-field { display: flex; flex-direction: column; gap: var(--space-1); margin: 0; font-size: 12px; line-height: 16px; font-weight: 400; color: var(--muted); }
.nfse-input { font: inherit; font-size: 13px; min-height: 36px; padding: 6px var(--space-2); border: 1px solid var(--border-strong); border-radius: var(--radius-lg); background: var(--surface-card); color: var(--ink); }

.nfse-cal__month { font-weight: 600; }
.nfse-cal__cell--future { opacity: 0.55; cursor: default; }
.nfse-cal__cell:not(.nfse-cal__cell--empty):not(.nfse-cal__cell--future):hover { box-shadow: inset 0 0 0 2px var(--accent); }
.nfse-scroll-x { overflow-x: auto; }
.nfse-card--clip { overflow: hidden; }
.nfse-feed__empty { padding: var(--space-3) var(--space-4); border-top: 1px solid var(--divider); color: var(--muted); }
.nfse-feed__foot { padding: 10px var(--space-4); border-top: 1px solid var(--divider); font-weight: 600; }
.nfse-feed__meta a { color: inherit; text-decoration: underline; }
.nfse-ui .nfse-health__item a:hover { color: inherit; }
.nfse-health__title a { font-size: inherit; text-decoration: underline; text-underline-offset: 2px; }
.nfse-text-danger { color: var(--danger-ink); font-weight: 600; }
/* Barra única: indicadores do período (3fr) e Fila agora (1fr) no mesmo card. As larguras vêm da área
   da Dashboard (container nfse-page), e não da janela: o menu lateral do WHMCS também conta. */
.nfse-ui.nfse-page { container: nfse-page / inline-size; }
.nfse-bar { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 1fr); align-items: stretch; background: var(--surface-card); border: 1px solid var(--border); border-radius: var(--radius-xl); }
.nfse-bar--solo { grid-template-columns: minmax(0, 1fr); }
.nfse-bar__period { display: flex; flex-direction: column; min-width: 0; padding: 14px 0 16px; }
.nfse-bar__head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px var(--space-3); padding: 0 var(--space-4) 10px; font-size: 12px; line-height: 16px; color: var(--muted); }
/* Ferramentas do período no cabeçalho da barra: setas, rótulo e Hoje / 7 dias / Personalizado, compactos. */
.nfse-periodnav { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.nfse-btn--xs, .nfse-btn--xs.nfse-btn--icon { min-height: 26px; height: 26px; width: 26px; border-radius: var(--radius-md); }
.nfse-btn--xs svg { width: 14px; height: 14px; }
.nfse-periodnav__label { padding: 0 2px; font-size: 13px; line-height: 20px; font-weight: 600; color: var(--ink); white-space: nowrap; }
.nfse-chips--sm { margin-left: 6px; gap: 4px; }
.nfse-chips--sm .nfse-chip { min-height: 26px; padding: 4px 10px; font-size: 12px; line-height: 16px; }
.nfse-bar__head .nfse-custom__panel { left: 0; right: auto; z-index: 30; }
.nfse-bar__head-title { font-weight: 600; color: var(--ink-2); }
.nfse-bar__kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); row-gap: 14px; }
.nfse-bar__kpis .nfse-kpi { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding: 0 var(--space-4); border-right: 1px solid var(--divider); }
.nfse-bar__kpis .nfse-kpi:last-child { border-right: 0; }
.nfse-bar__kpis .nfse-kpi__value { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nfse-bar__queue { border-radius: 0 calc(var(--radius-xl) - 1px) calc(var(--radius-xl) - 1px) 0; display: flex; flex-direction: column; gap: var(--space-2); min-width: 0; padding: var(--space-3) var(--space-4); background: var(--surface-subtle); border-left: 1px solid var(--border); }
.nfse-queue__head { display: flex; align-items: center; gap: var(--space-2); min-width: 0; }
.nfse-dot { width: 8px; height: 8px; border-radius: var(--radius-pill); flex: none; }
.nfse-dot--ok { background: var(--ok-ink); }
.nfse-dot--danger { background: var(--danger-ink); }
.nfse-queue__title { margin: 0; font-size: 12px; line-height: 16px; font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.nfse-ui form.nfse-queue__form { margin: 0 0 0 auto; flex: none; }
.nfse-btn--sm { min-height: 28px; height: 28px; padding: 0 10px; font-size: 12px; white-space: nowrap; }
.nfse-queue__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--space-4); row-gap: var(--space-1); }
.nfse-queue__row { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-2); min-width: 0; font-size: 12px; color: var(--ink-2); }
.nfse-ui a.nfse-queue__row, .nfse-ui a.nfse-queue__row:hover { color: var(--ink-2); text-decoration: none; }
.nfse-ui a.nfse-queue__row:hover span:first-child { text-decoration: underline; }
.nfse-queue__row > span:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nfse-queue__n { font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink); }
.nfse-queue__row--zero .nfse-queue__n { color: var(--zero); }
.nfse-ui a.nfse-queue__row--danger, .nfse-ui a.nfse-queue__row--danger:hover, .nfse-queue__row--danger .nfse-queue__n { color: var(--danger-ink); }
.nfse-queue__foot { display: flex; align-items: flex-end; gap: var(--space-2); margin-top: auto; font-size: 11px; line-height: 14px; color: var(--muted); }
.nfse-queue__meta { flex: 1; min-width: 0; }
.nfse-queue__foot a { margin-left: auto; font-weight: 600; white-space: nowrap; }
/* Área abaixo de ~1840px: os 6 indicadores a 24px não cabem um valor como R$ 1.258.700,87; passam a 22px. */
@container nfse-page (max-width: 1839px) {
  .nfse-bar__kpis .nfse-kpi { padding: 0 var(--space-3); }
  .nfse-bar__kpis .nfse-kpi:first-child { padding-left: var(--space-4); }
  .nfse-bar__kpis .nfse-kpi__value { font-size: 22px; }
}
/* Área abaixo de ~1640px: 2 linhas de 3 indicadores, de volta a 24px. */
@container nfse-page (max-width: 1639px) {
  .nfse-bar__kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .nfse-bar__kpis .nfse-kpi, .nfse-bar__kpis .nfse-kpi:first-child { padding: 0 var(--space-4); }
  .nfse-bar__kpis .nfse-kpi:nth-child(3n) { border-right: 0; }
  .nfse-bar__kpis .nfse-kpi__value { font-size: 24px; }
}
/* Área abaixo de 1000px: a Fila agora desce para baixo dos indicadores, no mesmo card. */
@container nfse-page (max-width: 999px) {
  .nfse-bar { grid-template-columns: minmax(0, 1fr); }
  .nfse-bar__queue { border-left: 0; border-top: 1px solid var(--border); border-radius: 0 0 calc(var(--radius-xl) - 1px) calc(var(--radius-xl) - 1px); }
}
/* Barra de navegação do addon (Views\AdminNav), em todas as telas, e a linha de título abaixo dela. */
.nfse-ui.nfse-shell { container: nfse-shell / inline-size; display: flex; flex-direction: column; gap: var(--space-4); padding-top: var(--space-4); margin-bottom: var(--space-4); }
.nfse-shell + .nfse-page { padding-top: 0; }
.nfse-navbar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-4); padding: var(--space-2) var(--space-3); background: var(--surface-card); border: 1px solid var(--border); border-radius: var(--radius-xl); }
.nfse-navbar__brand { display: flex; align-items: center; gap: 10px; padding-right: var(--space-4); border-right: 1px solid var(--border); }
.nfse-navbar__logo { width: 28px; height: 28px; display: block; }
.nfse-navbar__name { font-size: 15px; line-height: 20px; font-weight: 600; color: var(--ink); }
.nfse-navbar__tabs { display: flex; flex-wrap: wrap; gap: var(--space-1); }
.nfse-ui a.nfse-tab { display: inline-flex; align-items: center; gap: 6px; padding: 6px var(--space-3); border-radius: var(--radius-lg); font-size: 13px; line-height: 20px; color: var(--ink-2); text-decoration: none; }
.nfse-ui a.nfse-tab:hover { background: var(--surface-subtle); color: var(--ink); text-decoration: none; }
.nfse-ui a.nfse-tab[aria-current="page"], .nfse-ui a.nfse-tab[aria-current="page"]:hover { background: var(--badge-emitida-bg); color: var(--badge-emitida-ink); font-weight: 600; }
.nfse-tab svg { flex: none; }
.nfse-navbar__status { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); padding-right: var(--space-4); border-right: 1px solid var(--border); font-size: 12px; color: var(--muted); }
.nfse-navbar__status:empty { display: none; }
.nfse-ui a.nfse-navbar__queue { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); text-decoration: none; white-space: nowrap; }
.nfse-ui a.nfse-navbar__queue:hover { color: var(--ink); text-decoration: underline; }
.nfse-navbar__page { flex: 1 1 0; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 20px; }
.nfse-ui h1.nfse-navbar__title { display: inline; margin: 0; padding: 0; font-size: 15px; line-height: 20px; font-weight: 600; color: var(--ink); letter-spacing: 0; }
.nfse-navbar__subtitle { font-size: 12px; color: var(--muted); }
.nfse-navbar__tabs, .nfse-navbar__brand, .nfse-navbar__status { flex: none; }
/* Barra sem espaço para o subtítulo: ele some primeiro (o texto inteiro segue no title). */
@container nfse-shell (max-width: 1099px) {
  .nfse-navbar__subtitle { display: none; }
}
/* Barra estreita: marca e estado da fila na primeira linha, abas na linha de baixo. */
@container nfse-shell (max-width: 899px) {
  .nfse-navbar__tabs { order: 3; flex-basis: 100%; justify-content: flex-end; }
  .nfse-navbar__status { padding-right: 0; border-right: 0; }
}
/* Linha de três cards compactos: Emissões por dia | Média por dia da semana | Linha do tempo. */
.nfse-days { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.75fr) minmax(0, 1.5fr); gap: var(--space-4); align-items: stretch; }
.nfse-dcard { display: flex; flex-direction: column; gap: var(--space-2); min-width: 0; padding: var(--space-3) 14px; }
.nfse-dcard__head { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: var(--space-2); row-gap: 2px; }
.nfse-ui h2.nfse-dcard__title { margin: 0; font-size: 14px; line-height: 20px; font-weight: 600; color: var(--ink); }
.nfse-dcard__summary { font-size: 11px; line-height: 14px; color: var(--muted); }
.nfse-days__legend { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) 14px; margin-top: calc(-1 * var(--space-2)); font-size: 11px; line-height: 14px; color: var(--muted); }
.nfse-days__legend .nfse-heat-scale span[class^="nfse-heat-"] { width: 10px; height: 10px; }
.nfse-days__legend .nfse-legend__item { gap: 5px; }
/* Calendário compacto. */
.nfse-dcard .nfse-cal { gap: 3px; }
.nfse-dcard .nfse-cal__dow { font-size: 10px; line-height: 12px; text-align: center; }
.nfse-dcard .nfse-cal__cell { position: relative; height: 26px; padding: 1px var(--space-1); border-radius: var(--radius-sm); justify-content: space-between; }
.nfse-cal__day { font-size: 9px; line-height: 10px; opacity: 0.8; white-space: nowrap; overflow: hidden; }
.nfse-dcard .nfse-cal__count { font-size: 12px; line-height: 13px; text-align: right; }
.nfse-dcard .nfse-cal__marks { position: absolute; top: 3px; right: 3px; display: flex; gap: 2px; }
.nfse-cal__dot { width: 6px; height: 6px; border-radius: var(--radius-pill); flex: none; box-shadow: 0 0 0 1px var(--surface-card); }
.nfse-cal__dot--cancelada { background: var(--series-canceled); }
.nfse-cal__dot--erro { background: var(--series-error); }
/* Média por dia da semana em colunas. */
.nfse-vbars { flex: 1; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; min-height: 140px; }
.nfse-vbar { display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 0; }
.nfse-vbar__value { font-size: 10px; line-height: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.nfse-vbar__track { flex: 1; width: 100%; max-width: 22px; display: flex; align-items: flex-end; }
.nfse-vbar__fill { width: 100%; background: var(--accent); border-radius: var(--radius-sm) var(--radius-sm) 0 0; }
.nfse-vbar__fill--weekend { background: var(--accent-soft); }
.nfse-vbar__name { font-size: 10px; line-height: 12px; color: var(--muted); }
/* Linha do tempo: três séries na mesma escala. */
.nfse-tl__legend { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-left: auto; font-size: 11px; line-height: 14px; color: var(--muted); }
.nfse-tl__key { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.nfse-tl__key b { color: var(--ink); font-variant-numeric: tabular-nums; }
.nfse-tl__swatch { width: 10px; height: 10px; border-radius: 2px; }
.nfse-tl__swatch--emitidas { background: var(--accent-soft); }
.nfse-tl__swatch--cancelada { background: var(--series-canceled); }
.nfse-tl__swatch--erro { background: var(--series-error); }
.nfse-dcard--timeline .nfse-scroll-x { flex: 1; display: flex; }
.nfse-tl { flex: 1; padding-top: 5px; display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: minmax(140px, 1fr) auto; column-gap: 6px; row-gap: 3px; min-width: 0; }
.nfse-tl--long { min-width: 1280px; }
.nfse-tl__y { position: relative; min-width: 22px; font-size: 9px; line-height: 10px; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.nfse-tl__tick { position: absolute; right: 0; }
.nfse-tl__tick--max { top: -5px; }
.nfse-tl__tick--half { top: calc(50% - 5px); }
.nfse-tl__tick--zero { bottom: -5px; }
.nfse-tl__plot { position: relative; }
.nfse-tl__grid { position: absolute; left: 0; right: 0; border-top: 1px dashed var(--border); }
.nfse-tl__grid--max { top: 0; }
.nfse-tl__grid--half { top: 50%; }
.nfse-tl__grid--zero { bottom: 0; border-top-style: solid; }
.nfse-tl__days { position: relative; height: 100%; display: flex; gap: 2px; }
.nfse-tl__day { position: relative; flex: 1 1 0; min-width: 0; display: flex; align-items: flex-end; justify-content: center; }
/* Hoje: fundo bem leve na coluna inteira (translúcido, a grade continua visível) e a data do eixo em negrito. */
.nfse-tl__day--today { background: rgba(31, 95, 191, 0.07); border-radius: 3px; }
.nfse-tl__bar { min-height: 5px; border-radius: 2px 2px 0 0; }
.nfse-tl__bar--emitidas { position: absolute; left: 0; right: 0; bottom: 0; background: var(--heat-3); border-radius: 3px 3px 0 0; }
.nfse-tl__day--weekend .nfse-tl__bar--emitidas { background: var(--heat-2); }
.nfse-tl__minor { position: absolute; top: 0; bottom: 0; left: 50%; transform: translateX(-50%); display: flex; align-items: flex-end; gap: 1px; }
.nfse-tl__bar--cancelada, .nfse-tl__bar--erro { width: 4px; box-shadow: 0 0 0 1px var(--surface-card); }
.nfse-tl__bar--cancelada { background: var(--series-canceled); }
.nfse-tl__bar--erro { background: var(--series-error); }
.nfse-tl__placeholder { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--border); border-radius: 1px; }
.nfse-tl__axis { display: flex; gap: 2px; font-size: 9px; line-height: 10px; color: var(--muted); }
.nfse-tl__axis span { flex: 1 1 0; min-width: 0; text-align: center; white-space: nowrap; }
.nfse-tl__axis .nfse-tl__axis-future { opacity: 0.55; }
.nfse-tl__axis .nfse-tl__axis-today { color: var(--ink); font-weight: 700; }
/* Área abaixo de 1100px: calendário e média lado a lado, linha do tempo embaixo; abaixo de 700px, tudo empilhado. */
@container nfse-page (max-width: 1099px) {
  .nfse-days { grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.75fr); }
  .nfse-dcard--timeline { grid-column: 1 / -1; }
}
@container nfse-page (max-width: 699px) {
  .nfse-days { grid-template-columns: minmax(0, 1fr); }
}

/* ==========================================================================
   Componentes de tela (Fila, Relatórios, Configurações)
   Uso e exemplos em docs/UI.md; helpers PHP em src/Views/Ui.php.
   ========================================================================== */

/* Utilitários de texto e células. */
.nfse-muted { color: var(--muted); }
.nfse-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }
.nfse-nowrap { white-space: nowrap; }
.nfse-break { overflow-wrap: anywhere; word-break: break-word; }
.nfse-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; }
.nfse-cell-stack { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-1); min-width: 0; }
.nfse-cell-meta { font-size: 11px; line-height: 14px; color: var(--muted); }
.nfse-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.nfse-ui form.nfse-inline-form { display: inline-flex; margin: 0; }

/* Botões: variante discreta ("Limpar", "Cancelar") e o tamanho pequeno de texto em linhas de tabela. */
.nfse-btn--ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.nfse-btn--ghost:hover { background: var(--surface-subtle); }
.nfse-ui a.nfse-btn--ghost, .nfse-ui a.nfse-btn--ghost:hover { color: var(--ink-2); }
.nfse-btn--danger:hover { background: var(--danger-bg); }
.nfse-ui a.nfse-btn--danger, .nfse-ui a.nfse-btn--danger:hover { color: var(--danger-ink); }
.nfse-btn:disabled { opacity: 0.45; cursor: default; }

/* Badges: tom de aviso sem borda para tabelas. */
.nfse-badge--neutro { background: var(--badge-neutro-bg); color: var(--badge-neutro-ink); }

/* Cabeçalho de seção: título + resumo à esquerda, ações à direita. */
.nfse-sechead { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--space-2) var(--space-4); }
.nfse-sechead__text { min-width: 0; }
.nfse-ui h2.nfse-sechead__title { margin: 0; font-size: 20px; line-height: 28px; font-weight: 600; color: var(--ink); }
.nfse-sechead__summary { margin-top: 2px; font-size: 13px; line-height: 20px; color: var(--muted); max-width: 620px; }
.nfse-sechead__actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }

/* Barra de filtros: um card, campos numa linha onde couber, ações no fim. */
.nfse-filterbar { padding: var(--space-3) var(--space-4); }
.nfse-ui form.nfse-filterbar__form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--space-3); margin: 0; }
.nfse-filterbar__actions { display: flex; align-items: center; gap: var(--space-2); margin-left: auto; }
.nfse-filterbar .nfse-input, .nfse-input--sm { min-height: 32px; height: 32px; padding: 4px var(--space-2); }
.nfse-filterbar .nfse-btn { min-height: 32px; height: 32px; padding-block: 0; }

/* Campos de formulário (filtros e configurações). */
.nfse-field__label { font-size: 12px; line-height: 16px; color: var(--muted); }
.nfse-ui select.nfse-input { padding-right: 28px; -webkit-appearance: none; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%235b6472' stroke-width='2.5' 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; background-size: 12px 12px; }
/* Select múltiplo e com size: lista nativa, sem a seta. */
.nfse-ui select.nfse-input[multiple], .nfse-ui select.nfse-input[size] { padding-right: var(--space-2); background-image: none; }
.nfse-input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
.nfse-input[aria-invalid="true"] { border-color: var(--danger-border); box-shadow: 0 0 0 1px var(--danger-border); }
.nfse-input--w-xs { width: 96px; }
.nfse-input--w-sm { width: 140px; }
.nfse-input--w-md { width: 200px; }
.nfse-input--w-lg { width: 320px; }
.nfse-input--full { width: 100%; }

/* Tabelas: cabeçalho claro, linhas de 13px, rodapé com contagem e paginação no mesmo card. */
.nfse-card--table { overflow: hidden; }
.nfse-card--table .nfse-card__head + .nfse-table-wrap .nfse-table thead th { border-top: 0; }
.nfse-table thead th { background: var(--surface-subtle); color: var(--ink-2); font-size: 12px; font-weight: 600; }
.nfse-table td { font-size: 13px; vertical-align: top; }
.nfse-table tbody tr:first-child td { border-top: 0; }
.nfse-table .nfse-center { text-align: center; }
.nfse-table td.nfse-num, .nfse-table th.nfse-num { text-align: right; font-variant-numeric: tabular-nums; }
.nfse-table__empty { padding: var(--space-4); color: var(--muted); text-align: center; }
/* Linhas destacadas: fundo bem leve no tom (a primeira coluna pode estar oculta pela escolha de colunas). */
.nfse-table tr.nfse-row--danger { background: rgba(139, 34, 22, 0.04); }
.nfse-table tr.nfse-row--info { background: rgba(31, 95, 191, 0.04); }
.nfse-table tr.nfse-row--warn { background: var(--warn-bg); }
.nfse-tfoot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2) var(--space-4); padding: 10px var(--space-4); border-top: 1px solid var(--divider); font-size: 12px; line-height: 16px; color: var(--ink-2); }
.nfse-tfoot__summary b { color: var(--ink); font-variant-numeric: tabular-nums; }
.nfse-tfoot__tools { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.nfse-ui form.nfse-tfoot__form { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin: 0; }
.nfse-pager { display: inline-flex; align-items: center; gap: var(--space-1); }
.nfse-pager__current { padding: 0 var(--space-2); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Linha de indicadores num card só (mesmo visual da Dashboard). */
.nfse-kpis .nfse-kpi:last-child { border-right: 0; }
.nfse-kpis--sm .nfse-kpi { padding: var(--space-3) var(--space-4); }
.nfse-kpis--sm .nfse-kpi__value { font-size: 22px; line-height: 28px; }
.nfse-kpi__value--danger { color: var(--danger-ink); }
.nfse-kpi__value--warn { color: var(--warn-ink); }

/* Avisos: ícone + título + texto, no visual da barra de saúde. */
.nfse-callout { display: flex; align-items: flex-start; gap: var(--space-3); padding: var(--space-3) var(--space-4); border: 1px solid var(--border); border-radius: var(--radius-xl); background: var(--surface-card); color: var(--ink-2); }
.nfse-callout__icon { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.nfse-callout__body { flex: 1; min-width: 0; }
.nfse-callout__title { font-size: 13px; line-height: 18px; font-weight: 600; }
.nfse-callout__text { font-size: 12px; line-height: 18px; }
.nfse-callout__text p { margin: 0 0 var(--space-1); }
.nfse-callout a { color: inherit; font-weight: 600; text-decoration: underline; }
.nfse-callout--info { background: var(--badge-emitida-bg); border-color: var(--accent-soft); color: var(--badge-emitida-ink); }
.nfse-callout--ok { background: var(--ok-bg); border-color: var(--ok-bg); color: var(--ok-ink); }
.nfse-callout--warn { background: var(--warn-bg); border-color: var(--warn-border); color: var(--warn-ink); }
.nfse-callout--danger { background: var(--danger-bg); border-color: var(--danger-border); color: var(--danger-ink); }

/* Formulários em linhas: rótulo à esquerda (~240px), campo à direita, ajuda embaixo. */
.nfse-form { display: flex; flex-direction: column; }
.nfse-form__row { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: var(--space-2) var(--space-4); align-items: start; padding: var(--space-3) var(--space-4); border-top: 1px solid var(--divider); }
.nfse-form__row:first-child { border-top: 0; }
.nfse-ui label.nfse-form__label, .nfse-form__label { margin: 0; padding-top: 6px; font-size: 13px; line-height: 20px; font-weight: 600; color: var(--ink); }
.nfse-form__req { color: var(--danger-ink); margin-left: 2px; }
.nfse-form__field { display: flex; flex-direction: column; gap: var(--space-1); min-width: 0; }
.nfse-form__help { font-size: 12px; line-height: 16px; color: var(--muted); }
.nfse-form__error { font-size: 12px; line-height: 16px; color: var(--danger-ink); }
.nfse-form__row--invalid .nfse-input { border-color: var(--danger-border); box-shadow: 0 0 0 1px var(--danger-border); }
.nfse-form__row--invalid .nfse-form__label { color: var(--danger-ink); }

/* Barra de salvar: uma ação principal no fim da seção; fixa no rodapé quando o formulário é longo. */
.nfse-savebar { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: var(--space-2); padding: var(--space-3) var(--space-4); border-top: 1px solid var(--divider); background: var(--surface-card); border-radius: 0 0 var(--radius-xl) var(--radius-xl); }
.nfse-savebar--sticky { position: sticky; bottom: 0; z-index: 5; box-shadow: 0 -4px 12px rgba(29, 36, 51, 0.06); }
.nfse-savebar__note { margin-right: auto; font-size: 12px; color: var(--muted); }

/* Submenu de seção (Relatórios, Configurações): lista vertical à esquerda, conteúdo à direita. */
.nfse-withnav { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: var(--space-6) 32px; align-items: start; }
.nfse-withnav__content { display: flex; flex-direction: column; gap: var(--space-6); min-width: 0; }
.nfse-subnav { display: flex; flex-direction: column; gap: 2px; padding: var(--space-3) var(--space-2); }
.nfse-subnav__group { padding: 14px 10px 6px; font-size: 11px; line-height: 14px; font-weight: 600; letter-spacing: .04em; color: var(--muted); }
.nfse-subnav__group:first-child { padding-top: 0; }
.nfse-ui a.nfse-subnav__item { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); min-height: 36px; padding: 6px 10px; border-radius: var(--radius-lg); font-size: 13px; line-height: 20px; color: var(--ink-2); text-decoration: none; }
.nfse-ui a.nfse-subnav__item:hover { background: var(--surface-subtle); color: var(--ink); text-decoration: none; }
.nfse-ui a.nfse-subnav__item[aria-current="page"], .nfse-ui a.nfse-subnav__item[aria-current="page"]:hover { background: var(--badge-emitida-bg); color: var(--badge-emitida-ink); font-weight: 600; }
.nfse-subnav__label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nfse-subnav__meta { flex: none; font-size: 11px; line-height: 14px; font-weight: 400; color: var(--muted); }
.nfse-subnav__item .nfse-badge { flex: none; font-size: 11px; padding: 1px 7px; text-transform: none; letter-spacing: 0; font-weight: 500; }
.nfse-subnav__dot { flex: none; width: 7px; height: 7px; border-radius: var(--radius-pill); background: var(--zero); }
.nfse-subnav__dot--ok { background: var(--ok-ink); }
.nfse-subnav__dot--warn { background: var(--warn-border); }
.nfse-subnav__dot--danger { background: var(--danger-ink); }

/* Menu suspenso simples (ex.: escolha de colunas da tabela). */
.nfse-menu { position: relative; display: inline-flex; }
.nfse-menu__panel { position: absolute; right: 0; top: calc(100% + 4px); z-index: 30; width: 220px; max-height: 320px; overflow: auto; padding: 10px var(--space-3); background: var(--surface-card); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-pop); }
.nfse-menu__panel[hidden] { display: none; }
.nfse-menu__list { display: flex; flex-direction: column; gap: 6px; }
.nfse-ui label.nfse-check { display: flex; align-items: center; gap: var(--space-2); margin: 0; font-size: 13px; font-weight: 400; color: var(--ink-2); cursor: pointer; }
.nfse-menu__foot { display: flex; justify-content: space-between; gap: var(--space-2); margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--divider); }

/* Corpo de card com respiro (quando o card tem cabeçalho e o conteúdo não é tabela). */
.nfse-card__body { padding: var(--space-4); }

/* Texto e ação pequena na mesma linha (ex.: erro + botão de copiar só com ícone). */
.nfse-cell-inline { display: inline-flex; align-items: flex-start; gap: var(--space-1); max-width: 100%; }
.nfse-cell-inline > .nfse-btn { flex: none; margin-block: -3px; }

/* Pares rótulo/valor numa grade (<dl>). */
.nfse-dl { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: var(--space-2) var(--space-4); margin: 0; }
.nfse-dl__item { min-width: 0; }
.nfse-dl dt { font-size: 12px; line-height: 16px; font-weight: 400; color: var(--muted); }
.nfse-dl dd { margin: 0; font-size: 13px; line-height: 20px; font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }

/* Barra de progresso (a largura do preenchimento vem do dado). */
.nfse-progress { height: 8px; border-radius: var(--radius-pill); background: var(--surface-subtle); overflow: hidden; }
.nfse-progress__fill { height: 100%; background: var(--ok-ink); border-radius: var(--radius-pill); }

/* Código: prévia de uma linha em tabela (abre ao focar) e bloco no detalhe. */
.nfse-ui textarea.nfse-code-preview { display: block; width: 100%; min-width: 160px; height: 28px; margin: 0; padding: 4px 6px; resize: none; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface-subtle); color: var(--ink-2); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 11px; line-height: 18px; }
.nfse-ui textarea.nfse-code-preview:focus { height: 120px; white-space: pre-wrap; overflow: auto; }
.nfse-ui textarea.nfse-code, .nfse-ui pre.nfse-code { display: block; width: 100%; margin: 0; padding: var(--space-3); border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface-subtle); color: var(--ink); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; line-height: 18px; white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word; }
.nfse-ui textarea.nfse-code { height: 320px; resize: vertical; overflow: auto; }
.nfse-ui pre.nfse-code { max-height: 360px; overflow: auto; }

/* Duas colunas iguais com título por coluna; uma coluna abaixo de 900px de área. */
.nfse-split2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-4); }
.nfse-split2__item { display: flex; flex-direction: column; gap: var(--space-2); min-width: 0; }
.nfse-split2__title { font-size: 13px; line-height: 18px; font-weight: 600; color: var(--ink); }
@container nfse-page (max-width: 899px) {
  .nfse-split2 { grid-template-columns: minmax(0, 1fr); }
}

/* Área estreita: submenu vira uma linha de chips com rolagem; formulário empilha rótulo e campo. */
@container nfse-page (max-width: 999px) {
  .nfse-withnav { grid-template-columns: minmax(0, 1fr); }
  .nfse-subnav { flex-direction: row; overflow-x: auto; padding: var(--space-1); gap: var(--space-1); }
  .nfse-subnav__group { display: none; }
  .nfse-ui a.nfse-subnav__item { flex: none; border-radius: var(--radius-pill); border: 1px solid var(--border-strong); min-height: 30px; padding: 4px var(--space-3); font-size: 12px; }
}
@container nfse-page (max-width: 699px) {
  .nfse-form__row { grid-template-columns: minmax(0, 1fr); }
  .nfse-form__label { padding-top: 0; }
  .nfse-filterbar__actions { margin-left: 0; }
}

/* Fila: blocos com o mesmo respiro das telas com submenu. */
.nfse-ui.nfse-page.nfse-fila { gap: var(--space-6); }

/* Relatórios */

/* Cards de informação: título, pares rótulo/valor (nfse-dl) e nota curta. */
.nfse-rel-info { display: flex; flex-direction: column; gap: var(--space-2); }
.nfse-rel-info .nfse-card__title { margin: 0; }
.nfse-rel-note { font-size: 12px; line-height: 18px; color: var(--ink-2); }
.nfse-rel-note code, .nfse-callout code { font-size: 11px; padding: 0 3px; border-radius: var(--radius-sm); background: var(--surface-subtle); color: var(--ink); }
.nfse-rel-sub { display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-3); border: 1px solid var(--divider); border-radius: var(--radius-lg); background: var(--surface-subtle); }
.nfse-rel-sub__title { font-size: 12px; line-height: 16px; font-weight: 600; color: var(--ink); }

/* Atalhos de exportação por competência (chips que enviam POST). */
.nfse-rel-shortcuts { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2) var(--space-4); padding: var(--space-3) var(--space-4); }
.nfse-rel-shortcuts__text { min-width: 0; flex: 1 1 280px; }
.nfse-rel-shortcuts__title { font-size: 13px; line-height: 18px; font-weight: 600; color: var(--ink); }
.nfse-rel-shortcuts__summary { font-size: 12px; line-height: 16px; color: var(--muted); }

/* Estado da auditoria assíncrona (a barra é o nfse-progress). */
.nfse-rel-hint { font-size: 12px; line-height: 16px; color: var(--warn-ink); }
.nfse-rel-hint[hidden], .nfse-rel-error[hidden] { display: none; }
.nfse-rel-error { padding: 10px var(--space-3); border: 1px solid var(--danger-border); border-radius: var(--radius-lg); background: var(--danger-bg); color: var(--danger-ink); font-size: 12px; line-height: 18px; white-space: pre-wrap; overflow-wrap: anywhere; }

/* Configurações */

/* Configurações (padrão E3, telas de texto e formulário; ver docs/UI.md):
   submenu em grupos, conteúdo até 900px, cada bloco com título e explicação à esquerda e os campos num card à direita. */
.nfse-cfg .nfse-withnav__content { max-width: 900px; }
/* Status da seção em texto normal ("Expira em 27 dias"), não em maiúsculas. */
.nfse-cfg .nfse-sechead .nfse-badge { text-transform: none; letter-spacing: 0; font-weight: 500; }
.nfse-cfg .nfse-sechead { align-items: flex-start; }
.nfse-cfg-blk { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: var(--space-4) 32px; align-items: start; padding-top: var(--space-6); border-top: 1px solid var(--divider); min-width: 0; }
.nfse-cfg-blk--wide { grid-template-columns: minmax(0, 1fr); }
.nfse-cfg-blk--wide > .nfse-cfg-blk__intro { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: var(--space-4); }
.nfse-cfg-blk--wide > .nfse-cfg-blk__intro > .nfse-cfg-blk__actions { grid-column: 2; grid-row: 1 / span 2; margin-top: 0; align-self: start; }
.nfse-cfg-blk__intro { min-width: 0; }
.nfse-ui h3.nfse-cfg-blk__title { margin: 0; font-size: 15px; line-height: 22px; font-weight: 600; color: var(--ink); }
.nfse-ui p.nfse-cfg-blk__desc { margin: var(--space-1) 0 0; font-size: 12px; line-height: 18px; color: var(--muted); max-width: 70ch; }
.nfse-cfg-blk__actions { margin-top: var(--space-3); }
/* Campos dentro do card: rótulo em cima (500), campo, ajuda curta e "Como funciona" recolhível. */
.nfse-cfg-card .nfse-form__row { grid-template-columns: minmax(0, 1fr); gap: 6px; padding: 14px var(--space-5); }
.nfse-cfg .nfse-ui label.nfse-form__label, .nfse-cfg.nfse-ui label.nfse-form__label, .nfse-cfg-card .nfse-form__label { padding-top: 0; font-weight: 500; }
.nfse-cfg-card .nfse-form__help { max-width: 520px; line-height: 18px; }
.nfse-form__more { font-size: 12px; line-height: 18px; max-width: 520px; }
.nfse-form__more > summary { cursor: pointer; color: var(--accent, #1f5fbf); list-style: none; width: max-content; }
.nfse-form__more > summary::-webkit-details-marker { display: none; }
.nfse-form__more > summary::before { content: "▸"; display: inline-block; margin-right: 4px; transition: transform .15s; }
.nfse-form__more[open] > summary::before { transform: rotate(90deg); }
.nfse-form__more-body { margin-top: var(--space-1); color: var(--muted); }
.nfse-form__more-body > p { margin: 0 0 var(--space-1); }
.nfse-callout .nfse-form__more { margin-top: var(--space-1); }
.nfse-callout .nfse-form__more-body { color: inherit; }
.nfse-cfg-text { margin: 0; font-size: 13px; line-height: 20px; color: var(--ink-2); max-width: 70ch; white-space: pre-line; }
/* Submenu: com as pílulas de status, os nomes das seções quebram em duas linhas em vez de cortar
   (e, sem espaço nem assim, a pílula desce para a linha de baixo). */
.nfse-cfg a.nfse-subnav__item { flex-wrap: wrap; row-gap: 2px; }
.nfse-cfg .nfse-subnav__label { flex: 1 1 0; min-width: auto; overflow: visible; white-space: normal; }
/* Abas da tela (painéis alternados por JS) e formulário principal com os mesmos 16px entre blocos. */
.nfse-cfg-pane { display: flex; flex-direction: column; gap: var(--space-6); min-width: 0; }
.nfse-cfg-pane[hidden], .nfse-cfg-savebar[hidden] { display: none; }
.nfse-ui form.nfse-cfg-form { display: flex; flex-direction: column; gap: var(--space-6); margin: 0; }
/* Nas seções com formulário próprio, o formulário principal fica todo oculto: sem ele, não sobra espaço vazio. */
.nfse-ui form.nfse-cfg-form:not(:has(> .nfse-cfg-pane:not([hidden]))) { display: none; }
.nfse-ui form.nfse-cfg-cardform { margin: 0; }
.nfse-cfg-pending { font-size: 12px; line-height: 16px; color: var(--muted); }
/* Card de subseção: título + descrição empilhados no cabeçalho; blocos de texto com o mesmo recuo das linhas do formulário. */
.nfse-cfg-card { min-width: 0; }
.nfse-cfg-card > .nfse-card__head { align-items: flex-start; }
.nfse-cfg-card__heading { min-width: 0; flex: 1 1 320px; }
.nfse-ui h3.nfse-card__title { margin: 0; font-size: 14px; line-height: 20px; font-weight: 600; color: var(--ink); }
.nfse-cfg-block { display: flex; flex-direction: column; gap: var(--space-2); padding: 14px var(--space-5); border-top: 1px solid var(--divider); min-width: 0; }
.nfse-card__head + .nfse-cfg-block, .nfse-cfg-block:first-child, .nfse-cfg-card > .nfse-cfg-cardform:first-child > .nfse-cfg-block:first-child { border-top: 0; }
.nfse-cfg-note, .nfse-cfg-block.nfse-cfg-note { display: block; font-size: 12px; line-height: 18px; color: var(--muted); }
.nfse-cfg-note > div + div { margin-top: var(--space-1); }
.nfse-cfg-note strong { color: var(--ink-2); }
/* Campos: largura confortável no lado direito; textarea só cresce na vertical. */
.nfse-input.nfse-cfg-field { width: 100%; max-width: 560px; }
.nfse-ui textarea.nfse-input { width: 100%; resize: vertical; line-height: 18px; }
.nfse-cfg-inline { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); max-width: 560px; }
.nfse-cfg-inline .nfse-input { flex: 1 1 200px; min-width: 0; }
.nfse-cfg-code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 11px; line-height: 16px; color: var(--ink-2); overflow-wrap: anywhere; }
.nfse-cfg-checklist { display: flex; flex-direction: column; gap: var(--space-1); max-width: 560px; max-height: 180px; overflow: auto; padding: 6px 10px; border: 1px solid var(--border-strong); border-radius: var(--radius-lg); background: var(--surface-card); }
/* Status (certificado, atualização, municípios): badge + resumo, lista de dados e ações. */
.nfse-cfg-status { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); font-size: 12px; line-height: 16px; color: var(--ink-2); }
.nfse-ui dl.nfse-cfg-facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: var(--space-1) var(--space-3); margin: 0; font-size: 12px; line-height: 18px; }
.nfse-ui .nfse-cfg-facts dt { font-weight: 400; color: var(--muted); }
.nfse-ui .nfse-cfg-facts dd { margin: 0; color: var(--ink); font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.nfse-cfg-facts .nfse-mono { font-weight: 400; }
.nfse-cfg-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: var(--space-3); padding: var(--space-3) var(--space-4) var(--space-4); }
.nfse-cfg-panel { display: flex; flex-direction: column; gap: var(--space-2); min-width: 0; padding: var(--space-3); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.nfse-cfg-panel__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2); }
.nfse-cfg-panel__title { font-size: 13px; line-height: 18px; font-weight: 600; color: var(--ink); }
.nfse-cfg-panel__text { font-size: 12px; line-height: 18px; color: var(--ink-2); }
/* Barra de salvar do formulário principal: card próprio, fixa no rodapé. */
.nfse-savebar.nfse-cfg-savebar { border: 1px solid var(--border); border-radius: var(--radius-xl); }
/* Tabelas da tela: selects ocupam a célula; colunas de rótulo não quebram. */
.nfse-cfg-table select.nfse-input { width: 100%; min-width: 160px; }
.nfse-cfg-table .nfse-input--w-sm { width: 140px; }
@container nfse-page (max-width: 999px) {
  .nfse-cfg .nfse-withnav__content { max-width: none; }
  .nfse-cfg a.nfse-subnav__item { flex-wrap: nowrap; }
  .nfse-cfg .nfse-subnav__label { flex: none; white-space: nowrap; }
}
@container nfse-page (max-width: 699px) {
  .nfse-cfg-blk { grid-template-columns: minmax(0, 1fr); }
  .nfse-cfg-blk--wide > .nfse-cfg-blk__intro { display: block; }
  .nfse-cfg-blk--wide > .nfse-cfg-blk__intro > .nfse-cfg-blk__actions { margin-top: var(--space-3); }
}

/* Atualizador: lista da checagem */
.nfse-ui .nfse-upd-checks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.nfse-ui .nfse-upd-check { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-1) var(--space-3); align-items: center; padding: var(--space-3) 0; border-top: 1px solid var(--divider); }
.nfse-ui .nfse-upd-check:first-child { border-top: 0; padding-top: 0; }
.nfse-ui .nfse-upd-check__label { font-weight: 500; }
.nfse-ui .nfse-upd-check__detail { grid-column: 1 / -1; font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.nfse-ui .nfse-upd-ack { display: flex; gap: var(--space-2); align-items: flex-start; margin: var(--space-3) 0; font-size: 13px; }
.nfse-ui .nfse-upd-rollback { margin-top: var(--space-4); }
