/* Componentes reutilizáveis: botões, cards, badges, forms, kanban, tabela, toast, modal. */

/* === Botões === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: 0.7rem 1.25rem;
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--white-ice);
  font-weight: 600;
  font-size: var(--fs-sm);
  cursor: pointer;
  transition: transform var(--t-fast), box-shadow var(--t-fast), background var(--t-fast), color var(--t-fast);
  white-space: nowrap;
}
.btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: var(--glow-gold);
}
.btn:active:not(:disabled) { transform: translateY(0); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn--primary {
  background: linear-gradient(135deg, var(--gold-warm), var(--gold-light));
  color: var(--black-deep);
  border-color: transparent;
}
.btn--primary:hover:not(:disabled) {
  box-shadow: var(--glow-strong);
}

.btn--ghost {
  background: transparent;
  border-color: var(--border-subtle);
}

.btn--danger {
  background: rgba(208, 68, 56, 0.1);
  border-color: rgba(208, 68, 56, 0.4);
  color: var(--red-alert);
}
.btn--danger:hover:not(:disabled) { background: rgba(208, 68, 56, 0.2); }

.btn--sm { padding: 0.4rem 0.8rem; font-size: var(--fs-xs); }
.btn--lg { padding: 1rem 1.75rem; font-size: var(--fs-md); }
.btn--block { width: 100%; }
.btn--icon { padding: 0.5rem; border-radius: var(--radius-sm); }

/* === Cards === */
.card {
  background: var(--black-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--sp-5);
  box-shadow: var(--shadow-card);
  transition: border-color var(--t-base), transform var(--t-base), box-shadow var(--t-base);
}
.card--glow { border-color: var(--border-gold); box-shadow: var(--glow-gold); }
.card--hover:hover {
  border-color: var(--border-gold);
  transform: translateY(-2px);
  box-shadow: var(--glow-gold);
}
.card--flat { box-shadow: none; padding: var(--sp-4); }

.card__title {
  font-family: var(--font-display);
  font-size: var(--fs-lg);
  margin: 0 0 var(--sp-2);
}
.card__sub {
  color: var(--gray-smoke);
  font-size: var(--fs-sm);
  margin: 0 0 var(--sp-4);
}

/* === Badges === */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-pill);
  font-size: var(--fs-xs);
  font-weight: 600;
  border: 1px solid var(--border-subtle);
  background: var(--black-elevated);
  color: var(--gray-light);
}
.badge--gold { background: rgba(201, 160, 76, 0.15); color: var(--gold-light); border-color: var(--border-gold); }
.badge--green { background: rgba(63, 166, 111, 0.15); color: var(--green-success); border-color: rgba(63, 166, 111, 0.35); }
.badge--red { background: rgba(208, 68, 56, 0.15); color: var(--red-alert); border-color: rgba(208, 68, 56, 0.35); }
.badge--blue { background: rgba(68, 136, 208, 0.15); color: var(--blue-info); border-color: rgba(68, 136, 208, 0.35); }
.badge--yellow { background: rgba(212, 161, 74, 0.15); color: var(--yellow-warn); border-color: rgba(212, 161, 74, 0.35); }

/* === Forms === */
.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  margin-bottom: var(--sp-4);
}
.form-label {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--gray-light);
}
.form-label__hint {
  color: var(--gray-smoke);
  font-weight: 400;
  font-size: var(--fs-xs);
  margin-left: var(--sp-2);
}
.input, .textarea, .select {
  width: 100%;
  padding: 0.75rem 0.9rem;
  background: var(--black-soft);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--white-ice);
  font-size: var(--fs-base);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.input:focus, .textarea:focus, .select:focus {
  outline: none;
  border-color: var(--gold-warm);
  box-shadow: 0 0 0 3px rgba(201, 160, 76, 0.15);
}
.textarea { resize: vertical; min-height: 100px; font-family: inherit; }
.input--error { border-color: var(--red-alert); }

/* Wrapper de input password com botão olho */
.pwd-wrap {
  position: relative;
  display: block;
}
.pwd-wrap > .input {
  padding-right: 44px;
}
.pwd-toggle {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  background: transparent;
  border: none;
  color: var(--gray-smoke);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: color var(--t-fast), background var(--t-fast);
  padding: 0;
}
.pwd-toggle:hover {
  color: var(--gold-warm);
  background: var(--black-elevated);
}
.pwd-toggle:focus-visible {
  outline: 2px solid var(--gold-warm);
  outline-offset: 1px;
}
.form-error { color: var(--red-alert); font-size: var(--fs-xs); margin-top: var(--sp-1); }
.form-hint { color: var(--gray-smoke); font-size: var(--fs-xs); }

.checkbox-row {
  display: flex; align-items: center; gap: var(--sp-2);
  font-size: var(--fs-sm); color: var(--gray-light);
}

/* Linha de checkbox com label rica (perfil prefs) */
.check-row {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  padding: var(--sp-2) var(--sp-3);
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
}
.check-row:last-child { border-bottom: none; }
.check-row:hover { background: var(--black-elevated); }
.check-row input[type="checkbox"] {
  width: 18px; height: 18px;
  margin-top: 2px;
  flex-shrink: 0;
  accent-color: var(--gold-warm);
}
.check-row strong { color: var(--white-ice); }

/* === Tabela === */
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-sm);
}
.table th, .table td {
  text-align: left;
  padding: var(--sp-3) var(--sp-3);
  border-bottom: 1px solid var(--border-subtle);
}
.table th {
  color: var(--gray-smoke);
  font-weight: 600;
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.table tbody tr { transition: background var(--t-fast); }
.table tbody tr:hover { background: rgba(255, 255, 255, 0.02); cursor: pointer; }
.table--clickable td:last-child { text-align: right; }

.table-empty {
  padding: var(--sp-12) var(--sp-4);
  text-align: center;
  color: var(--gray-smoke);
}

/* === Kanban === */
.kanban {
  display: grid;
  gap: var(--sp-4);
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.kanban__col {
  background: var(--black-soft);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--sp-4);
  min-height: 200px;
}
.kanban__title {
  font-size: var(--fs-sm);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--gray-smoke);
  margin-bottom: var(--sp-4);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.kanban__items { display: flex; flex-direction: column; gap: var(--sp-3); }
.kanban__item {
  background: var(--black-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--sp-3);
  cursor: pointer;
  transition: border-color var(--t-fast), transform var(--t-fast);
}
.kanban__item:hover {
  border-color: var(--border-gold);
  transform: translateY(-1px);
}

/* Termo de responsabilidade (modal bloqueante) */
.termo-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-4);
  overflow-y: auto;
}
.termo-box {
  background: var(--black-card);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-lg);
  padding: var(--sp-6);
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--glow-strong);
}
.termo-header {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  color: var(--gold-warm);
  margin-bottom: var(--sp-4);
}
.termo-header h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--fs-xl);
}
.termo-intro {
  color: var(--gray-light);
  margin-bottom: var(--sp-4);
}
.termo-content {
  background: rgba(201, 160, 76, 0.06);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--sp-4);
  font-size: var(--fs-sm);
  line-height: 1.65;
  color: var(--cream-sand);
  margin-bottom: var(--sp-4);
}
.termo-content p { margin: 0 0 var(--sp-3); }
.termo-content ul { padding-left: var(--sp-5); }
.termo-content li { margin-bottom: var(--sp-1); }
.termo-check {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-2);
  padding: var(--sp-3);
  background: var(--black-soft);
  border-radius: var(--radius-md);
  margin-bottom: var(--sp-4);
  cursor: pointer;
}
.termo-check input[type="checkbox"] {
  width: 20px; height: 20px; flex-shrink: 0; margin-top: 2px;
  accent-color: var(--gold-warm);
}
.termo-foot {
  text-align: center;
  margin-top: var(--sp-3);
}

/* Autocomplete (busca de fiel em lancar-visita, vincular solicitação) */
.autocomplete-wrap {
  position: relative;
}
.autocomplete-list {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--black-card);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  max-height: 240px;
  overflow-y: auto;
  z-index: 50;
  margin-top: 4px;
}
.autocomplete-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: var(--sp-2) var(--sp-3);
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--white-ice);
  cursor: pointer;
  font-family: inherit;
  font-size: var(--fs-sm);
}
.autocomplete-item:last-child { border-bottom: none; }
.autocomplete-item:hover { background: var(--black-elevated); }

/* Mapeamento de import CSV */
.mapeamento-row {
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-2) 0;
  border-bottom: 1px solid var(--border-subtle);
}
.mapeamento-row:last-child { border-bottom: none; }
.mapeamento-label {
  flex: 1;
  font-size: var(--fs-sm);
  color: var(--gray-light);
}
.mapeamento-row select { flex: 2; }

/* Lista de anotações */
.anotacoes-lista {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  max-height: 320px;
  overflow-y: auto;
}

/* Mini counters (Tarefas / Metas / etc) */
.mini-counters {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
}
@media (max-width: 600px) {
  .mini-counters { grid-template-columns: repeat(2, 1fr); }
}
.mini-counter {
  background: var(--black-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--sp-3);
  text-align: center;
}
.mini-counter__num {
  font-family: var(--font-mono);
  font-size: var(--fs-2xl);
  font-weight: 700;
  color: var(--gold-warm);
  line-height: 1;
}
.mini-counter__num--success { color: var(--green-success); }
.mini-counter__num--danger { color: var(--red-alert); }
.mini-counter__lbl {
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gray-smoke);
  margin-top: var(--sp-1);
}

/* Lista de notas (tarefas) */
.notas-lista {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  max-height: 280px;
  overflow-y: auto;
  background: var(--black-soft);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--sp-2);
}
.nota-item {
  padding: var(--sp-2);
  background: var(--black-card);
  border-radius: var(--radius-sm);
  font-size: var(--fs-sm);
}

/* Card "atrasada" */
.kanban__item--atrasada {
  border-color: rgba(208, 68, 56, 0.4);
}
.chip--danger {
  background: rgba(208, 68, 56, 0.15);
  color: var(--red-alert);
}

/* Barra de visibilidade em lote (Itinerário) */
.bulk-vis-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  padding: var(--sp-3);
  background: var(--black-soft);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  margin-bottom: var(--sp-4);
  flex-wrap: wrap;
}
.bulk-vis-bar__label {
  font-size: var(--fs-sm);
  color: var(--gray-light);
  font-weight: 500;
}

/* Histórico accordion (Solicitações, etc) */
.hist-accordion {
  margin-top: var(--sp-6);
  background: var(--black-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.hist-accordion__summary {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-4);
  font-weight: 600;
  cursor: pointer;
  color: var(--gold-light);
  list-style: none;
}
.hist-accordion__summary::-webkit-details-marker { display: none; }
.hist-accordion__summary::after {
  content: '▾';
  margin-left: auto;
  color: var(--gray-smoke);
  transition: transform var(--t-fast);
}
.hist-accordion[open] .hist-accordion__summary::after { transform: rotate(180deg); }

/* Pílulas de status (tarefas, etc) — botões inline pra mover entre estados */
.status-pills {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--gray-smoke);
  font-size: var(--fs-xs);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--t-fast);
}
.status-pill:hover:not(:disabled):not(.status-pill--active) {
  border-color: var(--border-gold);
  color: var(--gold-light);
  background: var(--black-elevated);
}
.status-pill--active {
  background: var(--gold-warm);
  border-color: var(--gold-warm);
  color: var(--black-deep);
  cursor: default;
}
.status-pill__dot { font-size: 0.85em; line-height: 1; }

/* === Toast === */
.toast-root {
  position: fixed;
  bottom: var(--sp-4);
  right: var(--sp-4);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  z-index: var(--z-toast);
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--radius-md);
  background: var(--black-elevated);
  border: 1px solid var(--border-gold);
  box-shadow: var(--glow-gold);
  color: var(--white-ice);
  font-size: var(--fs-sm);
  max-width: 360px;
  animation: slideUp var(--t-base);
}
.toast--success { border-color: rgba(63, 166, 111, 0.5); }
.toast--error { border-color: rgba(208, 68, 56, 0.5); }
@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* === Modal === */
.modal-root {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  pointer-events: none;
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  pointer-events: auto;
  animation: fadeIn var(--t-base);
}
.modal {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  background: var(--black-card);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-lg);
  padding: var(--sp-6);
  max-width: 560px;
  width: calc(100% - 2rem);
  max-height: 85vh;
  overflow-y: auto;
  pointer-events: auto;
  box-shadow: var(--glow-strong);
  animation: slideUp var(--t-base);
}
.modal__title {
  font-family: var(--font-display);
  font-size: var(--fs-xl);
  margin: 0 0 var(--sp-4);
}
.modal__close {
  position: absolute;
  top: var(--sp-3); right: var(--sp-3);
  background: none;
  border: none;
  color: var(--gray-smoke);
  cursor: pointer;
  font-size: 1.5rem;
  padding: var(--sp-1);
  border-radius: var(--radius-sm);
  transition: color var(--t-fast);
}
.modal__close:hover { color: var(--white-ice); }
.modal__actions {
  display: flex;
  gap: var(--sp-3);
  justify-content: flex-end;
  margin-top: var(--sp-5);
}
@keyframes fadeIn {
  from { opacity: 0; } to { opacity: 1; }
}

/* === Loading / spinner === */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-subtle);
  border-top-color: var(--gold-warm);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block;
}
.spinner--lg { width: 48px; height: 48px; border-width: 3px; }

.loading-overlay {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  align-items: center;
  padding: var(--sp-12) var(--sp-4);
  color: var(--gray-smoke);
}

/* === Icon button / chip === */
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-2);
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--gray-light);
  transition: all var(--t-fast);
}
.icon-btn:hover { color: var(--gold-warm); border-color: var(--border-gold); }

.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  padding: 0.2rem 0.6rem;
  background: var(--black-elevated);
  border-radius: var(--radius-pill);
  font-size: var(--fs-xs);
  color: var(--gray-light);
}

/* Link de ação (Waze/Maps/WhatsApp inline nos cards) */
.link-acao {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  padding: 0.25rem 0.6rem;
  background: var(--black-soft);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  color: var(--gold-light);
  font-size: var(--fs-xs);
  font-weight: 500;
  text-decoration: none;
  transition: all var(--t-fast);
}
.link-acao:hover {
  border-color: var(--border-gold);
  background: var(--black-card);
  color: var(--gold-warm);
}

/* === Layout app v2 (estilo Pastor7) === */
.app-shell-v2 {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  grid-template-rows: auto 1fr;
  grid-template-areas:
    "sidebar topbar"
    "sidebar main";
  min-height: 100vh;
}

/* Topbar (compartilhada mobile/desktop) */
.topbar-v2 {
  grid-area: topbar;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--sp-6);
  background: var(--black-soft);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: var(--z-header);
}
.topbar-v2__brand {
  display: none;
  align-items: center;
  gap: var(--sp-2);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--fs-md);
  color: var(--white-ice);
}
.topbar-v2__avatar-wrap { position: relative; }

.avatar-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold-warm), var(--gold-light));
  border: none;
  color: var(--black-deep);
  font-weight: 700;
  font-size: var(--fs-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--glow-gold);
  transition: transform var(--t-fast);
}
.avatar-btn:hover { transform: scale(1.05); }

.avatar-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 240px;
  background: var(--black-card);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  z-index: calc(var(--z-header) + 10);
  animation: fadeIn var(--t-fast);
}
.avatar-menu__header {
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--border-subtle);
  background: var(--black-soft);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.avatar-menu__header strong { color: var(--white-ice); font-size: var(--fs-sm); }
.avatar-menu__header small { font-size: var(--fs-xs); }
.avatar-menu__item {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-4);
  background: transparent;
  border: none;
  color: var(--gray-light);
  font-size: var(--fs-sm);
  text-decoration: none;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  width: 100%;
  transition: background var(--t-fast), color var(--t-fast);
}
.avatar-menu__item:hover {
  background: var(--black-elevated);
  color: var(--white-ice);
}
.avatar-menu__item--danger:hover { color: var(--red-alert); }
.sidebar-v2 {
  grid-area: sidebar;
  background: var(--black-soft);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
.sidebar-v2__brand {
  padding: var(--sp-4) var(--sp-4) var(--sp-3);
  border-bottom: 1px solid var(--border-subtle);
}
.sidebar-v2__logo {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--fs-md);
  color: var(--white-ice);
}
.sidebar-v2__user {
  margin-top: var(--sp-1);
  color: var(--gold-warm);
  font-size: var(--fs-xs);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.sidebar-v2__nav {
  flex: 1;
  overflow-y: auto;
  padding: var(--sp-3);
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.sidebar-v2__footer {
  border-top: 1px solid var(--border-subtle);
  padding: var(--sp-2);
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.sidebar-footer-btn {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: 0.55rem var(--sp-3);
  background: transparent;
  border: none;
  border-radius: var(--radius-md);
  color: var(--gray-light);
  font-size: var(--fs-sm);
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: background var(--t-fast), color var(--t-fast);
}
.sidebar-footer-btn:hover {
  background: var(--black-card);
  color: var(--white-ice);
}
.sidebar-btn-sair:hover { color: var(--red-alert); }

.app-main-v2 {
  grid-area: main;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}
.app-content {
  padding: var(--sp-6);
  flex: 1;
}

/* Sub-tabs (estilo Pastor7) */
.sub-tabs-v2 {
  display: flex;
  gap: var(--sp-1);
  padding: var(--sp-3) var(--sp-6) 0;
  border-bottom: 1px solid var(--border-subtle);
  overflow-x: auto;
}
.sub-tab {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-4);
  color: var(--gray-light);
  font-size: var(--fs-sm);
  font-weight: 500;
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: all var(--t-fast);
  white-space: nowrap;
}
.sub-tab:hover { color: var(--white-ice); }
.sub-tab--active {
  color: var(--gold-warm);
  border-bottom-color: var(--gold-warm);
}

/* Bottom nav (mobile only) */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--black-soft);
  border-top: 1px solid var(--border-subtle);
  z-index: var(--z-header);
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.bottom-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 0.5rem 0.2rem;
  color: var(--gray-smoke);
  font-size: 0.65rem;
  font-weight: 500;
  text-decoration: none;
  transition: color var(--t-fast);
}
.bottom-nav-item:hover { color: var(--white-ice); }
.bottom-nav-item.active {
  color: var(--gold-warm);
}
.bottom-nav-item.active .bottom-nav-label {
  border-bottom: 2px solid var(--gold-warm);
  padding-bottom: 1px;
}
.bottom-nav-item-center {
  position: relative;
}
.bottom-nav-item-center svg {
  background: linear-gradient(135deg, var(--gold-warm), var(--gold-light));
  color: var(--black-deep) !important;
  border-radius: 50%;
  padding: 8px;
  margin-bottom: 2px;
  box-shadow: var(--glow-gold);
  width: 44px !important;
  height: 44px !important;
}
.bottom-nav-item-center.active svg {
  transform: scale(1.05);
}
.bottom-nav-label {
  white-space: nowrap;
}

/* Página Mais (mobile) */
.mais-grid {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  margin-top: var(--sp-4);
}
.mais-card {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-4);
  background: var(--black-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  color: inherit;
  text-decoration: none;
  transition: all var(--t-fast);
}
.mais-card:hover {
  border-color: var(--border-gold);
  background: var(--black-elevated);
  transform: translateY(-1px);
}
.mais-card__icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(201, 160, 76, 0.12);
  border-radius: var(--radius-md);
  color: var(--gold-warm);
  flex-shrink: 0;
}
.mais-card__label {
  font-weight: 600;
  color: var(--white-ice);
}
.mais-card__desc {
  font-size: var(--fs-xs);
  color: var(--gray-smoke);
  margin-top: 2px;
}
.mais-card > svg:last-child {
  margin-left: auto;
  color: var(--gray-dim);
  flex-shrink: 0;
}

/* Mobile: esconde sidebar, mostra bottom-nav + brand no topbar */
@media (max-width: 900px) {
  .app-shell-v2 {
    grid-template-columns: 1fr;
    grid-template-areas:
      "topbar"
      "main";
  }
  .sidebar-v2 { display: none; }
  .topbar-v2 { padding: 0 var(--sp-4); }
  .topbar-v2__brand { display: flex; }
  .bottom-nav { display: flex; }
  .app-main-v2 { padding-bottom: 75px; }
  .app-content { padding: var(--sp-4); }
  .sub-tabs-v2 { padding: var(--sp-2) var(--sp-4) 0; }
}

/* Layout app v1 legacy (mantido pra compatibilidade) */
.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}
.sidebar {
  background: var(--black-soft);
  border-right: 1px solid var(--border-subtle);
  padding: var(--sp-3);
  display: flex;
  flex-direction: column;
  gap: 1px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.sidebar__brand {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--fs-md);
  color: var(--white-ice);
  margin-bottom: var(--sp-2);
  padding: var(--sp-2);
}
.nav-link {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: 0.4rem var(--sp-3);
  border-radius: var(--radius-md);
  color: var(--gray-light);
  font-size: var(--fs-sm);
  font-weight: 500;
  cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast);
  text-decoration: none;
}
.nav-link:hover { background: var(--black-card); color: var(--white-ice); }
.nav-link--active {
  background: var(--black-card);
  color: var(--gold-warm);
  border-left: 2px solid var(--gold-warm);
}
.nav-section {
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gray-dim);
  margin: var(--sp-3) var(--sp-2) var(--sp-1);
}

.app-main {
  padding: var(--sp-6);
  overflow-x: hidden;
}
.app-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--sp-6);
  gap: var(--sp-3);
  flex-wrap: wrap;
}
.app-topbar__title {
  font-family: var(--font-display);
  font-size: var(--fs-2xl);
  margin: 0;
}

/* Botão hamburger (escondido em desktop) */
.sidebar-toggle {
  display: none;
  position: fixed;
  top: var(--sp-3);
  left: var(--sp-3);
  z-index: calc(var(--z-header) + 1);
  background: var(--black-card);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-md);
  padding: var(--sp-2);
  color: var(--gold-warm);
  cursor: pointer;
  box-shadow: var(--shadow-card);
  transition: transform var(--t-fast);
}
.sidebar-toggle:hover { transform: scale(1.05); }

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(2px);
  z-index: calc(var(--z-header) - 1);
  opacity: 0;
  transition: opacity var(--t-base);
  pointer-events: none;
}
.sidebar-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

/* Mobile: sidebar vira off-canvas */
@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    z-index: var(--z-header);
    left: -100%;
    width: 80%;
    max-width: 320px;
    transition: left var(--t-base);
  }
  .sidebar.open { left: 0; }
  .sidebar-toggle { display: inline-flex; }
  .sidebar-backdrop { display: block; }
  .app-main { padding: var(--sp-4); padding-top: var(--sp-12); }
}
