/* =========================================================
   E-Voting OSIS — Design System (AdminKit-aligned)
   ========================================================= */
:root {
  --ek-primary: #3B7DDD;
  --ek-primary-dark: #2f66b3;
  --ek-navy: #222E3C;
  --ek-bg: #F7F9FC;
  --ek-card: #FFFFFF;
  --ek-success: #28A745;
  --ek-warning: #FFC107;
  --ek-text: #495057;
  --ek-radius: 0.5rem;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--ek-bg);
  color: var(--ek-text);
  font-size: 14px;
}

h1 { font-size: 24px; font-weight: 700; color: var(--ek-navy); }
h2 { font-size: 20px; font-weight: 600; color: var(--ek-primary); }
h3 { font-size: 16px; font-weight: 500; color: var(--ek-text); }

a { color: var(--ek-primary); text-decoration: none; }
a:hover { color: var(--ek-primary-dark); }

.btn-primary {
  background-color: var(--ek-primary);
  border-color: var(--ek-primary);
  font-weight: 500;
  border-radius: 0.25rem;
}
.btn-primary:hover, .btn-primary:focus {
  background-color: var(--ek-primary-dark);
  border-color: var(--ek-primary-dark);
}
.btn-outline-primary { color: var(--ek-primary); border-color: var(--ek-primary); }
.btn-outline-primary:hover { background-color: var(--ek-primary); border-color: var(--ek-primary); }

.badge.bg-primary { background-color: var(--ek-primary) !important; }
.badge.bg-success { background-color: var(--ek-success) !important; }
.badge.bg-warning { background-color: var(--ek-warning) !important; color: #212529 !important; }

/* ---------- Public hero ---------- */
.ek-hero {
  background: linear-gradient(135deg, var(--ek-navy) 0%, #2c3e50 100%);
  color: #fff;
  padding: 64px 0 96px;
  position: relative;
}
.ek-hero::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 60px;
  background: var(--ek-bg);
  clip-path: polygon(0 100%, 100% 100%, 100% 0);
}
.ek-hero .badge-status {
  font-size: 13px;
  padding: 6px 14px;
  border-radius: 50px;
}
.ek-hero img.school-logo {
  height: 56px;
  width: 56px;
  object-fit: cover;
  border-radius: 12px;
  background: #fff;
  padding: 4px;
}

/* ---------- Candidate cards ---------- */
.candidate-card {
  background: var(--ek-card);
  border: 0;
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 .25rem 1rem rgba(0,0,0,.06);
  transition: transform .15s ease, box-shadow .15s ease;
}
/* Pull the whole grid up into the hero once, instead of pulling every card up individually */
#candidatesGrid {
  margin-top: -48px;
}
.candidate-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 .5rem 1.5rem rgba(0,0,0,.10);
}
.candidate-card .card-img-top {
  height: 280px;
  object-fit: cover;
  background: #dfe6ee;
}
.candidate-card .badge-number {
  position: absolute;
  top: 12px;
  left: 12px;
  background: var(--ek-primary);
  color: #fff;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 50px;
  box-shadow: 0 2px 6px rgba(0,0,0,.2);
}

/* ---------- Admin layout ---------- */
.ek-admin-wrapper { display: flex; min-height: 100vh; }
.ek-sidebar {
  width: 250px;
  flex-shrink: 0;
  background-color: var(--ek-navy);
  color: #cfd8e3;
  min-height: 100vh;
  position: sticky;
  top: 0;
}
.ek-sidebar .brand {
  padding: 20px;
  font-weight: 700;
  color: #fff;
  border-bottom: 1px solid rgba(255,255,255,.08);
  display: flex;
  align-items: center;
  gap: 10px;
}
.ek-sidebar .nav-link {
  color: #adb9c9;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 0;
  font-size: 14px;
}
.ek-sidebar .nav-link i { width: 18px; height: 18px; }
.ek-sidebar .nav-link:hover { color: #fff; background: rgba(255,255,255,.05); }
.ek-sidebar .nav-link.active {
  color: #fff;
  background: var(--ek-primary);
  border-left: 3px solid #fff;
}
.ek-sidebar .nav-section-title {
  color: #6b7a8f;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: 16px 20px 6px;
}

.ek-main { flex: 1; min-width: 0; }
.ek-topbar {
  background: #fff;
  border-bottom: 1px solid #e6e9ee;
  padding: 14px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.ek-content { padding: 24px; }

.stat-card {
  background: var(--ek-card);
  border-radius: var(--ek-radius);
  padding: 20px;
  box-shadow: 0 .125rem .5rem rgba(0,0,0,.05);
  height: 100%;
}
.stat-card .stat-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
}
.stat-card .stat-value { font-size: 26px; font-weight: 700; color: var(--ek-navy); }
.stat-card .stat-label { font-size: 13px; color: #8a97a8; }

.card { border: 0; border-radius: var(--ek-radius); box-shadow: 0 .125rem .5rem rgba(0,0,0,.05); }
.card-header { background: #fff; border-bottom: 1px solid #eef1f5; font-weight: 600; color: var(--ek-navy); }

.table thead th {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #8a97a8;
  border-bottom-width: 1px;
}

.progress { height: 10px; border-radius: 50px; background: #eef1f5; }
.progress-bar { background-color: var(--ek-primary); }

.ek-sidebar-close { display: none; }
.ek-sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 1040;
}
@media (max-width: 991.98px) {
  .ek-sidebar { position: fixed; left: -250px; z-index: 1050; transition: left .2s ease; }
  .ek-sidebar.show { left: 0; }
  .ek-sidebar-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    background: transparent;
    border: 0;
    color: #cfd8e3;
    padding: 4px;
  }
  .ek-sidebar-backdrop.show { display: block; }
}
