@font-face {
  font-family: "IRANSansX";
  src: url("/dashboard/static/fonts/IRANSansX-Regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "IRANSansX";
  src: url("/dashboard/static/fonts/IRANSansX-Medium.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: "IRANSansX";
  src: url("/dashboard/static/fonts/IRANSansX-Bold.woff2") format("woff2");
  font-weight: 700 900;
  font-display: swap;
}

:root {
  --page: #f6f8ff;
  --card: rgba(255,255,255,.92);
  --text: #151a34;
  --muted: #727991;
  --line: #e5e9f6;
  --line-strong: #d8deef;
  --purple: #725cff;
  --purple-dark: #4f3bea;
  --purple-soft: #eeeaff;
  --cyan: #24c7b8;
  --green: #2ed69f;
  --red: #ef4444;
  --shadow: 0 28px 70px rgba(49,62,110,.14);
  --shadow-soft: 0 16px 38px rgba(49,62,110,.10);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: "IRANSansX", Tahoma, Arial, sans-serif;
  color: var(--text);
  background: var(--page);
}

button, input, select { font-family: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.full { width: 100%; }

.edu-bg {
  background:
    radial-gradient(circle at 82% 5%, rgba(36,199,184,.18), transparent 30rem),
    radial-gradient(circle at 18% 88%, rgba(114,92,255,.14), transparent 35rem),
    linear-gradient(135deg, #fbfcff 0%, #f6f8ff 45%, #eef4ff 100%);
}

.glass-card {
  background: var(--card);
  border: 1px solid rgba(229,233,246,.9);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.brand, .login-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  width: 58px;
  height: 58px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--cyan), #62e5b8);
  color: #083c3a;
  font-size: 28px;
  font-weight: 900;
  box-shadow: 0 14px 32px rgba(36,199,184,.28);
}

.brand h1, .login-brand h1 {
  margin: 0 0 6px;
  font-size: 21px;
  font-weight: 900;
}

.brand p, .login-brand p, .panel-header p, .form-card p, .hero-card p, .login-hint, .empty-state p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 2;
}

.primary-btn, .soft-btn, .logout-btn, .small-btn {
  border: 0;
  cursor: pointer;
  font-weight: 900;
  transition: .18s ease;
}

.primary-btn {
  min-height: 48px;
  padding: 12px 20px;
  border-radius: 17px;
  color: #fff;
  background: linear-gradient(135deg, var(--purple), #22c7bb);
  box-shadow: 0 18px 32px rgba(114,92,255,.22);
}

.primary-btn:hover, .soft-btn:hover, .small-btn:hover, .logout-btn:hover {
  transform: translateY(-1px);
}

.primary-btn:disabled {
  opacity: .62;
  cursor: wait;
  transform: none;
}

.soft-btn {
  min-height: 48px;
  padding: 12px 20px;
  border-radius: 17px;
  color: var(--purple-dark);
  background: var(--purple-soft);
}

.alert {
  margin-bottom: 18px;
  padding: 14px 18px;
  border-radius: 18px;
  background: #ecfdf5;
  border: 1px solid #bbf7d0;
  color: #166534;
  font-size: 13px;
  font-weight: 800;
  line-height: 2;
}

.alert.error {
  background: #fff1f2;
  border-color: #fecdd3;
  color: #9f1239;
}

/* LOGIN */
.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(380px, 560px) minmax(0, 1fr);
  align-items: center;
  gap: 42px;
  padding: 60px;
}

.login-card {
  border-radius: 34px;
  padding: 38px;
}

.login-form {
  margin-top: 30px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.field-group label, .form-card label {
  display: block;
  margin: 0 0 8px;
  color: #2b3150;
  font-size: 13px;
  font-weight: 900;
}

.login-submit {
  margin-top: 8px;
}

.login-hint {
  margin-top: 18px;
}

.login-showcase {
  min-height: 560px;
  border-radius: 44px;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 65% 22%, rgba(114,92,255,.23), transparent 19rem),
    radial-gradient(circle at 32% 76%, rgba(36,199,184,.22), transparent 22rem),
    rgba(255,255,255,.38);
  border: 1px solid rgba(229,233,246,.72);
}

.showcase-card {
  max-width: 620px;
  border-radius: 34px;
  padding: 42px;
}

.eyebrow {
  display: inline-flex;
  color: #11897f;
  font-weight: 900;
  font-size: 13px;
  margin-bottom: 14px;
}

.showcase-card h2 {
  margin: 0;
  max-width: 520px;
  font-size: clamp(34px, 4vw, 54px);
  line-height: 1.55;
  letter-spacing: -.05em;
}

.showcase-card p {
  margin: 18px 0 0;
  color: var(--muted);
  line-height: 2;
}

.showcase-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 28px;
}

.showcase-metrics div {
  padding: 16px;
  border-radius: 20px;
  background: rgba(255,255,255,.68);
  border: 1px solid var(--line);
}

.showcase-metrics strong {
  display: block;
  color: var(--purple-dark);
  font-size: 20px;
}

.showcase-metrics span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

/* DASHBOARD */
.dashboard-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 292px minmax(0, 1fr);
  gap: 24px;
  padding: 24px;
}

.dashboard-sidebar {
  border-radius: 36px;
  padding: 24px;
  position: sticky;
  top: 24px;
  height: calc(100vh - 48px);
  background: rgba(248,250,255,.94);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.nav {
  display: grid;
  gap: 9px;
  margin-top: 28px;
}

.nav-item {
  min-height: 52px;
  border: 1px solid transparent;
  background: transparent;
  color: #2f3658;
  border-radius: 18px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: right;
  font-weight: 900;
  transition: .18s ease;
}

.nav-item:hover, .nav-item.active {
  background: #fff;
  border-color: rgba(114,92,255,.25);
  color: var(--purple-dark);
  box-shadow: 0 14px 30px rgba(49,62,110,.08);
}

.nav-icon {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--purple-soft);
}

.security-widget {
  margin-top: auto;
  padding: 20px;
  border-radius: 26px;
  background: #fff;
  border: 1px solid var(--line);
  text-align: center;
}

.lock-visual {
  width: 76px;
  height: 76px;
  margin: 0 auto 12px;
  display: grid;
  place-items: center;
  border-radius: 26px;
  background: linear-gradient(135deg, var(--purple), #22c7bb);
  font-size: 34px;
}

.security-widget strong {
  display: block;
  margin-bottom: 6px;
}

.security-widget p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.9;
}

.logout-btn {
  min-height: 48px;
  margin-top: 14px;
  border-radius: 18px;
  background: #fff1f2;
  color: #be123c;
  border: 1px solid #ffe4e6;
}

.dashboard-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.dashboard-topbar {
  min-height: 78px;
  display: grid;
  grid-template-columns: minmax(280px, 560px) minmax(0, 1fr);
  align-items: center;
  gap: 18px;
}

.search-box, .profile-pill, .status-chip {
  background: rgba(255,255,255,.88);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
}

.search-box {
  min-height: 58px;
  border-radius: 21px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.search-box input {
  border: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
}

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

.status-chip {
  min-height: 46px;
  border-radius: 999px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: #15803d;
  font-weight: 900;
  font-size: 12px;
  white-space: nowrap;
}

.pulse {
  width: 10px;
  height: 10px;
  background: var(--green);
  border-radius: 50%;
  box-shadow: 0 0 0 6px rgba(46,214,159,.18);
}

.profile-pill {
  min-height: 58px;
  border-radius: 22px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar {
  width: 42px;
  height: 42px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: #fff7ed;
}

.profile-pill strong, .profile-pill span {
  display: block;
  white-space: nowrap;
}

.profile-pill strong { font-size: 13px; }
.profile-pill span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(320px, .85fr);
  gap: 22px;
}

.hero-card {
  min-height: 264px;
  border-radius: 36px;
  padding: 30px;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) 310px;
  align-items: center;
  gap: 20px;
  background: linear-gradient(135deg, #7aa8ff 0%, #7b61ff 48%, #24c7b8 100%);
  color: #fff;
  overflow: hidden;
}

.hero-card .eyebrow, .hero-card p {
  color: rgba(255,255,255,.88);
}

.hero-card h2 {
  margin: 0;
  font-size: clamp(26px, 3vw, 42px);
  line-height: 1.55;
  letter-spacing: -.04em;
}

.hero-actions {
  display: flex;
  gap: 12px;
  margin-top: 22px;
  flex-wrap: wrap;
}

.hero-card .primary-btn {
  background: #fff;
  color: var(--purple-dark);
}

.hero-card .soft-btn {
  background: rgba(255,255,255,.22);
  color: #fff;
}

.hero-illustration {
  position: relative;
  min-height: 230px;
  display: grid;
  place-items: center;
}

.illustration-core {
  width: 154px;
  height: 154px;
  display: grid;
  place-items: center;
  border-radius: 44px;
  background: rgba(255,255,255,.22);
  font-size: 76px;
}

.floating-card {
  position: absolute;
  padding: 10px 14px;
  border-radius: 16px;
  background: rgba(255,255,255,.90);
  color: #2f3658;
  font-size: 12px;
  font-weight: 900;
}

.floating-card.one { top: 16px; right: 8px; }
.floating-card.two { left: 0; top: 82px; }
.floating-card.three { bottom: 18px; right: 52px; }

.calendar-card, .chart-card, .progress-card, .panel, .form-card {
  border-radius: 30px;
  padding: 24px;
}

.calendar-card {
  grid-row: span 2;
}

.calendar-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.calendar-head span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 5px;
}

.calendar-head strong { font-size: 19px; }

.mini-badge {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--purple-soft);
  color: var(--purple-dark);
  font-size: 12px;
  font-weight: 900;
}

.mini-calendar {
  margin-top: 22px;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 9px;
  text-align: center;
}

.mini-calendar span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.mini-calendar b {
  min-height: 34px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: #f8faff;
  font-size: 12px;
}

.active-day {
  color: #fff;
  background: linear-gradient(135deg, var(--purple), #22c7bb) !important;
}

.service-card {
  margin-top: 22px;
  border-radius: 24px;
  padding: 18px;
  background: #dffaf6;
}

.service-card span {
  display: block;
  color: #12736d;
  font-size: 12px;
  margin-bottom: 8px;
}

.service-card strong { color: #075e59; }

.stat-grid {
  display: grid;
  grid-column: 1 / 2;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.stat-card {
  border-radius: 26px;
  padding: 20px;
  min-height: 150px;
}

.stat-icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 17px;
  background: var(--purple-soft);
  margin-bottom: 16px;
}

.stat-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.stat-card strong {
  display: block;
  margin-top: 10px;
  font-size: 36px;
}

.progress-card {
  display: flex;
  align-items: center;
  gap: 22px;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.panel-header h3, .form-card h3, .progress-card h3 {
  margin: 0 0 8px;
  font-size: 22px;
}

.bar-chart {
  height: 170px;
  display: flex;
  align-items: flex-end;
  gap: 18px;
  padding: 16px 18px 0;
  border-radius: 24px;
  background: linear-gradient(180deg, #fbfcff, #f7f9ff);
  border: 1px solid var(--line);
}

.bar-chart span {
  flex: 1;
  height: var(--h);
  min-height: 28px;
  border-radius: 16px 16px 7px 7px;
  background: #fff;
  border: 2px solid rgba(114,92,255,.32);
}

.chart-labels, .legend {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 14px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.donut {
  width: 132px;
  height: 132px;
  flex: 0 0 auto;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle, #fff 0 48%, transparent 49%),
    conic-gradient(var(--purple) 0 72%, var(--green) 72% 88%, #edf1fb 88% 100%);
}

.donut span {
  font-size: 22px;
  font-weight: 900;
  color: var(--purple-dark);
}

.dot {
  width: 10px;
  height: 10px;
  display: inline-block;
  border-radius: 999px;
  margin-left: 6px;
}

.dot.green { background: var(--green); }
.dot.purple { background: var(--purple); }

.table-wrap {
  overflow-x: auto;
  border-radius: 24px;
  border: 1px solid var(--line);
  background: #fff;
}

table {
  width: 100%;
  min-width: 890px;
  border-collapse: collapse;
}

th, td {
  padding: 15px;
  text-align: right;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  font-size: 13px;
}

th {
  background: #f7f9ff;
  color: var(--purple-dark);
  font-weight: 900;
}

tr:last-child td { border-bottom: 0; }

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 7px 12px;
  background: #f1f5ff;
  color: #4c5575;
  font-size: 12px;
  font-weight: 900;
}

.badge.ok {
  background: #dcfce7;
  color: #166534;
}

.badge.warn {
  background: #fff7ed;
  color: #9a3412;
}

.inline-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.small-btn {
  border: 1px solid var(--line-strong);
  background: #fff;
  color: #2f3658;
  padding: 9px 12px;
  border-radius: 13px;
}

.operations-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.form-card label {
  margin-top: 14px;
}

input, select {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--text);
  border-radius: 17px;
  padding: 0 14px;
  outline: none;
  transition: .16s ease;
}

input:focus, select:focus {
  border-color: rgba(114,92,255,.55);
  box-shadow: 0 0 0 5px rgba(114,92,255,.10);
}

.switch-row {
  display: grid;
  gap: 9px;
  margin: 14px 0;
}

.switch-row label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: #2f3658;
  font-weight: 800;
}

.switch-row input {
  width: auto;
  min-height: auto;
}

.empty-state {
  padding: 28px;
  border-radius: 24px;
  background: #f8faff;
  border: 1px dashed var(--line-strong);
}

.empty-state strong {
  display: block;
  margin-bottom: 8px;
  color: var(--purple-dark);
}

@media (max-width: 1240px) {
  .dashboard-shell { grid-template-columns: 1fr; }
  .dashboard-sidebar {
    position: static;
    height: auto;
  }
  .nav { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .security-widget { display: none; }
  .overview-grid { grid-template-columns: 1fr; }
  .calendar-card { grid-row: auto; }
}

@media (max-width: 980px) {
  .login-page {
    grid-template-columns: 1fr;
    padding: 28px;
  }
  .login-showcase {
    min-height: auto;
    padding: 22px;
  }
  .dashboard-topbar { grid-template-columns: 1fr; }
  .topbar-actions {
    justify-content: stretch;
    flex-wrap: wrap;
  }
  .stat-grid, .operations-grid {
    grid-template-columns: 1fr;
  }
  .hero-card { grid-template-columns: 1fr; }
  .hero-illustration { display: none; }
}
