/* پنل دانشجو — هماهنگ با پوستهٔ پنل اپراتور */
:root {
  --surface: #fff;
  --line: #e2e8f4;
  --line-2: #c9d5eb;
  --text: #0f1c3a;
  --text-2: #3d4f6f;
  --muted: #7a8ba8;
  --blue-2: #2f5bf0;
  --green: #10b981;
  --red: #f43f5e;
  --amber: #f59e0b;
  --radius: 16px;
  --shadow: 0 8px 28px rgba(30, 50, 100, .08);
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  font-family: "Vazirmatn", system-ui, -apple-system, sans-serif;
  background: #f4f7fc; color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
body { min-height: 100vh; }
button, input, select, textarea, .nav-btn, .btn-primary, .btn-secondary, .smart-field {
  font-family: inherit !important;
}
[data-label]::before {
  font-family: "Vazirmatn", system-ui, sans-serif !important;
  font-weight: 600;
}

.bg-grid {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image:
    linear-gradient(rgba(47, 91, 240, .03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(47, 91, 240, .03) 1px, transparent 1px);
  background-size: 48px 48px;
}

.app-shell { display: flex; min-height: 100vh; position: relative; z-index: 1; }
.main-area { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.content { flex: 1; padding: 8px 28px 40px; max-width: 1180px; }

/* تاپ‌بار */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 28px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.72);
  backdrop-filter: blur(10px); position: sticky; top: 0; z-index: 20;
}
.crumb { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.crumb-root { color: var(--muted); font-weight: 500; }
.crumb-sep { color: var(--line-2); }
#crumbCurrent { font-weight: 700; color: var(--text); }
.topbar-actions { display: flex; align-items: center; gap: 14px; }
.user-chip {
  padding: 6px 14px; border-radius: 99px; background: rgba(47, 91, 240, .1);
  border: 1px solid var(--line); font-size: 13.5px; font-weight: 600; color: var(--text-2);
  display: flex; flex-direction: column; align-items: flex-start; line-height: 1.3;
}
.user-chip small { font-weight: 500; color: var(--muted); font-size: 11.5px; }

/* بخش‌ها */
.section, .tab-panel { display: none; }
.section.active, .tab-panel.active { display: block; animation: secSlideIn .4s cubic-bezier(.2, .8, .2, 1); }
@keyframes secSlideIn {
  from { opacity: 0; transform: translateX(-18px); }
  to { opacity: 1; transform: none; }
}

.section > h2 {
  display: flex; align-items: center; gap: 14px; margin: 6px 0 6px;
  font-size: clamp(22px, 3vw, 30px); font-weight: 800; color: var(--text);
}
.page-ico {
  width: 46px; height: 46px; border-radius: 15px; display: grid; place-items: center; flex-shrink: 0; color: #2f5bf0;
  background: linear-gradient(145deg, rgba(70, 120, 255, .32), rgba(30, 60, 180, .2));
  border: 1px solid rgba(130, 170, 255, .34);
}
.page-ico .ico { width: 23px; height: 23px; }
.section > p { color: var(--muted); margin: 2px 0 18px; font-size: 14px; line-height: 1.9; max-width: 820px; }

/* پنل جستجو */
.dash-panel, .search-panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px; box-shadow: var(--shadow); margin-bottom: 18px;
}
.search-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px 14px;
}
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: 13px; font-weight: 600; color: var(--text-2); }
.smart-field, .search-panel input, .search-panel select {
  width: 100%; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line);
  background: #f8faff; font: inherit; color: var(--text); outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.smart-field:focus, .search-panel input:focus, .search-panel select:focus {
  border-color: #2f5bf0; box-shadow: 0 0 0 3px rgba(47, 91, 240, .15);
}
.search-actions { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }

.btn-primary, .btn.btn-primary {
  background: linear-gradient(180deg, #5b86ff, #2f5bf0); color: #fff; border: none;
  padding: 10px 18px; border-radius: 12px; font: inherit; font-weight: 600; cursor: pointer;
  box-shadow: 0 8px 20px rgba(47, 91, 240, .35); transition: .15s;
}
.btn-primary:hover, .btn.btn-primary:hover { filter: brightness(1.06); transform: translateY(-1px); }
.btn-secondary, .btn.btn-secondary {
  background: rgba(70, 110, 240, .1); color: var(--text-2); border: 1px solid var(--line);
  padding: 10px 16px; border-radius: 12px; font: inherit; font-weight: 600; cursor: pointer; transition: .15s;
}
.btn-secondary:hover, .btn.btn-secondary:hover { background: rgba(70, 110, 240, .18); }
.btn-sm { padding: 7px 12px !important; font-size: 13px !important; border-radius: 10px !important; }
.btn-remove {
  background: rgba(244, 63, 94, .12) !important; color: #be123c !important;
  border: 1px solid rgba(244, 63, 94, .3) !important; padding: 7px 12px; border-radius: 10px;
  font: inherit; font-weight: 600; cursor: pointer; font-size: 13px;
}

/* هدر نتایج */
.results-header {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin: 8px 0 14px; flex-wrap: wrap;
}
.results-count { font-size: 14px; color: var(--text-2); }
.results-count strong { font-size: 18px; font-weight: 800; color: var(--text); margin-left: 4px; }
.view-toggle {
  display: inline-flex; border: 1px solid var(--line); border-radius: 11px; overflow: hidden; background: var(--surface);
}
.view-toggle button {
  border: none; background: transparent; padding: 8px 14px; font: inherit; font-size: 13px;
  font-weight: 600; color: var(--muted); cursor: pointer; transition: .15s;
}
.view-toggle button.active { background: rgba(47, 91, 240, .12); color: #2f5bf0; }
.my-header-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* کارت‌های کلاس */
.cards-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px;
}
.class-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 10px;
  transition: transform .2s, border-color .2s; position: relative; overflow: hidden;
}
.class-card:hover { transform: translateY(-3px); border-color: var(--line-2); }
.class-card.status-cancelled { box-shadow: var(--shadow), inset -3px 0 0 var(--red); }
.class-card.status-moved { box-shadow: var(--shadow), inset -3px 0 0 var(--amber); }
.class-card.status-active { box-shadow: var(--shadow), inset -3px 0 0 var(--green); }

.card-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.course-name { font-weight: 700; font-size: 15.5px; color: var(--text); line-height: 1.4; }
.status-badge {
  display: inline-block; padding: 3px 10px; border-radius: 8px; font-size: 12px; font-weight: 600; white-space: nowrap;
}
.status-badge.active, .status-active { background: rgba(16, 185, 129, .15); color: #047857; }
.status-badge.cancelled, .status-cancelled { background: rgba(244, 63, 94, .15); color: #be123c; }
.status-badge.moved, .status-moved { background: rgba(245, 158, 11, .18); color: #b45309; }

.card-body { display: flex; flex-direction: column; gap: 6px; }
.info-row { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--text-2); }
.info-icon { font-size: 14px; opacity: .85; }
.note-row { margin-top: 4px; }
.note-highlight { background: rgba(47, 91, 240, .06); padding: 6px 8px; border-radius: 8px; }
.card-actions { margin-top: auto; padding-top: 6px; }

/* جدول */
.table-wrap, .table-wrapper {
  overflow-x: auto; border-radius: 14px; border: 1px solid var(--line); background: var(--surface);
  box-shadow: var(--shadow);
}
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { padding: 11px 12px; text-align: center; border-bottom: 1px solid var(--line); }
th { background: rgba(70, 110, 240, .06); color: var(--text-2); font-weight: 600; }
tr:hover td { background: rgba(70, 110, 240, .03); }
td:last-child { white-space: nowrap; }

/* KPI / آمار من */
.cards { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); margin: 0 0 18px; }
.card.kpi {
  position: relative; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; background: var(--surface); box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 4px;
}
.card.kpi strong { font-size: 28px; font-weight: 800; color: var(--text); }
.card.kpi .card-title { font-size: 13px; color: var(--text-2); }
.kpi-cap { font-size: 12px; color: var(--muted); }
.kpi-green { --tone: rgba(52, 211, 153, .3); }
.kpi-red { --tone: rgba(251, 113, 133, .3); }
.kpi-amber { --tone: rgba(251, 191, 36, .28); }
.kpi-blue { --tone: rgba(63, 109, 255, .42); }

/* اعلان */
.notify-banner {
  display: flex; align-items: flex-start; gap: 12px; justify-content: space-between;
  padding: 14px 16px; margin-bottom: 16px; border-radius: 14px;
  background: linear-gradient(135deg, rgba(47, 91, 240, .12), rgba(16, 185, 129, .08));
  border: 1px solid rgba(47, 91, 240, .25);
}
.notify-content { display: flex; gap: 12px; align-items: flex-start; }
.notify-icon { font-size: 22px; }
.notify-text strong { display: block; margin-bottom: 4px; }
.notify-text p { margin: 0; font-size: 13.5px; color: var(--text-2); line-height: 1.6; }
.notify-close {
  border: none; background: transparent; font-size: 20px; cursor: pointer; color: var(--muted);
  width: 32px; height: 32px; border-radius: 8px;
}
.notify-close:hover { background: rgba(0,0,0,.05); }

.my-ann h3 { margin: 0 0 10px; font-size: 15px; }
.my-ann ul { margin: 0; padding: 0 18px; color: var(--text-2); font-size: 13.5px; line-height: 1.8; }
.push-hint { font-size: 12.5px; color: var(--muted); margin: 0 0 12px; }

/* خالی */
.empty-state {
  text-align: center; padding: 48px 20px; color: var(--muted);
  background: var(--surface); border: 1px dashed var(--line-2); border-radius: var(--radius);
}
.empty-ico { font-size: 2.8rem; margin-bottom: 12px; }
.empty-state h3 { margin: 0 0 8px; color: var(--text-2); font-size: 17px; }
.empty-state p { margin: 0; font-size: 14px; line-height: 1.7; max-width: 420px; margin-inline: auto; }

/* لینک ریل */
a.nav-btn.rail-btn { text-decoration: none; display: grid; place-items: center; }

@media (max-width: 860px) {
  .content { padding: 8px 14px 90px; }
  .topbar { padding: 12px 14px; }
  .rail {
    position: fixed; bottom: 0; left: 0; right: 0; top: auto; flex-direction: row;
    height: auto; width: 100%; border-radius: 16px 16px 0 0; z-index: 40;
    box-shadow: 0 -8px 30px rgba(30,50,100,.12); background: var(--surface);
  }
  .rail-logo { display: none; }
  .rail-nav { flex-direction: row; justify-content: space-around; width: 100%; padding: 8px; }
  .rail-bottom { display: none; }
  .rail-sep { display: none; }
  .app-shell { flex-direction: column; padding-bottom: 72px; }
  body .nav-btn.rail-btn { width: 44px; height: 44px; }
  [data-label]::before { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .section.active, .tab-panel.active { animation: none !important; }
}

/* جبرانی و جابه‌جایی */
.makeup-row { background: rgba(22, 163, 74, .08); padding: 6px 8px; border-radius: 8px; align-items: flex-start; }
.makeup-row.pending { background: rgba(245, 158, 11, .12); color: #8a5a00; }
.makeup-row.moved { background: rgba(47, 91, 240, .07); }
.makeup-row small { color: var(--text-2); opacity: .85; }
.mk-small { color: var(--text-2); font-size: 12px; line-height: 1.7; }
.my-mk li { margin-bottom: 4px; }

/* تداخل زمانی در برنامهٔ من */
.btn-conflict { background: #fff4e5; color: #b45309; border: 1px solid #f5c98b; cursor: pointer; }
.btn-conflict:hover { background: #ffe9c7; }
.btn-taken { background: #eef0f4; color: #5b6475; border: 1px solid #d5d9e2; cursor: not-allowed; }
.btn-taken:hover { background: #e6e9ef; }
.st-toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); max-width: min(92vw, 520px); background: #7c2d12; color: #fff; padding: 12px 18px; border-radius: 12px; font-size: 14px; line-height: 1.9; box-shadow: 0 12px 34px rgba(0,0,0,.3); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 2147483647; }
.st-toast.show { opacity: 1; transform: translate(-50%, 0); }
