/* =============================================
   Pesquisa Eleitoral — Admin CSS
   Premium Dark Theme v2.0
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,300;0,14..32,400;0,14..32,500;0,14..32,600;0,14..32,700;0,14..32,800;0,14..32,900&display=swap');

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

:root {
  /* Backgrounds */
  --bg-base:       #061d24;
  --bg-surface:    #0a2933;
  --bg-card:       #0d3440;
  --bg-card-2:     #124352;
  --bg-hover:      #195466;

  /* Borders */
  --border:        #195466;
  --border-light:  #216980;
  --border-glow:   rgba(14, 165, 233, 0.4);

  /* Brand Colors */
  --primary:       #0ea5e9;
  --primary-dark:  #0284c7;
  --primary-light: #38bdf8;
  --primary-glow:  rgba(14, 165, 233, 0.2);
  --accent:        #06b6d4;
  --accent-light:  #22d3ee;

  /* Status */
  --success:       #10b981;
  --success-glow:  rgba(16, 185, 129, 0.2);
  --warning:       #f59e0b;
  --warning-glow:  rgba(245, 158, 11, 0.2);
  --danger:        #ef4444;
  --danger-glow:   rgba(239, 68, 68, 0.2);
  --info:          #3b82f6;
  --info-glow:     rgba(59, 130, 246, 0.2);

  /* Text */
  --text-primary:  #f0f4ff;
  --text-secondary:#8fa3c0;
  --text-muted:    #4d6480;
  --text-accent:   #a5b4fc;

  /* Radii */
  --radius-xs:     6px;
  --radius-sm:     10px;
  --radius-md:     14px;
  --radius-lg:     18px;
  --radius-xl:     24px;
  --radius-2xl:    32px;

  /* Shadows */
  --shadow-xs:     0 1px 4px rgba(0,0,0,0.5);
  --shadow-sm:     0 2px 12px rgba(0,0,0,0.5);
  --shadow-md:     0 8px 32px rgba(0,0,0,0.6);
  --shadow-lg:     0 20px 60px rgba(0,0,0,0.7);
  --shadow-glow:   0 0 32px rgba(99,102,241,0.25);
  --shadow-glow-sm:0 0 16px rgba(99,102,241,0.2);

  /* Transitions */
  --transition:    all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  --font:          'Inter', system-ui, -apple-system, sans-serif;

  /* Sidebar */
  --sidebar-w:     264px;
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Animated background */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 0% 0%, rgba(99,102,241,0.07) 0%, transparent 50%),
    radial-gradient(ellipse 60% 50% at 100% 100%, rgba(139,92,246,0.06) 0%, transparent 50%),
    radial-gradient(ellipse 40% 40% at 50% 50%, rgba(59,130,246,0.03) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* --- Scrollbar --- */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* ==============================================
   LAYOUT
   ============================================== */
.layout {
  display: flex;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* ==============================================
   SIDEBAR
   ============================================== */
.sidebar {
  width: var(--sidebar-w);
  background: linear-gradient(180deg, #060c1a 0%, #040810 100%);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: var(--transition);
  overflow: hidden;
}

/* Subtle sidebar glow */
.sidebar::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 300px;
  background: radial-gradient(ellipse 100% 40% at 50% 0%, rgba(99,102,241,0.08) 0%, transparent 100%);
  pointer-events: none;
}

.sidebar::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--primary), transparent);
  opacity: 0;
}

/* --- Logo --- */
.sidebar-logo {
  padding: 24px 20px 18px;
  border-bottom: 1px solid rgba(30, 47, 71, 0.8);
  position: relative;
}

.sidebar-logo-inner {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-logo-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  box-shadow: 0 4px 16px rgba(99,102,241,0.35);
  flex-shrink: 0;
}

.sidebar-logo h1 {
  font-size: 15px;
  font-weight: 800;
  background: linear-gradient(135deg, #c7d2fe, #a5b4fc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.3px;
  line-height: 1.2;
}

.sidebar-logo p {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
  letter-spacing: 0.2px;
}

/* --- Nav --- */
.sidebar-nav {
  flex: 1;
  padding: 12px 10px;
  overflow-y: auto;
}

.nav-section-title {
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.8px;
  color: var(--text-muted);
  padding: 14px 12px 8px;
  opacity: 0.7;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  transition: var(--transition);
  margin-bottom: 2px;
  cursor: pointer;
  border: 1px solid transparent;
  background: none;
  width: 100%;
  text-align: left;
  position: relative;
  overflow: hidden;
}

.nav-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%) scaleY(0);
  width: 3px;
  height: 65%;
  background: linear-gradient(180deg, var(--primary), var(--accent));
  border-radius: 0 3px 3px 0;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
  border-color: var(--border);
}

.nav-item:hover .icon {
  color: var(--primary-light);
  opacity: 1;
}

.nav-item.active {
  background: linear-gradient(135deg, rgba(99,102,241,0.15), rgba(139,92,246,0.1));
  color: var(--text-accent);
  border-color: rgba(99,102,241,0.25);
  font-weight: 600;
}

.nav-item.active::before {
  transform: translateY(-50%) scaleY(1);
}

.nav-item.active .icon {
  color: var(--primary-light);
  opacity: 1;
}

.nav-item .icon {
  width: 18px;
  height: 18px;
  opacity: 0.6;
  flex-shrink: 0;
  transition: var(--transition);
}

/* --- Sidebar Footer --- */
.sidebar-footer {
  padding: 12px 10px 16px;
  border-top: 1px solid rgba(30, 47, 71, 0.8);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  margin-bottom: 8px;
}

.sidebar-user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 13px;
  color: white;
  flex-shrink: 0;
  box-shadow: 0 2px 10px rgba(99,102,241,0.3);
}

.sidebar-user-info p:first-child {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
}

.sidebar-user-info p:last-child {
  font-size: 11px;
  color: var(--text-muted);
}

/* ==============================================
   MAIN CONTENT
   ============================================== */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* --- Topbar --- */
.topbar {
  background: rgba(4, 7, 15, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 14px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, var(--border-light) 30%, var(--border-light) 70%, transparent 100%);
}

.topbar-title {
  font-size: 19px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.4px;
}

.topbar-subtitle {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: 1px;
}

/* Status indicator */
.topbar-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--success);
  font-weight: 500;
  background: rgba(16,185,129,0.08);
  border: 1px solid rgba(16,185,129,0.2);
  padding: 4px 10px;
  border-radius: 99px;
}

.topbar-status-dot {
  width: 6px;
  height: 6px;
  background: var(--success);
  border-radius: 50%;
  animation: statusPulse 2s ease-in-out infinite;
  box-shadow: 0 0 6px var(--success);
}

@keyframes statusPulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 4px var(--success); }
  50% { opacity: 0.6; box-shadow: 0 0 10px var(--success); }
}

.page-body {
  padding: 28px 32px;
  flex: 1;
}

/* ==============================================
   CARDS
   ============================================== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(99,102,241,0.3), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.card:hover { border-color: var(--border-light); }
.card:hover::before { opacity: 1; }

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

.card-title {
  font-size: 15.5px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.2px;
}

.card-subtitle {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: 3px;
}

/* ==============================================
   STATS GRID
   ============================================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
  animation: fadeInUp 0.4s ease both;
}

.stat-card:nth-child(1) { animation-delay: 0ms; }
.stat-card:nth-child(2) { animation-delay: 60ms; }
.stat-card:nth-child(3) { animation-delay: 120ms; }
.stat-card:nth-child(4) { animation-delay: 180ms; }

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

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
}

.stat-card::after {
  content: '';
  position: absolute;
  bottom: 0; right: 0;
  width: 80px; height: 80px;
  background: radial-gradient(circle, rgba(99,102,241,0.08), transparent 70%);
  border-radius: 50%;
}

.stat-card:hover {
  border-color: rgba(99,102,241,0.35);
  box-shadow: var(--shadow-glow-sm);
  transform: translateY(-2px);
}

.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  margin-bottom: 14px;
  backdrop-filter: blur(8px);
}

.stat-value {
  font-size: 30px;
  font-weight: 900;
  color: var(--text-primary);
  letter-spacing: -1.5px;
  line-height: 1;
  margin-bottom: 6px;
}

.stat-label {
  font-size: 12.5px;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0.1px;
}

/* ==============================================
   BUTTONS
   ============================================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
  font-family: var(--font);
  position: relative;
  overflow: hidden;
  letter-spacing: -0.1px;
}

/* Ripple effect */
.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(255,255,255,0.15) 0%, transparent 60%);
  opacity: 0;
  transform: scale(0);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.btn:active::after {
  opacity: 1;
  transform: scale(2.5);
  transition: none;
}

.btn:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  color: white;
  box-shadow: 0 4px 16px rgba(99,102,241,0.3), inset 0 1px 0 rgba(255,255,255,0.1);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(99,102,241,0.45), inset 0 1px 0 rgba(255,255,255,0.1);
}

.btn-primary:active:not(:disabled) { transform: translateY(0); }

.btn-secondary {
  background: rgba(255,255,255,0.05);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.btn-secondary:hover:not(:disabled) {
  background: rgba(255,255,255,0.08);
  color: var(--text-primary);
  border-color: var(--border-light);
}

.btn-danger {
  background: rgba(239,68,68,0.1);
  color: #fca5a5;
  border: 1px solid rgba(239,68,68,0.25);
}

.btn-danger:hover:not(:disabled) {
  background: rgba(239,68,68,0.2);
  border-color: rgba(239,68,68,0.5);
  box-shadow: 0 0 16px rgba(239,68,68,0.2);
}

.btn-success {
  background: rgba(16,185,129,0.1);
  color: #6ee7b7;
  border: 1px solid rgba(16,185,129,0.25);
}

.btn-success:hover:not(:disabled) {
  background: rgba(16,185,129,0.2);
  border-color: rgba(16,185,129,0.5);
}

.btn-sm  { padding: 5px 12px; font-size: 12.5px; gap: 5px; }
.btn-lg  { padding: 13px 26px; font-size: 15px; }

/* ==============================================
   FORMS
   ============================================== */
.form-group { margin-bottom: 18px; }

.form-label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 7px;
  letter-spacing: 0.2px;
  text-transform: uppercase;
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 14px;
  transition: var(--transition);
  outline: none;
}

.form-control:focus {
  border-color: var(--primary);
  background: rgba(99,102,241,0.05);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.12);
}

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

select.form-control {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%234d6480'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 15px;
  padding-right: 36px;
}

select.form-control option {
  background-color: var(--bg-card);
  color: var(--text-primary);
}

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

/* ==============================================
   TABLE
   ============================================== */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

thead th {
  background: rgba(255,255,255,0.02);
  padding: 11px 16px;
  text-align: left;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

tbody tr {
  border-bottom: 1px solid rgba(30, 47, 71, 0.6);
  transition: var(--transition);
}

tbody tr:last-child { border-bottom: none; }

tbody tr:hover {
  background: rgba(99,102,241,0.04);
}

tbody td {
  padding: 13px 16px;
  color: var(--text-secondary);
  vertical-align: middle;
}

/* ==============================================
   BADGES
   ============================================== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 99px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.1px;
}

.badge-success {
  background: rgba(16,185,129,0.12);
  color: #6ee7b7;
  border: 1px solid rgba(16,185,129,0.25);
}
.badge-warning {
  background: rgba(245,158,11,0.12);
  color: #fcd34d;
  border: 1px solid rgba(245,158,11,0.25);
}
.badge-danger {
  background: rgba(239,68,68,0.12);
  color: #fca5a5;
  border: 1px solid rgba(239,68,68,0.25);
}
.badge-info {
  background: rgba(99,102,241,0.12);
  color: #a5b4fc;
  border: 1px solid rgba(99,102,241,0.25);
}
.badge-gray {
  background: rgba(100,116,139,0.12);
  color: #94a3b8;
  border: 1px solid rgba(100,116,139,0.2);
}

/* ==============================================
   PROGRESS BAR
   ============================================== */
.progress-bar-wrap {
  width: 100%;
  background: rgba(255,255,255,0.05);
  border-radius: 999px;
  height: 6px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.progress-bar-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  animation: shimmer 2s 0.5s ease-in-out;
}

@keyframes shimmer {
  from { left: -100%; }
  to   { left: 200%; }
}

/* ==============================================
   MODAL
   ============================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-overlay.show {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: var(--bg-card-2);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: 32px;
  width: 92%;
  max-width: 540px;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.94) translateY(16px);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  position: relative;
}

.modal::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(99,102,241,0.5), var(--accent), rgba(99,102,241,0.5), transparent);
}

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

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

.modal-title {
  font-size: 17px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.3px;
}

.modal-close {
  width: 30px;
  height: 30px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  line-height: 1;
  transition: var(--transition);
}

.modal-close:hover {
  color: var(--text-primary);
  border-color: var(--border-light);
  background: rgba(255,255,255,0.08);
}

/* ==============================================
   TOASTS
   ============================================== */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 360px;
  min-width: 300px;
}

.toast {
  background: var(--bg-card-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  box-shadow: var(--shadow-md);
  transform: translateX(115%);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  font-size: 13.5px;
  position: relative;
  overflow: hidden;
}

/* Progress bar on toast */
.toast::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0;
  height: 2px;
  background: currentColor;
  opacity: 0.4;
  animation: toastTimer 4s linear forwards;
}

@keyframes toastTimer {
  from { width: 100%; }
  to   { width: 0%; }
}

.toast.show { transform: translateX(0); }

.toast-icon { font-size: 18px; flex-shrink: 0; margin-top: 1px; }
.toast-title { font-weight: 700; color: var(--text-primary); margin-bottom: 2px; font-size: 13.5px; }
.toast-msg { color: var(--text-secondary); font-size: 12.5px; line-height: 1.4; }

.toast-success { border-left: 3px solid var(--success); color: var(--success); }
.toast-error   { border-left: 3px solid var(--danger);  color: var(--danger); }
.toast-warning { border-left: 3px solid var(--warning); color: var(--warning); }
.toast-info    { border-left: 3px solid var(--info);    color: var(--info); }

/* ==============================================
   UTILITIES
   ============================================== */
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.w-full { width: 100%; }
.text-sm { font-size: 13px; }
.text-xs { font-size: 11.5px; }
.text-muted { color: var(--text-muted); }
.text-primary { color: var(--primary); }
.font-bold { font-weight: 700; }
.hidden { display: none !important; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

/* ==============================================
   SPINNER
   ============================================== */
.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,0.15);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}

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

/* ==============================================
   EMPTY STATE
   ============================================== */
.empty-state {
  text-align: center;
  padding: 64px 24px;
  color: var(--text-muted);
}

.empty-state .icon {
  font-size: 48px;
  margin-bottom: 18px;
  opacity: 0.35;
  display: block;
  filter: grayscale(20%);
}

.empty-state h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.empty-state p {
  font-size: 13.5px;
  line-height: 1.6;
  max-width: 340px;
  margin: 0 auto;
}

/* ==============================================
   RESPONSIVE
   ============================================== */
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); }
  .main-content { margin-left: 0; }
  .page-body { padding: 16px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .topbar { padding: 12px 20px; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .page-body { padding: 12px; }
}

/* ==============================================
   QUESTION BUILDER (Admin Survey Editor)
   ============================================== */
.question-card {
  background: rgba(255,255,255,0.025);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 12px;
  position: relative;
  transition: var(--transition);
  animation: fadeInUp 0.3s ease both;
}

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

.question-card .drag-handle {
  color: var(--text-muted);
  cursor: grab;
  user-select: none;
  font-size: 18px;
}

.option-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

/* ==============================================
   FILE UPLOAD / DROP ZONE
   ============================================== */
.file-drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 44px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  background: rgba(255,255,255,0.02);
  position: relative;
  overflow: hidden;
}

.file-drop-zone::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 50%, rgba(99,102,241,0.06), transparent 70%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.file-drop-zone:hover,
.file-drop-zone.dragging {
  border-color: var(--primary);
  background: rgba(99,102,241,0.04);
}

.file-drop-zone:hover::before,
.file-drop-zone.dragging::before {
  opacity: 1;
}

.file-drop-zone .upload-icon {
  font-size: 44px;
  margin-bottom: 14px;
  opacity: 0.5;
  display: block;
  transition: var(--transition);
}

.file-drop-zone:hover .upload-icon { opacity: 0.8; transform: scale(1.05); }
.file-drop-zone p { color: var(--text-muted); font-size: 13.5px; }
.file-drop-zone strong { color: var(--text-accent); }

/* ==============================================
   CHANNEL SELECTOR
   ============================================== */
.channel-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.channel-card {
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px 16px;
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
  position: relative;
  overflow: hidden;
  background: rgba(255,255,255,0.02);
}

.channel-card::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.channel-card:hover {
  border-color: var(--border-light);
  background: rgba(255,255,255,0.04);
  transform: translateY(-2px);
}

.channel-card.selected {
  border-color: var(--primary);
  background: rgba(99,102,241,0.08);
  box-shadow: var(--shadow-glow-sm), inset 0 0 20px rgba(99,102,241,0.05);
}

.channel-card .channel-icon {
  font-size: 34px;
  margin-bottom: 10px;
  display: block;
  transition: transform 0.2s ease;
}

.channel-card:hover .channel-icon { transform: scale(1.1); }

.channel-card .channel-name {
  font-weight: 700;
  font-size: 14px;
  color: var(--text-primary);
}

.channel-card .channel-desc {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ==============================================
   OPTIONS CONTAINER (Question builder)
   ============================================== */
.options-container {
  background: rgba(0,0,0,0.2);
  border-radius: var(--radius-sm);
  padding: 12px;
  border: 1px solid var(--border);
}

.sidebar-toggle {
  display: none;
}

@media (max-width: 900px) {
  .sidebar-toggle {
    display: flex !important;
  }
  
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    box-shadow: none;
  }
  
  .sidebar.active {
    transform: translateX(0);
    box-shadow: 0 0 40px rgba(0,0,0,0.8);
  }
  
  .main-content {
    margin-left: 0 !important;
    width: 100% !important;
  }
  
  .topbar {
    padding: 14px 20px;
  }
  
  .page-body {
    padding: 20px;
  }
  
  .grid-2, .grid-3 {
    grid-template-columns: 1fr !important;
  }
}

.grid-lists {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 20px;
}

@media (max-width: 900px) {
  .grid-lists {
    grid-template-columns: 1fr !important;
  }
}
