/* =====================================================================
   SisZap UI — classes do contrato compartilhado (docs/PLANO_MELHORIAS_2026_09.md §4.2)
   Carregado pelo layout depois de components.css. CSS puro (sem build).
   Documentação: DESIGN_SYSTEM.md
   ===================================================================== */

:root {
  --sz-primary: #0f2091;
  --sz-primary-dark: #0c1a73;
  --sz-primary-soft: #E8EBFA;
  --sz-secondary: #4353E8;
  --sz-secondary-soft: #EEF0FE;
  --sz-success: #22C55E;
  --sz-success-text: #178A46;
  --sz-success-soft: #E8F8EF;
  --sz-warning: #F59E0B;
  --sz-warning-text: #B45309;
  --sz-warning-soft: #FFF7DE;
  --sz-error: #D1383E;
  --sz-error-soft: #FEF1F2;
  --sz-bg: #F4F6FA;
  --sz-surface: #F7F8FB;
  --sz-card: #FFFFFF;
  --sz-border: #E2E5EE;
  --sz-border-light: #F2F4F8;
  --sz-text: #14171F;
  --sz-text-2: #3A4154;
  --sz-text-3: #6B7280;
  --sz-text-4: #9CA3AF;
  --sz-radius-card: 16px;
  --sz-radius-btn: 14px;
  --sz-radius-input: 12px;
  --sz-radius-sm: 10px;
  --sz-shadow-card: 0 4px 14px rgba(20, 23, 31, 0.07), 0 1px 3px rgba(20, 23, 31, 0.04);
  --sz-font: Figtree, Inter, sans-serif;
  --sz-font-title: 'Hanken Grotesk', Figtree, sans-serif;
  --sz-sidebar-w: 236px;
}

/* ---------------------------------------------------------------------
   .page-content — container padrão de página (abaixo do x-layout.page-header)
   --------------------------------------------------------------------- */
.page-content {
  width: 100%;
  padding: 24px;
  min-width: 0;
}

.page-content > * + * {
  margin-top: 20px;
}

.page-content--narrow { max-width: 760px; }
.page-content--medium { max-width: 1040px; }
.page-content--wide { max-width: 1440px; }
.page-content--centered { margin-left: auto; margin-right: auto; }

@media (max-width: 639px) {
  .page-content { padding: 16px; }
}

/* ---------------------------------------------------------------------
   .page-toolbar — barra de filtros / busca / ações acima de listas
   --------------------------------------------------------------------- */
.page-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
  padding: 12px 16px;
  background: var(--sz-card);
  border: 1px solid #E8EAF0;
  border-radius: 14px;
  box-shadow: 0 1px 3px rgba(20, 23, 31, 0.04);
}

.page-toolbar__search { flex: 1 1 240px; min-width: 200px; }
.page-toolbar__filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.page-toolbar__actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.page-toolbar__count {
  font-size: 12px;
  font-weight: 700;
  color: var(--sz-text-4);
  white-space: nowrap;
}

.page-toolbar .form-field { margin-bottom: 0; min-width: 160px; }
.page-toolbar .form-label { margin-bottom: 4px; }
.page-toolbar select.select-nm, .page-toolbar .select-nm,
.page-toolbar input.input-nm, .page-toolbar .input-nm { height: 38px; font-size: 13px; }
.page-toolbar .search-input { height: 38px; }

/* ---------------------------------------------------------------------
   .empty-state — ícone + título + texto + ação
   --------------------------------------------------------------------- */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 48px 24px;
  color: var(--sz-text-4);
}

.empty-state--compact { padding: 28px 16px; }

.empty-state__icon {
  width: 64px;
  height: 64px;
  border-radius: 20px;
  background: #F0F2F7;
  color: #B6BCCB;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}

.empty-state__icon .material-symbols-outlined { font-size: 32px; }
.empty-state--compact .empty-state__icon { width: 48px; height: 48px; border-radius: 14px; margin-bottom: 10px; }
.empty-state--compact .empty-state__icon .material-symbols-outlined { font-size: 24px; }

.empty-state__title {
  font-size: 15px;
  font-weight: 800;
  color: var(--sz-text-2);
  margin: 0;
}

.empty-state__text {
  font-size: 13px;
  font-weight: 500;
  color: var(--sz-text-4);
  max-width: 440px;
  margin: 6px auto 0;
  line-height: 1.5;
}

.empty-state__action { margin-top: 18px; display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }

/* Dentro de tabelas: <tr><td colspan class="empty-state-cell"> */
.data-table td.empty-state-cell { padding: 0; }

/* ---------------------------------------------------------------------
   .stat-grid — grade responsiva de .kpi-card
   --------------------------------------------------------------------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

@media (min-width: 1024px) {
  .stat-grid--2 { grid-template-columns: repeat(2, 1fr); }
  .stat-grid--3 { grid-template-columns: repeat(3, 1fr); }
  .stat-grid--4 { grid-template-columns: repeat(4, 1fr); }
  .stat-grid--5 { grid-template-columns: repeat(5, 1fr); }
  .stat-grid--6 { grid-template-columns: repeat(6, 1fr); }
}

.kpi-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  box-shadow: 0 1px 3px rgba(20, 23, 31, 0.04);
}

.kpi-card .kpi-label { order: -1; margin-top: 0; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--sz-text-4); }
.kpi-card .kpi-value { color: var(--sz-text); font-family: var(--sz-font-title); letter-spacing: -0.01em; }
.kpi-card .kpi-value small, .kpi-card .kpi-value .kpi-unit { font-size: 14px; font-weight: 600; color: var(--sz-text-4); margin-left: 2px; }
.kpi-card .kpi-hint { font-size: 12px; font-weight: 500; color: var(--sz-text-4); margin-top: 4px; }

.kpi-card__icon {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--sz-secondary-soft);
  color: var(--sz-secondary);
}

.kpi-card__icon .material-symbols-outlined { font-size: 20px; }

.kpi-card--primary .kpi-value { color: var(--sz-primary); }
.kpi-card--primary .kpi-card__icon { background: var(--sz-primary-soft); color: var(--sz-primary); }
.kpi-card--success .kpi-value { color: var(--sz-success-text); }
.kpi-card--success .kpi-card__icon { background: var(--sz-success-soft); color: var(--sz-success-text); }
.kpi-card--warning .kpi-value { color: var(--sz-warning-text); }
.kpi-card--warning .kpi-card__icon { background: var(--sz-warning-soft); color: var(--sz-warning-text); }
.kpi-card--error .kpi-value { color: var(--sz-error); }
.kpi-card--error .kpi-card__icon { background: var(--sz-error-soft); color: var(--sz-error); }
.kpi-card--muted .kpi-value { color: var(--sz-text-3); }

/* ---------------------------------------------------------------------
   .table-actions — ações de linha (sempre visíveis; ícones .btn-nm-icon)
   --------------------------------------------------------------------- */
.table-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 2px;
  opacity: 1;
  white-space: nowrap;
}

.table-actions form { display: inline-flex; margin: 0; }
.data-table td.table-actions-cell, .data-table th.table-actions-cell { text-align: right; width: 1%; white-space: nowrap; }

/* ---------------------------------------------------------------------
   .drawer — painel lateral deslizante com overlay
   Uso: <div class="drawer" id="x"><div class="drawer__overlay" data-drawer-close></div>
        <aside class="drawer__panel"><header class="drawer__header">…</header>
        <div class="drawer__body">…</div><footer class="drawer__footer">…</footer></aside></div>
   Abrir: SisZapUI.openDrawer('x') ou [data-drawer-open="x"]. Classe ativa: .drawer--open
   --------------------------------------------------------------------- */
.drawer {
  position: fixed;
  inset: 0;
  z-index: 70;
  visibility: hidden;
  pointer-events: none;
}

.drawer--open {
  visibility: visible;
  pointer-events: auto;
}

.drawer__overlay {
  position: absolute;
  inset: 0;
  background: rgba(16, 18, 28, 0.42);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.drawer--open .drawer__overlay { opacity: 1; }

.drawer__panel {
  position: absolute;
  top: 0;
  right: 0;
  height: 100%;
  width: min(480px, 100%);
  background: var(--sz-card);
  box-shadow: -12px 0 40px rgba(16, 18, 28, 0.18);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.25s ease;
  will-change: transform;
}

.drawer--open .drawer__panel { transform: translateX(0); }
.drawer--left .drawer__panel { left: 0; right: auto; transform: translateX(-100%); box-shadow: 12px 0 40px rgba(16, 18, 28, 0.18); }
.drawer--left.drawer--open .drawer__panel { transform: translateX(0); }
.drawer--sm .drawer__panel { width: min(380px, 100%); }
.drawer--lg .drawer__panel { width: min(640px, 100%); }
.drawer--xl .drawer__panel { width: min(860px, 100%); }

.drawer__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid #E8EAF0;
  flex-shrink: 0;
}

.drawer__title {
  font-family: var(--sz-font-title);
  font-size: 16px;
  font-weight: 800;
  color: var(--sz-text);
  line-height: 1.25;
  margin: 0;
}

.drawer__subtitle {
  font-size: 12px;
  font-weight: 600;
  color: var(--sz-text-4);
  margin-top: 2px;
}

button.drawer__close, .drawer__close {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  border: none;
  background: #F0F2F7;
  color: #5A6172;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s;
}

button.drawer__close:hover, .drawer__close:hover { background: #E8EAF0; color: var(--sz-text); }
.drawer__close .material-symbols-outlined { font-size: 18px; }

.drawer__body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  min-height: 0;
}

.drawer__body > * + * { margin-top: 16px; }

.drawer__footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 20px;
  border-top: 1px solid #E8EAF0;
  background: var(--sz-surface);
  flex-shrink: 0;
}

.drawer__section-title {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sz-text-4);
  margin-bottom: 8px;
}

body.has-overlay-open { overflow: hidden; }

/* ---------------------------------------------------------------------
   .alert — mensagens (x-feedback.alert / x-feedback.flash-messages)
   --------------------------------------------------------------------- */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid transparent;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.45;
}

.alert .material-symbols-outlined { font-size: 20px; flex-shrink: 0; margin-top: -1px; }
.alert__body { flex: 1; min-width: 0; }
.alert__title { font-weight: 800; margin-bottom: 1px; }
.alert ul { margin: 4px 0 0 0; padding-left: 18px; list-style: disc; }
button.alert__close, .alert__close {
  background: transparent;
  border: none;
  cursor: pointer;
  color: inherit;
  opacity: 0.6;
  padding: 0;
  display: inline-flex;
  flex-shrink: 0;
}
button.alert__close:hover, .alert__close:hover { opacity: 1; }
.alert__close .material-symbols-outlined { font-size: 18px; }

.alert--success { background: #E8F8EF; border-color: #BFE9CF; color: #14532D; }
.alert--warning { background: #FFF7DE; border-color: #F3DFA0; color: #7C4A03; }
.alert--error { background: #FEF1F2; border-color: #F5C2C5; color: #991B1B; }
.alert--info { background: #EEF0FE; border-color: #C8D0F0; color: #0f2091; }
.alert--neutral { background: #F7F8FB; border-color: #E2E5EE; color: #3A4154; }

/* ---------------------------------------------------------------------
   Cards — cabeçalho/rodapé usados pelo x-layout.card
   --------------------------------------------------------------------- */
.card-nm__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.card-nm__title {
  font-family: var(--sz-font-title);
  font-size: 15px;
  font-weight: 800;
  color: var(--sz-text);
  line-height: 1.3;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-nm__title .material-symbols-outlined { font-size: 20px; color: var(--sz-primary); }
.card-nm__subtitle { font-size: 12.5px; font-weight: 500; color: var(--sz-text-4); margin-top: 2px; }
.card-nm__actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.card-nm__footer { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--sz-border-light); display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.card-nm-flush .card-nm__footer { margin-top: 0; padding: 14px 20px; }
.card-nm-flush .card-nm-head .card-nm__title { font-size: 14px; }
.card-nm--soft { background: var(--sz-surface); box-shadow: none; }
.card-nm--hover:hover { transform: translateY(-1px); }

/* ---------------------------------------------------------------------
   Formulários — utilitários adicionais
   --------------------------------------------------------------------- */
.form-grid--2 { grid-template-columns: 1fr; }
.form-grid--3 { grid-template-columns: 1fr; }
@media (min-width: 640px) {
  .form-grid--2 { grid-template-columns: repeat(2, 1fr); }
  .form-grid--3 { grid-template-columns: repeat(3, 1fr); }
}
.form-grid--start { align-items: start; }

.form-section + .form-section { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--sz-border-light); }
.form-section__title { font-size: 13px; font-weight: 800; color: var(--sz-text); margin-bottom: 12px; display: flex; align-items: center; gap: 6px; }
.form-section__title .material-symbols-outlined { font-size: 18px; color: var(--sz-text-4); }

.form-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--sz-border-light);
}

.form-footer__start { margin-right: auto; display: flex; align-items: center; gap: 8px; }

.form-hint-text, .form-hint { font-size: 12px; font-weight: 500; color: var(--sz-text-4); margin-top: 5px; line-height: 1.4; }

/* Bloco de destaque (ex.: opção do teclado do setor) */
.form-highlight {
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--sz-surface);
  border: 1px solid #E8EAF0;
}
.form-highlight__value { font-family: var(--sz-font-title); font-size: 28px; font-weight: 800; color: var(--sz-primary); line-height: 1.1; }

/* Toggle switch acessível (x-common.toggle) */
.toggle-field {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
}
.toggle-field .toggle-switch { margin-top: 1px; }
.toggle-field__label { font-size: 13.5px; font-weight: 600; color: var(--sz-text-2); line-height: 1.3; }
.toggle-field__hint { font-size: 12px; font-weight: 500; color: var(--sz-text-4); margin-top: 2px; }
.toggle-field--disabled { cursor: not-allowed; opacity: 0.65; }

/* Checkbox nativo padronizado (x-common.checkbox) */
.checkbox-field { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; }
.checkbox-field input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 1px;
  border-radius: 5px;
  border: 1.5px solid #C9CEDC;
  accent-color: var(--sz-primary);
  cursor: pointer;
  flex-shrink: 0;
}
.checkbox-field input[type="checkbox"]:checked { background-color: var(--sz-primary); border-color: var(--sz-primary); }
.checkbox-field input[type="checkbox"]:focus { box-shadow: 0 0 0 3px rgba(67, 83, 232, 0.2); border-color: var(--sz-secondary); }
.checkbox-field__label { font-size: 13.5px; font-weight: 600; color: var(--sz-text-2); }
.checkbox-field__hint { font-size: 12px; font-weight: 500; color: var(--sz-text-4); margin-top: 2px; }

/* Grupo de opções tipo "pill" (período, modo) */
.option-pills { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.option-pill { position: relative; cursor: pointer; }
.option-pill input { position: absolute; opacity: 0; width: 0; height: 0; }
.option-pill__label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid var(--sz-border);
  background: var(--sz-card);
  font-size: 13px;
  font-weight: 700;
  color: var(--sz-text-3);
  transition: all 0.15s ease;
}
.option-pill input:checked + .option-pill__label { background: var(--sz-primary-soft); border-color: var(--sz-primary); color: var(--sz-primary); }
.option-pill input:focus-visible + .option-pill__label { box-shadow: 0 0 0 3px rgba(67, 83, 232, 0.2); }

/* Cartões de opção (rádio grande com descrição) */
.option-cards { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 640px) { .option-cards { grid-template-columns: repeat(2, 1fr); } }
.option-card { position: relative; cursor: pointer; }
.option-card input { position: absolute; opacity: 0; width: 0; height: 0; }
.option-card__box {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  border-radius: 12px;
  border: 2px solid var(--sz-border);
  background: var(--sz-card);
  transition: all 0.15s ease;
  height: 100%;
}
.option-card__icon { width: 36px; height: 36px; border-radius: 10px; background: #F0F2F7; color: var(--sz-text-3); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.option-card__title { font-size: 13.5px; font-weight: 800; color: var(--sz-text); }
.option-card__text { font-size: 12px; font-weight: 500; color: var(--sz-text-4); margin-top: 2px; line-height: 1.4; }
.option-card input:checked + .option-card__box { border-color: var(--sz-primary); background: var(--sz-primary-soft); }
.option-card input:checked + .option-card__box .option-card__icon { background: var(--sz-primary); color: #fff; }
.option-card input:focus-visible + .option-card__box { box-shadow: 0 0 0 3px rgba(67, 83, 232, 0.2); }

/* ---------------------------------------------------------------------
   Detalhes (páginas show) — lista rótulo/valor
   --------------------------------------------------------------------- */
.detail-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px 24px;
}
.detail-list--1 { grid-template-columns: 1fr; }
.detail-item { min-width: 0; }
.detail-item__label {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sz-text-4);
  margin-bottom: 4px;
}
.detail-item__value { font-size: 14px; font-weight: 600; color: var(--sz-text); line-height: 1.4; word-break: break-word; }
.detail-item__value--lg { font-family: var(--sz-font-title); font-size: 26px; font-weight: 800; color: var(--sz-primary); }
.detail-item__value--mono { font-family: 'Fira Code', 'SF Mono', 'Cascadia Code', monospace; font-size: 13px; }
.detail-item__value--muted { color: var(--sz-text-3); font-weight: 500; }

.quote-box {
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--sz-surface);
  border: 1px solid #E8EAF0;
  font-size: 13.5px;
  color: var(--sz-text-2);
  line-height: 1.5;
  white-space: pre-wrap;
}

/* Lista de itens (linhas) */
.list-rows { display: flex; flex-direction: column; gap: 8px; }
.list-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--sz-surface);
  border: 1px solid var(--sz-border-light);
  transition: background 0.15s;
}
.list-row:hover { background: #F0F2F7; }
.list-row__main { flex: 1; min-width: 0; }
.list-row__title { font-size: 13.5px; font-weight: 700; color: var(--sz-text); }
.list-row__meta { font-size: 12px; font-weight: 500; color: var(--sz-text-4); margin-top: 1px; }
.list-row__end { flex-shrink: 0; text-align: right; font-size: 12px; color: var(--sz-text-4); display: flex; align-items: center; gap: 8px; }

/* ---------------------------------------------------------------------
   Barra de progresso
   --------------------------------------------------------------------- */
.progress-bar { width: 100%; height: 6px; border-radius: 99px; background: #E8EAF0; overflow: hidden; }
.progress-bar--lg { height: 8px; }
.progress-bar__fill { height: 100%; border-radius: 99px; background: var(--sz-secondary); transition: width 0.3s ease; }
.progress-bar__fill--success { background: var(--sz-success); }
.progress-bar__fill--warning { background: var(--sz-warning); }
.progress-bar__fill--error { background: var(--sz-error); }
.progress-bar__fill--primary { background: var(--sz-primary); }
.progress-inline { display: flex; align-items: center; gap: 8px; min-width: 120px; }
.progress-inline .progress-bar { flex: 1; }
.progress-inline__value { font-size: 11.5px; font-weight: 700; color: var(--sz-text-4); white-space: nowrap; }

/* ---------------------------------------------------------------------
   Avatares com iniciais e status
   --------------------------------------------------------------------- */
.avatar-initials {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--sz-secondary-soft);
  color: var(--sz-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  flex-shrink: 0;
  text-transform: uppercase;
  position: relative;
}
.avatar-initials--sm { width: 28px; height: 28px; font-size: 11px; }
.avatar-initials--lg { width: 48px; height: 48px; font-size: 17px; }
.avatar-initials--xl { width: 64px; height: 64px; font-size: 22px; }
.avatar-initials--primary { background: var(--sz-primary-soft); color: var(--sz-primary); }
.avatar-initials__status {
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid #fff;
  background: #C9CEDC;
}
.avatar-initials__status--online { background: var(--sz-success); }

.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #C9CEDC; flex-shrink: 0; }
.status-dot--online, .status-dot--success { background: var(--sz-success); }
.status-dot--warning { background: var(--sz-warning); }
.status-dot--error { background: var(--sz-error); }
.status-dot--primary { background: var(--sz-primary); }

.entity-cell { display: flex; align-items: center; gap: 10px; min-width: 0; }
.entity-cell__name { font-size: 13.5px; font-weight: 700; color: var(--sz-text); line-height: 1.25; }
.entity-cell__meta { font-size: 11.5px; font-weight: 500; color: var(--sz-text-4); margin-top: 1px; }

/* ---------------------------------------------------------------------
   Sidebar do layout (resp. < 1024px) e barra superior mobile
   --------------------------------------------------------------------- */
.siszap-sidebar {
  width: var(--sz-sidebar-w);
  height: 100%;
  background: var(--sz-card);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  border-right: 1px solid #E8EAF0;
  z-index: 50;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 18px 12px;
}

.sidebar-brand__logo {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: var(--sz-primary);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sidebar-brand__name { font-family: var(--sz-font-title); font-size: 18px; font-weight: 800; letter-spacing: -0.01em; color: var(--sz-text); line-height: 1.1; }
.sidebar-brand__sub { font-size: 10.5px; font-weight: 600; color: var(--sz-text-4); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 6px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-height: 0;
}

.sidebar-nav__section {
  padding: 12px 12px 6px;
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--sz-text-4);
}

.sidebar-nav__link {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 40px;
  padding: 0 12px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--sz-text-3);
  text-decoration: none;
  transition: all 0.15s ease;
  position: relative;
}

.sidebar-nav__link:hover { background: var(--sz-surface); color: var(--sz-text); }
.sidebar-nav__icon { width: 20px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; color: var(--sz-text-4); }
.sidebar-nav__icon .material-symbols-outlined { font-size: 19px; }
.sidebar-nav__label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-nav__badge { font-size: 10.5px; font-weight: 800; padding: 1px 7px; border-radius: 99px; background: var(--sz-secondary-soft); color: var(--sz-secondary); }

.sidebar-nav__link--active,
aside.siszap-sidebar .nav-link-active {
  background: var(--sz-primary-soft);
  color: var(--sz-primary);
  font-weight: 700;
}

.sidebar-nav__link--active .sidebar-nav__icon,
aside.siszap-sidebar .nav-link-active .nav-icon-wrap { color: var(--sz-primary); }

.sidebar-nav__link--active::before {
  content: '';
  position: absolute;
  left: -12px;
  top: 10px;
  bottom: 10px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--sz-primary);
}

.sidebar-nav__link--active .material-symbols-outlined { font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24; }

.sidebar-footer { padding: 12px; border-top: 1px solid var(--sz-border-light); }

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 12px;
  background: var(--sz-surface);
}

.sidebar-user__name { font-size: 13.5px; font-weight: 700; color: var(--sz-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user__role { font-size: 11px; font-weight: 600; color: var(--sz-text-4); }

button.sidebar-user__logout, .sidebar-user__logout {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  border: none;
  background: transparent;
  color: var(--sz-text-4);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
  flex-shrink: 0;
}
button.sidebar-user__logout:hover, .sidebar-user__logout:hover { background: #FEF1F2; color: var(--sz-error); }
.sidebar-user__logout .material-symbols-outlined { font-size: 18px; }

.sidebar-club-logo { display: flex; justify-content: center; padding-top: 10px; }
.sidebar-club-logo img { width: 64px; height: auto; opacity: 0.7; }

.app-topbar { display: none; }

button.app-topbar__toggle, .app-topbar__toggle {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  border: 1px solid #E8EAF0;
  background: var(--sz-card);
  color: var(--sz-text-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

.app-topbar__brand { display: flex; align-items: center; gap: 8px; min-width: 0; }
.app-topbar__brand .sidebar-brand__logo { width: 30px; height: 30px; border-radius: 9px; }
.app-topbar__title { font-family: var(--sz-font-title); font-size: 15px; font-weight: 800; color: var(--sz-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-topbar__page { font-size: 12px; font-weight: 600; color: var(--sz-text-4); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.sidebar-overlay {
  position: fixed;
  inset: 0;
  z-index: 79;
  background: rgba(16, 18, 28, 0.42);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

@media (max-width: 1023px) {
  .app-topbar {
    display: flex;
    align-items: center;
    gap: 12px;
    height: 56px;
    padding: 0 16px;
    background: var(--sz-card);
    border-bottom: 1px solid #E8EAF0;
    flex-shrink: 0;
  }

  .siszap-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    z-index: 80;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    width: min(var(--sz-sidebar-w), 86vw);
  }

  body.sidebar-open .siszap-sidebar {
    transform: translateX(0);
    box-shadow: 12px 0 40px rgba(16, 18, 28, 0.2);
  }

  body.sidebar-open .sidebar-overlay { opacity: 1; pointer-events: auto; }

  .page-header { position: static !important; }
  .page-header__user { display: none; }
}

/* ---------------------------------------------------------------------
   Modais utilitários (SisZapUI.confirm / x-layout.modal)
   --------------------------------------------------------------------- */
.ui-modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(16, 18, 28, 0.42);
  animation: fadeIn 0.15s ease;
}

.ui-modal[hidden] { display: none; }

.ui-modal__card {
  width: 100%;
  max-width: 440px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  background: var(--sz-card);
  border-radius: 18px;
  padding: 22px;
  box-shadow: 0 24px 64px rgba(16, 18, 28, 0.25);
  animation: pop 0.15s ease;
}

.ui-modal__card--sm { max-width: 360px; }
.ui-modal__card--md { max-width: 480px; }
.ui-modal__card--lg { max-width: 640px; }
.ui-modal__card--xl { max-width: 860px; }

.ui-modal__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.ui-modal__title { font-family: var(--sz-font-title); font-size: 17px; font-weight: 800; color: var(--sz-text); line-height: 1.25; margin: 0; }
.ui-modal__text { font-size: 13.5px; font-weight: 500; color: var(--sz-text-3); line-height: 1.5; }
.ui-modal__icon {
  width: 44px;
  height: 44px;
  border-radius: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
  background: var(--sz-secondary-soft);
  color: var(--sz-secondary);
}
.ui-modal__icon--danger { background: var(--sz-error-soft); color: var(--sz-error); }
.ui-modal__icon--warning { background: var(--sz-warning-soft); color: var(--sz-warning-text); }
.ui-modal__icon--success { background: var(--sz-success-soft); color: var(--sz-success-text); }
.ui-modal__icon .material-symbols-outlined { font-size: 24px; }
.ui-modal__actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; flex-wrap: wrap; }
.ui-modal__actions [class*="btn-nm-"] { min-width: 110px; }
.ui-modal__body > * + * { margin-top: 14px; }

/* ---------------------------------------------------------------------
   Toasts do feedback-system (window.Feedback) — reskin no DS
   --------------------------------------------------------------------- */
#feedback-toast-container { z-index: 95; pointer-events: none; }
#feedback-toast-container .toast {
  pointer-events: auto;
  border-radius: 14px;
  box-shadow: 0 12px 32px rgba(16, 18, 28, 0.16);
  font-weight: 600;
  font-size: 13.5px;
  background: #fff;
}
@media (max-width: 639px) {
  #feedback-toast-container { left: 12px; right: 12px; bottom: 12px; width: auto; }
}

/* ---------------------------------------------------------------------
   Utilidades pequenas
   --------------------------------------------------------------------- */
.text-mono { font-family: 'Fira Code', 'SF Mono', 'Cascadia Code', monospace; }
.muted { color: var(--sz-text-4); }
.pagination-wrap { display: flex; justify-content: flex-end; }
.pagination-wrap nav { font-size: 13px; }
.inline-code {
  font-family: 'Fira Code', 'SF Mono', 'Cascadia Code', monospace;
  font-size: 12px;
  padding: 1px 6px;
  border-radius: 6px;
  background: #F0F2F7;
  color: var(--sz-text-2);
}
.legend-swatch { display: inline-block; width: 12px; height: 12px; border-radius: 4px; flex-shrink: 0; }
.color-dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }

/* ---------------------------------------------------------------------
   Complementos: ícone do page-header, toggle por checkbox, seleção em massa
   --------------------------------------------------------------------- */
.page-header__icon {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: var(--sz-primary-soft);
  color: var(--sz-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.page-header__icon .material-symbols-outlined { font-size: 20px; }

/* Toggle controlado por checkbox nativo (envia change): <label class="toggle-check"><input type="checkbox"><span class="toggle-switch"></span></label> */
.toggle-check { position: relative; display: inline-flex; align-items: center; cursor: pointer; }
.toggle-check input { position: absolute; opacity: 0; width: 0; height: 0; }
.toggle-check input:checked + .toggle-switch { background: var(--sz-primary); }
.toggle-check input:checked + .toggle-switch::after { transform: translateX(16px); }
.toggle-check input:disabled + .toggle-switch { opacity: 0.4; cursor: not-allowed; }
.toggle-check input:focus-visible + .toggle-switch { box-shadow: 0 0 0 3px rgba(67, 83, 232, 0.25); }

/* Barra de ações em massa (aparece com seleção) */
.bulk-bar {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 10px 14px 10px 16px;
  border-radius: 12px;
  background: var(--sz-primary-soft);
  border: 1px solid #C8D0F0;
  color: var(--sz-primary);
  font-size: 13px;
  font-weight: 700;
}
.bulk-bar--visible { display: flex; flex-wrap: wrap; }
.bulk-bar__count { margin-right: auto; display: inline-flex; align-items: center; gap: 8px; }
.data-table td.select-cell, .data-table th.select-cell { width: 36px; padding-right: 0; }
.data-table tbody tr.is-selected { background: #F3F5FE; }

/* Preview de mensagem WhatsApp (templates) */
.wa-preview {
  background: #E5DDD5 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='60' viewBox='0 0 60 60'%3E%3Ccircle cx='10' cy='10' r='1' fill='%23d3cbc2'/%3E%3Ccircle cx='40' cy='35' r='1' fill='%23d3cbc2'/%3E%3C/svg%3E");
  border-radius: 16px;
  padding: 20px;
  min-height: 220px;
}
.wa-bubble {
  background: #fff;
  border-radius: 10px 10px 10px 2px;
  padding: 8px 10px 6px;
  max-width: 320px;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.08);
  font-size: 13.5px;
  color: #111B21;
  line-height: 1.45;
}
.wa-bubble__header { font-weight: 800; margin-bottom: 4px; }
.wa-bubble__body { white-space: pre-wrap; word-break: break-word; }
.wa-bubble__footer { font-size: 12px; color: #667781; margin-top: 4px; }
.wa-bubble__time { font-size: 11px; color: #667781; text-align: right; margin-top: 2px; }
.wa-bubble__buttons { margin-top: 6px; border-top: 1px solid #E9EDEF; }
.wa-bubble__button { text-align: center; color: #027EB5; font-weight: 600; padding: 8px 0; border-bottom: 1px solid #E9EDEF; font-size: 13px; }
.wa-bubble__button:last-child { border-bottom: none; }
.wa-empty { color: #8696A0; font-style: italic; }

/* Contador de caracteres com limite */
.char-count { font-size: 11.5px; font-weight: 700; color: var(--sz-text-4); }
.char-count.is-over { color: var(--sz-error); }

/* Chips de variáveis clicáveis */
.var-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
button.var-chip, .var-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 8px;
  border: 1px solid var(--sz-border);
  background: var(--sz-surface);
  color: var(--sz-text-2);
  font-family: 'Fira Code', 'SF Mono', 'Cascadia Code', monospace;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
button.var-chip:hover, .var-chip:hover { background: var(--sz-secondary-soft); border-color: #C8D0F0; color: var(--sz-secondary); }

/* Token mascarado */
.token-mask {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--sz-surface);
  border: 1px solid var(--sz-border);
  font-family: 'Fira Code', 'SF Mono', 'Cascadia Code', monospace;
  font-size: 12.5px;
  color: var(--sz-text-2);
  letter-spacing: 0.04em;
}

/* Botão copiar inline */
button.copy-btn, .copy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 7px;
  border: none;
  background: transparent;
  color: var(--sz-text-4);
  cursor: pointer;
  transition: all 0.15s;
  vertical-align: middle;
}
button.copy-btn:hover, .copy-btn:hover { background: #F0F2F7; color: var(--sz-primary); }
.copy-btn .material-symbols-outlined { font-size: 16px; }
.copy-btn.is-copied { color: var(--sz-success-text); }

/* Ações em cards de explicação (tokens) */
.action-card { display: flex; flex-direction: column; height: 100%; }
.action-card__icon { width: 40px; height: 40px; border-radius: 12px; background: var(--sz-secondary-soft); color: var(--sz-secondary); display: inline-flex; align-items: center; justify-content: center; margin-bottom: 12px; }
.action-card__title { font-size: 14px; font-weight: 800; color: var(--sz-text); }
.action-card__text { font-size: 12.5px; font-weight: 500; color: var(--sz-text-3); margin-top: 4px; line-height: 1.5; flex: 1; }
.action-card__footer { margin-top: 14px; }

/* Linha de timeline simples */
.timeline { display: flex; flex-direction: column; gap: 0; }
.timeline__item { display: flex; gap: 12px; position: relative; padding-bottom: 16px; }
.timeline__item:last-child { padding-bottom: 0; }
.timeline__item::before { content: ''; position: absolute; left: 9px; top: 20px; bottom: 0; width: 2px; background: var(--sz-border-light); }
.timeline__item:last-child::before { display: none; }
.timeline__dot { width: 20px; height: 20px; border-radius: 50%; background: #F0F2F7; color: var(--sz-text-4); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; z-index: 1; }
.timeline__dot .material-symbols-outlined { font-size: 13px; }
.timeline__dot--success { background: var(--sz-success-soft); color: var(--sz-success-text); }
.timeline__dot--error { background: var(--sz-error-soft); color: var(--sz-error); }
.timeline__dot--primary { background: var(--sz-primary-soft); color: var(--sz-primary); }
.timeline__title { font-size: 13px; font-weight: 700; color: var(--sz-text); }
.timeline__meta { font-size: 12px; color: var(--sz-text-4); font-weight: 500; }

/* Rótulo de arquivo (input file estilizado) */
.file-field { display: inline-flex; align-items: center; gap: 8px; }
.file-field input[type="file"] { display: none; }
.file-field__name { font-size: 12px; font-weight: 600; color: var(--sz-text-4); max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------------------------------------------------------------------
   Catálogo de componentes (/docs)
   --------------------------------------------------------------------- */
.doc-code {
  background: #14171F;
  color: #E8EAF0;
  border-radius: 12px;
  padding: 16px 18px;
  font-family: 'Fira Code', 'SF Mono', 'Cascadia Code', monospace;
  font-size: 12.5px;
  line-height: 1.6;
  overflow-x: auto;
  white-space: pre;
  tab-size: 4;
}
.doc-swatch { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 12px; border: 1px solid var(--sz-border-light); background: var(--sz-card); }
.doc-swatch__color { width: 40px; height: 40px; border-radius: 10px; flex-shrink: 0; border: 1px solid rgba(20, 23, 31, 0.08); }
.doc-swatch__name { font-size: 13px; font-weight: 700; color: var(--sz-text); }
.doc-swatch__value { font-family: 'Fira Code', 'SF Mono', monospace; font-size: 11.5px; color: var(--sz-text-4); }
.doc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.doc-card { display: flex; flex-direction: column; gap: 6px; padding: 16px; border-radius: 14px; border: 1px solid #E8EAF0; background: var(--sz-card); text-decoration: none; transition: all 0.15s; }
.doc-card:hover { border-color: #C8D0F0; box-shadow: var(--sz-shadow-card); transform: translateY(-1px); }
.doc-card__title { font-size: 14px; font-weight: 800; color: var(--sz-text); display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.doc-card__title .material-symbols-outlined { font-size: 18px; color: var(--sz-text-4); }
.doc-card__tag { font-family: 'Fira Code', 'SF Mono', monospace; font-size: 11.5px; color: var(--sz-secondary); }
.doc-card__text { font-size: 12.5px; color: var(--sz-text-3); line-height: 1.45; }
.doc-demo { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.doc-demo + .doc-demo { margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--sz-border-light); }
.doc-demo__label { width: 100%; font-size: 11px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--sz-text-4); }

/* ---------------------------------------------------------------------
   .sz-pagination — paginação padrão (Paginator::defaultView e <x-layout.pagination>)
   --------------------------------------------------------------------- */
.sz-pagination { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; width: 100%; }
.sz-pagination__summary { margin: 0; font-size: 12.5px; color: #6B7280; }
.sz-pagination__summary strong { color: #14171F; font-weight: 700; }
.sz-pagination__pages { display: flex; align-items: center; gap: 4px; list-style: none; margin: 0 0 0 auto; padding: 0; }
.sz-pagination__btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  min-width: 34px; height: 34px; padding: 0 8px;
  border-radius: 10px; border: 1px solid #E2E5EE; background: #FFFFFF;
  color: #3A4154; font-size: 13px; font-weight: 700; text-decoration: none;
  transition: background .15s, border-color .15s, color .15s;
}
.sz-pagination__btn .material-symbols-outlined { font-size: 18px; }
a.sz-pagination__btn:hover { background: #F0F2F7; border-color: #D7DBE6; color: #0f2091; }
.sz-pagination__btn.is-active { background: #0f2091; border-color: #0f2091; color: #FFFFFF; cursor: default; }
.sz-pagination__btn.is-disabled { opacity: .45; cursor: not-allowed; }
.sz-pagination__ellipsis { display: inline-flex; align-items: center; justify-content: center; min-width: 26px; height: 34px; color: #9CA3AF; font-size: 13px; }
.pagination-wrap { display: flex; }
.pagination-wrap .sz-pagination { justify-content: space-between; }
@media (max-width: 640px) {
  .sz-pagination { justify-content: center; }
  .sz-pagination__pages { margin-left: 0; }
}

/* ---------------------------------------------------------------------
   .msg-status — confirmação de envio/leitura no chat (App\Support\MessageStatus)
   ✓ enviada · ✓✓ entregue · ✓✓ azul lida · ! falhou
   --------------------------------------------------------------------- */
.msg-status { display: inline-flex; align-items: center; gap: 3px; line-height: 1; cursor: default; }
.msg-status .material-symbols-outlined { font-size: 16px; font-variation-settings: 'FILL' 0, 'wght' 500, 'GRAD' 0, 'opsz' 20; transition: color .25s ease; }
.msg-status--sent .material-symbols-outlined,
.msg-status--delivered .material-symbols-outlined { color: #8696A0; }
.msg-status--pending .material-symbols-outlined { color: #9CA3AF; font-size: 14px; }
.msg-status--read .material-symbols-outlined { color: #53BDEB; }
.msg-status--failed .material-symbols-outlined { color: #D1383E; font-size: 15px; }
.msg-status__text { font-size: 10.5px; font-weight: 700; color: #D1383E; }
.msg-status--read { animation: msg-status-read .35s ease; }
@keyframes msg-status-read { from { transform: scale(.7); } to { transform: scale(1); } }
.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; }
