/* =====================================================================
   Learnly – Statistik og Profil (lag oven på styles.css + nordlys.css)
   ===================================================================== */

/* fælles overskrift i paneler */
.st-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 10px 16px; flex-wrap: wrap; margin-bottom: 18px; }
.st-head h2 { margin: 2px 0 0; font-size: 1.3rem; }
.st-head .eyebrow { color: var(--accent-ink); }
.panel + .panel, .pf-main > .panel + .panel { margin-top: 0; }

/* ---------- Statistik: toppen ---------- */
.st-hero { position: relative; isolation: isolate; overflow: hidden; border-radius: 38px; padding: clamp(28px, 4vw, 52px); color: #c9d4f2;
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 28px; align-items: center; background: var(--aurora); box-shadow: inset 0 1px 0 rgb(255 255 255 / .14), var(--lift-3); }
.st-hero::before { content: ''; position: absolute; inset: 0; z-index: -1; background-image: linear-gradient(rgb(255 255 255 / .05) 1px, transparent 1px), linear-gradient(90deg, rgb(255 255 255 / .05) 1px, transparent 1px); background-size: 48px 48px; -webkit-mask-image: radial-gradient(ellipse at 80% 40%, #000 15%, transparent 70%); mask-image: radial-gradient(ellipse at 80% 40%, #000 15%, transparent 70%); }
.st-hero .eyebrow { color: #9fb7ff; letter-spacing: .14em; }
.st-hero h1 { color: #fff; font-size: clamp(2.6rem, 5.4vw, 4.6rem); line-height: 1; letter-spacing: -.05em; margin: 12px 0 12px; text-shadow: 0 1px 0 #c8d6ff, 0 2px 0 #9fb3f0, 0 3px 0 #7a90da, 0 4px 0 #5a71c2, 0 16px 28px rgb(0 0 0 / .45); }
.st-hero p { max-width: 52ch; margin: 0 0 24px; font-size: 1.05rem; }
.st-big { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.st-big div { padding: 14px 14px 12px; border-radius: 18px; background: rgb(255 255 255 / .08); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); box-shadow: inset 0 1px 0 rgb(255 255 255 / .16), inset 0 0 0 1px rgb(255 255 255 / .08); }
.st-big b { display: block; color: #fff; font-family: var(--display); font-size: clamp(1.4rem, 2.4vw, 2rem); letter-spacing: -.04em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.st-big span { font-size: .76rem; color: #aebbe0; font-weight: 600; line-height: 1.3; display: block; }
.st-level { display: grid; justify-items: center; gap: 6px; padding: 22px 26px; border-radius: 30px; background: rgb(255 255 255 / .07); box-shadow: inset 0 1px 0 rgb(255 255 255 / .16), inset 0 0 0 1px rgb(255 255 255 / .08); text-align: center; }
.st-level .ring .ring-label strong { color: #fff; font-size: 3.2rem; letter-spacing: -.05em; text-shadow: 0 3px 0 #a8641a, 0 10px 18px rgb(0 0 0 / .35); }
.st-level .ring .ring-label small { color: #ffd98a; font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; }
.st-level .ring-val { filter: drop-shadow(0 0 10px rgb(255 182 39 / .7)) !important; }
.st-level > b { color: #fff; font-family: var(--display); font-size: 1.2rem; margin-top: 6px; }
.st-level > small { color: #aebbe0; font-size: .82rem; }

/* rækker af paneler */
.st-row { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(300px, 1fr); gap: 22px; margin-top: 24px; align-items: stretch; }
.st-row.even { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
.st-chart .chart { margin-top: 4px; }
.st-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: .76rem; color: var(--ink-2); font-weight: 600; }
.st-legend span { display: inline-flex; align-items: center; gap: 6px; }
.st-legend i { width: 12px; height: 12px; border-radius: 4px; display: inline-block; }
.lg-ok { background: linear-gradient(#6fe0a4, #1fa463); } .lg-xp { background: linear-gradient(#8f7bff, #3d6bff); } .lg-goal { background: repeating-linear-gradient(90deg, var(--gold) 0 3px, transparent 3px 5px); height: 3px !important; }
/* aktivitetskalender */
.heat { display: grid; gap: 10px; }
.heat-days, .heat-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 7px; }
.heat-days span { text-align: center; font-size: .7rem; font-weight: 750; color: var(--ink-3); }
.heat-grid i, .heat-key i { aspect-ratio: 1; border-radius: 9px; background: rgb(11 20 51 / .06); box-shadow: inset 0 1px 2px rgb(11 20 51 / .08); transition: transform .3s var(--spring); }
.heat-grid i:hover { transform: scale(1.15); }
.heat-grid .h1, .heat-key .h1 { background: #cfdcff; box-shadow: none; }
.heat-grid .h2, .heat-key .h2 { background: linear-gradient(145deg, #8fb0ff, #5b86ff); box-shadow: 0 4px 10px -6px rgb(61 107 255 / .8); }
.heat-grid .h3, .heat-key .h3 { background: linear-gradient(145deg, #6fe0a4, #1fa463); box-shadow: 0 4px 10px -6px rgb(31 164 99 / .9); }
.heat-grid .now { outline: 2px solid var(--ink); outline-offset: 2px; }
.heat-key { display: flex; align-items: center; justify-content: flex-end; gap: 5px; font-size: .72rem; color: var(--ink-3); font-weight: 600; margin-top: 4px; }
.heat-key i { width: 14px; height: 14px; border-radius: 4px; aspect-ratio: auto; }

/* forståelse */
.understanding { margin-top: 24px; }
.understanding .u-grid { margin-top: 0; gap: 14px; }
.u-tile { position: relative; overflow: hidden; display: grid; gap: 8px; align-content: start; padding: 18px; border-radius: 22px; background: var(--u-bg); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--u-c) 18%, transparent); }
.u-tile.ok { --u-c: #1fa463; --u-bg: linear-gradient(160deg, #eafaf1, #f7fdf9); }
.u-tile.bad { --u-c: #db4148; --u-bg: linear-gradient(160deg, #fff0f1, #fffafa); }
.u-tile.blue { --u-c: #3d6bff; --u-bg: linear-gradient(160deg, #ebf1ff, #f8faff); }
.u-tile.lav { --u-c: #8f7bff; --u-bg: linear-gradient(160deg, #f2eeff, #fbfaff); }
.u-tile .u-ic { position: absolute; right: 14px; top: 14px; width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; color: #fff; background: linear-gradient(145deg, color-mix(in srgb, var(--u-c) 55%, #fff), var(--u-c)); box-shadow: inset 0 1px 0 rgb(255 255 255 / .4), 0 8px 14px -6px var(--u-c); }
.u-tile .u-ic svg { width: 19px; height: 19px; }
.u-tile .eyebrow { color: color-mix(in srgb, var(--u-c) 70%, #000); padding-right: 44px; }
.u-tile .u-num { font-family: var(--display); font-size: 2.6rem; color: var(--ink); line-height: 1; }
.u-help { display: flex; gap: 10px; align-items: flex-start; margin: 18px 0 0; padding: 12px 14px; border-radius: 16px; background: var(--accent-soft); font-size: .88rem; color: var(--ink-2); }
.u-help svg { width: 18px; height: 18px; color: var(--accent); flex: none; margin-top: 1px; }
.recs { margin-top: 18px; display: grid; gap: 10px; }
.recs .fb-list li { padding: 12px 14px; border-radius: 16px; background: #fff; box-shadow: var(--lift-1), inset 0 0 0 1px var(--line-2); align-items: center; }
.recs .fb-list .ic.warn { background: linear-gradient(145deg, #ffd36e, #f29b1d); color: #fff; width: 26px; height: 26px; }

/* fag for fag */
.st-subjects { margin-top: 24px; }
.sj-table { display: grid; gap: 8px; }
.sj-row { display: grid; grid-template-columns: auto minmax(140px, 1fr) minmax(0, 2fr) 56px; gap: 18px; align-items: center; padding: 10px 14px 10px 10px; border-radius: 18px; color: var(--ink); transition: background .2s, transform .3s var(--ease); }
.sj-row:hover { color: var(--ink); background: rgb(255 255 255 / .7); transform: translateX(3px); }
.sj-row .s-tile { width: 44px; height: 44px; border-radius: 14px; }
.sj-row .s-tile svg { width: 22px; height: 22px; }
.sj-name { display: grid; min-width: 0; }
.sj-name small { color: var(--ink-2); font-size: .78rem; }
.sj-prog { display: grid; grid-template-columns: minmax(0, 1fr) 46px; gap: 12px; align-items: center; }
.sj-prog .progress { height: 10px; }
.sj-prog span { font-weight: 800; font-size: .86rem; text-align: right; font-variant-numeric: tabular-nums; }
.sj-score { display: grid; place-items: center; }
.sj-score .ring .ring-label strong { font-size: .86rem; } .sj-score .ring .ring-label small { font-size: .5rem; }
.sj-none { color: var(--ink-3); font-weight: 800; }

/* historik som tidslinje */
.hist { list-style: none; margin: 0; padding: 0 0 0 6px; position: relative; display: grid; gap: 12px; }
.hist::before { content: ''; position: absolute; left: 27px; top: 12px; bottom: 12px; width: 2px; background: linear-gradient(var(--line), transparent); }
.hist li { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 12px; align-items: center; position: relative; }
.hist .hx { width: 44px; height: 30px; border-radius: 10px; display: grid; place-items: center; font-weight: 800; font-size: .76rem; color: #7a4300; background: linear-gradient(180deg, #fff1c9, #ffd36e); box-shadow: inset 0 1px 0 rgb(255 255 255 / .8), 0 3px 0 #f0c25a; z-index: 1; }
.hist b { display: block; font-size: .9rem; font-weight: 650; }
.hist small { color: var(--ink-3); font-size: .76rem; }

/* ---------- Profil ---------- */
.prof-head { grid-template-columns: auto minmax(0, 1fr) auto; }
.pf-avatar { position: relative; width: 124px; height: 124px; display: grid; place-items: center; }
.pf-avatar .ring { position: absolute; inset: 0; }
.pf-avatar .ring-val { filter: drop-shadow(0 0 8px rgb(255 182 39 / .7)) !important; }
.prof-head .pf-avatar .avatar { width: 96px; height: 96px; font-size: 2.6rem; }
.pf-lv { position: absolute; bottom: -6px; left: 50%; transform: translateX(-50%); padding: 4px 10px; border-radius: 999px; font-size: .72rem; font-weight: 800; color: #5a3500; background: linear-gradient(180deg, #ffe9a8, #ffc246); box-shadow: 0 6px 14px -6px rgb(242 155 29 / .9); white-space: nowrap; }
.prof-head .eyebrow { color: #9fb7ff; letter-spacing: .14em; }
.prof-head h1 { margin: 6px 0 10px; }
.pf-mail { margin-top: 10px; color: #aebbe0; }
.pf-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 24px; align-items: start; }
.pf-main { display: grid; gap: 22px; min-width: 0; }
.pf-side { display: grid; gap: 18px; position: sticky; top: 100px; }
.pf-side h2 { font-size: 1.2rem; margin-bottom: 14px; }
.pf-side .eyebrow { color: var(--accent-ink); }
.pf-side form .small.muted { margin: -4px 0 14px; }
.pf-level .st-head { margin-bottom: 12px; }
.pf-lvbar { display: grid; gap: 8px; }
.pf-lvbar .progress { height: 14px; }
.pf-sw { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.pf-sw-h { display: flex; align-items: center; gap: 8px; font-size: .95rem; margin: 0 0 12px; }
.pf-sw-h svg { width: 18px; height: 18px; padding: 3px; border-radius: 7px; color: #fff; box-sizing: content-box; }
.pf-sw-h.ok svg { background: linear-gradient(145deg, #6fe0a4, #1fa463); }
.pf-sw-h.mid svg { background: linear-gradient(145deg, #ffd36e, #f29b1d); }
.pf-subj { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px; margin-bottom: 8px; border-radius: 16px; color: var(--ink); background: rgb(255 255 255 / .6); box-shadow: inset 0 0 0 1px var(--line-2); transition: transform .3s var(--ease), box-shadow .3s; }
.pf-subj:hover { color: var(--ink); transform: translateY(-2px); box-shadow: var(--lift-1), inset 0 0 0 1px var(--line); }
.pf-subj .s-tile { width: 40px; height: 40px; border-radius: 13px; }
.pf-subj .s-tile svg { width: 20px; height: 20px; }
.pf-subj .row { margin-bottom: 6px; flex-wrap: nowrap; }
.pf-subj b { font-size: .9rem; }
.pf-subj .ok { color: var(--ok); font-weight: 800; font-size: .86rem; } .pf-subj .mid { color: #c77d00; font-weight: 800; font-size: .86rem; }
.pf-go { font-size: .76rem; font-weight: 800; color: var(--accent-ink); padding: 6px 10px; border-radius: 999px; background: var(--accent-soft); }
.pf-courses { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.pf-course { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px; border-radius: 18px; color: var(--ink); background: rgb(255 255 255 / .6); box-shadow: inset 0 0 0 1px var(--line-2); transition: transform .3s var(--ease); }
.pf-course:hover { color: var(--ink); transform: translateY(-2px); }
.pf-course .s-tile { width: 42px; height: 42px; border-radius: 13px; }
.pf-course .s-tile svg { width: 20px; height: 20px; }
.pf-course b { display: block; font-size: .88rem; margin-bottom: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pf-pct { font-weight: 800; font-size: .84rem; }
.pf-achbar { width: 180px; }
.pf-date { color: var(--ok); font-weight: 700; margin-top: 4px; }
.res-row.sm { grid-template-columns: minmax(0, 1fr) auto; padding: 10px 12px; }

/* ---------- brudpunkter ---------- */
@media (max-width: 1280px) {
  .st-big { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .pf-layout { grid-template-columns: minmax(0, 1fr) 320px; }
  .pf-courses { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 1099px) {
  .st-row, .st-row.even { grid-template-columns: minmax(0, 1fr); }
  .pf-layout { grid-template-columns: minmax(0, 1fr); }
  .pf-side { position: static; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); align-items: start; }
  .pf-side > .btn { grid-column: 1 / -1; }
}
@media (max-width: 900px) { .st-hero { grid-template-columns: minmax(0, 1fr); } .st-level { grid-auto-flow: column; justify-content: start; align-items: center; text-align: left; } .st-level .ring { zoom: .7; } }
@media (max-width: 767px) {
  .st-hero { border-radius: 28px; padding: 26px 20px; }
  .st-hero h1 { font-size: clamp(2.3rem, 11vw, 3rem); }
  .st-big { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .st-big div:last-child { grid-column: 1 / -1; }
  .st-level { grid-auto-flow: row; justify-content: center; text-align: center; }
  .understanding .u-grid { grid-template-columns: minmax(0, 1fr); }
  .sj-row { grid-template-columns: auto minmax(0, 1fr) 50px; gap: 12px; }
  .sj-prog { grid-column: 1 / -1; grid-row: 2; }
  .pf-sw { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .pf-achbar { width: 100%; }
  .prof-head { grid-template-columns: minmax(0, 1fr); justify-items: start; }
  .pf-avatar { width: 96px; height: 96px; }
  .pf-avatar .ring { zoom: .78; }
  .prof-head .pf-avatar .avatar { width: 74px; height: 74px; font-size: 2rem; }
  .prof-nums { width: 100%; }
}
@media (max-width: 900px) and (min-width: 768px) { .prof-head { grid-template-columns: auto minmax(0, 1fr); } .prof-nums { grid-column: 1 / -1; } }
.heat-days, .heat-grid { grid-template-columns: repeat(7, minmax(0, 36px)); justify-content: space-between; gap: 6px; }
.st-head .see-all { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: .9rem; } .st-head .see-all svg { width: 17px; height: 17px; transition: transform .3s var(--spring); } .st-head .see-all:hover svg { transform: translateX(3px); }
