/* ==========================================================================
   EPI FaceGuard - Design System & Estilos Premium
   Arquitetura: Modern Dark/Slate com Acentos em Verde Segurança e Âmbar
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;600&display=swap');

:root {
  /* Paleta Base */
  --bg-main: #090d16;
  --bg-surface: #111726;
  --bg-card: #161f33;
  --bg-card-hover: #1c2742;
  --bg-glass: rgba(22, 31, 51, 0.75);
  
  /* Bordas e Divisores */
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-accent: rgba(16, 185, 129, 0.3);
  --border-active: #10b981;

  /* Cores de Acento e Status */
  --primary: #10b981;        /* Segurança Verde Esmeralda */
  --primary-glow: rgba(16, 185, 129, 0.25);
  --primary-dark: #059669;
  
  --accent-blue: #0ea5e9;     /* Tecnologia / Biometria */
  --accent-glow: rgba(14, 165, 233, 0.25);

  --warning: #f59e0b;         /* Âmbar de Alerta EPI */
  --warning-glow: rgba(245, 158, 11, 0.25);

  --danger: #ef4444;          /* Alerta / Erro / Incompatibilidade */
  --danger-glow: rgba(239, 68, 68, 0.25);

  /* Tipografia */
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --text-main: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-white: #ffffff;

  /* Sombras e Elevações */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 20px rgba(16, 185, 129, 0.35);

  /* Transições e Bordas */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  --transition-fast: 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset Global */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(16, 185, 129, 0.05) 0%, transparent 45%),
    radial-gradient(circle at 85% 80%, rgba(14, 165, 233, 0.04) 0%, transparent 45%);
}

/* Scrollbar estilizada */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-main);
}
::-webkit-scrollbar-thumb {
  background: #1e293b;
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: #334155;
}

/* ==========================================================================
   HEADER E BARRA DE NAVEGAÇÃO
   ========================================================================== */
.app-header {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
  padding: 0.75rem 1.5rem;
}

.header-container {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  text-decoration: none;
}

.brand-icon {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, #10b981 0%, #047857 100%);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  box-shadow: 0 4px 14px var(--primary-glow);
  position: relative;
  overflow: hidden;
}

.brand-icon::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  animation: shine 3s infinite;
}

@keyframes shine {
  0% { left: -100%; }
  20% { left: 100%; }
  100% { left: 100%; }
}

.brand-title {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-white);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.brand-title span {
  color: var(--primary);
}

.brand-sub {
  display: block;
  font-size: 0.72rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.nav-tab-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.6rem 1rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: var(--transition-fast);
}

.nav-tab-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}

.nav-tab-btn.active {
  color: var(--text-white);
  background: var(--bg-card);
  box-shadow: 0 2px 8px rgba(0,0,0,0.3), inset 0 0 0 1px rgba(16, 185, 129, 0.4);
}

.nav-tab-btn.terminal-accent {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(14, 165, 233, 0.15));
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #34d399;
}

.nav-tab-btn.terminal-accent.active {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #ffffff;
  box-shadow: 0 4px 16px var(--primary-glow);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.status-pill {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.status-pill.ready {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.btn-mobile-menu {
  display: none;
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 1.2rem;
  cursor: pointer;
}

/* ==========================================================================
   CONTEÚDO PRINCIPAL & VIEWS
   ========================================================================== */
.main-container {
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  padding: 1.75rem 1.5rem;
  flex: 1;
}

.app-view {
  display: none;
  animation: fadeIn 0.25s ease-out;
}

.app-view.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Cabeçalho das Páginas */
.view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.75rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.view-header h2 {
  font-size: 1.65rem;
  font-weight: 800;
  color: var(--text-white);
  letter-spacing: -0.02em;
}

.view-header p {
  color: var(--text-secondary);
  font-size: 0.92rem;
  margin-top: 0.2rem;
}

.view-header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* ==========================================================================
   SISTEMA DE BOTÕES
   ========================================================================== */
.btn {
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.65rem 1.2rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: var(--transition-fast);
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  box-shadow: 0 4px 14px var(--primary-glow);
}
.btn-primary:hover {
  background: linear-gradient(135deg, #34d399 0%, #047857 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px var(--primary-glow);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-main);
  border-color: var(--border-subtle);
}
.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-outline {
  background: transparent;
  color: var(--text-main);
  border-color: var(--border-subtle);
}
.btn-outline:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.25);
}

.btn-danger-soft {
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.25);
}
.btn-danger-soft:hover {
  background: rgba(239, 68, 68, 0.22);
  color: #ef4444;
}

.btn-sm {
  padding: 0.45rem 0.85rem;
  font-size: 0.82rem;
  border-radius: 6px;
}

.btn-xs {
  padding: 0.3rem 0.65rem;
  font-size: 0.75rem;
  border-radius: 4px;
}

.btn-lg {
  padding: 0.85rem 1.75rem;
  font-size: 1.05rem;
  border-radius: var(--radius-md);
}

/* ==========================================================================
   CARDS & CONTAINERS
   ========================================================================== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition-fast);
}

.card:hover {
  border-color: rgba(255, 255, 255, 0.15);
}

/* ==========================================================================
   DASHBOARD ESTILOS
   ========================================================================== */
.dashboard-metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.metric-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.35rem;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.metric-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--primary);
}

.metric-card.card-warning::before {
  background: var(--warning);
}

.metric-card.card-accent::before {
  background: var(--accent-blue);
}

.metric-info h3 {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.metric-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-white);
  margin: 0.35rem 0 0.2rem 0;
  line-height: 1;
}

.metric-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

.metric-icon-box {
  width: 46px;
  height: 46px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}

.dashboard-sections-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 1.5rem;
}

@media (max-width: 992px) {
  .dashboard-sections-grid {
    grid-template-columns: 1fr;
  }
}

.dash-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.35rem;
}

.dash-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.2rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-subtle);
}

.dash-panel-header h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-white);
}

.dash-delivery-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.dash-delivery-row:last-child {
  border-bottom: none;
}

.dash-delivery-colab {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.avatar-xs {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
}

.dash-delivery-colab strong {
  display: block;
  font-size: 0.9rem;
  color: var(--text-white);
}

.dash-delivery-colab small {
  color: var(--text-secondary);
  font-size: 0.78rem;
}

.dash-delivery-time {
  text-align: right;
}

.bio-match-tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  color: #34d399;
  background: rgba(16, 185, 129, 0.12);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
}

.dash-critical-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

/* ==========================================================================
   TERMINAL DE RETIRADA COM RECONHECIMENTO FACIAL (CORAÇÃO DO SISTEMA)
   ========================================================================== */
.terminal-layout {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 1.5rem;
  align-items: stretch;
}

@media (max-width: 1024px) {
  .terminal-layout {
    grid-template-columns: 1fr;
  }
}

.terminal-panel-left {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.terminal-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem;
}

.terminal-step-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.9rem;
}

.terminal-step-title h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-white);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.step-badge {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-full);
}

.step-waiting {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
}

.step-ready {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

/* Busca e lista de seleção de colaboradores no terminal */
.search-box-input {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
}
.search-box-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.terminal-scroll-list {
  max-height: 220px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding-right: 0.25rem;
}

.terminal-func-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.85rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition-fast);
}

.terminal-func-item:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.2);
}

.terminal-func-item.selected {
  background: rgba(16, 185, 129, 0.12);
  border-color: var(--primary);
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.2);
}

.terminal-func-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  overflow: hidden;
  background: #1e293b;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--text-secondary);
}

.terminal-func-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.terminal-func-data {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.terminal-func-data strong {
  font-size: 0.9rem;
  color: var(--text-white);
}

.terminal-func-data small {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.tag-aviso-bio {
  font-size: 0.68rem;
  color: #fbbf24;
  margin-top: 0.15rem;
}

.terminal-func-check {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--primary);
  min-width: 20px;
  text-align: right;
}

/* Seleção de EPIs com picker de quantidade */
.terminal-epi-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0.85rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  margin-bottom: 0.45rem;
}

.terminal-epi-row.selected {
  border-color: rgba(14, 165, 233, 0.5);
  background: rgba(14, 165, 233, 0.08);
}

.terminal-epi-row.disabled {
  opacity: 0.45;
  pointer-events: none;
}

.terminal-epi-info .epi-title {
  display: block;
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--text-white);
}

.terminal-epi-info .epi-sub {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.2rem;
}

.ca-tag {
  background: rgba(255, 255, 255, 0.08);
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  font-family: var(--font-mono);
  color: var(--text-secondary);
}

.stock-tag {
  font-size: 0.7rem;
  color: var(--text-muted);
}
.stock-tag.low {
  color: #f59e0b;
  font-weight: 600;
}

.terminal-epi-qty-picker {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.btn-qty {
  width: 28px;
  height: 28px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-white);
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
}
.btn-qty:hover:not(:disabled) {
  background: var(--primary);
  border-color: var(--primary);
}
.btn-qty:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.qty-display {
  font-size: 0.95rem;
  font-weight: 700;
  min-width: 24px;
  text-align: center;
  color: var(--text-white);
}

/* Painel Direito: CÂMERA & SCANNER FACIAL BIOMÉTRICO */
.terminal-panel-right {
  display: flex;
  flex-direction: column;
}

.scanner-container-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative;
  overflow: hidden;
}

.scanner-viewfinder-box {
  width: 100%;
  aspect-ratio: 16/10;
  max-height: 360px;
  background: #020617;
  border-radius: var(--radius-md);
  border: 2px dashed rgba(255, 255, 255, 0.15);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}

.camera-active .scanner-viewfinder-box {
  border-style: solid;
  border-color: rgba(16, 185, 129, 0.5);
  box-shadow: 0 0 30px rgba(16, 185, 129, 0.15);
}

#terminal-video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #020617;
  transform: scaleX(-1); /* espelha para sensação natural de espelho */
}

#terminal-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transform: scaleX(-1);
  pointer-events: none;
}

/* Container de Câmera no Modal de Cadastro */
.camera-live-enrollment-container {
  margin: 0.75rem 0;
  padding: 0.75rem;
  background: rgba(2, 6, 23, 0.6);
  border-radius: var(--radius-md);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.camera-live-frame-wrapper {
  position: relative;
  width: 100%;
  max-width: 460px;
  aspect-ratio: 16/9;
  max-height: 250px;
  margin: 0 auto;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #020617;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
}

#video-func-camera {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #020617;
  transform: scaleX(-1);
}

.camera-live-guide-oval {
  position: absolute;
  width: 140px;
  height: 170px;
  border: 2px dashed rgba(16, 185, 129, 0.75);
  border-radius: 50% / 45%;
  pointer-events: none;
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.2);
}

.camera-live-actions-bar {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  margin-top: 0.85rem;
  flex-wrap: wrap;
}

/* Mira e Retículo de Enquadramento Facial */
.terminal-reticle {
  position: absolute;
  width: 220px;
  height: 260px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-radius: 50% / 40%;
  pointer-events: none;
  transition: all 0.25s ease;
  box-shadow: 0 0 0 9999px rgba(2, 6, 23, 0.45);
}

.terminal-reticle::after {
  content: '';
  position: absolute;
  top: -5%;
  left: 0;
  width: 100%;
  height: 2px;
  background: #38bdf8;
  box-shadow: 0 0 10px #38bdf8;
  animation: scanSweep 2.2s infinite ease-in-out;
  opacity: 0.8;
}

@keyframes scanSweep {
  0% { top: 0%; }
  50% { top: 100%; }
  100% { top: 0%; }
}

.terminal-reticle.state-searching {
  border-color: #38bdf8;
  box-shadow: 0 0 0 9999px rgba(2, 6, 23, 0.45), 0 0 20px rgba(56, 189, 248, 0.4);
}

.terminal-reticle.state-matched {
  border-color: #10b981;
  border-width: 3px;
  box-shadow: 0 0 0 9999px rgba(2, 6, 23, 0.45), 0 0 35px rgba(16, 185, 129, 0.8);
  animation: pulseGreen 0.6s infinite alternate;
}

@keyframes pulseGreen {
  from { transform: scale(1); }
  to { transform: scale(1.03); }
}

.terminal-reticle.state-mismatch {
  border-color: #ef4444;
  border-width: 3px;
  box-shadow: 0 0 0 9999px rgba(2, 6, 23, 0.45), 0 0 30px rgba(239, 68, 68, 0.7);
}

/* HUD Superior e Inferior do Scanner */
.scanner-hud-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.hud-status-badge {
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.35rem 0.8rem;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
}

.hud-status-badge.status-loading {
  background: rgba(14, 165, 233, 0.15);
  color: #38bdf8;
}

.hud-status-badge.status-scanning {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
}

.hud-status-badge.status-success {
  background: rgba(16, 185, 129, 0.25);
  color: #34d399;
  box-shadow: 0 0 12px var(--primary-glow);
}

.hud-status-badge.status-mismatch {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
}

.hud-status-badge.status-error {
  background: rgba(239, 68, 68, 0.25);
  color: #ef4444;
}

/* Barra de similaridade facial */
.match-meter-container {
  margin: 0.75rem 0 1.25rem 0;
}

.match-meter-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-secondary);
  font-weight: 600;
  margin-bottom: 0.3rem;
}

.match-meter-label strong {
  color: var(--text-white);
  font-family: var(--font-mono);
}

.match-bar-bg {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.match-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #f59e0b 0%, #10b981 100%);
  border-radius: var(--radius-full);
  transition: width 0.2s ease;
}

/* Alternador de Modo de Reconhecimento */
.terminal-mode-toggle {
  display: flex;
  gap: 0.35rem;
  background: rgba(255, 255, 255, 0.05);
  padding: 0.25rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

/* Card do Colaborador Identificado Automaticamente por Rosto */
.terminal-colab-identificado-box {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.85rem;
  margin-bottom: 0.85rem;
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s ease;
}

.colab-reconhecido-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: 100%;
  animation: fadeIn 0.3s ease-out;
}

.colab-reconhecido-foto-box {
  position: relative;
  width: 65px;
  height: 65px;
  flex-shrink: 0;
}

.avatar-reconhecido {
  width: 100%;
  height: 100%;
  border-radius: var(--radius-sm);
  object-fit: cover;
  border: 2px solid var(--primary);
  box-shadow: 0 0 14px var(--primary-glow);
}

.badge-match-tag {
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  background: #059669;
  color: #ffffff;
  font-size: 0.62rem;
  font-weight: 700;
  padding: 0.1rem 0.4rem;
  border-radius: var(--radius-full);
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(0,0,0,0.5);
}

.colab-reconhecido-info h4 {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-white);
  line-height: 1.2;
}

.colab-reconhecido-info p {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin: 0.2rem 0;
}

.colab-reconhecido-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  gap: 0.75rem;
}

/* Resumo da entrega em andamento */
.terminal-summary-box {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.85rem;
  margin-bottom: 1rem;
}

.resumo-colab-box {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.avatar-sm {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--primary);
}

.avatar-placeholder {
  background: #1e293b;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--text-secondary);
}

.resumo-itens-lista {
  list-style: none;
  font-size: 0.85rem;
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border-subtle);
}

.resumo-itens-lista li {
  padding: 0.2rem 0;
  color: var(--text-white);
}

.pulse-glow {
  animation: pulseGlow 1.5s infinite alternate;
}

@keyframes pulseGlow {
  from {
    box-shadow: 0 0 10px var(--primary-glow);
  }
  to {
    box-shadow: 0 0 25px rgba(16, 185, 129, 0.6);
  }
}

.terminal-scanner-controls {
  display: flex;
  gap: 0.5rem;
  width: 100%;
}

.terminal-scanner-controls .btn {
  flex: 1;
}

/* ==========================================================================
   GRIDS DE ITENS (COLABORADORES & EPIS)
   ========================================================================== */
.content-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
}

.employee-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.employee-card-header {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
}

.employee-avatar {
  width: 60px;
  height: 60px;
  border-radius: var(--radius-md);
  position: relative;
  overflow: visible;
  flex-shrink: 0;
}

.employee-avatar img {
  width: 100%;
  height: 100%;
  border-radius: var(--radius-md);
  object-fit: cover;
  border: 1px solid var(--border-subtle);
}

.employee-avatar .avatar-placeholder {
  width: 100%;
  height: 100%;
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  font-size: 1.4rem;
}

.biometric-badge {
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-full);
  white-space: nowrap;
}

.badge-active {
  background: #047857;
  color: #ecfdf5;
  box-shadow: 0 2px 6px rgba(0,0,0,0.4);
}

.badge-pending {
  background: #78350f;
  color: #fef3c7;
}

.employee-info h4 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-white);
  line-height: 1.2;
}

.employee-role {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin: 0.25rem 0 0.4rem 0;
}

.employee-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.employee-card-body {
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding: 0.75rem 0;
  margin-bottom: 0.85rem;
}

.employee-contact {
  font-size: 0.8rem;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.employee-stats {
  margin-top: 0.6rem;
}

.stat-pill {
  font-size: 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  color: var(--text-secondary);
}

.employee-card-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.employee-card-actions .btn {
  flex: 1;
}

/* Cards de EPI */
.epi-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.epi-category-pill {
  font-size: 0.72rem;
  font-weight: 600;
  color: #38bdf8;
  background: rgba(14, 165, 233, 0.12);
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
}

.stock-status-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-full);
}

.badge-stock-ok {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
}

.badge-stock-low {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
}

.badge-stock-empty {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
}

.epi-card-content h4 {
  font-size: 1.05rem;
  color: var(--text-white);
  font-weight: 700;
  line-height: 1.3;
}

.epi-ca-container {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.4rem 0 0.5rem 0;
}

.epi-ca-container .label {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.ca-number {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  color: #34d399;
  background: rgba(16, 185, 129, 0.1);
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
}

.epi-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 0.85rem;
}

.epi-stock-meter {
  background: rgba(255, 255, 255, 0.03);
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  margin-bottom: 0.9rem;
}

.stock-info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.82rem;
  margin-bottom: 0.35rem;
}

.meter-bar {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.meter-fill {
  height: 100%;
  border-radius: var(--radius-full);
}

.meter-fill.badge-stock-ok { background: #10b981; }
.meter-fill.badge-stock-low { background: #f59e0b; }
.meter-fill.badge-stock-empty { background: #ef4444; }

.epi-card-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ==========================================================================
   TABELA DE HISTÓRICO
   ========================================================================== */
.table-container {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow-x: auto;
  box-shadow: var(--shadow-sm);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.88rem;
}

.data-table th {
  background: var(--bg-card);
  padding: 0.85rem 1rem;
  font-weight: 700;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.data-table td {
  padding: 0.9rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--text-main);
  vertical-align: middle;
}

.data-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.colab-table-cell {
  display: flex;
  flex-direction: column;
}

.colab-table-cell strong {
  color: var(--text-white);
}

.colab-table-cell small {
  color: var(--text-muted);
}

.itens-cell-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.epi-item-badge {
  background: rgba(255, 255, 255, 0.06);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.78rem;
  color: var(--text-white);
}

.historico-thumb-img {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  cursor: pointer;
  border: 1px solid var(--primary);
  transition: transform 0.15s ease;
}
.historico-thumb-img:hover {
  transform: scale(1.15);
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}

.status-pill-ok {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  color: #34d399;
  background: rgba(16, 185, 129, 0.12);
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-full);
}

/* ==========================================================================
   MODAIS E OVERLAYS
   ========================================================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(2, 6, 23, 0.85);
  backdrop-filter: blur(8px);
  z-index: 999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-overlay.modal-open {
  display: flex;
  animation: modalFade 0.2s ease-out;
}

@keyframes modalFade {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-container {
  background: var(--bg-surface);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-lg);
  max-width: 650px;
  width: 100%;
  max-height: 92vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  position: relative;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  background: var(--bg-surface);
  z-index: 10;
}

.modal-header h3 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-white);
}

.btn-close-modal {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 1.4rem;
  cursor: pointer;
  padding: 0.25rem;
  line-height: 1;
}
.btn-close-modal:hover {
  color: var(--text-white);
}

.modal-body {
  padding: 1.5rem;
}

/* Formulários */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

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

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-group.col-span-2 {
  grid-column: span 2;
}

.form-group label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-control {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  padding: 0.65rem 0.85rem;
  font-size: 0.9rem;
  font-family: var(--font-sans);
}
.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

/* Seção de Captura de Foto e Biometria no Modal */
.face-enrollment-box {
  background: var(--bg-card);
  border: 1px dashed rgba(255, 255, 255, 0.18);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  text-align: center;
  margin-top: 0.5rem;
}

.biometrics-status-box {
  font-size: 0.82rem;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  margin-top: 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
}

.biometrics-status-box.status-success {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.biometrics-status-box.status-warning {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.biometrics-status-box.status-info {
  background: rgba(14, 165, 233, 0.15);
  color: #38bdf8;
}

.modal-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-subtle);
  margin-top: 1.25rem;
}

/* ==========================================================================
   RECIBO DE SUCESSO & FICHA DIGITAL DE EPI (NR-6)
   ========================================================================== */
.recibo-card {
  padding: 1.75rem;
  text-align: center;
}

.recibo-badge-success {
  margin-bottom: 1.5rem;
}

.recibo-badge-success .icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 800;
  margin: 0 auto 0.75rem auto;
  box-shadow: 0 0 25px var(--primary-glow);
}

.recibo-badge-success h3 {
  font-size: 1.4rem;
  color: var(--text-white);
  font-weight: 800;
}

.recibo-badge-success p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.recibo-grid {
  display: grid;
  grid-template-columns: 1fr 180px;
  gap: 1.25rem;
  text-align: left;
  background: var(--bg-card);
  padding: 1.25rem;
  border-radius: var(--radius-md);
  margin-bottom: 1.25rem;
  border: 1px solid var(--border-subtle);
}

.recibo-colab {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.recibo-colab strong {
  font-size: 1.15rem;
  color: var(--text-white);
}

.recibo-colab span {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.recibo-time {
  margin-top: 0.4rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.recibo-foto-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.recibo-foto-box img {
  width: 120px;
  height: 120px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  border: 2px solid var(--primary);
  box-shadow: 0 4px 14px rgba(0,0,0,0.5);
}

.bio-tag {
  font-size: 0.7rem;
  font-weight: 700;
  color: #34d399;
  margin-top: 0.4rem;
}

.recibo-itens-tabela-box {
  text-align: left;
  margin-bottom: 1.25rem;
}

.recibo-itens-tabela-box h4 {
  font-size: 0.95rem;
  color: var(--text-white);
  margin-bottom: 0.5rem;
}

.recibo-tabela {
  width: 100%;
  border-collapse: collapse;
}

.recibo-tabela th {
  background: var(--bg-surface);
  padding: 0.5rem 0.75rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-subtle);
}

.recibo-tabela td {
  padding: 0.6rem 0.75rem;
  font-size: 0.85rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--text-main);
}

.recibo-obs {
  background: rgba(255, 255, 255, 0.03);
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  text-align: left;
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 1.25rem;
}

.recibo-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
}

/* ==========================================================================
   ESTILOS DE IMPRESSÃO - FICHA DE EPI OFICIAL NR-6
   ========================================================================== */
.ficha-epi-document {
  background: #ffffff;
  color: #0f172a;
  padding: 2.5rem;
  border-radius: var(--radius-md);
  font-family: Arial, Helvetica, sans-serif;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.ficha-header {
  text-align: center;
  border-bottom: 2px solid #0f172a;
  padding-bottom: 1rem;
  margin-bottom: 1.5rem;
}

.ficha-header-empresa h2 {
  font-size: 1.3rem;
  color: #0f172a;
  font-weight: 800;
}

.ficha-header-empresa p {
  font-size: 0.85rem;
  color: #475569;
}

.ficha-header-empresa h3 {
  font-size: 1.05rem;
  margin: 0.6rem 0 0.3rem 0;
  color: #1e293b;
}

.nr6-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  background: #e2e8f0;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
}

.ficha-dados-colaborador {
  display: grid;
  grid-template-columns: 1fr 1fr 120px;
  gap: 1.25rem;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 1rem;
  margin-bottom: 1.25rem;
}

.ficha-col p {
  font-size: 0.85rem;
  margin-bottom: 0.35rem;
  color: #334155;
}

.ficha-col-foto {
  text-align: center;
}

.ficha-foto-cadastrada {
  width: 90px;
  height: 90px;
  object-fit: cover;
  border: 1px solid #94a3b8;
  border-radius: 4px;
}

.ficha-foto-vazia {
  width: 90px;
  height: 90px;
  background: #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: #64748b;
  border: 1px solid #cbd5e1;
}

.ficha-declaracao {
  font-size: 0.82rem;
  color: #334155;
  line-height: 1.45;
  text-align: justify;
  background: #f1f5f9;
  padding: 0.85rem;
  border-radius: 6px;
  margin-bottom: 1.5rem;
  border-left: 3px solid #0284c7;
}

.ficha-tabela-itens {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 2rem;
}

.ficha-tabela-itens th {
  background: #e2e8f0;
  border: 1px solid #cbd5e1;
  padding: 0.6rem 0.5rem;
  font-size: 0.78rem;
  color: #1e293b;
  text-align: left;
}

.ficha-tabela-itens td {
  border: 1px solid #cbd5e1;
  padding: 0.5rem;
  font-size: 0.8rem;
  color: #334155;
  vertical-align: middle;
}

.ficha-snapshot-img {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid #059669;
}

.badge-bio-ok {
  color: #047857;
  font-weight: 700;
  font-size: 0.75rem;
}

.ficha-rodape {
  margin-top: 2.5rem;
  text-align: center;
}

.ficha-assinatura-box {
  display: inline-block;
  border-top: 1px solid #0f172a;
  padding-top: 0.5rem;
  min-width: 320px;
}

.ficha-assinatura-box p {
  font-size: 0.85rem;
  font-weight: 700;
  color: #0f172a;
}

.ficha-assinatura-box small {
  color: #64748b;
  font-size: 0.75rem;
}

/* ==========================================================================
   ESTILOS DE IMPRESSÃO - SUPORTE A BOBINA TÉRMICA 80MM E FICHA A4
   ========================================================================== */

/* Layout do Cupom Térmico 80mm na Tela e Impressão */
#cupom-termico-print-area {
  display: none;
}

.termico-wrapper {
  width: 72mm;
  max-width: 80mm;
  margin: 0 auto;
  padding: 3mm 2mm;
  background: #ffffff;
  color: #000000;
  font-family: 'Courier New', Courier, monospace;
  font-size: 11px;
  line-height: 1.25;
}

.termico-center {
  text-align: center;
}

.termico-bold {
  font-weight: bold;
}

.termico-small {
  font-size: 9.5px;
}

.termico-divider {
  text-align: center;
  overflow: hidden;
  white-space: nowrap;
  letter-spacing: -1px;
  margin: 3px 0;
  font-size: 10px;
}

.termico-tabela {
  width: 100%;
  border-collapse: collapse;
  margin: 4px 0;
  font-size: 10.5px;
}

.termico-tabela th, .termico-tabela td {
  padding: 2px 0;
  border-bottom: 1px dashed #000000;
}

.termico-tabela th {
  border-bottom: 1px solid #000000;
}

.termico-foto-center {
  text-align: center;
  margin: 4px 0;
}

.termico-img {
  width: 45mm;
  height: 35mm;
  object-fit: cover;
  filter: grayscale(100%) contrast(140%);
  border: 1px solid #000000;
}

.termico-legal {
  font-size: 8.5px;
  text-align: justify;
  margin: 4px 0;
  line-height: 1.15;
}

.termico-feed-space {
  height: 12mm; /* Espaço para guilhotina/corte da impressora térmica */
}

/* Modo de Impressão */
@media print {
  body * {
    visibility: hidden;
  }

  /* 1. SE IMPRIMINDO CUPOM TÉRMICO 80MM */
  body.printing-thermal-80mm {
    background: #ffffff !important;
    color: #000000 !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  body.printing-thermal-80mm #cupom-termico-print-area,
  body.printing-thermal-80mm #cupom-termico-print-area * {
    visibility: visible !important;
  }

  body.printing-thermal-80mm #cupom-termico-print-area {
    display: block !important;
    position: absolute !important;
    left: 0 !important;
    top: 0 !important;
    width: 76mm !important;
    max-width: 80mm !important;
    margin: 0 !important;
    padding: 1mm 2mm !important;
  }

  /* 2. SE IMPRIMINDO FICHA FORMAL A4 */
  body:not(.printing-thermal-80mm) #ficha-print-area,
  body:not(.printing-thermal-80mm) #ficha-print-area * {
    visibility: visible;
  }

  body:not(.printing-thermal-80mm) #ficha-print-area {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    margin: 0;
    padding: 0;
    box-shadow: none;
  }

  .modal-header, .modal-actions, .app-header {
    display: none !important;
  }

  /* REGRA EXPRESSA DO USUÁRIO: NA IMPRESSÃO DO RECIBO NUNCA SAI A FOTO */
  img, 
  .ficha-col-foto, 
  .ficha-snapshot-img, 
  .recibo-foto-box, 
  .termico-img, 
  .avatar-xs, 
  .avatar-sm,
  .historico-thumb-img,
  th.ficha-th-foto,
  td.ficha-td-foto {
    display: none !important;
    visibility: hidden !important;
  }
}

@page {
  margin: 0;
}

/* ==========================================================================
   ESTILOS DE AUTENTICAÇÃO, MULTI-EMPRESAS & SUPERADMIN
   ========================================================================== */
.login-overlay {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at top right, rgba(14, 165, 233, 0.15), transparent 60%),
              radial-gradient(circle at bottom left, rgba(2, 132, 199, 0.12), transparent 50%),
              #090d16;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.login-card {
  width: 100%;
  max-width: 440px;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(14, 165, 233, 0.35);
  border-radius: 16px;
  padding: 2.5rem 2rem;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.6), 0 0 35px rgba(14, 165, 233, 0.15);
  backdrop-filter: blur(16px);
  text-align: center;
}

.login-brand-icon {
  font-size: 3rem;
  margin-bottom: 0.5rem;
  display: inline-block;
  filter: drop-shadow(0 4px 10px rgba(14, 165, 233, 0.4));
}

.login-title {
  font-size: 1.6rem;
  font-weight: 800;
  color: #ffffff;
  margin: 0 0 0.25rem 0;
  letter-spacing: -0.5px;
}

.login-title span {
  color: var(--primary);
}

.login-subtitle {
  font-size: 0.85rem;
  color: #94a3b8;
  margin-bottom: 1.75rem;
}

.login-form {
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.login-error-box {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
  padding: 0.75rem;
  border-radius: 8px;
  font-size: 0.85rem;
  margin-bottom: 1rem;
  display: none;
  text-align: center;
}

.user-badge-container {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.75rem;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  font-size: 0.82rem;
}

.user-badge-name {
  font-weight: 600;
  color: #f8fafc;
}

.user-badge-company {
  color: var(--primary);
  font-size: 0.75rem;
}

.stat-pill {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  font-size: 0.8rem;
  color: #cbd5e1;
}

/* Responsividade Mobile & Tablet */
@media (max-width: 768px) {
  .header-container {
    flex-wrap: wrap;
  }
  .main-nav {
    display: none;
    width: 100%;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1rem 0;
    border-top: 1px solid var(--border-subtle);
  }
  .main-nav.nav-mobile-open {
    display: flex;
  }
  .btn-mobile-menu {
    display: block;
  }
  .header-actions .status-pill {
    display: none;
  }
  .terminal-reticle {
    width: 180px;
    height: 220px;
  }
  .recibo-grid {
    grid-template-columns: 1fr;
  }
}
