/* ============================================================
   Sistema de Concursos para Ferias y Eventos
   style.css — Estilos personalizados
   ============================================================ */

/* ── Variables CSS ────────────────────────────────────────── */
:root {
  --primary:       #2563eb;
  --primary-dark:  #1d4ed8;
  --primary-light: #eff6ff;
  --success:       #16a34a;
  --warning:       #d97706;
  --danger:        #dc2626;
  --sidebar-width: 260px;
  --sidebar-bg:    #0f172a;
  --sidebar-hover: rgba(255,255,255,.07);
  --topbar-h:      60px;
  --body-bg:       #f1f5f9;
  --card-radius:   12px;
  --font:          'Inter', system-ui, sans-serif;
}

/* ── Reset / Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: var(--font);
  background: var(--body-bg);
  color: #1e293b;
  margin: 0;
  min-height: 100vh;
  font-size: .9rem;
}

/* ── Layout Wrapper ───────────────────────────────────────── */
#wrapper {
  min-height: 100vh;
  overflow: hidden;
}

/* ── SIDEBAR ──────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-width);
  min-height: 100vh;
  background: var(--sidebar-bg);
  color: #cbd5e1;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  flex-shrink: 0;
  transition: width .3s ease, transform .3s ease;
  z-index: 1040;
  display: flex;
  flex-direction: column;
}

.sidebar-brand {
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  display: flex;
  align-items: center;
  font-size: 1rem;
  color: #f8fafc;
  flex-shrink: 0;
}

.brand-text { letter-spacing: -.2px; }

.sidebar-body {
  flex: 1;
  padding: 12px 8px;
}

.sidebar .nav-link {
  color: #94a3b8;
  border-radius: 8px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 500;
  font-size: .875rem;
  transition: background .15s, color .15s;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
}

.sidebar .nav-link i { font-size: 1rem; flex-shrink: 0; }

.sidebar .nav-link:hover {
  background: var(--sidebar-hover);
  color: #f8fafc;
}

.sidebar .nav-link.active {
  background: var(--primary);
  color: #fff !important;
  box-shadow: 0 4px 12px rgba(37,99,235,.35);
}

.nav-section-label {
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #475569;
  padding: 14px 14px 6px;
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid rgba(255,255,255,.08);
  flex-shrink: 0;
}

.avatar-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: .875rem;
  flex-shrink: 0;
}

.avatar-sm {
  width: 30px;
  height: 30px;
  font-size: .75rem;
}

/* Overlay móvil */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 1039;
}

.sidebar-overlay.active { display: block; }

/* Sidebar colapsado en móvil */
.sidebar-collapsed .sidebar {
  transform: translateX(calc(-1 * var(--sidebar-width)));
  position: fixed;
}

/* ── CONTENIDO PRINCIPAL ─────────────────────────────────── */
.main-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── TOPBAR ───────────────────────────────────────────────── */
.topbar {
  height: var(--topbar-h);
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
  flex-shrink: 0;
}

.topbar-title { font-size: 1rem; }

.sidebar-toggle {
  color: #64748b;
  text-decoration: none;
}

.sidebar-toggle:hover { color: var(--primary); }

/* ── PÁGINA ───────────────────────────────────────────────── */
.page-content {
  padding: 1.5rem;
  flex: 1;
}

/* ── TARJETAS ESTADÍSTICAS ───────────────────────────────── */
.stat-card {
  border-radius: var(--card-radius) !important;
  transition: transform .2s, box-shadow .2s;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,.1) !important;
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.1;
  color: #0f172a;
}

.stat-label {
  font-size: .78rem;
  color: #64748b;
  font-weight: 500;
}

/* ── CARDS GENERALES ──────────────────────────────────────── */
.card {
  border-radius: var(--card-radius) !important;
}

/* ── TABLAS ───────────────────────────────────────────────── */
.table {
  font-size: .875rem;
}

.table thead th {
  font-weight: 600;
  font-size: .78rem;
  letter-spacing: .3px;
  text-transform: uppercase;
  color: #64748b;
  border-bottom: 1px solid #e2e8f0;
  padding: .65rem .75rem;
}

.table tbody td {
  padding: .65rem .75rem;
  vertical-align: middle;
  border-color: #f1f5f9;
}

.table-hover tbody tr:hover { background: #f8fafc; }

/* ── BOTONES ──────────────────────────────────────────────── */
.btn {
  border-radius: 8px;
  font-weight: 500;
  font-size: .875rem;
  transition: all .15s;
}

.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
}

.btn-primary:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
}

/* ── FORMULARIOS ──────────────────────────────────────────── */
.form-control, .form-select {
  border-radius: 8px;
  border-color: #e2e8f0;
  font-size: .875rem;
  transition: border-color .15s, box-shadow .15s;
}

.form-control:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}

.input-group-text {
  background: #f8fafc;
  border-color: #e2e8f0;
  color: #64748b;
  border-radius: 8px 0 0 8px;
}

/* ── AUTH PAGES ───────────────────────────────────────────── */
.auth-body {
  background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 50%, #0f172a 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.auth-container {
  width: 100%;
  max-width: 420px;
}

.auth-card {
  border-radius: 16px !important;
  overflow: hidden;
}

.auth-logo {
  width: 70px;
  height: 70px;
  background: linear-gradient(135deg, var(--primary), #7c3aed);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: gold;
  margin: 0 auto;
}

/* ── BADGE ────────────────────────────────────────────────── */
.badge { border-radius: 6px; font-weight: 600; }

/* ── RESPONSIVE ───────────────────────────────────────────── */
@media (max-width: 991.98px) {
  .sidebar {
    position: fixed;
    left: 0; top: 0;
    height: 100vh;
    transform: translateX(calc(-1 * var(--sidebar-width)));
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 24px rgba(0,0,0,.25);
  }

  .sidebar-overlay.active { display: block; }

  .page-content { padding: 1rem; }
}

@media (max-width: 575.98px) {
  .stat-value { font-size: 1.4rem; }
  .page-content { padding: .75rem; }
}

/* ── PRINT ────────────────────────────────────────────────── */
@media print {
  .sidebar, .topbar, .btn, nav, .sidebar-toggle { display: none !important; }
  .main-content { margin: 0 !important; }
  .page-content { padding: 0 !important; }
  .card { box-shadow: none !important; border: 1px solid #ddd !important; }
}

/* ── MODAL ────────────────────────────────────────────────── */
.modal-content { border-radius: 14px !important; }
.modal-header  { border-bottom: 1px solid #f1f5f9; }
.modal-footer  { border-top: 1px solid #f1f5f9; }

/* ── ALERT ────────────────────────────────────────────────── */
.alert { border-radius: 10px; border: none; }
.alert-info    { background: #eff6ff; color: #1e40af; }
.alert-success { background: #f0fdf4; color: #166534; }
.alert-danger  { background: #fef2f2; color: #991b1b; }

/* ── MISCELLANEOUS ────────────────────────────────────────── */
.text-truncate-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Scrollbar personalizado */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }
