/* ==========================================================================
   COPSOQ III — DESIGN SYSTEM
   Sistema de Avaliação de Riscos Psicossociais (NR 1)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@500;600;700;800&family=Poppins:wght@300;400;500;600&display=swap');

:root {
  /* Light Mode (Default) - Treeade Theme */
  --bg-primary: #f4f7f6;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f9fafa;
  --bg-input: #ffffff;
  --bg-input-focus: #f4f7f6;

  --border-color: rgba(27, 58, 92, 0.08);
  --border-hover: rgba(27, 58, 92, 0.15);
  --border-input: rgba(27, 58, 92, 0.12);

  --text-primary: #243B53;
  --text-secondary: #5a6e7f;
  --text-muted: #829ab1;
  --text-inverse: #ffffff;

  /* Brand - Treeade Green & Navy */
  --purple-50: #f1faeb;
  --purple-100: #dff2d1;
  --purple-200: #c2e5ab;
  --purple-300: #9cd37b;
  --purple-400: #70cb44;
  --purple-500: #5db536;
  --purple-600: #4a912b;
  --purple-700: #3b7322;
  --purple-800: #2f5c1b;
  --purple-900: #264a16;

  --primary: #70cb44;
  --primary-hover: #5db536;
  --primary-glow: rgba(112, 203, 68, 0.2);
  --primary-glow-strong: rgba(112, 203, 68, 0.4);

  --secondary: #1b3a5c;
  --accent: #243B53;

  /* Status */
  --success: #10b981;
  --success-bg: rgba(16, 185, 129, 0.1);
  --success-border: rgba(16, 185, 129, 0.2);
  --warning: #f59e0b;
  --warning-bg: rgba(245, 158, 11, 0.1);
  --warning-border: rgba(245, 158, 11, 0.2);
  --danger: #ef4444;
  --danger-bg: rgba(239, 68, 68, 0.1);
  --danger-border: rgba(239, 68, 68, 0.2);
  --info: #06b6d4;

  /* Layout */
  --font-sans: 'Poppins', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-heading: 'Montserrat', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  --shadow-sm: 0 2px 8px rgba(27, 58, 92, 0.04);
  --shadow-md: 0 8px 32px rgba(27, 58, 92, 0.06);
  --shadow-lg: 0 16px 48px rgba(27, 58, 92, 0.08);
  --shadow-glow: 0 0 24px rgba(112, 203, 68, 0.15);
  --glass-blur: 0px; /* Removing glassmorphism */
  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);

  --sidebar-width: 280px;
}

/* Dark Theme */
.dark-theme {
  --bg-primary: #0c0a1a;
  --bg-secondary: #13102a;
  --bg-card: rgba(22, 18, 48, 0.7);
  --bg-card-hover: rgba(30, 25, 62, 0.8);
  --bg-input: rgba(255, 255, 255, 0.04);
  --bg-input-focus: rgba(255, 255, 255, 0.07);
  --border-color: rgba(112, 203, 68, 0.12);
  --border-hover: rgba(112, 203, 68, 0.25);
  --border-input: rgba(255, 255, 255, 0.1);
  --text-primary: #f1f0f7;
  --text-secondary: #a8a3c0;
  --text-muted: #6b6590;
  --text-inverse: #0c0a1a;
  --primary: #70cb44;
  --primary-hover: #5db536;
  --primary-glow: rgba(112, 203, 68, 0.2);
  --shadow-md: 0 8px 32px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 24px rgba(112, 203, 68, 0.15);
}

/* ==========================================================================
   RESET & BASE
   ========================================================================== */

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

body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color var(--transition-normal), color var(--transition-normal);
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

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

a:hover { color: var(--primary-hover); }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ==========================================================================
   GRADIENTS & EFFECTS
   ========================================================================== */

.gradient-purple {
  background: linear-gradient(135deg, #70cb44 0%, #5db536 100%);
}

.gradient-purple-dark {
  background: linear-gradient(135deg, #264a16 0%, #4a912b 50%, #70cb44 100%);
}

.gradient-bg {
  background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
}

.text-gradient {
  background: linear-gradient(135deg, var(--purple-300), var(--purple-500));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ==========================================================================
   LAYOUT — APP CONTAINER
   ========================================================================== */

.app-container {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-card);
  backdrop-filter: blur(var(--glass-blur));
  border-right: 1px solid var(--border-color);
  padding: 2rem 1.25rem;
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
  z-index: 100;
  transition: transform var(--transition-normal);
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 2.5rem;
  padding: 0 0.5rem;
}

.logo-icon {
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 800;
  font-size: 0.8rem;
  box-shadow: 0 4px 14px var(--primary-glow);
  letter-spacing: -0.02em;
}

.logo-text {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.logo-tag {
  font-size: 0.6rem;
  font-weight: 700;
  background: var(--primary);
  color: white;
  padding: 2px 7px;
  border-radius: 4px;
  margin-left: auto;
  letter-spacing: 0.02em;
}

.nav-menu {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex-grow: 1;
}

.nav-item a {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.8rem 1rem;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: 0.9rem;
  transition: all var(--transition-fast);
}

.nav-item a:hover {
  color: var(--text-primary);
  background: rgba(139, 92, 246, 0.06);
}

.nav-item.active a {
  color: var(--primary);
  background: var(--primary-glow);
  font-weight: 600;
}

.nav-item a svg, .nav-item a i {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.sidebar-footer {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}

.theme-toggle-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.theme-toggle-btn:hover {
  background: var(--primary-glow);
  color: var(--text-primary);
  border-color: var(--border-hover);
}

/* Main Content */
.main-content {
  flex-grow: 1;
  margin-left: var(--sidebar-width);
  padding: 2rem 2.5rem;
  min-height: 100vh;
}

/* ==========================================================================
   GLASS CARD
   ========================================================================== */

.glass-card {
  border-top: 3px solid var(--primary);
  background: var(--bg-card);
  backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
  transition: all var(--transition-normal);
}

.glass-card:hover {
  border-color: var(--border-hover);
}

/* ==========================================================================
   PAGE HEADER
   ========================================================================== */

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.page-title h1 {
  font-size: 1.75rem;
  color: var(--text-primary);
}

.page-title p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-top: 0.2rem;
}

/* ==========================================================================
   BUTTONS
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 1.4rem;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: var(--font-sans);
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: none;
  transition: all var(--transition-fast);
  outline: none;
  white-space: nowrap;
}

.btn svg, .btn i { width: 18px; height: 18px; }

.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: 0 4px 14px var(--primary-glow);
}

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px var(--primary-glow-strong);
}

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

.btn-secondary:hover {
  background: var(--primary-glow);
  border-color: var(--border-hover);
}

.btn-danger {
  background: var(--danger);
  color: white;
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.15);
}

.btn-danger:hover {
  background: #dc2626;
  transform: translateY(-1px);
}

.btn-success {
  background: var(--success);
  color: white;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.15);
}

.btn-success:hover {
  background: #059669;
  transform: translateY(-1px);
}

.btn-icon-only {
  width: 38px;
  height: 38px;
  padding: 0;
}

.btn-sm {
  padding: 0.45rem 0.9rem;
  font-size: 0.8rem;
}

.btn-lg {
  padding: 0.9rem 2rem;
  font-size: 1rem;
}

/* ==========================================================================
   BADGES
   ========================================================================== */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.7rem;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.badge-success, .badge-low {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid var(--success-border);
}

.badge-warning, .badge-medium {
  background: var(--warning-bg);
  color: var(--warning);
  border: 1px solid var(--warning-border);
}

.badge-danger, .badge-high {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid var(--danger-border);
}

.badge-info {
  background: rgba(6, 182, 212, 0.1);
  color: var(--info);
  border: 1px solid rgba(6, 182, 212, 0.2);
}

.badge-neutral {
  background: rgba(139, 92, 246, 0.08);
  color: var(--primary);
  border: 1px solid rgba(139, 92, 246, 0.15);
}

.badge-pending {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
}

/* ==========================================================================
   METRICS
   ========================================================================== */

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.metric-card {
  display: flex;
  align-items: center;
  gap: 1.15rem;
  padding: 1.25rem 1.5rem;
}

.metric-icon {
  width: 50px;
  height: 50px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.metric-icon svg, .metric-icon i { width: 24px; height: 24px; }

.metric-info { display: flex; flex-direction: column; }

.metric-value {
  font-size: 1.65rem;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.metric-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 0.15rem;
}

/* ==========================================================================
   TABLES
   ========================================================================== */

.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

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

.data-table th {
  background: rgba(139, 92, 246, 0.04);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
}

.data-table td {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
  font-size: 0.9rem;
}

.data-table tbody tr {
  transition: background-color var(--transition-fast);
}

.data-table tbody tr:hover {
  background: rgba(139, 92, 246, 0.03);
}

.data-table tr:last-child td { border-bottom: none; }

/* ==========================================================================
   FORMS & INPUTS
   ========================================================================== */

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

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

.form-control {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-input);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  transition: all var(--transition-fast);
  outline: none;
}

.form-control:focus {
  border-color: var(--primary);
  background: var(--bg-input-focus);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.form-control::placeholder { color: var(--text-muted); }

textarea.form-control {
  resize: vertical;
  min-height: 80px;
}

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b6590' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
}

/* Toggle Switch */
.toggle-container {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.toggle {
  position: relative;
  width: 44px;
  height: 24px;
  appearance: none;
  background: var(--border-color);
  border-radius: 12px;
  cursor: pointer;
  transition: background var(--transition-fast);
  border: none;
  flex-shrink: 0;
}

.toggle::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  background: white;
  border-radius: 50%;
  transition: transform var(--transition-fast);
}

.toggle:checked {
  background: var(--primary);
}

.toggle:checked::after {
  transform: translateX(20px);
}

/* ==========================================================================
   MODAL
   ========================================================================== */

.modal-backdrop {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  background: rgba(5, 4, 15, 0.8);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal);
}

.modal-backdrop.show {
  opacity: 1;
  pointer-events: auto;
}

.modal-container {
  width: 90%;
  max-width: 600px;
  max-height: 85vh;
  overflow-y: auto;
  border-radius: var(--radius-lg);
  transform: scale(0.92) translateY(20px);
  transition: transform var(--transition-normal);
}

.modal-backdrop.show .modal-container {
  transform: scale(1) translateY(0);
}

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

.modal-header h3 { font-size: 1.15rem; }

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

.modal-close:hover { color: var(--text-primary); }

/* ==========================================================================
   LOGIN PAGE
   ========================================================================== */

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f4f7f6 0%, #ffffff 50%, #f4f7f6 100%);
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
}

.login-page::before {
  content: '';
  position: absolute;
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.12) 0%, transparent 70%);
  top: -100px; right: -100px;
  border-radius: 50%;
}

.login-page::after {
  content: '';
  position: absolute;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(168, 85, 247, 0.08) 0%, transparent 70%);
  bottom: -100px; left: -100px;
  border-radius: 50%;
}

.login-card {
  width: 100%;
  max-width: 420px;
  padding: 2.5rem;
  border-radius: var(--radius-lg);
  position: relative;
  z-index: 1;
}

.login-logo {
  text-align: center;
  margin-bottom: 2rem;
}

.login-logo .logo-icon {
  width: 56px; height: 56px;
  margin: 0 auto 1rem;
  font-size: 1rem;
}

.login-logo h1 {
  font-size: 1.5rem;
  margin-bottom: 0.25rem;
}

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

.login-error {
  background: var(--danger-bg);
  border: 1px solid var(--danger-border);
  color: var(--danger);
  padding: 0.65rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  margin-bottom: 1rem;
  display: none;
}

/* ==========================================================================
   DASHBOARD GRID
   ========================================================================== */

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

.dashboard-full {
  grid-column: 1 / -1;
}

/* Chart containers */
.chart-container {
  position: relative;
  width: 100%;
  height: 300px;
}

.chart-container canvas {
  max-height: 100%;
}

/* ==========================================================================
   RESPONDER (EMPLOYEE PORTAL)
   ========================================================================== */

.responder-page {
  min-height: 100vh;
  background: linear-gradient(135deg, #f4f7f6 0%, #ffffff 50%, #f4f7f6 100%);
  display: flex;
  flex-direction: column;
}

/* Responder Header */
.responder-header {
  background: var(--bg-card);
  backdrop-filter: blur(var(--glass-blur));
  border-bottom: 1px solid var(--border-color);
  padding: 1rem 1.5rem;
  position: sticky;
  top: 0;
  z-index: 50;
}

.responder-header-inner {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.responder-header .logo-icon {
  width: 36px; height: 36px;
  font-size: 0.7rem;
}

.responder-progress-text {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.responder-progress-text strong {
  color: var(--primary);
}

/* Progress Bar */
.progress-bar {
  height: 4px;
  background: rgba(139, 92, 246, 0.1);
  position: sticky;
  top: 60px;
  z-index: 49;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--primary-hover));
  width: 0%;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 12px var(--primary-glow);
}

/* Tabs */
.tabs-container {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 64px;
  z-index: 48;
  overflow-x: auto;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.tabs-container::-webkit-scrollbar { display: none; }

.tabs-inner {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  padding: 0.65rem 1rem;
  gap: 0.5rem;
  white-space: nowrap;
}

.tab-btn {
  padding: 0.5rem 1rem;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 500;
  font-family: var(--font-sans);
  border: 1px solid var(--border-color);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.tab-btn:hover {
  color: var(--text-primary);
  border-color: var(--border-hover);
}

.tab-btn.active {
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
  color: white;
  border-color: transparent;
  box-shadow: 0 2px 10px var(--primary-glow);
}

.tab-btn.completed {
  border-color: var(--success-border);
  color: var(--success);
}

/* Main Content Area */
.responder-main {
  flex-grow: 1;
  max-width: 800px;
  width: 100%;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

/* Section Header */
.section-header {
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
  color: white;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  padding: 1.75rem 2rem;
  margin-bottom: -0.5rem;
  position: relative;
  z-index: 2;
}

.section-header h2 {
  font-size: 1.4rem;
  font-weight: 700;
}

.section-header p {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.85rem;
  margin-top: 0.25rem;
}

/* Question Card */
.section-body {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  padding: 2rem;
}

.question-card {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  transition: border-color var(--transition-fast);
}

.question-card:hover {
  border-color: var(--border-hover);
}

.question-card.answered {
  border-color: var(--success-border);
  background: rgba(16, 185, 129, 0.03);
}

.question-text {
  font-weight: 600;
  font-size: 1rem;
  color: var(--text-primary);
  margin-bottom: 1.25rem;
  line-height: 1.4;
}

.question-number {
  color: var(--primary);
  font-weight: 700;
}

/* Likert Scale Options */
.likert-options {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.likert-btn {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.7rem 1rem;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border-color);
  background: var(--bg-input);
  color: var(--text-secondary);
  font-size: 0.88rem;
  font-weight: 500;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: left;
  width: 100%;
}

.likert-btn:hover {
  border-color: var(--primary);
  background: var(--primary-glow);
  color: var(--text-primary);
  transform: translateX(3px);
}

.likert-btn.selected {
  background: var(--primary-glow);
  border-color: var(--primary);
  color: var(--primary);
  font-weight: 600;
  box-shadow: 0 0 0 3px var(--primary-glow);
  transform: translateX(3px);
}

.likert-num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  min-width: 30px;
  border-radius: 50%;
  background: rgba(27, 58, 92, 0.07);
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.likert-btn.selected .likert-num {
  background: var(--primary);
  color: #fff;
}

.likert-label {
  flex: 1;
  line-height: 1.3;
}

/* Question card error state */
.question-card.unanswered {
  border-left: 4px solid var(--danger) !important;
  animation: shake 0.3s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

/* Observation field */
.observation-toggle {
  font-size: 0.78rem;
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  transition: color var(--transition-fast);
  background: none;
  border: none;
  font-family: var(--font-sans);
  padding: 0;
}

.observation-toggle:hover { color: var(--primary); }

.observation-field {
  margin-top: 0.75rem;
  display: none;
}

.observation-field.show { display: block; }

.observation-field textarea {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xs);
  padding: 0.6rem 0.85rem;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  resize: vertical;
  min-height: 60px;
  outline: none;
  transition: border-color var(--transition-fast);
}

.observation-field textarea:focus {
  border-color: var(--primary);
}

/* Section Navigation */
.section-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
}

/* ==========================================================================
   CPF AUTH SCREEN
   ========================================================================== */

.auth-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.auth-card {
  width: 100%;
  max-width: 440px;
  padding: 2.5rem;
  text-align: center;
}

.auth-card .logo-icon {
  width: 60px; height: 60px;
  margin: 0 auto 1.5rem;
  font-size: 1rem;
}

.auth-card h2 {
  font-size: 1.4rem;
  margin-bottom: 0.5rem;
}

.auth-card .subtitle {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 2rem;
  line-height: 1.5;
}

.cpf-input {
  text-align: center;
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  padding: 1rem;
}

.auth-error {
  background: var(--danger-bg);
  border: 1px solid var(--danger-border);
  color: var(--danger);
  padding: 0.65rem;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  margin-top: 0.75rem;
  display: none;
}

.auth-already {
  background: var(--warning-bg);
  border: 1px solid var(--warning-border);
  color: var(--warning);
  padding: 0.65rem;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  margin-top: 0.75rem;
  display: none;
}

/* ==========================================================================
   SUCCESS SCREEN
   ========================================================================== */

.success-screen {
  text-align: center;
  padding: 3rem 1.5rem;
}

.success-icon {
  width: 80px; height: 80px;
  background: var(--success-bg);
  border: 2px solid var(--success-border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
  color: var(--success);
  animation: success-pulse 1s ease;
}

.success-icon svg { width: 40px; height: 40px; }

@keyframes success-pulse {
  0% { transform: scale(0); opacity: 0; }
  50% { transform: scale(1.15); }
  100% { transform: scale(1); opacity: 1; }
}

.success-screen h2 {
  font-size: 1.6rem;
  margin-bottom: 0.5rem;
}

.success-screen p {
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

/* ==========================================================================
   CHART BAR (CSS Charts)
   ========================================================================== */

.chart-bar-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.6rem;
}

.chart-bar-label {
  font-size: 0.78rem;
  color: var(--text-secondary);
  min-width: 160px;
  text-align: right;
  font-weight: 500;
}

.chart-bar-track {
  flex-grow: 1;
  height: 26px;
  background: var(--bg-input);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.chart-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: linear-gradient(90deg, var(--primary), var(--primary-hover));
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  min-width: 2px;
}

.chart-bar-fill.fill-success { background: linear-gradient(90deg, #059669, var(--success)); }
.chart-bar-fill.fill-warning { background: linear-gradient(90deg, #d97706, var(--warning)); }
.chart-bar-fill.fill-danger { background: linear-gradient(90deg, #dc2626, var(--danger)); }

.chart-bar-value {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-primary);
  min-width: 36px;
}

/* ==========================================================================
   QR CODE
   ========================================================================== */

.qr-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem;
  background: white;
  border-radius: var(--radius-sm);
  max-width: 250px;
  margin: 0 auto;
}

/* ==========================================================================
   ANIMATIONS
   ========================================================================== */

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

@keyframes slide-up {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in { animation: fade-in 0.4s ease-out; }
.animate-slide-up { animation: slide-up 0.5s ease-out; }

/* Hidden utility */
.hidden { display: none !important; }

/* ==========================================================================
   COMPANY SELECTOR (Sidebar)
   ========================================================================== */

.company-selector {
  background: rgba(112, 203, 68, 0.04);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.85rem;
  margin-bottom: 1.25rem;
}

.company-select-wrapper {
  position: relative;
}

.company-dropdown {
  font-weight: 600;
  font-size: 0.85rem;
  padding: 0.6rem 0.85rem;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xs);
  color: var(--text-primary);
  width: 100%;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.company-dropdown:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.company-dropdown:hover {
  border-color: var(--border-hover);
}

/* Company name label on responder page */
.company-name-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary);
  background: var(--primary-glow);
  padding: 0.4rem 1rem;
  border-radius: var(--radius-full);
  margin-bottom: 0.75rem;
  display: inline-block;
}

/* ==========================================================================
   PRINT STYLES
   ========================================================================== */

@media print {
  body { background: white !important; color: #1a1a2e !important; }
  .sidebar, .page-header, .nav-menu, .theme-toggle-btn,
  .btn, .tabs-container, .responder-header { display: none !important; }
  .main-content { margin-left: 0 !important; padding: 0 !important; }
  .glass-card {
  border-top: 3px solid var(--primary);
    background: white !important;
    box-shadow: none !important;
    border: 1px solid #ddd !important;
    break-inside: avoid;
  }
  .data-table th { background: #f0f0f0 !important; color: #333 !important; }
  .data-table td { color: #333 !important; }
  .chart-bar-fill { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .badge { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; padding: 1.25rem; }
  .page-header { flex-direction: column; align-items: flex-start; gap: 1rem; }
  .metrics-grid { grid-template-columns: 1fr 1fr; }
  .dashboard-grid { grid-template-columns: 1fr; }

  .responder-main { padding: 1.25rem 1rem 3rem; }
  .section-header { padding: 1.25rem 1.5rem; }
  .section-header h2 { font-size: 1.15rem; }
  .section-body { padding: 1.25rem; }
  .question-card { padding: 1.15rem; }

  .likert-options { gap: 0.35rem; }
  .likert-btn { padding: 0.45rem 0.85rem; font-size: 0.75rem; }

  .chart-bar-label { min-width: 100px; font-size: 0.7rem; }

  .login-card, .auth-card { padding: 1.75rem; }
}

@media (max-width: 480px) {
  .metrics-grid { grid-template-columns: 1fr; }
  .tabs-inner { padding: 0.5rem 0.75rem; }
  .tab-btn { padding: 0.4rem 0.75rem; font-size: 0.72rem; }
}
