/* ================= DESIGN TOKENS ================= */
:root {
  /* Brand */
  --brand: #6366f1;
  --brand-600: #4f46e5;
  --brand-50: #eef2ff;
  --accent: #f59e0b;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --info: #0ea5e9;

  /* Neutrals */
  --bg: #f5f6fa;
  --surface: #ffffff;
  --surface-2: #fafbfc;
  --border: #e5e7eb;
  --border-strong: #d1d5db;
  --text: #0f172a;
  --text-muted: #64748b;
  --text-soft: #94a3b8;

  /* Skills palette (used everywhere) */
  --skill-visual: #6366f1;
  --skill-audio: #14b8a6;
  --skill-motor: #f59e0b;
  --skill-memory: #ec4899;
  --skill-attention: #8b5cf6;
  --skill-logic: #0ea5e9;

  /* Sizing */
  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 2px rgba(15,23,42,.06), 0 1px 3px rgba(15,23,42,.04);
  --shadow: 0 4px 14px rgba(15,23,42,.06), 0 2px 4px rgba(15,23,42,.04);
  --shadow-lg: 0 12px 32px rgba(15,23,42,.08), 0 4px 12px rgba(15,23,42,.06);
  --sidebar-w: 260px;

  --ease: cubic-bezier(.2,.8,.2,1);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Tajawal', 'Cairo', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.55;
  min-height: 100vh;
}
h1,h2,h3,h4 { font-family: 'Cairo', 'Tajawal', sans-serif; margin:0; font-weight: 700; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, select, textarea { font-family: inherit; font-size: 14px; }
.hidden { display: none !important; }

/* ================= LAYOUT ================= */
.sidebar {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--surface);
  border-left: 1px solid var(--border);
  display: flex; flex-direction: column;
  padding: 22px 16px 16px;
  z-index: 40;
  transition: transform .3s var(--ease);
}
.main {
  margin-right: var(--sidebar-w);
  min-height: 100vh;
}
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 14px;
  padding: 14px 28px;
  background: rgba(255,255,255,.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.view { padding: 24px 28px 48px; }

/* ================= BRAND & NAV ================= */
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px 22px; }
.brand-logo {
  width: 44px; height: 44px; border-radius: 12px;
  background: linear-gradient(135deg, var(--brand), #a855f7);
  color: #fff; display: grid; place-items: center;
  font-weight: 900; font-size: 22px;
  box-shadow: 0 6px 14px rgba(99,102,241,.35);
}
.brand-text h1 { font-size: 16px; }
.brand-text p { margin: 2px 0 0; font-size: 12px; color: var(--text-muted); }

.nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  font-weight: 500;
  transition: all .15s var(--ease);
}
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active {
  background: var(--brand-50);
  color: var(--brand-600);
  font-weight: 700;
}
.nav-item .icon { font-size: 18px; width: 22px; text-align: center; }

.sidebar-footer { border-top: 1px solid var(--border); padding-top: 12px; }
.teacher-card {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: var(--radius-sm);
  background: var(--surface-2);
}
.teacher-card strong { display: block; font-size: 13px; }
.teacher-card span { font-size: 11px; color: var(--text-muted); }
.avatar {
  width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center;
  color: #fff; font-weight: 700; font-size: 13px;
  flex-shrink: 0;
}

/* ================= TOPBAR ================= */
.icon-btn {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: var(--surface-2);
  display: grid; place-items: center;
  font-size: 18px;
  color: var(--text-muted);
  position: relative;
  transition: all .15s var(--ease);
}
.icon-btn:hover { background: var(--brand-50); color: var(--brand); }
.icon-btn .dot {
  position: absolute; top: 8px; left: 10px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--danger); border: 2px solid var(--surface-2);
}
.search {
  flex: 1; max-width: 520px;
  position: relative;
  display: flex; align-items: center;
  background: var(--surface-2);
  border-radius: 12px;
  padding: 0 14px;
  border: 1px solid transparent;
  transition: all .15s var(--ease);
}
.search:focus-within { border-color: var(--brand); background: #fff; box-shadow: 0 0 0 3px var(--brand-50); }
.search span { color: var(--text-soft); margin-left: 8px; }
.search input {
  flex: 1; border: none; background: transparent; outline: none;
  padding: 10px 0; font-size: 14px;
}
.topbar-actions { display: flex; gap: 10px; align-items: center; margin-right: auto; }

/* ================= BUTTONS ================= */
.btn-primary, .btn-secondary, .btn-ghost, .btn-danger {
  padding: 10px 18px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 14px;
  transition: all .15s var(--ease);
  display: inline-flex; align-items: center; gap: 8px;
  white-space: nowrap;
}
.btn-primary {
  background: var(--brand); color: #fff;
  box-shadow: 0 4px 12px rgba(99,102,241,.3);
}
.btn-primary:hover { background: var(--brand-600); transform: translateY(-1px); }
.btn-secondary {
  background: var(--surface-2); color: var(--text); border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--brand-50); color: var(--brand-600); border-color: var(--brand); }
.btn-ghost { color: var(--text-muted); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-danger { background: #fee2e2; color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-sm { padding: 6px 12px; font-size: 12px; }

/* ================= CARDS ================= */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  padding: 20px;
}
.card-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 16px;
}
.card-head h3 { font-size: 16px; }
.card-head .actions { display: flex; gap: 8px; }

.page-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 20px; flex-wrap: wrap; gap: 12px;
}
.page-head h2 { font-size: 22px; }
.page-head p { margin: 4px 0 0; color: var(--text-muted); font-size: 13px; }

/* ================= KPI GRID ================= */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 22px;
}
.kpi {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px;
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}
.kpi::before {
  content: ''; position: absolute; top: 0; right: 0; width: 4px; height: 100%;
  background: var(--brand);
}
.kpi.k-green::before { background: var(--success); }
.kpi.k-orange::before { background: var(--warning); }
.kpi.k-pink::before { background: var(--skill-memory); }
.kpi .label { font-size: 12px; color: var(--text-muted); font-weight: 600; }
.kpi .value { font-size: 28px; font-weight: 900; margin: 6px 0; font-family: 'Cairo'; }
.kpi .trend { font-size: 12px; color: var(--success); font-weight: 700; }
.kpi .trend.down { color: var(--danger); }
.kpi .icon-big { position: absolute; left: 16px; top: 16px; font-size: 28px; opacity: .15; }

/* ================= GRIDS ================= */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.grid-12 { display: grid; grid-template-columns: 1.8fr 1fr; gap: 16px; }
@media (max-width: 900px) {
  .grid-2, .grid-12 { grid-template-columns: 1fr; }
}

/* ================= TABLES ================= */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 12px 10px; text-align: right; font-size: 13px; }
.table thead th {
  font-weight: 700; color: var(--text-muted); font-size: 12px;
  border-bottom: 1px solid var(--border); background: var(--surface-2);
}
.table tbody tr { border-bottom: 1px solid var(--border); transition: background .15s; }
.table tbody tr:hover { background: var(--brand-50); }
.table tbody tr:last-child { border: none; }

/* ================= BADGES ================= */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 20px;
  font-size: 11px; font-weight: 700;
  background: var(--surface-2); color: var(--text-muted);
}
.badge.success { background: #d1fae5; color: #065f46; }
.badge.warning { background: #fef3c7; color: #92400e; }
.badge.danger { background: #fee2e2; color: #991b1b; }
.badge.info { background: #dbeafe; color: #1e40af; }
.badge.brand { background: var(--brand-50); color: var(--brand-600); }

/* ================= SKILL CHIP ================= */
.skill-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 20px;
  font-size: 11px; font-weight: 700;
  color: #fff;
}
.skill-chip.visual { background: var(--skill-visual); }
.skill-chip.audio { background: var(--skill-audio); }
.skill-chip.motor { background: var(--skill-motor); }
.skill-chip.memory { background: var(--skill-memory); }
.skill-chip.attention { background: var(--skill-attention); }
.skill-chip.logic { background: var(--skill-logic); }

/* ================= PROGRESS BAR ================= */
.progress {
  width: 100%; height: 8px; background: var(--border);
  border-radius: 20px; overflow: hidden;
}
.progress > span {
  display: block; height: 100%;
  background: linear-gradient(90deg, var(--brand), #a855f7);
  border-radius: 20px;
  transition: width .5s var(--ease);
}
.progress.success > span { background: linear-gradient(90deg, var(--success), #6ee7b7); }
.progress.warning > span { background: linear-gradient(90deg, var(--warning), #fcd34d); }

/* ================= GAMES CARDS ================= */
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}
.game-card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: all .2s var(--ease);
  cursor: pointer;
  display: flex; flex-direction: column;
}
.game-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--brand); }
.game-cover {
  height: 120px;
  display: grid; place-items: center;
  font-size: 56px;
  position: relative;
  color: #fff;
}
.game-cover::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent, rgba(0,0,0,.25));
}
.game-body { padding: 14px 16px; flex: 1; }
.game-body h4 { font-size: 15px; margin-bottom: 4px; }
.game-body p { margin: 0; color: var(--text-muted); font-size: 12px; min-height: 36px; }
.game-meta { padding: 10px 16px; border-top: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.game-meta .skills { display: flex; gap: 4px; flex-wrap: wrap; }

/* ================= GROUPS ================= */
.groups-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
}
.group-card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 18px;
  transition: all .2s;
}
.group-card:hover { box-shadow: var(--shadow); }
.group-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 12px;
}
.group-header h4 { font-size: 16px; margin-bottom: 2px; }
.group-header p { font-size: 12px; color: var(--text-muted); margin: 0; }
.group-color {
  width: 14px; height: 40px; border-radius: 8px; flex-shrink: 0;
}
.avatars { display: flex; margin-bottom: 12px; }
.avatars .avatar {
  width: 32px; height: 32px; font-size: 11px;
  margin-left: -10px; border: 2px solid var(--surface);
}
.avatars .more {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--surface-2); color: var(--text-muted);
  display: grid; place-items: center;
  font-size: 11px; font-weight: 700; border: 2px solid var(--surface);
  margin-left: -10px;
}

/* ================= MODAL ================= */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(15,23,42,.5);
  backdrop-filter: blur(4px);
  display: grid; place-items: center;
  z-index: 100;
  padding: 20px;
}
.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  max-width: 640px; width: 100%;
  max-height: 85vh; overflow: auto;
  box-shadow: var(--shadow-lg);
  padding: 24px;
  animation: popin .25s var(--ease);
}
.modal.lg { max-width: 920px; }
.modal-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 16px;
}
.modal-head h3 { font-size: 18px; }
.close-btn {
  width: 34px; height: 34px; border-radius: 10px;
  background: var(--surface-2); font-size: 18px;
}
.close-btn:hover { background: var(--danger); color: #fff; }

@keyframes popin {
  from { transform: scale(.95) translateY(10px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}

/* ================= FORM ================= */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12px; font-weight: 700; color: var(--text-muted); margin-bottom: 6px; }
.field input[type="text"],
.field input[type="number"],
.field input[type="date"],
.field select,
.field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  outline: none;
  transition: all .15s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-50);
}
.field textarea { min-height: 90px; resize: vertical; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* Chips selector */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  padding: 6px 12px;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  background: #fff;
  cursor: pointer;
  transition: all .15s;
}
.chip:hover { border-color: var(--brand); color: var(--brand); }
.chip.active {
  background: var(--brand); color: #fff; border-color: var(--brand);
}

/* ================= TOAST ================= */
.toast {
  position: fixed; bottom: 24px; left: 50%;
  transform: translateX(-50%);
  background: var(--text); color: #fff;
  padding: 12px 20px; border-radius: 12px;
  box-shadow: var(--shadow-lg);
  font-weight: 600;
  z-index: 200;
  animation: slideup .3s var(--ease);
}
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
@keyframes slideup {
  from { transform: translate(-50%, 20px); opacity: 0; }
  to { transform: translate(-50%, 0); opacity: 1; }
}

/* ================= FILTERS BAR ================= */
.filters {
  display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
  padding: 14px; background: var(--surface);
  border-radius: var(--radius); border: 1px solid var(--border);
  margin-bottom: 18px;
}

/* ================= DIFFICULTY DOTS ================= */
.diff { display: inline-flex; gap: 3px; }
.diff span { width: 8px; height: 8px; border-radius: 50%; background: var(--border); }
.diff span.on { background: var(--accent); }

/* ================= RADAR CONTAINER ================= */
.chart-wrap { position: relative; height: 280px; }
.chart-wrap.sm { height: 200px; }

/* ================= SESSION LOBBY ================= */
.join-code {
  background: linear-gradient(135deg, var(--brand), #a855f7);
  color: #fff; padding: 30px;
  border-radius: var(--radius-lg); text-align: center;
}
.join-code .code {
  font-family: 'Cairo'; font-size: 48px; font-weight: 900;
  letter-spacing: 8px; margin: 12px 0;
  direction: ltr;
}

/* ================= RESPONSIVE ================= */
@media (max-width: 900px) {
  :root { --sidebar-w: 240px; }
  .sidebar { transform: translateX(100%); }
  .sidebar.open { transform: translateX(0); box-shadow: -10px 0 40px rgba(0,0,0,.2); }
  .main { margin-right: 0; }
  .view { padding: 16px; }
  .topbar { padding: 12px 16px; }
}

/* ================= MISC ================= */
.empty-state {
  text-align: center; padding: 60px 20px;
  color: var(--text-muted);
}
.empty-state .big { font-size: 64px; opacity: .4; }

.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; gap: 10px; align-items: center; }
.spacer { flex: 1; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; }

/* ================= GAME OVERLAY ================= */
.game-overlay {
  position: fixed; inset: 0; z-index: 9000;
  background: #0b1020; display: flex; flex-direction: column;
}
.game-overlay.hidden { display: none; }
.game-overlay-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px; background: linear-gradient(135deg,#1e293b,#0f172a);
  color: #fff; box-shadow: 0 2px 10px rgba(0,0,0,.3);
}
.go-ctx { font-weight: 800; font-size: 15px; }
.go-actions { display: flex; gap: 8px; }
.go-actions .icon-btn { background: rgba(255,255,255,.1); color: #fff;
  border: none; width: 36px; height: 36px; border-radius: 10px;
  font-size: 18px; cursor: pointer; transition: all .15s; }
.go-actions .icon-btn:hover { background: rgba(255,255,255,.2); }
#gameFrame {
  flex: 1; width: 100%; border: 0; background: #fff;
}

/* ================= ZAYAT BATTERIES ================= */
.z-item {
  background: #fff; border: 1px solid #e5e7eb; border-radius: 12px;
  padding: 14px; margin-bottom: 10px; transition: all .2s;
  display: grid; grid-template-columns: 40px 1fr; gap: 12px;
}
.z-item.z-answered { border-color: #10b981; background: #f0fdf4; }
.z-item-num {
  width: 40px; height: 40px; border-radius: 50%;
  background: #6366f1; color: #fff; display: grid; place-items: center;
  font-weight: 900; font-size: 18px;
}
.z-item-text { font-size: 15px; line-height: 1.6; grid-column: 2; }
.z-item-rates {
  grid-column: 2; display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px;
}
.z-rate {
  padding: 8px 14px; border: 2px solid #e5e7eb; border-radius: 10px;
  background: #fff; cursor: pointer; font-family: inherit;
  font-size: 13px; font-weight: 700; transition: all .15s;
  display: flex; align-items: center; gap: 4px;
}
.z-rate:hover { border-color: #6366f1; transform: translateY(-1px); }
.z-rate.active { background: #6366f1; color: #fff; border-color: #6366f1; }
.z-rate-val { font-size: 11px; opacity: 0.7; }
.z-rate.active .z-rate-val { opacity: 1; }

/* ================= TABS ================= */
.tab-btn {
  padding: 10px 16px; border: none; background: transparent;
  font-family: inherit; font-size: 14px; font-weight: 700;
  color: var(--text-muted); cursor: pointer;
  border-bottom: 3px solid transparent; transition: all .15s;
}
.tab-btn:hover { color: #6366f1; }
.tab-btn.active { color: #6366f1; border-bottom-color: #6366f1; }

/* ================= BUILDER STEPPER ================= */
.builder-steps { display: flex; gap: 10px; align-items: center; }
.bstep {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  gap: 6px; padding: 8px; opacity: 0.4; transition: opacity .2s;
}
.bstep.active { opacity: 1; }
.bstep-num {
  width: 40px; height: 40px; border-radius: 50%;
  background: #e5e7eb; color: #6b7280; display: grid; place-items: center;
  font-weight: 900; font-size: 18px;
}
.bstep.active .bstep-num { background: #6366f1; color: #fff; }
.bstep.current .bstep-num {
  background: #6366f1; color: #fff;
  box-shadow: 0 0 0 4px rgba(99,102,241,.2);
}
.bstep-label { font-size: 12px; font-weight: 700; color: var(--text-muted); }
.bstep.active .bstep-label { color: #6366f1; }

.builder-type-card {
  border: 2px solid transparent; transition: all .15s;
}
.builder-type-card:hover {
  transform: translateY(-2px); box-shadow: var(--shadow-lg);
}
.builder-type-card.selected {
  border-color: #6366f1; background: #f0f4ff;
}

.builder-skill-row {
  padding: 10px 12px; border-radius: 8px; cursor: pointer;
  transition: all .15s; margin-bottom: 4px;
  border: 2px solid transparent;
}
.builder-skill-row:hover { background: #f3f4f6; }
.builder-skill-row.selected {
  background: #f0f4ff; border-color: #6366f1;
}

/* ================= REPORTS ================= */
.kpi-mini {
  background: linear-gradient(135deg,#f9fafb,#f3f4f6);
  border-radius: 10px; padding: 14px; text-align: center;
}
.kpi-num { font-size: 32px; font-weight: 900; line-height: 1; }
.kpi-lbl { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

.report-preview {
  background: #f3f4f6; padding: 20px; border-radius: 12px;
  max-height: 80vh; overflow-y: auto;
}

.rep-page {
  background: white; padding: 36px;
  box-shadow: 0 2px 8px rgba(0,0,0,.08); border-radius: 8px;
  max-width: 800px; margin: 0 auto;
  font-family: 'Tajawal', 'Cairo', sans-serif;
}

.rep-header { border-bottom: 3px double #6366f1; padding-bottom: 16px; margin-bottom: 20px; }
.rep-brand { display: flex; align-items: center; gap: 14px; }
.rep-logo {
  width: 60px; height: 60px; border-radius: 50%;
  background: linear-gradient(135deg,#6366f1,#8b5cf6);
  color: white; display: grid; place-items: center;
  font-weight: 900; font-size: 14px; letter-spacing: -0.5px;
}
.rep-info-grid {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px 14px;
  font-size: 14px; padding: 12px; background: #f9fafb; border-radius: 8px;
}

.rep-section {
  margin: 24px 0; padding-top: 14px; border-top: 1px solid #e5e7eb;
  page-break-inside: avoid;
}
.rep-section h3 {
  color: #6366f1; margin: 0 0 10px;
  display: flex; align-items: center; gap: 8px;
}

.rep-cite {
  font-size: 12px; color: #666; font-style: italic;
  margin: 0 0 10px; padding: 6px 10px;
  background: #f0f9ff; border-right: 3px solid #0ea5e9; border-radius: 4px;
}

.rep-summary-grid {
  display: grid; grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 10px; margin: 14px 0;
}
.rep-summary-card {
  background: white; border: 2px solid #e5e7eb;
  border-radius: 10px; padding: 12px; text-align: center;
}
.rep-summary-icon { font-size: 28px; }
.rep-summary-label { font-size: 11px; color: #666; margin: 4px 0; }
.rep-summary-value { font-size: 14px; font-weight: 900; }

.rep-callout {
  background: #fef3c7; border: 1px solid #fcd34d;
  padding: 12px 14px; border-radius: 8px; margin: 12px 0;
  font-size: 13px;
}
.rep-callout ul, .rep-callout ol { margin: 6px 0 0; padding-right: 18px; }
.rep-callout li { margin: 3px 0; }

.rep-table {
  width: 100%; border-collapse: collapse; margin: 10px 0; font-size: 13px;
}
.rep-table th, .rep-table td {
  padding: 8px 10px; border-bottom: 1px solid #e5e7eb; text-align: right;
}
.rep-table th { background: #f3f4f6; font-weight: 700; color: #374151; }
.rep-table tbody tr:nth-child(even) { background: #fafafa; }

.rep-badge {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 700; border: 1px solid;
}

.rep-bar-chart { margin: 14px 0; }
.rep-bar-row {
  display: grid; grid-template-columns: 200px 1fr;
  gap: 10px; margin: 6px 0; align-items: center;
}
.rep-bar-label { font-size: 13px; font-weight: 700; }
.rep-bar-track {
  background: #f3f4f6; border-radius: 999px; height: 22px;
  overflow: hidden; position: relative;
}
.rep-bar-fill {
  height: 100%; display: flex; align-items: center; justify-content: flex-end;
  padding-left: 8px; color: white; font-size: 11px; font-weight: 700;
  transition: width .3s; min-width: 40px;
}

.rep-skill-list, .rep-goals { padding-right: 18px; }
.rep-skill-list li, .rep-goals li { margin: 8px 0; line-height: 1.6; }

.rep-plan-meta {
  display: grid; grid-template-columns: 1fr 1fr 1fr;
  gap: 10px; padding: 12px; background: #f0f9ff;
  border-radius: 8px; font-size: 14px;
}

.rep-footer {
  margin-top: 30px; padding-top: 20px;
  border-top: 2px solid #6366f1;
  page-break-inside: avoid;
}
.rep-footer-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 30px;
  margin-bottom: 20px;
}
.rep-sign-line {
  border-bottom: 1px dashed #999; height: 40px; margin: 14px 0 6px;
}
.rep-footnote {
  font-size: 11px; color: #666; text-align: center;
  background: #f9fafb; padding: 12px; border-radius: 8px;
}
.rep-footnote p { margin: 3px 0; }

/* ============== PRINT STYLES ============== */
@media print {
  body * { visibility: hidden; }
  body.printing-report .rep-page,
  body.printing-report .rep-page * { visibility: visible; }
  body.printing-report .rep-page {
    position: absolute; top: 0; right: 0; width: 100%;
    box-shadow: none; max-width: 100%; margin: 0;
  }
  .rep-section { page-break-inside: avoid; }
}

/* ================= LOGO & HERO ================= */
.brand-logo-img {
  width: 56px !important;
  height: 56px !important;
  max-width: 56px !important;
  max-height: 56px !important;
  min-width: 56px;
  border-radius: 50%;
  object-fit: contain;
  background: white;
  box-shadow: 0 4px 12px rgba(0,0,0,.15);
  border: 3px solid white;
  flex-shrink: 0;
  display: block;
}
/* Safety net for any rogue logo images */
.sidebar img[src*="logo"] {
  max-width: 56px !important;
  max-height: 56px !important;
}
.teacher-card img[src*="logo"] {
  max-width: 36px !important;
  max-height: 36px !important;
}

.hero-banner {
  background: linear-gradient(135deg, #10b981 0%, #6366f1 50%, #f97316 100%);
  border-radius: 20px; padding: 30px;
  color: white; margin-bottom: 24px;
  position: relative; overflow: hidden;
  box-shadow: 0 10px 30px rgba(99, 102, 241, 0.25);
}
.hero-banner::before {
  content: ''; position: absolute;
  top: -50px; right: -50px;
  width: 200px; height: 200px; border-radius: 50%;
  background: rgba(255,255,255,.1);
}
.hero-banner::after {
  content: ''; position: absolute;
  bottom: -80px; left: -80px;
  width: 250px; height: 250px; border-radius: 50%;
  background: rgba(255,255,255,.08);
}
.hero-content { position: relative; z-index: 1; }

.hero-pillars {
  display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px;
}
.pillar {
  background: rgba(255,255,255,.18); backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,.3);
  padding: 8px 16px; border-radius: 999px;
  font-size: 13px; font-weight: 700;
}

/* ================= SKILL TIERS ================= */
.tier-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px; border-radius: 999px;
  font-size: 13px; font-weight: 800; border: 2px solid;
}
.tier-badge.gifted     { background: #fef3c7; color: #92400e; border-color: #fbbf24; }
.tier-badge.advanced   { background: #d1fae5; color: #065f46; border-color: #10b981; }
.tier-badge.on_track   { background: #dbeafe; color: #1e3a8a; border-color: #3b82f6; }
.tier-badge.emerging   { background: #ede9fe; color: #5b21b6; border-color: #8b5cf6; }
.tier-badge.developing { background: #fed7aa; color: #9a3412; border-color: #f97316; }
.tier-badge.building   { background: #fce7f3; color: #831843; border-color: #ec4899; }

@media (max-width: 768px){
  .hero-banner { padding: 20px; }
  .hero-banner h1 { font-size: 22px !important; }
  .hero-pillars { gap: 4px; }
  .pillar { padding: 4px 10px; font-size: 11px; }
}

/* Reports logo */
.rep-logo-img {
  width: 70px; height: 70px; border-radius: 50%;
  object-fit: cover; background: white;
  border: 3px solid #6366f1;
  box-shadow: 0 4px 12px rgba(0,0,0,.1);
}

/* ================= ADAPTIVE TESTING ================= */
.adapt-progress {
  display: flex; gap: 8px; margin: 14px 0; padding: 14px;
  background: #f9fafb; border-radius: 14px;
}
.adapt-step {
  flex: 1; text-align: center; padding: 12px;
  border-radius: 10px; opacity: 0.4;
  transition: all .2s; display: flex; flex-direction: column; gap: 4px;
}
.adapt-step.current {
  opacity: 1; background: #6366f1; color: white;
  transform: scale(1.05); box-shadow: 0 4px 12px rgba(99,102,241,.3);
}
.adapt-step.done {
  opacity: 1; background: #d1fae5; color: #065f46;
}
.adapt-step.pending { opacity: 0.5; }

.btn-success {
  padding: 10px 18px; border: none; border-radius: 10px;
  background: linear-gradient(135deg, #10b981, #059669);
  color: white; font-weight: 700; cursor: pointer;
  font-family: inherit; font-size: 14px;
}
.btn-success:hover { transform: translateY(-1px); box-shadow: 0 4px 10px rgba(16,185,129,.3); }

/* ================= ARABI.PRO INTEGRATION ================= */
.arabi-link-card {
  background: linear-gradient(135deg, #fff8e1 0%, #fff 100%);
  border: 2px solid rgba(247, 201, 72, 0.45);
  border-radius: 14px; padding: 16px;
  margin: 14px 0;
  display: flex; flex-direction: column; gap: 12px;
}
.arabi-content {
  display: flex; align-items: center; gap: 14px;
}
.arabi-logo {
  width: 60px; height: 60px; border-radius: 12px;
  background: linear-gradient(135deg, #0c2d5e, #0c447c);
  display: grid; place-items: center; flex-shrink: 0;
}
.arabi-text { flex: 1; }
.arabi-actions {
  display: flex; gap: 10px; flex-wrap: wrap;
}
.arabi-btn {
  padding: 10px 18px; border: none; border-radius: 10px;
  font-family: 'Tajawal', 'Cairo', sans-serif;
  font-size: 14px; font-weight: 700;
  cursor: pointer; transition: all .2s;
  display: inline-flex; align-items: center; gap: 6px;
}
.arabi-btn.primary {
  background: #f7c948; color: #1a1a18;
  box-shadow: 0 4px 12px rgba(247, 201, 72, 0.3);
}
.arabi-btn.primary:hover { background: #e0a800; transform: translateY(-1px); }
.arabi-btn.secondary {
  background: #0c447c; color: white;
}
.arabi-btn.secondary:hover { background: #185fa5; transform: translateY(-1px); }
