/* ==========================================================
   CSS PRINCIPAL - APLICATIVO BRIEFING MOBILE GMN
   ========================================================== */

/* Font & Reset & Conic Border Animation */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Newsreader:ital,opsz,wght@0,6..72,300..800;1,6..72,300..800&display=swap');

@property --gradient-angle {
  syntax: "<angle>";
  initial-value: 0deg;
  inherits: false;
}

:root {
  /* Aura Dark Theme HSL System */
  --background-hsl: 0 0% 9%;       /* #171717 - Deep Charcoal Black */
  --foreground-hsl: 0 0% 98%;      /* #fafafa */
  --card-hsl: 0 0% 11%;            /* #1c1c1c - Cards */
  --border-hsl: 0 0% 20%;          /* #333333 - Subtle Hairline Border */
  --primary-hsl: 217 91% 60%;      /* #3b82f6 - Electric Blue */
  --primary-hover-hsl: 217 91% 50%;/* #2563eb */
  --gold-hsl: 38 92% 50%;          /* #f59e0b */
  --success-hsl: 142 71% 45%;      /* #10b981 */
  --warning-hsl: 38 92% 50%;       /* #f59e0b */
  --error-hsl: 350 89% 60%;        /* #f43f5e - Rose / Coral Red */
  
  /* Fallback Color Variables used in the app */
  --bg-app: hsl(var(--background-hsl));
  --bg-gradient: radial-gradient(circle at 50% 50%, hsl(0 0% 14%) 0%, hsl(var(--background-hsl)) 100%);
  --panel-glass: hsla(var(--card-hsl) / 0.7);
  --panel-border: hsla(var(--border-hsl) / 0.8);
  
  --primary: hsl(var(--primary-hsl));
  --primary-glow: rgba(37, 99, 235, 0.25);
  --primary-hover: hsl(var(--primary-hover-hsl));
  --secondary: hsla(var(--foreground-hsl) / 0.05);
  --secondary-hover: hsla(var(--foreground-hsl) / 0.09);
  
  --text-main: hsl(var(--foreground-hsl));
  --text-muted: hsl(0 0% 65%);
  --text-dark: #000000;
  
  --success: hsl(var(--success-hsl));
  --warning: hsl(var(--warning-hsl));
  --error: hsl(var(--error-hsl));
  
  /* Google Brand Colors */
  --g-blue: #4285F4;
  --g-red: #EA4335;
  --g-yellow: #FBBC05;
  --g-green: #34A853;
  
  --border-radius-lg: 20px;
  --border-radius-md: 12px;
  --border-radius-sm: 8px;
  
  --shadow-main: 0 10px 40px -10px rgba(0, 0, 0, 0.6);
  --transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-serif: 'Newsreader', serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: var(--font-family);
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: hsl(var(--background-hsl));
  background-image: var(--bg-gradient);
  color: var(--text-main);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

/* ==========================================================
   VIEWPORT E MOCKUP DE DISPOSITIVO MÓVEL
   ========================================================== */

.app-viewport {
  width: 100%;
  height: 100vh;
  height: 100dvh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.phone-shell {
  width: 410px;
  height: 840px;
  background: hsl(var(--background-hsl));
  border-radius: 40px;
  box-shadow: 0 25px 80px -20px rgba(0, 0, 0, 0.8), 0 0 0 10px #1a1a1a;
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* Ajuste Responsivo para Dispositivos Móveis Reais */
@media (max-width: 480px) {
  .app-viewport {
    padding: 0;
    height: 100vh;
    height: 100dvh;
  }
  .phone-shell {
    width: 100%;
    height: 100vh;
    height: 100dvh;
    border-radius: 0;
    box-shadow: none;
    border: none;
  }
  .phone-status-bar,
  .phone-home-indicator {
    display: none !important;
  }
  .screen {
    top: 0 !important;
    bottom: 0 !important;
    padding: 16px;
    padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  }
}

/* Barra de Status */
.phone-status-bar {
  height: 38px;
  padding: 0 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  user-select: none;
  z-index: 100;
  background: hsla(var(--background-hsl) / 0.8);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.phone-status-bar .status-icons {
  display: flex;
  align-items: center;
  gap: 6px;
}

.phone-status-bar svg {
  width: 14px;
  height: 14px;
}

/* Indicador Físico Inferior */
.phone-home-indicator {
  height: 24px;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  z-index: 100;
  background: hsla(var(--background-hsl) / 0.8);
  pointer-events: none;
}

.phone-home-indicator::after {
  content: '';
  width: 130px;
  height: 5px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 10px;
}

/* ==========================================================
   GERENCIADOR DE TELAS
   ========================================================== */

.screen {
  flex: 1;
  width: 100%;
  display: flex;
  flex-direction: column;
  padding: 24px;
  overflow: hidden; /* Evita que a tela inteira role, mantendo cabeçalho e rodapé fixos */
  position: absolute;
  top: 38px;
  bottom: 24px;
  left: 0;
  right: 0;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.35s ease, transform 0.35s ease;
  transform: translateY(20px);
}

.screen.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
  /* Mantido absolute para respeitar o grid fixo do celular */
}

/* Custom Scrollbar */
.screen::-webkit-scrollbar,
.card-scroll::-webkit-scrollbar {
  width: 4px;
}

.screen::-webkit-scrollbar-thumb,
.card-scroll::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
}

/* Toast de Alerta */
.toast {
  position: absolute;
  top: 50px;
  left: 20px;
  right: 20px;
  padding: 14px 20px;
  border-radius: var(--border-radius-md);
  background: hsl(var(--card-hsl));
  color: var(--text-main);
  box-shadow: var(--shadow-main);
  z-index: 1000;
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.4;
  border: 1px solid hsl(var(--border-hsl));
  border-left: 4px solid var(--primary);
  display: flex;
  align-items: center;
  transition: var(--transition);
}

.toast.success { border-left-color: var(--success); }
.toast.warning { border-left-color: var(--warning); }
.toast.error { border-left-color: var(--error); }
.toast.hidden {
  opacity: 0;
  transform: translateY(-50px) scale(0.9);
  pointer-events: none;
}

/* ==========================================================
   PAINEIS E ELEMENTOS DE VIDRO (GLASSMORPHISM)
   ========================================================== */

.glass-panel {
  background: hsla(var(--card-hsl) / 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-main);
  position: relative;
  border: 1px solid transparent;
}

.glass-panel::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  padding: 1px;
  border-radius: inherit;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.02));
  pointer-events: none;
}

/* Tipografia Serif Display */
.text-serif-display {
  font-family: var(--font-serif) !important;
  font-style: italic !important;
  font-weight: 350 !important;
  letter-spacing: -0.02em;
}

/* ==========================================================
   TELA 1: AUTENTICAÇÃO
   ========================================================== */

#screen-auth {
  justify-content: flex-start;
  overflow-y: auto;
}

#screen-auth .auth-header {
  margin-top: auto;
}

#screen-auth .auth-card {
  margin-bottom: auto;
}

.auth-header {
  text-align: center;
  margin-bottom: 24px;
}

.gmn-logo {
  font-size: 2.2rem;
  font-weight: 700;
  letter-spacing: -1px;
  margin-bottom: 4px;
}

.g-blue { color: var(--g-blue); }
.g-red { color: var(--g-red); }
.g-yellow { color: var(--g-yellow); }
.g-green { color: var(--g-green); }

.logo-subtitle {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-top: -2px;
}

.auth-header h1 {
  font-size: 1.6rem;
  font-weight: 600;
  margin-top: 10px;
}

.auth-header p {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 6px;
  padding: 0 10px;
}

.auth-card {
  padding: 24px;
}

.tabs {
  display: flex;
  background: hsla(var(--background-hsl) / 0.8);
  padding: 4px;
  border-radius: var(--border-radius-md);
  margin-bottom: 20px;
  border: 1px solid hsl(var(--border-hsl));
}

.tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 10px;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--border-radius-sm);
  cursor: pointer;
  transition: var(--transition);
}

.tab-btn.active {
  background: hsl(var(--primary-hsl));
  color: #fff;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.auth-form {
  display: none;
}

.auth-form.active {
  display: block;
}

/* Campos de entrada */
.input-group {
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.input-group label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
}

.input-group input,
.input-group textarea,
.input-group select {
  width: 100%;
  padding: 12px 16px;
  background: hsla(var(--background-hsl) / 0.6);
  border: 1px solid hsl(var(--border-hsl));
  border-radius: var(--border-radius-md);
  color: var(--text-main);
  font-size: 0.95rem;
  transition: var(--transition);
}

.input-group input:focus,
.input-group textarea:focus,
.input-group select:focus {
  outline: none;
  border-color: hsl(var(--primary-hsl));
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
  background: hsla(var(--background-hsl) / 0.9);
}

.input-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Divisor */
.divider {
  display: flex;
  align-items: center;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 500;
  text-transform: uppercase;
  margin: 20px 0;
}

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

.divider:not(:empty)::before { margin-right: 12px; }
.divider:not(:empty)::after { margin-left: 12px; }

/* Botões */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 20px;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--border-radius-md);
  border: none;
  cursor: pointer;
  transition: var(--transition);
  user-select: none;
}

.btn-primary {
  background: linear-gradient(to bottom, #3b82f6, #2563eb);
  border: 1px solid #2563eb;
  color: #fff;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.btn-primary:hover {
  background: linear-gradient(to bottom, #2563eb, #1d4ed8);
  border-color: #1d4ed8;
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.btn-secondary {
  background: var(--secondary);
  border: 1px solid hsl(var(--border-hsl));
  color: var(--text-main);
}

.btn-secondary:hover {
  background: var(--secondary-hover);
  border-color: hsla(var(--foreground-hsl) / 0.2);
  color: #fff;
}

.btn-gold {
  background: linear-gradient(to bottom, #fbbf24, #f59e0b);
  border: 1px solid #f59e0b;
  color: #000000;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.btn-gold:hover {
  background: linear-gradient(to bottom, #f59e0b, #d97706);
  border-color: #d97706;
  box-shadow: 0 6px 16px rgba(245, 158, 11, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.btn-shiny {
  --gradient-angle: 0deg;
  --gradient-shine: #60a5fa;
  position: relative;
  overflow: hidden;
  color: #fff;
  background: linear-gradient(#0c0d0e, #0c0d0e) padding-box, conic-gradient(from var(--gradient-angle), transparent 0%, #2563eb 15%, var(--gradient-shine) 30%, #2563eb 45%, transparent 60%, transparent 100%) border-box;
  border: 2px solid transparent;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
  animation: border-spin 3s linear infinite;
  isolation: isolate;
}

.btn-shiny span {
  position: relative;
  z-index: 2;
  display: inline-block;
}

.btn-shiny:hover {
  --gradient-shine: #93c5fd;
  box-shadow: 0 0 15px rgba(59, 130, 246, 0.35);
}

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

@keyframes border-spin {
  to {
    --gradient-angle: 360deg;
  }
}

.btn-block {
  width: 100%;
}

.btn.disabled {
  opacity: 0.4;
  pointer-events: none;
}

.btn-icon {
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: var(--text-main);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.btn-icon:hover {
  background: rgba(255, 255, 255, 0.15);
}

.btn-icon.hidden {
  display: none;
}

.icon {
  width: 18px;
  height: 18px;
}

.icon-rotated {
  width: 18px;
  height: 18px;
  transform: rotate(180deg);
}

/* Autenticação Google */
.google-auth-wrapper {
  display: flex;
  justify-content: center;
  width: 100%;
}

/* ==========================================
   TELA 2: BRIEFING WIZARD (CARROSSEL)
   ========================================== */

.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.header-user-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-avatar {
  width: 38px;
  height: 38px;
  background: hsla(var(--primary-hsl) / 0.15);
  border: 1px solid hsla(var(--primary-hsl) / 0.4);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #60a5fa;
  font-family: var(--font-serif);
  font-style: italic;
}

.user-name {
  font-size: 0.95rem;
  font-weight: 600;
}

.user-role {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.header-actions {
  display: flex;
  gap: 8px;
}

/* Barra de Progresso */
.progress-container {
  margin-bottom: 24px;
}

.progress-bar-wrapper {
  height: 6px;
  background: hsla(var(--foreground-hsl) / 0.05);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 8px;
  border: 1px solid hsl(var(--border-hsl));
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #2563eb 0%, #60a5fa 100%);
  border-radius: 10px;
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.4);
  transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.progress-text {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Container do Carrossel */
.wizard-container {
  flex: 1;
  position: relative;
  overflow: hidden;
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
}

#briefing-form {
  display: flex;
  flex-direction: column;
  flex: 1;
  height: 100%;
  min-height: 0;
}

.wizard-step {
  display: none;
  flex-direction: column;
  height: 100%;
}

.wizard-step.active {
  display: flex;
  animation: slideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  flex: 1;
  min-height: 0;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.step-intro {
  margin-bottom: 16px;
  flex-shrink: 0;
}

.step-num {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 0.85rem;
  font-weight: 700;
  color: #60a5fa;
  background: hsla(var(--primary-hsl) / 0.15);
  padding: 4px 10px;
  border-radius: 6px;
  display: inline-block;
  margin-bottom: 8px;
  letter-spacing: 1px;
  border: 1px solid hsla(var(--primary-hsl) / 0.3);
}

.step-intro h2 {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.55rem;
  font-weight: 400;
  letter-spacing: -0.02em;
}

.step-intro p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.card {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

/* Card Rolável (para listas longas de checkbox) */
.card-scroll {
  padding: 20px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.card-scroll h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 14px;
  border-left: 3px solid #2563eb;
  padding-left: 8px;
  letter-spacing: -0.01em;
}

.margin-top {
  margin-top: 24px;
}

.no-margin {
  margin: 0 !important;
}

/* Custom Checkboxes */
.checkbox-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.checkbox-container {
  display: flex;
  position: relative;
  padding-left: 36px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 450;
  user-select: none;
  align-items: center;
  min-height: 24px;
}

.checkbox-container input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0;
  width: 0;
}

.checkmark {
  position: absolute;
  top: 0;
  left: 0;
  height: 24px;
  width: 24px;
  background: hsla(var(--background-hsl) / 0.6);
  border: 1px solid hsl(var(--border-hsl));
  border-radius: var(--border-radius-sm);
  transition: var(--transition);
}

.checkbox-container:hover input ~ .checkmark {
  border-color: #3b82f6;
}

.checkbox-container input:checked ~ .checkmark {
  background: #2563eb;
  border-color: #2563eb;
  box-shadow: 0 0 8px rgba(37, 99, 235, 0.4);
}

.checkmark::after {
  content: "";
  position: absolute;
  display: none;
}

.checkbox-container input:checked ~ .checkmark::after {
  display: block;
}

.checkbox-container .checkmark::after {
  left: 8px;
  top: 4px;
  width: 5px;
  height: 10px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* Custom Switch Toggles */
.toggle-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.toggle-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid hsl(var(--border-hsl));
}

.toggle-row span {
  font-size: 0.9rem;
  font-weight: 450;
}

.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: hsla(var(--background-hsl) / 0.6);
  border: 1px solid hsl(var(--border-hsl));
  transition: .3s;
  border-radius: 34px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: hsl(0 0% 65%);
  transition: .3s;
  border-radius: 50%;
}

.switch input:checked + .slider {
  background-color: #2563eb;
  border-color: #2563eb;
}

.switch input:checked + .slider:before {
  transform: translateX(20px);
  background-color: white;
}

/* Radio Custom Card Group */
.radio-box-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.radio-box {
  cursor: pointer;
  position: relative;
}

.radio-box input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.radio-content {
  border: 1px solid hsl(var(--border-hsl));
  background: hsla(var(--background-hsl) / 0.5);
  padding: 12px;
  border-radius: var(--border-radius-md);
  text-align: center;
  transition: var(--transition);
}

.radio-box input:checked + .radio-content {
  border-color: #3b82f6;
  background: rgba(59, 130, 246, 0.1);
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.2);
}

.radio-content .title {
  font-size: 0.95rem;
  font-weight: 600;
  display: block;
}

/* Revisão */
.revision-box {
  background: rgba(59, 130, 246, 0.08);
  border: 1px dashed rgba(59, 130, 246, 0.3);
  padding: 16px;
  border-radius: var(--border-radius-md);
  text-align: center;
}

.revision-box h3 {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.15rem;
  color: #60a5fa;
  margin-bottom: 6px;
  border: none;
  padding: 0;
  letter-spacing: -0.01em;
}

.revision-box p {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Controles Inferiores */
.wizard-actions {
  display: flex;
  gap: 12px;
}

.wizard-actions .btn {
  flex: 1;
}

/* ==========================================
   TELA 3: PAINEL ADMINISTRATIVO
   ========================================== */

.admin-header {
  margin-bottom: 12px;
}

.admin-header h1 {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.5rem;
  font-weight: 400;
  letter-spacing: -0.02em;
}

.role-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.card-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.admin-tabs {
  display: flex;
  gap: 6px;
  background: hsla(var(--background-hsl) / 0.8);
  padding: 4px;
  border-radius: var(--border-radius-md);
  margin-bottom: 16px;
  border: 1px solid hsl(var(--border-hsl));
}

.admin-tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 8px 4px;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: var(--border-radius-sm);
  cursor: pointer;
  transition: var(--transition);
}

.admin-tab-btn.active {
  background: hsla(var(--foreground-hsl) / 0.08);
  color: var(--text-main);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.admin-content-container {
  flex: 1;
  overflow-y: auto;
  margin-bottom: 16px;
}

.admin-tab-content {
  display: none;
}

.admin-tab-content.active {
  display: block;
}

.admin-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 24px;
}

/* Submissões Admin */
.submissions-header {
  margin-bottom: 12px;
  padding: 0 4px;
}

.submissions-header h3 {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.25rem;
  font-weight: 400;
  letter-spacing: -0.01em;
}

.submissions-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.submission-card {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}

.submission-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px -10px rgba(0, 0, 0, 0.6);
}

.submission-card:hover::before {
  background: linear-gradient(to bottom, rgba(59, 130, 246, 0.3), rgba(255, 255, 255, 0.02));
}

.sub-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sub-date {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 20px;
  text-transform: uppercase;
  border: 1px solid transparent;
}

.badge.sincronizado {
  background: rgba(16, 185, 129, 0.12);
  color: var(--success);
  border-color: rgba(16, 185, 129, 0.25);
}

.badge.pendente {
  background: rgba(245, 158, 11, 0.12);
  color: var(--warning);
  border-color: rgba(245, 158, 11, 0.25);
}

.badge.erro {
  background: rgba(244, 63, 94, 0.12);
  color: var(--error);
  border-color: rgba(244, 63, 94, 0.25);
}

.sub-info h4 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 2px;
}

.sub-info p {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.sub-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 4px;
}

.btn-mini {
  padding: 6px 12px;
  font-size: 0.75rem;
  border-radius: var(--border-radius-sm);
}

.loading-state,
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Tabela de Usuários */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--border-radius-lg);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.admin-table th,
.admin-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid hsl(var(--border-hsl));
}

.admin-table th {
  font-weight: 600;
  color: var(--text-muted);
  background: hsla(var(--card-hsl) / 0.8);
}

.admin-table td {
  color: var(--text-main);
}

.text-center {
  text-align: center !important;
}

/* ==========================================
   MODAL DE INSPEÇÃO (JSON)
   ========================================== */

.modal {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(11, 12, 13, 0.8);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 1000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  transition: var(--transition);
}

.modal.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.modal-content {
  width: 100%;
  max-height: 80%;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  border-top-left-radius: 24px;
  border-top-right-radius: 24px;
  display: flex;
  flex-direction: column;
  animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  border-bottom: none;
  border: 1px solid hsl(var(--border-hsl));
}

@keyframes slideUp {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}

.modal-header {
  padding: 20px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid hsl(var(--border-hsl));
}

.modal-header h2 {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.2rem;
  font-weight: 400;
  letter-spacing: -0.01em;
}

.modal-body {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
}

/* Visualização Detalhada em Grid */
.detail-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.detail-section h4 {
  font-size: 0.85rem;
  color: #60a5fa;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
  border-bottom: 1px solid rgba(59, 130, 246, 0.2);
  padding-bottom: 4px;
}

.detail-row-text {
  font-size: 0.88rem;
  margin-bottom: 6px;
  display: flex;
  flex-wrap: wrap;
}

.detail-row-text strong {
  color: var(--text-muted);
  width: 150px;
  flex-shrink: 0;
}

.detail-chips-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.detail-chip {
  font-size: 0.75rem;
  padding: 4px 10px;
  background: hsla(var(--foreground-hsl) / 0.04);
  border: 1px solid hsl(var(--border-hsl));
  border-radius: 12px;
  color: var(--text-main);
}

/* Time Picker Custom Component */
.time-picker-group {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.time-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  background: hsla(var(--background-hsl) / 0.4);
  border-radius: var(--border-radius-md);
  border: 1px solid hsl(var(--border-hsl));
  transition: var(--transition);
}

.time-row-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.time-day-label {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-main);
}

.time-inputs-container {
  display: flex;
  align-items: center;
  gap: 12px;
  transition: var(--transition);
}

.time-inputs-container.disabled {
  opacity: 0.35;
  pointer-events: none;
}

.time-inputs-container input[type="time"] {
  flex: 1;
  min-width: 0;
  padding: 8px 12px;
  border-radius: var(--border-radius-sm);
  background: hsla(var(--background-hsl) / 0.6);
  border: 1px solid hsl(var(--border-hsl));
  color: var(--text-main);
  font-size: 0.9rem;
  font-weight: 500;
  text-align: center;
}

.time-inputs-container input[type="time"]:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.25);
}

.time-inputs-container span {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
}

.mini-chk {
  padding-left: 28px !important;
  min-height: 20px !important;
}

.mini-chk .checkmark {
  width: 20px !important;
  height: 20px !important;
}

.mini-chk input:checked ~ .checkmark::after {
  left: 6px !important;
  top: 2px !important;
}

/* Dashboard do Cliente */
.dashboard-scroll-content {
  flex: 1;
  overflow-y: auto;
  margin-bottom: 16px;
  padding-right: 4px;
}

.dashboard-scroll-content::-webkit-scrollbar {
  width: 4px;
}

.dashboard-scroll-content::-webkit-scrollbar-thumb {
  background: hsla(var(--foreground-hsl) / 0.1);
  border-radius: 10px;
}

.dashboard-actions {
  margin-top: auto;
  padding-top: 12px;
}

/* Password Input Toggler */
.password-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.password-input-wrapper input {
  padding-right: 48px !important;
}

.toggle-password-btn {
  position: absolute;
  right: 12px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  transition: var(--transition);
  z-index: 10;
}

.toggle-password-btn:hover {
  color: var(--text-main);
}

/* ==========================================================
   DESKTOP RESPONSIVE OPTIMIZATIONS
   ========================================================== */
@media (min-width: 769px) {
  /* Expand the phone shell into a widescreen container ONLY when NOT in auth mode */
  .phone-shell:not(.auth-mode) {
    width: 95%;
    max-width: 1200px;
    height: 94vh;
    border-radius: 20px;
    box-shadow: 0 25px 80px -20px rgba(0, 0, 0, 0.8);
  }

  /* Keep the phone shell container narrow for the login screen */
  .phone-shell.auth-mode {
    width: 410px;
    height: 840px;
    border-radius: 40px;
    box-shadow: 0 25px 80px -20px rgba(0, 0, 0, 0.8), 0 0 0 10px #1a1a1a;
  }

  /* Hide mobile simulator components ONLY when NOT in auth mode */
  .phone-shell:not(.auth-mode) .phone-status-bar,
  .phone-shell:not(.auth-mode) .phone-home-indicator {
    display: none !important;
  }

  /* Stretch screen content to full height of the container ONLY when NOT in auth mode */
  .phone-shell:not(.auth-mode) .screen {
    top: 0 !important;
    bottom: 0 !important;
    padding: 32px;
  }

  /* Restrict wizard container forms to a centered reading size */
  .wizard-container,
  .progress-container,
  .wizard-actions {
    width: 100%;
    max-width: 860px;
    margin-left: auto;
    margin-right: auto;
  }

  /* Reorganize submissions and users lists in a modern grid */
  .submissions-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
  }

  /* Keep dashboard and admin scrolls neatly centered */
  .dashboard-scroll-content,
  .dashboard-actions,
  .admin-content-container,
  .app-header {
    width: 100%;
    max-width: 1100px;
    margin-left: auto;
    margin-right: auto;
  }

  /* Center modals on desktop */
  .modal {
    align-items: center;
  }
  
  .modal-content {
    width: 90%;
    max-width: 600px;
    max-height: 85%;
    border-radius: 20px !important;
  }
}

/* ==========================================================
   CARDS COLAPSÁVEIS NAS CONFIGURAÇÕES
   ========================================================== */
.collapsible-card {
  margin-bottom: 1.25rem;
  border-radius: var(--border-radius-md);
  border: 1px solid var(--panel-border);
  background: var(--panel-glass);
  overflow: hidden;
  transition: var(--transition);
}

.collapsible-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  cursor: pointer;
  user-select: none;
  background: rgba(255, 255, 255, 0.01);
  transition: var(--transition);
}

.collapsible-header:hover {
  background: rgba(255, 255, 255, 0.04);
}

.collapsible-title-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-main);
}

.collapsible-title-wrapper svg {
  color: var(--primary);
  display: flex;
  align-items: center;
}

.collapsible-title-wrapper h4 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
}

.btn-toggle-collapse {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  border-radius: 50%;
  transition: var(--transition);
}

.collapsible-card:hover .btn-toggle-collapse {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}

.btn-toggle-collapse .arrow-icon {
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.collapsible-card.collapsed .btn-toggle-collapse .arrow-icon {
  transform: rotate(-90deg);
}

.collapsible-content {
  padding: 1.25rem;
  border-top: 1px solid var(--panel-border);
  transition: max-height 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease, padding 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
  max-height: 2000px;
  opacity: 1;
}

.collapsible-card.collapsed .collapsible-content {
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  border-top-color: transparent;
  opacity: 0;
  pointer-events: none;
}

/* ==========================================================
   ESTILOS ADICIONAIS: MODAL DE DÚVIDAS & GUIA DE ACESSO
   ========================================================== */

.auth-help-action {
  margin-top: 18px;
  text-align: center;
  display: flex;
  justify-content: center;
}

.btn-link {
  background: transparent;
  border: none;
  color: #60a5fa;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: var(--border-radius-sm);
  transition: var(--transition);
}

.btn-link:hover {
  color: #93c5fd;
  background: rgba(255, 255, 255, 0.04);
}

.btn-link svg {
  transition: transform 0.2s ease;
}

.btn-link:hover svg {
  transform: scale(1.1);
}

/* Abas menores para o FAQ Modal */
.mini-tabs {
  margin-bottom: 16px !important;
}

.faq-tab-content {
  display: none;
  animation: fadeIn 0.3s ease forwards;
}

.faq-tab-content.active {
  display: block;
}

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

.faq-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.faq-section h3 {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.3rem;
  font-weight: 400;
  color: #60a5fa;
  margin-bottom: 4px;
}

.faq-section > p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Grid de Benefícios */
.faq-benefits-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 8px;
}

.benefit-item {
  display: flex;
  gap: 14px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--border-radius-md);
  transition: var(--transition);
}

.benefit-item:hover {
  background: rgba(59, 130, 246, 0.04);
  border-color: rgba(59, 130, 246, 0.2);
  transform: translateY(-1px);
}

.benefit-icon {
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  background: rgba(59, 130, 246, 0.1);
  border-radius: 50%;
  border: 1px solid rgba(59, 130, 246, 0.2);
}

.benefit-item h4 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 3px;
}

.benefit-item p {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Info Alert box */
.info-alert {
  padding: 12px 16px;
  border-radius: var(--border-radius-md);
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.25);
  font-size: 0.82rem;
  color: #a5b4fc;
  line-height: 1.4;
}

/* Fluxo de Etapas (Guia de Acesso) */
.steps-flow {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 8px;
}

.step-card {
  display: flex;
  gap: 14px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--border-radius-md);
  align-items: flex-start;
  transition: var(--transition);
}

.step-card:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.12);
}

.step-badge {
  width: 26px;
  height: 26px;
  background: #2563eb;
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  flex-shrink: 0;
  box-shadow: 0 0 8px rgba(37, 99, 235, 0.4);
}

.step-desc h4 {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 4px;
}

.step-desc p {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.45;
}

/* ==========================================================
   CHECKLIST DE PRÉ-ANÁLISE (ESTILOS COMPLEMENTARES)
   ========================================================== */
.pre-analysis-form-container {
  animation: fadeIn 0.3s ease forwards;
}

.checklist-category-card {
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.checklist-category-card:hover {
  border-color: rgba(96, 165, 250, 0.2) !important;
  background-color: rgba(255, 255, 255, 0.03) !important;
}

.score-gauge-wrapper {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.75rem 1.25rem;
  border-radius: 12px;
}

.pa-score-sticky-card {
  position: sticky;
  top: 10px;
  float: right;
  z-index: 100;
  margin-left: 1.5rem;
  background: rgba(18, 18, 28, 0.85) !important;
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  text-align: right;
  transition: all 0.3s ease;
}

@media (max-width: 768px) {
  .pa-score-sticky-card {
    position: sticky;
    top: 10px;
    float: none;
    margin-left: auto;
    margin-right: 0;
    margin-bottom: 1rem;
    width: fit-content;
  }
}

/* ==========================================================
   LAYOUT DE IMPRESSÃO (PRINT REPORT)
   ========================================================== */
@media print {
  /* Ocultar toda a interface do aplicativo, menus, botões de ação e fundos escuros */
  body {
    background: #ffffff !important;
    color: #000000 !important;
    font-family: Arial, sans-serif !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .phone-shell, 
  .screen, 
  .app-header, 
  .admin-tabs, 
  .submissions-header, 
  #pre-analyses-list, 
  #pre-analysis-back-btn, 
  .form-actions, 
  .phone-status-bar, 
  .phone-home-indicator {
    display: none !important;
  }

  #admin-tab-pre-analyses, 
  #pre-analysis-form-container, 
  #pre-analysis-form {
    display: block !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  .glass-panel {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
  }

  .form-header h2, 
  .section-title h4, 
  .checklist-category-card h5 {
    color: #1a1a1a !important;
    text-shadow: none !important;
  }

  .form-header p, 
  .input-hint, 
  label {
    color: #333333 !important;
  }

  /* Grid em preto e branco com bordas sutis */
  .checklist-category-card {
    background: #ffffff !important;
    border: 1px solid #dddddd !important;
    margin-bottom: 20px !important;
    padding: 15px !important;
    page-break-inside: avoid;
  }

  .checkbox-container {
    color: #000000 !important;
    pointer-events: none;
    margin-bottom: 6px !important;
    padding-left: 0 !important;
  }

  /* Mostrar checkbox nativo impresso */
  .checkbox-container input[type="checkbox"] {
    opacity: 1 !important;
    position: relative !important;
    display: inline-block !important;
    margin-right: 8px !important;
    width: 14px !important;
    height: 14px !important;
    cursor: default;
    vertical-align: middle !important;
  }

  .checkbox-container .checkmark {
    display: none !important;
  }

  .checkbox-container .label-text {
    vertical-align: middle !important;
    display: inline-block !important;
  }

  /* Organizar formulário em grid de colunas para dados do cliente */
  .form-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 15px !important;
    margin-bottom: 25px !important;
    border: 1px solid #dddddd !important;
    padding: 15px !important;
    border-radius: 8px !important;
  }

  .input-group input {
    border: none !important;
    border-bottom: 1px solid #999999 !important;
    background: transparent !important;
    color: #000000 !important;
    padding: 2px 0 !important;
    font-size: 10.5pt !important;
  }

  /* Score dinâmico impresso em alta visibilidade */
  .score-gauge-wrapper {
    background: #f3f4f6 !important;
    border: 1.5px solid #cccccc !important;
    padding: 10px 15px !important;
    border-radius: 8px !important;
    color: #000000 !important;
  }

  .pa-score-sticky-card {
    position: static !important;
    float: right !important;
    margin: 0 0 20px 0 !important;
    background: #f3f4f6 !important;
    border: 1.5px solid #cccccc !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    width: auto !important;
  }

  #pa-score-text {
    color: #000000 !important;
    font-size: 12pt !important;
    font-weight: bold !important;
  }

  #pa-score-badge {
    background: #333333 !important;
    color: #ffffff !important;
    border-radius: 4px !important;
    border: none !important;
    font-size: 10pt !important;
    padding: 2px 8px !important;
  }

  /* Áreas de texto expandidas e sem scroll bar */
  textarea {
    border: 1px solid #cccccc !important;
    background: transparent !important;
    color: #000000 !important;
    font-size: 10pt !important;
    height: auto !important;
    min-height: 80px !important;
    resize: none !important;
    overflow: visible !important;
  }

  /* Rodapé / Assinatura do Relatório */
  #pre-analysis-form::after {
    content: "Relatório de Auditoria e Pré-Análise de Perfil - Agência GMN. Documento gerado eletronicamente.";
    display: block;
    margin-top: 40px;
    font-size: 8.5pt;
    text-align: center;
    color: #777777;
    border-top: 1px solid #dddddd;
    padding-top: 10px;
  }
}

