/* ==========================================================================
   Cantina Web — Colégio Monteiro Lobato
   Design System & UI Stylesheet
   Baseado estritamente em docs/DESIGN.md
   ========================================================================== */

:root {
  /* Cores Institucionais e Primárias (docs/DESIGN.md V2) */
  --primary-blue: #1d4ed8;
  --primary-blue-hover: #1e40af;
  --primary-blue-active: #172554;
  --primary-focus: #2563eb;
  --brand-light-blue: #eff6ff;
  --brand-cyan: #0284c7;

  /* Superfícies e Fundos (Anti-Monotonia: Opção 1) */
  --surface-bg: #edf2f7;
  --surface-card: #ffffff;
  --surface-header: #f8fafc;
  --surface-disabled: #f8fafc;

  /* Bordas */
  --border-default: #cbd5e1;
  --border-subtle: #e2e8f0;

  /* Tipografia com Contraste Calibrado WCAG AA */
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --text-on-primary: #ffffff;

  /* Ações e Estados Operacionais */
  --action-success: #16a34a;
  --action-success-hover: #15803d;
  --action-success-active: #166534;
  --action-success-surface: #dcfce7;
  --action-success-text: #15803d;

  --action-danger: #dc2626;
  --action-danger-hover: #b91c1c;
  --action-danger-surface: #fee2e2;
  --action-danger-text: #b91c1c;

  --action-warning: #eab308;
  --action-warning-surface: #fef9c3;
  --action-warning-text: #854d0e;

  /* Espaçamentos */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;

  /* Bordas Arredondadas */
  --radius-none: 0px;
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-full: 9999px;
}

/* Reset Geral e Tipografia Base */
body,
.bg-surface {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--surface-bg);
  color: var(--text-primary);
  font-size: 13px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}

/* Numerais Tabulares Obrigatórios para Alinhamento Vertical */
.font-tabular,
.table-data-grid td,
.money-value,
.quantity-value,
.stat-value {
  font-feature-settings: 'tnum' 1, 'zero' 1;
  font-variant-numeric: tabular-nums;
}

/* Hierarquia Tipográfica */
h1, .h1-title {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.25;
  color: var(--text-primary);
  margin-bottom: var(--space-3);
}

h2, .h2-title {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}

.text-secondary-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
}

.text-microcopy {
  font-size: 11px;
  font-weight: 400;
  color: #64748b;
}

.value-highlight {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
}

/* Barra Superior (Topbar) e Identidade */
.app-header {
  background-color: #ffffff;
  border-bottom: 1px solid var(--border-subtle);
  height: 56px;
  display: flex;
  align-items: center;
  padding: 0 var(--space-4);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.header-logo {
  height: 38px !important;
  width: 38px !important;
  max-height: 38px !important;
  max-width: 38px !important;
  border-radius: 50% !important;
  object-fit: cover !important;
  flex-shrink: 0 !important;
  margin-right: var(--space-2);
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.08), 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  display: inline-block;
}

/* Foco Acessível em Elementos Interativos (Anti-Slop Accessibility) */
:focus-visible {
  outline: 2px solid var(--primary-blue);
  outline-offset: 2px;
}

/* Foco refinado em campos de texto e formulário (sem duplo outline ou contorno agressivo) */
.form-control:focus,
.form-control:focus-visible,
.form-control-enterprise:focus,
.form-control-enterprise:focus-visible,
.form-select:focus,
.form-select:focus-visible,
input.form-control:focus-visible,
input.form-control:focus,
input[type="text"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
input[type="text"]:focus-visible,
input[type="password"]:focus-visible,
input[type="number"]:focus-visible,
input[type="email"]:focus-visible,
input[type="tel"]:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: none !important;
  border-color: var(--primary-blue) !important;
  box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.14) !important;
}

/* Espaçamento defensivo para inputs numéricos com setas (spin buttons) */
input[type="number"] {
  padding-left: 0.65rem;
  padding-right: 0.65rem;
}

input[type="number"].text-end {
  padding-right: 28px !important;
}

/* Botões do Sistema e Microinterações Táteis */
.btn,
.btn-enterprise {
  height: 34px;
  padding: 0 var(--space-3);
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.12s ease, border-color 0.12s ease, transform 0.08s ease, box-shadow 0.12s ease;
  user-select: none;
}

/* Feedback Tátil de Clique Físico (Skill: Tactile Feedback) */
.btn:active,
.btn-enterprise:active {
  transform: translateY(1px) scale(0.985);
}

.btn-sm,
.btn-enterprise.btn-sm {
  height: 30px;
  padding: 0 10px;
  font-size: 12px;
}

.btn-primary,
.btn-enterprise.btn-primary {
  background-color: var(--primary-blue);
  border: 1px solid var(--primary-blue-hover);
  color: var(--text-on-primary);
}

.btn-primary:hover,
.btn-enterprise.btn-primary:hover {
  background-color: var(--primary-blue-hover);
  border-color: var(--primary-blue-active);
  color: var(--text-on-primary);
}

.btn-outline-primary,
.btn-enterprise.btn-outline-primary {
  background-color: #ffffff;
  border: 1px solid var(--primary-blue);
  color: var(--primary-blue);
}

.btn-outline-primary:hover,
.btn-enterprise.btn-outline-primary:hover,
.btn-outline-primary:focus,
.btn-enterprise.btn-outline-primary:focus,
.btn-check:checked + .btn-outline-primary,
.btn-check:checked + .btn.btn-outline-primary,
.btn-check:active + .btn-outline-primary {
  background-color: var(--primary-blue) !important;
  border-color: var(--primary-blue-hover) !important;
  color: var(--text-on-primary) !important;
}

.btn-success,
.btn-enterprise.btn-success {
  background-color: var(--action-success);
  border: 1px solid var(--action-success-hover);
  color: var(--text-on-primary);
}

.btn-success:hover,
.btn-enterprise.btn-success:hover {
  background-color: var(--action-success-hover);
  border-color: var(--action-success-active);
  color: var(--text-on-primary);
}

.btn-danger,
.btn-enterprise.btn-danger {
  background-color: var(--action-danger);
  border: 1px solid var(--action-danger-hover);
  color: var(--text-on-primary);
}

.btn-danger:hover,
.btn-enterprise.btn-danger:hover {
  background-color: var(--action-danger-hover);
  color: var(--text-on-primary);
}

.btn-secondary,
.btn-enterprise.btn-secondary {
  background-color: #ffffff;
  color: #1e293b;
  border: 1px solid var(--border-default);
}

.btn-secondary:hover,
.btn-enterprise.btn-secondary:hover {
  background-color: var(--surface-disabled);
  border-color: #94a3b8;
  color: #0f172a;
}

.btn-icon {
  width: 28px;
  height: 28px;
  padding: 0;
  background-color: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
}

.btn-icon:hover {
  background-color: var(--surface-bg);
  color: var(--text-primary);
}

/* Faixa de Métricas e Indicadores de Alta Densidade (Stat Strip) */
.stat-strip,
.stat-strip-enterprise {
  display: flex;
  flex-wrap: wrap;
  background-color: var(--surface-card, #ffffff);
  border: 1px solid var(--border-subtle, #e2e8f0);
  border-radius: var(--radius-md, 8px);
  overflow: visible;
  margin-bottom: var(--space-4, 1.5rem);
  box-shadow: 0 1px 2px 0 rgba(15, 23, 42, 0.03);
}

.stat-strip-item,
.stat-strip .stat-item,
.stat-strip-enterprise .stat-item,
.stat-strip-enterprise .stat-strip-item {
  flex: 1 1 180px;
  min-width: 170px;
  padding: 14px 18px;
  border-right: 1px solid var(--border-subtle, #e2e8f0);
  display: flex;
  flex-direction: column;
  justify-content: center;
  background-color: #ffffff;
}

.stat-strip-item:last-child,
.stat-strip .stat-item:last-child,
.stat-strip-enterprise .stat-item:last-child,
.stat-strip-enterprise .stat-strip-item:last-child {
  border-right: none;
}

.stat-strip-label,
.stat-strip .stat-label,
.stat-strip-enterprise .stat-label,
.stat-strip-enterprise .stat-strip-label {
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.025em;
  margin-bottom: 4px;
  display: block;
}

.stat-strip-value,
.stat-strip .stat-value,
.stat-strip-enterprise .stat-value,
.stat-strip-enterprise .stat-strip-value {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary, #0f172a);
  line-height: 1.25;
  display: block;
}

.stat-strip .stat-subtext,
.stat-strip-enterprise .stat-subtext {
  font-size: 11px;
  color: #64748b;
  margin-top: 4px;
  display: block;
}

/* Bento Card Interativo e Organizado */
.bento-card {
  background-color: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.bento-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 2px 6px 0 rgba(15, 23, 42, 0.04);
}

/* Formulários Estruturados */
.form-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: var(--space-1);
  display: block;
}

.form-label .required {
  color: var(--action-danger);
}

.form-control, .form-select {
  font-size: 13px;
  color: var(--text-primary);
  background-color: #ffffff;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  padding: 4px 10px;
}

input.form-control, .form-select {
  height: 34px;
}

textarea.form-control {
  height: auto;
  min-height: 80px;
  padding: 8px 10px;
  line-height: 1.5;
}

.form-control:focus, .form-select:focus {
  border-color: var(--primary-blue) !important;
  box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.14) !important;
  outline: none !important;
}

.form-control:disabled {
  background-color: var(--surface-disabled);
  cursor: not-allowed;
  opacity: 0.8;
}

/* Input Monetário */
.input-group-money {
  display: flex;
  align-items: stretch;
}

.input-group-money .money-prefix {
  background-color: var(--surface-bg);
  border: 1px solid var(--border-default);
  border-right: none;
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
  padding: 0 8px;
  display: flex;
  align-items: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

.input-group-money .form-control {
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  text-align: right;
  font-feature-settings: 'tnum' 1, 'zero' 1;
}

/* Campo de Busca com Ícone Interno Integrado (Sem Sobreposição de Texto) */
.search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.search-input-wrapper .search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-secondary, #64748b);
  pointer-events: none;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.search-input-wrapper .form-control,
.search-input-wrapper input.form-control,
.search-input-wrapper .form-control-sm {
  padding-left: 46px !important;
  width: 100%;
}

/* Tabelas Corporativas Contemporâneas (Data Grid / Enterprise) */
.table-data-grid,
.table-enterprise {
  width: 100%;
  border-collapse: collapse;
  background-color: #ffffff;
  font-size: 13px;
}

.table-data-grid th,
.table-enterprise th {
  background-color: #f8fafc;
  color: #475569;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  height: 40px;
  padding: 10px 14px;
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-default);
  vertical-align: middle;
  white-space: nowrap;
}

.table-data-grid td,
.table-enterprise td {
  height: 40px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
  color: var(--text-primary);
}

.table-data-grid tr:hover td,
.table-enterprise tr:hover td {
  background-color: #f8fafc;
}

.table-data-grid tr.row-active td,
.table-enterprise tr.row-active td {
  background-color: #eff6ff;
}

.table-data-grid tfoot td,
.table-enterprise tfoot td {
  background-color: #f8fafc;
  font-weight: 700;
  height: 40px;
  padding: 10px 14px;
  border-top: 1px solid var(--border-default);
}

/* Alinhamento em Tabelas */
.cell-center { text-align: center; }
.cell-right { text-align: right; }
.cell-left { text-align: left; }

/* Densidade Otimizada para Telas Corporativas (1366x768 e Laptops) */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table-enterprise.table-sm th,
.table-enterprise.table-sm td,
.table-data-grid.table-sm th,
.table-data-grid.table-sm td {
  padding: 5px 8px;
  height: auto;
  line-height: 1.35;
}

.table-enterprise.table-dense th,
.table-enterprise.table-dense td {
  padding: 4px 6px;
  font-size: 11.5px;
  height: auto;
  line-height: 1.3;
}

.table-enterprise .font-tabular,
.table-enterprise .btn-action-group,
.table-enterprise .btn-group {
  white-space: nowrap;
}

/* Cards e Contêineres Corporativos (Anti-Monotonia: Opção 1 + Opção 4) */
.card-enterprise {
  background-color: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-4);
  box-shadow: 0 1px 3px 0 rgba(15, 23, 42, 0.06), 0 1px 2px -1px rgba(15, 23, 42, 0.04);
  overflow: hidden;
  transition: box-shadow 0.18s ease, border-color 0.18s ease;
}

.card-enterprise:hover {
  border-color: var(--border-default);
  box-shadow: 0 4px 6px -1px rgba(15, 23, 42, 0.07), 0 2px 4px -2px rgba(15, 23, 42, 0.04);
}

.card-enterprise-header {
  background-color: var(--surface-header);
  border-bottom: 1px solid var(--border-subtle);
  padding: 12px 18px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  letter-spacing: -0.01em;
}

.card-enterprise-body {
  padding: 18px 20px;
  background-color: var(--surface-card);
}

/* Card de Relatório Executivo (Hub de Relatórios) */
.card-report {
  background-color: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.card-report:hover {
  border-color: #cbd5e1;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.07);
}

.card-report-title {
  font-size: 16px;
  font-weight: 700 !important;
  color: #0f172a;
  margin-bottom: 8px;
  line-height: 1.35;
  letter-spacing: -0.01em;
}

/* Indicadores de Status Tipográficos Discretos (Substitui pílulas semáforo) */
.status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  color: #334155;
  white-space: nowrap;
}

.status-indicator .bullet {
  font-size: 8px;
  line-height: 1;
}

.status-indicator.status-success,
.status-indicator.status-active {
  color: #166534;
}
.status-indicator.status-success .bullet,
.status-indicator.status-active .bullet {
  color: #16a34a;
}

.status-indicator.status-danger {
  color: #991b1b;
}
.status-indicator.status-danger .bullet {
  color: #dc2626;
}

.status-indicator.status-warning,
.status-indicator.status-inactive {
  color: #854d0e;
}
.status-indicator.status-warning .bullet,
.status-indicator.status-inactive .bullet {
  color: #d97706;
}

.status-indicator.status-neutral {
  color: #475569;
}
.status-indicator.status-neutral .bullet {
  color: #94a3b8;
}

/* Tags de Código e Identificadores (Monospace Não-Quebrável) */
.code-tag {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono, monospace);
  font-size: 11px;
  font-weight: 600;
  color: #334155;
  background-color: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  padding: 2px 7px;
  line-height: 1.3;
  white-space: nowrap;
  letter-spacing: 0.02em;
  font-feature-settings: 'tnum' 1, 'zero' 1;
}

/* Tags de Alérgenos (Segurança Alimentar Corporativa) */
.tag-alergeno {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  background-color: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 600;
  color: #92400e;
  white-space: nowrap;
  letter-spacing: 0.02em;
  line-height: 1.3;
}

/* Miniatura de Produto Refinada (Anti-Slop) */
.product-thumb {
  width: 38px;
  height: 38px;
  border-radius: 6px;
  background-color: #f8fafc;
  border: 1px solid #e2e8f0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.product-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.product-thumb svg {
  width: 18px;
  height: 18px;
  color: #94a3b8;
}

/* Botões de Ação de Linha Neutros (Substitui botões vermelhos berrantes) */
.btn-action-group {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 28px;
  min-width: 28px;
  padding: 0 6px;
  font-size: 11px;
  font-weight: 500;
  color: #475569;
  background-color: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none !important;
  line-height: 1;
  white-space: nowrap;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.02);
}

.btn-action.btn-action-icon,
.btn-action:has(> svg:only-child) {
  width: 28px;
  min-width: 28px;
  padding: 0;
}

.btn-action:hover {
  background-color: #f1f5f9;
  border-color: #cbd5e1;
  color: #0f172a;
}

.btn-action:active {
  transform: translateY(1px) scale(0.98);
}

.btn-action-danger,
.btn-action-delete {
  color: #64748b;
}

.btn-action-danger:hover,
.btn-action-delete:hover {
  background-color: #fef2f2;
  border-color: #fca5a5;
  color: #dc2626;
}

/* Botão Pílula de Alternância de Status / Disponibilidade */
.btn-status-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 28px;
  padding: 0 10px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 9999px;
  border: 1px solid #e2e8f0;
  background-color: #ffffff;
  color: #334155;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  white-space: nowrap;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.02);
}

.btn-status-toggle:hover {
  background-color: #f8fafc;
  border-color: #cbd5e1;
  color: #0f172a;
}

.btn-status-toggle:active {
  transform: translateY(1px);
}

/* Badge de Contagem Discreta */
.badge-count {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  background-color: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 600;
  color: #475569;
  font-feature-settings: 'tnum' 1, 'zero' 1;
}

/* Badges e Tags de Status Suaves (Uso Restrito) */
.badge-status {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 600;
}

.badge-status.badge-success {
  background-color: #f0fdf4;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

.badge-status.badge-danger {
  background-color: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.badge-status.badge-warning {
  background-color: #fffbeb;
  color: #92400e;
  border: 1px solid #fde68a;
}

/* Alertas Alimentares */
.tag-alergeno {
  background-color: #fef3c7;
  color: #92400e;
  border: 1px solid #fcd34d;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
}

/* Empty State Padronizado */
.empty-state {
  text-align: center;
  padding: 32px var(--space-4);
  color: var(--text-muted);
}

.empty-state p {
  font-size: 13px;
  margin: 0;
}

/* Loading State */
.loading-overlay {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.spinner-blue {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(59, 130, 246, 0.2);
  border-top-color: #3b82f6;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Itens Desabilitados ou com Estoque Zerado */
.item-disabled,
.item-out-of-stock {
  opacity: 0.5;
  background-color: var(--surface-disabled);
  cursor: not-allowed !important;
  pointer-events: none;
}

/* Modais Estruturados */
.modal-content {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-default);
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.2);
}

.modal-header {
  border-bottom: 1px solid var(--border-subtle);
  padding: var(--space-3) var(--space-4);
}

.modal-footer {
  border-top: 1px solid var(--border-subtle);
  padding: var(--space-3) var(--space-4);
}

/* ==========================================================================
   ESTRUTURA DO PAINEL DA CANTINA COM SIDEBAR (docs/DESIGN.md & Fase 5)
   ========================================================================== */

.app-admin-wrapper {
  display: flex;
  min-height: 100vh;
  width: 100%;
  overflow-x: clip;
}

/* Sidebar Operacional 240px de Alta Densidade */
.app-sidebar {
  width: 240px;
  min-width: 240px;
  max-width: 240px;
  background-color: #ffffff;
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  height: 100vh;
  user-select: none;
}

.sidebar-header {
  height: 56px;
  padding: 0 12px 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  text-decoration: none;
  gap: 10px;
}

.sidebar-brand .header-logo {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
}

.sidebar-brand-text {
  display: flex;
  flex-direction: column;
}

.sidebar-brand-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.sidebar-brand-sub {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.2;
}

.btn-sidebar-collapse {
  width: 28px;
  height: 28px;
  border: 1px solid transparent;
  background: transparent;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.12s ease;
}

.btn-sidebar-collapse:hover {
  background-color: #f1f5f9;
  color: var(--text-primary);
  border-color: var(--border-subtle);
}

.btn-sidebar-close {
  background: none;
  border: none;
  padding: 4px;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: var(--radius-sm);
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 10px;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}

.sidebar-nav::-webkit-scrollbar {
  width: 5px;
}

.sidebar-nav::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Caixas Agrupadas por Categoria no Menu (Anti-Monotonia: Inset Grouped Boxes) */
.nav-section-box {
  background-color: var(--surface-bg); /* #edf2f7 */
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 4px 6px;
  margin-bottom: 12px;
  transition: all 0.15s ease;
}

.nav-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: transparent;
  border: none;
  padding: 4px 6px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  user-select: none;
  transition: background-color 0.12s ease;
  text-align: left;
}

.nav-section-header:hover {
  background-color: rgba(255, 255, 255, 0.75);
}

.nav-section-header:focus-visible {
  outline: 2px solid var(--primary-focus);
  outline-offset: 1px;
}

.nav-section-label {
  font-size: 10px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: block;
}

.nav-section-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), color 0.12s ease;
}

.nav-section-header:hover .nav-section-arrow {
  color: var(--text-primary);
}

.nav-section-box.collapsed .nav-section-arrow {
  transform: rotate(-90deg);
}

.nav-section-box.collapsed .nav-list {
  display: none;
}

.nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-item {
  margin-bottom: 2px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 8px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  font-weight: 500;
  color: #475569;
  text-decoration: none;
  transition: all 0.12s ease;
}

.nav-link:hover {
  background-color: rgba(255, 255, 255, 0.85);
  color: var(--text-primary);
}

.nav-link.active {
  background-color: #ffffff;
  color: var(--primary-blue);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08), 0 1px 2px rgba(15, 23, 42, 0.04);
  border: 1px solid rgba(203, 213, 225, 0.8);
}

.nav-bullet {
  font-size: 7px;
  line-height: 1;
  color: #94a3b8;
  transition: color 0.12s ease;
}

.nav-link:hover .nav-bullet {
  color: #64748b;
}

.nav-link.active .nav-bullet {
  color: var(--primary-blue);
}

.nav-label {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user {
  padding: 10px 14px;
  border-top: 1px solid var(--border-subtle);
  background-color: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar-user-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  margin-right: 8px;
}

.sidebar-user-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.25;
}

.sidebar-user-role {
  font-size: 11px;
  color: var(--text-muted);
}

.btn-sidebar-logout {
  width: 28px;
  height: 28px;
  border: 1px solid transparent;
  background: transparent;
  border-radius: var(--radius-sm);
  color: #64748b;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.12s ease;
}

.btn-sidebar-logout:hover {
  background-color: #fee2e2;
  color: var(--action-danger);
  border-color: #fecaca;
}

/* Área Principal do Painel */
.app-main-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background-color: var(--surface-bg);
}

.app-topbar {
  height: 54px;
  padding: 0 32px;
  background-color: #ffffff; /* Revertido para branco puro conforme solicitação */
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 1010;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}

.btn-sidebar-toggle {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 5px 8px;
  color: var(--text-secondary);
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.12s ease;
}

.btn-sidebar-toggle:hover {
  background-color: #f8fafc;
  color: var(--text-primary);
  border-color: var(--border-default);
}

.topbar-title-group {
  display: flex;
  flex-direction: column;
}

.topbar-context-tag {
  font-size: 10px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  line-height: 1;
}

.topbar-page-heading {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
}

.topbar-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background-color: #f8fafc;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 4px 10px;
  font-size: 12px;
}

.topbar-chip .chip-label {
  color: var(--text-muted);
  font-weight: 500;
}

.topbar-chip .chip-value {
  color: var(--text-primary);
  font-weight: 600;
}

.topbar-date {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  padding: 4px 10px;
  background-color: #f8fafc;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
}

.app-page-content {
  flex: 1;
  padding: 24px 32px;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.app-admin-footer {
  border-top: 1px solid var(--border-subtle);
  background-color: #ffffff;
  padding: 12px 32px;
}

/* Modo Terminal de Caixa (PDV Frente de Caixa) — Layout travado no Viewport sem Scroll de Janela */
@media (min-width: 961px) {
  .app-admin-wrapper.pdv-layout-locked {
    height: 100vh;
    max-height: 100vh;
    overflow: hidden;
  }
  .app-admin-wrapper.pdv-layout-locked .app-main-area {
    height: 100vh;
    max-height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-width: 0;
  }
  .app-admin-wrapper.pdv-layout-locked .app-topbar {
    flex-shrink: 0;
    height: 48px;
    padding: 0 16px;
  }
  .app-admin-wrapper.pdv-layout-locked .app-page-content {
    flex: 1;
    min-height: 0;
    height: calc(100vh - 48px);
    max-height: calc(100vh - 48px);
    overflow: hidden;
    padding: 8px 12px;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
  }
  .app-admin-wrapper.pdv-layout-locked .app-admin-footer {
    display: none !important;
  }
}

/* Offcanvas Sidebar Mobile */
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background-color: rgba(15, 23, 42, 0.4);
  z-index: 1030;
}

/* Suporte a overflow visível para dropdowns flutuantes (autocomplete, etc.) */
.card-enterprise.card-overflow-visible,
.card-overflow-visible,
.card-overflow-visible .card-enterprise-body {
  overflow: visible !important;
}

.autocomplete-aluno-item:hover,
.autocomplete-aluno-item.active {
  background-color: var(--surface-hover, #f8fafc) !important;
}

.autocomplete-aluno-item:last-child {
  border-bottom: none !important;
}

/* Gatilho e Overlay de Auto-Hide da Barra Lateral */
.sidebar-edge-trigger,
.sidebar-floating-overlay {
  display: none;
}

/* Colapso e Expansão Sólida da Barra Lateral no Desktop e Notebooks (>= 768px) */
@media (min-width: 768px) {
  .sidebar-backdrop {
    display: none !important;
  }

  .app-sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: 240px;
    z-index: 1020;
    transform: translateX(0);
    transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  }

  /* Ao expandir a barra lateral: a parte principal se contrai para caber tudo perfeitamente lado a lado */
  .app-main-area {
    margin-left: 240px !important;
    width: calc(100% - 240px) !important;
    max-width: calc(100% - 240px) !important;
    transition: margin-left 0.22s cubic-bezier(0.4, 0, 0.2, 1), width 0.22s cubic-bezier(0.4, 0, 0.2, 1), max-width 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  }

  /* Quando a barra lateral está expandida: esconder o botão da topbar para eliminar botão excessivo (Anexo 3) */
  .app-admin-wrapper:not(.sidebar-collapsed) .btn-sidebar-toggle {
    display: none !important;
  }

  .app-admin-wrapper:not(.sidebar-collapsed) .app-sidebar {
    transform: translateX(0) !important;
  }

  .app-admin-wrapper:not(.sidebar-collapsed) .app-main-area {
    margin-left: 240px !important;
    width: calc(100% - 240px) !important;
    max-width: calc(100% - 240px) !important;
  }

  /* Ao colapsar a barra lateral: a barra se esconde e a parte principal se estica para preencher a tela */
  .app-admin-wrapper.sidebar-collapsed .app-sidebar {
    transform: translateX(-240px);
  }

  .app-admin-wrapper.sidebar-collapsed .app-main-area {
    margin-left: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  /* Quando colapsada: botão da topbar exibe a setinha '>' para travar a barra aberta */
  .app-admin-wrapper.sidebar-collapsed .btn-sidebar-toggle {
    display: inline-flex !important;
  }

  .app-admin-wrapper.sidebar-collapsed .btn-sidebar-toggle .icon-toggle-bars {
    display: none !important;
  }

  .app-admin-wrapper.sidebar-collapsed .btn-sidebar-toggle .icon-toggle-arrow {
    display: inline-block !important;
  }

  /* Faixa de borda na extrema esquerda: ativa apenas quando a barra lateral estiver colapsada (Anexo 2) */
  .app-admin-wrapper.sidebar-collapsed .sidebar-edge-trigger {
    display: block !important;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 20px;
    z-index: 1030;
    background: transparent;
    cursor: pointer;
    transition: background-color 0.15s ease;
  }

  .app-admin-wrapper.sidebar-collapsed .sidebar-edge-trigger:hover {
    background-color: rgba(37, 99, 235, 0.08);
  }

  /* Quando a barra lateral colapsada é aberta temporariamente por hover (Peek Open) */
  .app-admin-wrapper.sidebar-collapsed.sidebar-peek-open .app-sidebar {
    transform: translateX(0) !important;
    z-index: 1020 !important;
  }

  /* CRÍTICO: No hover peek, a área principal se contrai sincronizada para JAMAIS cobrir o conteúdo */
  .app-admin-wrapper.sidebar-collapsed.sidebar-peek-open .app-main-area {
    margin-left: 240px !important;
    width: calc(100% - 240px) !important;
    max-width: calc(100% - 240px) !important;
  }

  .app-admin-wrapper.sidebar-collapsed.sidebar-peek-open .btn-sidebar-toggle {
    display: none !important;
  }
}

/* Dispositivos móveis estritos (< 768px) */
@media (max-width: 767.98px) {
  .app-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 1040;
    transform: translateX(-100%);
    transition: transform 0.2s ease-in-out;
    box-shadow: 2px 0 12px rgba(15, 23, 42, 0.15);
  }

  .app-sidebar.sidebar-open {
    transform: translateX(0);
  }

  .sidebar-backdrop.show {
    display: block;
  }

  .app-main-area {
    margin-left: 0 !important;
    width: 100% !important;
  }

  .btn-sidebar-toggle .icon-toggle-bars {
    display: inline-block !important;
  }

  .btn-sidebar-toggle .icon-toggle-arrow {
    display: none !important;
  }
}

/* ==========================================================================
   ESTRUTURA DO PORTAL DA FAMÍLIA (docs/DESIGN.md & Fase 5)
   ========================================================================== */

.portal-header {
  background-color: #ffffff;
  border-bottom: 1px solid var(--border-subtle);
  padding: 10px 0;
}

.portal-brand-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.portal-wallet-card {
  display: flex;
  align-items: center;
  background-color: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: var(--radius-md);
  padding: 5px 14px;
  text-decoration: none;
  transition: background-color 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
}

.portal-wallet-card:hover {
  background-color: #dcfce7;
  border-color: #86efac;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.portal-wallet-card.wallet-low {
  background-color: #fffbeb;
  border-color: #fde68a;
}

.portal-wallet-card.wallet-low:hover {
  background-color: #fef3c7;
  border-color: #fcd34d;
}

.wallet-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #166534;
  line-height: 1.1;
}

.portal-wallet-card.wallet-low .wallet-label {
  color: #92400e;
}

.wallet-value {
  font-size: 14px;
  font-weight: 700;
  color: #15803d;
  line-height: 1.2;
}

.portal-wallet-card.wallet-low .wallet-value {
  color: #b45309;
}

.portal-header {
  background-color: #ffffff;
  border-bottom: 1px solid var(--border-subtle);
  padding: 10px 0;
  box-shadow: 0 1px 2px 0 rgba(15, 23, 42, 0.03);
}

.portal-nav-bar {
  background-color: #ffffff;
  border-bottom: 1px solid var(--border-subtle);
}

.portal-nav-list {
  display: flex;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-x: auto;
  white-space: nowrap;
}

.portal-nav-item {
  margin: 0;
}

.portal-nav-link {
  display: inline-flex;
  align-items: center;
  height: 42px;
  padding: 0 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: color 0.12s ease, border-color 0.12s ease;
}

.portal-nav-link:hover {
  color: var(--text-primary);
}

.portal-nav-link.active {
  color: var(--primary-blue);
  font-weight: 600;
  border-bottom-color: var(--primary-blue);
}

.portal-footer {
  background-color: #ffffff;
  border-top: 1px solid var(--border-subtle);
}

/* ==========================================================================
   ESTRUTURA DE AUTENTICAÇÃO E PRIMEIRO ACESSO (auth.php)
   ========================================================================== */

.auth-wrapper {
  background-color: var(--surface-bg);
}

.auth-card-container {
  width: 100%;
  max-width: 420px;
}

.auth-logo {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.08), 0 2px 6px rgba(0, 0, 0, 0.06);
}

.auth-brand-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.015em;
}

.auth-brand-sub {
  font-size: 12px;
  color: var(--text-secondary);
}

.auth-card {
  background-color: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

/* ==========================================================================
   COMPONENTES PARCIAIS (Enterprise Partials)
   ========================================================================== */

/* Alertas com Alto Contraste WCAG AA e Saída Suave */
.alert-enterprise {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 13px;
  margin-bottom: 16px;
  border: 1px solid transparent;
  line-height: 1.45;
  transition: opacity 0.35s ease, transform 0.35s ease, max-height 0.35s ease, margin 0.35s ease, padding 0.35s ease;
  max-height: 200px;
  overflow: hidden;
  opacity: 1;
  transform: translateY(0);
}

.alert-enterprise.alert-dismissing {
  opacity: 0;
  transform: translateY(-8px);
  max-height: 0;
  margin-top: 0;
  margin-bottom: 0;
  padding-top: 0;
  padding-bottom: 0;
  border-width: 0;
}

.alert-enterprise-icon {
  flex-shrink: 0;
  margin-top: 1px;
}

.alert-enterprise-body {
  flex-grow: 1;
}

.alert-enterprise-title {
  font-weight: 600;
  margin-right: 4px;
}

.alert-enterprise-close {
  background: none;
  border: none;
  padding: 2px;
  color: inherit;
  opacity: 0.6;
  cursor: pointer;
  flex-shrink: 0;
  transition: opacity 0.12s ease;
}

.alert-enterprise-close:hover {
  opacity: 1;
}

.alert-enterprise-success {
  background-color: #f0fdf4;
  border-color: #bbf7d0;
  color: #15803d;
}

.alert-enterprise-danger {
  background-color: #fef2f2;
  border-color: #fecaca;
  color: #b91c1c;
}

.alert-enterprise-warning {
  background-color: #fffbeb;
  border-color: #fde68a;
  color: #92400e;
}

.alert-enterprise-info {
  background-color: #eff6ff;
  border-color: #bfdbfe;
  color: #1d4ed8;
}

/* Modais Corporativos */
.modal-enterprise {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-default);
  box-shadow: 0 8px 30px rgba(15, 23, 42, 0.15);
}

.modal-enterprise .modal-header {
  border-bottom: 1px solid var(--border-subtle);
  background-color: #ffffff;
  padding: 12px 18px;
}

.modal-enterprise .modal-body {
  padding: 18px;
  color: var(--text-primary);
}

.modal-enterprise .modal-footer {
  border-top: 1px solid var(--border-subtle);
  background-color: #f8fafc;
  padding: 10px 18px;
}

/* Modal de Confirmação Corporativo Unificado */
.modal-confirm-enterprise {
  z-index: 1075 !important;
}

.modal-confirm-enterprise .modal-dialog {
  max-width: 440px;
  margin: 1.75rem auto;
}

.modal-confirm-enterprise .modal-content {
  border: 1px solid #cbd5e1;
  box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.25);
  border-radius: 8px;
}

.modal-confirm-enterprise .modal-header {
  border-bottom: 1px solid #e2e8f0;
  background-color: #f8fafc;
  padding: 10px 16px;
}

.modal-confirm-enterprise .modal-body {
  padding: 16px;
  color: #334155;
  font-size: 13px;
  line-height: 1.5;
}

.modal-confirm-enterprise .modal-footer {
  border-top: 1px solid #e2e8f0;
  background-color: #f8fafc;
  padding: 10px 16px;
  gap: 8px;
}

/* Empty State Corporativo */
.empty-state-enterprise {
  text-align: center;
  padding: 40px 20px;
  background-color: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.empty-state-icon {
  margin-bottom: 12px;
}

.empty-state-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.empty-state-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 16px;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

.empty-state-action {
  margin-top: 12px;
}

/* Loading e Skeletons */
.loading-overlay-enterprise {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 36px 20px;
  gap: 12px;
}

.loading-text {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.skeleton-container {
  padding: 8px 0;
}

.skeleton-row {
  margin-bottom: 8px;
}

.skeleton-line {
  height: 18px;
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
  background-size: 200% 100%;
  border-radius: var(--radius-sm);
  animation: skeleton-shimmer 1.5s infinite;
}

@keyframes skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ==========================================================================
   Módulo de Autenticação & Primeiro Acesso (Auth UI)
   ========================================================================== */

.auth-card-container {
  width: 100%;
  max-width: 440px;
}

.auth-brand-name {
  font-size: 19px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.auth-brand-sub {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.auth-card {
  background-color: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 26px 24px;
  box-shadow: 0 4px 12px -2px rgba(15, 23, 42, 0.08), 0 2px 6px -1px rgba(15, 23, 42, 0.04);
}

.auth-header-block {
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 14px;
  margin-bottom: 18px;
}

/* Alternador de Opções de Login em Formato de Botões (Segmented Control) */
.auth-toggle-group {
  display: flex;
  background-color: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 4px;
  gap: 6px;
  margin-bottom: var(--space-4);
}

.auth-toggle-btn {
  flex: 1 1 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 38px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 500;
  color: #475569;
  background-color: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  text-decoration: none !important;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.auth-toggle-btn:hover {
  color: #0f172a;
  background-color: rgba(255, 255, 255, 0.8);
  border-color: #cbd5e1;
  text-decoration: none;
}

.auth-toggle-btn.active {
  background-color: #ffffff;
  color: #0f172a;
  font-weight: 600;
  border-color: #cbd5e1;
  box-shadow: 0 1px 3px 0 rgba(15, 23, 42, 0.08);
}

.auth-toggle-btn:focus-visible {
  outline: 2px solid var(--primary-blue);
  outline-offset: 1px;
}

/* Linha divisória com microcopy centralizado */
.auth-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 16px 0;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--border-subtle);
}

.auth-divider span {
  padding: 0 10px;
}

/* ==========================================================================
   Controles de Quantidade e Ocultação Definitiva de Spinners/Setas Nativas
   ========================================================================== */
.input-qtd::-webkit-outer-spin-button,
.input-qtd::-webkit-inner-spin-button,
input[type=number].no-spinners::-webkit-outer-spin-button,
input[type=number].no-spinners::-webkit-inner-spin-button {
  -webkit-appearance: none !important;
  margin: 0 !important;
  display: none !important;
}

.input-qtd,
input[type=number].no-spinners {
  -moz-appearance: textfield !important;
  appearance: textfield !important;
  text-align: center !important;
}

/* ==========================================================================
   Ponto de Venda (PDV) e Balcão — Enterprise POS Layout
   ========================================================================== */
.pdv-wrapper {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.pdv-grid {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 16px;
  align-items: start;
  width: 100%;
}

@media (min-width: 1440px) {
  .pdv-grid {
    grid-template-columns: 1fr 440px;
    gap: 20px;
  }
}

@media (max-width: 960px) {
  .pdv-grid {
    grid-template-columns: 1fr;
  }
}

.pdv-catalog {
  background-color: #ffffff;
  border: 1px solid var(--border-default, #e2e8f0);
  border-radius: var(--radius-md, 8px);
  padding: 14px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.pdv-catalog-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid #f1f5f9;
}

.pdv-category-nav {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
}

.pdv-cat-btn {
  appearance: none;
  -webkit-appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 6px;
  border: 1px solid var(--border-default, #cbd5e1);
  background-color: #ffffff;
  color: #334155;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
  user-select: none;
  line-height: 1.2;
}

.pdv-cat-btn:hover {
  background-color: #f8fafc;
  border-color: #94a3b8;
  color: #0f172a;
}

.pdv-cat-btn.active {
  background-color: #1d4ed8 !important;
  border-color: #1e40af !important;
  color: #ffffff !important;
  box-shadow: 0 1px 3px rgba(29, 78, 216, 0.25);
}

.pdv-products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
  gap: 12px;
  max-height: calc(100vh - 230px);
  overflow-y: auto;
  padding-right: 4px;
}

.pdv-prod-card {
  background-color: #ffffff;
  border: 1px solid var(--border-default, #e2e8f0);
  border-radius: 8px;
  padding: 10px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 165px;
  position: relative;
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
}

.pdv-prod-card:hover:not(.disabled) {
  border-color: #94a3b8;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}

.pdv-prod-card:active:not(.disabled) {
  transform: translateY(0) scale(0.99);
}

.pdv-prod-card.disabled {
  opacity: 0.45;
  cursor: not-allowed;
  background-color: #f8fafc;
  border-style: dashed;
}

.pdv-prod-card .prod-thumb-box {
  width: 100%;
  height: 75px;
  border-radius: 6px;
  background-color: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin-bottom: 8px;
  border: 1px solid #f1f5f9;
}

.pdv-prod-card .prod-thumb-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pdv-prod-title {
  font-size: 13px;
  font-weight: 600;
  color: #0f172a;
  line-height: 1.3;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  height: 34px;
}

.tag-alergeno {
  display: inline-block;
  padding: 1px 5px;
  font-size: 10px;
  font-weight: 600;
  background-color: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
  border-radius: 4px;
  margin-bottom: 4px;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pdv-prod-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid #f8fafc;
}

.pdv-prod-price {
  font-size: 14px;
  font-weight: 700;
  color: #1d4ed8;
}

.pdv-prod-stock {
  font-size: 11px;
  color: #64748b;
  font-weight: 500;
}

.pdv-cart-panel {
  background-color: #ffffff;
  border: 1px solid var(--border-default, #e2e8f0);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  height: calc(100vh - 145px);
  min-height: 580px;
  position: sticky;
  top: 70px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.pdv-cart-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-default, #e2e8f0);
  background-color: #f8fafc;
  border-radius: 8px 8px 0 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.pdv-cart-body {
  flex: 1;
  overflow-y: auto;
  padding: 10px 14px;
}

.pdv-cart-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid #f1f5f9;
  gap: 8px;
}

.pdv-cart-item-title {
  font-size: 13px;
  font-weight: 600;
  color: #0f172a;
  line-height: 1.25;
}

.pdv-cart-item-desc {
  font-size: 11px;
  color: #64748b;
}

.pdv-cart-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.pdv-qty-btn {
  width: 26px;
  height: 26px;
  border: 1px solid #cbd5e1;
  background-color: #ffffff;
  border-radius: 4px;
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #1e293b;
  user-select: none;
  transition: all 0.1s ease;
}

.pdv-qty-btn:hover {
  background-color: #f1f5f9;
  border-color: #94a3b8;
}

.pdv-qty-btn:active {
  transform: scale(0.95);
}

.pdv-cart-footer {
  border-top: 1px solid var(--border-default, #e2e8f0);
  padding: 12px 14px;
  background-color: #ffffff;
  border-radius: 0 0 8px 8px;
}

.pdv-total-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 10px;
}

.pdv-total-label {
  font-size: 12px;
  font-weight: 700;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.pdv-total-val {
  font-size: 24px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.02em;
}

.pdv-pay-methods {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 10px;
}

.pdv-pay-btn {
  border: 1px solid #cbd5e1;
  background-color: #ffffff;
  padding: 8px 4px;
  border-radius: 6px;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  font-size: 12px;
  color: #1e293b;
}

.pdv-pay-btn:hover {
  background-color: #f8fafc;
  border-color: #94a3b8;
}

.pdv-pay-btn.active {
  border-color: #1d4ed8;
  background-color: #eff6ff;
  color: #1d4ed8;
  font-weight: 700;
  box-shadow: 0 0 0 1px #1d4ed8;
}

.pdv-shortcut-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 10px;
  font-weight: 700;
  color: #475569;
  font-family: monospace;
  margin-left: 4px;
  line-height: 1.2;
}

/* Modais Customizados do PDV */
.modal-backdrop-custom {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1060;
  padding: 16px;
}

.modal-backdrop-custom.d-none {
  display: none !important;
}

.modal-card-custom {
  background-color: #ffffff;
  border-radius: 8px;
  box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.25);
  border: 1px solid #cbd5e1;
  width: 100%;
  max-width: 520px;
  overflow: hidden;
  animation: modalScaleIn 0.15s ease-out;
}

@keyframes modalScaleIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

.modal-header-custom {
  padding: 12px 16px;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: #f8fafc;
}

.modal-title-custom {
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
}

.modal-close-custom {
  background: none;
  border: none;
  color: #64748b;
  font-size: 16px;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
}

.modal-close-custom:hover {
  color: #0f172a;
}

.modal-body-custom {
  padding: 16px;
}

.modal-footer-custom {
  padding: 10px 16px;
  border-top: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  background-color: #f8fafc;
}

/* ==========================================================================
   Renderização e Container de QR Code Pix (Anti-Overflow)
   ========================================================================== */
#pix-qrcode-container,
.pix-qrcode-container {
  width: 210px !important;
  height: 210px !important;
  padding: 10px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  overflow: hidden !important;
  background-color: #ffffff !important;
  border: 1px solid var(--border-default, #e2e8f0) !important;
  border-radius: 8px !important;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06) !important;
  box-sizing: border-box !important;
  margin: 0 auto !important;
}

#pix-qrcode-container svg,
.pix-qrcode-container svg,
.pix-qrcode-svg {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  max-width: 190px !important;
  max-height: 190px !important;
  margin: 0 auto !important;
  object-fit: contain !important;
}




