/* ===== استایل مشترک صفحات پنل (ثبت‌نام، داشبورد، سراسری، پروفایل) ===== */

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Vazirmatn', Tahoma, Arial, sans-serif;
  background: #eef2f8;
  color: #1e293b;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ---------- هدر آبی ---------- */
.topbar {
  background: #2f5fd0;
  color: #fff;
  padding: 8px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 58px;
}
.topbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.topbar-logo {
  background: #fff;
  border-radius: 8px;
  padding: 4px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.topbar-logo img { width: 30px; height: 30px; display: block; }
.topbar-titles h1 { font-size: 15px; font-weight: 700; line-height: 1.6; }
.topbar-titles p { font-size: 11.5px; opacity: 0.85; line-height: 1.6; }

.topbar-actions .btn-light {
  background: rgba(255, 255, 255, 0.92);
  color: #2f5fd0;
  border: none;
  border-radius: 8px;
  padding: 7px 22px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}
.topbar-actions .btn-light:hover { background: #fff; }

/* ---------- هدر سفید داشبورد ---------- */
.app-header {
  background: #fff;
  border-bottom: 1px solid #e8edf3;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  z-index: 5;
}
.user-chip {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-right: 52px; /* جای آیکن منو در لبه راست */
}
.avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  background: #e2e8f0;
  flex-shrink: 0;
}
.avatar-fallback {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2f5fd0, #38bdf8);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  font-weight: 700;
  flex-shrink: 0;
}
.user-chip .name { font-size: 15px; font-weight: 700; color: #0f172a; }

.btn-exit {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  color: #e11d48;
  border: 1.5px solid #fb7185;
  border-radius: 10px;
  padding: 8px 18px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-exit:hover { background: #fff1f2; }

.hamburger {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: #475569;
  padding: 6px;
  border-radius: 8px;
}
.hamburger:hover { background: #f1f5f9; }

/* ---------- ریل آیکن سمت راست ---------- */
.side-rail {
  position: fixed;
  right: 6px;
  top: 230px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 4;
}
.side-rail button {
  background: none;
  border: none;
  color: #64748b;
  padding: 8px;
  border-radius: 8px;
  cursor: pointer;
}
.side-rail button:hover { background: #e2e8f0; }

/* ---------- محتوا ---------- */
.page-content {
  max-width: 1240px;
  margin: 0 auto;
  padding: 34px 40px 60px;
}

/* ---------- کارت‌های داشبورد ---------- */
.dash-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(320px, 480px));
  justify-content: center;
  gap: 28px;
  margin-top: 60px;
}
.dash-card {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.07);
  padding: 26px 28px 28px;
  border-top: 3px solid #2563eb;
}
.dash-card.green { border-top-color: #10b981; }
.dash-card-head {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}
.dash-card-head h2 { font-size: 20px; font-weight: 800; color: #0f172a; }
.dash-card-head .ic { flex-shrink: 0; display: flex; }
.dash-card p { color: #64748b; font-size: 14px; line-height: 2; margin-bottom: 20px; }
.btn-block {
  width: 100%;
  border: none;
  border-radius: 10px;
  padding: 12px;
  font-family: inherit;
  font-size: 15.5px;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-decoration: none;
  transition: filter 0.15s;
}
.btn-block:hover { filter: brightness(1.08); }
.btn-block.blue { background: #2438c9; }
.btn-block.green { background: #12d19c; }

/* ---------- تیتر صفحه سراسری ---------- */
.sara-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 34px;
  flex-wrap: wrap;
}
.sara-head h1 {
  color: #2f8ae0;
  font-size: 30px;
  font-weight: 800;
  margin-bottom: 8px;
}
.sara-head .sub { color: #64748b; font-size: 14.5px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: #dbeafe;
  color: #1e50c8;
  border-radius: 999px;
  padding: 9px 20px;
  font-size: 14.5px;
  font-weight: 600;
  white-space: nowrap;
}

/* ---------- کاشی‌های سراسری ---------- */
.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 26px;
}
.tile {
  background: #fff;
  border: 1px solid #e5eaf1;
  border-radius: 14px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  transition: box-shadow 0.15s, transform 0.15s;
}
.tile:hover {
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.10);
  transform: translateY(-2px);
}
.tile::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 4px;
  background: linear-gradient(to left, #1d4ed8, #38bdf8);
}
.tile-head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 14px;
}
.tile-icon {
  width: 56px;
  height: 56px;
  background: #dbeafe;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #2b4bbe;
  flex-shrink: 0;
}
.tile h3 { font-size: 16.5px; font-weight: 800; color: #1e293b; line-height: 1.7; padding-top: 4px; }
.tile p { color: #64748b; font-size: 13.5px; line-height: 1.9; margin-bottom: 18px; flex-grow: 1; }
.tile .btn-tile {
  background: #2b4bbe;
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 11px;
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: background 0.15s;
}
.tile .btn-tile:hover { background: #2440a8; }

/* ---------- صفحه ثبت‌نام ---------- */
.register-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 24px;
  align-items: start;
}
.panel-card {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.06);
  padding: 22px 26px 30px;
}
.panel-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  flex-wrap: wrap;
  gap: 10px;
}
.panel-card-head h2 { font-size: 17px; font-weight: 800; color: #0f172a; }
.panel-card-actions { display: flex; gap: 8px; }
.btn-sm {
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  border-radius: 8px;
  padding: 7px 18px;
  cursor: pointer;
  border: 1px solid #dbe2ec;
  background: #fff;
  color: #334155;
}
.btn-sm:hover { background: #f8fafc; }
.btn-sm.primary {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
}
.btn-sm.primary:hover { background: #1d4ed8; }

.alert {
  border-radius: 10px;
  padding: 11px 16px;
  font-size: 13.5px;
  line-height: 1.9;
  margin-bottom: 20px;
  text-align: center;
}
.alert.error { background: #fee2e2; color: #dc2626; border: 1px solid #fecaca; }
.alert.success { background: #dcfce7; color: #16a34a; border: 1px solid #bbf7d0; }
.alert[hidden] { display: none; }

/* فرم */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 22px;
}
.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 7px;
}
.field input,
.field select {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
  font-family: inherit;
  font-size: 13.5px;
  color: #0f172a;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field input:focus,
.field select:focus {
  outline: none;
  background: #fff;
  border-color: #2f5fd0;
  box-shadow: 0 0 0 3px rgba(47, 95, 208, 0.12);
}
.field input.invalid,
.field select.invalid { border-color: #ef4444; background: #fef2f2; }
.ltr-input { direction: ltr; text-align: left; }

.field select {
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path d='M1 1l5 5 5-5' stroke='%2394a3b8' stroke-width='2' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: left 12px center;
  padding-left: 34px;
}

/* تصویر پروفایل */
.profile-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 22px;
}
.profile-upload {
  width: 92px;
  height: 92px;
  border: 1.5px dashed #c7d2e2;
  border-radius: 10px;
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  overflow: hidden;
  flex-shrink: 0;
}
.profile-upload img { width: 100%; height: 100%; object-fit: cover; }
.file-btn {
  background: #2563eb;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 7px 16px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.file-btn:hover { background: #1d4ed8; }
.file-hint { font-size: 12.5px; color: #64748b; margin-top: 6px; }

/* بخش معدلات */
.section-title {
  font-size: 14.5px;
  font-weight: 800;
  color: #0f172a;
  margin: 26px 0 16px;
  padding-top: 20px;
  border-top: 1px dashed #dbe2ec;
}
.gpa-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 220px));
  gap: 14px;
  justify-content: start;
}
.gpa-card {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #fbfdff;
  padding: 12px;
}
.gpa-card label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: #334155;
  margin-bottom: 8px;
  text-align: right;
}
.gpa-input {
  display: flex;
  align-items: center;
  gap: 8px;
}
.gpa-input input {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
  font-family: inherit;
  font-size: 13px;
  direction: ltr;
  text-align: left;
}
.gpa-input .q {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid #cbd5e1;
  color: #94a3b8;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: help;
}

/* سایدبار */
.sidebar-card .side-list {
  border: 1.5px dashed #c7d2e2;
  border-radius: 10px;
  padding: 18px 16px;
  color: #64748b;
  font-size: 13px;
  line-height: 2.2;
}
.sidebar-card .side-list ol { padding-right: 18px; }
.btn-add {
  background: #16a34a;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 6px 14px;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
}

/* ---------- صفحه پروفایل ---------- */
.profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 16px;
  margin-top: 20px;
}
.info-item {
  background: #f8fafc;
  border: 1px solid #e8edf3;
  border-radius: 10px;
  padding: 12px 14px;
}
.info-item .k { font-size: 12px; color: #64748b; margin-bottom: 4px; }
.info-item .v { font-size: 14.5px; font-weight: 700; color: #0f172a; word-break: break-word; }

/* ---------- مودال ویرایش ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 16px;
  overflow-y: auto;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  z-index: 70;
}
.modal-backdrop.show {
  opacity: 1;
  pointer-events: auto;
}
.modal {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.3);
  width: 100%;
  max-width: 760px;
  padding: 22px 26px 26px;
  transform: translateY(-14px);
  transition: transform 0.2s;
}
.modal-backdrop.show .modal { transform: translateY(0); }
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.modal-head h2 { font-size: 17px; font-weight: 800; color: #0f172a; }
.modal-close {
  background: none;
  border: none;
  font-size: 28px;
  line-height: 1;
  color: #64748b;
  cursor: pointer;
  padding: 2px 8px;
  border-radius: 8px;
}
.modal-close:hover { background: #f1f5f9; color: #0f172a; }
.edit-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px dashed #dbe2ec;
}
.edit-actions .btn-sm { font-size: 14px; padding: 9px 28px; }

/* ---------- منوی کشویی (دراور) ---------- */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
  z-index: 50;
}
.drawer-backdrop.show {
  opacity: 1;
  pointer-events: auto;
}
.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 320px;
  max-width: 85vw;
  background: #fff;
  box-shadow: -8px 0 30px rgba(15, 23, 42, 0.18);
  transform: translateX(100%);
  transition: transform 0.28s ease;
  z-index: 60;
  display: flex;
  flex-direction: column;
}
.drawer.open { transform: translateX(0); }
.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid #eef2f8;
}
.drawer-head img { width: 62px; height: 62px; object-fit: contain; }
.drawer-close {
  background: none;
  border: none;
  font-size: 30px;
  line-height: 1;
  color: #0f172a;
  cursor: pointer;
  padding: 2px 8px;
  border-radius: 8px;
}
.drawer-close:hover { background: #f1f5f9; }
.drawer-nav {
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.drawer-link {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 15px 16px;
  border-radius: 10px;
  color: #1e293b;
  font-size: 16px;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.15s;
}
.drawer-link svg { flex-shrink: 0; order: -1; }
.drawer-link:hover { background: #f1f5f9; }
.drawer-link.active { background: #eff6ff; color: #2f5fd0; }

/* ---------- ریسپانسیو ---------- */
@media (max-width: 900px) {
  .page-content { padding: 22px 16px 50px; }
  .register-layout { grid-template-columns: 1fr; }
  .dash-cards { grid-template-columns: 1fr; margin-top: 20px; }
  .form-grid { grid-template-columns: 1fr; }
  .gpa-grid { grid-template-columns: 1fr 1fr; }
  .side-rail { display: none; }
  .topbar-titles h1 { font-size: 13.5px; }
  .topbar-titles p { font-size: 10.5px; }
  .user-chip { padding-right: 40px; }
  .user-chip .name { font-size: 13px; }
}
