/* SU Design System — applied to lecture_live.
   Source: /Users/haith/SU/design-system.html v1.0
   100% adherence to brand tokens. */

:root{
  /* Brand */
  --purple-900:#311647; --purple-800:#46225f; --purple-700:#5b2e7d;
  --purple-600:#6f3f97; --purple-500:#8a6fb4; --purple-400:#a990cb;
  --purple-300:#c8b6dc; --purple-200:#e4daee; --purple-100:#f2ecf7;
  --purple-50:#f8f5fb;

  --cyan-700:#176d80; --cyan-600:#1e8ea5; --cyan-500:#2eb0c8;
  --cyan-400:#5dc6da; --cyan-300:#9ed9e6; --cyan-200:#cfecf3;
  --cyan-100:#e6f5f8;

  --gray-900:#1a1a1c; --gray-800:#2a2a2d; --gray-700:#46474a;
  --gray-600:#6b6c70; --gray-500:#8a8b8e; --gray-400:#aaabae;
  --gray-300:#cfd0d2; --gray-200:#e4e5e6; --gray-100:#eeeff0;
  --gray-50:#f6f6f7;
  --white:#ffffff; --paper:#fbfbfc;

  /* Semantic */
  --success:#1f8a5b; --warning:#c98800; --danger:#c0392b; --info:#1e8ea5;

  /* Type */
  --ff-ar:'IBM Plex Sans Arabic', system-ui, sans-serif;
  --ff-en:'Inter', system-ui, sans-serif;
  --ff-mono:'JetBrains Mono', ui-monospace, monospace;

  /* Radius */
  --r-1:4px; --r-2:8px; --r-3:12px; --r-4:16px; --r-5:24px; --r-pill:999px;

  /* Shadow */
  --sh-1: 0 1px 2px rgba(20,15,40,.06), 0 1px 1px rgba(20,15,40,.04);
  --sh-2: 0 4px 12px rgba(20,15,40,.06), 0 2px 4px rgba(20,15,40,.04);
  --sh-3: 0 12px 32px rgba(20,15,40,.10), 0 4px 8px rgba(20,15,40,.04);
  --sh-focus: 0 0 0 3px rgba(91,46,125,.25);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  background: var(--paper);
  color: var(--gray-900);
  font-family: var(--ff-ar);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--purple-200); color: var(--purple-900); }

/* Top bar with brand */
.su-top {
  background: linear-gradient(135deg,var(--purple-700) 0%,var(--purple-500) 65%,var(--purple-400) 100%);
  color:#fff; position:relative; overflow:hidden;
}
.su-top::before, .su-top::after { content:""; position:absolute; pointer-events:none; }
.su-top::before {
  width:520px; height:300px; left:-60px; top:-40px; transform:rotate(-8deg);
  background:rgba(255,255,255,.10);
  clip-path:polygon(0 0,100% 30%,80% 100%,0 70%);
}
.su-top::after {
  width:380px; height:240px; right:-40px; bottom:-60px;
  background:rgba(46,176,200,.18);
  clip-path:polygon(20% 0,100% 10%,90% 100%,0 80%);
}
.su-top-inner {
  position:relative; padding:22px 32px;
  display:flex; align-items:center; justify-content:space-between; gap:24px;
  flex-wrap:wrap;
}
.su-brand { display:flex; align-items:center; gap:16px; min-width:0; }
.su-brand img { height:44px; width:auto; background:#fff; padding:6px 10px; border-radius:var(--r-2); }
.su-brand .titles { min-width:0; }
.su-brand .eyebrow {
  font-family:var(--ff-en); font-size:11px; letter-spacing:.18em; text-transform:uppercase;
  opacity:.85; font-weight:500;
}
.su-brand .lecture-title {
  font-size:18px; font-weight:600; letter-spacing:-.005em;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}

/* Pills */
.pill {
  display:inline-flex; align-items:center; gap:6px;
  font-size:13px; font-weight:500;
  padding:6px 14px; border-radius:var(--r-pill);
  background:rgba(255,255,255,.18); color:#fff; backdrop-filter:saturate(1.4);
}
.pill b { font-weight:700; }
.pill.live {
  background:rgba(192,57,43,.30); padding-right:10px;
}
.pill.live::before {
  content:""; width:8px; height:8px; border-radius:50%; background:#fff;
  animation:su-blink 1.4s ease infinite;
}
@keyframes su-blink { 0%,100%{opacity:1} 50%{opacity:.3} }
.pill.cyan { background:var(--cyan-500); color:#fff; }
.pill.outline { background:transparent; border:1px solid rgba(255,255,255,.4); }

/* Buttons */
.btn {
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  font-family:var(--ff-ar); font-size:15px; font-weight:600;
  padding:12px 22px; border-radius:var(--r-pill);
  border:1px solid transparent; cursor:pointer; transition:all .15s;
  text-decoration:none; line-height:1; background:transparent; color:inherit;
}
.btn:focus-visible { outline:none; box-shadow:var(--sh-focus); }
.btn.primary   { background:var(--purple-700); color:#fff; }
.btn.primary:hover:not(:disabled){ background:var(--purple-800); }
.btn.secondary { background:var(--cyan-500); color:#fff; }
.btn.secondary:hover:not(:disabled){ background:var(--cyan-600); }
.btn.outline   { background:transparent; color:var(--purple-700); border-color:var(--purple-700); }
.btn.outline:hover:not(:disabled){ background:var(--purple-50); }
.btn.ghost     { background:transparent; color:var(--purple-700); }
.btn.ghost:hover:not(:disabled){ background:var(--purple-50); }
.btn.danger    { background:var(--danger); color:#fff; }
.btn.danger:hover:not(:disabled){ background:#a73022; }
.btn.success   { background:var(--success); color:#fff; }
.btn.success:hover:not(:disabled){ background:#175e3f; }
.btn:disabled, .btn.disabled { background:var(--gray-200); color:var(--gray-500); cursor:not-allowed; border-color:transparent; }
.btn.sm { padding:8px 14px; font-size:13px; }
.btn.lg { padding:16px 28px; font-size:17px; }
.btn.block { width:100%; }

/* Cards */
.card {
  background:#fff; border:1px solid var(--gray-200); border-radius:var(--r-3);
  padding:20px; box-shadow:var(--sh-1);
}
.card.flat { box-shadow:none; }

/* Badges */
.badge {
  display:inline-flex; align-items:center; gap:6px;
  font-size:12px; font-weight:600; padding:4px 10px; border-radius:var(--r-pill);
  background:var(--purple-100); color:var(--purple-800);
}
.badge.cyan    { background:var(--cyan-100); color:var(--cyan-700); }
.badge.gray    { background:var(--gray-100); color:var(--gray-700); }
.badge.success { background:#e2f4ec; color:var(--success); }
.badge.warn    { background:#fbf1d6; color:#8a5b00; }
.badge.danger  { background:#fae3df; color:var(--danger); }
.badge .d { width:6px; height:6px; border-radius:50%; background:currentColor; }

/* Form fields */
.field { display:flex; flex-direction:column; gap:6px; margin-bottom:16px; }
.field label { font-size:13px; font-weight:600; color:var(--gray-800); }
.field .hint { font-size:12px; color:var(--gray-600); }
.input {
  font-family:var(--ff-ar); font-size:15px; padding:11px 14px;
  border:1px solid var(--gray-300); border-radius:var(--r-2);
  background:#fff; color:var(--gray-900); transition:all .15s;
}
.input::placeholder { color:var(--gray-500); }
.input:focus { outline:none; border-color:var(--purple-500); box-shadow:var(--sh-focus); }

/* Alerts */
.alert {
  display:flex; gap:14px; padding:14px 16px;
  border-radius:var(--r-2); border:1px solid; align-items:flex-start;
}
.alert .ic {
  width:24px; height:24px; border-radius:50%; flex-shrink:0;
  display:flex; align-items:center; justify-content:center; color:#fff;
  font-weight:700; font-size:14px; font-family:var(--ff-en);
}
.alert.info    { background:var(--cyan-100); border-color:var(--cyan-300); color:var(--cyan-700); }
.alert.info .ic{ background:var(--cyan-500); }
.alert.success { background:#e9f6ef; border-color:#9ed1b6; color:#0e6a44; }
.alert.success .ic { background:var(--success); }
.alert.warn    { background:#fcf4dc; border-color:#e6c97c; color:#7a4f00; }
.alert.warn .ic    { background:var(--warning); }
.alert.danger  { background:#fae8e4; border-color:#e9a99e; color:#8b1f12; }
.alert.danger .ic  { background:var(--danger); }
.alert b { display:block; margin-bottom:2px; color:inherit; }
.alert p { margin:0; font-size:14px; color:inherit; opacity:.9; }

/* Section heading */
.label {
  font-family:var(--ff-en); font-size:11px; letter-spacing:.14em;
  text-transform:uppercase; color:var(--gray-500); font-weight:600;
  margin-bottom:8px; display:block;
}

/* Mono inline */
code.inline {
  font-family:var(--ff-mono); font-size:13px;
  background:var(--gray-100); padding:2px 6px; border-radius:4px;
  color:var(--purple-800);
}

/* Stat tile */
.stat {
  background:#fff; border:1px solid var(--gray-200); border-radius:var(--r-3);
  padding:18px 20px; position:relative; overflow:hidden;
}
.stat::before {
  content:""; position:absolute; top:0; right:0; width:64px; height:64px;
  background:var(--cyan-100); clip-path:polygon(100% 0,0 0,100% 100%); opacity:.6;
}
.stat .num {
  font-family:var(--ff-en); font-size:32px; font-weight:700;
  color:var(--purple-700); line-height:1; letter-spacing:-.02em;
}
.stat .lbl { font-size:13px; color:var(--gray-700); margin-top:6px; }

/* Progress bar */
.progress {
  background:var(--gray-100); border-radius:var(--r-pill); height:6px; overflow:hidden;
}
.progress > div { height:100%; transition:width .3s; background:var(--purple-700); border-radius:inherit; }
.progress.success > div { background:var(--success); }
.progress.warn > div    { background:var(--warning); }
.progress.danger > div  { background:var(--danger); }

/* Dot indicator */
.dot-ind { width:8px; height:8px; border-radius:50%; background:var(--gray-400); flex-shrink:0; }
.dot-ind.ok    { background:var(--success); box-shadow:0 0 0 3px rgba(31,138,91,.12); }
.dot-ind.warn  { background:var(--warning); }
.dot-ind.error { background:var(--danger); }
.dot-ind.live  { background:var(--success); animation:su-pulse 1.4s ease infinite; }
@keyframes su-pulse { 0%,100%{opacity:1} 50%{opacity:.3} }

/* Scrollbars */
::-webkit-scrollbar { width:10px; height:10px; }
::-webkit-scrollbar-thumb { background:var(--gray-300); border-radius:var(--r-pill); border:2px solid var(--paper); }
::-webkit-scrollbar-thumb:hover { background:var(--gray-400); }
::-webkit-scrollbar-track { background:transparent; }

/* Utility */
.row { display:flex; gap:12px; align-items:center; flex-wrap:wrap; }
.stack { display:flex; flex-direction:column; gap:12px; }
.muted { color:var(--gray-600); }
.mono  { font-family:var(--ff-mono); }
.en    { font-family:var(--ff-en); }
.tag-num { font-family:var(--ff-en); font-weight:600; }
