/**
 * File: styles.css
 * Purpose: Main/global stylesheet for the entire site (base layout, header,
 *          footer, typography, shared components)
 * Used by: every page (loaded via partials/header.php)
 * Note: Other feature stylesheets layer on top of these base styles.
 */

/* === Font face + design tokens === */
@font-face {
  font-family: "Vazirmatn";
  src: url("./fonts/Vazirmatn-variable.woff2") format("woff2-variations"),
       url("./fonts/Vazirmatn-variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
:root {
  --ink: #0f172a;
  --ink-soft: #475569;
  --accent: #2563eb;
  --accent-deep: #1d4ed8;
  --accent-warm: #f97316;
  --card: rgba(255, 255, 255, 0.85);
  --stroke: rgba(15, 23, 42, 0.12);
  --shadow: rgba(15, 23, 42, 0.16);
  --page-start-gap: clamp(1rem, 2vw, 1.6rem);
}

/* === Base reset === */
* {
  box-sizing: border-box;
}

/* === Body + decorative background === */
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  font-family: "Vazirmatn", "Segoe UI", sans-serif;
  text-align: right;
  color: var(--ink);
  position: relative;
  isolation: isolate;
  background: linear-gradient(138deg, #eef5ff 0%, #d8e6ff 36%, #e8f3ff 70%, #d5e1f5 100%);
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
}

body::before {
  z-index: -2;
  background:
    radial-gradient(920px 560px at 108% -8%, rgba(37, 99, 235, 0.32) 0%, rgba(37, 99, 235, 0) 64%),
    radial-gradient(760px 520px at -12% 106%, rgba(14, 116, 144, 0.3) 0%, rgba(14, 116, 144, 0) 60%),
    conic-gradient(from 210deg at 76% 30%, rgba(59, 130, 246, 0.18), rgba(14, 165, 233, 0.08), rgba(99, 102, 241, 0.14), rgba(59, 130, 246, 0.18));
  filter: saturate(1.06) contrast(1.02);
}

body::after {
  z-index: -1;
  opacity: 0.56;
  background-image:
    linear-gradient(120deg, rgba(255, 255, 255, 0.34) 0%, rgba(255, 255, 255, 0) 46%),
    repeating-linear-gradient(125deg, rgba(148, 163, 184, 0.1) 0px, rgba(148, 163, 184, 0.1) 2px, transparent 2px, transparent 36px),
    repeating-linear-gradient(0deg, rgba(148, 163, 184, 0.06) 0px, rgba(148, 163, 184, 0.06) 1px, transparent 1px, transparent 44px),
    repeating-linear-gradient(90deg, rgba(148, 163, 184, 0.06) 0px, rgba(148, 163, 184, 0.06) 1px, transparent 1px, transparent 44px);
  mask-image: radial-gradient(circle at center, rgba(0, 0, 0, 0.75), transparent 88%);
}
a {
  color: inherit;
  text-decoration: none;
}

/* === Site header + footer === */
.site-header,
.site-footer {
  width: min(1120px, 92vw);
  margin: 0 auto;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 600ms ease, transform 600ms ease;
}

.site-header {
  width: 100%;
  margin: 0;
  padding: 0.58rem 0;
  position: sticky;
  top: 0;
  z-index: 80;
  backdrop-filter: blur(12px);
  background: rgba(255, 255, 255, 0.86);
  border-bottom: 1px solid rgba(15, 23, 42, 0.1);
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.12);
  transition: background 220ms ease, box-shadow 220ms ease, border-color 220ms ease, opacity 600ms ease, transform 600ms ease;
}

.site-footer {
  padding: 2.8rem 0;
}

body.is-loaded .site-header,
body.is-loaded .site-footer {
  opacity: 1;
  transform: translateY(0);
}


main {
  flex: 1 0 auto;
  margin-top: var(--page-start-gap);
  opacity: 0;
  transition: opacity 500ms ease;
}

body.is-loaded main {
  opacity: 1;
}


body.is-loaded main > section {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 500ms ease, transform 500ms ease;
}

body.is-loaded main > section:nth-child(1) { transition-delay: 0.1s; }
body.is-loaded main > section:nth-child(2) { transition-delay: 0.2s; }
body.is-loaded main > section:nth-child(3) { transition-delay: 0.3s; }
body.is-loaded main > section:nth-child(4) { transition-delay: 0.4s; }
body.is-loaded main > section:nth-child(5) { transition-delay: 0.5s; }

body.is-loaded main > section {
  opacity: 1;
  transform: translateY(0);
}

body.is-scrolled .site-header {
  background: rgba(255, 255, 255, 0.62);
  border-bottom-color: rgba(15, 23, 42, 0.08);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.header-top {
  display: none;
}


.hamburger {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
  cursor: pointer;
  transition: background 180ms ease, box-shadow 180ms ease;
  flex-shrink: 0;
}

.hamburger:hover {
  background: rgba(37, 99, 235, 0.1);
}

.hamburger:focus-visible {
  outline: 2px solid rgba(37, 99, 235, 0.65);
  outline-offset: 2px;
}

.hamburger.is-open svg {
  display: none;
}

.hamburger.is-open::after {
  content: "";
  display: block;
  width: 20px;
  height: 20px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='currentColor' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M18 6L6 18M6 6l12 12'/%3E%3C/svg%3E") center / contain no-repeat;
}

.header-top-bar {
  display: contents;
}

.header-main {
  position: relative;
  z-index: 5;
  width: min(1820px, 98vw);
  margin: 0 auto;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1.2rem;
  padding: 0.7rem 1.1rem;
  border-radius: 0;
  background: transparent;
  border: none;
  box-shadow: none;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: max-content;
}

.mark {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(37, 99, 235, 0.28);
  color: #fff;
  font-size: 1.1rem;
  font-weight: 700;
  overflow: hidden;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.16);
  position: relative;
  animation: logoBorderPulse 2.4s ease-in-out infinite;
}

.mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.wordmark {
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
}

.name {
  font-family: "Vazirmatn", "Segoe UI", sans-serif;
  font-size: 1.55rem;
  color: var(--ink);
  line-height: 1.2;
}

.tag {
  font-size: 0.88rem;
  color: var(--ink-soft);
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  font-size: 0.95rem;
  color: var(--ink-soft);
  justify-self: center;
  align-items: center;
  justify-content: center;
}

.nav a,
.students-menu > summary,
.admin-menu > summary {
  font-family: "Vazirmatn", "Vazir", "IRANSans", "Tahoma", "Segoe UI", sans-serif;
  font-size: 0.98rem;
  font-weight: 500;
  line-height: 1.55;
}

.nav a {
  padding: 0.38rem 0.72rem;
  border-radius: 10px;
  transition: background 200ms ease, color 200ms ease, transform 200ms ease;
}

.nav a:hover {
  background: rgba(37, 99, 235, 0.14);
  color: var(--accent);
  transform: translateY(-1px);
}

.nav a:focus-visible,
.admin-menu > summary:focus-visible,
.students-menu > summary:focus-visible,
.profile-trigger:focus-visible {
  outline: 2px solid rgba(37, 99, 235, 0.65);
  outline-offset: 2px;
}

.admin-menu {
  position: relative;
}

.admin-menu > summary {
  list-style: none;
  cursor: pointer;
  padding: 0.38rem 0.72rem;
  border-radius: 10px;
  color: var(--ink-soft);
  transition: background 200ms ease, color 200ms ease, transform 200ms ease;
}

.admin-menu > summary::-webkit-details-marker {
  display: none;
}

.admin-menu > summary:hover {
  background: rgba(37, 99, 235, 0.14);
  color: var(--accent);
  transform: translateY(-1px);
}

.admin-menu[open] > summary,
.admin-menu.is-active > summary {
  background: rgba(37, 99, 235, 0.14);
  color: var(--accent);
}

.admin-menu-list {
  position: absolute;
  top: calc(100% + 0.55rem);
  inset-inline-start: 0;
  min-width: 10.5rem;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(148, 163, 184, 0.34);
  border-radius: 14px;
  padding: 0.45rem;
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.16), 0 4px 12px rgba(37, 99, 235, 0.08);
  backdrop-filter: blur(10px);
  z-index: 90;
  opacity: 0;
  transform: translateY(-8px) scale(0.95);
  pointer-events: none;
  transition: opacity 220ms ease, transform 220ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.admin-menu[open] .admin-menu-list {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.admin-menu-list a {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 0.75rem;
  border-radius: 10px;
  color: var(--ink-soft);
  white-space: nowrap;
  font-weight: 500;
  transition: background 180ms ease, color 180ms ease;
  position: relative;
  overflow: hidden;
}

.admin-menu-list a::before {
  content: '';
  width: 18px;
  height: 18px;
  background-size: contain;
  background-repeat: no-repeat;
  opacity: 0.6;
  flex-shrink: 0;
}

.admin-menu-list a.logs::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='currentColor'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z' /%3E%3C/svg%3E");
}

.admin-menu-list a.users::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='currentColor'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M12 4.354a4 4 0 110 5.292M15 21H3v-1a6 6 0 0112 0v1zm0 0h6v-1a6 6 0 00-9-5.197M13 7a4 4 0 11-8 0 4 4 0 018 0z' /%3E%3C/svg%3E");
}

.admin-menu-list a.registration-requests::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='currentColor'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M9 12h6m-6 4h6M7 4h10a2 2 0 012 2v12a2 2 0 01-2 2H7a2 2 0 01-2-2V6a2 2 0 012-2z'/%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M9 8h6'/%3E%3C/svg%3E");
}

.admin-menu-list a.election::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='currentColor'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M9 12l2 2 4-4m5-3H4a1 1 0 00-1 1v10a1 1 0 001 1h16a1 1 0 001-1V8a1 1 0 00-1-1zM7 7V5a5 5 0 0110 0v2'/%3E%3C/svg%3E");
}

.admin-menu-list a.attendance::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='currentColor'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M9 5H7a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-2M9 5a2 2 0 012-2h2a2 2 0 012 2M9 5a2 2 0 002 2h2a2 2 0 002-2m-6 9l2 2 4-4'/%3E%3C/svg%3E");
}

.admin-menu-list a.discipline {
  color: #d97706;
}
.admin-menu-list a.discipline:hover {
  color: #b45309;
}
.admin-menu-list a.discipline::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='currentColor'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M20.618 5.984A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016zM12 9v2m0 4h.01'/%3E%3C/svg%3E");
}

.admin-menu-list a.database::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='currentColor'%3E%3Cellipse cx='12' cy='5' rx='7' ry='3' stroke-width='2'/%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M5 5v14c0 1.657 3.134 3 7 3s7-1.343 7-3V5M5 12c0 1.657 3.134 3 7 3s7-1.343 7-3'/%3E%3C/svg%3E");
}

.admin-menu-list a.library::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='currentColor'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M4 19.5A2.5 2.5 0 0 1 6.5 17H20'/%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M6.5 2H20v20H6.5A2.5 2.5 0 0 1 4 19.5v-15A2.5 2.5 0 0 1 6.5 2z'/%3E%3C/svg%3E");
}


.admin-menu-list a.report-cards::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='currentColor'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M22 10v6M2 10l10-5 10 5-10 5z'/%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M6 12v5c3 3 9 3 12 0v-5'/%3E%3C/svg%3E");
}


.admin-menu-list a.admin-support::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='currentColor'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M21 11.5a8.38 8.38 0 0 1-.9 3.8 8.5 8.5 0 0 1-7.6 4.7 8.38 8.38 0 0 1-3.8-.9L3 21l1.9-5.7a8.38 8.38 0 0 1-.9-3.8 8.5 8.5 0 0 1 4.7-7.6 8.38 8.38 0 0 1 3.8-.9h.5a8.48 8.48 0 0 1 8 8v.5z'/%3E%3C/svg%3E");
}

.admin-menu-list a:not(:last-child) {
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
  padding-bottom: 0.5rem;
  margin-bottom: 0.2rem;
}

.admin-menu-list a:hover,
.admin-menu-list a.active {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.12), rgba(37, 99, 235, 0.06));
  color: var(--accent);
}

.admin-menu-list a:hover::before,
.admin-menu-list a.active::before {
  opacity: 1;
}

.students-menu {
  position: relative;
}

.students-menu > summary {
  list-style: none;
  cursor: pointer;
  padding: 0.38rem 0.72rem;
  border-radius: 10px;
  color: var(--ink-soft);
  transition: background 200ms ease, color 200ms ease, transform 200ms ease;
}

.students-menu > summary::-webkit-details-marker {
  display: none;
}

.students-menu > summary:hover {
  background: rgba(37, 99, 235, 0.14);
  color: var(--accent);
  transform: translateY(-1px);
}

.students-menu[open] > summary,
.students-menu.is-active > summary {
  background: rgba(37, 99, 235, 0.14);
  color: var(--accent);
}

.students-menu-list {
  position: absolute;
  top: calc(100% + 0.55rem);
  inset-inline-start: 0;
  min-width: 10.5rem;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(148, 163, 184, 0.34);
  border-radius: 14px;
  padding: 0.45rem;
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.16), 0 4px 12px rgba(37, 99, 235, 0.08);
  backdrop-filter: blur(10px);
  z-index: 90;
  opacity: 0;
  transform: translateY(-8px) scale(0.95);
  pointer-events: none;
  transition: opacity 220ms ease, transform 220ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.students-menu[open] .students-menu-list {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.students-menu-list a {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 0.75rem;
  border-radius: 10px;
  color: var(--ink-soft);
  white-space: nowrap;
  font-weight: 500;
  transition: background 180ms ease, color 180ms ease;
  position: relative;
  overflow: hidden;
}

.students-menu-list a::before {
  content: '';
  width: 18px;
  height: 18px;
  background-size: contain;
  background-repeat: no-repeat;
  opacity: 0.6;
  flex-shrink: 0;
}

.students-menu-list a.schedule::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='currentColor'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z' /%3E%3C/svg%3E");
}

.students-menu-list a.vote::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='currentColor'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M21 12a9 9 0 11-18 0 9 9 0 0118 0z'/%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M9.75 12l1.5 1.5 3-3'/%3E%3C/svg%3E");
}


.students-menu-list a.support::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='currentColor'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M21 11.5a8.38 8.38 0 0 1-.9 3.8 8.5 8.5 0 0 1-7.6 4.7 8.38 8.38 0 0 1-3.8-.9L3 21l1.9-5.7a8.38 8.38 0 0 1-.9-3.8 8.5 8.5 0 0 1 4.7-7.6 8.38 8.38 0 0 1 3.8-.9h.5a8.48 8.48 0 0 1 8 8v.5z'/%3E%3C/svg%3E");
}


.students-menu-list a.my-grades::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='currentColor'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M22 10v6M2 10l10-5 10 5-10 5z'/%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M6 12v5c3 3 9 3 12 0v-5'/%3E%3C/svg%3E");
}


.students-menu-list a.my-absences::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='currentColor'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' stroke-linecap='round' stroke-linejoin='round' stroke-width='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6' stroke-linecap='round' stroke-width='2'/%3E%3Cline x1='8' y1='2' x2='8' y2='6' stroke-linecap='round' stroke-width='2'/%3E%3Cline x1='3' y1='10' x2='21' y2='10' stroke-linecap='round' stroke-width='2'/%3E%3Cpath d='M9 14l6 6M15 14l-6 6' stroke-linecap='round' stroke-width='2'/%3E%3C/svg%3E");
}

.students-menu-list a.my-discipline::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='currentColor'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M20.618 5.984A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016zM12 9v2m0 4h.01'/%3E%3C/svg%3E");
}

.students-menu-list a:not(:last-child) {
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
  padding-bottom: 0.5rem;
  margin-bottom: 0.2rem;
}

.students-menu-list a:hover,
.students-menu-list a.active {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.12), rgba(37, 99, 235, 0.06));
  color: var(--accent);
}

.students-menu-list a:hover::before,
.students-menu-list a.active::before {
  opacity: 1;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  justify-self: start;
}

.user-chip {
  align-self: center;
  color: var(--ink-soft);
  font-size: 0.9rem;
  white-space: nowrap;
}

.profile-menu {
  position: relative;
}

.profile-trigger {
  list-style: none;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid rgba(15, 23, 42, 0.24);
  box-shadow: 0 8px 16px rgba(15, 23, 42, 0.14);
  cursor: pointer;
  background: #fff;
}

.profile-trigger::-webkit-details-marker {
  display: none;
}

.profile-trigger img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.profile-menu[open] .profile-trigger {
  border-color: rgba(37, 99, 235, 0.72);
  box-shadow: 0 10px 20px rgba(37, 99, 235, 0.24);
}

.profile-menu-list {
  position: absolute;
  top: calc(100% + 0.55rem);
  inset-inline-end: 0;
  min-width: 10.5rem;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(148, 163, 184, 0.34);
  border-radius: 14px;
  padding: 0.45rem;
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.16), 0 4px 12px rgba(37, 99, 235, 0.08);
  backdrop-filter: blur(10px);
  z-index: 120;
  opacity: 0;
  transform: translateY(-8px) scale(0.95);
  pointer-events: none;
  transition: opacity 220ms ease, transform 220ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.profile-menu[open] .profile-menu-list {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.profile-item {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 0.75rem;
  border-radius: 10px;
  color: var(--ink-soft);
  white-space: nowrap;
  font-weight: 500;
  transition: background 180ms ease, color 180ms ease;
  position: relative;
  overflow: hidden;
}

.profile-item::before {
  content: '';
  width: 18px;
  height: 18px;
  background-size: contain;
  background-repeat: no-repeat;
  opacity: 0.6;
  flex-shrink: 0;
}

.profile-item.settings::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='currentColor'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z' /%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M15 12a3 3 0 11-6 0 3 3 0 016 0z' /%3E%3C/svg%3E");
}

.profile-item.logout::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='currentColor'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M17 16l4-4m0 0l-4-4m4 4H7m6 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h4a3 3 0 013 3v1' /%3E%3C/svg%3E");
}

.profile-item.theme-toggle {
  width: 100%;
  border: none;
  background: transparent;
  text-align: right;
  font: inherit;
  cursor: pointer;
}

.profile-item.theme-toggle::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='currentColor'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M21 12.79A9 9 0 1111.21 3c.52 0 .99.05 1.46.14A7 7 0 1020.86 12c.09.47.14.94.14 1.42z'/%3E%3C/svg%3E");
}

.profile-item.theme-toggle.is-dark::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='currentColor'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M12 3v2m0 14v2m9-9h-2M5 12H3m15.364 6.364l-1.414-1.414M7.05 7.05 5.636 5.636m12.728 0-1.414 1.414M7.05 16.95l-1.414 1.414M12 8a4 4 0 100 8 4 4 0 000-8z'/%3E%3C/svg%3E");
}

.profile-item:not(:last-child) {
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
  padding-bottom: 0.5rem;
  margin-bottom: 0.2rem;
}

.profile-item:hover,
.profile-item.active {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.12), rgba(37, 99, 235, 0.06));
  color: var(--accent);
}

.profile-item:hover::before,
.profile-item.active::before {
  opacity: 1;
}

.profile-item.danger {
  color: #be123c;
}

.profile-item.danger::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='currentColor'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M17 16l4-4m0 0l-4-4m4 4H7m6 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h4a3 3 0 013 3v1' /%3E%3C/svg%3E");
}

.profile-item.danger:hover {
  background: linear-gradient(135deg, rgba(190, 18, 60, 0.12), rgba(190, 18, 60, 0.06));
  color: #9f1239;
}


.profile-item.theme-toggle{
  color: rgb(54, 54, 54);
}

.profile-item.theme-toggle:hover{
  color: rgb(0, 0, 0);
  background: linear-gradient(135deg, rgba(26, 45, 68, 0.24), rgba(9, 20, 37, 0.12));
}


.ghost {
  padding: 0.7rem 1.2rem;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: transparent;
  color: var(--ink);
  font-family: "Vazirmatn", "Segoe UI", sans-serif;
  cursor: pointer;
}

.cta {
  padding: 0.7rem 1.3rem;
  border-radius: 999px;
  border: none;
  background: var(--accent);
  color: #fff;
  font-family: "Vazirmatn", "Segoe UI", sans-serif;
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.25);
  cursor: pointer;
  transition: transform 200ms ease, box-shadow 200ms ease;
}

.cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 28px rgba(37, 99, 235, 0.28);
}

.cta-secondary {
  background: #0f766e;
  box-shadow: 0 12px 24px rgba(15, 118, 110, 0.25);
}

.cta-secondary:hover {
  box-shadow: 0 16px 28px rgba(15, 118, 110, 0.28);
}

.site-footer {
  position: relative;
  display: grid;
  gap: 1.8rem;
  border-top: none;
  margin-top: 3rem;
  padding-top: 0;
  padding-bottom: 2.8rem;
  overflow: hidden;
}

.footer-decor {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(700px 350px at 12% 8%, rgba(37, 99, 235, 0.07) 0%, transparent 60%),
    radial-gradient(600px 320px at 88% 92%, rgba(14, 165, 233, 0.05) 0%, transparent 55%),
    radial-gradient(400px 200px at 50% 50%, rgba(99, 102, 241, 0.03) 0%, transparent 70%);
  z-index: 0;
}

.footer-main {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  gap: 2.5rem;
  flex-wrap: wrap;
}

.footer-brand {
  flex: 1 1 280px;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.footer-brand-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.footer-logo-mark {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(37, 99, 235, 0.2);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.12);
  flex-shrink: 0;
  transition: transform 250ms ease, box-shadow 250ms ease;
}

.footer-logo-mark:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.22);
}

.footer-logo-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.footer-title {
  font-family: "Vazirmatn", "Segoe UI", sans-serif;
  font-size: 1.35rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--ink) 40%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.footer-badge {
  font-size: 0.78rem;
  color: var(--ink-soft);
  margin-top: 0.15rem;
  opacity: 0.85;
}

.footer-sub {
  color: var(--ink-soft);
  max-width: 400px;
  line-height: 1.9;
  font-size: 0.88rem;
  margin: 0;
}

.footer-contact {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-contact-item {
  display: inline-flex;
  align-items: flex-start;
  gap: 0.55rem;
  font-size: 0.9rem;
  color: var(--ink-soft);
  padding: 0.45rem 0.65rem;
  border-radius: 10px;
  transition: background 200ms ease, color 200ms ease, transform 200ms ease;
  cursor: pointer;
  width: fit-content;
}

.footer-contact-item svg {
  flex-shrink: 0;
  margin-top: 0.15rem;
  opacity: 0.6;
  transition: opacity 200ms ease, transform 200ms ease;
}

.footer-contact-item:hover {
  background: rgba(37, 99, 235, 0.08);
  color: var(--accent-deep);
  transform: translateX(2px);
}

.footer-contact-item:hover svg {
  opacity: 1;
  transform: scale(1.12);
}

.footer-contact-item:focus-visible {
  outline: 2px solid rgba(37, 99, 235, 0.34);
  outline-offset: 2px;
}

.footer-columns {
  display: flex;
  flex: 2 1 520px;
  gap: 2.2rem;
  flex-wrap: wrap;
}

.footer-col {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-width: 170px;
}

.footer-col-title {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-family: "Vazirmatn", "Segoe UI", sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 0.3rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid rgba(37, 99, 235, 0.15);
}

.footer-col-title svg {
  opacity: 0.5;
  color: var(--accent);
  flex-shrink: 0;
}


.footer-link,
.footer-col a,
.footer-legal a {
  color: var(--ink-soft);
  width: fit-content;
  position: relative;
  padding: 0.42rem 0.6rem;
  padding-inline-start: 0.5rem;
  border-radius: 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  transition:
    color 250ms cubic-bezier(0.22, 1, 0.36, 1),
    background 250ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 250ms cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 250ms cubic-bezier(0.22, 1, 0.36, 1);
}

.footer-link svg,
.footer-col a svg {
  opacity: 0.4;
  flex-shrink: 0;
  transition:
    opacity 250ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 300ms cubic-bezier(0.34, 1.56, 0.64, 1),
    filter 250ms ease;
}

.footer-link {
  font-size: 0.92rem;
}


.footer-link::after,
.footer-col a::after,
.footer-legal a::after {
  content: "";
  position: absolute;
  inset-inline-start: 0.5rem;
  bottom: 2px;
  width: calc(100% - 1rem);
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), #0ea5e9, var(--accent));
  background-size: 200% 100%;
  opacity: 0;
  transform: scaleX(0);
  transform-origin: right center;
  transition:
    transform 280ms cubic-bezier(0.22, 1, 0.36, 1),
    opacity 220ms ease;
  filter: blur(0px);
}


.footer-link::before,
.footer-col a::before {
  content: "";
  position: absolute;
  inset-inline-start: -2px;
  top: 50%;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0;
  transform: translateY(-50%) scale(0);
  transition:
    opacity 250ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 300ms cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 0 6px rgba(37, 99, 235, 0.4);
}

.footer-link:hover,
.footer-col a:hover,
.footer-legal a:hover {
  color: var(--accent-deep);
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.08) 0%, rgba(14, 165, 233, 0.04) 100%);
  transform: translateX(-4px);
  box-shadow: 0 2px 12px rgba(37, 99, 235, 0.06);
}

.footer-link:hover svg,
.footer-col a:hover svg {
  opacity: 1;
  transform: scale(1.2) rotate(-3deg);
  filter: drop-shadow(0 0 3px rgba(37, 99, 235, 0.3));
}

.footer-link:hover::after,
.footer-link:focus-visible::after,
.footer-col a:hover::after,
.footer-col a:focus-visible::after,
.footer-legal a:hover::after,
.footer-legal a:focus-visible::after {
  opacity: 1;
  transform: scaleX(1);
}

.footer-link:hover::before,
.footer-col a:hover::before {
  opacity: 1;
  transform: translateY(-50%) scale(1);
}

.footer-link:focus-visible,
.footer-col a:focus-visible,
.footer-legal a:focus-visible {
  outline: 2px solid rgba(37, 99, 235, 0.34);
  outline-offset: 2px;
}


.footer-bottom {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.84rem;
  color: var(--ink-soft);
  padding-top: 1.2rem;
  border-top: 1px dashed rgba(148, 163, 184, 0.36);
}

.footer-copyright {
  transition: color 200ms ease;
}

.footer-legal {
  display: flex;
  gap: 0.6rem;
}

.footer-legal a {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.38rem 0.75rem;
  border-radius: 999px;
  border: 1px solid rgba(37, 99, 235, 0.12);
  background: rgba(37, 99, 235, 0.04);
  font-size: 0.82rem;
  transition: background 200ms ease, border-color 200ms ease, color 200ms ease, box-shadow 200ms ease, transform 200ms ease;
}

.footer-legal a svg {
  opacity: 0.55;
  transition: opacity 200ms ease;
}

.footer-legal a:hover {
  background: rgba(37, 99, 235, 0.1);
  border-color: rgba(37, 99, 235, 0.3);
  color: var(--accent-deep);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.1);
  transform: translateY(-1px);
}

.footer-legal a:hover svg {
  opacity: 1;
}

.footer-legal a::after {
  display: none;
}

@media (hover: none) {
  .footer-link:hover,
  .footer-col a:hover,
  .footer-legal a:hover,
  .footer-contact-item:hover {
    transform: none;
  }

}

@media (prefers-reduced-motion: reduce) {
  .footer-link,
  .footer-col a,
  .footer-legal a,
  .footer-link::after,
  .footer-col a::after,
  .footer-legal a::after,
  .footer-link::before,
  .footer-col a::before,
  .footer-link svg,
  .footer-col a svg,
  .footer-contact-item,
  .footer-contact-item svg,
  .footer-logo-mark {
    transition: none !important;
  }

  .footer-link::before,
  .footer-col a::before {
    opacity: 0 !important;
    transform: translateY(-50%) scale(0) !important;
  }

  .hamburger {
    transition: none !important;
  }

  .nav {
    transition: none !important;
  }
}

@keyframes logoBorderPulse {
  0%,
  100% {
    border-color: rgba(37, 99, 235, 0.2);
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.16);
  }
  50% {
    border-color: rgba(37, 99, 235, 0.6);
    box-shadow: 0 14px 30px rgba(37, 99, 235, 0.28);
  }
}

@media (max-width: 1100px) {
  .header-main {
    grid-template-columns: 1fr;
    gap: 0.8rem;
    width: min(96vw, 1100px);
    padding: 0.8rem 0.9rem;
  }

  .brand,
  .nav,
  .header-actions {
    justify-self: center;
  }

  .name {
    font-size: 1.35rem;
  }

  .tag {
    text-align: center;
  }

  .profile-menu-list {
    inset-inline-start: 0;
    inset-inline-end: auto;
  }

  .footer-main {
    flex-direction: column;
    gap: 2rem;
  }

  .footer-columns {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.8rem;
  }


}

@media (max-width: 768px) {
  
  .hamburger {
    display: flex;
  }

  
  .header-top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
  }

  .header-main {
    grid-template-columns: 1fr;
    gap: 0;
    padding: 0.6rem 0.8rem;
  }

  .brand {
    min-width: 0;
  }

  .name {
    font-size: 1.15rem;
  }

  .tag {
    font-size: 0.78rem;
  }

  .mark {
    width: 42px;
    height: 42px;
  }

  
  .nav {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0 0;
    border-top: 1px solid var(--stroke);
    margin-top: 0.5rem;
    justify-self: stretch;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 280ms ease, opacity 200ms ease, padding 200ms ease;
  }

  .nav.is-open {
    max-height: 80vh;
    opacity: 1;
    padding: 0.5rem 0;
  }

  .nav a,
  .students-menu > summary,
  .admin-menu > summary {
    padding: 0.65rem 0.8rem;
    border-radius: 10px;
    font-size: 0.95rem;
    min-height: 44px;
    display: flex;
    align-items: center;
  }

  .nav a:hover {
    transform: none;
  }

  
  .admin-menu,
  .students-menu {
    position: static;
  }

  .admin-menu-list,
  .students-menu-list {
    position: static;
    opacity: 1;
    transform: none;
    pointer-events: auto;
    box-shadow: none;
    border: none;
    background: rgba(37, 99, 235, 0.04);
    border-radius: 12px;
    padding: 0.25rem;
    margin-top: 0.15rem;
    display: none;
  }

  .admin-menu[open] .admin-menu-list,
  .students-menu[open] .students-menu-list {
    display: block;
  }

  .admin-menu-list a,
  .students-menu-list a {
    padding: 0.55rem 0.75rem;
    min-height: 44px;
  }

  
  .header-actions {
    justify-self: stretch;
    justify-content: center;
    padding-top: 0.5rem;
    border-top: 1px solid var(--stroke);
    margin-top: 0.3rem;
  }

  .header-actions .cta {
    padding: 0.6rem 1.1rem;
    font-size: 0.9rem;
  }

  .profile-menu-list {
    inset-inline-start: 0;
    inset-inline-end: auto;
  }
}

@media (max-width: 480px) {
  .header-top-bar {
    gap: 0.5rem;
  }

  .name {
    font-size: 1rem;
  }

  .tag {
    display: none;
  }

  .mark {
    width: 38px;
    height: 38px;
  }
}

@media (max-width: 640px) {
  .user-chip-desktop {
    display: none;
  }

  .site-footer {
    padding-top: 2rem;
    padding-bottom: 2.5rem;
  }

  .footer-brand-header {
    gap: 0.6rem;
  }

  .footer-logo-mark {
    width: 38px;
    height: 38px;
    border-radius: 10px;
  }

  .footer-title {
    font-size: 1.2rem;
  }

  .footer-columns {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .footer-col {
    min-width: 0;
  }

  .footer-link,
  .footer-col a {
    padding: 0.55rem;
    min-height: 44px;
    display: flex;
    align-items: center;
  }



  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.8rem;
  }

  .footer-legal {
    flex-wrap: wrap;
    gap: 0.5rem;
  }


}

.admin-menu[open] .admin-menu-list {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.profile-menu[open] .profile-menu-list {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}


.election-hero {
  background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
  color: white;
  border-radius: 20px;
  padding: 2.5rem 2rem;
  margin-bottom: 2.5rem;
  box-shadow: 0 10px 30px rgba(30, 64, 175, 0.25);
  position: relative;
  overflow: hidden;
}

.election-hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,0.18) 0%, transparent 60%);
  opacity: 0.4;
}

.election-card {
  background: rgba(255, 255, 255, 0.96);
  border-radius: 16px;
  padding: 1.8rem 2rem;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.10);
  border: 1px solid rgba(226, 232, 240, 0.7);
  margin-bottom: 2rem;
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.election-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.14);
}

.election-section-title {
  font-size: 1.45rem;
  font-weight: 700;
  color: #1e40af;
  margin: 0 0 1.4rem;
  position: relative;
  padding-bottom: 0.6rem;
}

.election-section-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: 0;
  width: 70px;
  height: 3px;
  background: linear-gradient(to left, #2563eb, #60a5fa);
  border-radius: 2px;
}

.election-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.4rem;
  margin: 1.5rem 0;
}

.election-stat-item {
  background: #f0f7ff;
  border-radius: 14px;
  padding: 1.4rem;
  text-align: center;
  border: 1px solid #bfdbfe;
  transition: all 0.2s;
}

.election-stat-item:hover {
  background: #e0f2fe;
  transform: translateY(-3px);
}

.election-stat-number {
  font-size: 2.2rem;
  font-weight: 800;
  color: #1d4ed8;
  margin-bottom: 0.4rem;
}

.election-progress-bar {
  height: 10px;
  background: #e2e8f0;
  border-radius: 5px;
  overflow: hidden;
  margin-top: 0.6rem;
}

.election-progress-fill {
  height: 100%;
  background: linear-gradient(to right, #3b82f6, #60a5fa);
  transition: width 0.5s ease;
}

.candidate-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.6rem;
  margin-top: 1.5rem;
}

.candidate-card {
  background: white;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(0,0,0,0.08);
  transition: all 0.25s ease;
}

.candidate-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 32px rgba(0,0,0,0.14);
}

.candidate-info {
  padding: 1.3rem;
}

.candidate-name {
  font-size: 1.28rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
  color: #0f172a;
}

.candidate-meta {
  color: #475569;
  font-size: 0.95rem;
  margin-bottom: 1rem;
}

.candidate-votes {
  font-size: 1.1rem;
  font-weight: 600;
  color: #2563eb;
}


.btn-end-election {
  background: linear-gradient(135deg, #ef4444, #b91c1c);
  color: white;
  border: none;
  padding: 0.9rem 2rem;
  font-size: 1.05rem;
  font-weight: 600;
  border-radius: 12px;
  box-shadow: 0 6px 16px rgba(239, 68, 68, 0.3);
  transition: all 0.22s;
}

.btn-end-election:hover {
  background: linear-gradient(135deg, #dc2626, #991b1b);
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(220, 38, 38, 0.4);
}
.tools-menu summary {
  color: #10b981; 
  font-weight: 600;
}

.nav .admin-menu > summary {
  color: #0f766e;
  font-weight: 600;
}

.nav .admin-menu > summary:hover,
.nav .admin-menu[open] > summary,
.nav .admin-menu.is-active > summary {
  color: #115e59;
  background: rgba(15, 118, 110, 0.12);
}

.admin-menu .election {
  color: #8b5cf6; 
}

.admin-menu .election.active {
  color: #7c3aed;
  background: rgba(124, 58, 237, 0.08);
}


.nav .admin-menu > summary {
  color: var(--ink-soft);
  font-weight: 500;
}

.nav .admin-menu > summary:hover,
.nav .admin-menu[open] > summary,
.nav .admin-menu.is-active > summary {
  color: var(--accent);
  background: rgba(37, 99, 235, 0.14);
}

.admin-menu-list a.logs {
  color: #0f766e;
}

.admin-menu-list a.users {
  color: #1d4ed8;
}

.admin-menu-list a.registration-requests {
  color: #49dbff;
}

.admin-menu-list a.election {
  color: #8b5cf6;
}

.admin-menu-list a.attendance {
  color: #b45309;
}

.admin-menu-list a.database {
  color: #0e7490;
}

.admin-menu-list a.logs:hover,
.admin-menu-list a.logs.active {
  color: #0f766e;
  background: rgba(15, 118, 110, 0.1);
}

.admin-menu-list a.users:hover,
.admin-menu-list a.users.active {
  color: #1d4ed8;
  background: rgba(29, 78, 216, 0.1);
}

.admin-menu-list a.registration-requests:hover,
.admin-menu-list a.registration-requests.active {
  color: #49dbff;
  background: rgba(3, 196, 255, 0.1);
}

.admin-menu-list a.election:hover,
.admin-menu-list a.election.active {
  color: #7c3aed;
  background: rgba(124, 58, 237, 0.1);
}

.admin-menu-list a.attendance:hover,
.admin-menu-list a.attendance.active {
  color: #b45309;
  background: rgba(180, 83, 9, 0.12);
}

.admin-menu-list a.database:hover,
.admin-menu-list a.database.active {
  color: #0e7490;
  background: rgba(14, 116, 144, 0.1);
}

.admin-menu-list a.library {
  color: #6d28d9;
}

.admin-menu-list a.library:hover,
.admin-menu-list a.library.active {
  color: #6d28d9;
  background: rgba(109, 40, 217, 0.1);
}


.admin-menu-list a.report-cards {
  color: #059669;
}

.admin-menu-list a.report-cards:hover,
.admin-menu-list a.report-cards.active {
  color: #047857;
  background: rgba(5, 150, 105, 0.1);
}


.admin-menu-list a.admin-support {
  color: #db2777;
}

.admin-menu-list a.admin-support:hover,
.admin-menu-list a.admin-support.active {
  color: #be185d;
  background: rgba(219, 39, 119, 0.1);
}


.students-menu-list a.schedule {
  color: #1d4ed8;
}

.students-menu-list a.vote {
  color: #0f766e;
}

.students-menu-list a.schedule:hover,
.students-menu-list a.schedule.active {
  color: #1d4ed8;
  background: rgba(29, 78, 216, 0.1);
}

.students-menu-list a.vote:hover,
.students-menu-list a.vote.active {
  color: #0f7666;
  background: rgba(15, 118, 110, 0.1);
}

.students-menu-list a.library {
  color: #6d28d9;
}

.students-menu-list a.library::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='currentColor'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M4 19.5A2.5 2.5 0 0 1 6.5 17H20'/%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M6.5 2H20v20H6.5A2.5 2.5 0 0 1 4 19.5v-15A2.5 2.5 0 0 1 6.5 2z'/%3E%3C/svg%3E");
}

.students-menu-list a.library:hover,
.students-menu-list a.library.active {
  color: #6d28d9;
  background: rgba(109, 40, 217, 0.1);
}


.students-menu-list a.support {
  color: #db2777;
}

.students-menu-list a.support:hover,
.students-menu-list a.support.active {
  color: #be185d;
  background: rgba(219, 39, 119, 0.1);
}


.students-menu-list a.my-grades {
  color: #059669;
}

.students-menu-list a.my-grades:hover,
.students-menu-list a.my-grades.active {
  color: #047857;
  background: rgba(5, 150, 105, 0.1);
}


.students-menu-list a.my-absences {
  color: #b45309;
}

.students-menu-list a.my-absences:hover,
.students-menu-list a.my-absences.active {
  color: #92400e;
  background: rgba(180, 83, 9, 0.1);
}

.students-menu-list a.my-discipline {
  color: #d97706;
}

.students-menu-list a.my-discipline:hover,
.students-menu-list a.my-discipline.active {
  color: #b45309;
  background: rgba(180, 83, 9, 0.1);
}



.notif-bell-wrap {
  position: relative;
}

.notif-bell-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.85);
  color: var(--ink-soft);
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  transition: background 200ms ease, color 200ms ease, border-color 200ms ease, box-shadow 200ms ease;
}

.notif-bell-btn:hover {
  background: rgba(37, 99, 235, 0.1);
  color: var(--accent);
  border-color: rgba(37, 99, 235, 0.3);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.12);
}

.notif-bell-btn:focus-visible {
  outline: 2px solid rgba(37, 99, 235, 0.65);
  outline-offset: 2px;
}

.notif-bell-badge {
  position: absolute;
  top: -4px;
  inset-inline-start: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  background: linear-gradient(135deg, #e11d48, #be123c);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  box-shadow: 0 2px 6px rgba(225, 29, 72, 0.35);
  animation: notifBadgePulse 2s ease-in-out infinite;
}

@keyframes notifBadgePulse {
  0%, 100% { box-shadow: 0 2px 6px rgba(225, 29, 72, 0.35); }
  50% { box-shadow: 0 2px 10px rgba(225, 29, 72, 0.55); }
}

.notif-bell-badge[hidden] {
  display: none;
}



.notif-dropdown {
  
  position: fixed;
  top: auto;
  left: auto;
  right: auto;
  bottom: auto;
  width: clamp(280px, calc(100vw - 1.5rem), 380px);
  max-height: min(440px, calc(100vh - 5rem));
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(148, 163, 184, 0.34);
  border-radius: 16px;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.18), 0 4px 12px rgba(37, 99, 235, 0.08);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 200;
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
  overflow: clip;
  overflow-clip-margin: 0;
}

.notif-dropdown.is-open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}


.notif-dropdown-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.8rem 0.95rem;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.92);
}

.notif-dropdown-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.notif-mark-all-btn {
  border: none;
  background: transparent;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: 8px;
  transition: background 180ms ease, color 180ms ease;
}

.notif-mark-all-btn:hover {
  background: rgba(37, 99, 235, 0.1);
  color: var(--accent-deep);
}

.notif-mark-all-btn:focus-visible {
  outline: 2px solid rgba(37, 99, 235, 0.5);
  outline-offset: 1px;
}

.notif-dropdown-list {
  overflow-y: auto;
  overscroll-behavior: contain;
  flex: 1 1 auto;
  min-height: 0;
  padding: 0.35rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.3) transparent;
  -webkit-overflow-scrolling: touch;
  scroll-padding-block: 0.35rem;
}

.notif-dropdown-list::-webkit-scrollbar {
  width: 5px;
}

.notif-dropdown-list::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.3);
  border-radius: 999px;
}



.notif-item {
  display: flex;
  gap: 0.65rem;
  padding: 0.72rem 0.75rem;
  border-radius: 12px;
  cursor: pointer;
  position: relative;
  transition: background 180ms ease;
}

.notif-item:hover {
  background: rgba(37, 99, 235, 0.06);
}

.notif-item.is-unread {
  background: rgba(37, 99, 235, 0.04);
}

.notif-item.is-unread::before {
  content: '';
  position: absolute;
  bottom: 0.75rem;
  inset-inline-end: 0.75rem;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 6px rgba(37, 99, 235, 0.4);
}

.notif-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: rgba(37, 99, 235, 0.1);
  color: var(--accent);
}

.notif-icon svg {
  width: 18px;
  height: 18px;
}

.notif-icon.notif-icon-support {
  background: rgba(15, 118, 110, 0.1);
  color: #0f766e;
}

.notif-icon.notif-icon-registration {
  background: rgba(245, 158, 11, 0.1);
  color: #d97706;
}

.notif-icon.notif-icon-news {
  background: rgba(124, 58, 237, 0.1);
  color: #7c3aed;
}

.notif-icon.notif-icon-absence {
  background: rgba(244, 63, 94, 0.1);
  color: #e11d48;
}

.notif-icon.notif-icon-calendar {
  background: rgba(14, 165, 233, 0.1);
  color: #0ea5e9;
}

.notif-body {
  flex: 1;
  min-width: 0;
}

.notif-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.notif-item-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notif-item.is-read .notif-item-title {
  color: var(--ink-soft);
  font-weight: 500;
}

.notif-item-text {
  font-size: 0.82rem;
  color: var(--ink-soft);
  line-height: 1.5;
  margin-top: 0.15rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.notif-item-time {
  font-size: 0.72rem;
  color: #94a3b8;
  margin-top: 0.3rem;
}

.notif-delete-btn {
  position: absolute;
  top: 0.5rem;
  inset-inline-end: 0.5rem;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  z-index: 2;
  transition: opacity 180ms ease, background 180ms ease, color 180ms ease;
}

.notif-item:hover .notif-delete-btn {
  opacity: 1;
}

.notif-delete-btn:hover {
  background: rgba(225, 29, 72, 0.1);
  color: #e11d48;
}

.notif-delete-btn:focus-visible {
  opacity: 1;
  outline: 2px solid rgba(225, 29, 72, 0.4);
  outline-offset: 1px;
}

.notif-empty {
  text-align: center;
  padding: 2rem 1rem;
  color: #94a3b8;
  font-size: 0.9rem;
}


@media (max-width: 768px) {
  .notif-bell-btn {
    width: 42px;
    height: 42px;
    min-width: 42px;
  }

  .notif-dropdown {
    position: fixed;
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: 100%;
    height: calc(75vh - env(safe-area-inset-bottom, 0px));
    border-radius: 18px 18px 0 0;
    transform: translateY(100%);
    padding-bottom: env(safe-area-inset-bottom, 0px);
    border-bottom: none;
    overflow: hidden;
    overflow-clip-margin: unset;
    display: flex;
    flex-direction: column;
  }

  .notif-dropdown.is-open {
    transform: translateY(0);
  }

  .notif-dropdown-header {
    padding: 1rem 1rem 0.7rem;
    border-radius: 18px 18px 0 0;
    flex-shrink: 0;
  }

  .notif-dropdown-list {
    padding: 0.4rem;
    flex: 1 1 0%;
    min-height: 0;
    overflow-y: auto;
  }

  .notif-item {
    padding: 0.8rem 0.75rem;
    min-height: 48px;
  }

  .notif-icon {
    width: 38px;
    height: 38px;
  }
}

@media (max-width: 480px) {
  .notif-bell-btn {
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 10px;
  }

  .notif-bell-btn svg {
    width: 18px;
    height: 18px;
  }

  .notif-dropdown-header {
    padding: 0.85rem 0.85rem 0.6rem;
    gap: 0.5rem;
  }

  .notif-dropdown-title {
    font-size: 0.92rem;
  }

  .notif-mark-all-btn {
    font-size: 0.76rem;
    padding: 0.2rem 0.4rem;
  }

  .notif-dropdown-list {
    padding: 0.3rem;
  }

  .notif-item {
    padding: 0.7rem 0.65rem;
    gap: 0.5rem;
    min-height: 44px;
  }

  .notif-icon {
    width: 34px;
    height: 34px;
    border-radius: 8px;
  }

  .notif-icon svg {
    width: 16px;
    height: 16px;
  }

  .notif-item-title {
    font-size: 0.84rem;
  }

  .notif-item-text {
    font-size: 0.78rem;
  }

  .notif-item-time {
    font-size: 0.68rem;
  }
}

@media (max-width: 360px) {
  .notif-bell-btn {
    width: 42px;
    height: 42px;
    min-width: 42px;
  }

  .notif-dropdown {
    max-height: calc(80vh - env(safe-area-inset-bottom, 0px));
  }

  .notif-dropdown-header {
    padding: 0.75rem 0.7rem 0.55rem;
    flex-wrap: wrap;
  }

  .notif-dropdown-title {
    font-size: 0.88rem;
    flex: 1 1 auto;
  }

  .notif-mark-all-btn {
    font-size: 0.72rem;
    flex-shrink: 0;
  }

  .notif-item {
    padding: 0.6rem 0.55rem;
    gap: 0.4rem;
  }

  .notif-icon {
    width: 30px;
    height: 30px;
    border-radius: 8px;
  }

  .notif-icon svg {
    width: 14px;
    height: 14px;
  }

  .notif-item-title {
    font-size: 0.8rem;
  }

  .notif-item-text {
    font-size: 0.74rem;
    -webkit-line-clamp: 1;
  }
}

@media (hover: none) {
  .notif-delete-btn {
    opacity: 0.6;
    width: 32px;
    height: 32px;
  }

  .notif-item {
    padding-inline-end: 2.2rem;
  }
}

@media (hover: none) and (max-width: 480px) {
  .notif-delete-btn {
    width: 36px;
    height: 36px;
    opacity: 0.7;
  }

  .notif-item {
    padding-inline-end: 2.5rem;
    padding-block: 0.85rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .notif-bell-badge {
    animation: none !important;
  }

  .notif-bell-btn,
  .notif-dropdown,
  .notif-item,
  .notif-delete-btn,
  .notif-mark-all-btn {
    transition: none !important;
  }
}



.page {
  width: min(1320px, 96vw);
  margin-inline: auto;
  margin-block: var(--page-start-gap) 3rem;
}


:root { color-scheme: light; }
:root[data-theme=dark] { color-scheme: dark; }
