/* school.badran.tech — "Ember" dashboard. One primary colour; deadlines read as heat. */
:root {
  --ember: #FF5A1F;
  --ember-ink: #1A0F0A;
  --ember-text: #C2410C;                 /* ember for small text on surfaces (AA) */
  --ember-soft: rgba(255, 90, 31, .12);
  --bg: #F6F3F0;
  --side: #FFFFFF;
  --surface: #FFFFFF;
  --surface-2: #F3EEEA;
  --line: #ECE4DE;
  --text: #1C1714;
  --muted: #7A6E66;
  --heat-0: #F1EBE6;
  --shadow: 0 1px 2px rgba(26, 15, 10, .04), 0 6px 18px -10px rgba(26, 15, 10, .12);
  --r: 14px;
  --side-w: 236px;
  --display: "Bricolage Grotesque", "IBM Plex Sans Arabic", system-ui, sans-serif;
  --body: "Inter", "IBM Plex Sans Arabic", system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0E0A08; --side: #130E0B; --surface: #18120F; --surface-2: #221A16; --line: #2C221C;
    --text: #F3ECE7; --muted: #9C8F86; --ember-text: #FF8A5C; --ember-soft: rgba(255, 90, 31, .16); --heat-0: #201813;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px -12px rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0E0A08; --side: #130E0B; --surface: #18120F; --surface-2: #221A16; --line: #2C221C;
  --text: #F3ECE7; --muted: #9C8F86; --ember-text: #FF8A5C; --ember-soft: rgba(255, 90, 31, .16); --heat-0: #201813;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px -12px rgba(0, 0, 0, .6);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 13px/1.5 var(--body); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { margin: 0; font-family: var(--display); letter-spacing: -.015em; font-weight: 700; }
button { font: inherit; color: inherit; }
.muted { color: var(--muted); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.rtl { font-family: "IBM Plex Sans Arabic", var(--body); }
:focus-visible { outline: 2px solid var(--ember); outline-offset: 2px; border-radius: 8px; }

/* ---------- brand + buttons ---------- */
.brand { display: inline-flex; align-items: center; gap: 9px; font: 800 18px/1 var(--display); letter-spacing: -.03em; }
.brand b { color: var(--ember); }
.flame { width: 26px; height: 26px; border-radius: 8px; background: var(--ember); position: relative; flex: none; }
.flame::after { content: ""; position: absolute; inset: 5px 7px 5px; background: var(--ember-ink); border-radius: 50% 50% 50% 50% / 62% 62% 38% 38%; clip-path: polygon(50% 0, 100% 55%, 100% 100%, 0 100%, 0 55%); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 32px; padding: 0 13px; border-radius: 999px; border: 1px solid transparent; font: 600 12.5px/1 var(--body); cursor: pointer; white-space: nowrap; transition: background .15s; }
.btn-ember { background: var(--ember); color: var(--ember-ink); }
.btn-ember:hover { background: #FF6E3A; }
.btn-ink { background: var(--ember-ink); color: #FFF4EE; }
.btn-ink:hover { background: #000; }
.btn-ghost { border-color: var(--line); background: var(--surface); }
.btn-ghost:hover { background: var(--surface-2); }
.icon-btn { width: 32px; height: 32px; flex: none; display: grid; place-items: center; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; color: var(--text); transition: background .15s; }
.icon-btn:hover { background: var(--surface-2); }
.icon-btn.is-busy svg { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- login ---------- */
.is-login { min-height: 100svh; display: grid; }
.login { position: relative; display: grid; place-items: center; padding: 24px 16px; overflow: hidden; }
.login-card { position: relative; z-index: 1; width: min(380px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 30px 26px; box-shadow: var(--shadow); }
.login-card h1 { font-size: 30px; line-height: 1.05; margin: 24px 0 8px; }
.login-card h1 em { font-style: normal; color: var(--ember); }
.login-form { display: flex; gap: 8px; margin-top: 18px; }
.login-form input { flex: 1; min-width: 0; height: 38px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg); color: var(--text); font: 500 13px var(--body); }
.login-form .btn { height: 38px; }
.err { color: var(--ember-text); font-weight: 600; margin: 12px 0 0; }
.login-glow { position: absolute; width: 640px; height: 640px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 90, 31, .3), rgba(255, 90, 31, 0) 65%); bottom: -320px; right: -180px; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100svh; }
.side { position: sticky; top: 0; height: 100svh; display: flex; flex-direction: column; background: var(--side); border-right: 1px solid var(--line); padding: 18px 14px 14px; overflow-y: auto; z-index: 40; }
.side-top { display: flex; align-items: center; justify-content: space-between; padding: 2px 6px 18px; }
.side-close { display: none; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-label { margin: 14px 10px 6px; font-size: 10.5px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); }
.nav-label:first-child { margin-top: 0; }
.nav a { position: relative; display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 10px; border-radius: 10px; color: var(--muted); font-weight: 500; transition: background .15s, color .15s; }
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a.on { background: var(--ember-soft); color: var(--text); font-weight: 600; }
.nav a.on svg { color: var(--ember); }
.nav a.on::before { content: ""; position: absolute; left: -14px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--ember); }
.nav a > span:not(.mono) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav em { font-style: normal; font-size: 11px; font-weight: 600; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; display: grid; place-items: center; background: var(--surface-2); color: var(--text); }
.nav em.hot { background: var(--ember); color: var(--ember-ink); }
.nav-courses a { height: 34px; }
.mono { width: 22px; height: 22px; flex: none; border-radius: 7px; display: grid; place-items: center; font: 700 10.5px/1 var(--body); background: var(--surface-2); color: var(--text); }
.mono.hot { background: var(--ember); color: var(--ember-ink); }
.side-bottom { margin-top: auto; padding-top: 16px; display: grid; gap: 10px; }
.theme-switch { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; padding: 3px; border-radius: 11px; background: var(--surface-2); }
.theme-switch button { height: 28px; border: 0; border-radius: 8px; background: transparent; display: flex; align-items: center; justify-content: center; gap: 5px; font-size: 11.5px; font-weight: 600; color: var(--muted); cursor: pointer; }
.theme-switch button[aria-checked="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, .12); }
.sync-card { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 10px 10px 12px; border: 1px solid var(--line); border-radius: 12px; }
.sync-card b { display: block; font-size: 12px; }
.sync-card span { display: block; font-size: 11.5px; color: var(--muted); }
.me { display: flex; align-items: center; gap: 10px; padding: 4px 2px 0 4px; }
.me form { margin: 0; }
.avatar { width: 32px; height: 32px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--ember); color: var(--ember-ink); font: 700 13px/1 "IBM Plex Sans Arabic", var(--body); }
.me-text { flex: 1; min-width: 0; }
.me-text b { display: block; font-size: 12.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: "IBM Plex Sans Arabic", var(--body); }
.me-text span { font-size: 11px; color: var(--muted); }

.main { min-width: 0; display: flex; flex-direction: column; }
.bar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; height: 60px; padding: 0 28px; background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.menu-btn { display: none; }
.bar-title { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 10px; }
.bar-title h1 { font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-title span { font-size: 12px; white-space: nowrap; }
.clock { font-size: 12px; font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.content { padding: 24px 28px 40px; outline: none; }
.content > * + * { margin-top: 16px; }

@media (max-width: 1023px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: min(280px, 86vw); transform: translateX(-100%); transition: transform .22s ease; box-shadow: var(--shadow); }
  .side.open { transform: none; }
  .side-close, .menu-btn { display: grid; }
  .scrim { position: fixed; inset: 0; z-index: 30; background: rgba(10, 6, 4, .45); }
  .bar { padding: 0 16px; height: 56px; }
  .content { padding: 16px 16px 32px; }
}
@media (max-width: 599px) { .bar-title span, .clock { display: none; } }

/* ---------- grid + cards ---------- */
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; }
.s3 { grid-column: span 3; } .s4 { grid-column: span 4; } .s5 { grid-column: span 5; } .s6 { grid-column: span 6; } .s7 { grid-column: span 7; } .s8 { grid-column: span 8; } .s12 { grid-column: span 12; }
@media (max-width: 1199px) { .s5, .s7 { grid-column: span 12; } .s3 { grid-column: span 6; } }
@media (max-width: 767px) { .s4, .s6, .s8 { grid-column: span 12; } .grid { gap: 12px; } }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.card-head h2 { font-size: 14px; letter-spacing: -.005em; }
.card-head a { font-size: 12px; font-weight: 600; color: var(--ember-text); }
.card-head a:hover { text-decoration: underline; }

/* stat cards */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 899px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; } }
.stat { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; overflow: hidden; }
.stat .k { font-size: 12px; color: var(--muted); font-weight: 500; display: flex; align-items: center; gap: 6px; }
.stat .v { font: 800 28px/1.1 var(--display); letter-spacing: -.03em; margin-top: 6px; }
.stat .h { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.stat .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--line); }
.stat.hot { background: var(--ember); border-color: var(--ember); color: var(--ember-ink); }
.stat.hot .k, .stat.hot .h { color: var(--ember-ink); opacity: .78; }
.stat.hot .dot { background: var(--ember-ink); animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .25; } }

/* next up */
.nextup { position: relative; overflow: hidden; isolation: isolate; border-radius: var(--r); background: var(--ember); color: var(--ember-ink); padding: 20px; display: flex; flex-direction: column; min-height: 248px; }
.nextup::before { content: ""; position: absolute; z-index: -1; width: 420px; height: 420px; border-radius: 50%; right: -150px; top: -190px; background: radial-gradient(circle, rgba(255, 236, 200, .55), rgba(255, 236, 200, 0) 62%); animation: breathe 6s ease-in-out infinite; }
.nextup::after { content: ""; position: absolute; z-index: -1; inset: 0; background-image: radial-gradient(rgba(26, 15, 10, .14) 1px, transparent 1.2px); background-size: 12px 12px; mask-image: linear-gradient(200deg, #000, transparent 55%); -webkit-mask-image: linear-gradient(200deg, #000, transparent 55%); }
@keyframes breathe { 50% { transform: scale(1.12) translate(-14px, 10px); } }
@media (prefers-reduced-motion: reduce) { .nextup::before, .stat.hot .dot { animation: none; } }
.nextup .tag { font-size: 11px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; display: flex; align-items: center; gap: 7px; }
.nextup .tag i { width: 7px; height: 7px; border-radius: 50%; background: var(--ember-ink); animation: pulse 1.6s ease-in-out infinite; }
.nextup h3 { font-size: 22px; line-height: 1.12; margin: 12px 0 4px; }
.nextup .course { font-size: 12.5px; font-weight: 500; opacity: .85; }
.countdown { display: flex; gap: 6px; margin: auto 0 14px; padding-top: 16px; }
.countdown div { background: rgba(26, 15, 10, .9); color: #FFF4EE; border-radius: 11px; padding: 8px 10px 6px; min-width: 58px; text-align: center; }
.countdown b { display: block; font: 800 26px/1 var(--display); font-variant-numeric: tabular-nums; }
.countdown span { font-size: 9.5px; letter-spacing: .1em; text-transform: uppercase; opacity: .7; }
.nextup-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 12.5px; font-weight: 600; }
.nextup-after { margin-top: 10px; font-size: 12px; opacity: .85; }
.nextup-after a { font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.nextup.calm { background: var(--surface); color: var(--text); border: 1px solid var(--line); }
.nextup.calm::after, .nextup.calm::before { display: none; }

/* compact list rows */
.list { display: grid; }
.li { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 10px 4px; border-top: 1px solid var(--line); }
.li:first-child { border-top: 0; padding-top: 2px; }
.li .ico { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: color-mix(in srgb, var(--ember) calc(var(--heat, .15) * 100%), var(--surface-2)); }
.li .ico.ink { color: var(--ember-ink); }
.li .ico svg { width: 16px; height: 16px; }
.li .t { font-weight: 600; font-size: 13px; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.li a.t:hover { text-decoration: underline; text-decoration-color: var(--ember); text-underline-offset: 3px; }
.li .s { font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.li .r { text-align: right; font-size: 12px; white-space: nowrap; }
.li .r b { display: block; font-weight: 600; font-variant-numeric: tabular-nums; }
.li .r .pill { margin-top: 3px; }

/* deadline table */
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { height: 30px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-size: 12px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.chip span { font-weight: 500; color: var(--muted); }
.chip[aria-selected="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }
.chip[aria-selected="true"] span { color: inherit; opacity: .7; }
.select { height: 30px; padding: 0 28px 0 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237A6E66' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center; color: var(--text); font: 600 12px var(--body); appearance: none; -webkit-appearance: none; max-width: 100%; }
.table { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.group-h { display: flex; align-items: center; gap: 8px; padding: 9px 16px; background: var(--surface-2); font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); border-top: 1px solid var(--line); }
.group-h:first-child { border-top: 0; }
.group-h b { color: var(--text); }
.group-h.urgent b { color: var(--ember-text); }
.tr { position: relative; display: grid; grid-template-columns: 30px minmax(0, 1fr) 150px 120px 64px; align-items: center; gap: 14px; padding: 10px 16px; border-top: 1px solid var(--line); }
.group-h + .tr { border-top: 0; }
.tr::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--ember); opacity: var(--heat, .15); }
.tr:hover { background: color-mix(in srgb, var(--surface-2) 55%, var(--surface)); }
.tr .ico { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: color-mix(in srgb, var(--ember) calc(var(--heat, .15) * 100%), var(--surface-2)); }
.tr .ico.ink { color: var(--ember-ink); }
.tr .ico svg { width: 16px; height: 16px; }
.tr .t { font-weight: 600; line-height: 1.3; }
.tr a.t:hover { text-decoration: underline; text-decoration-color: var(--ember); text-underline-offset: 3px; }
.tr .s { display: flex; flex-wrap: wrap; gap: 2px 10px; font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.tr .when b { display: block; font-weight: 600; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.tr .when span { font-size: 11.5px; color: var(--muted); }
.tr .st { justify-self: start; }
.tr.done { opacity: .6; }
.tr.done .t { text-decoration: line-through; text-decoration-color: var(--muted); }
.tr.done::before { opacity: 0; }
@media (max-width: 899px) {
  .tr { grid-template-columns: 30px minmax(0, 1fr) auto; row-gap: 6px; }
  .tr .when { grid-column: 2; display: flex; gap: 8px; align-items: baseline; }
  .tr .when b { display: inline; }
  .tr .st { grid-column: 2; grid-row: 3; }
  .tr .tk { grid-column: 3; grid-row: 1; }
}
.pill { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 11px; font-weight: 600; white-space: nowrap; background: var(--surface-2); color: var(--text); }
.pill.hot { background: var(--ember); color: var(--ember-ink); }
.pill.ok { background: var(--text); color: var(--bg); }
.pill.line { background: transparent; border: 1px solid var(--line); color: var(--muted); }
.tk { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); cursor: pointer; justify-self: end; }
.tick { appearance: none; -webkit-appearance: none; width: 18px; height: 18px; margin: 0; border-radius: 6px; border: 1.5px solid var(--line); background: var(--surface); cursor: pointer; display: grid; place-items: center; }
.tick:checked { background: var(--text); border-color: var(--text); }
.tick:checked::after { content: ""; width: 8px; height: 4px; border: 2px solid var(--bg); border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px); }
.empty { padding: 28px; text-align: center; color: var(--muted); }

/* heat calendar */
.heat { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; }
.dow { font-size: 10.5px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); padding: 0 2px 2px; }
.day { position: relative; border-radius: 8px; background: var(--heat-0); aspect-ratio: 1; padding: 5px 6px; display: flex; flex-direction: column; justify-content: space-between; font-size: 11.5px; font-weight: 600; min-width: 0; }
.day.today { box-shadow: inset 0 0 0 1.5px var(--ember); }
.day.past { opacity: .35; }
.day .dots { display: flex; gap: 2px; flex-wrap: wrap; }
.day .dots i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.day[data-h="1"] { background: color-mix(in srgb, var(--ember) 22%, var(--heat-0)); }
.day[data-h="2"] { background: color-mix(in srgb, var(--ember) 45%, var(--heat-0)); }
.day[data-h="3"] { background: color-mix(in srgb, var(--ember) 72%, var(--heat-0)); color: var(--ember-ink); }
.day[data-h="4"] { background: var(--ember); color: var(--ember-ink); }
.legend { display: flex; align-items: center; justify-content: flex-end; gap: 4px; margin-top: 10px; font-size: 11px; color: var(--muted); }
.legend i { width: 11px; height: 11px; border-radius: 3px; background: var(--heat-0); }
.legend i:nth-child(2) { background: color-mix(in srgb, var(--ember) 22%, var(--heat-0)); }
.legend i:nth-child(3) { background: color-mix(in srgb, var(--ember) 45%, var(--heat-0)); }
.legend i:nth-child(4) { background: color-mix(in srgb, var(--ember) 72%, var(--heat-0)); }
.legend i:nth-child(5) { background: var(--ember); }

/* big calendar view */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.cal .dow { padding: 10px 10px 8px; border-bottom: 1px solid var(--line); }
.cal .cell { min-height: 112px; padding: 8px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.cal .cell:nth-child(7n) { border-right: 0; }
.cal .cell.past { background: color-mix(in srgb, var(--surface-2) 45%, var(--surface)); }
.cal .cell.past .n, .cal .cell.past .ev { opacity: .5; }
.cal .n { font-size: 12px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.cal .n small { font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.cal .cell.today .n b { background: var(--ember); color: var(--ember-ink); border-radius: 999px; padding: 1px 7px; }
.cal .ev { display: block; font-size: 11px; line-height: 1.3; padding: 4px 6px; border-radius: 6px; background: color-mix(in srgb, var(--ember) calc(var(--heat, .2) * 100%), var(--surface-2)); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal .ev.ink { color: var(--ember-ink); }
.cal .ev.done { background: var(--surface-2); text-decoration: line-through; color: var(--muted); }
.cal .ev b { font-weight: 600; margin-right: 4px; }
@media (max-width: 767px) {
  .cal .cell { min-height: 64px; padding: 5px; }
  .cal .ev { font-size: 0; height: 6px; padding: 0; border-radius: 3px; }
  .cal .n small { display: none; }
}

/* load bars (per course) */
.bars { display: grid; gap: 10px; }
.bar-row { display: grid; grid-template-columns: minmax(0, 1fr) 34px; gap: 4px 10px; align-items: center; }
.bar-row .nm { font-size: 12px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; grid-column: 1 / -1; display: flex; justify-content: space-between; gap: 8px; }
.bar-row .nm span { color: var(--muted); font-weight: 400; }
.track { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; display: flex; }
.track i { height: 100%; background: var(--ember); }
.track i.d { background: var(--text); opacity: .75; }
.bar-row b { font-size: 12px; text-align: right; font-variant-numeric: tabular-nums; }

/* courses */
.courses { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.course-card { display: flex; flex-direction: column; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; min-height: 178px; transition: border-color .15s, transform .15s, box-shadow .15s; }
.course-card:hover { border-color: color-mix(in srgb, var(--ember) 45%, var(--line)); transform: translateY(-2px); box-shadow: var(--shadow); }
.course-card .top { display: flex; align-items: center; justify-content: space-between; }
.course-card .mono { width: 34px; height: 34px; border-radius: 10px; font-size: 13px; }
.course-card .code { font-size: 11px; font-weight: 600; letter-spacing: .06em; color: var(--muted); }
.course-card .nm { font: 700 15px/1.25 var(--display); }
.course-card .nm.rtl { font: 600 15px/1.4 "IBM Plex Sans Arabic", sans-serif; }
.course-card .cat { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.course-card .bottom { margin-top: auto; display: grid; gap: 8px; }
.course-card .next { font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.course-card .next b { color: var(--text); font-weight: 600; }
.course-card .counts { display: flex; gap: 12px; font-size: 11.5px; color: var(--muted); }
.course-card .counts b { color: var(--text); }

/* course detail header */
.course-hero { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.course-hero .mono { width: 44px; height: 44px; border-radius: 12px; font-size: 16px; }
.course-hero .info { flex: 1; min-width: 200px; }
.course-hero h2 { font-size: 20px; }
.course-hero h2.rtl { font-family: "IBM Plex Sans Arabic", sans-serif; font-weight: 600; }

/* self-paced */
.sp-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.sp { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.sp:hover { border-color: color-mix(in srgb, var(--ember) 45%, var(--line)); }
.sp .ico { width: 28px; height: 28px; flex: none; border-radius: 8px; display: grid; place-items: center; background: var(--surface-2); }
.sp .ico svg { width: 15px; height: 15px; }
.sp b { display: block; font-size: 12.5px; font-weight: 600; line-height: 1.3; }
.sp span { font-size: 11px; color: var(--muted); }

.greet { display: flex; align-items: end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.greet h2 { font-size: 24px; font-weight: 800; letter-spacing: -.025em; }
.greet h2 .rtl { font-weight: 600; }
.greet p { margin: 2px 0 0; color: var(--muted); }

.alert { background: var(--ember-soft); border: 1px solid var(--ember); border-radius: 12px; padding: 10px 14px; font-size: 12.5px; }
.toast { position: fixed; left: 50%; bottom: 20px; transform: translate(-50%, 16px); background: var(--ember-ink); color: #FFF4EE; padding: 9px 16px; border-radius: 999px; font-size: 12.5px; font-weight: 500; opacity: 0; pointer-events: none; transition: .2s; z-index: 60; max-width: calc(100% - 32px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Arabic titles inside an LTR layout: keep them on the same left edge */
.main [dir="auto"], .nav [dir="auto"], .me [dir="auto"] { text-align: left; }
