/* ============================================================
   VINELAND ADAPTIVE BEHAVIOR SCALE - ARABIC WEB APP
   RTL Full Support | Modern Motion UI
   BRAND: مستفر — Yellow #F5C518 · Black · White (Light Theme)
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary:       #E6B800;   /* Golden Yellow — main brand */
  --primary-light: #F5C518;   /* Standard yellow */
  --primary-dark:  #C49A00;   /* Deeper gold */
  --secondary:     #E6B800;
  --success:       #059669;
  --warning:       #D97706;
  --danger:        #DC2626;
  --purple:        #7C3AED;
  --pink:          #E6B800;
  --bg:            #FFFFFF;   /* White page background */
  --bg2:           #F8F8F8;   /* Very light grey panels */
  --bg3:           #F0F0F0;   /* Input / hover background */
  --card:          #FFFFFF;   /* White cards */
  --border:        #E0E0E0;   /* Light grey borders */
  --text:          #1A1A1A;   /* Near-black text */
  --text-muted:    #666666;   /* Muted grey text */
  --font:          'Cairo', sans-serif;

  /* Domain colors — UNCHANGED (used in charts) */
  --c-comm:     #4F46E5;
  --c-daily:    #10B981;
  --c-social:   #F59E0B;
  --c-motor:    #EF4444;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  direction: rtl;
  overflow-x: hidden;
  padding-bottom: 42px;
}

/* Force light background on html too */
html { background: #FFFFFF; }

.hidden { display: none !important; }

/* Required field star & optional label (shared across modules) */
.req-star {
  color: #EF4444;
  font-weight: 900;
  margin-right: 2px;
}
.optional-label {
  font-size: .72rem;
  color: #888;
  font-weight: 400;
  margin-right: 4px;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #F0F0F0; }
::-webkit-scrollbar-thumb { background: #E6B800; border-radius: 3px; }

/* ===========================
   SPLASH SCREEN
   =========================== */
#splash-screen {
  position: fixed;
  /* Start below global header */
  top: 62px; left: 0; right: 0; bottom: 0;
  background: #FFFFFF;
  display: flex; align-items: flex-start; justify-content: center;
  z-index: 8999;   /* below global header (9000) */
  overflow-y: auto;
  overflow-x: hidden;
  padding: 1.5rem 1rem 2rem;
}
#splash-screen::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 50% 10%, rgba(230,184,0,.1) 0%, transparent 65%);
  pointer-events: none;
  z-index: 0;
}

.splash-content {
  text-align: center;
  z-index: 2;
  animation: fadeInUp 1s ease forwards;
  width: 100%;
  max-width: 1200px;
  padding-top: .5rem;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(40px); }
  to   { opacity: 1; transform: translateY(0); }
}

.splash-logo {
  position: relative;
  width: 220px; height: 155px;
  margin: 0 auto 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-ring { display: none; }
.logo-icon { display: none; }

.splash-title {
  font-size: clamp(1.5rem, 4vw, 2.4rem);
  font-weight: 900;
  background: linear-gradient(90deg, #C49A00, #E6B800, #C49A00);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: .5rem;
}

.splash-subtitle {
  font-size: 1rem;
  letter-spacing: 3px;
  color: #888888;
  margin-bottom: .75rem;
  font-family: 'Arial', sans-serif;
  direction: ltr;
}

.splash-desc {
  color: #666666;
  font-size: 1rem;
  margin-bottom: 1.75rem;
}

.btn-start {
  padding: .85rem 2.5rem;
  background: linear-gradient(135deg, #E6B800, #C49A00);
  color: #FFFFFF;
  border: none;
  border-radius: 50px;
  font-size: 1.1rem;
  font-family: var(--font);
  font-weight: 900;
  cursor: pointer;
  transition: all .3s;
  box-shadow: 0 6px 24px rgba(230,184,0,.35);
}
.btn-start:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 32px rgba(230,184,0,.5);
}
.btn-start i { margin-left: .5rem; }
.btn-start-outline {
  background: transparent;
  border: 2px solid rgba(230,184,0,.7);
  color: #C49A00;
  box-shadow: none;
}
.btn-start-outline:hover {
  background: rgba(230,184,0,.1);
  border-color: #E6B800;
}

/* Particles */
.splash-particles { position: absolute; inset: 0; pointer-events: none; }
.particle {
  position: absolute;
  border-radius: 50%;
  animation: float var(--dur) ease-in-out infinite alternate;
}
@keyframes float {
  from { transform: translateY(0) scale(1); opacity: .3; }
  to   { transform: translateY(-30px) scale(1.2); opacity: .8; }
}

/* ===========================
   APP HEADER
   =========================== */
.app-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(14px);
  border-bottom: 2px solid #E6B800;
  padding: .75rem 1.5rem;
  box-shadow: 0 2px 12px rgba(0,0,0,.08);
}
.header-content {
  max-width: 1400px; margin: 0 auto;
  display: flex; align-items: center; gap: 1.5rem;
}
.header-logo {
  display: flex; align-items: center; gap: .6rem;
  font-size: 1.1rem; font-weight: 700;
  color: #1A1A1A;
  white-space: nowrap;
}
.header-logo i { font-size: 1.3rem; }
.header-progress {
  flex: 1;
  display: flex; align-items: center; gap: .75rem;
  font-size: .85rem; color: var(--text-muted);
}
.progress-bar-wrap {
  flex: 1; height: 8px;
  background: #E8E8E8;
  border-radius: 4px; overflow: hidden;
}
.progress-bar {
  height: 100%; width: 0;
  background: linear-gradient(90deg, #E6B800, #F5C518);
  border-radius: 4px;
  transition: width .6s cubic-bezier(.4,0,.2,1);
}
.header-actions { margin-right: auto; }
.btn-icon {
  width: 38px; height: 38px;
  background: #F5F5F5; border: 1px solid #E0E0E0;
  color: #666666; border-radius: 8px;
  cursor: pointer; transition: all .2s;
  display: flex; align-items: center; justify-content: center;
}
.btn-icon:hover { color: #C49A00; border-color: #E6B800; background: #FFFBE6; }

/* ===========================
   PAGES
   =========================== */
.main-content { min-height: calc(100vh - 60px); }
.page { display: none; }
.page.active { display: block; }

/* ===========================
   CHILD INFO PAGE
   =========================== */
#page-info {
  padding: 2rem 1.5rem;
  background: radial-gradient(ellipse at 50% 0%, rgba(230,184,0,.07) 0%, transparent 60%);
}
.page-container {
  max-width: 700px; margin: 0 auto;
  background: #FFFFFF;
  border: 1px solid #E8E8E8;
  border-top: 3px solid #E6B800;
  border-radius: 20px;
  padding: 2.5rem;
  box-shadow: 0 8px 40px rgba(0,0,0,.08);
  animation: fadeInUp .6s ease;
}
.page-hero { text-align: center; margin-bottom: 2rem; }
.hero-icon {
  width: 80px; height: 80px;
  background: linear-gradient(135deg, #E6B800, #C49A00);
  border-radius: 20px; margin: 0 auto 1rem;
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem; color: #FFFFFF;
  box-shadow: 0 6px 20px rgba(230,184,0,.3);
}
.page-hero h2 { font-size: 1.6rem; font-weight: 900; margin-bottom: .5rem; color: #1A1A1A; }
.page-hero p { color: #666666; }

.info-form { display: flex; flex-direction: column; gap: 1.25rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
@media(max-width:600px) { .form-row { grid-template-columns: 1fr; } }

.form-group { display: flex; flex-direction: column; gap: .5rem; }
.form-group label {
  font-size: .85rem; font-weight: 600; color: #444444;
}
.form-group label i { margin-left: .4rem; color: #C49A00; }
.form-group input, .form-group select {
  padding: .7rem 1rem;
  background: #F8F8F8; border: 1px solid #DDDDDD;
  border-radius: 10px; color: #1A1A1A;
  font-family: var(--font); font-size: .95rem;
  transition: border-color .2s;
  direction: rtl;
}
.form-group input:focus, .form-group select:focus {
  outline: none; border-color: #E6B800;
  box-shadow: 0 0 0 3px rgba(230,184,0,.15);
}
.form-group input::placeholder { color: #AAAAAA; }
.form-group select option { background: #FFFFFF; color: #1A1A1A; }

.form-actions { text-align: center; margin-top: .5rem; }
.btn-primary {
  padding: .9rem 2.5rem;
  background: linear-gradient(135deg, #E6B800, #C49A00);
  color: #FFFFFF; border: none; border-radius: 50px;
  font-family: var(--font); font-size: 1rem; font-weight: 900;
  cursor: pointer; transition: all .3s;
  box-shadow: 0 6px 20px rgba(230,184,0,.35);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(230,184,0,.5); }
.btn-primary i { margin-right: .5rem; }

/* ===========================
   QUESTIONNAIRE PAGE
   =========================== */
#page-questionnaire {
  display: none;
  min-height: calc(100vh - 60px);
}
#page-questionnaire.active { display: flex; }

.questionnaire-layout {
  display: flex;
  width: 100%;
  min-height: calc(100vh - 60px);
}

/* Domain Sidebar */
.domain-sidebar {
  width: 220px; min-width: 220px;
  background: linear-gradient(180deg, #1E1E28 0%, #22222E 100%);
  border-left: 1px solid rgba(255,255,255,.07);
  padding: 1.5rem 1rem;
  display: flex; flex-direction: column; gap: .5rem;
}
@media(max-width:768px) { .domain-sidebar { display: none; } }

.sidebar-title {
  font-size: .7rem; letter-spacing: 2px; text-transform: uppercase;
  color: var(--text-muted); margin-bottom: .75rem; padding-bottom: .75rem;
  border-bottom: 1px solid var(--border);
}
.domain-list { list-style: none; display: flex; flex-direction: column; gap: .4rem; }
.domain-list li {
  padding: .6rem .8rem;
  border-radius: 10px;
  cursor: pointer;
  font-size: .85rem;
  display: flex; align-items: center; gap: .5rem;
  transition: all .2s;
  color: var(--text-muted);
}
.domain-list li.active {
  background: linear-gradient(135deg, rgba(245,197,24,.2), rgba(212,160,20,.2));
  color: var(--text);
  border: 1px solid rgba(245,197,24,.5);
}
.domain-list li .domain-dot {
  width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0;
}
.domain-list li .domain-check {
  margin-right: auto; color: var(--success); font-size: .75rem; opacity: 0;
}
.domain-list li.done .domain-check { opacity: 1; }

/* Question Area */
.question-area {
  flex: 1; padding: 2rem;
  display: flex; flex-direction: column; gap: 1rem;
  overflow-y: auto;
}
@media(max-width:600px) { .question-area { padding: 1rem; } }

.domain-header {
  font-size: 1.5rem; font-weight: 900;
  display: flex; align-items: center; gap: .75rem;
}
.domain-header .domain-icon {
  width: 48px; height: 48px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
}

.subdomain-badge {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .3rem .9rem;
  background: rgba(245,197,24,.1);
  border: 1px solid rgba(245,197,24,.35);
  border-radius: 20px; font-size: .8rem;
  color: #F5C518;
  width: fit-content;
}

.question-card {
  background: #FFFFFF;
  border: 1px solid #E8E8E8;
  border-top: 3px solid #E6B800;
  border-radius: 20px;
  padding: 2rem;
  animation: slideIn .4s ease;
  box-shadow: 0 4px 20px rgba(0,0,0,.06);
}
@keyframes slideIn {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

.question-number {
  font-size: .75rem; color: #888888;
  margin-bottom: .75rem; font-weight: 600;
  letter-spacing: 1px;
}
.question-text {
  font-size: 1.15rem; font-weight: 700;
  line-height: 1.8; margin-bottom: 1rem;
  color: #1A1A1A;
}
.age-hint {
  font-size: .8rem; color: var(--secondary);
  margin-bottom: 1.25rem;
  display: flex; align-items: center; gap: .4rem;
}
.age-hint::before { content: '⏰'; }

.answer-options {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: .75rem;
}
@media(max-width:500px) { .answer-options { grid-template-columns: 1fr; } }

.answer-btn {
  padding: 1rem;
  background: #F8F8F8;
  border: 2px solid #E0E0E0;
  border-radius: 14px; cursor: pointer;
  display: flex; align-items: center; gap: .75rem;
  transition: all .25s; text-align: right;
  font-family: var(--font);
}
.answer-btn:hover {
  border-color: #E6B800;
  background: #FFFBE6;
  transform: translateY(-2px);
}
.answer-btn.selected {
  border-color: #E6B800;
  background: rgba(230,184,0,.1);
  box-shadow: 0 4px 15px rgba(230,184,0,.2);
}
.answer-btn[data-val="2"].selected { border-color: var(--success); background: rgba(16,185,129,.15); }
.answer-btn[data-val="1"].selected { border-color: var(--warning); background: rgba(245,158,11,.15); }
.answer-btn[data-val="0"].selected { border-color: var(--danger); background: rgba(239,68,68,.15); }
.answer-btn[data-val="N"].selected { border-color: var(--text-muted); background: rgba(148,163,184,.15); }

.answer-icon { font-size: 1.3rem; flex-shrink: 0; }
.answer-label { flex: 1; font-size: .9rem; font-weight: 600; color: #1A1A1A; }
.answer-score {
  font-size: .85rem; font-weight: 700;
  padding: .2rem .5rem; border-radius: 6px;
  background: #EEEEEE; color: #666666;
  min-width: 24px; text-align: center;
}

/* Question Navigation */
.question-nav {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem;
}
.btn-nav {
  padding: .65rem 1.5rem;
  background: #F5F5F5;
  border: 1px solid #DDDDDD;
  border-radius: 10px; color: #1A1A1A;
  font-family: var(--font); font-size: .9rem;
  cursor: pointer; transition: all .2s;
  display: flex; align-items: center; gap: .4rem;
}
.btn-nav:hover { border-color: #E6B800; color: #C49A00; background: #FFFBE6; }
.btn-nav:disabled { opacity: .4; cursor: not-allowed; }
.btn-next {
  background: linear-gradient(135deg, #E6B800, #C49A00);
  border-color: transparent; color: #FFFFFF;
  font-weight: 900;
}
.btn-next:hover { opacity: .9; transform: translateX(-3px); }
.nav-info { color: #888888; font-size: .85rem; text-align: center; }

/* ===========================
   DASHBOARD
   =========================== */
.dashboard-container {
  max-width: 1300px; margin: 0 auto;
  padding: 2rem 1.5rem;
  display: flex; flex-direction: column; gap: 2rem;
}

.dashboard-header {
  text-align: center;
  padding: 2rem;
  background: linear-gradient(135deg, rgba(245,197,24,.12), rgba(255,255,255,.03));
  border: 1px solid rgba(245,197,24,.25);
  border-top: 1px solid rgba(255,255,255,.1);
  border-radius: 20px;
  animation: fadeInUp .6s ease;
}
.dash-title { font-size: clamp(1.2rem, 3vw, 1.8rem); font-weight: 900; margin: .5rem 0; }
.dash-title i { color: var(--primary-light); margin-left: .5rem; }
.dash-child-info { font-size: 1rem; color: var(--text-muted); }
.dash-date { font-size: .85rem; color: var(--text-muted); margin-top: .25rem; }

/* Overall Score */
.overall-section {
  display: flex; justify-content: center;
  animation: fadeInUp .8s ease .2s both;
}
.overall-card {
  background: #FFFFFF;
  border: 1px solid #E8E8E8;
  border-top: 3px solid #E6B800;
  border-radius: 24px;
  padding: 2.5rem;
  display: flex; align-items: center; gap: 3rem;
  flex-wrap: wrap; justify-content: center;
  box-shadow: 0 6px 24px rgba(0,0,0,.07);
  text-align: center;
  min-width: 500px;
}
@media(max-width:600px) { .overall-card { min-width: 0; gap: 1.5rem; } }

.overall-ring-wrap {
  position: relative;
  width: 180px; height: 180px; flex-shrink: 0;
}
.overall-ring { transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: var(--bg3); stroke-width: 12; }
.ring-fill {
  fill: none; stroke-width: 12;
  stroke: url(#ringGrad);
  stroke-linecap: round;
  transition: stroke-dashoffset 2s cubic-bezier(.4,0,.2,1);
}
.overall-score-inner {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
}
.overall-score-num {
  font-size: 2.8rem; font-weight: 900;
  background: linear-gradient(135deg, #F5C518, #FFD94D);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}
.overall-score-label { font-size: .7rem; color: var(--text-muted); margin-top: .2rem; }
.overall-level { font-size: .75rem; font-weight: 700; margin-top: .3rem; }

.overall-meta { display: flex; flex-direction: column; gap: 1rem; }
.meta-item {
  display: flex; align-items: center; gap: .75rem;
  font-size: .95rem; color: #555555;
  background: #F8F8F8; border-radius: 12px; padding: .7rem 1.25rem;
  border: 1px solid #EEEEEE;
}
.meta-item i { color: #E6B800; font-size: 1rem; width: 18px; text-align: center; }
.meta-item span { font-weight: 600; color: #1A1A1A; }

/* Domains Grid */
.domains-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(250px,1fr));
  gap: 1.25rem;
  animation: fadeInUp .8s ease .3s both;
}
.domain-card {
  background: #FFFFFF;
  border: 1px solid #E8E8E8;
  border-radius: 18px; padding: 1.5rem;
  position: relative; overflow: hidden;
  transition: transform .3s, box-shadow .3s;
  box-shadow: 0 2px 10px rgba(0,0,0,.05);
}
.domain-card:hover { transform: translateY(-4px); box-shadow: 0 8px 20px rgba(0,0,0,.1); }
.domain-card::before {
  content: ''; position: absolute;
  top: 0; right: 0; width: 4px; height: 100%;
  background: var(--domain-color);
}
.domain-card-header {
  display: flex; align-items: center; gap: .75rem; margin-bottom: 1rem;
}
.domain-card-icon {
  width: 42px; height: 42px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
  background: rgba(var(--domain-rgb), .2);
  color: var(--domain-color);
}
.domain-card-name { font-weight: 700; font-size: .95rem; }
.domain-card-sub { font-size: .75rem; color: var(--text-muted); }

.domain-score-bar {
  height: 8px; background: #EEEEEE; border-radius: 4px;
  overflow: hidden; margin: .5rem 0;
}
.domain-score-fill {
  height: 100%; border-radius: 4px;
  background: var(--domain-color);
  transition: width 1.5s cubic-bezier(.4,0,.2,1);
  width: 0;
}
.domain-score-row {
  display: flex; justify-content: space-between;
  font-size: .8rem; margin-top: .3rem;
}
.domain-score-val { font-weight: 700; color: var(--domain-color); font-size: 1.1rem; }
.domain-level-badge {
  display: inline-block;
  padding: .2rem .65rem;
  border-radius: 20px;
  font-size: .72rem; font-weight: 700;
  margin-top: .6rem;
}

/* Charts Section */
.charts-section {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(380px,1fr));
  gap: 1.5rem;
  animation: fadeInUp .8s ease .4s both;
}
@media(max-width:600px) { .charts-section { grid-template-columns: 1fr; } }

.chart-card {
  background: #FFFFFF;
  border: 1px solid #E8E8E8;
  border-radius: 18px; padding: 1.5rem;
  box-shadow: 0 2px 10px rgba(0,0,0,.05);
}
.chart-card h3 {
  font-size: 1rem; margin-bottom: 1.25rem;
  color: #555555; font-weight: 600;
}
.chart-card h3 i { color: #C49A00; margin-left: .4rem; }

/* Subdomain Section */
.section-title {
  font-size: 1.1rem; font-weight: 800; margin-bottom: 1.25rem;
}
.section-title i { color: #F5C518; margin-left: .5rem; }
.subdomain-cards {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(300px,1fr));
  gap: 1rem;
  animation: fadeInUp .8s ease .5s both;
}
.subdomain-card {
  background: #FFFFFF;
  border: 1px solid #E8E8E8;
  border-right: 3px solid var(--domain-color, #E6B800);
  border-radius: 14px; padding: 1.25rem;
  box-shadow: 0 2px 8px rgba(0,0,0,.05);
  transition: transform .25s, box-shadow .25s;
}
.subdomain-card:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0,0,0,.08); }
.subdomain-card-title {
  font-size: .9rem; font-weight: 700; margin-bottom: .75rem;
  display: flex; align-items: center; gap: .5rem;
}
.subdomain-card-title .sd-dot {
  width: 8px; height: 8px; border-radius: 50%;
}
.subdomain-progress { display: flex; flex-direction: column; gap: .3rem; }
.subdomain-bar-wrap {
  display: flex; align-items: center; gap: .75rem;
}
.subdomain-bar {
  flex: 1; height: 6px; background: #EEEEEE; border-radius: 3px; overflow: hidden;
}
.subdomain-bar-fill {
  height: 100%; border-radius: 3px;
  transition: width 1.5s cubic-bezier(.4,0,.2,1); width: 0;
}
.subdomain-pct { font-size: .8rem; font-weight: 700; width: 36px; text-align: left; }

/* Recommendations */
.recommendations-section {
  animation: fadeInUp .8s ease .6s both;
}
.rec-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px,1fr));
  gap: 1rem;
}
.rec-card {
  background: #FFFFFF;
  border: 1px solid #E8E8E8;
  border-right: 4px solid var(--domain-color);
  border-radius: 14px; padding: 1.25rem;
  box-shadow: 0 2px 8px rgba(0,0,0,.05);
  transition: transform .25s, box-shadow .25s;
}
.rec-card:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0,0,0,.08); }
.rec-card-header {
  display: flex; align-items: center; gap: .6rem;
  margin-bottom: .75rem;
}
.rec-card-header i { font-size: 1.1rem; }
.rec-card-title { font-weight: 700; font-size: .9rem; }
.rec-list {
  list-style: none; display: flex; flex-direction: column; gap: .4rem;
}
.rec-list li {
  font-size: .82rem; color: #444444;
  padding: .35rem .6rem;
  background: #F7F7F7; border-radius: 8px;
  line-height: 1.5;
  border: 1px solid #EEEEEE;
}
.rec-list li::before { content: '• '; color: #F5C518; }

/* Dashboard Actions */
.dashboard-actions {
  display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap;
  padding-bottom: 2rem;
}
.btn-action {
  padding: .8rem 2rem;
  background: linear-gradient(135deg, #F5C518, #D4A014);
  color: #0A0A0A; border: none; border-radius: 50px;
  font-family: var(--font); font-size: .95rem; font-weight: 900;
  cursor: pointer; transition: all .3s;
  box-shadow: 0 4px 15px rgba(245,197,24,.3);
}
.btn-action:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(245,197,24,.5); }
.btn-action.btn-secondary {
  background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.12); color: var(--text);
  box-shadow: none;
}
.btn-action.btn-secondary:hover { border-color: #F5C518; color: #F5C518; }
.btn-action i { margin-left: .4rem; }

/* Level Colors */
.level-excellent { color: #10B981; background: rgba(16,185,129,.15); }
.level-good      { color: #06B6D4; background: rgba(6,182,212,.15); }
.level-average   { color: #F59E0B; background: rgba(245,158,11,.15); }
.level-below     { color: #EF4444; background: rgba(239,68,68,.15); }
.level-low       { color: #8B5CF6; background: rgba(139,92,246,.15); }

/* ===========================
   HISTORY PAGE
   =========================== */
.history-container {
  max-width:1200px; margin:0 auto;
  padding:2rem 1.5rem;
  display:flex; flex-direction:column; gap:1.5rem;
  background: #FFFFFF;
}
.history-header { display:flex; flex-direction:column; gap:1rem; }
.history-header-top {
  display:flex; align-items:flex-start; justify-content:space-between;
  gap:1rem; flex-wrap:wrap;
}
.history-title { font-size:1.6rem; font-weight:900; color:#1A1A1A; }
.history-title i { color:#E6B800; margin-left:.5rem; }
.history-subtitle { color:#666666; font-size:.9rem; margin-top:.25rem; }

.search-bar-wrap { display:flex; flex-direction:column; gap:.75rem; }
.search-bar {
  display:flex; align-items:center; gap:.75rem;
  background: #F8F8F8; border:1px solid #DDDDDD;
  border-radius:12px; padding:.6rem 1rem;
  transition:border-color .2s;
}
.search-bar:focus-within { border-color:#E6B800; box-shadow:0 0 0 3px rgba(230,184,0,.12); }
.search-icon { color:#AAAAAA; flex-shrink:0; }
.search-bar input {
  flex:1; background:transparent; border:none; outline:none;
  color:#1A1A1A; font-family:var(--font); font-size:.95rem; direction:rtl;
}
.search-bar input::placeholder { color:#AAAAAA; }
.search-clear {
  background:none; border:none; color:var(--text-muted); cursor:pointer;
  padding:.2rem; opacity:0; transition:opacity .2s;
}
.search-clear.visible { opacity:1; }
.search-filters { display:flex; gap:.75rem; flex-wrap:wrap; }
.search-filters select {
  padding:.5rem .9rem;
  background: #F8F8F8; border:1px solid #DDDDDD;
  border-radius:8px; color:#1A1A1A;
  font-family:var(--font); font-size:.82rem; cursor:pointer;
}
.search-filters select:focus { outline:none; border-color:#E6B800; }

.history-stats {
  display:grid; grid-template-columns:repeat(auto-fill,minmax(150px,1fr)); gap:.75rem;
}
.stat-card {
  background:#FFFFFF; border:1px solid #E8E8E8; border-top:3px solid #E6B800; border-radius:14px;
  padding:1rem; text-align:center; animation:fadeInUp .4s ease;
  box-shadow: 0 2px 8px rgba(0,0,0,.05);
}
.stat-card-val { font-size:1.8rem; font-weight:900; color:#C49A00; }
.stat-card-label { font-size:.75rem; color:#666666; margin-top:.2rem; }

.records-grid {
  display:grid; grid-template-columns:repeat(auto-fill,minmax(320px,1fr)); gap:1.25rem;
}
.record-card {
  background:#FFFFFF; border:1px solid #E8E8E8; border-radius:18px;
  padding:1.5rem; cursor:pointer;
  transition:transform .25s, box-shadow .25s, border-color .25s;
  position:relative; overflow:hidden;
  box-shadow: 0 2px 10px rgba(0,0,0,.05);
}
.record-card::before {
  content:''; position:absolute; top:0; right:0; width:4px; height:100%;
  background:var(--rc-color, var(--primary));
}
.record-card:hover {
  transform:translateY(-4px);
  box-shadow:0 10px 30px rgba(0,0,0,.1);
  border-color:rgba(230,184,0,.4);
}
.record-card-header { display:flex; align-items:flex-start; justify-content:space-between; gap:.75rem; margin-bottom:.75rem; }
.record-child-name { font-size:1.05rem; font-weight:800; color:#1A1A1A; }
.record-meta { font-size:.75rem; color:#888888; margin-top:.15rem; }
.record-badge { padding:.25rem .7rem; border-radius:20px; font-size:.72rem; font-weight:700; flex-shrink:0; }
.record-domains { display:grid; grid-template-columns:1fr 1fr; gap:.35rem; margin:.75rem 0; }
.record-domain-row { display:flex; align-items:center; gap:.4rem; font-size:.78rem; color:#666666; }
.record-domain-dot { width:8px; height:8px; border-radius:50%; flex-shrink:0; }
.record-domain-name { flex:1; }
.record-domain-pct { font-weight:700; font-size:.8rem; }
.record-score-bar { height:4px; background: #F0F0F0; border-radius:2px; margin:.1rem 0; overflow:hidden; }
.record-score-fill { height:100%; border-radius:2px; }
.record-footer {
  display:flex; align-items:center; justify-content:space-between;
  margin-top:.75rem; padding-top:.75rem; border-top:1px solid #F0F0F0;
  font-size:.78rem; color:#888888;
}
.record-total-score { font-size:1.2rem; font-weight:900; }

/* Compass record card variant */
.compass-record-card {
  border-top: 3px solid #4F46E5 !important;
  background: linear-gradient(135deg, #FAFAFE, #FFFFFF) !important;
}
.compass-record-card:hover {
  border-color: rgba(79,70,229,.5) !important;
  box-shadow: 0 10px 30px rgba(79,70,229,.12) !important;
}
.compass-record-badge {
  display: inline-block;
  background: rgba(79,70,229,.08);
  color: #6366F1;
  border: 1px solid rgba(79,70,229,.2);
  border-radius: 20px;
  padding: .18rem .65rem;
  font-size: .68rem;
  font-weight: 700;
  margin-bottom: .55rem;
}

.records-loading { text-align:center; padding:3rem; color:#888888; display:flex; flex-direction:column; align-items:center; gap:.6rem; }
.records-empty { text-align:center; padding:3rem; color:#888888; display:flex; flex-direction:column; align-items:center; gap:.8rem; }
.records-empty h3 { font-size:1.2rem; color:#1A1A1A; }

.pagination-wrap { display:flex; justify-content:center; gap:.5rem; flex-wrap:wrap; padding:.5rem; }
.page-btn {
  width:36px; height:36px; border-radius:8px;
  background:#F5F5F5; border:1px solid #DDDDDD; color:#666666;
  cursor:pointer; font-family:var(--font); font-size:.85rem;
  transition:all .2s; display:flex; align-items:center; justify-content:center;
}
.page-btn:hover,.page-btn.active { background:#E6B800; border-color:#E6B800; color:#FFFFFF; font-weight:700; }

/* Modal */
.modal-overlay {
  position:fixed; inset:0; background:rgba(0,0,0,.5);
  backdrop-filter:blur(6px);
  display:flex; align-items:center; justify-content:center;
  z-index:10000; padding:1rem;
  animation:fadeIn .25s ease;
}
.modal-box {
  background: #FFFFFF; border: 1px solid #E8E8E8; border-top: 3px solid #E6B800; border-radius:24px;
  width:100%; max-width:700px; max-height:90vh;
  display:flex; flex-direction:column;
  animation:popIn .35s cubic-bezier(.34,1.56,.64,1); overflow:hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,.15);
}
.modal-header {
  display:flex; align-items:center; justify-content:space-between;
  padding:1.25rem 1.75rem; border-bottom:1px solid #EEEEEE; flex-shrink:0;
}
.modal-header h3 { font-size:1.1rem; font-weight:800; color:#1A1A1A; }
.modal-close {
  background: #F5F5F5; border:1px solid #E0E0E0; border-radius:8px;
  width:34px; height:34px; display:flex; align-items:center; justify-content:center;
  cursor:pointer; color:#666666; transition:all .2s;
}
.modal-close:hover { color:#C49A00; border-color:#E6B800; background: #FFFBE6; }
.modal-close:hover { color:var(--text); border-color:#F5C518; }
.modal-body { flex:1; overflow-y:auto; padding:1.75rem; display:flex; flex-direction:column; gap:1.25rem; }
.modal-footer {
  display:flex; gap:.75rem; justify-content:flex-end;
  padding:1rem 1.75rem; border-top:1px solid #EEEEEE;
  flex-shrink:0; flex-wrap:wrap;
}
.btn-danger { background: linear-gradient(135deg,#EF4444,#DC2626) !important; }
.modal-score-grid {
  display:grid; grid-template-columns:repeat(auto-fill,minmax(130px,1fr)); gap:.75rem;
}
.modal-score-card { background: #F8F8F8; border: 1px solid #EEEEEE; border-radius:12px; padding:.9rem; text-align:center; }
.modal-score-val { font-size:1.4rem; font-weight:900; }
.modal-score-lbl { font-size:.72rem; color:#666666; margin-top:.2rem; }

/* Dashboard rewrite */
.dashboard-container {
  max-width:1200px; margin:0 auto; padding:2rem 1.5rem;
  display:flex; flex-direction:column; gap:2rem;
}
.print-page { display:flex; flex-direction:column; gap:1.5rem; }
.print-page-break { margin-top:1rem; }

.dashboard-header {
  padding:1.5rem 2rem;
  background: linear-gradient(135deg, #FFFDE7, #FFF9C4);
  border:1px solid rgba(230,184,0,.25); border-top: 3px solid #E6B800; border-radius:20px;
  animation:fadeInUp .5s ease;
  box-shadow: 0 4px 16px rgba(230,184,0,.1);
}
.dash-logo-row { display:flex; align-items:center; gap:1rem; margin-bottom:1rem; }
.dash-logo-icon {
  width:60px; height:60px; border-radius:14px; flex-shrink:0;
  background: transparent;
  display:flex; align-items:center; justify-content:center;
  overflow:hidden;
}
.dash-logo-icon img {
  width:60px; height:60px;
  object-fit:contain;
  filter: drop-shadow(0 3px 8px rgba(230,184,0,.4));
}
.dash-title { font-size:clamp(1.1rem,2.5vw,1.5rem); font-weight:900; line-height:1.2; color:#1A1A1A; }
.dash-subtitle { font-size:.72rem; color:#888888; letter-spacing:2px; font-family:'Arial',sans-serif; direction:ltr; }
.dash-info-grid {
  display:grid; grid-template-columns:repeat(auto-fill,minmax(200px,1fr)); gap:.5rem;
}
.dash-info-item {
  display:flex; align-items:center; gap:.5rem;
  font-size:.82rem; color:#555555;
  background:#F8F8F8; border: 1px solid #EEEEEE; border-radius:8px; padding:.4rem .75rem;
}
.dash-info-item i { color:#E6B800; width:14px; flex-shrink:0; }
.dash-info-item span { font-weight:600; color:#1A1A1A; }

.overall-radar-row {
  display:grid; grid-template-columns:300px 1fr; gap:1.5rem; align-items:start;
}
@media(max-width:900px) { .overall-radar-row { grid-template-columns:1fr; } }

/* Overall Card */
.overall-card {
  background: #FFFFFF; border: 1px solid #E8E8E8;
  border-top: 3px solid #E6B800;
  border-radius:20px; padding:1.5rem;
  text-align:center; animation:fadeInUp .7s ease .2s both;
  display:flex; flex-direction:column; align-items:center; gap:.75rem;
  box-shadow: 0 4px 16px rgba(0,0,0,.07);
}
.overall-card-title {
  font-size:.85rem; font-weight:700; color:#666666;
  display:flex; align-items:center; gap:.4rem; justify-content:center;
}
.overall-card-title i { color:#C49A00; }
.overall-ring-wrap { position:relative; width:160px; height:160px; }
.overall-ring { transform:rotate(-90deg); width:100%; height:100%; }
.ring-bg { fill:none; stroke:#EEEEEE; stroke-width:12; }
.ring-fill { fill:none; stroke-width:12; stroke:url(#ringGrad); stroke-linecap:round; transition:stroke-dashoffset 2s cubic-bezier(.4,0,.2,1); stroke:#E6B800; }
.overall-score-inner { position:absolute; inset:0; display:flex; flex-direction:column; align-items:center; justify-content:center; }
.overall-score-num {
  font-size:2.4rem; font-weight:900;
  background:linear-gradient(135deg,#C49A00,#E6B800);
  -webkit-background-clip:text; -webkit-text-fill-color:transparent; background-clip:text; line-height:1;
}
.overall-score-pct { font-size:.85rem; color:#888888; }
.overall-score-label { font-size:.65rem; color:#888888; }
.overall-level { font-size:.78rem; font-weight:700; margin-top:.2rem; padding:.2rem .6rem; border-radius:10px; }
.overall-meta { display:flex; flex-direction:column; gap:.5rem; width:100%; }
.meta-item {
  display:flex; align-items:center; gap:.6rem;
  font-size:.8rem; color:#555555;
  background: #F8F8F8; border: 1px solid #EEEEEE; border-radius:10px; padding:.5rem .9rem;
}
.meta-item i { color:#E6B800; width:16px; flex-shrink:0; }
.meta-item span { font-weight:600; color:#1A1A1A; }

/* Chart Cards */
.chart-card {
  background: #FFFFFF; border: 1px solid #E8E8E8;
  border-top: 2px solid rgba(230,184,0,.4);
  border-radius:18px; padding:1.5rem;
  animation:fadeInUp .7s ease .4s both;
  box-shadow: 0 4px 16px rgba(0,0,0,.05);
}
.chart-card-title {
  font-size:.9rem; margin-bottom:1rem; color:#555555;
  font-weight:700; display:flex; align-items:center; gap:.4rem;
}
.chart-card-title i { color:#E6B800; }
.radar-wrap, .profile-chart-wrap { height:300px; position:relative; }
.bar-wrap-full { height:360px; position:relative; }

/* Dashboard print footer */
.print-footer {
  margin-top:1.5rem; padding-top:1rem;
  border-top:2px solid #E8E8E8;
  text-align:center; font-size:.78rem; color:#666666;
  display:flex; flex-direction:column; gap:.3rem;
}
.print-footer-logo { font-weight:700; color:#1A1A1A; font-size:.85rem; }
.print-footer-logo i { color:#C49A00; }

/* ── dash-info-item with label/value ── */
.dash-info-cell {
  display: flex; flex-direction: column; gap: 1px;
}
.dash-info-label {
  font-size: .68rem; color: #999999; font-weight: 500; line-height: 1.1;
}
.dash-info-val {
  font-size: .85rem; font-weight: 700; color: #1A1A1A; line-height: 1.2;
}

/* ── Print footer specialist row ── */
.print-footer-specialist-row {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 1.5rem;
  padding: .6rem 0; background: #F8F8F8;
  border-radius: 10px; margin-bottom: .6rem;
}
.print-footer-specialist {
  display: flex; align-items: center; gap: .4rem;
  font-size: .82rem; color: #444444;
}
.print-footer-specialist i { color: #C49A00; font-size: .8rem; }
.print-footer-specialist span { color: #777777; }
.print-footer-specialist strong { color: #1A1A1A; font-weight: 700; }
.print-footer-divider {
  height: 1px; background: #E8E8E8; margin: .3rem 0;
}
.print-footer-bottom {
  display: flex; flex-wrap: wrap; align-items: center;
  justify-content: space-between; gap: .5rem;
}

/* ── Home button ── */
.btn-home {
  background: linear-gradient(135deg, #FFFFFF, #F0F0F0) !important;
  color: #1A1A1A !important;
  border: 2px solid #E0E0E0 !important;
  box-shadow: 0 2px 8px rgba(0,0,0,.1) !important;
}
.btn-home:hover {
  background: linear-gradient(135deg, #F8F8F8, #EBEBEB) !important;
  box-shadow: 0 6px 18px rgba(0,0,0,.15) !important;
}
.btn-home-hist {
  background: linear-gradient(135deg, #FFFFFF, #F0F0F0);
  color: #1A1A1A;
  border: 2px solid #E0E0E0;
  padding: .65rem 1.4rem;
  border-radius: 50px;
  font-family: var(--font); font-size: .9rem; font-weight: 700;
  cursor: pointer; transition: all .25s;
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
}
.btn-home-hist:hover {
  background: linear-gradient(135deg, #F5F5F5, #E8E8E8);
  box-shadow: 0 5px 16px rgba(0,0,0,.14);
  transform: translateY(-2px);
}

/* Header history btn */
.btn-history-nav { }

/* Animations */
@keyframes countUp { from{opacity:0} to{opacity:1} }
.animate-in { animation: fadeInUp .5s ease forwards; }

/* Animations */
@keyframes countUp {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.animate-in { animation: fadeInUp .5s ease forwards; }

/* Completion Overlay */
.completion-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  display: flex; align-items: center; justify-content: center;
  z-index: 999;
  animation: fadeIn .3s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.completion-card {
  background: #FFFFFF; border: 1px solid #E8E8E8;
  border-top: 3px solid #E6B800;
  border-radius: 24px; padding: 3rem;
  text-align: center; max-width: 480px;
  animation: popIn .5s cubic-bezier(.34,1.56,.64,1);
  box-shadow: 0 20px 60px rgba(0,0,0,.15);
}
@keyframes popIn {
  from { opacity: 0; transform: scale(.7); }
  to   { opacity: 1; transform: scale(1); }
}
.completion-icon {
  font-size: 4rem; margin-bottom: 1rem;
  animation: bounce 1s ease infinite alternate;
}
@keyframes bounce {
  from { transform: translateY(0); }
  to   { transform: translateY(-10px); }
}
.completion-card h2 { font-size: 1.8rem; font-weight: 900; margin-bottom: .5rem; color:#1A1A1A; }
.completion-card p { color: #666666; margin-bottom: 1.5rem; }

/* ===========================
   INTRO PAGE
   =========================== */
#page-intro {
  min-height: calc(100vh - 60px);
  display: none;
  align-items: center; justify-content: center;
  padding: 2rem 1.5rem;
  background: radial-gradient(ellipse at 60% 0%, rgba(230,184,0,.08) 0%, transparent 60%),
              #FFFFFF;
}
#page-intro.active { display: flex; }

.intro-wrapper {
  max-width: 780px; width: 100%;
  display: flex; flex-direction: column; gap: 1.5rem;
  animation: fadeInUp .7s ease;
}

/* Banner */
.intro-banner {
  display: flex; align-items: center; gap: 1.5rem;
  background: linear-gradient(135deg, #FFFDE7, #FFF9C4);
  border: 1px solid rgba(230,184,0,.3);
  border-top: 3px solid #E6B800;
  border-radius: 22px; padding: 1.5rem 2rem;
  box-shadow: 0 4px 16px rgba(230,184,0,.1);
}
@media(max-width:600px){ .intro-banner { flex-direction:column; text-align:center; padding:1.25rem; } }

.intro-banner-rings {
  position: relative; width: 80px; height: 80px; flex-shrink: 0;
}
.ibr {
  position: absolute; inset: 0; border-radius: 50%;
  border: 2.5px solid transparent;
  animation: spin 3s linear infinite;
}
.ibr1 { border-top-color: #E6B800; animation-duration: 3s; }
.ibr2 { inset: 10px; border-right-color: #C49A00; animation-duration: 2s; animation-direction: reverse; }
.ibr3 { inset: 20px; border-bottom-color: #E6B800; animation-duration: 1.5s; }
.intro-banner-icon {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem; color: #C49A00;
}
.intro-banner-text { flex: 1; }
.intro-main-title {
  font-size: clamp(1.3rem, 3vw, 1.9rem); font-weight: 900;
  background: linear-gradient(90deg, #C49A00, #E6B800);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text; line-height: 1.2;
}
.intro-main-sub {
  font-size: .78rem; letter-spacing: 2px; color: #888888;
  font-family: 'Arial', sans-serif; direction: ltr; margin-top: .3rem;
}

/* Domain chips */
.intro-domains-row {
  display: flex; gap: .75rem; flex-wrap: wrap;
}
.intro-domain-chip {
  padding: .45rem 1rem;
  background: rgba(var(--dc-rgb, 79,70,229), .12);
  border: 1px solid color-mix(in srgb, var(--dc) 40%, transparent);
  border-color: var(--dc);
  border-radius: 50px;
  font-size: .82rem; font-weight: 700;
  color: var(--dc, var(--primary-light));
  opacity: .85;
  transition: opacity .2s, transform .2s;
}
.intro-domain-chip:hover { opacity: 1; transform: translateY(-2px); }

/* Main card */
.intro-card {
  background: #FFFFFF;
  border: 1px solid #E8E8E8;
  border-right: 4px solid #E6B800;
  border-radius: 20px; padding: 2rem 2.5rem;
  position: relative; overflow: hidden;
  box-shadow: 0 4px 16px rgba(0,0,0,.06);
}
@media(max-width:600px){ .intro-card { padding: 1.25rem; } }
.intro-card::before {
  content: '';
  position: absolute; top: 0; right: 0;
  width: 100%; height: 3px;
  background: linear-gradient(90deg, #F5C518, #FFD94D, #F5C518);
}
.intro-card-icon {
  width: 46px; height: 46px; border-radius: 12px;
  background: linear-gradient(135deg, #F5C518, #D4A014);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; color: #0A0A0A;
  margin-bottom: 1rem;
  box-shadow: 0 4px 14px rgba(245,197,24,.35);
}
.intro-card-title {
  font-size: 1.2rem; font-weight: 800; margin-bottom: .9rem;
  color: #1A1A1A;
}
.intro-card-body {
  font-size: .97rem; line-height: 1.9;
  color: #555555; margin-bottom: .75rem;
}
.intro-card-body:last-of-type { margin-bottom: 0; }

/* Info chips row */
.intro-info-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
}
.intro-info-chip {
  background: #FFFFFF; border: 1px solid #E8E8E8;
  border-radius: 14px; padding: 1rem 1.1rem;
  display: flex; align-items: center; gap: .85rem;
  transition: transform .25s, border-color .25s, box-shadow .25s;
  box-shadow: 0 2px 8px rgba(0,0,0,.05);
}
.intro-info-chip:hover { transform: translateY(-3px); border-color: #E6B800; box-shadow: 0 6px 20px rgba(230,184,0,.15); }
.intro-info-chip:hover { transform: translateY(-3px); border-color: #F5C518; }
.intro-info-icon {
  width: 38px; height: 38px; border-radius: 10px; flex-shrink: 0;
  background: linear-gradient(135deg, #F5C518, #D4A014);
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; color: #0A0A0A; font-weight: 900;
}
.intro-info-label { font-size: .72rem; color: #888888; }
.intro-info-val { font-size: .95rem; font-weight: 800; color: #1A1A1A; margin-top: .1rem; }

/* CTA */
.intro-cta { text-align: center; }
.btn-intro-start {
  display: inline-flex; align-items: center; gap: .75rem;
  padding: 1rem 3rem;
  background: linear-gradient(135deg, #E6B800, #C49A00);
  color: #FFFFFF; border: none; border-radius: 50px;
  font-family: var(--font); font-size: 1.1rem; font-weight: 900;
  cursor: pointer; transition: all .3s;
  box-shadow: 0 8px 28px rgba(230,184,0,.35);
  letter-spacing: .3px;
}
.btn-intro-start:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 38px rgba(230,184,0,.5);
}
.btn-intro-start i { font-size: 1rem; }

/* ===========================
   QR MODAL
   =========================== */
.qr-modal-box { max-width: 600px; }
.qr-modal-body {
  display: grid; grid-template-columns: 200px 1fr;
  gap: 1.5rem; padding: 1.5rem;
  align-items: start;
}
@media(max-width:560px) {
  .qr-modal-body { grid-template-columns: 1fr; }
}

.qr-section {
  display: flex; flex-direction: column; align-items: center; gap: .75rem;
}
.qr-canvas-wrap {
  background: #fff; border-radius: 16px; padding: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,.3);
  display: flex; align-items: center; justify-content: center;
}
.qr-canvas-wrap canvas { display: block; border-radius: 4px; }
.qr-hint { font-size: .75rem; color: var(--text-muted); text-align: center; }

.qr-link-section { display: flex; flex-direction: column; gap: 1rem; }
.qr-child-banner {
  background: linear-gradient(135deg, #FFFDE7, #FFF9C4);
  border: 1px solid rgba(230,184,0,.3);
  border-radius: 12px; padding: .75rem 1rem;
  font-weight: 700; font-size: .9rem; color:#1A1A1A;
}
.qr-link-wrap { display: flex; flex-direction: column; gap: .4rem; }
.qr-link-label { font-size: .75rem; color: var(--text-muted); font-weight: 600; }
.qr-link-label i { color: var(--primary-light); margin-left: .3rem; }
.qr-link-row { display: flex; gap: .5rem; align-items: center; }
.qr-link-input {
  flex: 1; padding: .55rem .85rem;
  background: #F8F8F8; border: 1px solid #DDDDDD;
  border-radius: 8px; color: #555555;
  font-family: monospace; font-size: .72rem;
  direction: ltr; text-align: left; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
  outline: none; cursor: text;
}
.qr-copy-btn {
  width: 34px; height: 34px; flex-shrink: 0;
  background: #E6B800; border: none; border-radius: 8px;
  color: #FFFFFF; cursor: pointer; transition: all .2s;
  display: flex; align-items: center; justify-content: center;
  font-weight: 900;
}
.qr-copy-btn:hover { background: #C49A00; }
.qr-score-summary {
  display: flex; flex-direction: column; gap: .4rem;
  background: #F8F8F8; border: 1px solid #EEEEEE; border-radius: 10px; padding: .85rem;
}
.qr-domain-row {
  display: flex; align-items: center; gap: .5rem;
  font-size: .78rem; color: #555555;
}
.qr-domain-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.qr-domain-name { flex: 1; }
.qr-domain-pct { font-weight: 700; }

.btn-qr {
  background: linear-gradient(135deg, #E6B800, #C49A00) !important;
  color: #FFFFFF !important;
}

/* Shared result box */
.shared-result-box { max-width: 600px; }

/* ===========================
   LOGO IMAGE CLASSES
   =========================== */
/* Splash screen logo image */
.splash-logo-img {
  width: 200px;
  height: 140px;
  object-fit: contain;
  border-radius: 0;
  background: transparent;
  direction: ltr;
  display: block;
  mix-blend-mode: multiply;
  animation: pulse-glow 3s ease-in-out infinite;
  position: relative;
  z-index: 2;
}
@keyframes pulse-glow {
  0%, 100% { filter: drop-shadow(0 8px 28px rgba(230,184,0,.45)); }
  50%       { filter: drop-shadow(0 14px 40px rgba(230,184,0,.75)); }
}

/* App header logo image */
.header-logo-img {
  width: 44px; height: 30px;
  object-fit: contain; border-radius: 0;
  flex-shrink: 0;
  direction: ltr;
  display: block;
  mix-blend-mode: multiply;
  filter: drop-shadow(0 2px 6px rgba(230,184,0,.3));
}

/* Intro page clinic logo */
.intro-logo-wrap {
  flex-shrink: 0;
  width: 140px; height: 90px;
}
.intro-clinic-logo {
  width: 140px; height: 90px;
  object-fit: contain; border-radius: 0;
  background: transparent;
  direction: ltr;
  display: block;
  mix-blend-mode: multiply;
  filter: drop-shadow(0 4px 14px rgba(230,184,0,.4));
  transition: transform .3s, filter .3s;
}
.intro-clinic-logo:hover {
  transform: scale(1.06) rotate(-2deg);
  filter: drop-shadow(0 8px 24px rgba(230,184,0,.6));
}

/* ===========================
   INTRO FOOTER COPYRIGHT
   =========================== */
.intro-footer {
  text-align: center;
  display: flex; flex-direction: column;
  align-items: center; gap: .55rem;
  padding-bottom: .5rem;
}
/* Intro footer */
.intro-footer-top {
  display: flex; align-items: center; gap: .4rem; flex-wrap: wrap;
  justify-content: center;
  font-size: .8rem; color: #888888;
}
.intro-footer-brand {
  font-family: 'Arial', sans-serif;
  direction: ltr; font-style: italic;
  color: #C49A00; font-weight: 600;
}
.intro-footer-copy {
  font-size: .75rem; color: #888888;
  display: flex; align-items: center; gap: .3rem;
  flex-wrap: wrap; justify-content: center;
  border-top: 1px solid #EEEEEE;
  padding-top: .5rem; width: 100%;
}
.intro-footer-copy i { color: #E6B800; }

/* ===========================
   SPLASH BUTTONS ROW
   =========================== */
.splash-btns {
  display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap;
  flex-direction: column; align-items: center;
}

.splash-admin-row {
  display: flex; gap: .75rem; flex-wrap: wrap; justify-content: center;
  padding-top: .5rem;
  border-top: 1px solid rgba(196,154,0,.25);
  width: 100%;
}
.splash-admin-row.hidden { display: none !important; }

/* ★ Resume Draft Banner */
.resume-draft-banner {
  width: 100%;
  max-width: 560px;
  margin: 1rem auto 0;
  animation: slideIn .4s ease;
}
.resume-draft-banner.hidden { display: none !important; }
.resume-draft-inner {
  display: flex;
  align-items: center;
  gap: .85rem;
  background: linear-gradient(135deg, #FFF7E0, #FFFBE6);
  border: 2px solid #F5C518;
  border-radius: 14px;
  padding: .9rem 1.2rem;
  box-shadow: 0 4px 18px rgba(245,197,24,.22);
}
.resume-draft-icon {
  font-size: 2rem;
  flex-shrink: 0;
}
.resume-draft-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: .15rem;
}
.resume-draft-text strong {
  font-size: .95rem;
  color: #1a1a1a;
}
.resume-draft-text span {
  font-size: .8rem;
  color: #6B7280;
}
.resume-draft-actions {
  display: flex;
  gap: .5rem;
  flex-shrink: 0;
}
.btn-resume-continue {
  background: linear-gradient(135deg, #10B981, #059669);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: .5rem 1rem;
  font-size: .82rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: .35rem;
  transition: transform .15s, box-shadow .15s;
  font-family: var(--font);
}
.btn-resume-continue:hover { transform: scale(1.04); box-shadow: 0 4px 12px rgba(16,185,129,.3); }
.btn-resume-discard {
  background: transparent;
  color: #EF4444;
  border: 1.5px solid #EF4444;
  border-radius: 10px;
  padding: .5rem .85rem;
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: .35rem;
  transition: background .15s, color .15s;
  font-family: var(--font);
}
.btn-resume-discard:hover { background: #EF4444; color: #fff; }
@media(max-width:540px) {
  .resume-draft-inner { flex-direction: column; text-align: center; }
  .resume-draft-actions { justify-content: center; }
}

/* Splash layout sections */
.splash-main-btns {
  display: flex; gap: .85rem; flex-wrap: wrap; justify-content: center;
}
.splash-modules-row {
  width: 100%; display: flex; justify-content: center; padding: .25rem 0;
}

/* Therapeutic Programs module link button */
.btn-start-tp {
  display: flex; align-items: center; gap: .85rem;
  background: linear-gradient(135deg, rgba(124,58,237,.18), rgba(16,185,129,.12));
  border: 1.5px solid rgba(124,58,237,.4) !important;
  border-radius: 14px !important;
  color: #E9D5FF !important;
  padding: .75rem 1.5rem !important;
  text-decoration: none; cursor: pointer;
  font-family: 'Cairo', sans-serif; font-weight: 700;
  min-width: 280px; max-width: 380px;
  transition: all .25s;
  position: relative; overflow: hidden;
}
.btn-start-tp::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(124,58,237,.08), rgba(16,185,129,.06));
  opacity: 0; transition: opacity .25s;
}
.btn-start-tp:hover {
  border-color: rgba(124,58,237,.7) !important;
  box-shadow: 0 6px 28px rgba(124,58,237,.35), 0 0 0 1px rgba(124,58,237,.2);
  transform: translateY(-2px);
  color: #F3E8FF !important;
}
.btn-start-tp:hover::before { opacity: 1; }
.btn-start-tp > i:first-child {
  font-size: 1.3rem; color: #A78BFA; flex-shrink: 0;
}
.btn-start-tp-text { flex: 1; text-align: right; line-height: 1.3; }
.btn-start-tp-main { display: block; font-size: .95rem; font-weight: 800; color: #E9D5FF; }
.btn-start-tp-sub  { display: block; font-size: .72rem; color: #A78BFA; font-weight: 500; margin-top: .1rem; }
.btn-start-tp-arrow { font-size: .72rem; color: #7C3AED; flex-shrink: 0; }

.btn-start-admin {
  background: rgba(79,70,229,.15) !important;
  border: 1px solid rgba(79,70,229,.35) !important;
  color: #A5B4FC !important;
  font-size: .85rem !important;
  padding: .55rem 1.1rem !important;
}
.btn-start-admin:hover {
  background: rgba(79,70,229,.3) !important;
  border-color: rgba(79,70,229,.6) !important;
  color: #C7D2FE !important;
  transform: translateY(-2px);
}
.btn-start-admin i { margin-left: .4rem; }

/* ===========================
   MODULE CARDS GRID (Landing Page)
   =========================== */
.modules-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  width: 100%;
  max-width: 1140px;
  margin: 1.25rem auto 0;
  padding: .5rem 1.5rem 1.5rem;
  animation: fadeInUp .7s ease forwards;
  align-items: stretch;
}

/* Base card */
.module-card {
  background: #FFFFFF;
  border-radius: 20px;
  border: 1.5px solid #EDE8D0;
  box-shadow: 0 4px 20px rgba(196,154,0,.10), 0 1px 4px rgba(0,0,0,.05);
  padding: 1.75rem 1.75rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: .9rem;
  cursor: default;
  transition: transform .25s, box-shadow .25s;
  position: relative;
  overflow: hidden;
  min-height: 260px;
}
.module-card::after {
  content: ''; position: absolute; top: 0; right: 0; left: 0; height: 4px;
  border-radius: 20px 20px 0 0;
}
.module-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 36px rgba(196,154,0,.18), 0 2px 8px rgba(0,0,0,.06);
}

/* Card color strips */
.module-card--clinic::after  { background: linear-gradient(90deg, #E6B800, #F5C518); }
.module-card--therapy::after { background: linear-gradient(90deg, #7C3AED, #A78BFA); }
.module-card--control::after { background: linear-gradient(90deg, #DC2626, #EF4444); }

/* Icon wrap */
.module-card__icon-wrap {
  width: 56px; height: 56px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; flex-shrink: 0;
}
.module-card__icon-wrap--clinic  { background: #FFFBEA; color: #C49A00; border: 1.5px solid #F5E076; }
.module-card__icon-wrap--therapy { background: #F5F0FF; color: #7C3AED; border: 1.5px solid #DDD6FE; }
.module-card__icon-wrap--control { background: #FFF0F0; color: #DC2626; border: 1.5px solid #FECACA; }

/* Card body */
.module-card__body { flex: 1; }
.module-card__title {
  font-size: 1.05rem; font-weight: 900; color: #1A1A1A; margin-bottom: .35rem;
}
.module-card__desc {
  font-size: .82rem; color: #666; line-height: 1.55;
  margin-bottom: .65rem;
}

/* Tags */
.module-card__tags { display: flex; flex-wrap: wrap; gap: .4rem; }
.module-tag {
  font-size: .7rem; font-weight: 700; border-radius: 20px;
  padding: .18rem .6rem; border: 1px solid transparent;
}
.module-tag--gold   { background: #FFFBEA; color: #92660A; border-color: #F5E076; }
.module-tag--blue   { background: #EFF6FF; color: #1D4ED8; border-color: #BFDBFE; }
.module-tag--purple { background: #F5F0FF; color: #6D28D9; border-color: #DDD6FE; }
.module-tag--green  { background: #F0FDF4; color: #166534; border-color: #BBF7D0; }
.module-tag--red    { background: #FFF0F0; color: #991B1B; border-color: #FECACA; }

/* Card actions */
.module-card__actions {
  display: flex; gap: .6rem; flex-wrap: wrap;
  padding-top: .85rem; border-top: 1px solid #F0EDD5;
}
.module-card__actions--wrap { gap: .5rem; }

/* Module buttons */
.module-btn {
  display: inline-flex; align-items: center; gap: .4rem;
  border-radius: 10px; cursor: pointer;
  font-family: 'Cairo', sans-serif; font-size: .85rem; font-weight: 700;
  padding: .55rem 1.1rem; transition: all .2s;
  text-decoration: none; border: 1.5px solid transparent;
}
.module-btn--primary {
  background: linear-gradient(135deg, #E6B800, #C49A00);
  color: #fff; border-color: #C49A00;
  box-shadow: 0 3px 12px rgba(230,184,0,.3);
}
.module-btn--primary:hover {
  box-shadow: 0 6px 20px rgba(230,184,0,.45);
  transform: translateY(-1px);
  color: #fff;
}
.module-btn--outline {
  background: #FAFAF5; color: #92660A;
  border-color: #E0D890;
}
.module-btn--outline:hover {
  background: #FFFBEA; border-color: #E6B800;
  color: #7A5500;
}
.module-btn--sm {
  font-size: .77rem; padding: .4rem .8rem;
}

/* therapy card: purple button tint */
.module-card--therapy .module-btn--primary {
  background: linear-gradient(135deg, #7C3AED, #6D28D9);
  border-color: #6D28D9;
  box-shadow: 0 3px 12px rgba(124,58,237,.3);
}
.module-card--therapy .module-btn--primary:hover {
  box-shadow: 0 6px 20px rgba(124,58,237,.45);
}
.module-card--therapy .module-card__actions { border-top-color: #EDE8FF; }

/* control card: muted button */
.module-card--control .module-btn--outline {
  background: #FFF5F5; color: #991B1B; border-color: #FECACA;
}
.module-card--control .module-btn--outline:hover {
  background: #FEE2E2; border-color: #FCA5A5;
}
.module-card--control .module-card__actions { border-top-color: #FEE2E2; }

/* Splash desc: hide original subtitle row if modules are visible */
.modules-visible .splash-desc { margin-bottom: 1.25rem; }

/* Responsive: 2-column on medium, 1-column on small */
@media (max-width: 860px) {
  .modules-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.1rem;
    padding: .5rem 1rem 1.5rem;
  }
}
@media (max-width: 560px) {
  .modules-grid {
    grid-template-columns: 1fr;
    gap: .9rem;
    padding: .5rem .75rem 1.25rem;
    max-width: 100%;
  }
  .module-card { min-height: auto; }
}

/* Keep old .splash-btns in case something else uses it */
.splash-btns { display: none; }
@media print {
  #page-intro { display: none !important; }
}

/* ===========================
   COPYRIGHT FOOTER BAR
   =========================== */
.copyright-bar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 8888;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 6px 20px;
  background: linear-gradient(90deg, #C49A00 0%, #E6B800 50%, #C49A00 100%);
  box-shadow: 0 -2px 12px rgba(0,0,0,.12);
  direction: rtl;
}

.copyright-bar-logo {
  width: 56px;
  height: 36px;
  object-fit: contain;
  border-radius: 0;
  flex-shrink: 0;
  mix-blend-mode: multiply;
}

.copyright-bar-text {
  font-family: 'Cairo', sans-serif;
  font-size: .78rem;
  font-weight: 700;
  color: #FFFFFF;
  letter-spacing: .5px;
  text-shadow: 0 1px 3px rgba(0,0,0,.2);
  white-space: nowrap;
}

/* ============================================================
   CHARACTER ILLUSTRATIONS
   Rounded-triangle SVG characters throughout the app
   ============================================================ */

/* ── SPLASH: faint background characters ── */
.splash-bg-char {
  position: absolute;
  pointer-events: none;
  z-index: 0;
  opacity: .052;
}
.splash-bg-char svg { display: block; }
.splash-bg-char--1 { top: 3%; right: 2%; width: 110px; }
.splash-bg-char--2 { bottom: 13%; left: 2%; width: 88px; }
.splash-bg-char--3 { top: 36%; left: 0%;  width: 72px; }

/* ── SPLASH: character strip ── */
.splash-char-strip {
  display: flex;
  gap: .8rem;
  justify-content: center;
  align-items: flex-end;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.scs-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .3rem;
  animation: scsFloat var(--d, 1.1s) ease-in-out var(--dl, 0s) infinite alternate;
}
@keyframes scsFloat {
  0%   { transform: translateY(0); }
  100% { transform: translateY(-8px); }
}

.scs-bubble {
  width: 46px; height: 46px;
  border-radius: 50%;
  border: 1.8px solid var(--bc, rgba(230,184,0,.22));
  background: #FFFFF8;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 3px 10px rgba(0,0,0,.07);
  transition: transform .2s, box-shadow .2s;
  cursor: default;
}
.scs-bubble:hover {
  transform: scale(1.18);
  box-shadow: 0 6px 22px rgba(230,184,0,.28);
}
.scs-bubble svg { width: 72%; height: 72%; }
.scs-bubble--lg { width: 54px; height: 54px; }
.scs-bubble--lg svg { width: 74%; height: 74%; }

.scs-item--center .scs-bubble { width: 54px; height: 54px; }
.scs-item--center .scs-bubble svg { width: 74%; height: 74%; }

.scs-lbl {
  font-size: .52rem;
  color: #AAAAAA;
  font-weight: 700;
  white-space: nowrap;
}

/* ── DOMAIN CARDS: watermark character ── */
.domain-card-wm {
  position: absolute;
  bottom: -14px;
  left: -10px;
  width: 90px;
  height: 90px;
  opacity: .07;
  pointer-events: none;
  color: var(--domain-color, #999);
  transition: opacity .3s;
}
.domain-card-wm svg { width: 100%; height: 100%; }
.domain-card:hover .domain-card-wm { opacity: .12; }

/* ── RECORDS EMPTY STATE ── */
.empty-char {
  margin: 0 auto .5rem;
  width: 110px; height: 110px;
  max-width: 110px; max-height: 110px;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.empty-char svg {
  display: block;
  width: 110px !important;
  height: 110px !important;
  max-width: 110px;
  max-height: 110px;
  filter: drop-shadow(0 4px 12px rgba(16,185,129,.2));
  animation: emptyFloat 2.5s ease-in-out infinite alternate;
}
@keyframes emptyFloat {
  0%   { transform: translateY(0)   rotate(0deg); }
  50%  { transform: translateY(-6px) rotate(-1.5deg); }
  100% { transform: translateY(-2px) rotate(1deg); }
}

/* ── RECORDS LOADING STATE ── */
.loading-char {
  margin: 0 auto .2rem;
  width: 90px; height: 90px;
  max-width: 90px; max-height: 90px;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  animation: loadingBounce .7s ease-in-out infinite alternate;
}
.loading-char svg {
  display: block;
  width: 90px !important;
  height: 90px !important;
  max-width: 90px;
  max-height: 90px;
}
@keyframes loadingBounce {
  0%   { transform: translateY(0); }
  100% { transform: translateY(-10px); }
}

.loading-dots {
  display: flex; gap: .35rem; justify-content: center; margin-bottom: .3rem;
}
.loading-dots span {
  display: block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--primary, #E6B800);
  animation: ldPop .55s ease-in-out infinite alternate;
}
.loading-dots span:nth-child(2) { animation-delay: .13s; }
.loading-dots span:nth-child(3) { animation-delay: .26s; }
@keyframes ldPop {
  0%   { opacity: .25; transform: scale(.65); }
  100% { opacity: 1;   transform: scale(1.35); }
}

/* ── RECOMMENDATIONS SECTION: heart character in title ── */
.rec-section-char {
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
  width: 38px; height: 38px;
  margin-right: .5rem;
  margin-bottom: -.3rem;
  opacity: .85;
  filter: drop-shadow(0 2px 6px rgba(239,68,68,.3));
  animation: recCharPulse 2.8s ease-in-out infinite alternate;
}
.rec-section-char svg { width: 100%; height: 100%; }
@keyframes recCharPulse {
  0%   { transform: scale(1)    rotate(0deg); }
  50%  { transform: scale(1.08) rotate(-3deg); }
  100% { transform: scale(1.04) rotate(2deg); }
}

/* Keep loading-spinner as fallback (hidden if char present) */
.loading-spinner {
  width: 36px; height: 36px;
  border: 3px solid rgba(230,184,0,.2);
  border-top-color: var(--primary, #E6B800);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

/* ============================================================
   ROLES MANAGEMENT PANEL STYLES
   إدارة الصلاحيات
   ============================================================ */

#roles-mgmt-panel {
  position: fixed; inset: 0; z-index: 10400;
  background: rgba(0,0,0,.45);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 2rem 1rem;
  overflow-y: auto;
}
#roles-mgmt-panel.hidden { display: none !important; }
#roles-mgmt-panel .umgmt-box {
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
}

/* ── Role card in list ── */
.role-card {
  background: #fff;
  border: 1.5px solid #E8E8E8;
  border-radius: 12px;
  padding: 1rem 1.1rem;
  margin-bottom: .85rem;
  transition: box-shadow .2s;
}
.role-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.08); }

.role-card-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.role-card-info {
  display: flex; align-items: center; gap: .6rem;
  flex: 1; min-width: 0;
}
.role-color-dot {
  width: 14px; height: 14px;
  border-radius: 50%; flex-shrink: 0;
  box-shadow: 0 0 0 3px rgba(0,0,0,.06);
}
.role-card-name {
  font-weight: 700; font-size: .92rem; color: #1A1A1A;
}
.role-card-slug {
  font-size: .72rem; color: #9CA3AF; direction: ltr; text-align: right;
}
.role-card-meta {
  display: flex; flex-direction: column; gap: .25rem; align-items: flex-end;
  min-width: 100px;
}
.role-perm-count {
  font-size: .72rem; color: #6B7280; white-space: nowrap;
}
.role-perm-bar {
  width: 80px; height: 5px;
  background: #E8E8E8; border-radius: 3px; overflow: hidden;
}
.role-perm-fill {
  height: 100%; border-radius: 3px;
  transition: width .4s ease;
}
.role-card-actions {
  display: flex; gap: .4rem;
}

/* ── Permission chips ── */
.role-perms-preview {
  display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .6rem;
}
.perm-chip {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .22rem .55rem; border-radius: 20px;
  font-size: .7rem; font-weight: 600;
  transition: all .15s;
}
.perm-chip i { font-size: .68rem; }
.perm-chip--on {
  background: #ECFDF5; color: #059669;
  border: 1px solid #A7F3D0;
}
.perm-chip--off {
  background: #F5F5F5; color: #BDBDBD;
  border: 1px solid #E8E8E8;
}

/* ── Permission checkbox grid ── */
.roles-perms-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: .5rem;
}
.perm-label {
  display: flex; align-items: center; gap: .5rem;
  padding: .4rem .6rem;
  background: #F9FAFB; border: 1px solid #E8E8E8; border-radius: 8px;
  cursor: pointer; font-size: .8rem; color: #374151;
  transition: background .15s, border-color .15s;
}
.perm-label:hover { background: #FFF9EC; border-color: #F5E076; }
.perm-label input[type="checkbox"] {
  accent-color: #C49A00; width: 15px; height: 15px; flex-shrink: 0;
}
.perm-label-text i { color: #C49A00; margin-left: .3rem; font-size: .76rem; }

/* ── Roles panel states ── */
.roles-loading, .roles-error, .roles-empty {
  text-align: center; padding: 2rem; color: #9CA3AF; font-size: .88rem;
}
.roles-error { color: #EF4444; }

