/* ============================================================
   Lumen — طرح ظاهری
   Burgundy and cream from the Lumen logo; a dark sidebar shell for
   signed-in people, a light landing for guests. RTL-first, logical
   properties throughout, one typeface (Vazirmatn) served locally.
   ============================================================ */

@font-face { font-family: 'Vazirmatn'; src: url('../fonts/Vazirmatn-Regular.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Vazirmatn'; src: url('../fonts/Vazirmatn-Medium.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Vazirmatn'; src: url('../fonts/Vazirmatn-SemiBold.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Vazirmatn'; src: url('../fonts/Vazirmatn-Bold.woff2') format('woff2'); font-weight: 700; font-display: swap; }

:root {
  /* برند */
  --brand:        #7A1520;
  --brand-dark:   #5A0F14;
  --brand-press:  #2D0304;
  --brand-soft:   #D9B77A;
  --brand-tint:   #F6ECE1;
  --gold:         #B8873F;
  --cream:        #ECE5D3;

  /* متن */
  --text:         #241012;
  --muted:        #74615B;
  --faint:        #A28F87;

  /* سطوح */
  --border:       #E8DED0;
  --border-soft:  #F1E9DD;
  --surface:      #FFFDF9;
  --bg:           #F7F2EA;
  --chip:         #F1E8DC;
  --chip-2:       #EADFCF;

  /* وضعیت */
  --success:      #2E8B6F;
  --success-dark: #1E6B4F;
  --success-bg1:  #DDF2E6;
  --success-bg2:  #EDF7F1;
  --success-line: #BEE3CD;
  --danger:       #C4453D;
  --danger-dark:  #9B342D;
  --danger-bg1:   #FBE3DF;
  --danger-bg2:   #FDF0EE;
  --danger-line:  #F2C3BD;
  --warning:      #9A6200;
  --warning-bg1:  #FCEFD9;
  --warning-bg2:  #FEF7EC;
  --warning-line: #F0DAAE;

  --radius:       18px;
  --radius-sm:    12px;
  --pill:         99px;
  --shadow:       0 1px 2px rgba(45, 3, 4, .04), 0 6px 20px -14px rgba(45, 3, 4, .18);
  --shadow-lg:    0 30px 60px -24px rgba(45, 3, 4, .28);
  --ring:         0 0 0 4px rgba(122, 21, 32, .12);
  --sidebar-w:    264px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

html, body, input, select, textarea, button, optgroup, option,
table, th, td, code, pre, kbd, samp {
  font-family: 'Vazirmatn', Tahoma, sans-serif;
}

body {
  font-size: 14.5px;
  line-height: 1.85;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
img { max-width: 100%; }
:focus-visible { outline: 3px solid rgba(122, 21, 32, .35); outline-offset: 2px; border-radius: 6px; }

.container { width: min(1140px, calc(100% - 40px)); margin-inline: auto; }
.page { padding: 34px 0 80px; }

.muted  { color: var(--muted); }
.faint  { color: var(--faint); }
.small  { font-size: 13px; }
.center { text-align: center; }
.right  { text-align: end; }
.nowrap { white-space: nowrap; }
.mt { margin-top: 18px; }
.mb { margin-bottom: 18px; }
.ltr { direction: ltr; unicode-bidi: isolate; display: inline-block; }

.icon { width: 20px; height: 20px; flex: none; }
.icon.sm { width: 15px; height: 15px; }
.icon.lg { width: 26px; height: 26px; }

/* ============================================================
   App shell (signed in)
   ============================================================ */
.app-shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; }

.sidebar {
  position: sticky; top: 0; height: 100vh; z-index: 40;
  display: flex; flex-direction: column;
  background:
    radial-gradient(120% 60% at 100% 0%, rgba(217, 183, 122, .14), transparent 60%),
    linear-gradient(180deg, #3A070B 0%, #2D0304 55%, #220203 100%);
  color: var(--cream);
  padding: 22px 16px 18px;
  overflow-y: auto;
}
.sidebar-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 8px 20px; }
.sidebar-brand img { width: 108px; display: block; }
.sidebar .sidebar-close { display: none; }

.side-nav { display: grid; gap: 4px; }
.side-link {
  position: relative; display: flex; align-items: center; gap: 12px;
  padding: 11px 14px; border-radius: 12px;
  color: rgba(236, 229, 211, .74); font-weight: 500; font-size: 14.5px;
  transition: background .15s ease, color .15s ease;
}
.side-link:hover { background: rgba(236, 229, 211, .07); color: var(--cream); text-decoration: none; }
.side-link.is-active { background: rgba(236, 229, 211, .12); color: #fff; font-weight: 600; }
.side-link.is-active::before {
  content: ""; position: absolute; inset-inline-start: -16px; top: 10px; bottom: 10px;
  width: 4px; border-radius: 0 4px 4px 0; background: var(--brand-soft);
}
.side-count {
  margin-inline-start: auto; min-width: 22px; height: 22px; padding: 0 7px;
  display: grid; place-items: center; border-radius: var(--pill);
  background: var(--brand-soft); color: var(--brand-press); font-size: 12px; font-weight: 700;
}

.sidebar-foot { margin-top: auto; padding-top: 18px; }
.me {
  display: flex; align-items: center; gap: 10px;
  padding: 10px; border-radius: 14px; background: rgba(236, 229, 211, .07);
}
.me-text { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.5; }
.me-text strong { font-size: 13.5px; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-text small { font-size: 12px; color: rgba(236, 229, 211, .62); }
.side-tz { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: rgba(236, 229, 211, .5); margin: 12px 8px 0; }

.avatar {
  display: grid; place-items: center; flex: none;
  width: 38px; height: 38px; border-radius: 50%;
  background: linear-gradient(140deg, var(--brand-soft), #C49A5A); color: var(--brand-press);
  font-weight: 700; font-size: 14px;
}
.avatar.sm { width: 32px; height: 32px; font-size: 12.5px; }

.icon-btn {
  display: inline-grid; place-items: center; width: 38px; height: 38px; flex: none;
  border: 0; border-radius: 10px; background: transparent; color: inherit; cursor: pointer;
}
.icon-btn:hover { background: rgba(236, 229, 211, .1); text-decoration: none; }
.sidebar .icon-btn { color: rgba(236, 229, 211, .7); }

.app-main { min-width: 0; display: flex; flex-direction: column; }
.app-content { width: min(1160px, 100%); margin-inline: auto; padding: 34px 36px 60px; flex: 1; }
.app-footer {
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 18px 36px 24px; font-size: 12.5px; color: var(--faint);
  width: min(1160px, 100%); margin-inline: auto;
}

.mobile-bar { display: none; }
.drawer-scrim { display: none; }
.tabbar { display: none; }

/* ============================================================
   Guest header & footer
   ============================================================ */
.site-header {
  position: sticky; top: 0; z-index: 30;
  background: rgba(255, 253, 249, .86);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; gap: 22px; min-height: 70px; }
.brand { display: flex; align-items: center; gap: 11px; color: var(--text); }
.brand:hover { text-decoration: none; }
img.brand-mark { width: 40px; height: 40px; object-fit: contain; display: block; }
.brand-text { display: flex; flex-direction: column; line-height: 1.3; }
.brand-text b { font-size: 17px; font-weight: 700; }
.brand-latin { font-size: 11px; letter-spacing: 3px; color: var(--brand); font-weight: 600; margin-inline-start: 4px; }
.brand-text > span { font-size: 11.5px; color: var(--muted); font-weight: 500; }

.nav { display: flex; align-items: center; gap: 6px; margin-inline-start: auto; }
.nav a { color: var(--muted); font-weight: 500; padding: 8px 14px; border-radius: 10px; }
.nav a:hover { background: var(--brand-tint); color: var(--brand); text-decoration: none; }
.nav a.is-active { color: var(--brand); font-weight: 600; }
.nav a.btn { color: #fff; }

.site-footer { background: var(--surface); border-top: 1px solid var(--border); padding: 30px 0; margin-top: 40px; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.footer-brand { display: flex; align-items: center; gap: 16px; }
.footer-brand img { width: 84px; }
.footer-brand p { color: var(--muted); font-size: 13px; }
.footer-links { display: flex; gap: 18px; }
.footer-links a { color: var(--muted); }

/* ============================================================
   Page furniture
   ============================================================ */
.page-title { font-size: 27px; font-weight: 700; line-height: 1.45; margin-bottom: 4px; letter-spacing: -.2px; }
.page-sub { color: var(--muted); margin-bottom: 26px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.page-head .page-sub { margin-bottom: 0; }
.eyebrow { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 600; color: var(--gold); letter-spacing: .3px; margin-bottom: 6px; }
.flashes { margin-bottom: 6px; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  margin-bottom: 20px;
}
.card-tight { padding: 14px 18px; }
.card h2 { font-size: 19px; font-weight: 700; margin-bottom: 4px; }
.card h3 { font-size: 16px; font-weight: 700; margin-bottom: 14px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.card-head h2, .card-head h3 { margin-bottom: 0; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 30px 0 14px; flex-wrap: wrap; }
.section-head h2 { font-size: 19px; font-weight: 700; }

.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(310px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.stack > * + * { margin-top: 14px; }

/* ---------- ورود و ثبت‌نام ---------- */
.auth-wrap { max-width: 440px; margin: 40px auto; }
.auth-head { text-align: center; margin-bottom: 24px; }
.auth-logo { display: block; width: 140px; height: auto; margin: 0 auto 18px; }
.auth-head h1 { font-size: 22px; font-weight: 700; color: var(--text); line-height: 1.6; }
.auth-head p { font-size: 14px; color: var(--muted); margin-top: 6px; }
.auth-wrap .card { padding: 28px; box-shadow: var(--shadow-lg); }

/* ---------- فرم‌ها ---------- */
label { display: block; font-weight: 600; font-size: 13.5px; margin-bottom: 7px; color: var(--text); }

input:not([type]), input[type=text], input[type=email], input[type=password], input[type=date],
input[type=number], input[type=url], input[type=time], input[type=datetime-local], input[type=search], input[type=tel],
select, textarea {
  width: 100%;
  min-height: 46px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  font: inherit;
  color: var(--text);
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
input:hover, select:hover, textarea:hover { border-color: #D9CBB8; }
textarea { min-height: 112px; resize: vertical; line-height: 1.9; }
select {
  appearance: none; -webkit-appearance: none; cursor: pointer;
  padding-inline-start: 14px; padding-inline-end: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2374615B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-size: 16px; background-position: left 14px center;
}
input[type=file] { border: 1px dashed var(--border); border-radius: var(--radius-sm); padding: 12px 14px; background: #fff; width: 100%; cursor: pointer; }
input[type=file]::file-selector-button {
  font: inherit; font-weight: 600; font-size: 13px; border: 0; border-radius: 9px; padding: 6px 14px;
  margin-inline-end: 12px; background: var(--brand-tint); color: var(--brand); cursor: pointer;
}
::placeholder { color: var(--faint); }
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: var(--ring); background: #fff; }

.field { margin-bottom: 18px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.hint { font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.checkbox { display: flex; align-items: center; gap: 9px; font-weight: 500; margin-bottom: 0; cursor: pointer; }
.checkbox input, input[type=checkbox], input[type=radio] { width: auto; min-height: 0; accent-color: var(--brand); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 22px;
  border: 1px solid transparent; border-radius: var(--radius-sm);
  background: var(--brand-dark); color: #fff;
  font: inherit; font-weight: 600; font-size: 14.5px;
  cursor: pointer; white-space: nowrap;
  box-shadow: 0 6px 16px -8px rgba(90, 15, 20, .55);
  transition: background .15s ease, transform .15s ease, box-shadow .15s ease;
}
.btn:hover { background: var(--brand-press); color: #fff; text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[disabled] { opacity: .5; cursor: not-allowed; box-shadow: none; }
.btn-sm { min-height: 38px; padding: 0 15px; font-size: 13.5px; border-radius: 10px; }
.btn-ghost { background: #fff; color: var(--text); border-color: var(--border); box-shadow: none; }
.btn-ghost:hover { background: var(--brand-tint); color: var(--brand); border-color: #E3CDB5; }
.btn-gold { background: var(--cream); color: var(--brand-press); box-shadow: none; }
.btn-gold:hover { background: #fff8e8; color: var(--brand-press); }
.btn-danger { background: var(--danger); box-shadow: none; }
.btn-danger:hover { background: var(--danger-dark); }
.btn-block { display: flex; width: 100%; }
.btn-lg { min-height: 54px; padding: 0 30px; font-size: 15.5px; border-radius: 14px; }

/* ---------- پیام‌ها ---------- */
.alert {
  display: flex; align-items: flex-start; gap: 12px; flex-wrap: wrap;
  border-radius: var(--radius-sm); padding: 14px 18px; margin-bottom: 16px;
  border: 1px solid transparent; font-size: 14px; line-height: 1.85;
}
.alert a { font-weight: 600; }
.alert-success { background: var(--success-bg2); border-color: var(--success-line); color: var(--success-dark); }
.alert-error   { background: var(--danger-bg2);  border-color: var(--danger-line);  color: var(--danger-dark); }
.alert-warning { background: var(--warning-bg2); border-color: var(--warning-line); color: var(--warning); }
.alert-info    { background: #FBF4EA; border-color: #EBD8BE; color: var(--brand-dark); }

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 11px; border-radius: var(--pill);
  font-size: 12px; font-weight: 600; line-height: 1.75;
  background: var(--chip); color: #5B4640; white-space: nowrap;
}
a.badge:hover { text-decoration: none; background: var(--chip-2); }
.badge-level   { background: var(--brand-tint); color: var(--brand); }
.badge-success { background: var(--success-bg1); color: var(--success-dark); }
.badge-warning { background: var(--warning-bg1); color: var(--warning); }
.badge-danger  { background: var(--danger-bg1); color: var(--danger-dark); }
.badge-muted   { background: var(--chip); color: var(--muted); }

/* ---------- جدول‌ها ---------- */
.table-wrap { overflow-x: auto; border-radius: var(--radius-sm); }
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
.table th, .table td { padding: 13px 14px; text-align: start; border-bottom: 1px solid var(--border-soft); vertical-align: middle; }
.table th { font-size: 12px; font-weight: 600; color: var(--muted); background: #FAF5EE; border-bottom-color: var(--border); }
.table th:first-child { border-start-start-radius: 10px; }
.table th:last-child { border-start-end-radius: 10px; }
.table tbody tr:hover td { background: #FCF8F2; }
.table tr:last-child td { border-bottom: 0; }
.table select, .table input { min-height: 38px; padding-top: 6px; padding-bottom: 6px; font-size: 13.5px; }

/* ---------- پیشرفت و آمار ---------- */
.progress { height: 8px; background: var(--chip); border-radius: var(--pill); overflow: hidden; }
.progress > span { display: block; height: 100%; background: linear-gradient(270deg, var(--brand) 0%, var(--brand-soft) 100%); border-radius: var(--pill); }

.stat {
  position: relative; overflow: hidden;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px 22px; box-shadow: var(--shadow);
}
.stat-value { font-size: 30px; font-weight: 700; line-height: 1.35; letter-spacing: -.5px; }
.stat-label { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.stat-icon {
  position: absolute; inset-inline-end: 18px; top: 18px;
  width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center;
  background: var(--brand-tint); color: var(--brand);
}

/* ---------- کارت دوره ---------- */
.course-card { display: flex; flex-direction: column; padding: 14px 14px 20px; transition: transform .18s ease, box-shadow .18s ease; }
.course-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.course-card .cover {
  position: relative; overflow: hidden;
  height: 136px; border-radius: 13px; margin-bottom: 16px;
  background:
    repeating-conic-gradient(from -95deg at 12% 115%, rgba(236, 229, 211, .16) 0deg 5deg, transparent 5deg 14deg),
    linear-gradient(135deg, #8A1B27 0%, #5A0F14 55%, #2D0304 100%);
  display: grid; place-items: center; color: var(--cream); font-size: 34px; font-weight: 700; letter-spacing: 2px;
}
.course-card .cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.course-card > :not(.cover) { margin-inline: 8px; }
.course-card h3 { margin-bottom: 6px; font-size: 16.5px; }
.course-card .desc { color: var(--muted); font-size: 13.5px; flex: 1; line-height: 1.9; }
.course-card .foot { margin-top: 18px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }

/* ---------- آزمون ---------- */
.question { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; margin-bottom: 16px; box-shadow: var(--shadow); }
.question-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 8px; flex-wrap: wrap; }
.question-no { font-size: 12px; font-weight: 700; color: var(--gold); }
.question-prompt { font-size: 16.5px; font-weight: 600; margin: 8px 0 16px; white-space: pre-wrap; line-height: 1.95; }

.options { display: grid; gap: 10px; }
.option {
  display: flex; align-items: center; gap: 12px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 12px 16px; cursor: pointer; background: #fff; font-weight: 500;
  transition: border-color .15s ease, background .15s ease;
}
.option:hover { border-color: #E3CDB5; background: var(--brand-tint); }
.option input { width: auto; min-height: 0; accent-color: var(--brand); }
.option:has(input:checked) { border-color: var(--brand); background: var(--brand-tint); box-shadow: var(--ring); }

.recorder { border: 1px dashed #E0CFBA; border-radius: var(--radius-sm); padding: 18px; background: #FBF6EF; }
.recorder-controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.rec-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--faint); flex: 0 0 10px; }
.rec-dot.live { background: var(--danger); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .25; } }
.rec-status { font-size: 13px; color: var(--muted); }
.recorder audio { width: 100%; margin-top: 12px; }

.sticky-bar {
  position: sticky; bottom: 12px; z-index: 5;
  background: rgba(255, 253, 249, .94); backdrop-filter: blur(8px);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 20px; box-shadow: var(--shadow-lg);
  display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
}

/* ---------- جلسه ---------- */
.lesson-layout { display: grid; grid-template-columns: 280px 1fr; gap: 20px; align-items: start; }
.lesson-list { list-style: none; }
.lesson-list li { border-bottom: 1px solid var(--border-soft); }
.lesson-list li:last-child { border-bottom: 0; }
.lesson-list a { display: flex; gap: 9px; padding: 10px 8px; color: var(--text); font-size: 13.5px; border-radius: 10px; }
.lesson-list a:hover { text-decoration: none; color: var(--brand); background: var(--brand-tint); }
.lesson-list .is-current { font-weight: 700; color: var(--brand); background: var(--brand-tint); }
.lesson-body { line-height: 2.15; font-size: 15px; }
.lesson-body p { margin-bottom: 14px; }
.tick { color: var(--success); font-weight: 700; }
.locked-item { display: flex; gap: 9px; padding: 10px 8px; color: var(--faint); font-size: 13.5px; cursor: not-allowed; }

.video-wrap { background: #120102; border-radius: var(--radius-sm); overflow: hidden; }
.video-wrap video { width: 100%; display: block; max-height: 64vh; }
.video-embed { position: relative; padding-top: 56.25%; }
.video-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.material-list { list-style: none; }
.material-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border-soft); }
.material-list li:last-child { border-bottom: 0; }
.material-list a { display: flex; align-items: center; gap: 11px; font-weight: 600; }
.file-icon {
  display: grid; place-items: center; min-width: 46px; height: 34px; padding: 0 8px;
  border-radius: 9px; background: var(--brand-tint); color: var(--brand);
  font-size: 10.5px; font-weight: 700; direction: ltr;
}

/* ---------- نردبان جلسه‌ها ---------- */
.session-list { list-style: none; position: relative; }
.session-row { position: relative; display: flex; align-items: center; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--border-soft); flex-wrap: wrap; }
.session-row:last-child { border-bottom: 0; }
.session-num {
  display: grid; place-items: center; flex: 0 0 40px; height: 40px;
  border-radius: 12px; background: var(--chip); color: #5B4640; font-weight: 700; font-size: 13.5px;
}
.session-row.is-done .session-num { background: var(--success-bg1); color: var(--success); }
.session-row.is-locked { opacity: .62; }
.session-row.is-locked .session-num { background: #F3ECE2; }
.session-row.is-exam .session-num { background: var(--brand-dark); color: var(--cream); }
.session-main { flex: 1; min-width: 180px; }
.session-title { font-weight: 600; }
.session-meta { margin-top: 2px; }
.lock { font-size: 13px; }

/* ---------- نتیجه ---------- */
.result-mark {
  display: inline-grid; place-items: center;
  width: 68px; height: 68px; border-radius: 50%;
  font-size: 30px; font-weight: 700; color: #fff;
}
.result-mark.is-pass    { background: linear-gradient(160deg, #4FBF9C, var(--success)); box-shadow: 0 10px 24px -8px rgba(46,139,111,.5); }
.result-mark.is-fail    { background: linear-gradient(160deg, #D9645C, var(--danger)); box-shadow: 0 10px 24px -8px rgba(196,69,61,.45); }
.result-mark.is-pending { background: linear-gradient(160deg, #E0A030, #B07800); box-shadow: 0 10px 24px -8px rgba(176,110,0,.4); }

/* ---------- انتخاب مدرس ---------- */
.teacher-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.teacher-card {
  display: flex; align-items: center; gap: 12px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 12px 14px; color: var(--text); background: #fff;
}
.teacher-card:hover { border-color: #E3CDB5; background: var(--brand-tint); text-decoration: none; }
.teacher-card.is-selected { border-color: var(--brand); box-shadow: var(--ring); background: var(--brand-tint); }
.teacher-card > span:last-child { display: flex; flex-direction: column; line-height: 1.6; }
.teacher-avatar {
  display: grid; place-items: center; flex: 0 0 44px; height: 44px;
  border-radius: 50%; background: linear-gradient(140deg, var(--brand-soft), #C49A5A); color: var(--brand-press);
  font-weight: 700; overflow: hidden;
}
.teacher-avatar img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- انتخاب زمان ---------- */
.slot-day { padding: 14px 0; border-bottom: 1px solid var(--border-soft); }
.slot-day:last-of-type { border-bottom: 0; }
.slot-date { font-weight: 700; font-size: 13.5px; margin-bottom: 10px; }
.slot-row { display: flex; flex-wrap: wrap; gap: 8px; }
.slot {
  position: relative; display: inline-flex; align-items: center;
  border: 1px solid var(--border); border-radius: 10px;
  padding: 8px 16px; font-size: 13.5px; cursor: pointer; background: #fff; font-weight: 500;
  direction: ltr; margin-bottom: 0;
  transition: border-color .15s ease, background .15s ease;
}
.slot:hover { border-color: #E3CDB5; background: var(--brand-tint); }
.slot input { position: absolute; opacity: 0; pointer-events: none; }
.slot:has(input:checked) { border-color: var(--brand); background: var(--brand-dark); color: #fff; font-weight: 600; }
.slot.is-static { cursor: default; background: #F7F1E8; color: var(--muted); }

/* ---------- ساعات کاری مدرس ---------- */
.week-row { display: flex; gap: 14px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--border-soft); }
.week-row:last-child { border-bottom: 0; }
.week-day { flex: 0 0 88px; font-weight: 700; font-size: 13.5px; }
.week-slots { display: flex; flex-wrap: wrap; gap: 7px; flex: 1; }
.rule-chip { display: inline-flex; align-items: center; gap: 7px; background: var(--brand-tint); color: var(--brand-dark); border-radius: 9px; padding: 5px 12px; font-size: 12.5px; font-weight: 600; }
.rule-chip.is-off { opacity: .5; text-decoration: line-through; }
.chip-btn { border: 0; background: transparent; cursor: pointer; font-size: 12px; padding: 0 2px; color: var(--muted); }
.chip-btn:hover { color: var(--danger); }

/* ---------- کلاس آنلاین ---------- */
.meeting-frame { position: relative; padding-top: 60%; background: #000; border-radius: var(--radius-sm); overflow: hidden; }
.meeting-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.classroom-cta {
  position: relative; overflow: hidden;
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  padding: 22px 24px; border-radius: var(--radius);
  background:
    repeating-conic-gradient(from -95deg at 4% 120%, rgba(236, 229, 211, .07) 0deg 5deg, transparent 5deg 14deg),
    linear-gradient(135deg, #2D0304, #5A0F14);
  color: var(--cream);
}
.classroom-cta img { filter: brightness(0) invert(.93) sepia(.25); flex: none; }
.classroom-cta div { flex: 1; min-width: 220px; }
.classroom-cta strong { font-size: 17px; }
.classroom-cta .muted { color: #CDB9AC; margin-top: 4px; }
.classroom-cta .btn { background: var(--cream); color: var(--brand-press); box-shadow: none; }
.classroom-cta .btn:hover { background: #FFF8E8; color: var(--brand-press); }

.live-rooms { display: grid; gap: 10px; }
.live-room { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 13px 15px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: #fff; }
.live-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 4px var(--success-bg1); flex: none; animation: pulse 2s infinite; }

/* ---------- مدیریت کاربران ---------- */
.new-user-form { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 16px; align-items: end; margin-top: 4px; }
.new-user-form .field:last-child .btn { width: 100%; }
.cred-box { direction: rtl; white-space: pre-wrap; font-family: 'Vazirmatn', Tahoma, sans-serif; background: #fff; border: 1px solid var(--success-line); border-radius: var(--radius-sm); padding: 12px 16px; margin: 10px 0; line-height: 2; color: var(--text); width: 100%; }

/* ============================================================
   Dashboard pieces
   ============================================================ */
.hero-card {
  position: relative; overflow: hidden;
  border-radius: 22px; padding: 30px 32px; margin-bottom: 22px;
  color: var(--cream);
  background:
    repeating-conic-gradient(from -95deg at 6% 125%, rgba(236, 229, 211, .08) 0deg 5deg, transparent 5deg 13deg),
    radial-gradient(90% 120% at 100% 0%, rgba(217, 183, 122, .22), transparent 55%),
    linear-gradient(135deg, #5A0F14 0%, #3A070B 60%, #2D0304 100%);
  box-shadow: var(--shadow-lg);
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; align-items: center;
}
.hero-card h1 { font-size: 26px; font-weight: 700; color: #fff; line-height: 1.5; }
.hero-card p { color: rgba(236, 229, 211, .8); margin-top: 4px; max-width: 60ch; }
.hero-card .row { margin-top: 18px; }
.hero-card .btn { background: var(--cream); color: var(--brand-press); box-shadow: none; }
.hero-card .btn:hover { background: #fff8e8; }
.hero-card .btn-ghost { background: rgba(236, 229, 211, .08); color: var(--cream); border-color: rgba(236, 229, 211, .25); }
.hero-card .btn-ghost:hover { background: rgba(236, 229, 211, .16); color: #fff; }

.ring {
  --p: 0; width: 120px; height: 120px; border-radius: 50%;
  display: grid; place-items: center; position: relative;
  background: conic-gradient(var(--brand-soft) calc(var(--p) * 1%), rgba(236, 229, 211, .14) 0);
}
.ring::before { content: ""; position: absolute; inset: 10px; border-radius: 50%; background: #3A070B; }
.ring span { position: relative; text-align: center; line-height: 1.3; }
.ring b { display: block; font-size: 26px; color: #fff; }
.ring small { font-size: 11.5px; color: rgba(236, 229, 211, .7); }

.next-step {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 18px 20px; border-radius: var(--radius); margin-bottom: 22px;
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow);
}
.next-step .step-icon { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--brand-tint); color: var(--brand); flex: none; }
.next-step .step-text { flex: 1; min-width: 200px; }
.next-step .step-text strong { display: block; font-size: 15.5px; }

.meet-list { display: grid; gap: 10px; }
.meet {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: #fff;
}
.meet.is-open { border-color: #E3CDB5; background: linear-gradient(90deg, #fff, #FBF3EA); }
.meet-date {
  display: grid; place-items: center; width: 54px; height: 58px; flex: none;
  border-radius: 12px; background: var(--brand-tint); color: var(--brand); line-height: 1.25; text-align: center;
}
.meet-date > span { display: grid; justify-items: center; }
.meet-date b { font-size: 19px; }
.meet-date small { font-size: 11px; }
.meet-main { flex: 1; min-width: 160px; }
.meet-main strong { display: block; }

.empty {
  text-align: center; padding: 36px 20px;
  border: 1px dashed #E0CFBA; border-radius: var(--radius); background: #FCF8F2;
}
.empty .icon { width: 34px; height: 34px; color: var(--brand-soft); margin-bottom: 8px; }
.empty p { color: var(--muted); margin-bottom: 14px; }

/* ============================================================
   Landing
   ============================================================ */
.landing { overflow: hidden; }
.landing-hero {
  position: relative;
  background:
    repeating-conic-gradient(from -95deg at 8% 118%, rgba(236, 229, 211, .07) 0deg 5deg, transparent 5deg 13deg),
    radial-gradient(70% 90% at 100% 0%, rgba(217, 183, 122, .2), transparent 60%),
    linear-gradient(140deg, #5A0F14 0%, #3A070B 55%, #220203 100%);
  color: var(--cream);
  padding: 84px 0 96px;
}
.landing-hero .container { display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center; }
.landing-hero .eyebrow { color: var(--brand-soft); }
.landing-hero h1 { font-size: clamp(30px, 4.4vw, 50px); line-height: 1.35; font-weight: 700; color: #fff; letter-spacing: -.5px; }
.landing-hero h1 em { font-style: normal; color: var(--brand-soft); }
.landing-hero p.lead { font-size: 17px; color: rgba(236, 229, 211, .82); margin: 18px 0 30px; max-width: 54ch; line-height: 2; }
.landing-hero .btn { background: var(--cream); color: var(--brand-press); box-shadow: 0 14px 30px -14px rgba(0, 0, 0, .6); }
.landing-hero .btn:hover { background: #fff8e8; }
.landing-hero .btn-ghost { background: transparent; color: var(--cream); border-color: rgba(236, 229, 211, .3); box-shadow: none; }
.landing-hero .btn-ghost:hover { background: rgba(236, 229, 211, .1); color: #fff; }
.hero-facts { display: flex; gap: 28px; margin-top: 34px; flex-wrap: wrap; }
.hero-facts div { line-height: 1.5; }
.hero-facts b { display: block; font-size: 22px; color: #fff; }
.hero-facts span { font-size: 12.5px; color: rgba(236, 229, 211, .65); }

.hero-visual { position: relative; }
.mock {
  background: #1A0102; border: 1px solid rgba(236, 229, 211, .14); border-radius: 18px;
  box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .7); padding: 12px; transform: rotate(-1.5deg);
}
.mock-top { display: flex; gap: 6px; padding: 4px 6px 10px; }
.mock-top i { width: 9px; height: 9px; border-radius: 50%; background: rgba(236, 229, 211, .2); }
.mock-body { display: grid; grid-template-columns: 1fr 34%; gap: 10px; }
.mock-board { background: #FFFDF8; border-radius: 10px; aspect-ratio: 4 / 3; padding: 16px; color: #2A1416; position: relative; overflow: hidden; }
.mock-board .t1 { font-size: 15px; font-weight: 600; direction: ltr; text-align: left; }
.mock-board .t2 { font-size: 18px; font-weight: 700; color: #7A1520; margin-top: 8px; }
.mock-board svg { position: absolute; inset-inline: 10% 8%; bottom: 14%; width: 70%; color: #7A1520; }
.mock-side { display: grid; gap: 8px; align-content: start; }
.mock-cam { aspect-ratio: 4 / 3; border-radius: 9px; background: linear-gradient(140deg, #5A0F14, #2D0304); display: grid; place-items: center; color: var(--cream); font-weight: 700; }
.mock-cam.b { background: linear-gradient(140deg, #8C6A3A, #4A2C10); }
.mock-chat { border-radius: 9px; background: rgba(236, 229, 211, .07); padding: 8px; display: grid; gap: 5px; }
.mock-chat i { display: block; height: 7px; border-radius: 5px; background: rgba(236, 229, 211, .2); }
.mock-chat i:nth-child(2) { width: 70%; background: rgba(217, 183, 122, .45); margin-inline-start: auto; }
.mock-chat i:nth-child(3) { width: 85%; }
.mock-badge {
  position: absolute; inset-inline-start: -18px; bottom: -20px;
  display: flex; align-items: center; gap: 10px;
  background: var(--surface); color: var(--text); border-radius: 14px; padding: 10px 14px;
  box-shadow: var(--shadow-lg); font-size: 13px; font-weight: 600;
}
.mock-badge .live-dot { background: var(--danger); box-shadow: 0 0 0 4px var(--danger-bg1); }

.l-section { padding: 84px 0; }
.l-section.alt { background: var(--surface); border-block: 1px solid var(--border); }
.l-head { text-align: center; max-width: 640px; margin: 0 auto 46px; }
.l-head h2 { font-size: clamp(24px, 3vw, 32px); font-weight: 700; line-height: 1.5; }
.l-head p { color: var(--muted); margin-top: 8px; font-size: 15.5px; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; counter-reset: step; }
.step {
  position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 28px 24px; box-shadow: var(--shadow);
}
.step .step-icon { width: 50px; height: 50px; border-radius: 14px; display: grid; place-items: center; background: var(--brand-tint); color: var(--brand); margin-bottom: 16px; }
.step h3 { font-size: 17px; margin-bottom: 6px; }
.step p { color: var(--muted); font-size: 14px; }
.step::after {
  counter-increment: step; content: counter(step, persian);
  position: absolute; inset-inline-end: 22px; top: 18px; font-size: 40px; font-weight: 700; color: var(--chip-2); line-height: 1;
}

.levels { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; align-items: end; }
.level {
  border-radius: 14px 14px 6px 6px; padding: 14px 10px; text-align: center;
  background: linear-gradient(180deg, var(--brand-tint), #EFDFCC); color: var(--brand-dark);
}
.level b { display: block; font-size: 22px; direction: ltr; }
.level span { font-size: 12.5px; color: var(--muted); }
.level small { display: block; font-size: 11.5px; color: var(--brand); margin-top: 4px; font-weight: 600; }
.level:nth-child(1) { height: 120px; } .level:nth-child(2) { height: 145px; } .level:nth-child(3) { height: 170px; }
.level:nth-child(4) { height: 195px; } .level:nth-child(5) { height: 220px; } .level:nth-child(6) { height: 245px; }
.level:nth-child(n+4) { background: linear-gradient(180deg, #8A1B27, #5A0F14); color: var(--cream); }
.level:nth-child(n+4) span { color: rgba(236, 229, 211, .7); }
.level:nth-child(n+4) small { color: var(--brand-soft); }

.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.feature { padding: 24px; border-radius: var(--radius); background: var(--bg); border: 1px solid var(--border-soft); }
.feature .icon { width: 28px; height: 28px; color: var(--brand); margin-bottom: 12px; }
.feature h3 { font-size: 16px; margin-bottom: 6px; }
.feature p { color: var(--muted); font-size: 14px; }

.cta-band {
  border-radius: 26px; padding: 46px; text-align: center; color: var(--cream);
  background:
    repeating-conic-gradient(from -95deg at 50% 130%, rgba(236, 229, 211, .07) 0deg 5deg, transparent 5deg 13deg),
    linear-gradient(135deg, #5A0F14, #2D0304);
}
.cta-band h2 { font-size: clamp(22px, 3vw, 30px); color: #fff; }
.cta-band p { color: rgba(236, 229, 211, .78); margin: 8px 0 24px; }
.cta-band .btn { background: var(--cream); color: var(--brand-press); }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1080px) {
  .app-shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: fixed; inset-block: 0; inset-inline-start: 0; width: min(300px, 86vw);
    transform: translateX(105%); transition: transform .25s ease; box-shadow: var(--shadow-lg);
  }
  .drawer-open .sidebar { transform: none; }
  .sidebar .sidebar-close { display: inline-grid; }
  .drawer-scrim { position: fixed; inset: 0; z-index: 35; background: rgba(20, 2, 3, .45); opacity: 0; pointer-events: none; transition: opacity .2s ease; display: block; }
  .drawer-open .drawer-scrim { opacity: 1; pointer-events: auto; }
  .mobile-bar {
    position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 10px;
    padding: 10px 14px; background: rgba(255, 253, 249, .92); backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
  }
  .mobile-bar .icon-btn { color: var(--text); }
  .mobile-bar .icon-btn:hover { background: var(--brand-tint); }
  .mobile-brand { display: flex; align-items: center; gap: 8px; color: var(--text); font-weight: 700; margin-inline-end: auto; }
  .mobile-brand img { width: 30px; height: 30px; object-fit: contain; }
  .mobile-brand:hover { text-decoration: none; }
  .app-content { padding: 24px 20px 50px; }
  .app-footer { padding: 14px 20px 22px; }
  .landing-hero .container { grid-template-columns: 1fr; }
  .hero-visual { max-width: 520px; margin-inline: auto; width: 100%; }
}

@media (max-width: 760px) {
  body { font-size: 14px; }
  .page-title { font-size: 22px; }
  .field-row, .new-user-form { grid-template-columns: 1fr; }
  .lesson-layout { grid-template-columns: 1fr; }
  .sticky-bar { flex-direction: column; align-items: stretch; bottom: 70px; }
  .sticky-bar .btn { width: 100%; }
  .hero-card { grid-template-columns: 1fr; padding: 24px 22px; }
  .hero-card .ring { display: none; }
  .hero-card h1 { font-size: 22px; }
  .steps, .features { grid-template-columns: 1fr; }
  .levels { grid-template-columns: repeat(3, 1fr); }
  .level { height: auto !important; border-radius: 14px; }
  .landing-hero { padding: 54px 0 70px; }
  .l-section { padding: 60px 0; }
  .cta-band { padding: 34px 22px; }
  .header-inner { min-height: 62px; gap: 10px; }
  .brand-text > span { display: none; }
  .nav a:not(.btn) { padding: 8px 10px; }
  .mock-badge { inset-inline-start: 8px; }
  .card { padding: 20px; }

  .role-student .app-content { padding-bottom: 96px; }
  .role-student .app-footer { display: none; }
  .tabbar {
    position: fixed; inset-inline: 0; bottom: 0; z-index: 30;
    display: grid; grid-template-columns: repeat(4, 1fr);
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    background: rgba(255, 253, 249, .96); backdrop-filter: blur(10px);
    border-top: 1px solid var(--border); box-shadow: 0 -10px 30px -18px rgba(45, 3, 4, .3);
  }
  .tabbar a { display: grid; justify-items: center; gap: 2px; padding: 6px 2px; border-radius: 12px; color: var(--muted); font-size: 11.5px; font-weight: 500; }
  .tabbar a:hover { text-decoration: none; }
  .tabbar a.is-active { color: var(--brand); background: var(--brand-tint); font-weight: 700; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* Inline forms inside table cells stay on one line */
.table td form.row { flex-wrap: nowrap; }
.table td form.row select { min-width: 96px; }

/* ============================================================
   Protected video player
   ============================================================ */
.secure-player { position: relative; overflow: hidden; user-select: none; -webkit-user-select: none; }
.secure-player video { width: 100%; display: block; max-height: 64vh; background: #120102; }
.secure-player.is-fs, .secure-player:fullscreen { display: grid; place-items: center; background: #000; border-radius: 0; }
.secure-player:fullscreen video { max-height: 100vh; height: 100%; }
/* The browser's own fullscreen button would take the bare video; ours takes the player. */
.secure-player video::-webkit-media-controls-fullscreen-button { display: none; }
.sp-fs {
  position: absolute; top: 10px; inset-inline-start: 10px; z-index: 4;
  width: 36px; height: 36px; border: 0; border-radius: 10px; cursor: pointer;
  display: grid; place-items: center; color: #fff; background: rgba(20, 2, 3, .55);
  opacity: 0; transition: opacity .2s ease;
}
.sp-fs svg { width: 18px; height: 18px; }
.secure-player:hover .sp-fs, .sp-fs:focus-visible { opacity: 1; }
.sp-wm {
  position: absolute; top: 0; left: 0; z-index: 3; pointer-events: none;
  padding: 4px 10px; border-radius: 6px; white-space: nowrap;
  font-size: clamp(11px, 1.6vw, 15px); font-weight: 600; color: rgba(255, 255, 255, .62);
  text-shadow: 0 1px 2px rgba(0, 0, 0, .55); background: rgba(0, 0, 0, .12);
  transition: transform 1.2s ease;
}
.sp-tile { position: absolute; inset: 0; z-index: 2; pointer-events: none; opacity: .09; background-repeat: repeat; }
.sp-message {
  position: absolute; inset-inline: 12px; top: 12px; z-index: 5; padding: 10px 14px; border-radius: 10px;
  background: rgba(20, 2, 3, .82); color: var(--cream); font-size: 13.5px; text-align: center;
}
.sp-note { margin-top: 8px; display: flex; gap: 6px; align-items: center; }
.sp-pending { aspect-ratio: 16 / 9; display: grid; place-items: center; text-align: center; color: var(--cream); background: linear-gradient(135deg, #3A070B, #1A0102); }
.sp-pending > div { display: grid; gap: 6px; justify-items: center; padding: 20px; }
.sp-pending span:not(.spinner) { color: rgba(236, 229, 211, .7); font-size: 13.5px; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid rgba(236, 229, 211, .2); border-top-color: var(--brand-soft); animation: spin 1s linear infinite; margin-bottom: 6px; }
@keyframes spin { to { transform: rotate(360deg); } }
.hls-badge { display: inline-flex; align-items: center; gap: 6px; }

/* ============================================================
 *  Paid courses: card-to-card payment (pay.php, admin/payments.php)
 * ============================================================ */
.pay-page { max-width: 620px; margin: 0 auto; }
.pay-amount { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  background: var(--brand-tint); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 16px; }
.pay-amount span { display: block; }
.pay-amount strong { font-size: 24px; font-weight: 700; color: var(--brand); }

.pay-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; margin-bottom: 18px; background: var(--chip); border-radius: 14px; }
.pay-tab { border: 0; border-radius: 11px; padding: 9px 6px; background: transparent; color: var(--brand-dark); font: inherit; font-weight: 700; font-size: 14px; cursor: pointer; }
.pay-tab small { font-weight: 500; font-size: 11px; opacity: .8; }
.pay-tab.is-active { background: var(--brand-press); color: #fff; }

.pay-card-wrap { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-bottom: 16px; }
.pay-card {
  position: relative; width: 100%; max-width: 380px; aspect-ratio: 85.6 / 54; padding: 6% 7%; border-radius: 18px; overflow: hidden;
  color: #fff; direction: rtl; text-align: right; user-select: none; container-type: inline-size;
  display: flex; flex-direction: column; justify-content: space-between;
  background:
    linear-gradient(158deg, transparent 52%, rgba(217, 183, 122, .30) 52.3%, rgba(184, 135, 63, .06) 84%, transparent 84.3%),
    linear-gradient(158deg, transparent 30%, rgba(217, 183, 122, .16) 30.3%, transparent 62%),
    linear-gradient(135deg, #2D0304 0%, #5A0F14 48%, #7A1520 100%);
  box-shadow: 0 18px 40px -18px #5A0F14, 0 2px 6px rgba(45, 3, 4, .2);
}
.pay-card__top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pay-card__bank { font-weight: 700; font-size: clamp(12px, 4.6cqi, 19px); text-shadow: 0 1px 2px rgba(0,0,0,.25); }
.pay-card__chip { width: 13%; min-width: 36px; height: auto; }
.pay-card__tag { padding: .1em .9em; border-radius: 99px; font-weight: 700; font-size: clamp(11px, 3.6cqi, 14px);
  background: rgba(217, 183, 122, .2); border: 1.5px solid rgba(217, 183, 122, .75); color: #F3DFB4; }
.pay-card__number { direction: ltr; text-align: center; white-space: nowrap; font-weight: 700;
  font-family: ui-monospace, "SFMono-Regular", Consolas, "Courier New", monospace;
  font-size: 6.1cqi; letter-spacing: .08em; word-spacing: .15em; text-shadow: 0 2px 3px rgba(0,0,0,.3); }
.pay-card--sheba .pay-card__number { font-size: 4.7cqi; letter-spacing: .02em; word-spacing: .05em; }
.pay-card__bottom { display: flex; flex-direction: column; gap: 1px; }
.pay-card__label { font-size: clamp(9px, 3cqi, 12px); opacity: .75; }
.pay-card__holder { font-size: clamp(12px, 4.4cqi, 18px); font-weight: 700; color: #F3DFB4; }

[data-copy].is-done { background: var(--success); border-color: var(--success); color: #fff; }
.pay-steps { list-style: persian; margin: 0 0 14px; padding: 0 20px 0 0; font-size: 14px; line-height: 2; }
.pay-note { background: var(--warning-bg2); border: 1px solid var(--warning-line); color: var(--warning); border-radius: var(--radius-sm); padding: 10px 14px; font-size: 14px; }
.pay-form { border-top: 1px dashed var(--border); padding-top: 16px; margin-top: 8px; }
.pay-form input[dir="ltr"] { text-align: left; }

.pay-drop { position: relative; display: flex; align-items: center; justify-content: center; flex-direction: column; min-height: 120px; padding: 14px;
  border: 2px dashed var(--chip-2); border-radius: 16px; background: var(--bg); text-align: center; cursor: pointer; margin-bottom: 14px; overflow: hidden; }
.pay-drop:hover, .pay-drop.is-over { border-color: var(--brand); background: var(--brand-tint); }
.pay-drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.pay-drop__empty { color: var(--muted); font-size: 14px; }
.pay-drop img { max-width: 100%; max-height: 260px; border-radius: 10px; }
.pay-drop.has-file { border-style: solid; border-color: var(--brand); }

.pay-status { text-align: center; }
.pay-status__icon { font-size: 44px; line-height: 1.2; }
.pay-status h2 { margin: 6px 0; font-size: 19px; }
.pay-dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 6px 14px; margin: 12px 0; text-align: right; }
.pay-dl div { background: var(--bg); border-radius: 10px; padding: 6px 10px; }
.pay-dl dt { font-size: 12px; color: var(--muted); }
.pay-dl dd { margin: 0; font-weight: 600; font-size: 14px; }

/* admin queue */
.pay-admin-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 16px 0; }
.pay-admin-tabs a { padding: 7px 14px; border-radius: 99px; background: var(--chip); color: var(--brand-dark); font-size: 14px; font-weight: 600; text-decoration: none; }
.pay-admin-tabs a.is-active { background: var(--brand-press); color: #fff; }
.pay-admin-tabs b { display: inline-block; min-width: 20px; padding: 0 6px; margin-inline-start: 4px; border-radius: 99px; background: var(--brand-soft); color: var(--brand-press); font-size: 12px; text-align: center; }
.pay-list { display: grid; gap: 14px; }
.pay-item { display: grid; grid-template-columns: 170px 1fr; gap: 18px; align-items: start; }
.pay-item.is-pending { border-inline-start: 4px solid var(--warning); }
.pay-item.is-approved { border-inline-start: 4px solid var(--success); }
.pay-item.is-rejected { border-inline-start: 4px solid var(--danger); }
.pay-receipt { display: grid; place-items: center; height: 210px; border-radius: 12px; background: var(--bg); border: 1px solid var(--border); overflow: hidden; }
.pay-receipt img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.pay-receipt__pdf { font-weight: 700; font-size: 22px; color: var(--brand); }
.pay-amount-line { margin: 8px 0 2px; }
.pay-amount-line b { color: var(--brand); font-size: 17px; }
.pay-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 10px; }
.pay-reject { display: flex; gap: 6px; flex: 1; min-width: 240px; }
.pay-reject input { flex: 1; min-width: 0; }
@media (max-width: 640px) {
  .pay-item { grid-template-columns: 1fr; }
  .pay-receipt { height: 180px; }
  .pay-amount strong { font-size: 21px; }
}
