/* My Maktab home pages (Spec E, U8): school, teacher and Business homes, from the approved
   mockup docs/design/school-dashboard-mockup.html. Our own design. Self-contained tokens so it
   works in the new and the classic look; light, dark and automatic; system fonts (no CDN). */
:root, [data-theme="light"] {
  --h-bg: #f3f6f4; --h-surface: #ffffff; --h-ink: #13241d; --h-muted: #56685f; --h-line: #e1e9e4;
  --h-g: #0e6b4b; --h-g-soft: #e3f2eb; --h-b: #2563c9; --h-b-soft: #e6eefc; --h-a: #9a5f0a; --h-a-soft: #fbf0de;
  --h-r: #b93a44; --h-r-soft: #fbe6e8; --h-v: #6247bf; --h-v-soft: #eeeafb; --h-n: #4b5563; --h-n-soft: #eceff2;
  --h-band-a: #0e6b4b; --h-band-b: #14876a; --h-band-c: #2a9d7c;
  --h-shadow: 0 1px 2px rgba(19,36,29,.06), 0 6px 18px rgba(19,36,29,.06);
  --h-display: "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --h-body: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}
[data-theme="dark"] {
  --h-bg: #0f1714; --h-surface: #16211c; --h-ink: #e7efea; --h-muted: #a3b5ac; --h-line: #24332c;
  --h-g: #3fbf8c; --h-g-soft: #173a2c; --h-b: #7aa6f0; --h-b-soft: #1b2a44; --h-a: #e6ab4f; --h-a-soft: #3a2c15;
  --h-r: #ec7b84; --h-r-soft: #3d1f23; --h-v: #a891f0; --h-v-soft: #2a2346; --h-n: #b4bdc9; --h-n-soft: #252b33;
  --h-band-a: #0d3d2c; --h-band-b: #11533c; --h-band-c: #176b4f; --h-shadow: 0 1px 2px rgba(0,0,0,.4);
}
@media (prefers-color-scheme: dark) {
  [data-theme="auto"] {
    --h-bg: #0f1714; --h-surface: #16211c; --h-ink: #e7efea; --h-muted: #a3b5ac; --h-line: #24332c;
    --h-g: #3fbf8c; --h-g-soft: #173a2c; --h-b: #7aa6f0; --h-b-soft: #1b2a44; --h-a: #e6ab4f; --h-a-soft: #3a2c15;
    --h-r: #ec7b84; --h-r-soft: #3d1f23; --h-v: #a891f0; --h-v-soft: #2a2346; --h-n: #b4bdc9; --h-n-soft: #252b33;
    --h-band-a: #0d3d2c; --h-band-b: #11533c; --h-band-c: #176b4f; --h-shadow: 0 1px 2px rgba(0,0,0,.4);
  }
}
/* Tones: letters (g b a r v n) and the U6 numbers (c1 green, c2 blue, c3 violet, c4 amber, c5 rose, c6 grey). */
.hm .g, .hm .c1, .mm-t-g { --t: var(--h-g); --ts: var(--h-g-soft); } .hm .b, .hm .c2, .mm-t-b { --t: var(--h-b); --ts: var(--h-b-soft); }
.hm .v, .hm .c3, .mm-t-v { --t: var(--h-v); --ts: var(--h-v-soft); } .hm .a, .hm .c4, .mm-t-a { --t: var(--h-a); --ts: var(--h-a-soft); }
.hm .r, .hm .c5, .mm-t-r { --t: var(--h-r); --ts: var(--h-r-soft); } .hm .n, .hm .c6, .mm-t-n { --t: var(--h-n); --ts: var(--h-n-soft); }

.hm { display: flex; flex-direction: column; gap: 20px; font-family: var(--h-body); color: var(--h-ink); }
.hm h2 { font-family: var(--h-display); font-weight: 650; font-size: 1.1875rem; margin: 0; }
.hm a { color: inherit; }
.hm-muted { color: var(--h-muted); margin: 0; }
.hm-muted a, .hm-card header a { color: var(--h-g); font-weight: 650; text-decoration: none; }
.hm-muted a:hover, .hm-card header a:hover { text-decoration: underline; }

/* Sidebar chips (the left navigation) */
.mm-nav-chip { width: 30px; height: 30px; border-radius: 8px; display: inline-grid; place-items: center; flex: none; background: var(--ts, var(--h-g-soft)); color: var(--t, var(--h-g)); }
.mm-nav-chip .mm-icon { width: 17px; height: 17px; color: inherit !important; }
.mm-nav a[aria-current="page"] .mm-nav-chip { box-shadow: 0 0 0 2px var(--t, var(--h-g)); }

/* Greeting band */
.hm-band { border-radius: 20px; padding: 26px 28px; color: #fff; background: linear-gradient(120deg, var(--h-band-a), var(--h-band-b) 60%, var(--h-band-c));
  position: relative; overflow: hidden; display: flex; gap: 24px; align-items: center; flex-wrap: wrap; }
.hm-band .hm-pattern { position: absolute; right: -30px; top: -30px; width: 300px; height: 300px; opacity: .16; color: #fff; pointer-events: none; }
.hm-band-text { position: relative; min-width: 0; }
.hm-band h1 { font-family: var(--h-display); font-weight: 800; font-size: clamp(24px, 3vw, 34px); margin: 0; color: #fff; letter-spacing: -.01em; text-wrap: balance;
  background: none !important; border: 0 !important; padding: 0 !important; }
.hm-band p { margin: 6px 0 0; color: rgba(255,255,255,.92) !important; }
.hm-band-hint a { color: #fff; font-weight: 700; }
.hm-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.hm-chip { background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.28); border-radius: 999px; padding: 5px 12px; font-size: .875rem; font-weight: 650; }
.hm-next { margin-left: auto; position: relative; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.28); border-radius: 16px; padding: 14px 18px; min-width: 220px;
  color: #fff !important; text-decoration: none; display: block; }
a.hm-next:hover { background: rgba(255,255,255,.22); }
.hm-next small { display: block; opacity: .88; text-transform: uppercase; letter-spacing: .08em; font-size: .875rem; }
.hm-next strong { display: block; font-size: 1.125rem; margin-top: 2px; }

/* Quick actions */
.hm-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.hm-act { display: flex; align-items: center; gap: 12px; background: var(--h-surface); border: 1px solid var(--h-line); border-radius: 14px; padding: 12px 14px;
  color: var(--h-ink) !important; text-decoration: none; font-weight: 650; box-shadow: var(--h-shadow); transition: transform .15s; }
.hm-act:hover { transform: translateY(-2px); }
.hm-ic { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; flex: none; background: var(--ts); color: var(--t); }
.hm-ic .mm-icon { color: inherit; }
.hm-ic-lg { width: 42px; height: 42px; border-radius: 12px; }

/* KPI tiles */
.hm-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.hm-kpi { background: var(--h-surface); border-radius: 16px; padding: 16px 18px; box-shadow: var(--h-shadow); display: flex; flex-direction: column; gap: 6px; min-width: 0; border: 1px solid var(--h-line); }
.hm-kpi-row { display: flex; align-items: center; gap: 10px; color: var(--h-muted); font-weight: 650; font-size: .875rem; }
.hm-kpi-row a { color: var(--h-muted); text-decoration: none; } .hm-kpi-row a:hover { color: var(--h-ink); text-decoration: underline; }
.hm-kpi .hm-ic { width: 34px; height: 34px; border-radius: 10px; }
.hm-num { font-family: var(--h-display); font-weight: 800; font-size: 2rem; font-variant-numeric: tabular-nums; line-height: 1; }
.hm-trend { font-size: .875rem; font-weight: 650; color: var(--h-muted); }
.hm-trend.up { color: var(--h-g); } .hm-trend.down { color: var(--h-r); }
.hm-spark { width: 100%; height: 36px; display: block; }
.hm-spark-area { fill: var(--ts); stroke: none; } .hm-spark-line { fill: none; stroke: var(--t); stroke-width: 2; vector-effect: non-scaling-stroke; }

/* Insight cards */
.hm-grid2 { display: grid; grid-template-columns: 1.25fr 1fr; gap: 14px; }
.hm-card { background: var(--h-surface); border-radius: 18px; padding: 18px 20px; box-shadow: var(--h-shadow); border: 1px solid var(--h-line); min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.hm-card header { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.hm-att { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; }
.hm-att .mm-chart-ring svg { width: 132px; height: 132px; }
.hm-att .mm-chart-ring figcaption { display: none; }
.hm-classes { flex: 1; min-width: 220px; display: flex; flex-direction: column; gap: 10px; list-style: none; margin: 0; padding: 0; }
.hm-classes li { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: center; }
.hm-classes a { text-decoration: none; } .hm-classes a:hover b { text-decoration: underline; }
.hm-bar { grid-column: 1 / -1; display: block; height: 8px; border-radius: 99px; background: var(--h-line); overflow: hidden; }
.hm-bar i { display: block; height: 100%; border-radius: 99px; background: var(--t, var(--h-line)); }
.hm-pill { font-size: .875rem; font-weight: 750; border-radius: 999px; padding: 3px 9px; background: var(--ts); color: var(--t); }
.hm-pipe { display: flex; flex-direction: column; gap: 10px; list-style: none; margin: 0; padding: 0; }
.hm-pipe li { display: grid; grid-template-columns: 110px 1fr 28px; gap: 10px; align-items: center; font-size: .875rem; }
.hm-pipe .hm-bar { grid-column: auto; height: 12px; } .hm-pipe b { text-align: right; font-variant-numeric: tabular-nums; }
.hm-levels { display: flex; align-items: flex-end; gap: 8px; height: 140px; padding-top: 6px; }
.hm-lv { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: .875rem; color: var(--h-muted); height: 100%; justify-content: flex-end; min-width: 0; }
.hm-lv i { display: block; width: 100%; border-radius: 8px 8px 4px 4px; background: var(--h-g); }
.hm-lv span { font-variant-numeric: tabular-nums; color: var(--h-ink); font-weight: 750; }
.hm-lv small { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hm-feed { display: flex; flex-direction: column; gap: 12px; margin: 0; padding: 0; list-style: none; }
.hm-feed li { display: flex; gap: 12px; align-items: flex-start; }
.hm-feed .hm-ic { width: 32px; height: 32px; border-radius: 9px; }
.hm-feed a { text-decoration: none; font-weight: 600; } .hm-feed a:hover { text-decoration: underline; }
.hm-feed small { display: block; color: var(--h-muted); }

/* Your modules */
.hm-modules { display: flex; flex-direction: column; gap: 12px; }
.hm-mods { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.hm-mod { background: var(--h-surface); border: 1px solid var(--h-line); border-radius: 16px; padding: 16px; display: flex; flex-direction: column; gap: 10px; transition: border-color .15s, transform .15s; }
.hm-mod:hover { border-color: var(--h-g); transform: translateY(-2px); }
.hm-mod-main { display: flex; flex-direction: column; gap: 8px; color: var(--h-ink) !important; text-decoration: none; }
.hm-mod-main strong { font-size: 1rem; } .hm-mod-main small { color: var(--h-muted); }
.hm-links { display: flex; flex-wrap: wrap; gap: 6px; }
.hm-links a { font-size: .875rem; background: var(--h-bg); border-radius: 999px; padding: 4px 10px; color: var(--h-ink) !important; text-decoration: none; border: 1px solid var(--h-line); }
.hm-links a:hover { border-color: var(--h-g); color: var(--h-g) !important; }
details.hm-soon { background: var(--h-surface); border: 1px dashed var(--h-line); border-radius: 14px; padding: 12px 16px; color: var(--h-muted); }
details.hm-soon summary { cursor: pointer; font-weight: 650; }
details.hm-soon p { margin: 10px 0 0; }

.hm a:focus-visible, .hm summary:focus-visible { outline: 3px solid var(--h-b); outline-offset: 2px; border-radius: 8px; }
@media (max-width: 1100px) { .hm-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .hm-grid2 { grid-template-columns: 1fr; } }
@media (max-width: 760px) { .hm-next { margin-left: 0; min-width: 0; width: 100%; } .hm-band { padding: 20px; } }
@media (max-width: 420px) { .hm-kpis { grid-template-columns: 1fr; } .hm-pipe li { grid-template-columns: 90px 1fr 28px; } }
@media (prefers-reduced-motion: reduce) { .hm *, .hm-act, .hm-mod { transition: none !important; } .hm-act:hover, .hm-mod:hover { transform: none; } }
/* U15: a module's icon chip beside its name (Business licence list, licence picker): 24px icons on cards and lists. */
.mm-module-name { display: inline-flex; align-items: center; gap: .6rem; }
.mm-module-chip { width: 2.25rem; height: 2.25rem; }
.mm-module-chip .mm-icon { width: 1.5rem; height: 1.5rem; }
