/* ═══════════════════════════════════════════════════════════
   style.css — التصميم الاحترافي
   نسخة عامة | وزارة التعليم | تحليل بيانات الطلاب
═══════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@300;400;500;700;800;900&display=swap');

:root {
  --navy:    #0d3248;
  --navy2:   #1c3f5e;
  --blue:    #2d73b6;
  --teal:    #1aac8e;
  --green:   #198754;
  --bg:      #f0f4fa;
  --card:    #ffffff;
  --border:  #dce4ef;
  --text:    #1a2535;
  --muted:   #6c7a90;
  --sidebar: 260px;
  --topbar:  60px;
  --radius:  12px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Tajawal', Arial, sans-serif;
  direction: rtl;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
}

/* ════════════════════════════════════════════════════
   LANDING PAGE
════════════════════════════════════════════════════ */
#landing {
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── Hero ── */
.hero {
  background: linear-gradient(135deg, #071d2e 0%, var(--navy) 50%, #1a3a5c 100%);
  min-height: 100vh;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 3rem 1.5rem;
  overflow: hidden;
}

.hero-dots {
  position: absolute; inset: 0;
  background-image: radial-gradient(circle, rgba(26,172,142,.18) 1.5px, transparent 1.5px);
  background-size: 30px 30px;
  animation: dotsPulse 8s ease-in-out infinite alternate;
}
@keyframes dotsPulse {
  from { opacity: .4; transform: scale(1); }
  to   { opacity: .8; transform: scale(1.02); }
}

.hero-badge {
  display: inline-flex; align-items: center; gap: .5rem;
  background: rgba(26,172,142,.2); border: 1px solid rgba(26,172,142,.4);
  color: #7ee8d4; border-radius: 50px; padding: .4rem 1.2rem;
  font-size: .85rem; font-weight: 600; margin-bottom: 1.5rem;
  position: relative; z-index: 2;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 900; color: #fff;
  line-height: 1.2; margin-bottom: 1rem;
  position: relative; z-index: 2;
}
.hero h1 span { color: #1aac8e; }

.hero-sub {
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  color: rgba(255,255,255,.75); max-width: 680px;
  margin: 0 auto 2.5rem; position: relative; z-index: 2;
}

.hero-btns { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; position: relative; z-index: 2; }

.btn-hero-primary {
  background: linear-gradient(135deg, var(--teal), #0e8a6e);
  color: #fff; border: none; border-radius: 50px;
  padding: .85rem 2.4rem; font-size: 1.05rem; font-weight: 700;
  cursor: pointer; transition: .25s;
  box-shadow: 0 8px 24px rgba(26,172,142,.4);
  font-family: 'Tajawal', sans-serif;
}
.btn-hero-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 32px rgba(26,172,142,.5); }

.btn-hero-outline {
  background: transparent; color: rgba(255,255,255,.85);
  border: 1.5px solid rgba(255,255,255,.35); border-radius: 50px;
  padding: .85rem 2rem; font-size: 1rem; font-weight: 600;
  cursor: pointer; transition: .25s; font-family: 'Tajawal', sans-serif;
}
.btn-hero-outline:hover { border-color: rgba(255,255,255,.7); color: #fff; }

.hero-privacy {
  position: relative; z-index: 2; margin-top: 2rem;
  color: rgba(255,255,255,.55); font-size: .88rem;
  display: flex; align-items: center; justify-content: center; gap: .4rem;
}

.hero-scroll-down {
  position: absolute; bottom: 2rem; left: 50%; transform: translateX(-50%);
  z-index: 2; color: rgba(255,255,255,.5);
  width: 40px; height: 40px; border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,.25);
  display: flex; align-items: center; justify-content: center;
  font-size: .9rem; text-decoration: none;
  animation: scrollBounce 2s ease-in-out infinite;
  transition: .25s;
}
.hero-scroll-down:hover {
  color: var(--teal); border-color: var(--teal);
  background: rgba(26,172,142,.1);
}
@keyframes scrollBounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50%       { transform: translateX(-50%) translateY(7px); }
}
.hero-privacy i { color: var(--teal); }

/* ── Features ── */
.features-section {
  padding: 5rem 1.5rem;
  background: #fff;
}
.section-title {
  text-align: center; margin-bottom: 3rem;
}
.section-title h2 { font-size: 2rem; font-weight: 800; color: var(--navy); }
.section-title p  { color: var(--muted); font-size: 1.05rem; margin-top: .5rem; }

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem; max-width: 1100px; margin: 0 auto;
}
.feature-card {
  text-align: center; padding: 2rem 1.5rem;
  border: 1px solid var(--border); border-radius: var(--radius);
  transition: .3s; background: var(--bg);
}
.feature-card:hover { transform: translateY(-4px); box-shadow: 0 12px 32px rgba(13,50,72,.1); border-color: var(--teal); }
.feature-icon {
  width: 64px; height: 64px; border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem; margin: 0 auto 1rem;
}
.feature-card h5 { font-weight: 700; color: var(--navy); margin-bottom: .4rem; }
.feature-card p  { color: var(--muted); font-size: .9rem; }

/* ── How it works ── */
.how-section {
  padding: 5rem 1.5rem;
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy2) 100%);
}
.how-section .section-title h2 { color: #fff; }
.how-section .section-title p  { color: rgba(255,255,255,.65); }

.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2rem; max-width: 900px; margin: 0 auto; position: relative;
}
.step-card {
  text-align: center; color: #fff;
}
.step-num {
  width: 56px; height: 56px;
  background: var(--teal); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; font-weight: 900;
  margin: 0 auto 1rem;
}
.step-card h5 { font-weight: 700; margin-bottom: .4rem; }
.step-card p  { color: rgba(255,255,255,.65); font-size: .9rem; }

/* ── Privacy ── */
.privacy-section {
  padding: 4rem 1.5rem; background: #f0faf6;
}
.privacy-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem; max-width: 900px; margin: 0 auto;
}
.privacy-item {
  display: flex; align-items: flex-start; gap: 1rem;
  padding: 1.5rem; background: #fff;
  border-radius: var(--radius); border: 1px solid #c3e6d8;
}
.privacy-item i { font-size: 1.4rem; color: var(--teal); margin-top: .1rem; }
.privacy-item h6 { font-weight: 700; color: var(--navy); margin-bottom: .2rem; }
.privacy-item p  { color: var(--muted); font-size: .88rem; margin: 0; }

/* ── Landing Footer ── */
.landing-footer {
  background: var(--navy); color: rgba(255,255,255,.55);
  padding: 2rem 2rem; font-size: .88rem;
}
.landing-footer a { color: var(--teal); text-decoration: none; }
.landing-footer-inner {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 1rem; max-width: 1100px; margin: 0 auto;
}
.landing-footer-credit {
  display: flex; align-items: center; gap: .5rem;
  color: rgba(255,255,255,.85); font-size: .95rem; font-weight: 600;
  background: rgba(26,172,142,.15); border: 1px solid rgba(26,172,142,.3);
  border-radius: 50px; padding: .5rem 1.2rem; white-space: nowrap;
}
.landing-footer-credit i { color: var(--teal); }
.landing-footer-credit strong { color: #fff; }

/* ════════════════════════════════════════════════════
   APP SHELL
════════════════════════════════════════════════════ */
#app {
  display: flex; height: 100vh; overflow: hidden;
}

/* ── Sidebar ── */
#sidebar {
  width: var(--sidebar); min-width: var(--sidebar);
  background: var(--navy);
  display: flex; flex-direction: column;
  overflow-y: auto; overflow-x: hidden;
  transition: width .3s;
  z-index: 100;
}

.sb-logo {
  padding: 1.2rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,.1);
  display: flex; align-items: center; gap: .75rem;
}
.sb-logo-icon {
  width: 38px; height: 38px; border-radius: 10px;
  background: var(--teal);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 1rem; flex-shrink: 0;
}
.sb-logo-text { color: #fff; font-weight: 800; font-size: .95rem; line-height: 1.2; }
.sb-logo-text small { color: rgba(255,255,255,.5); font-size: .72rem; font-weight: 400; display: block; }

.sb-counts {
  padding: .6rem 1rem;
  background: rgba(255,255,255,.05);
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.sb-stat { color: rgba(255,255,255,.65); font-size: .78rem; margin-bottom: .1rem; }
.sb-stat span { font-weight: 700; color: #fff; }
.sb-stat .text-info    { color: #0dcaf0!important; }
.sb-stat .text-success { color: #1aac8e!important; }

.sb-nav { flex: 1; padding: .75rem 0; }
.nav-link {
  display: flex; align-items: center; gap: .85rem;
  padding: .7rem 1.2rem; color: rgba(255,255,255,.65);
  cursor: pointer; transition: .2s; text-decoration: none;
  border-radius: 0; font-weight: 500; font-size: .9rem;
  border-right: 3px solid transparent;
}
.nav-link i { width: 18px; text-align: center; font-size: .95rem; }
.nav-link:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav-link.active {
  background: rgba(26,172,142,.18);
  color: #fff; border-right-color: var(--teal);
}

.sb-footer {
  padding: 1rem;
  border-top: 1px solid rgba(255,255,255,.1);
}
.btn-clear-sb {
  width: 100%; padding: .6rem; border-radius: 8px;
  background: rgba(220,53,69,.15); color: #ff8fa3;
  border: 1px solid rgba(220,53,69,.3); cursor: pointer;
  font-family: 'Tajawal', sans-serif; font-size: .85rem;
  transition: .2s;
}
.btn-clear-sb:hover { background: rgba(220,53,69,.3); }

/* ── Main Area ── */
#main-area {
  flex: 1; display: flex; flex-direction: column; overflow: hidden;
}

/* ── Top Bar ── */
.topbar {
  height: var(--topbar); min-height: var(--topbar);
  background: var(--card); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 1.5rem; gap: 1rem;
}
.topbar-title {
  font-weight: 700; color: var(--navy); font-size: 1.05rem;
}
.topbar-actions { display: flex; align-items: center; gap: .75rem; }

.btn-print {
  background: none; border: 1px solid var(--border);
  border-radius: 8px; padding: .4rem .9rem;
  color: var(--muted); cursor: pointer; font-size: .85rem;
  transition: .2s; display: flex; align-items: center; gap: .4rem;
  font-family: 'Tajawal', sans-serif;
}
.btn-print:hover { background: var(--bg); color: var(--text); }

#sidebar-toggle {
  display: none; background: none; border: none;
  font-size: 1.2rem; color: var(--navy); cursor: pointer; padding: .3rem;
}

/* ── Content ── */
#content {
  flex: 1; overflow-y: auto; padding: 1.5rem;
}

/* ── App Sections ── */
.app-section { }

.page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1.5rem; flex-wrap: wrap; gap: .75rem;
}
.page-header h4 { font-weight: 800; color: var(--navy); font-size: 1.3rem; margin: 0; }
.page-header small { color: var(--muted); font-size: .85rem; }

/* ── KPI Cards ── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem; margin-bottom: 1.5rem;
}
.kpi-card {
  background: var(--card); border-radius: var(--radius);
  padding: 1.25rem 1rem; text-align: center;
  border: 1px solid var(--border);
  box-shadow: 0 2px 8px rgba(0,0,0,.04);
  transition: .25s;
}
.kpi-card:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0,0,0,.08); }
.kpi-icon {
  width: 48px; height: 48px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; margin: 0 auto .75rem;
}
.kpi-val  { font-size: 1.8rem; font-weight: 900; line-height: 1; margin-bottom: .3rem; }
.kpi-lbl  { color: var(--muted); font-size: .82rem; font-weight: 500; }

/* ── Chart Cards ── */
.chart-card {
  background: var(--card); border-radius: var(--radius);
  padding: .85rem; border: 1px solid var(--border);
  box-shadow: 0 2px 8px rgba(0,0,0,.04); margin-bottom: .75rem;
}
.card-title {
  font-size: .85rem; font-weight: 700; color: var(--navy);
  margin-bottom: .6rem; border-bottom: 2px solid var(--bg);
  padding-bottom: .4rem;
}
.chart-card.mt-3 { margin-top: .75rem; }
.chart-card.mt-2 { margin-top: .75rem; }

.dash-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.dash-grid .span2 { grid-column: 1 / -1; }

.analytics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .75rem;
}
.analytics-grid .span2 { grid-column: span 2; }
.analytics-grid .span3 { grid-column: 1 / -1; }

/* ── Upload ── */
.upload-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; margin-bottom: 1.5rem;
}
.upload-card {
  border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: 0 4px 16px rgba(0,0,0,.06);
}
.upload-card-header {
  padding: 1.5rem; text-align: center; color: #fff;
}
.tarbiya-card .upload-card-header { background: linear-gradient(135deg, #0d3248, #2d73b6); }
.damj-card    .upload-card-header { background: linear-gradient(135deg, #1a5c2a, #1aac8e); }
.upload-card-header h5 { font-weight: 700; margin: .5rem 0 .25rem; }
.count-chip {
  display: inline-block; background: rgba(255,255,255,.2);
  border-radius: 20px; padding: .2rem .8rem; font-size: .82rem;
}
.drop-zone {
  padding: 2rem 1.5rem; text-align: center;
  background: #fff; cursor: pointer;
  border-top: 2px dashed var(--border); transition: .25s;
}
.drop-zone:hover, .drop-zone.drag-over {
  background: #f0faf6; border-color: var(--teal);
}
.drop-zone.has-file { border-color: var(--teal); background: #f0faf6; }
.drop-zone p { color: var(--text); font-weight: 600; margin-bottom: .3rem; }
.file-badge {
  margin-top: .75rem; padding: .35rem .8rem;
  background: #d4edda; border-radius: 20px;
  color: #155724; font-size: .82rem; font-weight: 600; display: inline-block;
}

.import-actions { display: flex; gap: 1rem; margin-bottom: 1.5rem; flex-wrap: wrap; }

.btn-import {
  background: linear-gradient(135deg, var(--teal), #0e8a6e);
  color: #fff; border: none; border-radius: 10px;
  padding: .75rem 2rem; font-size: 1rem; font-weight: 700;
  cursor: pointer; font-family: 'Tajawal', sans-serif;
  transition: .25s; box-shadow: 0 4px 12px rgba(26,172,142,.3);
}
.btn-import:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(26,172,142,.4); }

.btn-clear {
  background: transparent; color: #dc3545;
  border: 1.5px solid #dc3545; border-radius: 10px;
  padding: .75rem 1.5rem; font-size: .95rem; font-weight: 600;
  cursor: pointer; font-family: 'Tajawal', sans-serif; transition: .2s;
}
.btn-clear:hover { background: #dc354510; }

.import-progress { margin-bottom: 1.5rem; }
.prog-track {
  height: 10px; background: var(--border); border-radius: 5px; overflow: hidden;
}
.prog-fill {
  height: 100%; background: linear-gradient(90deg, var(--teal), var(--blue));
  width: 0; border-radius: 5px; transition: width .4s ease;
}

.privacy-note {
  background: #f0faf6; border: 1px solid #c3e6d8;
  border-radius: 10px; padding: 1rem 1.25rem;
  color: #1a5c2a; font-size: .9rem; font-weight: 500;
}

/* ── Noor Landing Section ── */
.noor-landing-section {
  padding: 5rem 1.5rem;
  background: #f8faff;
  border-top: 1px solid var(--border);
}

.noor-landing-steps {
  display: flex; align-items: stretch; justify-content: center;
  gap: 0; max-width: 1000px; margin: 0 auto 2rem;
  flex-wrap: wrap;
}

.noor-landing-step {
  flex: 1; min-width: 220px; max-width: 280px;
  background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.75rem 1.25rem;
  text-align: center; position: relative;
  transition: .3s;
}
.noor-landing-step:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(13,50,72,.1);
  border-color: var(--teal);
}

.nls-num {
  position: absolute; top: -14px; right: 50%; transform: translateX(50%);
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--teal); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: .85rem;
}

.nls-icon {
  width: 60px; height: 60px; border-radius: 16px;
  background: linear-gradient(135deg, var(--navy), var(--navy2));
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; color: var(--teal);
  margin: .5rem auto 1rem;
}

.nls-body h5 { font-weight: 800; color: var(--navy); margin-bottom: .4rem; font-size: 1rem; }
.nls-body p  { color: var(--muted); font-size: .88rem; line-height: 1.6; margin: 0; }

.nls-connector {
  display: flex; align-items: center; justify-content: center;
  color: var(--teal); font-size: 1.3rem; padding: 0 .5rem;
  flex-shrink: 0;
}

.nls-reports-box {
  max-width: 800px; margin: 0 auto;
  background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
}

.nls-report {
  display: flex; align-items: center; gap: 1rem;
  padding: 1rem 1.5rem;
  font-size: .95rem; font-weight: 600; color: var(--text);
}
.nls-report:not(:last-child) { border-bottom: 1px solid var(--border); }

.nls-report-icon {
  width: 42px; height: 42px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem; flex-shrink: 0;
}

.nls-arrow { color: var(--muted); margin: 0 .5rem; font-size: 1rem; }

.nls-target {
  border-radius: 20px; padding: .2rem .8rem;
  font-size: .82rem; font-weight: 700;
}

@media (max-width: 768px) {
  .noor-landing-steps { flex-direction: column; align-items: center; }
  .nls-connector { transform: rotate(90deg); }
  .nls-report { flex-wrap: wrap; }
}



.noor-guide {
  margin-top: 1.5rem;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--card); overflow: hidden;
}
.noor-guide-title {
  background: linear-gradient(135deg, var(--navy), var(--navy2));
  color: #fff; padding: .85rem 1.25rem;
  font-weight: 700; font-size: .95rem;
  display: flex; align-items: center; gap: .6rem; flex-wrap: wrap;
}
.noor-guide-title i { color: var(--teal); }
.noor-role-badge {
  margin-right: auto;
  background: rgba(26,172,142,.25); border: 1px solid rgba(26,172,142,.5);
  color: #7ee8d4; border-radius: 20px;
  padding: .2rem .85rem; font-size: .78rem; font-weight: 600;
}
.noor-steps {
  display: flex; align-items: center; gap: 0;
  padding: 1.25rem 1rem; flex-wrap: wrap; gap: .5rem;
}
.noor-step {
  display: flex; align-items: flex-start; gap: .75rem;
  background: var(--bg); border-radius: 10px;
  padding: .85rem 1rem; flex: 1; min-width: 180px;
  border: 1px solid var(--border);
}
.noor-step-num {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--teal); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 1rem; flex-shrink: 0;
}
.noor-step-body strong { display: block; color: var(--navy); font-size: .9rem; margin-bottom: .2rem; }
.noor-step-body p { margin: 0; color: var(--muted); font-size: .82rem; line-height: 1.5; }
.noor-arrow {
  color: var(--muted); font-size: 1.1rem; flex-shrink: 0; padding: 0 .25rem;
}
.noor-tag {
  display: inline-block; background: var(--navy);
  color: #fff; border-radius: 4px;
  padding: .1rem .45rem; font-size: .78rem; font-weight: 700;
}
.noor-tag-green { background: var(--teal); }
.noor-reports {
  border-top: 1px solid var(--border);
  padding: .85rem 1.25rem;
  display: flex; flex-direction: column; gap: .5rem;
}
.noor-report-row {
  display: flex; align-items: center; gap: .75rem;
  font-size: .88rem; color: var(--text);
}
.noor-report-row i { font-size: 1.1rem; flex-shrink: 0; }

/* ── Filters ── */
.filters-bar {
  display: flex; flex-wrap: wrap; gap: .6rem; margin-bottom: 1rem;
  padding: .75rem 1rem; background: var(--card);
  border-radius: var(--radius); border: 1px solid var(--border);
}
.filter-input {
  flex: 1; min-width: 200px; padding: .45rem .8rem;
  border: 1px solid var(--border); border-radius: 8px;
  font-family: 'Tajawal', sans-serif; font-size: .9rem;
  outline: none; transition: .2s;
}
.filter-input:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(26,172,142,.1); }
.filter-select {
  padding: .45rem .8rem; border: 1px solid var(--border);
  border-radius: 8px; font-family: 'Tajawal', sans-serif; font-size: .9rem;
  background: #fff; outline: none; cursor: pointer;
}
.btn-reset {
  padding: .45rem 1rem; border: 1px solid var(--border); border-radius: 8px;
  background: none; color: var(--muted); cursor: pointer;
  font-family: 'Tajawal', sans-serif; font-size: .88rem;
}
.btn-export {
  padding: .5rem 1.1rem; border-radius: 8px;
  background: linear-gradient(135deg, #1a5c2a, var(--teal));
  color: #fff; border: none; cursor: pointer;
  font-family: 'Tajawal', sans-serif; font-size: .9rem;
  font-weight: 600; transition: .2s;
}
.btn-export:hover { opacity: .9; }

.info-bar {
  color: var(--muted); font-size: .85rem; margin-bottom: .75rem;
  padding: .4rem .5rem;
}
.info-bar strong { color: var(--text); }
.info-chip {
  padding: .3rem .8rem; background: var(--bg);
  border-radius: 20px; font-size: .82rem; color: var(--muted);
}

/* ── Table ── */
.table-wrap {
  overflow-x: auto; border-radius: var(--radius);
  border: 1px solid var(--border);
}
.data-table {
  width: 100%; border-collapse: collapse; font-size: .88rem;
  background: var(--card);
}
.data-table thead th {
  background: var(--navy); color: #fff;
  padding: .65rem .75rem; text-align: right;
  font-weight: 600; font-size: .85rem; white-space: nowrap;
  position: sticky; top: 0; z-index: 2;
}
.data-table tbody td {
  padding: .55rem .75rem; border-bottom: 1px solid #eef1f7;
  vertical-align: middle;
}
.data-table tbody tr:nth-child(even) td { background: #f8fafd; }
.data-table tbody tr:hover td { background: #eef7f4; }
.data-table tfoot td {
  padding: .6rem .75rem; background: #eef2f7;
  font-weight: 700; border-top: 2px solid var(--navy);
}
.mono { font-family: 'Courier New', monospace; font-size: .82rem; }
.small-cell { max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Pivot ── */
.pivot-wrap { max-height: 65vh; overflow: auto; border-radius: var(--radius); }
.pivot-table {
  font-size: .78rem;
}
.pivot-table td, .pivot-table th {
  padding: .3rem .45rem !important;
  white-space: nowrap;
}
.pivot-table .col-sticky {
  position: sticky; right: 0; z-index: 1;
  background: var(--card); min-width: 140px; max-width: 180px;
}
.pivot-table thead th { font-size: .75rem; }
.pivot-table thead th:first-child { position: sticky; right: 0; z-index: 3; }
.sector-hdr td {
  background: linear-gradient(135deg, var(--navy), var(--navy2))!important;
  color: #fff!important; font-weight: 700; padding: .4rem .6rem !important;
  font-size: .8rem;
}
.subtotal-row td { background: #eef2f7!important; font-weight: 700; }
.school-cell { font-size: .76rem; }
.muted-dash  { color: #ccc; font-size: .72rem; }

/* ── Badges ── */
.badge {
  display: inline-block; border-radius: 4px;
  padding: .18rem .55rem; font-size: .78rem; font-weight: 600;
}
.b-blue  { background: #2d73b610; color: #2d73b6; border: 1px solid #2d73b630; }
.b-pink  { background: #dc354510; color: #dc3545; border: 1px solid #dc354530; }
.b-cyan  { background: #0dcaf010; color: #0dcaf0; border: 1px solid #0dcaf030; }
.b-green { background: #19875410; color: #198754; border: 1px solid #19875430; }
.b-gray  { background: #6c757d12; color: #555;    border: 1px solid #6c757d30; }
.b-num   { background: var(--navy); color: #fff; border: none; font-size: .72rem; padding: .12rem .4rem; }

/* ── Pagination ── */
.pager {
  display: flex; align-items: center; justify-content: center;
  gap: .35rem; margin-top: 1rem; padding: .5rem 0;
}
.pager button {
  width: 34px; height: 34px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--card);
  color: var(--text); cursor: pointer; font-family: 'Tajawal', sans-serif;
  font-size: .88rem; transition: .2s;
}
.pager button:hover    { background: var(--bg); border-color: var(--teal); color: var(--teal); }
.pager button.active   { background: var(--navy); color: #fff; border-color: var(--navy); }
.pager span            { color: var(--muted); padding: 0 .25rem; }

/* ── Empty State ── */
.empty-state {
  text-align: center; padding: 4rem 2rem; color: var(--muted);
}
.empty-state i    { font-size: 3.5rem; margin-bottom: 1rem; opacity: .4; }
.empty-state h5   { color: var(--text); margin-bottom: .4rem; font-size: 1.1rem; }
.empty-state p    { margin-bottom: 1.5rem; }

/* ── No-ID Alert ── */
.no-id-alert {
  display: flex; align-items: center; gap: .75rem; flex-wrap: wrap;
  background: #fff3cd; border: 1px solid #ffc107;
  border-radius: 10px; padding: .75rem 1.1rem;
  color: #664d03; font-size: .9rem; font-weight: 600;
  margin-bottom: 1rem;
}
.no-id-alert i { color: #e6a300; }
.no-id-btn {
  margin-right: auto; background: #ffc107; color: #000;
  border: none; border-radius: 6px; padding: .3rem .8rem;
  font-size: .82rem; font-weight: 700; cursor: pointer;
  font-family: 'Tajawal', sans-serif; transition: .2s;
}
.no-id-btn:hover { background: #e6a300; }
.row-no-id td { background: #fff8e1 !important; }

/* ════════════════════════════════════════════════════
   RESPONSIVE
════════════════════════════════════════════════════ */
@media (max-width: 992px) {
  :root { --sidebar: 220px; }
  .analytics-grid { grid-template-columns: repeat(2, 1fr); }
  .analytics-grid .span2 { grid-column: span 2; }
  .analytics-grid .span3 { grid-column: 1 / -1; }
  .dash-grid { grid-template-columns: 1fr; }
  .dash-grid .span2 { grid-column: 1; }
}

@media (max-width: 768px) {
  #sidebar {
    position: fixed; top: 0; right: 0; bottom: 0;
    transform: translateX(100%); z-index: 999;
    box-shadow: -4px 0 20px rgba(0,0,0,.2);
  }
  #sidebar.open { transform: translateX(0); }
  #main-area { width: 100%; }
  #sidebar-toggle { display: block; }
  .upload-grid { grid-template-columns: 1fr; }
  .kpi-grid    { grid-template-columns: repeat(2, 1fr); }
  #content     { padding: 1rem; }
  .filters-bar { flex-direction: column; }
  .filter-input, .filter-select { width: 100%; }
}

@media (max-width: 480px) {
  .hero h1      { font-size: 1.8rem; }
  .kpi-grid     { grid-template-columns: 1fr 1fr; }
  .hero-btns    { flex-direction: column; align-items: center; }
}
