/* استایل‌های تکمیلی پنل کیمیا */

:root {
  --bnav-hole: #6366f1;
  --bnav-bg: #ffffff;
  --bnav-bar: #f8fafc;
  --bnav-icon: #94a3b8;
  --bnav-text: #64748b;
  --card-bg: #ffffff;
  --card-border: rgba(226, 232, 240, 0.95);
  --card-text: #1e293b;
  --muted: #64748b;
  --surface: #f8fafc;
}

html.dark {
  --bnav-bg: #0f172a;
  --bnav-bar: #1e293b;
  --bnav-icon: #64748b;
  --bnav-text: #94a3b8;
  --card-bg: #1e293b;
  --card-border: rgba(51, 65, 85, 0.85);
  --card-text: #e2e8f0;
  --muted: #94a3b8;
  --surface: #0f172a;
}

/* ========== موبایل: لایه‌بندی پایدار ========== */
@media (max-width: 1023.98px) {
  html, body {
    max-width: 100vw !important;
    overflow-x: hidden !important;
  }

  body.has-bottom-nav {
    padding-bottom: calc(88px + env(safe-area-inset-bottom, 0px)) !important;
  }

  /* لایه اصلی: فقط ستون محتوا، سایدبار از جریان خارج */
  .panel-layout {
    display: block !important;
    width: 100% !important;
    min-height: 100vh;
    position: relative;
  }

  .panel-main {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    min-height: 100vh !important;
  }

  .panel-main > main {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    padding-left: 0.85rem !important;
    padding-right: 0.85rem !important;
  }

  .panel-main > header .flex {
    flex-wrap: nowrap !important;
    gap: 0.5rem !important;
  }

  .panel-main > header .dropdown span.hidden.sm\:inline,
  .panel-main > header [data-icon="chevronDown"] {
    display: none !important;
  }

  #sidebar,
  #sidebar.sidebar-shell {
    position: fixed !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    left: auto !important;
    width: min(18rem, 86vw) !important;
    max-width: 86vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    min-height: 0 !important;
    margin: 0 !important;
    border-radius: 0 !important;
    border-left: 1px solid var(--card-border) !important;
    z-index: 70 !important;
    transform: translate3d(105%, 0, 0) !important;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1) !important;
    background: var(--card-bg) !important;
    box-shadow: none !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    display: flex !important;
    flex-direction: column !important;
    /* خارج از جریان سند */
    flex: none !important;
    float: none !important;
  }

  #sidebar.is-open {
    transform: translate3d(0, 0, 0) !important;
    box-shadow: -12px 0 40px rgba(15, 23, 42, 0.25) !important;
  }

  #sidebar.translate-x-full {
    transform: translate3d(105%, 0, 0) !important;
  }

  #sidebar.is-open.translate-x-full {
    transform: translate3d(0, 0, 0) !important;
  }

  #sidebar nav {
    flex: 1 1 auto;
  }

  #sidebar-overlay {
    z-index: 65 !important;
  }

  .sidebar-credit {
    display: none !important;
  }

  .system-footer.page-footer {
    display: block !important;
    width: 100%;
    padding: 0.85rem 1rem calc(0.5rem + env(safe-area-inset-bottom, 0px));
    font-size: 0.75rem;
    border-top: 1px solid var(--card-border);
    position: relative;
    z-index: 1;
  }

  .mobile-bottom-nav {
    display: block !important;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 60;
    padding: 0 8px max(8px, env(safe-area-inset-bottom));
    pointer-events: none;
  }

  .mobile-bottom-nav .bnav-inner {
    pointer-events: auto;
    position: relative;
    max-width: 560px;
    margin: 0 auto;
    height: 62px;
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding: 0 2px;
    direction: rtl;
    border-radius: 16px;
    background: var(--bnav-bg);
    border: 1px solid var(--card-border);
    box-shadow: 0 -6px 24px rgba(15, 23, 42, 0.12);
  }

  .mobile-bottom-nav .bnav-inner::before,
  .bnav-selector {
    display: none !important;
  }

  .bnav-item {
    flex: 1;
    min-width: 0;
    height: 54px;
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    text-decoration: none;
    color: var(--bnav-text);
    font-size: 9.5px;
    font-weight: 600;
    border-radius: 12px;
    transition: 0.2s ease;
    padding: 2px;
  }

  .bnav-item .bnav-icon {
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--bnav-icon);
    border-radius: 9px;
  }

  .bnav-item .bnav-icon svg {
    width: 17px;
    height: 17px;
  }

  .bnav-item span.label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    line-height: 1.1;
  }

  .bnav-item.active {
    color: #4f46e5;
    background: rgba(99, 102, 241, 0.12);
  }

  .bnav-item.active .bnav-icon {
    color: #4f46e5;
    background: rgba(99, 102, 241, 0.15);
  }

  html.dark .bnav-item.active {
    color: #a5b4fc;
    background: rgba(99, 102, 241, 0.2);
  }

  html.dark .bnav-item.active .bnav-icon {
    color: #a5b4fc;
  }

  /* کارت‌ها و جداول موبایل */
  .kimia-card,
  .modern-panel,
  .card {
    max-width: 100%;
  }

  .row {
    margin-left: -0.5rem !important;
    margin-right: -0.5rem !important;
  }

  .row > [class*="col-"] {
    padding-left: 0.5rem !important;
    padding-right: 0.5rem !important;
  }

  .dashboard-tabs {
    grid-template-columns: 1fr 1fr !important;
    gap: 0.4rem !important;
    padding: 0.7rem 0.7rem 0 !important;
  }

  .dashboard-tabs .nav-link {
    padding: 0.55rem 0.4rem !important;
    font-size: 0.78rem !important;
  }

  .stat-mini {
    margin-bottom: 0;
  }

  .stat-mini-inner {
    gap: 0.5rem;
  }

  .stat-mini .stat-icon {
    width: 2.4rem;
    height: 2.4rem;
  }

  .exam-search-wrap {
    min-width: 100% !important;
    max-width: 100% !important;
    flex: 1 1 100% !important;
  }

  .table-responsive {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .ss-panel {
    max-width: 100vw;
  }

  .actions-cell {
    flex-wrap: wrap;
  }

  .settings-grid {
    grid-template-columns: 1fr !important;
  }

  .settings-brand-panel {
    grid-column: auto !important;
  }
}

@media (min-width: 1024px) {
  .mobile-bottom-nav {
    display: none !important;
  }

  .panel-layout {
    display: flex !important;
    align-items: flex-start;
    min-height: 100vh;
  }

  .panel-main {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
  }

  #sidebar,
  #sidebar.sidebar-shell {
    position: sticky !important;
    top: 1rem !important;
    align-self: flex-start !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: calc(100vh - 2rem) !important;
    transform: none !important;
    margin: 1rem 1rem 1rem 0 !important;
    border-radius: 1.25rem !important;
    border: 1px solid var(--card-border) !important;
    background: var(--card-bg) !important;
    box-shadow: 0 10px 30px -18px rgba(15, 23, 42, 0.25);
    overflow: hidden;
    width: 18rem !important;
    flex: 0 0 18rem !important;
  }

  #sidebar.translate-x-full {
    transform: none !important;
  }

  body.has-bottom-nav {
    padding-bottom: 0 !important;
  }

  .sidebar-credit {
    display: block !important;
  }

  .system-footer.page-footer {
    display: none !important;
  }
}

.sidebar-credit {
  display: none;
  margin-top: auto;
  padding: 0.75rem 1rem 1rem;
  text-align: center;
  font-size: 0.72rem;
  color: var(--muted);
  border-top: 1px solid var(--card-border);
  line-height: 1.5;
}
.sidebar-credit a {
  color: #6366f1;
  font-weight: 700;
  text-decoration: none;
}
.sidebar-credit a:hover {
  text-decoration: underline;
}

.system-footer.page-footer {
  display: none;
}

/* ========== کارت‌ها و دارک‌مود کامل ========== */
.kimia-card,
.card {
  border-radius: 1rem !important;
  border: 1px solid var(--card-border) !important;
  background: var(--card-bg) !important;
  color: var(--card-text) !important;
  box-shadow: 0 4px 24px -4px rgba(15, 23, 42, 0.08);
  overflow: hidden;
}

html.dark .kimia-card,
html.dark .card {
  box-shadow: none;
}

.kimia-card {
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}

.card-header {
  background: var(--surface) !important;
  border-bottom: 1px solid var(--card-border) !important;
  color: var(--card-text) !important;
  padding: 1rem 1.25rem !important;
  font-weight: 700;
}

.card-body {
  background: var(--card-bg) !important;
  color: var(--card-text) !important;
}

.card-header.bg-primary,
.card-header.bg-success,
.card-header.bg-info,
.card-header.bg-warning,
.card-header.bg-danger {
  border-bottom: none !important;
}

.card-header.bg-primary { background: linear-gradient(135deg, #6366f1, #4f46e5) !important; color: #fff !important; }
.card-header.bg-success { background: linear-gradient(135deg, #10b981, #059669) !important; color: #fff !important; }
.card-header.bg-info { background: linear-gradient(135deg, #06b6d4, #0891b2) !important; color: #fff !important; }
.card-header.bg-warning { background: linear-gradient(135deg, #fbbf24, #f59e0b) !important; color: #78350f !important; }
.card-header.bg-danger { background: linear-gradient(135deg, #f43f5e, #e11d48) !important; color: #fff !important; }

html.dark .card.bg-primary,
html.dark .card.bg-success,
html.dark .card.bg-info,
html.dark .card.bg-warning,
html.dark .card.bg-danger {
  border: none !important;
}

.card.bg-primary { background: linear-gradient(135deg, #6366f1, #4f46e5) !important; }
.card.bg-success { background: linear-gradient(135deg, #10b981, #059669) !important; }
.card.bg-info { background: linear-gradient(135deg, #06b6d4, #0891b2) !important; }
.card.bg-warning { background: linear-gradient(135deg, #f59e0b, #d97706) !important; }
.card.bg-danger { background: linear-gradient(135deg, #f43f5e, #e11d48) !important; }

.panel-page-title { margin-bottom: 1.5rem; }
.panel-page-title h2 { font-size: 1.5rem; font-weight: 700; }
.panel-page-title p { margin-top: 0.25rem; color: var(--muted); }

.kimia-card h3,
.kimia-card .card-title-text,
.content-title {
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--card-text);
}

/* فرم‌ها */
.form-control,
.form-select {
  border-radius: 0.75rem !important;
  border-color: var(--card-border) !important;
  background: var(--card-bg) !important;
  color: var(--card-text) !important;
}

html.dark .form-control,
html.dark .form-select,
html.dark .form-control:focus,
html.dark .form-select:focus {
  background-color: #0f172a !important;
  border-color: #475569 !important;
  color: #e2e8f0 !important;
}

html.dark .form-control::placeholder { color: #64748b; }
html.dark .form-text,
html.dark .text-muted { color: #94a3b8 !important; }
html.dark .form-label { color: #cbd5e1 !important; }
html.dark .form-check-label { color: #e2e8f0; }

/* جداول */
.table { color: var(--card-text) !important; }
html.dark .table {
  --bs-table-bg: transparent;
  --bs-table-striped-bg: rgba(51, 65, 85, 0.45);
  --bs-table-hover-bg: rgba(71, 85, 105, 0.35);
  --bs-table-border-color: #334155;
  color: #e2e8f0 !important;
}
html.dark .table > :not(caption) > * > * {
  border-color: #334155 !important;
  color: #e2e8f0 !important;
  background-color: transparent;
}
html.dark .table-striped > tbody > tr:nth-of-type(odd) > * {
  background-color: rgba(51, 65, 85, 0.4) !important;
  color: #e2e8f0 !important;
}
html.dark .table thead th {
  color: #94a3b8 !important;
  border-color: #334155 !important;
}

html.dark .list-group-item {
  background: transparent !important;
  border-color: #334155 !important;
  color: #e2e8f0 !important;
}

html.dark .modal-content {
  background-color: #1e293b !important;
  color: #e2e8f0 !important;
  border-color: #334155 !important;
}
html.dark .modal-header,
html.dark .modal-footer { border-color: #334155 !important; }
html.dark .btn-close { filter: invert(1); }
html.dark .img-thumbnail {
  background: #0f172a;
  border-color: #475569;
}
html.dark .border { border-color: #334155 !important; }
html.dark .alert-info {
  background: rgba(6, 182, 212, 0.12) !important;
  border-color: rgba(6, 182, 212, 0.3) !important;
  color: #67e8f9 !important;
}
html.dark .alert-warning {
  background: rgba(245, 158, 11, 0.15) !important;
  border-color: rgba(245, 158, 11, 0.35) !important;
  color: #fcd34d !important;
}
html.dark .alert-success {
  background: rgba(16, 185, 129, 0.12) !important;
  border-color: rgba(16, 185, 129, 0.3) !important;
  color: #6ee7b7 !important;
}
html.dark .alert-danger {
  background: rgba(244, 63, 94, 0.12) !important;
  border-color: rgba(244, 63, 94, 0.3) !important;
  color: #fda4af !important;
}

.btn-primary,
.btn-gradient {
  background-image: linear-gradient(to left, #6366f1, #7c3aed);
  border: none;
  color: #fff !important;
  border-radius: 0.75rem;
  font-weight: 500;
  box-shadow: 0 8px 20px -6px rgba(99, 102, 241, 0.45);
}
.btn-primary:hover,
.btn-gradient:hover {
  filter: brightness(1.08);
  color: #fff !important;
}

html.dark .bg-light,
html.dark .bg-white {
  background-color: #0f172a !important;
  color: #e2e8f0 !important;
}
html.dark .badge.bg-light {
  background-color: #e2e8f0 !important;
  color: #1e293b !important;
}
html.dark .stat-chip,
html.dark .surface-chip {
  background: #0f172a !important;
  color: #e2e8f0 !important;
  border-color: #334155 !important;
}
.surface-chip {
  background: var(--surface);
  color: var(--card-text);
  border: 1px solid var(--card-border);
}
html.dark .nav-tabs {
  border-bottom-color: #334155 !important;
}
html.dark .nav-tabs .nav-link {
  color: #94a3b8;
  border-color: transparent;
}
html.dark .nav-tabs .nav-link.active {
  background: #1e293b !important;
  color: #e2e8f0 !important;
  border-color: #334155 #334155 #1e293b !important;
}
html.dark .progress {
  background-color: #0f172a !important;
}
html.dark .dropdown-menu {
  background-color: #1e293b !important;
  border-color: #334155 !important;
  color: #e2e8f0 !important;
}
html.dark .dropdown-item {
  color: #e2e8f0 !important;
}
html.dark .dropdown-item:hover {
  background-color: #334155 !important;
}
html.dark .input-group-text {
  background: #0f172a !important;
  border-color: #475569 !important;
  color: #cbd5e1 !important;
}
html.dark .accordion-item,
html.dark .accordion-button {
  background: #1e293b !important;
  color: #e2e8f0 !important;
  border-color: #334155 !important;
}
html.dark .accordion-button:not(.collapsed) {
  background: #0f172a !important;
  color: #e2e8f0 !important;
}
html.dark .page-link {
  background: #1e293b;
  border-color: #334155;
  color: #cbd5e1;
}
html.dark .page-item.active .page-link {
  background: #6366f1;
  border-color: #6366f1;
}
html.dark .page-item.disabled .page-link {
  background: #0f172a;
  border-color: #334155;
  color: #64748b;
}
html.dark .thumbnail-box,
html.dark .report-thumb-bg {
  background: #0f172a !important;
}

/* دکمه‌های فقط‌آیکون */
.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  border-radius: 0.7rem !important;
  border: 1px solid transparent;
  line-height: 1;
}
.btn-icon svg { width: 16px; height: 16px; }
.btn-icon.btn-edit {
  background: rgba(99, 102, 241, 0.12);
  color: #4f46e5;
  border-color: rgba(99, 102, 241, 0.25);
}
.btn-icon.btn-files {
  background: rgba(6, 182, 212, 0.12);
  color: #0891b2;
  border-color: rgba(6, 182, 212, 0.25);
}
.btn-icon.btn-delete {
  background: rgba(244, 63, 94, 0.12);
  color: #e11d48;
  border-color: rgba(244, 63, 94, 0.25);
}
html.dark .btn-icon.btn-edit { background: rgba(99,102,241,.22); color: #a5b4fc; }
html.dark .btn-icon.btn-files { background: rgba(6,182,212,.22); color: #67e8f9; }
html.dark .btn-icon.btn-delete { background: rgba(244,63,94,.22); color: #fda4af; }
.actions-cell { white-space: nowrap; display: flex; gap: 0.4rem; }

/* کارت انتخاب نوع/مقطع — فشرده */
.choice-card {
  display: flex !important;
  align-items: center;
  gap: 0.75rem;
  border-radius: 0.85rem !important;
  border: 1.5px solid var(--card-border) !important;
  background: var(--card-bg) !important;
  color: var(--card-text) !important;
  cursor: pointer;
  transition: 0.2s ease;
  text-align: right;
  padding: 0.65rem 0.85rem !important;
  height: auto !important;
  min-height: 0;
}
.choice-card:hover {
  border-color: #a5b4fc !important;
  transform: none;
}
.choice-card.is-selected,
.choice-card.selected-test,
.exam-type-card.selected-test,
.school-level-card.selected {
  border-color: #6366f1 !important;
  background: rgba(99, 102, 241, 0.1) !important;
  box-shadow: none;
}
.choice-card.selected-descriptive,
.exam-type-card.selected-descriptive,
.school-level-card-high.selected {
  border-color: #10b981 !important;
  background: rgba(16, 185, 129, 0.1) !important;
}
html.dark .choice-card.is-selected,
html.dark .exam-type-card.selected-test,
html.dark .school-level-card.selected {
  background: rgba(99, 102, 241, 0.2) !important;
}
html.dark .exam-type-card.selected-descriptive,
html.dark .school-level-card-high.selected {
  background: rgba(16, 185, 129, 0.2) !important;
}
.choice-card .choice-icon {
  width: 34px;
  height: 34px;
  margin: 0;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(99, 102, 241, 0.12);
  color: #4f46e5;
  flex-shrink: 0;
}
.choice-card .choice-icon svg { width: 16px; height: 16px; }
.choice-card h6 {
  margin: 0 !important;
  font-size: 0.9rem;
  line-height: 1.3;
}
.choice-card p {
  margin: 0.15rem 0 0 !important;
  font-size: 0.72rem !important;
  line-height: 1.35;
}
html.dark .choice-card .choice-icon {
  background: rgba(99, 102, 241, 0.25);
  color: #a5b4fc;
}

/* کارت مدرن پنل */
.modern-panel {
  border-radius: 1.15rem;
  border: 1px solid var(--card-border);
  background: var(--card-bg);
  overflow: hidden;
  height: 100%;
}
.modern-panel-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.15rem;
  border-bottom: 1px solid var(--card-border);
  background: linear-gradient(180deg, rgba(99,102,241,0.06), transparent);
}
html.dark .modern-panel-head {
  background: linear-gradient(180deg, rgba(99,102,241,0.12), transparent);
}
.modern-panel-head .head-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: linear-gradient(to bottom left, #6366f1, #7c3aed);
  flex-shrink: 0;
}
.modern-panel-head h5 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--card-text);
}
.modern-panel-head p {
  margin: 0.15rem 0 0;
  font-size: 0.75rem;
  color: var(--muted);
}
.modern-panel-body { padding: 1.15rem; }

.upload-drop {
  border: 2px dashed rgba(99, 102, 241, 0.35);
  border-radius: 1rem;
  padding: 1.25rem;
  text-align: center;
  background: rgba(99, 102, 241, 0.04);
  transition: 0.2s;
}
html.dark .upload-drop {
  background: rgba(99, 102, 241, 0.08);
  border-color: rgba(129, 140, 248, 0.35);
}

.exam-grid-card {
  border-radius: 1rem;
  border: 1px solid var(--card-border);
  background: var(--card-bg);
  padding: 1.25rem;
  height: 100%;
  transition: all 0.35s ease;
  display: flex;
  flex-direction: column;
  color: var(--card-text);
}
.exam-grid-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px -8px rgba(99, 102, 241, 0.25);
}
.exam-grid-card.has-report { border-color: rgba(16, 185, 129, 0.45); }
.exam-grid-card.no-report { border-color: rgba(245, 158, 11, 0.45); }

.alert { border-radius: 0.75rem; }

.badge-soft {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  border-radius: 9999px;
  padding: 0.2rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 600;
}
.badge-soft-info { background: #e0e7ff; color: #4338ca; }
html.dark .badge-soft-info { background: rgba(49, 46, 129, 0.45); color: #a5b4fc; }

.nav-link [data-icon],
.dropdown-item [data-icon],
.bnav-icon [data-icon],
.btn-icon [data-icon] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* اطلاعیه زرد لاگین */
.login-notice {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 440px;
  margin: 0 auto 1rem;
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  padding: 0.95rem 1rem;
  border-radius: 1rem;
  background: #fef3c7;
  border: 1px solid #f59e0b;
  color: #78350f;
  box-shadow: 0 10px 30px -12px rgba(245, 158, 11, 0.45);
}
.login-notice .notice-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f59e0b;
  color: #fff;
}
.login-notice .notice-title {
  font-weight: 800;
  font-size: 0.95rem;
  margin-bottom: 0.2rem;
}
.login-notice .notice-text {
  font-size: 0.82rem;
  line-height: 1.6;
  opacity: 0.95;
}
html.dark .login-notice {
  background: rgba(245, 158, 11, 0.18);
  border-color: rgba(245, 158, 11, 0.45);
  color: #fde68a;
}

.login-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #eef2ff 0%, #f8fafc 40%, #f5f3ff 100%);
}
html.dark .login-shell {
  background: linear-gradient(135deg, #020617 0%, #0f172a 50%, #1e1b4b 100%);
}
.login-shell .blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(64px);
  pointer-events: none;
  z-index: 0;
}
.login-shell .blob-1 {
  width: 28rem; height: 28rem;
  background: rgba(99, 102, 241, 0.35);
  top: -6rem; right: -4rem;
  animation: float 8s ease-in-out infinite;
}
.login-shell .blob-2 {
  width: 22rem; height: 22rem;
  background: rgba(139, 92, 246, 0.28);
  bottom: -5rem; left: -3rem;
  animation: float 9s ease-in-out infinite;
  animation-delay: -3s;
}
.login-shell .blob-3 {
  width: 16rem; height: 16rem;
  background: rgba(6, 182, 212, 0.2);
  top: 40%; left: 40%;
  animation: float 10s ease-in-out infinite;
  animation-delay: -5s;
}

.login-glass {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 440px;
  border-radius: 1.5rem;
  padding: 2.25rem 2rem;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.65);
  box-shadow: 0 25px 60px -15px rgba(79, 70, 229, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
}
html.dark .login-glass {
  background: rgba(15, 23, 42, 0.55);
  border-color: rgba(148, 163, 184, 0.18);
  box-shadow: 0 25px 60px -12px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.login-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 1.75rem;
}
.login-brand .logo-mark {
  width: 3.25rem; height: 3.25rem;
  border-radius: 1rem;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  background: linear-gradient(to bottom left, #6366f1, #7c3aed);
  box-shadow: 0 10px 25px -5px rgba(99, 102, 241, 0.5);
  margin-bottom: 0.85rem;
}
.login-brand h1 {
  font-size: 1.35rem; font-weight: 800;
  background: linear-gradient(to left, #6366f1, #8b5cf6);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.login-brand p { margin-top: 0.35rem; font-size: 0.875rem; color: #64748b; }
html.dark .login-brand p { color: #94a3b8; }

.login-field { margin-bottom: 1rem; }
.login-field label {
  display: block; font-size: 0.875rem; font-weight: 500;
  margin-bottom: 0.4rem; color: #475569;
}
html.dark .login-field label { color: #cbd5e1; }
.login-field input {
  width: 100%; border-radius: 0.85rem;
  border: 1px solid rgba(226, 232, 240, 0.95);
  background: rgba(255, 255, 255, 0.7);
  padding: 0.75rem 1rem; font-size: 0.9375rem;
  transition: all 0.2s; outline: none;
}
html.dark .login-field input {
  background: rgba(30, 41, 59, 0.7);
  border-color: #475569; color: #e2e8f0;
}
.login-field input:focus {
  border-color: #818cf8;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}
.login-actions {
  display: flex; align-items: center; justify-content: space-between;
  margin: 0.75rem 0 1.25rem; font-size: 0.8125rem; color: #64748b;
}
.login-submit {
  width: 100%; border: none; border-radius: 0.9rem;
  padding: 0.85rem 1rem; font-weight: 600; font-size: 1rem; color: #fff;
  background: linear-gradient(to left, #6366f1, #7c3aed);
  box-shadow: 0 12px 28px -8px rgba(99, 102, 241, 0.55);
  cursor: pointer; transition: filter 0.2s, transform 0.2s;
}
.login-submit:hover { filter: brightness(1.08); transform: translateY(-1px); }
.login-theme-btn {
  position: absolute; top: 1.25rem; left: 1.25rem; z-index: 2;
  border-radius: 0.85rem; border: 1px solid rgba(226, 232, 240, 0.9);
  background: rgba(255, 255, 255, 0.6); backdrop-filter: blur(12px);
  padding: 0.55rem; color: #475569; cursor: pointer;
}
html.dark .login-theme-btn {
  background: rgba(30, 41, 59, 0.7); border-color: #475569; color: #cbd5e1;
}

.login-footer {
  position: relative;
  z-index: 2;
  margin-top: 1.5rem;
  padding: 0.85rem 1.15rem;
  text-align: center;
  font-size: 0.9rem;
  font-weight: 600;
  color: #334155;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 999px;
  box-shadow: 0 8px 24px -12px rgba(15, 23, 42, 0.25);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.login-footer a {
  color: #4f46e5;
  font-weight: 800;
  text-decoration: none;
}
.login-footer a:hover {
  text-decoration: underline;
  color: #4338ca;
}
html.dark .login-footer {
  color: #e2e8f0;
  background: rgba(15, 23, 42, 0.75);
  border-color: rgba(148, 163, 184, 0.28);
  box-shadow: 0 8px 24px -10px rgba(0, 0, 0, 0.45);
}
html.dark .login-footer a {
  color: #a5b4fc;
}
html.dark .login-footer a:hover {
  color: #c7d2fe;
}

.stat-mini {
  border-radius: 1rem; padding: 1.25rem; color: #fff;
  position: relative; overflow: hidden;
  box-shadow: 0 10px 24px -10px rgba(15, 23, 42, 0.35);
}
.stat-mini.primary { background: linear-gradient(135deg, #6366f1, #4f46e5); }
.stat-mini.success { background: linear-gradient(135deg, #10b981, #059669); }
.stat-mini.info { background: linear-gradient(135deg, #06b6d4, #0891b2); }
.stat-mini.warning { background: linear-gradient(135deg, #f59e0b, #d97706); }
.stat-mini-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  position: relative;
  z-index: 1;
}
.stat-mini .stat-icon {
  width: 3rem;
  height: 3rem;
  border-radius: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.18);
  flex-shrink: 0;
}
.stat-mini .stat-icon svg {
  width: 1.5rem;
  height: 1.5rem;
}
.stat-mini::after {
  content: "";
  position: absolute;
  width: 7rem;
  height: 7rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  left: -1.5rem;
  bottom: -2rem;
}

.dashboard-tabs {
  display: grid !important;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  flex-wrap: nowrap;
  padding: 0.85rem 0.85rem 0;
  border-bottom: 1px solid var(--card-border);
  width: 100%;
}
.dashboard-tabs .nav-item {
  width: 100%;
  margin: 0 !important;
}
.dashboard-tabs .nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  width: 100%;
  border-radius: 999px !important;
  border: 1px solid var(--card-border);
  background: var(--surface);
  color: var(--card-text) !important;
  font-weight: 600;
  padding: 0.65rem 0.75rem;
  font-size: 0.9rem;
  white-space: nowrap;
}
.dashboard-tabs .nav-link svg {
  width: 1.05rem;
  height: 1.05rem;
  flex-shrink: 0;
}
.dashboard-tabs .nav-link.active {
  background: linear-gradient(to left, #6366f1, #7c3aed) !important;
  border-color: transparent !important;
  color: #fff !important;
  box-shadow: 0 8px 20px -8px rgba(99, 102, 241, 0.55);
}
html.dark .dashboard-tabs .nav-link:not(.active) {
  background: #0f172a;
  border-color: #334155;
}
@media (max-width: 420px) {
  .dashboard-tabs .nav-link span:last-child {
    font-size: 0.8rem;
  }
}

.settings-grid {
  display: grid;
  gap: 1.25rem;
}
@media (min-width: 768px) {
  .settings-grid { grid-template-columns: 1fr 1fr; }
}
.settings-brand-panel {
  grid-column: 1 / -1;
}

/* دکمه‌های گرد و مدرن */
.btn,
.login-submit {
  border-radius: 999px !important;
  font-weight: 600;
  padding: 0.55rem 1.25rem;
  transition: 0.2s ease;
}
.btn-sm { border-radius: 999px !important; }
.btn-icon {
  border-radius: 999px !important;
}
.btn-secondary {
  background: var(--surface) !important;
  border: 1px solid var(--card-border) !important;
  color: var(--card-text) !important;
  box-shadow: none;
}
html.dark .btn-secondary {
  background: #0f172a !important;
  border-color: #334155 !important;
  color: #e2e8f0 !important;
}
.btn-info {
  background-image: linear-gradient(to left, #06b6d4, #0891b2);
  border: none;
  color: #fff !important;
}
.btn-success {
  background-image: linear-gradient(to left, #10b981, #059669);
  border: none;
  color: #fff !important;
}

/* دراپ‌داون مدرن قابل جستجو */
.ss-native {
  position: absolute !important;
  opacity: 0 !important;
  pointer-events: none !important;
  width: 1px !important;
  height: 1px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
}
.ss-wrap {
  position: relative;
  width: 100%;
}
.ss-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  border-radius: 0.85rem;
  border: 1px solid var(--card-border);
  background: var(--card-bg);
  color: var(--card-text);
  padding: 0.65rem 0.9rem;
  text-align: right;
  font-size: 0.95rem;
  transition: 0.2s ease;
}
.ss-trigger:hover,
.ss-wrap.open .ss-trigger {
  border-color: #818cf8;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}
.ss-trigger.is-placeholder .ss-trigger-text {
  color: var(--muted);
}
.ss-chevron {
  width: 1rem;
  height: 1rem;
  color: var(--muted);
  flex-shrink: 0;
  transition: transform 0.2s;
}
.ss-chevron svg { width: 100%; height: 100%; }
.ss-wrap.open .ss-chevron { transform: rotate(180deg); }
.ss-panel {
  display: none;
  position: absolute;
  z-index: 1080;
  top: calc(100% + 6px);
  right: 0;
  left: 0;
  border-radius: 1rem;
  border: 1px solid var(--card-border);
  background: var(--card-bg);
  box-shadow: 0 18px 40px -16px rgba(15, 23, 42, 0.35);
  overflow: hidden;
}
.ss-wrap.open .ss-panel { display: block; }
.ss-search {
  padding: 0.65rem;
  border-bottom: 1px solid var(--card-border);
  background: var(--surface);
}
.ss-search-input {
  width: 100%;
  border-radius: 999px;
  border: 1px solid var(--card-border);
  background: var(--card-bg);
  color: var(--card-text);
  padding: 0.5rem 0.9rem;
  outline: none;
}
.ss-search-input:focus {
  border-color: #818cf8;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}
.ss-list {
  max-height: 220px;
  overflow-y: auto;
  padding: 0.35rem;
}
.ss-option {
  width: 100%;
  display: block;
  text-align: right;
  border: 0;
  background: transparent;
  color: var(--card-text);
  border-radius: 0.7rem;
  padding: 0.55rem 0.75rem;
  font-size: 0.92rem;
}
.ss-option:hover { background: rgba(99, 102, 241, 0.1); }
.ss-option.selected {
  background: rgba(99, 102, 241, 0.16);
  color: #4f46e5;
  font-weight: 600;
}
html.dark .ss-option.selected { color: #a5b4fc; }
.ss-empty {
  padding: 0.85rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
}

/* فوتر */
.system-footer {
  margin-top: auto;
  padding: 1rem 1.25rem calc(1.1rem + env(safe-area-inset-bottom, 0px));
  text-align: center;
  font-size: 0.82rem;
  color: var(--muted);
  border-top: 1px solid var(--card-border);
  background: transparent;
}
.system-footer a {
  color: #6366f1;
  font-weight: 700;
  text-decoration: none;
}
.system-footer a:hover { text-decoration: underline; }
body.has-bottom-nav .system-footer.page-footer {
  margin-bottom: 0.15rem;
}

/* لوگو / برندینگ */
.brand-logo-wrap {
  display: inline-flex;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 0.9rem;
  overflow: hidden;
  border: 1px solid var(--card-border);
  background: #fff;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.brand-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.brand-preview {
  min-height: 72px;
  border-radius: 1rem;
  border: 1px dashed var(--card-border);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem;
  background: var(--surface);
}
.brand-preview img {
  max-height: 64px;
  max-width: 100%;
  object-fit: contain;
}
.brand-preview-fav img {
  max-height: 40px;
  max-width: 40px;
}

/* مودال مدرن کاربر */
.modern-modal {
  border-radius: 1.25rem !important;
  overflow: hidden;
  border: 1px solid var(--card-border);
}
.modern-modal-header {
  background: var(--surface);
  border-bottom: 1px solid var(--card-border);
  padding: 1.1rem 1.25rem !important;
}
.modal-subtitle {
  margin-top: 0.2rem;
  font-size: 0.82rem;
  color: var(--muted);
}
.modal-section {
  margin-bottom: 1.15rem;
  padding: 1rem;
  border-radius: 1rem;
  border: 1px solid var(--card-border);
  background: var(--surface);
}
.modal-section-title {
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 0.85rem;
  color: var(--card-text);
}
.modern-modal-footer {
  border-top: 1px solid var(--card-border);
  gap: 0.5rem;
}

/* جستجوی آزمون */
.exam-search-wrap {
  position: relative;
  min-width: min(100%, 280px);
  flex: 1 1 240px;
  max-width: 360px;
}
.exam-search-wrap .exam-search-icon {
  position: absolute;
  right: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
  display: inline-flex;
}
.exam-search-wrap .exam-search-icon svg {
  width: 1rem;
  height: 1rem;
}
.exam-search-wrap .form-control {
  padding-right: 2.4rem !important;
  border-radius: 999px !important;
}

/* جلوگیری از اسکرول افقی موبایل */
html, body { max-width: 100%; overflow-x: hidden; }
.table-responsive { max-width: 100%; }

/* فلکس ستون اصلی برای فوتر پایین */
.panel-main {
  min-height: 100vh;
}

/* ========== پاپ‌آپ سفارشی AppDialog ========== */
#app-dialog-root {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
#app-dialog-root.is-open {
  display: flex;
}
.app-dialog-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
}
.app-dialog-card {
  position: relative;
  z-index: 1;
  width: min(100%, 400px);
  border-radius: 1.25rem;
  padding: 1.5rem 1.35rem 1.25rem;
  background: var(--surface, #fff);
  border: 1px solid var(--card-border, #e2e8f0);
  box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.35);
  text-align: center;
  animation: appDialogIn 0.22s ease;
}
html.dark .app-dialog-card {
  background: #0f172a;
  border-color: #334155;
}
@keyframes appDialogIn {
  from { opacity: 0; transform: translateY(10px) scale(0.97); }
  to { opacity: 1; transform: none; }
}
.app-dialog-icon {
  width: 3rem;
  height: 3rem;
  margin: 0 auto 0.85rem;
  border-radius: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(99, 102, 241, 0.12);
  color: #4f46e5;
}
.app-dialog-icon.is-success { background: rgba(16, 185, 129, 0.15); color: #059669; }
.app-dialog-icon.is-warning,
.app-dialog-icon.is-confirm,
.app-dialog-icon.is-danger { background: rgba(245, 158, 11, 0.15); color: #d97706; }
.app-dialog-icon.is-danger { background: rgba(244, 63, 94, 0.12); color: #e11d48; }
.app-dialog-title {
  font-size: 1.05rem;
  font-weight: 800;
  margin: 0 0 0.45rem;
  color: var(--card-text, #0f172a);
}
.app-dialog-message {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.7;
  color: var(--muted, #64748b);
  white-space: pre-wrap;
}
.app-dialog-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 1.15rem;
}
.app-dialog-btn {
  border: none;
  border-radius: 999px;
  padding: 0.55rem 1.2rem;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  min-width: 5.5rem;
}
.app-dialog-btn.is-primary {
  background: linear-gradient(to left, #6366f1, #7c3aed);
  color: #fff;
}
.app-dialog-btn.is-secondary {
  background: var(--surface, #f8fafc);
  border: 1px solid var(--card-border, #e2e8f0);
  color: var(--card-text, #334155);
}
html.dark .app-dialog-btn.is-secondary {
  background: #1e293b;
  border-color: #475569;
  color: #e2e8f0;
}
.app-dialog-btn.is-danger {
  background: linear-gradient(to left, #f43f5e, #e11d48);
  color: #fff;
}
body.app-dialog-open,
body.ann-popup-open {
  overflow: hidden;
}

/* ========== پاپ‌آپ اعلان ورود ========== */
.ann-popup-root {
  position: fixed;
  inset: 0;
  z-index: 10040;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.ann-popup-root.is-open {
  display: flex;
}
.ann-popup-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(5px);
}
.ann-popup-card {
  position: relative;
  z-index: 1;
  width: min(100%, 460px);
  max-height: min(90vh, 640px);
  overflow: auto;
  border-radius: 1.35rem;
  padding: 1.4rem 1.35rem 1.15rem;
  background: var(--surface, #fff);
  border: 1px solid var(--card-border, #e2e8f0);
  box-shadow: 0 30px 60px -18px rgba(15, 23, 42, 0.4);
  animation: appDialogIn 0.24s ease;
}
html.dark .ann-popup-card {
  background: #0f172a;
  border-color: #334155;
}
.ann-popup-type {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  margin-bottom: 0.75rem;
  background: rgba(99, 102, 241, 0.12);
  color: #4f46e5;
}
.ann-popup-type svg { width: 1rem; height: 1rem; }
.ann-popup-title {
  font-size: 1.15rem;
  font-weight: 800;
  margin: 0 0 0.65rem;
  color: var(--card-text, #0f172a);
}
.ann-popup-body {
  font-size: 0.95rem;
  line-height: 1.8;
  color: var(--muted, #475569);
  white-space: pre-wrap;
  margin-bottom: 0.85rem;
}
.ann-popup-attach { margin-bottom: 0.75rem; }
.ann-popup-actions { display: flex; justify-content: flex-end; }
.ann-popup-progress {
  margin-top: 0.85rem;
  text-align: center;
  font-size: 0.78rem;
  color: var(--muted, #94a3b8);
}

.ann-popup-card.type-notice .ann-popup-type,
.ann-type-badge.type-notice { background: rgba(245, 158, 11, 0.15); color: #d97706; }
.ann-popup-card.type-news .ann-popup-type,
.ann-type-badge.type-news { background: rgba(59, 130, 246, 0.15); color: #2563eb; }
.ann-popup-card.type-update .ann-popup-type,
.ann-type-badge.type-update { background: rgba(16, 185, 129, 0.15); color: #059669; }
.ann-popup-card.type-promo .ann-popup-type,
.ann-type-badge.type-promo { background: rgba(236, 72, 153, 0.15); color: #db2777; }
.ann-popup-card.type-general .ann-popup-type,
.ann-type-badge.type-general { background: rgba(99, 102, 241, 0.15); color: #4f46e5; }

/* ========== کارت‌های اعلان کاربر / ادمین ========== */
.ann-user-list {
  display: grid;
  gap: 0.9rem;
}
.ann-card {
  border: 1px solid var(--card-border, #e2e8f0);
  border-radius: 1.1rem;
  padding: 1rem 1.1rem;
  background: var(--surface, #fff);
}
html.dark .ann-card {
  background: #0f172a;
  border-color: #334155;
}
.ann-card.is-unseen {
  box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.25);
}
.ann-card-head {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  margin-bottom: 0.65rem;
}
.ann-type-badge {
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 0.85rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.ann-type-badge svg { width: 1.15rem; height: 1.15rem; }
.ann-card-title { font-size: 1rem; font-weight: 800; }
.ann-card-meta {
  font-size: 0.78rem;
  color: var(--muted, #94a3b8);
  margin-top: 0.2rem;
}
.ann-card-body {
  font-size: 0.92rem;
  line-height: 1.75;
  color: var(--card-text, #334155);
}
.ann-card-actions {
  margin-top: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.ann-admin-item { padding: 1rem 1.1rem !important; }
.text-truncate-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.min-w-0 { min-width: 0; }

/* ========== لاگین موبایل ========== */
@media (max-width: 640px) {
  .login-shell {
    justify-content: flex-start;
    padding: max(1rem, env(safe-area-inset-top)) 0.85rem max(1.25rem, env(safe-area-inset-bottom));
    min-height: 100dvh;
    overflow-x: hidden;
    overflow-y: auto;
  }
  .login-shell .blob-1 { width: 16rem; height: 16rem; top: -4rem; right: -5rem; }
  .login-shell .blob-2 { width: 14rem; height: 14rem; bottom: -3rem; left: -4rem; }
  .login-shell .blob-3 { display: none; }
  .login-theme-btn {
    top: max(0.75rem, env(safe-area-inset-top));
    left: 0.75rem;
  }
  .login-notice {
    max-width: 100%;
    margin-bottom: 0.85rem;
    padding: 0.8rem 0.85rem;
  }
  .login-glass {
    max-width: 100%;
    padding: 1.5rem 1.15rem 1.35rem;
    border-radius: 1.25rem;
  }
  .login-brand { margin-bottom: 1.25rem; }
  .login-brand .logo-mark { width: 2.85rem; height: 2.85rem; }
  .login-brand h1 { font-size: 1.15rem; line-height: 1.45; }
  .login-brand p { font-size: 0.8rem; }
  .login-actions {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.55rem;
  }
  .login-field input {
    font-size: 16px; /* جلوگیری از زوم iOS */
    padding: 0.7rem 0.9rem;
  }
  .login-footer {
    margin-top: 1.15rem;
    width: 100%;
    max-width: 100%;
    font-size: 0.82rem;
    padding: 0.7rem 1rem;
  }
}

