﻿@font-face {
  font-family: "Vazirmatn";
  src: url("/static/core/fonts/Vazirmatn-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #f4f1ea;
  --bg-accent: #ffe9cf;
  --ink: #1e1e1e;
  --muted: #5a5956;
  --primary: #0f766e;
  --primary-dark: #0a534e;
  --accent: #e9724c;
  --card: #ffffff;
  --shadow: 0 12px 30px rgba(15, 23, 42, 0.12);
  --radius: 20px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Vazirmatn", "Tahoma", sans-serif;
  background: radial-gradient(circle at top right, #ffe7b9, transparent 55%),
    radial-gradient(circle at 10% 40%, #f9d6cd, transparent 40%),
    linear-gradient(180deg, #f8f3ea 0%, #fffaf2 100%);
  color: var(--ink);
  min-height: 100vh;
}

.page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 24px 60px;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.brand-logo {
  width: 42px;
  height: 42px;
  object-fit: contain;
}

nav a {
  color: var(--muted);
  text-decoration: none;
  margin-right: 16px;
  font-weight: 600;
}

nav a:hover {
  color: var(--primary);
}

.hero {
  background: var(--card);
  padding: 28px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: grid;
  gap: 18px;
  grid-template-columns: 2fr 1fr;
  align-items: center;
  overflow: hidden;
  position: relative;
}

.hero::after {
  content: "";
  position: absolute;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: rgba(233, 114, 76, 0.15);
  top: -80px;
  left: -80px;
}

.hero h1 {
  margin: 0 0 10px;
  font-size: 30px;
}

.hero p {
  margin: 0;
  color: var(--muted);
  line-height: 1.8;
}

.hero-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.hero-stats {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.stat-chip {
  background: #fff2d9;
  border-radius: 14px;
  padding: 10px 14px;
  display: grid;
  gap: 4px;
  min-width: 140px;
}

.stat-chip strong {
  font-size: 18px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 18px;
  border-radius: 999px;
  border: none;
  background: var(--primary);
  color: white;
  text-decoration: none;
  font-weight: 700;
  font-family: "Vazirmatn", "Tahoma", sans-serif;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 10px 20px rgba(15, 118, 110, 0.2);
}

button {
  font-family: "Vazirmatn", "Tahoma", sans-serif;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 30px rgba(15, 118, 110, 0.25);
}

.btn.secondary {
  background: white;
  color: var(--primary);
  border: 1px solid rgba(15, 118, 110, 0.2);
  box-shadow: none;
}

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

.grid.two {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.grid.three {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

.card h2 {
  margin-top: 0;
  font-size: 20px;
}

.chart-card {
  display: grid;
  gap: 16px;
  align-content: start;
}

.donut {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  margin: 0 auto;
  background: conic-gradient(
    var(--primary) 0% calc(var(--easy) * 1%),
    #f5a524 calc(var(--easy) * 1%) calc((var(--easy) + var(--medium)) * 1%),
    var(--accent) calc((var(--easy) + var(--medium)) * 1%) 100%
  );
  position: relative;
}

.donut::after {
  content: "";
  position: absolute;
  inset: 26px;
  background: #fff;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px #efe7d8;
}

.legend {
  display: grid;
  gap: 8px;
  font-size: 13px;
}

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

.legend .easy {
  background: var(--primary);
}

.legend .medium {
  background: #f5a524;
}

.legend .hard {
  background: var(--accent);
}

.bar-list {
  display: grid;
  gap: 12px;
}

.bar-row {
  display: grid;
  grid-template-columns: 1fr 2fr auto;
  gap: 10px;
  align-items: center;
  font-size: 13px;
}

.bar {
  height: 10px;
  background: #f3ede3;
  border-radius: 999px;
  overflow: hidden;
}

.bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #0f766e, #41b5a5);
  border-radius: 999px;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.muted {
  color: var(--muted);
  margin: 4px 0 0;
}

.stats {
  display: grid;
  gap: 12px;
}

.stat-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  background: #f8f6f1;
  border-radius: 14px;
}

.stats.compact {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.stats.compact .stat-item {
  padding: 6px 8px;
  font-size: 12px;
  background: #fbf8f2;
}

.olympiad-counts {
  display: grid;
  gap: 6px;
  margin-top: 6px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

label {
  font-weight: 600;
}

small {
  color: var(--muted);
  display: block;
  margin-top: 4px;
}

input[type="text"],
input[type="number"],
input[type="file"],
input[type="password"],
input[type="date"],
select {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid #e5e0d6;
  font-family: inherit;
  background: #fff;
  transition: border 0.2s ease, box-shadow 0.2s ease;
}

input[type="file"] {
  background: white;
}

input[type="password"],
.jalali-input {
  background: linear-gradient(180deg, #fff, #f7f2ea);
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.06);
}

input[type="text"]:focus,
input[type="number"]:focus,
input[type="password"]:focus,
.jalali-input:focus,
select:focus {
  outline: none;
  border-color: rgba(15, 118, 110, 0.5);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.15);
}

.messages {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

.message {
  padding: 10px 14px;
  border-radius: 12px;
  background: #fff4de;
  color: #8a4b1f;
}

.message.success {
  background: #e4f5ef;
  color: #1f6f60;
}

.message.error {
  background: #ffe1e1;
  color: #8c2f39;
}

.filter-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.filter-form {
  display: grid;
  gap: 12px;
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td {
  padding: 10px;
  border-bottom: 1px solid #eee6da;
  text-align: right;
}

.action-links {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.action-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: #f7f1e6;
  color: var(--primary);
  text-decoration: none;
}

.action-link:hover {
  background: rgba(15, 118, 110, 0.15);
}

.action-link.danger {
  color: #b91c1c;
}

.action-link.danger:hover {
  background: rgba(185, 28, 28, 0.15);
}

.action-icon {
  width: 18px;
  height: 18px;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.pagination a,
.pagination span {
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid #e5e0d6;
  text-decoration: none;
  color: var(--primary);
  background: #fff;
}

.pagination .active {
  background: var(--primary);
  color: #fff;
}

.pagination .disabled {
  opacity: 0.5;
}

.exam-question {
  margin-bottom: 18px;
  padding: 14px;
  border-radius: 14px;
  background: #fdfaf4;
}

.exam-question h3 {
  margin: 0 0 8px;
  font-size: 16px;
}

.options {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}

.option-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.option-label {
  font-weight: 700;
}

ul {
  margin: 8px 0;
  padding-right: 18px;
}

.answer-key {
  margin-top: 20px;
  background: #f2f6f3;
  padding: 16px;
  border-radius: 16px;
}

.fade-in {
  animation: fadeIn 0.5s ease-out;
}

.jalali-datepicker {
  position: absolute;
  background: #fff;
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 12px;
  width: 260px;
  z-index: 50;
  display: none;
}

.jalali-datepicker.open {
  display: block;
}

.jd-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.jd-selects {
  display: flex;
  gap: 8px;
}

.jd-select {
  border-radius: 10px;
  border: 1px solid #e5e0d6;
  padding: 6px 8px;
  font-family: inherit;
  background: #fff;
}

.jd-nav {
  border: none;
  background: #f3ece0;
  color: var(--primary);
  width: 32px;
  height: 32px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 700;
}

.jd-weekdays,
.jd-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  text-align: center;
}

.jd-weekdays span {
  font-size: 12px;
  color: var(--muted);
}

.jd-day {
  border: none;
  background: #f8f2e8;
  border-radius: 8px;
  padding: 6px 0;
  cursor: pointer;
  font-family: inherit;
}

.jd-day:hover {
  background: rgba(15, 118, 110, 0.15);
}

.jd-day.today {
  border: 1px solid rgba(15, 118, 110, 0.6);
}

.jd-day.selected {
  background: var(--primary);
  color: #fff;
}

.jd-empty {
  height: 28px;
}

.select-search {
  display: grid;
  gap: 8px;
}

.select-search-input {
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid #e5e0d6;
  font-family: inherit;
}

.select-search input,
.select-search select {
  width: 100%;
}

.select2-hidden {
  display: none;
}

.select2-wrapper {
  position: relative;
  width: 100%;
}

.select2-input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid #e5e0d6;
  font-family: inherit;
  background: #fff;
}

.select2-dropdown {
  position: absolute;
  right: 0;
  left: 0;
  top: calc(100% + 6px);
  background: #fff;
  border-radius: 12px;
  border: 1px solid #e5e0d6;
  box-shadow: var(--shadow);
  max-height: 220px;
  overflow-y: auto;
  display: none;
  z-index: 20;
}

.select2-dropdown.open {
  display: block;
}

.select2-option {
  padding: 8px 12px;
  cursor: pointer;
}

.select2-option:hover,
.select2-option.selected {
  background: #f6efe4;
}

.percent-group {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 900px) {
  header {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero {
    grid-template-columns: 1fr;
  }
}
