/* PBUHub — SATU gaya dashboard untuk semua modul (arahan pemilik 10/11).
   Hierarki: JUMLAH (jubin kecerunan warna modul, nombor putih besar) → KATEGORI (kad putih, aksen warna di atas)
   → PECAHAN (kad putih kecil + bar & peratus). Kad statistik sedia ada (stat-card, ed-stat, ea-kpi, yr-card, ed-card)
   diselaraskan kepada bahasa yang sama: jejari 16px, sempadan halus, bayang lembut, nombor tebal, label huruf besar kecil. */
.app-shell { --dc-radius: 16px; --dc-border: #e4e9f2; --dc-shadow: 0 6px 18px rgba(15, 23, 42, .06); --dc-ink: #14213d; --dc-muted: #64748b; }

/* ---- Tajuk & susun atur ---- */
.dash-section { margin: 0 0 24px; }
.dash-section-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 12px; }
.dash-section-head h2 { display: flex; align-items: center; gap: 10px; margin: 0; font-size: .78rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--dc-ink); }
.dash-section-head h2::before { content: ""; width: 22px; height: 3px; border-radius: 3px; background: #F8B814; }
.dash-section-head small { font-size: .74rem; color: var(--dc-muted); }
.dash-title { display: flex; align-items: center; gap: 12px; margin: 0 0 16px; font-size: .95rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--dc-ink); }
.dash-title::before { content: ""; width: 6px; height: 22px; border-radius: 6px; background: linear-gradient(180deg, var(--mb-3), var(--mb-1)); }
.dash-title::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, #F8B814, transparent); }
.dash-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 14px; }
.dash-stack { display: grid; gap: 14px; }
.dash-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.dash-tiles.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.dash-tiles.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.dash-tiles > .dash-total { grid-row: span 2; }
.dash-parts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; align-content: stretch; }
.dash-parts.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.dash-parts.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* ---- Warna aksen ---- */
.dash-tone-blue, .stat-card--blue { --t: #2563eb; --t-soft: #e8f0fe; }
.dash-tone-yellow, .stat-card--orange, .dash-tone-orange { --t: #d97706; --t-soft: #fff4de; }
.dash-tone-purple, .stat-card--purple { --t: #7c3aed; --t-soft: #f1eafe; }
.dash-tone-green, .stat-card--green { --t: #16a34a; --t-soft: #e6f6ec; }
.dash-tone-teal, .stat-card--teal { --t: #0d9488; --t-soft: #e0f5f2; }
.dash-tone-red, .stat-card--red { --t: #dc2626; --t-soft: #fde8e8; }
.dash-tone-gray { --t: #64748b; --t-soft: #f1f4f8; }

/* ---- JUMLAH: jubin kecerunan warna modul ---- */
.dash-total { position: relative; display: flex; flex-direction: column; justify-content: center; gap: 6px; min-height: 150px; padding: 24px 26px; overflow: hidden;
    border-radius: var(--dc-radius); color: #fff; text-decoration: none; background: linear-gradient(135deg, var(--mb-1) 0%, var(--mb-2) 60%, var(--mb-3) 100%);
    box-shadow: 0 14px 30px var(--mb-shadow); transition: transform .15s ease; }
.dash-total::before { content: ""; position: absolute; right: -50px; top: -60px; width: 190px; height: 190px; border-radius: 50%; background: rgba(255, 255, 255, .08); }
.dash-total::after { content: ""; position: absolute; right: 40px; bottom: -70px; width: 130px; height: 130px; border-radius: 50%; background: rgba(255, 255, 255, .05); }
.dash-total .dash-icon { position: absolute; right: 20px; top: 16px; z-index: 1; font-size: 1.5rem; color: rgba(255, 255, 255, .75); }
.dash-total span { position: relative; z-index: 1; order: -1; font-size: .72rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--mb-eyebrow); }
.dash-total strong { position: relative; z-index: 1; font-size: clamp(2.8rem, 6vw, 4.2rem); font-weight: 900; line-height: 1; letter-spacing: -.03em; color: #fff; font-variant-numeric: tabular-nums; }
.dash-total small { position: relative; z-index: 1; font-size: .8rem; color: rgba(255, 255, 255, .8); }
.dash-total.is-xl strong { font-size: clamp(3.2rem, 8vw, 5rem); }
a.dash-total:hover { transform: translateY(-2px); color: #fff; }

/* ---- KATEGORI & kad statistik sedia ada: kad putih + aksen atas ---- */
.dash-tile, .app-shell .stat-card, .app-shell .ed-stat, .app-shell .ea-kpi, .app-shell .yr-card, .app-shell .ed-card {
    position: relative; background: #fff !important; border: 1px solid var(--dc-border) !important; border-radius: var(--dc-radius) !important; box-shadow: var(--dc-shadow) !important; overflow: hidden; }
.dash-tile::before, .app-shell .stat-card::before, .app-shell .ed-stat::before, .app-shell .yr-card::before {
    content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--t, var(--mb-3)); }
.dash-tile { display: flex; flex-direction: column; justify-content: center; gap: 6px; min-height: 96px; padding: 18px 20px; text-decoration: none; color: var(--dc-ink); transition: transform .15s ease, box-shadow .15s ease; }
.dash-tile strong { font-size: clamp(1.9rem, 3.4vw, 2.4rem); font-weight: 900; line-height: 1; color: var(--dc-ink); font-variant-numeric: tabular-nums; }
.dash-tile span { order: -1; font-size: .68rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--dc-muted); }
a.dash-tile:hover, .app-shell a.ed-stat:hover { transform: translateY(-2px); box-shadow: 0 12px 26px rgba(15, 23, 42, .1) !important; color: var(--dc-ink); }
.app-shell .stat-card .stat-value, .app-shell .ed-stat strong, .app-shell .ea-kpi strong, .app-shell .yr-card strong { font-weight: 900; color: var(--dc-ink); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.app-shell .stat-card .stat-label, .app-shell .ed-stat .ed-stat-label, .app-shell .ea-kpi small, .app-shell .yr-card small {
    font-size: .68rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--dc-muted); }
.app-shell .stat-card .stat-icon { background: var(--t-soft, #eef2f7) !important; color: var(--t, var(--mb-3)) !important; box-shadow: none !important; }

/* ---- PECAHAN: kad putih kecil + bar & peratus ---- */
.dash-part { position: relative; display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 2px 8px; min-height: 78px; padding: 14px 16px 18px; overflow: hidden;
    background: #fff; border: 1px solid var(--dc-border); border-radius: 14px; box-shadow: var(--dc-shadow); text-decoration: none; color: var(--dc-ink); transition: transform .15s ease, border-color .15s ease; }
.dash-part span { grid-column: 1 / -1; order: -1; font-size: .66rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--dc-muted); }
.dash-part strong { font-size: 1.55rem; font-weight: 900; line-height: 1; color: var(--dc-ink); font-variant-numeric: tabular-nums; }
.dash-part em { font-style: normal; font-size: .72rem; font-weight: 800; padding: 2px 8px; border-radius: 999px; background: #eef2f7; color: var(--mb-2); }
.dash-part::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 5px; background: #eef2f7; }
.dash-part i.dash-bar { position: absolute; left: 0; bottom: 0; z-index: 1; height: 5px; border-radius: 0 5px 5px 0; background: linear-gradient(90deg, var(--mb-2), var(--mb-3)); }
.dash-part.is-zero strong { color: #a8b3c4; }
a.dash-part:hover { transform: translateY(-1px); border-color: var(--mb-3); color: var(--dc-ink); }

@media (max-width: 991.98px) {
    .dash-parts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .dash-tiles.cols-3, .dash-tiles.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dash-tiles > .dash-total { grid-row: auto; grid-column: 1 / -1; }
}
@media (max-width: 575.98px) {
    .dash-split { grid-template-columns: 1fr; }
    .dash-parts, .dash-parts.cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dash-total { min-height: 120px; padding: 20px; }
}

/* Catatan kecil di bawah nombor pecahan (x-dash.part :note), cth "3 aktif". */
.dash-part small { grid-column: 1 / -1; font-size: .7rem; font-weight: 700; color: var(--dc-muted); }

/* ---- Graf (x-dash.chart) — kad putih sama seperti pecahan; grid dua lajur ---- */
.dash-charts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.dash-charts.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.dash-charts > .is-wide { grid-column: 1 / -1; }
.dash-chart { margin: 0; padding: 16px 18px 14px; background: #fff; border: 1px solid var(--dc-border); border-radius: var(--dc-radius); box-shadow: var(--dc-shadow); min-width: 0; }
.dash-chart figcaption { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 0 0 10px; }
.dash-chart figcaption strong { font-size: .72rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--dc-ink); }
.dash-chart figcaption small { font-size: .72rem; color: var(--dc-muted); text-align: right; }
.dash-chart-box { position: relative; }
.dash-chart-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: #a8b3c4; font-size: .8rem; }
.dash-chart-empty i { font-size: 1.8rem; }
/* Makluman ringkas di atas dashboard (cth rekod menunggu pengesahan). */
.dash-note { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 18px; padding: 10px 14px; border: 1px solid var(--dc-border); border-left: 4px solid #F8B814; border-radius: 12px; background: #fffdf5; color: #5b4a12; font-size: .82rem; }
.dash-note a { font-weight: 700; }
/* Senarai ringkas dalam kad dashboard. */
.dash-list { margin: 0; padding: 0; list-style: none; background: #fff; border: 1px solid var(--dc-border); border-radius: var(--dc-radius); box-shadow: var(--dc-shadow); overflow: hidden; }
.dash-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; border-top: 1px solid #f1f4f8; font-size: .84rem; }
.dash-list li:first-child { border-top: 0; }
.dash-list li a { font-weight: 700; color: var(--dc-ink); text-decoration: none; min-width: 0; }
.dash-list li a:hover { color: var(--mb-3); }
.dash-list li small { color: var(--dc-muted); white-space: nowrap; }
@media (max-width: 991.98px) { .dash-charts.cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 767.98px) { .dash-charts, .dash-charts.cols-3 { grid-template-columns: 1fr; } }
@media print { .dash-chart { break-inside: avoid; box-shadow: none; } }

/* ---- SENARAI BERPERINGKAT <x-dash.rank> (10/11): pecahan kategori = bar mendatar HTML, satu warna (--dash-accent, lalai warna modul).
   Nama & nilai teks biasa (dakwat), bar ≤ 8px, hujung data bulat 4px, tapak rata. Ganti grid jubin pecahan yang panjang. ---- */
.dash-rank { margin: 0; padding: 16px 18px 14px; background: #fff; border: 1px solid var(--dc-border); border-radius: var(--dc-radius); box-shadow: var(--dc-shadow); min-width: 0; }
.dash-rank.is-bare { padding: 0; border: 0; border-radius: 0; box-shadow: none; background: transparent; }
.dash-rank figcaption { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 0 0 12px; }
.dash-rank figcaption strong { font-size: .72rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--dc-ink); }
.dash-rank figcaption small { font-size: .72rem; color: var(--dc-muted); text-align: right; white-space: nowrap; }
.dash-rank-list { list-style: none; margin: 0; padding: 0; }
.dash-rank-list.cols-2 { columns: 2; column-gap: 32px; }
.dash-rank-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: 4px 12px; padding: 0 0 10px; break-inside: avoid; }
.dash-rank-list li:last-child { padding-bottom: 0; }
.dash-rank-label { font-size: .82rem; font-weight: 600; color: var(--dc-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-rank-value { font-size: .84rem; font-weight: 800; color: var(--dc-ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.dash-rank-value small { display: inline-block; min-width: 2.7em; margin-left: 6px; font-size: .74rem; font-weight: 600; color: var(--dc-muted); text-align: right; }
.dash-rank-track { grid-column: 1 / -1; height: 8px; border-radius: 0 4px 4px 0; background: #eef2f7; }
.dash-rank-track i { display: block; height: 100%; border-radius: 0 4px 4px 0; background: var(--dash-accent, var(--mb-2)); }
.dash-rank-list li.is-zero .dash-rank-value, .dash-rank-list li.is-rest .dash-rank-label, .dash-rank-list li.is-rest .dash-rank-value { color: var(--dc-muted); font-weight: 600; }
.dash-rank-empty { display: flex; align-items: center; gap: 8px; min-height: 64px; color: #a8b3c4; font-size: .8rem; }
.dash-rank-empty i { font-size: 1.3rem; }
@media (max-width: 767.98px) { .dash-rank-list.cols-2 { columns: 1; } }

/* ---- BAR BERSEGMEN <x-dash.split> (10/11): komposisi 2–6 bahagian sekali pandang. Bar 28px, segmen 4px bucu, sela 2px warna permukaan,
   peratus di dalam segmen; legenda nama + bilangan ikut susunan segmen. Warna = palet kategori (dalam komponen). ---- */
.dash-seg { margin: 0; padding: 16px 18px 14px; background: #fff; border: 1px solid var(--dc-border); border-radius: var(--dc-radius); box-shadow: var(--dc-shadow); min-width: 0; }
.dash-seg.is-bare { padding: 0; border: 0; border-radius: 0; box-shadow: none; background: transparent; }
.dash-seg figcaption { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 0 0 12px; }
.dash-seg figcaption strong { font-size: .72rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--dc-ink); }
.dash-seg figcaption small { font-size: .72rem; color: var(--dc-muted); text-align: right; white-space: nowrap; }
.dash-seg-bar { display: flex; gap: 2px; height: 28px; }
.dash-seg-bar span { display: flex; align-items: center; min-width: 3px; padding: 0 0 0 7px; overflow: hidden; border-radius: 4px; font-size: .72rem; font-weight: 800; line-height: 1; white-space: nowrap; font-variant-numeric: tabular-nums; }
.dash-seg-bar span:focus-visible { outline: 2px solid var(--dc-ink); outline-offset: 2px; }
.dash-seg-legend { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px 24px; list-style: none; margin: 14px 0 0; padding: 0; }
.dash-seg-legend li { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; align-items: center; gap: 8px; font-size: .82rem; color: var(--dc-ink); }
.dash-seg-legend li i { width: 10px; height: 10px; border-radius: 3px; }
.dash-seg-legend li span { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-seg-legend li b { font-weight: 800; font-variant-numeric: tabular-nums; }
.dash-seg-legend li.is-zero span, .dash-seg-legend li.is-zero b { color: var(--dc-muted); font-weight: 600; }
@media (max-width: 575.98px) { .dash-seg-legend { grid-template-columns: 1fr; } }

/* ---- CARTA DONAT <x-dash.donut> (10/11): komposisi 3–10 bahagian; jumlah di tengah; legenda HTML = nama · bilangan · % setiap bahagian. ---- */
.dash-donut { margin: 0; padding: 16px 18px 14px; background: #fff; border: 1px solid var(--dc-border); border-radius: var(--dc-radius); box-shadow: var(--dc-shadow); min-width: 0; }
.dash-donut.is-bare { padding: 0; border: 0; border-radius: 0; box-shadow: none; background: transparent; }
.dash-donut > figcaption { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 0 0 12px; }
.dash-donut > figcaption strong { font-size: .72rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--dc-ink); }
.dash-donut > figcaption small { font-size: .72rem; color: var(--dc-muted); text-align: right; white-space: nowrap; }
.dash-donut-body { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 18px; align-items: center; }
.dash-donut-body .dash-chart { padding: 0; border: 0; border-radius: 0; box-shadow: none; background: transparent; }
.dash-donut-legend { display: grid; gap: 7px; list-style: none; margin: 0; padding: 0; }
.dash-donut-legend li { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto 2.9em; align-items: center; gap: 8px; font-size: .82rem; color: var(--dc-ink); }
.dash-donut-legend li i { width: 10px; height: 10px; border-radius: 3px; }
.dash-donut-legend li span { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-donut-legend li b { font-weight: 800; font-variant-numeric: tabular-nums; }
.dash-donut-legend li small { font-size: .74rem; font-weight: 600; color: var(--dc-muted); text-align: right; font-variant-numeric: tabular-nums; }
.dash-donut-legend li.is-zero span, .dash-donut-legend li.is-zero b { color: var(--dc-muted); font-weight: 600; }
.dash-donut.is-bare .dash-donut-body { grid-template-columns: 120px minmax(0, 1fr); gap: 14px; }
@media (max-width: 575.98px) { .dash-donut-body, .dash-donut.is-bare .dash-donut-body { grid-template-columns: 1fr; justify-items: center; } .dash-donut-legend { width: 100%; } }

/* ---- CINCIN BERLAPIS <x-dash.rings> (10/11 malam, gaya contoh pemilik): komposisi 3–4 bahagian, cincin = peratus, legenda nombor besar ---- */
.dash-rings { margin: 0; padding: 16px 18px 14px; background: #fff; border: 1px solid var(--dc-border); border-radius: var(--dc-radius); box-shadow: var(--dc-shadow); min-width: 0; }
.dash-rings.is-bare { padding: 0; border: 0; border-radius: 0; box-shadow: none; background: transparent; }
.dash-rings > figcaption { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 0 0 12px; }
.dash-rings > figcaption strong { font-size: .72rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--dc-ink); }
.dash-rings > figcaption small { font-size: .72rem; color: var(--dc-muted); text-align: right; white-space: nowrap; }
.dash-rings-body { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 20px; align-items: center; }
.dash-rings-svg { display: block; max-width: 100%; height: auto; }
.dash-rings-track { fill: none; stroke: #edf1f7; }
.dash-rings-arc { fill: none; stroke-linecap: round; transition: stroke-dasharray .6s ease; }
.dash-rings-legend { display: grid; gap: 10px; list-style: none; margin: 0; padding: 0; }
.dash-rings-legend li { display: grid; grid-template-columns: 10px auto 1fr; grid-template-rows: auto auto; column-gap: 8px; align-items: baseline; color: var(--dc-ink); }
.dash-rings-legend li i { grid-row: 1 / 3; align-self: center; width: 10px; height: 10px; border-radius: 50%; }
.dash-rings-legend li b { font-size: 1.35rem; font-weight: 800; line-height: 1.05; font-variant-numeric: tabular-nums; }
.dash-rings-legend li small { font-size: .74rem; font-weight: 700; color: var(--dc-muted); font-variant-numeric: tabular-nums; }
.dash-rings-legend li span { grid-column: 2 / -1; font-size: .66rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--dc-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-rings-legend li.is-zero b { color: var(--dc-muted); }
@media (max-width: 575.98px) { .dash-rings-body { grid-template-columns: 1fr; justify-items: center; } .dash-rings-legend { width: 100%; grid-template-columns: repeat(2, minmax(0, 1fr)); } }
