*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--pe-font-ui), sans-serif; background: #f4f6fb; color: #0f172a; direction: rtl; font-size: 14px; }
@media (max-width: 640px) {
  .page-header { padding: 16px 14px 22px; text-align: right; }
  .page-header h1 { font-size: 18px; }
  .roles-row { flex-direction: column; }
  .container { padding: 18px 12px 48px; }
  thead th { font-size: 12px; padding: 8px; }
}

/* ── Header ── */
.page-header { background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%); color: #fff; padding: 20px 24px 28px; text-align: center; position: relative; }
.page-header h1 { font-size: 22px; font-weight: 700; margin-bottom: 6px; }
.page-header p  { font-size: 13px; opacity: .85; }
.back-link { display: inline-flex; align-items: center; gap: 6px; color: #fff; text-decoration: none; font-size: 13px; background: rgba(255,255,255,.15); border: 1px solid rgba(255,255,255,.35); border-radius: 8px; padding: 6px 14px; margin-bottom: 16px; transition: background .2s; }
.back-link:hover { background: rgba(255,255,255,.28); }

/* ── Container ── */
.container { max-width: 900px; margin: 0 auto; padding: 28px 16px 60px; }

/* ── Section titles ── */
.section-title { font-size: 16px; font-weight: 700; color: #1e40af; border-right: 4px solid #3b82f6; padding-right: 12px; margin-bottom: 18px; }

/* ── Role cards ── */
.roles-row { display: flex; gap: 16px; margin-bottom: 36px; flex-wrap: wrap; }
.role-card { flex: 1 1 180px; background: #fff; border-radius: 12px; padding: 24px 16px 20px; box-shadow: 0 2px 12px rgba(0,0,0,.08); border: 2px solid transparent; text-align: center; }
.role-card.superadmin { border-color: #f59e0b; }
.role-card.centeradmin { border-color: #3b82f6; }
.role-card.user        { border-color: #22c55e; }

.role-icon-wrap { width: 64px; height: 64px; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 14px; }
.role-icon-wrap.gold  { background: linear-gradient(135deg, #fbbf24 0%, #d97706 100%); box-shadow: 0 4px 14px rgba(217,119,6,.35); }
.role-icon-wrap.blue  { background: linear-gradient(135deg, #60a5fa 0%, #1d4ed8 100%); box-shadow: 0 4px 14px rgba(29,78,216,.30); }
.role-icon-wrap.green { background: linear-gradient(135deg, #4ade80 0%, #16a34a 100%); box-shadow: 0 4px 14px rgba(22,163,74,.30); }
.role-icon-wrap svg { color: #fff; }

.role-name-fa { font-size: 15px; font-weight: 700; margin-bottom: 2px; }
.role-name-en { font-size: 11px; color: #6b7280; margin-bottom: 8px; }
.role-desc    { font-size: 12px; color: #6b7280; line-height: 1.6; }

/* ── Access table ── */
.table-wrap { overflow-x: auto; margin-bottom: 36px; border-radius: 12px; box-shadow: 0 2px 8px rgba(0,0,0,.07); }
table { width: 100%; border-collapse: collapse; background: #fff; }
thead th { background: #1e40af; color: #fff; padding: 10px 14px; font-size: 13px; font-weight: 700; text-align: center; white-space: nowrap; font-family: var(--pe-font-ui), sans-serif; }
thead th:first-child { text-align: right; }
tbody tr:nth-child(even) { background: #f8fafc; }
tbody tr:hover { background: #eff6ff; }
td { padding: 9px 14px; font-size: 13px; border-bottom: 1px solid #e5e7eb; font-family: var(--pe-font-ui), sans-serif; }
td:first-child { text-align: right; color: #374151; }
td:not(:first-child) { text-align: center; }
.op-icon { font-size: 14px; }

/* ── Permission badges ── */
.badge-yes  { display: inline-flex; align-items: center; gap: 3px; background: #dcfce7; color: #15803d; border-radius: 20px; padding: 3px 11px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.badge-no   { display: inline-flex; align-items: center; gap: 3px; background: #fee2e2; color: #dc2626; border-radius: 20px; padding: 3px 11px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.badge-cond { display: inline-flex; align-items: center; gap: 3px; background: #fef9c3; color: #b45309; border-radius: 20px; padding: 3px 11px; font-size: 12px; font-weight: 700; cursor: help; white-space: nowrap; border: 1px solid #fde68a; }

/* ── Alert cards ── */
.alerts-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 36px; }
.alert-card { border-radius: 10px; padding: 16px 18px; border-right: 5px solid; line-height: 1.65; font-size: 13px; }
.alert-card h4 { font-size: 13px; font-weight: 700; margin-bottom: 6px; }
.alert-red    { background: #fef2f2; border-color: #dc2626; color: #7f1d1d; }
.alert-red h4 { color: #dc2626; }
.alert-yellow { background: #fffbeb; border-color: #d97706; color: #78350f; }
.alert-yellow h4 { color: #d97706; }
.alert-green  { background: #f0fdf4; border-color: #16a34a; color: #14532d; }
.alert-green h4 { color: #16a34a; }
.alert-blue   { background: #eff6ff; border-color: #2563eb; color: #1e3a8a; }
.alert-blue h4 { color: #2563eb; }

/* ── Icons legend ── */
.icons-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; margin-bottom: 36px; }
.icon-row { display: flex; align-items: center; gap: 10px; background: #fff; border-radius: 8px; padding: 10px 14px; box-shadow: 0 1px 4px rgba(0,0,0,.06); font-size: 13px; }
.icon-row .ico { font-size: 18px; min-width: 26px; text-align: center; }
.icon-row .lbl { color: #374151; }

/* ── FAQ Accordion ── */
.faq-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 36px; }
.faq-item { background: #fff; border-radius: 10px; box-shadow: 0 1px 4px rgba(0,0,0,.07); overflow: hidden; }
.faq-q { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; cursor: pointer; font-size: 14px; font-weight: 600; color: #1e40af; user-select: none; }
.faq-q .arrow { font-size: 18px; transition: transform .25s; color: #6b7280; }
.faq-item.open .faq-q .arrow { transform: rotate(90deg); }
.faq-a { display: none; padding: 0 18px 14px; font-size: 13px; color: #374151; line-height: 1.7; }
.faq-item.open .faq-a { display: block; }

.icon-row .ico-badge { font-size: 12px; padding: 2px 8px; }
.table-note { font-size: 12px; color: #6b7280; margin-top: -24px; margin-bottom: 32px; }

/* ── Print ── */
@media print {
  .back-link { display: none; }
  .page-header { background: #1e40af; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .faq-a { display: block !important; }
  .faq-q .arrow { display: none; }
  body { background: #fff; }
}

/* ── Mobile ── */
@media (max-width: 700px) {
  .roles-row { flex-direction: column; }
  .alerts-grid { grid-template-columns: 1fr; }
  .icons-grid { grid-template-columns: 1fr 1fr; }
  .page-header h1 { font-size: 17px; }
  .table-wrap { font-size: 12px; }
  td { padding: 7px 8px; }
  .badge-yes, .badge-no, .badge-cond { padding: 2px 7px; font-size: 11px; }
}
