/**
 * style.css - Design System Principal, Hub Dark do Sistema e Painel Administrativo
 * Inspirado visualmente na identidade do Sistema Informática (sistema.png)
 */

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

:root {
  /* Paleta Base Light */
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --bg-subtle: #f1f5f9;
  
  /* Cores Primárias */
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  --primary-border: #bfdbfe;
  
  /* Sistema Dark Cores (sistema.png) */
  --sys-dark-bg: #0b0f19;
  --sys-dark-surface: #111726;
  --sys-dark-card: #151c2e;
  --sys-dark-border: #1e293b;
  --sys-dark-border-hover: #334155;
  --sys-text-bright: #f8fafc;
  --sys-text-muted: #94a3b8;
  
  /* Semânticas */
  --success: #10b981;
  --success-bg: #ecfdf5;
  --success-border: #a7f3d0;
  
  --warning: #f59e0b;
  --warning-bg: #fffbeb;
  --warning-border: #fde68a;
  
  --danger: #ef4444;
  --danger-bg: #fef2f2;
  --danger-border: #fecaca;
  
  /* Tipografia */
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  
  /* Bordas e Sombras */
  --border-color: #e2e8f0;
  --border-focus: #3b82f6;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.07), 0 2px 4px -2px rgb(0 0 0 / 0.07);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.08), 0 4px 6px -4px rgb(0 0 0 / 0.05);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  text-decoration: underline;
}

/* ==========================================================================
   Hub Dark do Sistema (Fiel ao visual de sistema.png - Centralizado)
   ========================================================================== */
.sistema-dark-wrapper {
  min-height: 100vh;
  width: 100%;
  background-color: var(--sys-dark-bg);
  color: var(--sys-text-bright);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  position: relative;
  overflow: hidden;
}

/* Vídeo de fundo do Hub Central */
.hub-bg-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  pointer-events: none;
}

.hub-bg-overlay {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: rgba(6, 12, 25, 0.6);
  pointer-events: none;
}

.sistema-main-container,
.sistema-footer {
  position: relative;
  z-index: 1;
}

/* Conteúdo Principal do Hub */
.sistema-main-container {
  flex: 1;
  max-width: 1180px;
  width: 100%;
  margin: 0 auto;
  padding: 4rem 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.sistema-welcome-banner {
  margin-bottom: 3rem;
  text-align: center;
}

.sistema-welcome-banner h1 {
  font-size: 2.2rem;
  color: #ffffff;
  margin-bottom: 0.5rem;
}

.sistema-welcome-banner p {
  color: var(--sys-text-muted);
  font-size: 1.05rem;
}

/* Grade de Cards do Sistema Centralizada */
.sistema-modules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 320px));
  justify-content: center;
  gap: 1.75rem;
  width: 100%;
  max-width: 1080px;
}

.sistema-card {
  background-color: var(--sys-dark-card);
  border: 1.5px solid var(--sys-dark-border);
  border-radius: var(--radius-lg);
  padding: 2.5rem 1.75rem 2rem 1.75rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  cursor: pointer;
  width: 100%;
}

.sistema-card:hover {
  transform: translateY(-4px);
  border-color: var(--sys-dark-border-hover);
  box-shadow: 0 12px 25px -5px rgba(0, 0, 0, 0.5);
}

.sistema-card.active-module {
  border-color: #0284c7;
  box-shadow: 0 0 20px -5px rgba(2, 132, 199, 0.25);
}

.sistema-card.active-module:hover {
  border-color: #38bdf8;
  box-shadow: 0 0 25px 0 rgba(56, 189, 248, 0.35);
}

.card-icon-container {
  width: 60px;
  height: 60px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
}

.icon-cyan { background-color: #0c2338; border: 1.5px solid #0369a1; }
.icon-green { background-color: #0d281e; border: 1.5px solid #15803d; }
.icon-red { background-color: #2b1418; border: 1.5px solid #991b1b; }
.icon-purple { background-color: #261435; border: 1.5px solid #7e22ce; }
.icon-blue { background-color: #0f1d38; border: 1.5px solid #1d4ed8; }
.icon-amber { background-color: #2b1f0d; border: 1.5px solid #b45309; }
.icon-indigo { background-color: #19183b; border: 1.5px solid #4338ca; }

.card-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: 0.03em;
  margin-bottom: 0.4rem;
}

.card-desc {
  font-size: 0.8rem;
  color: var(--sys-text-muted);
  line-height: 1.4;
  margin-bottom: 1.25rem;
  flex: 1;
}

.card-mini-kpis {
  display: flex;
  gap: 0.35rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  justify-content: center;
}

.kpi-tag {
  font-size: 0.7rem;
  font-weight: 700;
  background: #0e1626;
  border: 1px solid #1e293b;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  color: #94a3b8;
}

.kpi-green { color: #4ade80; border-color: #14532d; }
.kpi-amber { color: #f59e0b; border-color: #78350f; }

.card-badge-status {
  font-size: 0.7rem;
  font-weight: 700;
  color: #64748b;
  background: #0f172a;
  border: 1px dashed #334155;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  margin-bottom: 1.25rem;
  display: inline-block;
}

.card-badge-status.badge-maintenance {
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.12);
  border: 1px dashed rgba(245, 158, 11, 0.45);
  box-shadow: 0 0 10px -2px rgba(245, 158, 11, 0.15);
}

.btn-card-access {
  width: 100%;
  padding: 0.55rem 1rem;
  border-radius: 8px;
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid transparent;
}

.btn-cyan { background-color: #07273d; color: #38bdf8; border-color: #0284c7; }
.btn-cyan:hover { background-color: #0c3e61; color: #ffffff; }

.btn-green { background-color: #09261a; color: #4ade80; border-color: #16a34a; }
.btn-green:hover { background-color: #0f3f2b; color: #ffffff; }

.btn-red { background-color: #291014; color: #f87171; border-color: #dc2626; }
.btn-red:hover { background-color: #42161d; color: #ffffff; }

.btn-purple { background-color: #210d30; color: #c084fc; border-color: #9333ea; }
.btn-purple:hover { background-color: #381552; color: #ffffff; }

.btn-blue { background-color: #0a1b38; color: #60a5fa; border-color: #2563eb; }
.btn-blue:hover { background-color: #132d5c; color: #ffffff; }

.btn-amber { background-color: #2b1a06; color: #fbbf24; border-color: #d97706; }
.btn-amber:hover { background-color: #442a0b; color: #ffffff; }

.btn-indigo { background-color: #141336; color: #818cf8; border-color: #4f46e5; }
.btn-indigo:hover { background-color: #232159; color: #ffffff; }

.sistema-footer {
  width: 100%;
  text-align: center;
  padding: 1.5rem 1rem;
  border-top: 1px solid var(--sys-dark-border);
  background-color: var(--sys-dark-surface);
  color: #64748b;
  font-size: 0.85rem;
  margin-top: auto;
}

/* ==========================================================================
   Autenticação & Telas de Entrada
   ========================================================================== */
#auth-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  background: radial-gradient(circle at 50% 10%, #1e293b 0%, #0b0f19 80%);
}

.auth-card {
  background: var(--bg-card);
  width: 100%;
  max-width: 460px;
  padding: 2.5rem;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--border-color);
  animation: slideUp 0.3s ease-out;
}

.auth-brand {
  text-align: center;
  margin-bottom: 2rem;
}

.auth-logo-icon {
  margin-bottom: 0.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.auth-brand h2 {
  font-size: 1.6rem;
  margin-bottom: 0.25rem;
}

.auth-subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.demo-credentials-pill {
  background: #f0fdf4;
  border: 1px dashed #86efac;
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  margin-bottom: 1.5rem;
  font-size: 0.85rem;
}

.pill-title {
  display: block;
  font-weight: 600;
  color: #15803d;
  margin-bottom: 0.25rem;
}

.demo-click {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  cursor: pointer;
}

.btn-demo-autofill {
  background: #16a34a;
  color: white;
  border: none;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
}

.btn-demo-autofill:hover {
  background: #15803d;
}

.auth-form .form-group {
  margin-bottom: 1.25rem;
}

.btn-auth-submit {
  width: 100%;
  margin-top: 0.5rem;
}

.auth-switch-link {
  text-align: center;
  margin-top: 1.5rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* ==========================================================================
   Painel Administrativo AutoRisk (Layout & Header)
   ========================================================================== */
.admin-layout {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.admin-header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow-sm);
}

.btn-auth-back-hub {
  background: #0f172a;
  border: 1.5px solid #334155;
  color: #cbd5e1;
  font-family: 'Outfit', sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  cursor: pointer;
  margin-bottom: 1.5rem;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 0.6rem 1.15rem;
  border-radius: 9999px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  letter-spacing: 0.02em;
}

.btn-auth-back-hub:hover {
  background: #1e293b;
  border-color: #6366f1;
  color: #ffffff;
  transform: translateX(-3px);
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.35);
}

.btn-back-icon-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
}

.btn-auth-back-hub:hover .btn-back-icon-wrap,
.btn-back-hub:hover .btn-back-icon-wrap,
.btn-back-to-admin:hover .btn-back-icon-wrap {
  transform: translateX(-3px);
}

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

.btn-back-hub {
  background: #0b0f19;
  border: 1.5px solid #1e293b;
  color: #cbd5e1;
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 0.55rem 1.1rem;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  letter-spacing: 0.02em;
}

.btn-back-hub:hover {
  background: #151c2e;
  border-color: #38bdf8;
  color: #38bdf8;
  transform: translateX(-3px);
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.35);
}

.header-divider {
  width: 1px;
  height: 24px;
  background: var(--border-color);
  margin: 0 0.5rem;
}

.header-brand .logo-box {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-icon-svg {
  display: flex;
  align-items: center;
  justify-content: center;
}

.header-brand h2 {
  font-size: 1.2rem;
  line-height: 1.2;
}

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

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

.user-pill {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.user-avatar-icon {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
}

.user-info-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.user-info-text strong {
  font-size: 0.9rem;
}

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

/* Menu do Perfil (dropdown) */
.user-menu-wrap {
  position: relative;
}

.user-pill-trigger {
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-lg);
  padding: 0.4rem 0.6rem;
  cursor: pointer;
  transition: var(--transition);
}

.user-pill-trigger:hover {
  background: var(--bg-subtle);
  border-color: var(--border-color);
}

.user-dropdown {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  min-width: 230px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 0.4rem;
  display: none;
  z-index: 60;
  animation: slideUp 0.15s ease-out;
}

.user-dropdown.open {
  display: block;
}

.user-dropdown-header {
  padding: 0.7rem 0.85rem;
  margin-bottom: 0.25rem;
  border-bottom: 1px solid var(--border-color);
}

.user-dropdown-header strong {
  display: block;
  font-size: 0.9rem;
  color: var(--text-main);
}

.user-dropdown-header small {
  display: block;
  color: var(--text-muted);
  font-size: 0.75rem;
  margin-top: 0.15rem;
}

.user-dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  transition: var(--transition);
  font-family: 'Outfit', sans-serif;
}

.user-dropdown-item:hover {
  background: var(--bg-subtle);
}

.user-dropdown-danger {
  color: var(--danger);
}

.user-dropdown-danger:hover {
  background: var(--danger-bg);
}

.btn-logout {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.btn-logout:hover {
  background: var(--danger-bg);
  color: var(--danger);
  border-color: var(--danger-border);
}

.admin-main {
  flex: 1;
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* ==========================================================================
   Hero & Banner do Link Único Universal
   ========================================================================== */
.dashboard-hero-universal {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: 2rem;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
  border: 1px solid #334155;
  color: white;
  padding: 2.25rem 2.5rem;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  flex-wrap: wrap;
}

.hero-left {
  flex: 1;
  min-width: 320px;
}

.universal-badge-top {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: #0369a1;
  color: #e0f2fe;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  margin-bottom: 0.75rem;
  letter-spacing: 0.05em;
}

.dashboard-hero-universal h1 {
  color: white;
  font-size: 1.85rem;
  margin-bottom: 0.4rem;
}

.dashboard-hero-universal p {
  color: #94a3b8;
  font-size: 0.95rem;
  margin-bottom: 1.25rem;
}

.universal-link-box {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.universal-link-box input {
  background: #0b0f19;
  border: 1px solid #334155;
  color: #38bdf8;
  font-family: monospace;
  font-size: 0.9rem;
  padding: 0.65rem 1rem;
  border-radius: var(--radius-md);
  flex: 1;
  min-width: 260px;
}

.btn-wa-direct {
  background: #14532d;
  color: #4ade80;
  border: 1px solid #16a34a;
  padding: 0.65rem 1rem;
  border-radius: var(--radius-md);
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  transition: var(--transition);
}

.btn-wa-direct:hover {
  background: #166534;
  color: #ffffff;
}

.btn-preview-link {
  background: #1e293b;
  border: 1px solid #334155;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.btn-preview-link:hover {
  background: #334155;
}

.hero-right {
  display: flex;
  align-items: flex-end;
  align-self: flex-end;
}

.btn-cta-builder {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #0f172a;
  padding: 1rem 1.4rem;
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 1rem;
  text-align: left;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-cta-builder:hover {
  transform: translateY(-2px);
  border-color: #3b82f6;
  box-shadow: 0 8px 20px rgba(59, 130, 246, 0.2);
}

.builder-btn-icon {
  background: #eff6ff;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.builder-btn-text strong {
  display: block;
  font-size: 0.95rem;
  color: #1e293b;
}

.builder-btn-text small {
  display: block;
  font-size: 0.75rem;
  color: #64748b;
}

/* Construtor Centralizado */
.builder-centered-layout {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.universal-link-banner {
  background: #ffffff;
  border: 1px solid #bfdbfe;
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  box-shadow: var(--shadow-sm);
  flex-wrap: wrap;
}

.banner-badge {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: #1e40af;
  margin-bottom: 0.25rem;
}

.banner-text p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

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

.banner-link-input {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  color: #2563eb;
  font-size: 0.85rem;
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius-sm);
  width: 240px;
}

/* ==========================================================================
   KPI Cards / Métricas
   ========================================================================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2.5rem;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.icon-blue { background: #dbeafe; }
.icon-green { background: #d1fae5; }
.icon-amber { background: #fef3c7; }
.icon-purple { background: #ede9fe; }

.stat-details {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.stat-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-value {
  font-family: 'Outfit', sans-serif;
  font-size: 1.75rem;
  font-weight: 800;
  color: #ffffff;
  line-height: 1.2;
}

.stat-sub {
  font-size: 0.8rem;
  color: var(--text-light);
  margin-top: 0.2rem;
}

/* ==========================================================================
   Tabela & Gerenciamento de Formulários
   ========================================================================== */
.forms-management-section {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.section-toolbar {
  padding: 1.25rem 1.75rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.toolbar-left {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.toolbar-left h3 {
  font-size: 1.25rem;
}

.filter-tabs {
  display: flex;
  background: var(--bg-subtle);
  padding: 0.25rem;
  border-radius: var(--radius-md);
  gap: 0.25rem;
}

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

.tab-btn.active {
  background: var(--bg-card);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.search-box {
  position: relative;
  min-width: 280px;
}

.search-icon {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  color: var(--text-muted);
}

.search-box input {
  width: 100%;
  padding: 0.55rem 1rem 0.55rem 2.25rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  outline: none;
  transition: var(--transition);
}

.search-box input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

/* Tabela Customizada */
.table-responsive {
  overflow-x: auto;
}

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

.custom-table th {
  background: #f8fafc;
  padding: 0.85rem 1.5rem;
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border-color);
}

.custom-table td {
  padding: 1.1rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}

.custom-table tbody tr:hover {
  background-color: #f8fafc;
}

.client-cell {
  display: flex;
  flex-direction: column;
}

.client-name {
  font-size: 0.95rem;
  color: var(--text-main);
}

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

.vehicle-tag {
  background: var(--bg-subtle);
  padding: 0.3rem 0.65rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
}

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

/* Paginação da tabela de respostas */
.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-color);
}

.pagination-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1.1rem;
  font-weight: 600;
  cursor: pointer;
}

.pagination-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

.pagination-info {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
  text-align: center;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.badge-success {
  background: var(--success-bg);
  color: #065f46;
  border: 1px solid var(--success-border);
}

.badge-warning {
  background: var(--warning-bg);
  color: #92400e;
  border: 1px solid var(--warning-border);
}

.badge .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

/* Risk Pill */
.risk-score-pill {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-md);
  line-height: 1.1;
}

.risk-score-pill strong {
  font-size: 0.95rem;
}

.risk-score-pill small {
  font-size: 0.65rem;
  font-weight: 800;
}

/* Status do Laudo ao lado do Score de Risco */
.risk-cell-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.score-baixo {
  background: #d1fae5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.score-moderado {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
}

.score-medio {
  background: #ffedd5;
  color: #9a3412;
  border: 1px solid #fdba74;
}

.score-alto {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

/* Status do Laudo (Pendente / Confirmado) */
.score-label-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
}

.report-status {
  display: inline-block;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.report-status.status-completed {
  background: #d1fae5;
  color: #065f46;
}

.report-status.status-pending {
  background: #fef3c7;
  color: #92400e;
}

/* Ações na Tabela */
.table-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.4rem;
}

.btn-icon-action {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  padding: 0.45rem 0.65rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-main);
  text-decoration: none;
}

.btn-icon-action:hover {
  background: #e2e8f0;
  transform: translateY(-1px);
}

.btn-icon-action.btn-wa:hover {
  background: #f0fdf4;
  border-color: #86efac;
}

.btn-icon-action.btn-delete:hover {
  background: var(--danger-bg);
  color: var(--danger);
  border-color: var(--danger-border);
}

.btn-action-view {
  background: var(--primary-light);
  color: var(--primary);
  border: 1px solid var(--primary-border);
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.btn-action-view:hover {
  background: var(--primary);
  color: white;
}

.empty-table-state {
  text-align: center;
  padding: 4rem 2rem;
}

.empty-icon-svg {
  margin-bottom: 0.75rem;
  display: inline-flex;
}

.empty-table-state h4 {
  font-size: 1.2rem;
  margin-bottom: 0.25rem;
}

.empty-table-state p {
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

/* ==========================================================================
   Modais & Overlays
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  z-index: 100;
  animation: fadeIn 0.2s ease-out;
}

.modal-card {
  background: var(--bg-card);
  width: 100%;
  max-width: 560px;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-card.modal-lg {
  max-width: 800px;
}

.modal-card.modal-highlight {
  max-width: 520px;
}

.modal-header {
  padding: 1.5rem 1.75rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title-group {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.modal-badge-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.modal-badge-icon.icon-success {
  background: #dcfce7;
}

.modal-title-group h3 {
  font-size: 1.2rem;
  line-height: 1.2;
}

.modal-title-group p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.btn-close-modal {
  background: transparent;
  border: none;
  font-size: 1.25rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.25rem;
}

.modal-form {
  padding: 1.5rem 1.75rem;
  overflow-y: auto;
}

.modal-footer {
  padding: 1rem 1.75rem;
  background: #f8fafc;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* Modal de Compartilhamento / Link Criado */
.share-content-body {
  padding: 1.75rem;
}

.link-display-box {
  margin-bottom: 1.5rem;
}

.link-display-box label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.input-with-button {
  display: flex;
  gap: 0.5rem;
}

.input-with-button input {
  flex: 1;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  padding: 0.65rem 1rem;
  border-radius: var(--radius-md);
  font-family: monospace;
  font-size: 0.9rem;
  color: var(--text-main);
}

.share-actions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.btn-share-wa, .btn-share-preview {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  background: var(--bg-subtle);
  cursor: pointer;
  text-align: left;
  transition: var(--transition);
  text-decoration: none;
  color: var(--text-main);
}

.btn-share-wa:hover {
  background: #f0fdf4;
  border-color: #86efac;
}

.btn-share-preview:hover {
  background: #eff6ff;
  border-color: #bfdbfe;
}

.btn-share-wa strong, .btn-share-preview strong {
  display: block;
  font-size: 0.9rem;
}

.btn-share-wa small, .btn-share-preview small {
  color: var(--text-muted);
  font-size: 0.75rem;
}

/* ==========================================================================
   Relatório de Risco (Modal & Impressão)
   ========================================================================== */
.report-content-scroll {
  padding: 1.75rem;
  overflow-y: auto;
}

.risk-score-banner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius-lg);
  margin-bottom: 1.5rem;
}

.risk-score-banner.level-baixo {
  background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
  border: 1px solid #86efac;
  color: #14532d;
}

.risk-score-banner.level-moderado {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border: 1px solid #fcd34d;
  color: #78350f;
}

.risk-score-banner.level-medio {
  background: linear-gradient(135deg, #ffedd5 0%, #fed7aa 100%);
  border: 1px solid #fdba74;
  color: #7c2d12;
}

.risk-score-banner.level-alto {
  background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
  border: 1px solid #fca5a5;
  color: #7f1d1d;
}

.score-number-box {
  background: white;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md);
  text-align: center;
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}

.score-number-box .score-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
}

.score-number-box .score-val {
  font-family: 'Outfit', sans-serif;
  font-size: 2.2rem;
  font-weight: 800;
  line-height: 1;
}

.score-number-box .score-val small {
  font-size: 1rem;
  color: var(--text-muted);
}

.risk-level-tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  background: rgba(0,0,0,0.08);
  margin-bottom: 0.25rem;
}

.factors-section {
  margin-bottom: 1.5rem;
}

.factors-section h4 {
  font-size: 1rem;
  margin-bottom: 0.75rem;
}

.factors-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.factor-item {
  background: var(--bg-subtle);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  font-size: 0.85rem;
}

.factor-item strong {
  display: block;
  font-size: 0.85rem;
  margin-bottom: 0.15rem;
}

.factor-item p {
  color: var(--text-muted);
  font-size: 0.75rem;
  line-height: 1.3;
}

.factor-positive { border-left: 4px solid var(--success); }
.factor-neutral, .factor-attention { border-left: 4px solid var(--warning); }
.factor-negative { border-left: 4px solid var(--danger); }

.answers-review-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.review-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.review-box-header {
  background: #f8fafc;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 0.9rem;
}

.review-rows {
  padding: 0.75rem 1rem;
}

.r-row {
  display: flex;
  justify-content: space-between;
  padding: 0.4rem 0;
  border-bottom: 1px dashed var(--border-color);
  font-size: 0.85rem;
  gap: 0.5rem;
}

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

.r-k {
  color: var(--text-muted);
}

.r-v {
  text-align: right;
}

.highlight-alert {
  color: var(--danger);
  font-weight: 700;
}

.internal-notes-box {
  background: #fdf2f8;
  border: 1px solid #fbcfe8;
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  font-size: 0.85rem;
}

.internal-notes-box h6 {
  color: #9d174d;
  font-size: 0.8rem;
  margin-bottom: 0.25rem;
}

/* ==========================================================================
   Form Controls, Inputs & Botões Globais
   ========================================================================== */
.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 0.4rem;
}

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

.form-group input, 
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 0.65rem 0.9rem;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--text-main);
  background-color: var(--bg-card);
  transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.btn-primary {
  background: var(--primary);
  color: white;
  border: none;
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 0.95rem;
}

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-subtle);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.btn-secondary:hover {
  background: #e2e8f0;
}

.btn-print {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.btn-print:hover {
  background: #e2e8f0;
}

/* ==========================================================================
   Toasts & Animações
   ========================================================================== */
#toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.custom-toast {
  background: #1e293b;
  color: white;
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xl);
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  max-width: 380px;
  border: 1px solid #334155;
}

.custom-toast.toast-success {
  background: #064e3b;
  border-color: #10b981;
}

.custom-toast.toast-error {
  background: #7f1d1d;
  border-color: #ef4444;
}

.toast-icon-svg {
  display: flex;
  align-items: center;
}

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

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

.fade-out {
  opacity: 0;
  transform: translateY(-8px);
  transition: all 0.3s ease;
}

/* ==========================================================================
   Construtor & Editor de Perguntas (Form Builder)
   ========================================================================== */
.builder-layout {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: #f1f5f9;
}

.builder-header {
  background: #ffffff;
  border-bottom: 1px solid var(--border-color);
  padding: 0.9rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow-sm);
  gap: 1rem;
  flex-wrap: wrap;
}

.builder-header-left {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.btn-back-to-admin {
  background: #0b0f19;
  border: 1.5px solid #1e293b;
  color: #cbd5e1;
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 0.55rem 1.1rem;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  letter-spacing: 0.02em;
}

.btn-back-to-admin:hover {
  background: #151c2e;
  border-color: #38bdf8;
  color: #38bdf8;
  transform: translateX(-3px);
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.35);
}

.builder-title-box h2 {
  font-size: 1.15rem;
  line-height: 1.2;
}

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

.builder-header-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.builder-tab-switch {
  display: flex;
  background: #f1f5f9;
  padding: 0.25rem;
  border-radius: var(--radius-md);
  gap: 0.25rem;
}

.builder-tab-btn {
  background: transparent;
  border: none;
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.builder-tab-btn.active {
  background: #ffffff;
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.btn-save-builder {
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

/* Área Principal do Builder */
.builder-main {
  flex: 1;
  max-width: 1320px;
  width: 100%;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.builder-grid-layout {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 1.75rem;
  align-items: flex-start;
}

/* Sidebar de Metadados do Segurado */
.builder-sidebar-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 80px;
}

.sidebar-card-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-color);
}

.sidebar-card-header h3 {
  font-size: 1.05rem;
  color: #1e293b;
}

.sidebar-form-fields .form-group {
  margin-bottom: 1rem;
}

.field-hint {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* Título de seção dentro de modais (ex.: Alterar Senha / E-mail) */
.form-section-title {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin: 0 0 0.85rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border-color);
}

.form-section-title + .form-group,
.form-section-title:not(:first-child) {
  margin-top: 1rem;
}

.form-group input:disabled {
  background: var(--bg-subtle);
  color: var(--text-muted);
  cursor: not-allowed;
  opacity: 0.85;
}

/* Área Central das Seções */
.builder-sections-area {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.sections-top-info {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.sections-top-info h3 {
  font-size: 1.15rem;
  margin-bottom: 0.2rem;
}

.sections-top-info p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.builder-section-box {
  background: #ffffff;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.section-box-header {
  background: #f8fafc;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.section-header-title {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.sec-icon-wrap {
  display: flex;
  align-items: center;
  background: #eff6ff;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  justify-content: center;
}

.section-header-title h4 {
  font-size: 1.1rem;
  color: #1e293b;
}

.sec-fields-count {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  background: #e2e8f0;
  padding: 0.15rem 0.55rem;
  border-radius: 9999px;
}

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

.btn-icon-sm {
  background: #ffffff;
  border: 1px solid var(--border-color);
  padding: 0.35rem 0.6rem;
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
}

.btn-icon-sm:hover {
  background: #e2e8f0;
}

.btn-delete-sm:hover {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #dc2626;
}

/* Lista de Perguntas */
.questions-list {
  padding: 1rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.question-row-item {
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: var(--transition);
}

.question-row-item:hover {
  border-color: #93c5fd;
  background: #ffffff;
  box-shadow: var(--shadow-sm);
}

.q-order-badge {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #e2e8f0;
  color: #334155;
  font-weight: 700;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.q-content {
  flex: 1;
}

.q-label-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-bottom: 0.2rem;
}

.q-label-text {
  font-size: 0.95rem;
  color: #0f172a;
}

.q-badge-req {
  font-size: 0.65rem;
  font-weight: 700;
  background: #fee2e2;
  color: #991b1b;
  padding: 0.1rem 0.45rem;
  border-radius: 4px;
}

.q-badge-opt {
  font-size: 0.65rem;
  font-weight: 600;
  background: #f1f5f9;
  color: #64748b;
  padding: 0.1rem 0.45rem;
  border-radius: 4px;
}

.q-badge-type {
  font-size: 0.65rem;
  font-weight: 700;
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
  padding: 0.1rem 0.45rem;
  border-radius: 4px;
}

.q-meta-preview {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.q-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.btn-q-action {
  background: #ffffff;
  border: 1px solid var(--border-color);
  padding: 0.35rem 0.55rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 600;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.btn-q-action:hover:not(:disabled) {
  background: #e2e8f0;
}

.btn-q-action:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.btn-q-edit {
  color: var(--primary);
  border-color: #bfdbfe;
}

.btn-q-edit:hover {
  background: #eff6ff;
}

.btn-q-delete:hover {
  background: #fee2e2;
  color: #dc2626;
  border-color: #fca5a5;
}

.section-box-footer {
  padding: 0.75rem 1.5rem 1.25rem 1.5rem;
}

.btn-add-question-dashed {
  width: 100%;
  background: #f8fafc;
  border: 1.5px dashed #cbd5e1;
  padding: 0.75rem;
  border-radius: var(--radius-md);
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--primary);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}

.btn-add-question-dashed:hover {
  background: #eff6ff;
  border-color: #3b82f6;
}

/* Editor de Opções de Seleção */
.options-editor-box {
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-top: 0.5rem;
}

.options-editor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.options-editor-header label {
  font-size: 0.85rem;
  font-weight: 700;
  color: #1e293b;
  margin: 0;
}

.options-rows-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 180px;
  overflow-y: auto;
}

.option-edit-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.option-edit-row input {
  padding: 0.45rem 0.75rem;
  font-size: 0.85rem;
}

/* Pré-visualização do Cliente */
.builder-preview-wrapper {
  max-width: 760px;
  margin: 0 auto;
}

.preview-notice-banner {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.85rem;
  color: #1e40af;
  margin-bottom: 1.5rem;
}

.preview-fields-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.field-half {
  flex: 1 1 calc(50% - 0.5rem);
  min-width: 240px;
}

.field-full {
  flex: 1 1 100%;
}

.form-fields-dynamic-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

/* ==========================================================================
   Regras de Impressão (PDF / Impressora)
   ========================================================================== */
@media print {
  body {
    background: #fff;
    color: #000;
  }

  /* Esconde o dashboard (banner, KPIs, tabela) para imprimir somente o laudo */
  .admin-layout {
    display: none !important;
  }

  .admin-header,
  .btn-logout,
  .btn-print,
  .btn-close-modal,
  .modal-footer,
  .modal-header-actions,
  #toast-container {
    display: none !important;
  }

  /* Faz o modal do laudo ocupar a página sem recortes */
  .modal-backdrop {
    position: static !important;
    background: none !important;
    padding: 0 !important;
    backdrop-filter: none !important;
  }

  .modal-card {
    box-shadow: none !important;
    border: none !important;
    border-radius: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
    max-height: none !important;
    overflow: visible !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .report-content-scroll {
    overflow: visible !important;
    max-height: none !important;
  }
}

/* Responsividade Mobile */
@media (max-width: 900px) {
  .sistema-modules-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  }
}

@media (max-width: 768px) {
  .sistema-topbar {
    padding: 0.8rem 1rem;
    flex-wrap: wrap;
  }
  .topbar-center {
    order: 3;
    max-width: 100%;
    width: 100%;
  }
  .admin-header {
    padding: 1rem;
    flex-wrap: wrap;
    gap: 0.75rem;
  }
  .dashboard-hero {
    flex-direction: column;
    align-items: flex-start;
    padding: 1.5rem;
  }
  .form-grid-2, .factors-list, .answers-review-grid, .share-actions-grid {
    grid-template-columns: 1fr;
  }
  .section-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .search-box {
    width: 100%;
  }
}

/* ==========================================================================
   Telas de Módulos Isolados (/Seguros, /RH, /Checklist)
   ========================================================================== */
.module-standalone-wrapper {
  min-height: 100vh;
  width: 100%;
  background: radial-gradient(circle at 50% 15%, #161f30 0%, #0b0f19 75%);
  color: var(--sys-text-bright);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.module-nav-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 2rem;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--sys-dark-border);
}

.btn-module-back {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid var(--sys-dark-border);
  color: #cbd5e1;
  font-weight: 600;
  font-size: 0.875rem;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition);
}

.btn-module-back:hover {
  background: rgba(51, 65, 85, 0.9);
  color: #ffffff;
  border-color: #475569;
  transform: translateX(-2px);
}

.module-nav-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.05rem;
  color: #94a3b8;
}

.module-nav-brand strong {
  color: #f8fafc;
}

.route-pill {
  font-size: 0.75rem;
  font-family: monospace;
  background: #020617;
  color: #38bdf8;
  padding: 0.35rem 0.75rem;
  border-radius: 20px;
  border: 1px solid #1e293b;
}

.module-content-main {
  flex: 1;
  max-width: 980px;
  width: 100%;
  margin: 0 auto;
  padding: 3rem 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.module-showcase-card {
  width: 100%;
  background: var(--sys-dark-card);
  border-radius: 20px;
  padding: 3rem 2.5rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  border: 1.5px solid var(--sys-dark-border);
  box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.7);
  animation: slideUp 0.35s ease-out;
}

.showcase-amber {
  border-color: rgba(245, 158, 11, 0.3);
}

.showcase-indigo {
  border-color: rgba(99, 102, 241, 0.3);
}

.module-icon-large {
  width: 88px;
  height: 88px;
  border-radius: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
}

.icon-amber-glow {
  background: radial-gradient(circle, rgba(245, 158, 11, 0.2) 0%, rgba(245, 158, 11, 0.05) 100%);
  border: 2px solid rgba(245, 158, 11, 0.4);
  box-shadow: 0 0 25px rgba(245, 158, 11, 0.2);
}

.icon-indigo-glow {
  background: radial-gradient(circle, rgba(99, 102, 241, 0.2) 0%, rgba(99, 102, 241, 0.05) 100%);
  border: 2px solid rgba(99, 102, 241, 0.4);
  box-shadow: 0 0 25px rgba(99, 102, 241, 0.2);
}

.module-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  padding: 0.35rem 0.9rem;
  border-radius: 20px;
  margin-bottom: 1.25rem;
}

.badge-amber-glow {
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.badge-indigo-glow {
  color: #818cf8;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.4);
}

.pulse-dot-amber, .pulse-dot-indigo {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  animation: pulseDot 1.5s infinite;
}

.pulse-dot-amber { background-color: #fbbf24; }
.pulse-dot-indigo { background-color: #818cf8; }

@keyframes pulseDot {
  0% { transform: scale(0.95); opacity: 0.6; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.6; }
}

.module-title {
  font-size: 2.2rem;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 0.75rem;
}

.module-subtitle {
  max-width: 680px;
  color: var(--sys-text-muted);
  font-size: 1.05rem;
  line-height: 1.5;
  margin-bottom: 2.5rem;
}

.module-features-preview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.25rem;
  width: 100%;
  margin-bottom: 2.5rem;
  text-align: left;
}

.preview-card {
  background: #0b1120;
  border: 1px solid #1e293b;
  border-radius: 12px;
  padding: 1.25rem;
  transition: var(--transition);
}

.preview-card:hover {
  border-color: #334155;
  transform: translateY(-3px);
}

.preview-icon {
  margin-bottom: 0.75rem;
}

.preview-card h4 {
  font-size: 0.95rem;
  font-weight: 700;
  color: #f1f5f9;
  margin-bottom: 0.4rem;
}

.preview-card p {
  font-size: 0.8rem;
  color: #94a3b8;
  line-height: 1.4;
}

.module-actions-bar {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
}

.btn-amber-solid {
  background-color: #d97706;
  color: #ffffff;
  border: none;
}
.btn-amber-solid:hover {
  background-color: #b45309;
}

.btn-outline-amber {
  background: transparent;
  color: #fbbf24;
  border: 1px solid #d97706;
}
.btn-outline-amber:hover {
  background: rgba(245, 158, 11, 0.15);
  color: #ffffff;
}

.btn-indigo-solid {
  background-color: #4f46e5;
  color: #ffffff;
  border: none;
}
.btn-indigo-solid:hover {
  background-color: #4338ca;
}

.btn-outline-indigo {
  background: transparent;
  color: #818cf8;
  border: 1px solid #4f46e5;
}
.btn-outline-indigo:hover {
  background: rgba(99, 102, 241, 0.15);
  color: #ffffff;
}

.btn-back-to-hub {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: #1e293b;
  border: 1px solid #334155;
  color: #94a3b8;
  padding: 0.45rem 0.85rem;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.btn-back-to-hub:hover {
  background: #334155;
  color: #ffffff;
}

/* ==========================================================================
   Prisma Studio & Database Admin (/Admin)
   ========================================================================== */
.admin-db-footer-link {
  color: #38bdf8;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  transition: var(--transition);
}
.admin-db-footer-link:hover {
  color: #7dd3fc;
  text-decoration: underline;
}

/* Master Login */
.prisma-login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  background: radial-gradient(circle at 50% 15%, #0f2744 0%, #080d1a 80%);
}

.prisma-login-card {
  background: #0f172a;
  border: 1.5px solid #1e293b;
  border-radius: 20px;
  width: 100%;
  max-width: 480px;
  padding: 2.5rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
  position: relative;
}

.prisma-brand-header {
  text-align: center;
  margin-top: 1rem;
  margin-bottom: 2rem;
}

.prisma-logo-box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  filter: drop-shadow(0 0 15px rgba(56, 189, 248, 0.4));
}

.prisma-brand-header h2 {
  font-size: 1.6rem;
  color: #ffffff;
  margin-bottom: 0.35rem;
}

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

.prisma-conn-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.7rem;
  font-family: monospace;
  background: #020617;
  color: #38bdf8;
  border: 1px solid #1e293b;
  padding: 0.3rem 0.75rem;
  border-radius: 20px;
}

.pulse-dot-green {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: #10b981;
  box-shadow: 0 0 8px #10b981;
}

.btn-prisma-connect {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #ffffff;
  border: none;
  font-weight: 700;
  width: 100%;
  padding: 0.75rem 1.25rem;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.35);
  margin-top: 1.25rem;
}

.prisma-login-card .form-group {
  margin-bottom: 1.25rem;
}

.prisma-login-card .form-group label {
  color: #e2e8f0 !important;
  font-size: 0.875rem;
  font-weight: 600;
  display: block;
  margin-bottom: 0.45rem;
  text-align: left;
}

.prisma-login-card .form-group label .required {
  color: #ef4444;
}

.prisma-login-card .form-group input {
  background: #020617 !important;
  border: 1.5px solid #1e293b !important;
  border-radius: 8px !important;
  color: #ffffff !important;
  padding: 0.75rem 1rem !important;
  font-size: 0.95rem;
  width: 100%;
  transition: var(--transition);
}

.prisma-login-card .form-group input:focus {
  outline: none;
  border-color: #38bdf8 !important;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.18) !important;
  background: #0b1120 !important;
}

.btn-prisma-connect:hover {
  background: linear-gradient(135deg, #0369a1 0%, #075985 100%);
  transform: translateY(-1px);
}

.prisma-footer-info {
  margin-top: 1.5rem;
  text-align: center;
  font-size: 0.75rem;
  color: #64748b;
}

.input-error-shake {
  animation: shake 0.4s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
  border-color: #ef4444 !important;
}

@keyframes shake {
  10%, 90% { transform: translate3d(-1px, 0, 0); }
  20%, 80% { transform: translate3d(2px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
  40%, 60% { transform: translate3d(4px, 0, 0); }
}

/* Prisma Studio Dashboard */
.prisma-studio-wrapper {
  min-height: 100vh;
  background-color: #090d16;
  color: #f1f5f9;
  display: flex;
  flex-direction: column;
}

.prisma-topbar {
  background: #0f172a;
  border-bottom: 1px solid #1e293b;
  padding: 0.75rem 1.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}

.prisma-topbar-left {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.prisma-logo-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.15rem;
  color: #ffffff;
  cursor: pointer;
}

.version-tag {
  background: #1e293b;
  color: #38bdf8;
  font-size: 0.65rem;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  margin-left: 0.25rem;
}

.prisma-env-tag {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: #94a3b8;
  background: #020617;
  border: 1px solid #1e293b;
  padding: 0.25rem 0.65rem;
  border-radius: 6px;
}

.status-indicator-green {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
}

.prisma-topbar-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.btn-topbar-action {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: #1e293b;
  border: 1px solid #334155;
  color: #cbd5e1;
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.btn-topbar-action:hover {
  background: #334155;
  color: #ffffff;
}

.btn-danger-action:hover {
  background: #7f1d1d;
  color: #fca5a5;
  border-color: #991b1b;
}

/* Studio Layout */
.prisma-body-layout {
  display: flex;
  flex: 1;
}

.prisma-sidebar {
  width: 260px;
  background: #0c1220;
  border-right: 1px solid #1e293b;
  padding: 1.5rem 1rem;
  display: flex;
  flex-direction: column;
}

.sidebar-section-title {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #64748b;
  padding: 0 0.5rem;
  margin-bottom: 0.5rem;
}

.prisma-nav-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.prisma-nav-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 0.75rem;
  border-radius: 6px;
  font-size: 0.85rem;
  color: #94a3b8;
  cursor: pointer;
  transition: var(--transition);
}

.prisma-nav-list li:hover {
  background: #1e293b;
  color: #f8fafc;
}

.prisma-nav-list li.active {
  background: #0284c7;
  color: #ffffff;
  font-weight: 600;
}

.nav-icon {
  display: inline-flex;
  align-items: center;
  margin-right: 0.6rem;
}

.nav-label {
  flex: 1;
}

.badge-count {
  font-size: 0.7rem;
  background: rgba(0, 0, 0, 0.35);
  padding: 0.1rem 0.45rem;
  border-radius: 12px;
  color: inherit;
}

.sidebar-footer-card {
  margin-top: auto;
  background: #020617;
  border: 1px solid #1e293b;
  border-radius: 8px;
  padding: 0.75rem;
  font-size: 0.75rem;
}

.sf-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.25rem;
  color: #94a3b8;
}

.sf-row strong {
  color: #f1f5f9;
}

/* Conteúdo Principal */
.prisma-main-content {
  flex: 1;
  padding: 2rem 2.5rem;
  overflow-y: auto;
}

.pane-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 2rem;
  gap: 1rem;
}

.pane-header h2 {
  font-size: 1.5rem;
  color: #ffffff;
  margin-bottom: 0.25rem;
}

.pane-subtitle {
  font-size: 0.85rem;
  color: #94a3b8;
}

.btn-prisma-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: #0284c7;
  color: #ffffff;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.825rem;
  cursor: pointer;
  transition: var(--transition);
}

.btn-prisma-primary:hover {
  background: #0369a1;
}

.btn-prisma-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: #1e293b;
  border: 1px solid #334155;
  color: #cbd5e1;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.825rem;
  cursor: pointer;
  transition: var(--transition);
}

.btn-prisma-secondary:hover {
  background: #334155;
  color: #ffffff;
}

/* Grid de Módulos Admin */
.modules-admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  gap: 1.5rem;
}

.module-admin-card {
  background: #0f172a;
  border: 1.5px solid #1e293b;
  border-radius: 12px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
}

.card-glow-cyan { border-color: rgba(2, 132, 199, 0.35); }
.card-glow-indigo { border-color: rgba(99, 102, 241, 0.35); }
.card-glow-amber { border-color: rgba(245, 158, 11, 0.35); }

.mac-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.mac-icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mac-info {
  flex: 1;
}

.mac-info h3 {
  font-size: 1.1rem;
  color: #ffffff;
  margin-bottom: 0.15rem;
}

.route-code {
  font-size: 0.75rem;
  font-family: monospace;
  color: #94a3b8;
}

.mac-status-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.25rem 0.6rem;
  border-radius: 20px;
}

.status-active { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }
.status-maintenance { background: rgba(245, 158, 11, 0.15); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.3); }
.status-coming { background: rgba(99, 102, 241, 0.15); color: #818cf8; border: 1px solid rgba(99, 102, 241, 0.3); }

.mac-desc {
  font-size: 0.825rem;
  color: #94a3b8;
  margin-bottom: 1.25rem;
  line-height: 1.4;
  flex: 1;
}

.mac-status-selector label {
  font-size: 0.75rem;
  font-weight: 700;
  color: #cbd5e1;
  display: block;
  margin-bottom: 0.4rem;
}

.status-options-group {
  display: flex;
  gap: 0.4rem;
  background: #020617;
  padding: 0.35rem;
  border-radius: 8px;
  border: 1px solid #1e293b;
}

.btn-status-toggle {
  flex: 1;
  background: transparent;
  border: none;
  color: #64748b;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.35rem 0.4rem;
  border-radius: 4px;
  cursor: pointer;
  transition: var(--transition);
}

.btn-status-toggle:hover {
  color: #f1f5f9;
}

.btn-status-toggle.active-btn.btn-act-green {
  background: #064e3b;
  color: #34d399;
}
.btn-status-toggle.active-btn.btn-act-amber {
  background: #78350f;
  color: #fbbf24;
}
.btn-status-toggle.active-btn.btn-act-indigo {
  background: #312e81;
  color: #a5b4fc;
}

.mac-footer {
  margin-top: 1.25rem;
  padding-top: 0.75rem;
  border-top: 1px solid #1e293b;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
  color: #64748b;
}

.btn-link-action {
  color: #38bdf8;
  font-weight: 600;
  text-decoration: none;
}
.btn-link-action:hover {
  text-decoration: underline;
}

/* Tabelas Prisma */
.prisma-table-container {
  background: #0f172a;
  border: 1px solid #1e293b;
  border-radius: 8px;
  overflow-x: auto;
}

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

.prisma-table th {
  background: #0c1322;
  color: #94a3b8;
  font-weight: 700;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #1e293b;
}

.prisma-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #1e293b;
  color: #cbd5e1;
}

.prisma-table tr:hover td {
  background: #1e293b;
}

.token-pill {
  font-family: monospace;
  background: #020617;
  color: #38bdf8;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  border: 1px solid #1e293b;
}

.pwd-mask {
  font-family: monospace;
  color: #64748b;
}

.btn-table-action {
  background: #1e293b;
  border: 1px solid #334155;
  color: #94a3b8;
  padding: 0.35rem 0.55rem;
  border-radius: 4px;
  cursor: pointer;
  transition: var(--transition);
}

.btn-table-action:hover {
  background: #38bdf8;
  color: #0f172a;
}

.btn-delete-row:hover {
  background: #ef4444 !important;
  color: #ffffff !important;
  border-color: #dc2626 !important;
}

.row-action-btns {
  display: flex;
  gap: 0.35rem;
}

/* Code Viewer & Schema */
.prisma-code-block {
  background: #020617;
  border: 1px solid #1e293b;
  border-radius: 8px;
  padding: 1.5rem;
  overflow-x: auto;
}

.prisma-code-block pre {
  margin: 0;
  font-family: 'Fira Code', Consolas, monospace;
  font-size: 0.825rem;
  color: #38bdf8;
  line-height: 1.5;
}

/* Stats Cards */
.stats-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.25rem;
}

.stat-card {
  background: #0f172a;
  border: 1px solid #1e293b;
  border-radius: 10px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
}

.sc-label {
  font-size: 0.75rem;
  color: #94a3b8;
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.sc-val {
  font-size: 1.8rem;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 0.2rem;
}

.stat-card small {
  font-size: 0.7rem;
  color: #64748b;
}

.danger-zone-card {
  background: #1f1215;
  border: 1.5px solid #7f1d1d;
  border-radius: 10px;
  padding: 1.5rem;
}

.danger-zone-card h3 {
  color: #fca5a5;
  font-size: 1rem;
  margin-bottom: 0.4rem;
}

.danger-zone-card p {
  font-size: 0.825rem;
  color: #fca5a5;
  opacity: 0.85;
  margin-bottom: 1.25rem;
}

.btn-danger-solid {
  background: #dc2626;
  color: #ffffff;
  border: none;
  padding: 0.6rem 1.2rem;
  border-radius: 6px;
  font-weight: 700;
  font-size: 0.825rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: var(--transition);
}

.btn-danger-solid:hover {
  background: #b91c1c;
}

/* Card de Backup & Restauração */
.backup-zone-card {
  background: #0c1622;
  border: 1.5px solid #0e7490;
  border-radius: 10px;
  padding: 1.5rem;
}

.backup-zone-card h3 {
  color: #67e8f9;
  font-size: 1rem;
  margin-bottom: 0.4rem;
}

.backup-zone-card p {
  font-size: 0.825rem;
  color: #94a3b8;
  margin-bottom: 1.25rem;
  line-height: 1.5;
}

.backup-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* Aba Personalização do Hub */
.customize-bg-preview {
  background: #020617;
  border: 1px solid #1e293b;
  border-radius: 10px;
  min-height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin-bottom: 1.5rem;
}

.customize-bg-preview img {
  width: 100%;
  height: 240px;
  object-fit: cover;
  display: block;
}

.customize-media-preview {
  width: 100%;
  height: 240px;
  object-fit: cover;
  display: block;
  background: #020617;
}

.customize-bg-preview.has-error {
  border-color: #7f1d1d;
}

.customize-bg-empty {
  color: #64748b;
  font-size: 0.85rem;
  padding: 2rem;
  text-align: center;
}

.customize-card {
  background: #0c1622;
  border: 1.5px solid #1e293b;
  border-radius: 10px;
  padding: 1.5rem;
  margin-bottom: 1.25rem;
}

.customize-card h3 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #e2e8f0;
  font-size: 0.95rem;
  margin-bottom: 0.4rem;
}

.customize-card p {
  font-size: 0.825rem;
  color: #94a3b8;
  margin-bottom: 1rem;
  line-height: 1.5;
}

.customize-url-row {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.customize-url-row .prisma-text-input {
  flex: 1;
  min-width: 260px;
}

.prisma-text-input {
  background: #020617;
  border: 1px solid #334155;
  border-radius: 6px;
  color: #e2e8f0;
  font-family: 'Outfit', sans-serif;
  font-size: 0.85rem;
  padding: 0.55rem 0.8rem;
  outline: none;
  transition: var(--transition);
}

.prisma-text-input:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
}

/* ==========================================================================
   Controle de Acesso por Módulo (Usuários) & Formulário do Prisma Admin
   ========================================================================== */

/* Coluna de módulos na tabela de usuários */
.module-tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.module-tag {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  background: #0e7490;
  color: #ffffff;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

/* Grade de checkboxes de módulos no modal (tema claro do modal) */
.module-access-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.65rem;
}

.module-check {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
  cursor: pointer;
  transition: var(--transition);
}

.module-check:hover {
  border-color: #38bdf8;
  background: #eff6ff;
}

.module-check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #0284c7;
  cursor: pointer;
  flex-shrink: 0;
}

.module-check span {
  font-weight: 700;
  font-size: 0.8rem;
  color: #0f172a;
}

.module-check small {
  display: block;
  width: 100%;
  font-size: 0.68rem;
  color: #64748b;
}

/* Duas colunas no formulário do modal */
.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

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

/* Aviso de "nenhum módulo liberado" no Hub */
.hub-no-access-banner {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem;
  border: 1px dashed #f59e0b;
  border-radius: var(--radius-lg);
  background: rgba(245, 158, 11, 0.08);
  color: #fbbf24;
  max-width: 560px;
  margin: 0 auto;
}

.hub-no-access-banner strong {
  font-size: 1rem;
  display: block;
  margin-bottom: 0.25rem;
}

.hub-no-access-banner p {
  margin: 0;
  font-size: 0.85rem;
  color: #94a3b8;
}

