/* سامانه انتخابات و مدیریت - دانشگاه پیام نور */
:root {
  --g-900: #0b4a26;
  --g-800: #0f5a2e;
  --g-700: #14733a;
  --g-600: #1a8f43;
  --g-500: #1fa04c;
  --g-100: #e3f5e8;
  --g-50: #f0faf3;
  --bg: #f1f4f2;
  --card: #ffffff;
  --ink: #1b2a22;
  --muted: #667a6f;
  --line: #e7ece9;
  --shadow: 0 1px 2px rgba(15, 60, 35, .06), 0 4px 14px rgba(15, 60, 35, .05);
  --r: 14px;
  --font: 'Vazirmatn', 'Vazir', Tahoma, 'Segoe UI', sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.7;
  direction: rtl;
  text-align: right;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--g-500); outline-offset: 2px; }
svg { flex: none; }

/* ============ چیدمان پنل ============ */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 268px; flex: none;
  background: linear-gradient(180deg, #0f5d2f 0%, #0b4a26 100%);
  color: #fff;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  padding: 18px 14px 20px;
  z-index: 50;
}
.sidebar::-webkit-scrollbar { width: 0; }
.brand { display: flex; align-items: center; gap: 12px; padding: 6px 8px 22px; }
.brand-text { line-height: 1.35; }
.brand-text strong { display: block; font-size: 19px; font-weight: 800; letter-spacing: -.2px; }
.brand-text span { font-size: 11.5px; opacity: .85; }

.nav { list-style: none; margin: 0; padding: 0; }
.nav > li { margin-bottom: 3px; }
.nav-link {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 11px 14px; border-radius: 11px; border: 0; background: transparent;
  color: #fff; font-size: 14.5px; font-weight: 600; text-align: right;
  transition: background .15s;
}
.nav-link:hover { background: rgba(255, 255, 255, .08); }
.nav-link.active { background: var(--g-600); box-shadow: 0 6px 14px rgba(0, 0, 0, .18); }
.nav-link .label { flex: 1; }
.nav-link .caret { transition: transform .2s; opacity: .8; }
.nav-item.open > .nav-link .caret { transform: rotate(180deg); }
.sub { list-style: none; margin: 2px 0 6px; padding: 0 22px 0 0; display: none; }
.nav-item.open > .sub { display: block; }
.sub a { display: block; padding: 7px 14px; border-radius: 9px; font-size: 13.5px; color: rgba(255, 255, 255, .82); }
.sub a:hover, .sub a.active { background: rgba(255, 255, 255, .09); color: #fff; }

.main { flex: 1; min-width: 0; padding: 18px 20px 28px; }

/* ============ نوار بالا ============ */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  background: var(--card); border-radius: var(--r); box-shadow: var(--shadow);
  padding: 8px 14px; margin-bottom: 16px;
}
.top-right, .top-left { display: flex; align-items: center; gap: 12px; }
.hello { display: flex; align-items: center; gap: 10px; padding: 4px 10px; }
.hello b { font-weight: 600; font-size: 15px; }
.avatar {
  width: 40px; height: 40px; border-radius: 50%; position: relative;
  background: linear-gradient(135deg, #cfe9d7, #8bc9a0);
  display: grid; place-items: center; color: var(--g-800); font-weight: 800;
  border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line);
}
.avatar::after {
  content: ''; position: absolute; bottom: -1px; left: -1px; width: 11px; height: 11px;
  background: #22b455; border: 2px solid #fff; border-radius: 50%;
}
.date-chip { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: #2a3b32; padding: 0 12px; }
.date-chip svg { color: var(--g-700); }
.icon-btn {
  width: 40px; height: 40px; display: grid; place-items: center; position: relative;
  background: transparent; border: 0; border-radius: 10px; color: #2b3a32;
}
.icon-btn:hover { background: var(--g-50); }
.badge {
  position: absolute; top: 2px; right: 3px; min-width: 17px; height: 17px; padding: 0 4px;
  background: #e5342f; color: #fff; border-radius: 9px; font-size: 10px; font-weight: 700;
  display: grid; place-items: center; line-height: 1; border: 2px solid #fff; box-sizing: content-box;
}
.logout-btn {
  display: flex; align-items: center; gap: 8px; padding: 9px 18px;
  background: #f1f3f2; border: 0; border-radius: 10px; font-size: 13.5px; font-weight: 500; color: #25332b;
}
.logout-btn:hover { background: #e6ebe8; }
.menu-toggle { display: none; }

/* ============ کارت‌های آماری ============ */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 16px; }
.stat {
  display: flex; align-items: center; gap: 16px; padding: 18px 22px;
  border-radius: var(--r); border: 1px solid transparent; box-shadow: var(--shadow);
}
.stat .ico { width: 88px; height: 88px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.stat .num { font-size: 29px; font-weight: 800; line-height: 1.1; letter-spacing: .2px; }
.stat .num small { display: block; font-size: 9px; font-weight: 400; color: var(--muted); margin-top: 1px; line-height: 1.2; }
.stat .cap { font-size: 13.5px; color: #3c4d43; margin-top: 2px; }
.stat .body { flex: 1; text-align: right; }
.stat.orange { background: #fff3e4; border-color: #f7e3c9; }
.stat.orange .ico { background: #fde2bf; color: #f08a24; }
.stat.purple { background: #f5f0ff; border-color: #e7ddfa; }
.stat.purple .ico { background: #e2d5f8; color: #7e3fc9; }
.stat.blue { background: #eef5ff; border-color: #d9e7fb; }
.stat.blue .ico { background: #d3e4fb; color: #1e64c8; }
.stat.green { background: #eaf9ee; border-color: #d3efdb; }
.stat.green .ico { background: #d5f1dd; color: #1e9a49; }
.stat .ico svg { width: 38px; height: 38px; }

/* ============ کارت و جدول ============ */
.card { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 20px; }
.card-title { display: flex; align-items: center; gap: 10px; font-size: 17px; font-weight: 800; margin: 0; }
.card-title svg { color: var(--g-600); }
.btn-pill {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 18px; border-radius: 22px;
  background: var(--g-700); color: #fff; font-size: 13px; font-weight: 600; border: 0;
}
.btn-pill:hover { background: var(--g-800); }
.btn-soft { background: #fff; color: #234; border: 1px solid var(--line); }

.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; min-width: 720px; }
.tbl th {
  background: #f5f7f6; color: #1d2b23; font-weight: 700; font-size: 14px;
  padding: 11px 18px; text-align: right; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.tbl td { padding: 10px 18px; font-size: 14px; border-bottom: 1px solid #f0f3f1; color: #2a3a31; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover { background: #fafcfb; }
.tbl .num-col { width: 70px; }
.chip { display: inline-block; padding: 1px 16px; border-radius: 14px; font-size: 13px; font-weight: 600; background: var(--g-100); color: #17803f; }
.chip.pending { background: #fff3d6; color: #a86d00; }
.chip.inactive { background: #fde4e2; color: #b3261e; }

/* ============ ردیف پایین داشبورد ============ */
.bottom { display: grid; grid-template-columns: 1fr 1.28fr 1.38fr; gap: 16px; margin-top: 16px; }
.pad { padding: 0 20px 20px; }

.activity { list-style: none; margin: 0; padding: 0 20px 6px; }
.activity li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 0; border-top: 1px solid var(--line); font-size: 13.5px; }
.activity li:first-child { border-top: 1px solid var(--line); }
.activity .dot { width: 11px; height: 11px; border-radius: 50%; background: #22b455; flex: none; box-shadow: 0 0 0 3px #e3f5e8; }
.activity .msg { display: flex; align-items: center; gap: 10px; flex: 1; }
.activity time { font-size: 12px; color: #55675d; white-space: nowrap; }

.notice-wrap { position: relative; margin: 0 20px 20px; border-radius: 12px; overflow: hidden; background: linear-gradient(135deg, #0f6a35, #0c5a2c 60%, #0a4d26); color: #fff; min-height: 228px; }
.slide { display: none; padding: 22px 24px 70px; min-height: 228px; position: relative; }
.slide.on { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.slide .art { flex: none; margin-top: 4px; margin-right: -6px; }
.slide .txt { flex: 1; }
.slide h4 { margin: 8px 0 8px; font-size: 21px; line-height: 1.7; font-weight: 800; }
.slide p { margin: 18px 0 0; font-size: 12.5px; opacity: .92; }
.notice-foot { position: absolute; bottom: 14px; left: 14px; right: 14px; display: flex; align-items: center; justify-content: space-between; }
.btn-light { display: inline-flex; align-items: center; gap: 8px; background: #fff; color: #17432a; padding: 8px 18px; border-radius: 20px; font-size: 13px; font-weight: 600; border: 0; }
.dots { display: flex; gap: 6px; }
.dots button { width: 17px; height: 6px; border-radius: 4px; border: 0; background: rgba(255, 255, 255, .4); padding: 0; }
.dots button.on { background: #fff; }

.quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; padding: 0 20px 20px; }
.q-tile {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  height: 94px; border-radius: 12px; font-size: 13.5px; font-weight: 600; text-align: center; line-height: 1.4;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .02); transition: transform .15s;
}
.q-tile:hover { transform: translateY(-2px); }
.q-tile svg { width: 34px; height: 34px; }
.q-orange { background: #fdf0de; color: #d9761a; }
.q-green { background: #e5f7ea; color: #1b8f44; }
.q-blue { background: #e6f0fd; color: #2468c7; }
.q-purple { background: #f0eafc; color: #7a45c6; }
.q-teal { background: #dff4ee; color: #1a8a72; }
.q-tile span { color: #1d2b23; }

/* ============ صفحه ورود ============ */
.login-page { min-height: 100vh; display: grid; place-items: center; background: linear-gradient(135deg, #0b4a26, #14733a 60%, #1a8f43); padding: 20px; }
.login-card { width: 100%; max-width: 400px; background: #fff; border-radius: 18px; padding: 30px 28px; box-shadow: 0 20px 50px rgba(0, 0, 0, .25); }
.login-card .brand-l { display: flex; flex-direction: column; align-items: center; gap: 6px; margin-bottom: 20px; text-align: center; }
.login-card h1 { font-size: 20px; margin: 4px 0 0; font-weight: 800; color: var(--g-800); }
.login-card p.sub-t { margin: 0; color: var(--muted); font-size: 13px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 5px; }
.input {
  width: 100%; padding: 11px 14px; border: 1px solid #d6dfd9; border-radius: 10px; font: inherit; background: #fbfdfc; direction: ltr; text-align: right;
}
.input.rtl { direction: rtl; }
.input:focus { outline: 2px solid #b9e3c7; border-color: var(--g-500); }
.btn-block { width: 100%; padding: 12px; border-radius: 10px; border: 0; background: var(--g-700); color: #fff; font-size: 15px; font-weight: 700; }
.btn-block:hover { background: var(--g-800); }
.alert { padding: 10px 14px; border-radius: 10px; background: #fde8e6; color: #a8231b; margin-bottom: 14px; font-size: 13px; }
.alert.ok { background: #e3f5e8; color: #17703a; }

/* ============ صفحات داخلی (جستجو و صفحه‌بندی) ============ */
.toolbar { display: flex; gap: 10px; padding: 0 20px 14px; flex-wrap: wrap; }
.toolbar .input { max-width: 280px; direction: rtl; }
.pager { display: flex; gap: 6px; padding: 14px 20px; justify-content: center; flex-wrap: wrap; }
.pager a, .pager span { min-width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px; background: #f2f5f3; font-size: 13px; }
.pager .cur { background: var(--g-700); color: #fff; }
.empty { padding: 50px 20px; text-align: center; color: var(--muted); }

/* ============ صفحه اصلی سایت ============ */
.site-head { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 40; }
.wrap { width: min(1180px, 92%); margin-inline: auto; }
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; gap: 16px; }
.site-brand { display: flex; align-items: center; gap: 12px; }
.site-brand strong { display: block; font-size: 17px; font-weight: 800; color: var(--g-800); line-height: 1.3; }
.site-brand span { font-size: 12px; color: var(--muted); }
.site-nav { display: flex; gap: 6px; align-items: center; }
.site-nav a { padding: 8px 14px; border-radius: 10px; font-weight: 600; font-size: 14px; color: #2a3b32; }
.site-nav a:hover { background: var(--g-50); }
.site-nav a.cta { background: var(--g-700); color: #fff; }
.site-nav a.cta:hover { background: var(--g-800); }

.hero { background: linear-gradient(135deg, #0b4a26 0%, #12713a 60%, #1a8f43 100%); color: #fff; position: relative; overflow: hidden; }
.hero::before {
  content: ''; position: absolute; inset: -40% auto -40% -10%; width: 520px;
  background: repeating-conic-gradient(from 0deg at 50% 50%, rgba(217, 177, 59, .16) 0 3deg, transparent 3deg 9deg);
  border-radius: 50%; mask-image: radial-gradient(circle, #000 20%, transparent 68%); -webkit-mask-image: radial-gradient(circle, #000 20%, transparent 68%);
}
.hero .wrap { display: grid; grid-template-columns: 1.15fr .85fr; gap: 30px; align-items: center; padding: 64px 0 70px; position: relative; }
.hero h1 { font-size: clamp(26px, 4vw, 40px); margin: 0 0 14px; line-height: 1.55; font-weight: 800; }
.hero p { margin: 0 0 26px; font-size: 16px; opacity: .92; max-width: 54ch; }
.hero .actions { display: flex; gap: 12px; flex-wrap: wrap; }
.btn-gold { background: #e4bd45; color: #3b2d00; padding: 12px 26px; border-radius: 12px; font-weight: 800; font-size: 15px; display: inline-flex; gap: 8px; align-items: center; }
.btn-ghost { border: 1.5px solid rgba(255, 255, 255, .55); color: #fff; padding: 11px 24px; border-radius: 12px; font-weight: 600; }
.hero-card { background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .22); backdrop-filter: blur(6px); border-radius: 18px; padding: 20px; }
.hero-card h3 { margin: 0 0 12px; font-size: 16px; }
.hero-card ul { list-style: none; margin: 0; padding: 0; }
.hero-card li { display: flex; justify-content: space-between; gap: 10px; padding: 10px 0; border-top: 1px solid rgba(255, 255, 255, .18); font-size: 14px; }
.hero-card li:first-child { border-top: 0; }

.sec { padding: 46px 0 6px; }
.sec h2 { font-size: 22px; margin: 0 0 18px; font-weight: 800; color: var(--g-800); display: flex; align-items: center; gap: 10px; }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: -34px; position: relative; z-index: 2; }
.kpi { background: #fff; border-radius: 16px; box-shadow: var(--shadow); padding: 18px 20px; display: flex; align-items: center; gap: 14px; }
.kpi .ico { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; }
.kpi b { display: block; font-size: 24px; line-height: 1.2; font-weight: 800; }
.kpi span { color: var(--muted); font-size: 13px; }
.cards3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.el-card { background: #fff; border-radius: 16px; box-shadow: var(--shadow); padding: 20px; display: flex; flex-direction: column; gap: 10px; }
.el-card h3 { margin: 0; font-size: 16.5px; font-weight: 800; }
.el-card .meta { color: var(--muted); font-size: 13px; display: flex; flex-direction: column; gap: 2px; }
.el-card .chip { align-self: flex-start; }
.news { display: grid; gap: 12px; }
.news-item { background: #fff; border-radius: 14px; box-shadow: var(--shadow); padding: 16px 20px; display: flex; gap: 14px; align-items: flex-start; }
.news-item .ni { width: 42px; height: 42px; border-radius: 12px; background: var(--g-100); color: var(--g-700); display: grid; place-items: center; flex: none; }
.news-item h4 { margin: 0 0 2px; font-size: 15px; }
.news-item p { margin: 0; color: var(--muted); font-size: 13.5px; }
.site-foot { margin-top: 54px; background: var(--g-900); color: #d6ecdc; padding: 26px 0; font-size: 13px; }
.site-foot .wrap { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: center; }

/* ============ واکنش‌گرا ============ */
@media (max-width: 1280px) {
  .stat .ico { width: 70px; height: 70px; }
  .stat .ico svg { width: 30px; height: 30px; }
  .bottom { grid-template-columns: 1fr 1fr; }
  .bottom .col-quick { grid-column: 1 / -1; }
}
@media (max-width: 1024px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .sidebar { position: fixed; top: 0; right: 0; transform: translateX(100%); transition: transform .25s; box-shadow: -10px 0 30px rgba(0, 0, 0, .25); }
  .sidebar.open { transform: none; }
  .menu-toggle { display: grid; }
  .date-chip { display: none; }
  .hero .wrap { grid-template-columns: 1fr; padding: 44px 0 56px; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .cards3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .main { padding: 12px; }
  .stats, .bottom { grid-template-columns: 1fr; }
  .quick { grid-template-columns: repeat(2, 1fr); }
  .logout-btn span { display: none; }
  .slide.on { flex-direction: column-reverse; align-items: center; }
  .kpis, .cards3 { grid-template-columns: 1fr; }
  .site-nav a:not(.cta) { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
