/* ========================================================
   Sistema de Votação do Grêmio Estudantil - CSS Administrativo
   ======================================================== */

:root {
  --admin-sidebar-bg: #0f172a;
  --admin-sidebar-hover: #1e293b;
  --admin-sidebar-active: #2563eb;
  --admin-header-bg: #ffffff;
  --admin-body-bg: #f8fafc;
  --primary: #1e40af;
  --primary-light: #3b82f6;
  --secondary: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --text-dark: #1e293b;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
}

body.admin-body {
  display: flex;
  min-height: 100vh;
  background-color: var(--admin-body-bg);
  color: var(--text-dark);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  margin: 0;
  padding: 0;
}

/* Sidebar */
.admin-sidebar {
  width: 260px;
  background-color: var(--admin-sidebar-bg);
  color: #f8fafc;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: all 0.3s;
}

.sidebar-brand {
  padding: 24px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-brand img {
  width: 36px;
  height: 36px;
}

.brand-text h2 {
  font-size: 16px;
  font-weight: 700;
  color: #ffffff;
  margin: 0;
}

.brand-text span {
  font-size: 12px;
  color: #94a3b8;
}

.sidebar-menu {
  list-style: none;
  padding: 16px 12px;
  margin: 0;
  flex: 1;
}

.menu-item {
  margin-bottom: 4px;
}

.menu-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 8px;
  color: #cbd5e1;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
}

.menu-link:hover {
  background-color: var(--admin-sidebar-hover);
  color: #ffffff;
}

.menu-link.active {
  background-color: var(--admin-sidebar-active);
  color: #ffffff;
  font-weight: 600;
}

.menu-link svg {
  width: 20px;
  height: 20px;
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 13px;
}

.admin-user-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.user-name {
  font-weight: 600;
  color: #ffffff;
}

.user-role {
  font-size: 11px;
  color: #94a3b8;
}

/* Área Principal do Admin */
.admin-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.admin-topbar {
  background-color: var(--admin-header-bg);
  height: 64px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
}

.topbar-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-dark);
}

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

.btn-sm {
  padding: 7px 12px;
  font-size: 13px;
  border-radius: 6px;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  border: 1px solid transparent;
}

.btn-outline-primary {
  color: var(--primary);
  border-color: #cbd5e1;
  background: white;
}
.btn-outline-primary:hover {
  background: #f1f5f9;
}

.btn-primary {
  background: var(--primary);
  color: white;
}
.btn-primary:hover {
  background: #1e3a8a;
}

.btn-success {
  background: var(--secondary);
  color: white;
}
.btn-success:hover {
  background: #059669;
}

.btn-danger {
  background: var(--danger);
  color: white;
}
.btn-danger:hover {
  background: #dc2626;
}

.admin-content {
  padding: 24px;
  flex: 1;
}

/* Cards de Estatísticas */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  margin-bottom: 24px;
}

.stat-card {
  background: white;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 16px;
}

.stat-icon {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}

.icon-blue { background: #eff6ff; color: #2563eb; }
.icon-green { background: #ecfdf5; color: #10b981; }
.icon-purple { background: #faf5ff; color: #a855f7; }
.icon-amber { background: #fffbeb; color: #f59e0b; }

.stat-info .stat-value {
  font-size: 26px;
  font-weight: 800;
  color: var(--text-dark);
  line-height: 1.1;
}

.stat-info .stat-label {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Painéis / Caixas de Conteúdo */
.content-box {
  background: white;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  margin-bottom: 24px;
  overflow: hidden;
}

.box-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.box-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-dark);
  margin: 0;
}

.box-body {
  padding: 20px;
}

/* Tabelas Administrativas */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 14px;
}

.admin-table th {
  background: #f8fafc;
  color: var(--text-muted);
  font-weight: 600;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0.04em;
}

.admin-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-dark);
  vertical-align: middle;
}

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

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

.table-thumbnail {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--border-color);
}

.table-badge {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 9999px;
  font-weight: 600;
  display: inline-block;
}

.btn-action-disabled {
  opacity: 0.4;
  cursor: not-allowed !important;
  pointer-events: none;
}

/* Barra de Progresso de Votos */
.progress-bar-container {
  background: #e2e8f0;
  height: 12px;
  border-radius: 6px;
  overflow: hidden;
  margin-top: 6px;
  width: 100%;
}

.progress-bar-fill {
  background: var(--primary);
  height: 100%;
  border-radius: 6px;
  transition: width 0.5s ease-in-out;
}

.progress-bar-fill.winner {
  background: var(--secondary);
}

/* Destaque Vencedor / Empate */
.winner-banner {
  background: #ecfdf5;
  border: 2px solid #a7f3d0;
  border-radius: 12px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 24px;
}

.winner-icon {
  width: 56px;
  height: 56px;
  background: #10b981;
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  flex-shrink: 0;
}

.tie-banner {
  background: #fffbeb;
  border: 2px solid #fde68a;
  border-radius: 12px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 24px;
}

.tie-icon {
  width: 56px;
  height: 56px;
  background: #f59e0b;
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  flex-shrink: 0;
}

/* Login Admin */
.admin-login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 100%);
  padding: 20px;
  width: 100%;
}

.admin-login-card {
  max-width: 440px;
  width: 100%;
  background: white;
  border-radius: 16px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
  overflow: hidden;
}

.admin-login-header {
  padding: 30px;
  text-align: center;
  border-bottom: 1px solid var(--border-color);
}

.admin-login-body {
  padding: 30px;
}

/* Mobile Admin */
@media (max-width: 900px) {
  body.admin-body {
    flex-direction: column;
  }
  .admin-sidebar {
    width: 100%;
  }
  .sidebar-menu {
    display: flex;
    overflow-x: auto;
    padding: 10px;
  }
  .menu-link {
    white-space: nowrap;
    padding: 8px 12px;
  }
  .sidebar-footer {
    display: none;
  }
}
