/* ============================================================
   SerTec Radar Político - Estilos Principais
   ============================================================ */

:root {
  --sertec-primary:    #1a3a5c;
  --sertec-secondary:  #0d6efd;
  --sertec-accent:     #f0a500;
  --sertec-success:    #198754;
  --sertec-danger:     #dc3545;
  --sertec-sidebar-bg: #0f2540;
  --sertec-sidebar-w:  260px;
  --sertec-header-h:   60px;
  --sertec-text-light: #cdd9e8;
}

/* ── BODY & LAYOUT ── */
body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: #f0f4f8;
  margin: 0;
  overflow-x: hidden;
}

/* ── SIDEBAR ── */
#sidebar {
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  width: var(--sertec-sidebar-w);
  background: var(--sertec-sidebar-bg);
  z-index: 1050;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.15) transparent;
}

#sidebar .sidebar-brand {
  padding: 18px 20px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  background: linear-gradient(135deg, #0d2035 0%, #1a3a5c 100%);
  flex-shrink: 0;
}

#sidebar .sidebar-brand .brand-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

#sidebar .sidebar-brand .brand-icon {
  width: 40px;
  height: 40px;
  background: var(--sertec-accent);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: #fff;
  flex-shrink: 0;
}

#sidebar .brand-name {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

#sidebar .brand-sub {
  font-size: 10px;
  color: var(--sertec-accent);
  font-weight: 400;
}

/* Seções do menu */
.sidebar-section-label {
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: rgba(255,255,255,0.3);
  padding: 18px 20px 6px;
}

/* Itens do menu */
#sidebar .nav-link {
  color: var(--sertec-text-light);
  padding: 9px 20px;
  font-size: 13.5px;
  font-weight: 400;
  border-radius: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.2s;
  border-left: 3px solid transparent;
  text-decoration: none;
}

#sidebar .nav-link i {
  width: 18px;
  text-align: center;
  opacity: 0.8;
  font-size: 14px;
}

#sidebar .nav-link:hover {
  background: rgba(255,255,255,0.06);
  color: #fff;
  border-left-color: var(--sertec-accent);
}

#sidebar .nav-link.active {
  background: rgba(240,165,0,0.12);
  color: var(--sertec-accent);
  border-left-color: var(--sertec-accent);
  font-weight: 600;
}

#sidebar .nav-link.active i {
  opacity: 1;
}

/* ── TOPBAR ── */
#topbar {
  position: fixed;
  top: 0;
  left: var(--sertec-sidebar-w);
  right: 0;
  height: var(--sertec-header-h);
  background: #fff;
  z-index: 1040;
  display: flex;
  align-items: center;
  padding: 0 24px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  border-bottom: 1px solid #e9ecef;
}

#topbar .page-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--sertec-primary);
  margin: 0;
  flex: 1;
}

#topbar .topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ── MAIN CONTENT ── */
#main-content {
  margin-left: var(--sertec-sidebar-w);
  margin-top: var(--sertec-header-h);
  padding: 24px;
  min-height: calc(100vh - var(--sertec-header-h));
}

/* ── CARDS ── */
.stat-card {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  border: 1px solid #e9ecef;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  transition: box-shadow 0.2s, transform 0.2s;
  height: 100%;
}

.stat-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  transform: translateY(-1px);
}

.stat-card .stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin-bottom: 12px;
}

.stat-card .stat-value {
  font-size: 26px;
  font-weight: 700;
  color: var(--sertec-primary);
  line-height: 1;
  margin-bottom: 4px;
}

.stat-card .stat-label {
  font-size: 12px;
  color: #6c757d;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 500;
}

/* ── FILTER BAR ── */
.filter-card {
  background: #fff;
  border-radius: 10px;
  padding: 16px 20px;
  border: 1px solid #e9ecef;
  margin-bottom: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.filter-card .filter-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #6c757d;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ── DATA TABLE WRAPPER ── */
.table-card {
  background: #fff;
  border-radius: 10px;
  border: 1px solid #e9ecef;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  overflow: hidden;
}

.table-card .table-card-header {
  padding: 14px 20px;
  border-bottom: 1px solid #e9ecef;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fafbfc;
}

.table-card .table-card-header h6 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--sertec-primary);
}

.table-card .table-card-body {
  padding: 16px;
}

/* ── BADGES ── */
.badge-eleito    { background: #d1fae5; color: #065f46; }
.badge-suplente  { background: #dbeafe; color: #1e40af; }
.badge-nao-eleito{ background: #f3f4f6; color: #374151; }
.badge-cassado   { background: #fee2e2; color: #991b1b; }
.badge-anulado   { background: #fef3c7; color: #92400e; }

/* ── RANKING NUMBER ── */
.rank-num {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
}

.rank-1 { background: #fef9c3; color: #854d0e; }
.rank-2 { background: #e2e8f0; color: #334155; }
.rank-3 { background: #fee2e2; color: #7f1d1d; }
.rank-n { background: #f1f5f9; color: #475569; }

/* ── PROGRESS BAR ── */
.vote-bar-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.vote-bar {
  flex: 1;
  height: 6px;
  background: #e9ecef;
  border-radius: 3px;
  overflow: hidden;
}

.vote-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--sertec-secondary), var(--sertec-primary));
  border-radius: 3px;
  transition: width 0.6s ease;
}

/* ── IMPORT AREA ── */
.drop-zone {
  border: 2px dashed #d1d5db;
  border-radius: 12px;
  padding: 40px;
  text-align: center;
  transition: all 0.2s;
  cursor: pointer;
  background: #f9fafb;
}

.drop-zone.dragover {
  border-color: var(--sertec-secondary);
  background: #eff6ff;
}

.drop-zone i {
  font-size: 40px;
  color: #9ca3af;
  margin-bottom: 12px;
}

/* ── LOG TERMINAL ── */
.import-log {
  background: #0d1117;
  color: #c9d1d9;
  border-radius: 8px;
  padding: 16px;
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 12px;
  max-height: 400px;
  overflow-y: auto;
  line-height: 1.6;
}

.import-log .log-success { color: #3fb950; }
.import-log .log-error   { color: #f85149; }
.import-log .log-warn    { color: #d29922; }
.import-log .log-info    { color: #58a6ff; }
.import-log .log-muted   { color: #8b949e; }

/* ── PROGRESS ── */
.import-progress-bar {
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
  background: #e9ecef;
}

.import-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #0d6efd, #0ea5e9);
  border-radius: 4px;
  transition: width 0.4s ease;
}

/* ── CHARTS ── */
.chart-card {
  background: #fff;
  border-radius: 10px;
  border: 1px solid #e9ecef;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.chart-card .chart-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--sertec-primary);
  margin-bottom: 16px;
}

/* ── SHORTCUT CARDS (dashboard) ── */
.shortcut-card {
  background: #fff;
  border-radius: 10px;
  border: 1px solid #e9ecef;
  padding: 16px;
  text-align: center;
  transition: all 0.2s;
  text-decoration: none;
  color: var(--sertec-primary);
  display: block;
}

.shortcut-card:hover {
  background: var(--sertec-primary);
  color: #fff;
  border-color: var(--sertec-primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(26,58,92,0.2);
}

.shortcut-card i {
  font-size: 28px;
  margin-bottom: 8px;
  display: block;
  color: var(--sertec-accent);
}

.shortcut-card:hover i {
  color: var(--sertec-accent);
}

.shortcut-card span {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  #sidebar {
    transform: translateX(calc(-1 * var(--sertec-sidebar-w)));
  }
  #sidebar.open {
    transform: translateX(0);
  }
  #topbar {
    left: 0;
  }
  #main-content {
    margin-left: 0;
  }
}

/* ── PRINT ── */
@media print {
  #sidebar, #topbar { display: none !important; }
  #main-content { margin: 0; padding: 0; }
  .no-print { display: none !important; }
}

/* ── UTILS ── */
.fw-600 { font-weight: 600; }
.text-sertec { color: var(--sertec-primary); }
.bg-sertec { background: var(--sertec-primary); }
.border-sertec { border-color: var(--sertec-primary) !important; }
.text-accent { color: var(--sertec-accent); }
.cursor-pointer { cursor: pointer; }
.number-format { font-variant-numeric: tabular-nums; }
