/* =====================================================================
   نظرسنجی ارزیابی دبیر — استایل اصلی
   فونت: Vazirmatn (لوکال)  |  آیکون‌ها: Font Awesome Free (لوکال)
   ===================================================================== */

@font-face {
  font-family: 'Vazirmatn';
  src: url('../fonts/Vazirmatn-Light.woff2') format('woff2');
  font-weight: 300;
  font-display: swap;
}
@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;
}
@font-face {
  font-family: 'Vazirmatn';
  src: url('../fonts/Vazirmatn-ExtraBold.woff2') format('woff2');
  font-weight: 800;
  font-display: swap;
}

:root {
  --brand: #4f46e5;
  --brand-2: #7c3aed;
  --brand-soft: #eef2ff;
  --teal: #0d9488;
  --pink: #db2777;
  --amber: #d97706;
  --bg: #f5f6fb;
  --surface: #ffffff;
  --ink: #171a2b;
  --ink-2: #3d4359;
  --muted: #6b7280;
  --line: #e7e8f2;
  --danger: #dc2626;
  --success: #16a34a;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow-sm: 0 1px 2px rgba(23, 26, 43, 0.05), 0 2px 8px rgba(23, 26, 43, 0.04);
  --shadow: 0 10px 30px -12px rgba(23, 26, 43, 0.18), 0 2px 8px rgba(23, 26, 43, 0.04);
  --shadow-lg: 0 24px 60px -24px rgba(45, 35, 120, 0.35);
  --ring: 0 0 0 4px rgba(79, 70, 229, 0.14);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: 'Vazirmatn', system-ui, -apple-system, 'Segoe UI', Tahoma, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.85;
  font-size: 15.5px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  content: '';
  position: fixed;
  inset: 0 0 auto 0;
  height: 460px;
  background:
    radial-gradient(900px 340px at 85% -8%, rgba(124, 58, 237, 0.16), transparent 62%),
    radial-gradient(760px 320px at 8% -14%, rgba(13, 148, 136, 0.14), transparent 60%),
    linear-gradient(180deg, #fbfbff 0%, var(--bg) 78%);
  z-index: -1;
  pointer-events: none;
}

h1, h2, h3, h4 { margin: 0; line-height: 1.55; font-weight: 700; letter-spacing: -0.2px; }
p { margin: 0; }
a { color: var(--brand); text-decoration: none; }
button, input, textarea, select { font-family: inherit; font-size: inherit; color: inherit; }
::selection { background: rgba(79, 70, 229, 0.18); }

/* ----------------------------- اسکلت صفحه ---------------------------- */
.shell { max-width: 900px; margin: 0 auto; padding: 28px 20px 120px; }
.wide { max-width: 1280px; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: saturate(150%) blur(14px);
  background: rgba(255, 255, 255, 0.78);
  border-bottom: 1px solid rgba(231, 232, 242, 0.9);
}
.topbar-inner {
  max-width: 900px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.wide .topbar-inner { max-width: 1280px; }

.logo {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 19px;
  background: linear-gradient(140deg, var(--brand), var(--brand-2));
  box-shadow: 0 8px 20px -8px rgba(79, 70, 229, 0.8);
  flex: none;
}
.brand-title { font-size: 15px; font-weight: 700; line-height: 1.5; }
.brand-sub { font-size: 11.5px; color: var(--muted); line-height: 1.4; }

/* ------------------------------ کارت‌ها ------------------------------ */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 22px;
}
.card + .card { margin-top: 16px; }

.hero {
  position: relative;
  overflow: hidden;
  border-radius: 24px;
  padding: 34px 30px;
  color: #fff;
  background:
    radial-gradient(600px 300px at 90% 0%, rgba(255, 255, 255, 0.18), transparent 60%),
    linear-gradient(140deg, #4338ca 0%, #5b46e0 45%, #7c3aed 100%);
  box-shadow: var(--shadow-lg);
}
.hero::after {
  content: '';
  position: absolute;
  inset: auto -60px -120px auto;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
}
.hero h1 { font-size: clamp(20px, 3.2vw, 27px); font-weight: 800; }
.hero.compact { padding: 16px 22px; border-radius: 18px; }
.hero.compact h1 { font-size: 15.5px; font-weight: 600; opacity: 0.95; }
.hero.compact p, .hero.compact .chips { display: none; }
.hero.compact::after { display: none; }
.hero p { color: rgba(255, 255, 255, 0.9); font-size: 14px; margin-top: 10px; max-width: 62ch; }
.hero .chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 13px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #fff;
  backdrop-filter: blur(6px);
}
.chip.soft {
  background: var(--brand-soft);
  border-color: #dfe3ff;
  color: #4338ca;
}
.chip.teal { background: #e6f7f4; border-color: #c8ece6; color: #0f766e; }
.chip.amber { background: #fef4e6; border-color: #fbe3c4; color: #b45309; }
.chip.rose { background: #fdeef6; border-color: #f9d6e8; color: #be185d; }

/* ------------------------------- پیشرفت ------------------------------ */
.progress-wrap {
  position: sticky;
  top: 69px;
  z-index: 30;
  background: rgba(245, 246, 251, 0.9);
  backdrop-filter: blur(10px);
  padding: 12px 0 10px;
  margin-bottom: 4px;
}
.progress-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12.5px;
  color: var(--muted);
  margin-bottom: 8px;
}
.progress-meta strong { color: var(--ink-2); font-weight: 600; }
.progress-track {
  height: 8px;
  border-radius: 999px;
  background: #e6e7f3;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  transition: width 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}
.steps {
  display: flex;
  gap: 6px;
  margin-top: 10px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}
.steps::-webkit-scrollbar { display: none; }
.step-dot {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  background: #fff;
  border: 1px solid var(--line);
  white-space: nowrap;
  cursor: pointer;
  transition: 0.2s;
}
.step-dot i { font-size: 11px; }
.step-dot.active {
  color: #fff;
  background: linear-gradient(140deg, var(--brand), var(--brand-2));
  border-color: transparent;
  box-shadow: 0 6px 16px -8px rgba(79, 70, 229, 0.9);
}
.step-dot.done { color: #0f766e; background: #e6f7f4; border-color: #c8ece6; }

/* -------------------------------- بخش ------------------------------- */
.section-head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin: 26px 0 14px;
}
.section-icon {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 18px;
  flex: none;
  box-shadow: 0 8px 18px -10px rgba(23, 26, 43, 0.7);
}
.section-head h2 { font-size: 19px; }
.section-head p { font-size: 12.5px; color: var(--muted); margin-top: 2px; }

/* ------------------------------- سؤال‌ها ----------------------------- */
.q {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.25s, border-color 0.25s, transform 0.25s;
}
.q + .q { margin-top: 12px; }
.q:hover { box-shadow: var(--shadow); }
.q.invalid { border-color: #fbc9c9; box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.08); animation: shake 0.4s; }
.q-head { display: flex; gap: 10px; align-items: flex-start; }
.q-num {
  flex: none;
  min-width: 30px;
  height: 30px;
  padding: 0 8px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--brand);
  background: var(--brand-soft);
  border: 1px solid #e3e7ff;
}
.q-text { font-weight: 600; font-size: 15px; color: var(--ink); line-height: 1.75; }
.q-hint { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.q-answered .q-num { color: #0f766e; background: #e6f7f4; border-color: #c8ece6; }

.opts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 9px;
  margin-top: 14px;
}
.opt {
  position: relative;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px 13px;
  border-radius: 13px;
  border: 1.5px solid var(--line);
  background: #fcfcff;
  cursor: pointer;
  font-size: 14px;
  color: var(--ink-2);
  transition: all 0.18s ease;
  user-select: none;
}
.opt:hover { border-color: #c7cbf7; background: #f7f8ff; transform: translateY(-1px); }
.opt input { position: absolute; opacity: 0; pointer-events: none; }
.opt span.label { order: 1; flex: 1; text-align: right; }
.opt .dot { order: 2; margin-inline-start: auto; }
.opt .dot {
  flex: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid #cfd2e6;
  display: grid;
  place-items: center;
  transition: 0.18s;
  background: #fff;
}
.opt .dot::after {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff;
  transform: scale(0);
  transition: transform 0.18s ease;
}
.opt input:checked ~ .dot { border-color: var(--brand); background: var(--brand); }
.opt input:checked ~ .dot::after { transform: scale(1); }
.opt:has(input:checked) {
  border-color: var(--brand);
  background: linear-gradient(180deg, #f4f5ff, #eef0ff);
  color: #241f6b;
  font-weight: 600;
  box-shadow: 0 6px 18px -12px rgba(79, 70, 229, 0.9);
}
.opt:has(input:focus-visible) { box-shadow: var(--ring); }

/* --------------------------- مراکز / انتخاب ------------------------- */
.center-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
  margin-top: 6px;
}
.center-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 20px 18px;
  border-radius: 16px;
  border: 1.5px solid var(--line);
  background: #fcfcff;
  cursor: pointer;
  text-align: center;
  align-items: center;
  transition: 0.2s ease;
}
.center-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: #c7cbf7; }
.center-card input { position: absolute; opacity: 0; }
.center-card .cc-icon {
  width: 50px;
  height: 50px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-size: 20px;
  color: var(--brand);
  background: var(--brand-soft);
  transition: 0.2s;
}
.center-card .cc-title { font-weight: 600; font-size: 14.5px; }
.center-card .cc-check {
  position: absolute;
  top: 12px;
  left: 12px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid #dfe1f0;
  display: grid;
  place-items: center;
  color: transparent;
  font-size: 10px;
  background: #fff;
  transition: 0.2s;
}
.center-card:has(input:checked) {
  border-color: var(--brand);
  background: linear-gradient(180deg, #f7f8ff, #eff1ff);
  box-shadow: 0 14px 34px -20px rgba(79, 70, 229, 0.95);
}
.center-card:has(input:checked) .cc-icon {
  color: #fff;
  background: linear-gradient(140deg, var(--brand), var(--brand-2));
}
.center-card:has(input:checked) .cc-check {
  color: #fff;
  background: var(--brand);
  border-color: var(--brand);
}
.center-card.bad { border-color: #fbc9c9; animation: shake 0.4s; }

/* ------------------------------ فرم‌ها ------------------------------ */
.field { margin-top: 14px; }
.field label.fl {
  display: block;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-2);
  margin-bottom: 6px;
}
.field label.fl .req { color: var(--danger); }
.input, .textarea, .select {
  width: 100%;
  padding: 11px 14px;
  border-radius: 12px;
  border: 1.5px solid var(--line);
  background: #fcfcff;
  transition: 0.18s;
  font-size: 14px;
  outline: none;
}
.input:focus, .textarea:focus, .select:focus {
  border-color: var(--brand);
  background: #fff;
  box-shadow: var(--ring);
}
.textarea { min-height: 92px; resize: vertical; line-height: 1.9; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 560px) { .grid-2 { grid-template-columns: 1fr; } }

/* ------------------------------ دکمه‌ها ------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: 13px;
  border: 1.5px solid transparent;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: 0.18s ease;
  background: #fff;
  color: var(--ink-2);
  border-color: var(--line);
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-primary {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(140deg, var(--brand), var(--brand-2));
  box-shadow: 0 12px 26px -14px rgba(79, 70, 229, 1);
}
.btn-primary:hover { box-shadow: 0 16px 32px -14px rgba(79, 70, 229, 1); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { background: #fff; color: var(--ink); }
.btn-danger { color: var(--danger); border-color: #fbd5d5; background: #fff5f5; }
.btn-danger:hover { background: #fee2e2; }
.btn-sm { padding: 7px 12px; font-size: 12.5px; border-radius: 10px; }
.btn-block { width: 100%; }

.navbar-form {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 50;
  padding: 12px 20px calc(12px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
}
.navbar-inner {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: space-between;
}
.nav-hint { font-size: 12px; color: var(--muted); }
.nav-hint .bad { color: var(--danger); font-weight: 600; }

/* -------------------------------- هشدار ----------------------------- */
.alert {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 14px;
  border-radius: 13px;
  font-size: 13px;
  line-height: 1.8;
}
.alert i { margin-top: 4px; }
.alert-info { background: #eef2ff; color: #3730a3; border: 1px solid #dfe3ff; }
.alert-warn { background: #fff8eb; color: #92400e; border: 1px solid #fbe3c4; }
.alert-danger { background: #fef2f2; color: #991b1b; border: 1px solid #fbd5d5; }
.alert-success { background: #ecfdf5; color: #065f46; border: 1px solid #c7f0dd; }

/* -------------------------------- توست ------------------------------ */
.toast-wrap {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 16px;
  border-radius: 12px;
  background: #171a2b;
  color: #fff;
  font-size: 13px;
  box-shadow: 0 18px 40px -18px rgba(0, 0, 0, 0.6);
  animation: toastIn 0.3s ease;
  max-width: 92vw;
}
.toast.ok { background: #0f766e; }
.toast.err { background: #b91c1c; }

/* ------------------------------- موفقیت ----------------------------- */
.success-box { text-align: center; padding: 46px 24px; }
.success-ring {
  width: 92px;
  height: 92px;
  margin: 0 auto 20px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 38px;
  color: #fff;
  background: linear-gradient(140deg, #10b981, #059669);
  box-shadow: 0 20px 44px -20px rgba(5, 150, 105, 0.9);
  animation: pop 0.5s cubic-bezier(0.2, 1.5, 0.4, 1);
}
.success-box h2 { font-size: 22px; }
.success-box p { color: var(--muted); font-size: 13.5px; margin-top: 8px; }

@keyframes pop {
  0% { transform: scale(0.4); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes toastIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}
.fade-in { animation: fadeIn 0.35s ease; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.hidden { display: none !important; }

/* ============================ پنل ادمین ============================= */
.admin-layout {
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 20px;
  align-items: start;
}
.side {
  position: sticky;
  top: 88px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow-sm);
}
.side-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 11px;
  font-size: 13.5px;
  color: var(--ink-2);
  cursor: pointer;
  transition: 0.16s;
  border: none;
  background: none;
  width: 100%;
  text-align: right;
}
.side-item i { width: 18px; color: var(--muted); font-size: 13px; }
.side-item:hover { background: #f6f7fc; }
.side-item.active { background: var(--brand-soft); color: #3730a3; font-weight: 600; }
.side-item.active i { color: var(--brand); }
.side-title { font-size: 11px; color: var(--muted); padding: 12px 12px 6px; font-weight: 600; letter-spacing: 0.3px; }

.kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}
.kpi {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}
.kpi .kpi-icon {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  font-size: 14px;
  margin-bottom: 10px;
  background: var(--brand-soft);
  color: var(--brand);
}
.kpi .kpi-value { font-size: 24px; font-weight: 800; letter-spacing: -0.5px; }
.kpi .kpi-label { font-size: 12px; color: var(--muted); margin-top: -2px; }
.kpi .kpi-foot { font-size: 11.5px; color: var(--muted); margin-top: 6px; }

.bar-row { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.bar-label { font-size: 12.5px; min-width: 140px; color: var(--ink-2); }
.bar-track { flex: 1; height: 10px; background: #eef0f7; border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 999px; transition: width 0.5s ease; }
.bar-val { font-size: 12px; color: var(--muted); min-width: 46px; text-align: left; }

table.tbl { width: 100%; border-collapse: collapse; font-size: 12.5px; }
table.tbl th {
  text-align: right;
  padding: 10px 8px;
  color: var(--muted);
  font-weight: 600;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
table.tbl td { padding: 11px 8px; border-bottom: 1px solid #f2f3f9; vertical-align: top; }
table.tbl tr:hover td { background: #fbfbff; }
.tag {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  background: var(--brand-soft);
  color: #4338ca;
  white-space: nowrap;
}
.tag.green { background: #e6f7f4; color: #0f766e; }
.tag.amber { background: #fef4e6; color: #b45309; }
.tag.rose { background: #fdeef6; color: #be185d; }

.qa-item {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
  background: #fff;
}
.qa-item + .qa-item { margin-top: 10px; }
.qa-q { font-size: 13px; font-weight: 600; color: var(--ink); }
.qa-a { font-size: 13.5px; color: var(--ink-2); margin-top: 6px; white-space: pre-wrap; }
.qa-meta { font-size: 11px; color: var(--muted); margin-top: 8px; display: flex; gap: 10px; flex-wrap: wrap; }

.dist-row {
  display: grid;
  grid-template-columns: 1fr 56px;
  gap: 8px;
  align-items: center;
  font-size: 12px;
}
.dist-track { height: 8px; background: #eef0f7; border-radius: 999px; overflow: hidden; margin-top: 4px; }
.dist-fill { height: 100%; background: linear-gradient(90deg, var(--brand), var(--brand-2)); border-radius: 999px; }

@media (max-width: 900px) {
  .admin-layout { grid-template-columns: 1fr; }
  .side { position: static; display: flex; gap: 6px; overflow-x: auto; }
  .side-title { display: none; }
  .side-item { white-space: nowrap; width: auto; }
}

@media (max-width: 620px) {
  .shell { padding: 16px 14px 132px; }
  .hero { padding: 26px 20px; border-radius: 20px; }
  .card { padding: 16px; }
  .q { padding: 15px 14px; }
  .progress-wrap { top: 61px; }
  .opts { grid-template-columns: 1fr; }
  .brand-sub { display: none; }
  .topbar-inner { padding: 9px 14px; gap: 9px; }
  .brand-title { font-size: 13px; line-height: 1.4; }
  .logo { width: 38px; height: 38px; border-radius: 12px; font-size: 16px; }
  .topbar .chip { display: none; }
  .btn { white-space: nowrap; }
  .navbar-form { padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); }
  .navbar-inner { gap: 8px; }
  .navbar-inner .btn { padding: 10px 13px; font-size: 13px; border-radius: 12px; }
  .nav-hint { display: none; }
  .section-head h2 { font-size: 17px; }
  .section-head p { font-size: 12px; }
  .steps { gap: 5px; }
  .step-dot { padding: 5px 9px; font-size: 11px; }
}

@media (max-width: 380px) {
  .navbar-inner .btn { padding: 9px 10px; font-size: 12px; }
}

@media print {
  .topbar, .navbar-form, .progress-wrap, .side { display: none !important; }
  body::before { display: none; }
}

/* ======================= پنجره جزئیات یک پاسخ ======================= */
.modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}
.modal.hidden { display: none !important; }
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(23, 26, 43, 0.55);
  backdrop-filter: blur(3px);
  animation: fadeIn 0.2s ease;
}
.modal-card {
  position: relative;
  background: #fff;
  border-radius: 20px;
  width: min(900px, 100%);
  max-width: 100%;
  min-width: 0;
  margin: auto;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.55);
  animation: pop 0.22s cubic-bezier(0.2, 1.2, 0.4, 1);
}
.modal-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #fbfbff, #fff);
}
.modal-body { padding: 16px 20px 22px; overflow: auto; min-width: 0; }
.modal-foot {
  padding: 12px 20px;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 8px;
  justify-content: space-between;
  align-items: center;
  background: #fbfbff;
  flex-wrap: wrap;
}
.ans-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  min-width: 0;
  padding: 9px 0;
  border-bottom: 1px dashed #eef0f7;
}
.ans-row:last-child { border-bottom: none; }
.ans-q { flex: 1; min-width: 0; font-size: 12.8px; color: var(--ink-2); overflow-wrap: anywhere; }
.ans-q b { color: var(--muted); font-weight: 600; }
.ans-a {
  flex: none;
  font-size: 12.5px;
  font-weight: 600;
  text-align: left;
  max-width: 46%;
  min-width: 0;
  overflow-wrap: anywhere;
}
.ans-text {
  overflow-wrap: anywhere;
  background: #f8f9ff;
  border: 1px solid #eceefb;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 13px;
  white-space: pre-wrap;
  margin: 6px 0 2px;
  color: var(--ink-2);
}
.ans-empty { color: #b6bacb; font-weight: 500; }
.modal-sec-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 18px 0 6px;
  font-size: 13.5px;
  font-weight: 700;
}
.modal-sec-head .dotmark { width: 8px; height: 8px; border-radius: 50%; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: #f7f8ff; }

@media print {
  .no-print, .topbar, .side, .toast-wrap { display: none !important; }
  body.printing .shell, body.printing .admin-layout > *:not(#modalRoot) { display: none !important; }
  body.printing .modal { position: static; padding: 0; }
  body.printing .modal-backdrop { display: none; }
  body.printing .modal-card {
    box-shadow: none;
    max-height: none;
    width: 100%;
    border-radius: 0;
  }
  body.printing .modal-body { overflow: visible; }
  .ans-row { break-inside: avoid; }
}

@media (max-width: 620px) {
  .modal { padding: 8px; }
  .modal-card { border-radius: 16px; max-height: 92vh; }
  .modal-head { padding: 12px 14px; }
  .modal-body { padding: 10px 12px 16px; }
  .modal-foot { padding: 10px 12px; }
  .ans-row { display: block; }
  .ans-a { max-width: 100%; text-align: right; margin-top: 4px; }
  .modal-sec-head { font-size: 12.8px; }
}

/* جلوگیری از پهن شدن صفحه در موبایل (min-width:auto در گرید/فلکس) */
.admin-layout,
.admin-layout > *,
.admin-layout section,
.admin-layout .card,
.admin-layout .kpis,
.admin-layout .kpis > * {
  min-width: 0;
}
.admin-layout table.tbl { min-width: 620px; }
