/* =========================================================
   TABISABA — Progress Belajarku (tahap 23)
   Kartu di Profil, halaman /progress-belajar, dan /progress-belajar/detail.
   Hanya kelas lp-* (tidak mengubah gaya global).
   ========================================================= */
.lp-page {
  --lp-buku: #0f8a6c;
  --lp-buku-soft: #e2f3ed;
  --lp-podcast: #c98a12;
  --lp-podcast-soft: #fbf0d9;
  --lp-artikel: #3b82f6;
  --lp-artikel-soft: #e6effe;
  --lp-academy: #8b5cf6;
  --lp-academy-soft: #efe9fe;
}
.lp-card {
  --lp-buku: #0f8a6c;
  --lp-buku-soft: #e2f3ed;
  --lp-podcast: #c98a12;
  --lp-podcast-soft: #fbf0d9;
  --lp-artikel: #3b82f6;
  --lp-artikel-soft: #e6effe;
  --lp-academy: #8b5cf6;
  --lp-academy-soft: #efe9fe;
}

/* ---------- Warna kategori ---------- */
.lp-tone--buku { background: var(--lp-buku-soft); color: var(--lp-buku); }
.lp-tone--podcast { background: var(--lp-podcast-soft); color: var(--lp-podcast); }
.lp-tone--artikel { background: var(--lp-artikel-soft); color: var(--lp-artikel); }
.lp-tone--academy { background: var(--lp-academy-soft); color: var(--lp-academy); }
.lp-bg--buku { background: var(--lp-buku); }
.lp-bg--podcast { background: var(--lp-podcast); }
.lp-bg--artikel { background: var(--lp-artikel); }
.lp-bg--academy { background: var(--lp-academy); }
.lp-fill--buku { stroke: var(--lp-buku); }
.lp-fill--podcast { stroke: var(--lp-podcast); }
.lp-fill--artikel { stroke: var(--lp-artikel); }
.lp-fill--academy { stroke: var(--lp-academy); }

.lp-progress { margin: 0; }
.lp-progress--buku::-webkit-progress-value { background: var(--lp-buku); }
.lp-progress--buku::-moz-progress-bar { background: var(--lp-buku); }
.lp-progress--buku::-webkit-progress-bar { background: var(--lp-buku-soft); }
.lp-progress--podcast::-webkit-progress-value { background: var(--lp-podcast); }
.lp-progress--podcast::-moz-progress-bar { background: var(--lp-podcast); }
.lp-progress--podcast::-webkit-progress-bar { background: var(--lp-podcast-soft); }
.lp-progress--artikel::-webkit-progress-value { background: var(--lp-artikel); }
.lp-progress--artikel::-moz-progress-bar { background: var(--lp-artikel); }
.lp-progress--artikel::-webkit-progress-bar { background: var(--lp-artikel-soft); }
.lp-progress--academy::-webkit-progress-value { background: var(--lp-academy); }
.lp-progress--academy::-moz-progress-bar { background: var(--lp-academy); }
.lp-progress--academy::-webkit-progress-bar { background: var(--lp-academy-soft); }
.lp-progress--buku { background: var(--lp-buku-soft); }
.lp-progress--podcast { background: var(--lp-podcast-soft); }
.lp-progress--artikel { background: var(--lp-artikel-soft); }
.lp-progress--academy { background: var(--lp-academy-soft); }

/* =========================================================
   Kartu di Profil
   ========================================================= */
.lp-card { display: flex; flex-direction: column; gap: var(--space-3); }
.lp-card__head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); }
.lp-card__title { display: flex; align-items: center; gap: var(--space-2); margin: 0; font-size: var(--text-base); font-weight: var(--weight-bold); color: var(--color-text); }
.lp-card__title .icon { color: var(--color-primary); }
.lp-card__more { display: inline-flex; align-items: center; gap: 2px; min-height: 36px; padding: 0 var(--space-1); font-size: var(--text-sm); font-weight: var(--weight-semibold); color: var(--color-primary); white-space: nowrap; }
.lp-card__more .icon { width: 16px; height: 16px; }
.lp-card__hero { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--space-2); padding: var(--space-3); border-radius: var(--radius-md); background: var(--color-primary-soft); }
.lp-card__time { display: flex; flex-direction: column; min-width: 0; }
.lp-card__time strong { font-size: var(--text-3xl); font-weight: var(--weight-extrabold); line-height: 1.1; color: var(--color-primary-dark); }
.lp-card__time span { font-size: var(--text-xs); color: var(--color-text-muted); }

.lp-chip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: var(--radius-full); font-size: var(--text-xs); font-weight: var(--weight-semibold); background: var(--color-surface); }
.lp-chip .icon { width: 14px; height: 14px; flex: none; }
.lp-chip--up { color: var(--color-success); }
.lp-chip--down { color: var(--color-rose); }

.lp-rows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-3); }
.lp-row { display: flex; align-items: center; gap: var(--space-3); }
.lp-row__icon, .lp-cat__icon { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 36px; height: 36px; border-radius: var(--radius-sm); }
.lp-row__icon .icon { width: 18px; height: 18px; }
.lp-row__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.lp-row__top { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-2); font-size: var(--text-sm); }
.lp-row__name { font-weight: var(--weight-semibold); color: var(--color-text); }
.lp-row__value { color: var(--color-text-muted); font-size: var(--text-xs); text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }

.lp-target { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3); border: 1px solid var(--color-border); border-radius: var(--radius-md); color: var(--color-text); }
.lp-target:hover { border-color: var(--color-primary); }
.lp-target__icon { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 36px; height: 36px; border-radius: var(--radius-sm); background: var(--color-gold-soft); color: var(--color-gold-strong); }
.lp-target__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.lp-target__top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px var(--space-2); font-size: var(--text-sm); font-weight: var(--weight-semibold); }
.lp-target__top span + span { color: var(--color-text-muted); font-weight: var(--weight-medium); font-size: var(--text-xs); }
.lp-target__hint { font-size: var(--text-xs); color: var(--color-text-muted); }
.lp-target__pct { font-size: var(--text-lg); color: var(--color-primary); }
.lp-target--empty { border-style: dashed; }
.lp-target > .icon { color: var(--color-text-muted); flex: none; }

.lp-empty { display: flex; flex-direction: column; align-items: center; gap: var(--space-2); padding: var(--space-3) var(--space-2); text-align: center; }
.lp-empty__art { display: inline-flex; align-items: center; justify-content: center; width: 56px; height: 56px; border-radius: 50%; background: var(--color-primary-soft); color: var(--color-primary); }
.lp-empty__art .icon { width: 28px; height: 28px; }
.lp-empty__title { margin: 0; font-weight: var(--weight-bold); }
.lp-empty__text { margin: 0; font-size: var(--text-sm); color: var(--color-text-muted); max-width: 34ch; }
.lp-empty__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-2); margin-top: var(--space-1); }
.lp-empty--block { padding: var(--space-6) var(--space-3); background: var(--color-surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-md); }

.lp-card--error { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; }
.lp-card--error p { display: flex; align-items: center; gap: var(--space-2); margin: 0; font-size: var(--text-sm); color: var(--color-text-muted); }
.lp-card--error p .icon { color: var(--color-rose); }

/* =========================================================
   Halaman Progress Belajarku
   ========================================================= */
.lp-page { display: flex; flex-direction: column; gap: var(--space-4); padding-bottom: var(--space-8); }
.lp-page > [data-lp-body] { display: flex; flex-direction: column; gap: var(--space-4); }

.lp-periods { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; padding: 4px; border-radius: var(--radius-full); background: var(--color-surface); box-shadow: var(--shadow-sm); border: 1px solid var(--color-border); }
.lp-periods__item { min-height: 40px; padding: 0 4px; border-radius: var(--radius-full); font-size: var(--text-sm); font-weight: var(--weight-semibold); color: var(--color-text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lp-periods__item[aria-selected="true"] { background: var(--color-primary); color: #fff; }
.lp-periods--compact .lp-periods__item { min-height: 34px; font-size: var(--text-xs); }

.lp-sum { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); }
.lp-sum__cell { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.lp-sum__cell + .lp-sum__cell { padding-left: var(--space-3); border-left: 1px solid var(--color-border); }
.lp-sum__label { display: flex; align-items: center; gap: 6px; font-size: var(--text-xs); font-weight: var(--weight-semibold); color: var(--color-text-muted); }
.lp-sum__label .icon { width: 16px; height: 16px; color: var(--color-primary); }
.lp-sum__value { font-size: var(--text-lg); font-weight: var(--weight-extrabold); line-height: 1.2; color: var(--color-primary-dark); }
.lp-change { display: inline-flex; align-items: flex-start; gap: 4px; font-size: var(--text-xs); color: var(--color-text-muted); }
.lp-change .icon { width: 14px; height: 14px; flex: none; margin-top: 1px; }
.lp-change--up { color: var(--color-success); font-weight: var(--weight-semibold); }
.lp-change--down { color: var(--color-rose); font-weight: var(--weight-semibold); }

.lp-dots { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; max-width: 160px; }
.lp-dot { aspect-ratio: 1; max-width: 18px; border-radius: 50%; background: var(--color-border); }
.lp-dot.is-on { background: var(--color-primary); }
.lp-dot.is-future { background: transparent; border: 1.5px dashed var(--color-border); }

.lp-box { display: flex; flex-direction: column; gap: var(--space-3); }
.lp-box__head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); }
.lp-box__title { display: flex; align-items: center; gap: var(--space-2); margin: 0; font-size: var(--text-base); font-weight: var(--weight-bold); }
.lp-box__title .icon { color: var(--color-primary); }
.lp-box__sub { font-size: var(--text-xs); font-weight: var(--weight-medium); color: var(--color-text-muted); }
.lp-more { color: var(--color-primary); }
.lp-note { margin: 0; font-size: var(--text-xs); line-height: var(--leading-normal); color: var(--color-text-muted); }
.lp-note--center { text-align: center; }
.lp-note--box { display: flex; gap: var(--space-2); padding: var(--space-3); border-radius: var(--radius-md); background: var(--color-surface); border: 1px solid var(--color-border); }
.lp-note--box .icon { flex: none; width: 16px; height: 16px; color: var(--color-primary); }

/* Donut */
.lp-dist { display: flex; align-items: center; gap: var(--space-4); }
.lp-donut { flex: none; width: 128px; height: 128px; }
.lp-donut__track { fill: none; stroke: var(--color-primary-soft); stroke-width: 14; }
.lp-donut__arc { fill: none; stroke-width: 14; }
.lp-donut__value { font-size: 15px; font-weight: 800; fill: var(--color-primary-dark); font-family: var(--font-sans); }
.lp-donut__label { font-size: 10px; fill: var(--color-text-muted); font-family: var(--font-sans); }
.lp-legend { flex: 1; min-width: 0; list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.lp-legend li { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto auto; align-items: center; gap: var(--space-2); font-size: var(--text-sm); }
.lp-legend__dot { width: 10px; height: 10px; border-radius: 3px; }
.lp-legend__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lp-legend__val { font-weight: var(--weight-semibold); white-space: nowrap; }
.lp-legend__pct { min-width: 34px; text-align: right; color: var(--color-text-muted); font-size: var(--text-xs); }

/* Tren */
.lp-trend { display: block; width: 100%; height: auto; }
.lp-trend__grid { stroke: var(--color-border); stroke-width: 1; stroke-dasharray: 3 3; }
.lp-trend__tick, .lp-trend__label { font-size: 9px; fill: var(--color-text-muted); font-family: var(--font-sans); }
.lp-trend__bar { fill: var(--color-primary); }
.lp-trend__bar.is-future { fill: var(--color-primary-soft); }

/* Target */
.lp-goal__nums { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-2); }
.lp-goal__nums span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.lp-goal__nums small { font-size: var(--text-xs); color: var(--color-text-muted); }
.lp-goal__nums strong { font-size: var(--text-base); font-weight: var(--weight-extrabold); color: var(--color-primary-dark); }
.lp-goal .progress { height: 8px; }
.lp-goal-form { display: flex; flex-direction: column; gap: var(--space-3); }
.lp-goal-form__opts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-2); }
.lp-opt { position: relative; display: block; }
.lp-opt input { position: absolute; opacity: 0; inset: 0; }
.lp-opt span { display: flex; align-items: center; justify-content: center; min-height: 44px; border: 1.5px solid var(--color-border); border-radius: var(--radius-md); font-size: var(--text-sm); font-weight: var(--weight-semibold); background: var(--color-surface); }
.lp-opt input:checked + span { border-color: var(--color-primary); background: var(--color-primary); color: #fff; }
.lp-opt input:focus-visible + span { box-shadow: 0 0 0 3px rgba(7, 91, 75, 0.25); }

/* Konsistensi */
.lp-streak { display: flex; align-items: center; gap: var(--space-3); }
.lp-streak__fire { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 44px; height: 44px; border-radius: 50%; background: var(--color-gold-soft); color: #e0742b; }
.lp-streak strong { display: block; font-size: var(--text-base); }
.lp-streak span:not(.lp-streak__fire) { font-size: var(--text-xs); color: var(--color-text-muted); }
.lp-cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.lp-cal__head { font-size: 10px; font-weight: var(--weight-semibold); text-align: center; color: var(--color-text-muted); }
.lp-cal__day { display: flex; align-items: center; justify-content: center; aspect-ratio: 1; max-height: 40px; border-radius: var(--radius-sm); font-size: var(--text-xs); background: #f2f1ec; color: var(--color-text-muted); }
.lp-cal__day.is-on { background: var(--color-primary); color: #fff; font-weight: var(--weight-bold); }
.lp-cal__day.is-today { outline: 2px solid var(--color-gold); outline-offset: -2px; }
.lp-cal__day.is-future { background: transparent; color: var(--color-border); }

/* Kartu kategori */
.lp-section { display: flex; flex-direction: column; gap: var(--space-2); }
.lp-section__title { margin: 0; font-size: var(--text-base); font-weight: var(--weight-bold); }
.lp-cats { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-2); }
.lp-cat { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3); border-radius: var(--radius-lg); background: var(--color-surface); box-shadow: var(--shadow-sm); border: 1px solid var(--color-border); color: var(--color-text); }
.lp-cat:hover { border-color: var(--color-primary); }
.lp-cat > .icon { flex: none; color: var(--color-text-muted); }
.lp-cat__icon { width: 40px; height: 40px; }
.lp-cat__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.lp-cat__top { display: flex; justify-content: space-between; gap: var(--space-2); font-size: var(--text-sm); }
.lp-cat__time { font-size: var(--text-xs); font-weight: var(--weight-semibold); color: var(--color-primary); white-space: nowrap; }
.lp-cat__line { font-size: var(--text-xs); color: var(--color-text-muted); }
.lp-cat__bar { display: flex; align-items: center; gap: var(--space-2); font-size: var(--text-xs); font-weight: var(--weight-semibold); }
.lp-cat__bar .progress { flex: 1; }
.lp-cat__bar span { min-width: 34px; text-align: right; }

/* Lencana */
.lp-badges { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-2); }
.lp-badge { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: var(--space-3) var(--space-1); border-radius: var(--radius-md); background: #f6f5f0; text-align: center; min-width: 0; }
.lp-badge__medal { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 50%; background: var(--color-border); color: var(--color-text-muted); }
.lp-badge.is-earned { background: var(--color-gold-soft); }
.lp-badge.is-earned .lp-badge__medal { background: linear-gradient(145deg, #f2c35b, #d9a441); color: #fff; box-shadow: 0 4px 10px rgba(217, 164, 65, 0.35); }
.lp-badge__name { font-size: var(--text-xs); font-weight: var(--weight-bold); line-height: var(--leading-tight); overflow-wrap: anywhere; }
.lp-badge__desc { font-size: var(--text-xs); color: var(--color-text-muted); }
.lp-badge__meta { font-size: 10px; color: var(--color-text-muted); }
.lp-badges--all { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: var(--space-3); }

/* Kosong (halaman) */
.lp-hello { display: flex; flex-direction: column; align-items: center; gap: var(--space-3); padding: var(--space-6) var(--space-4); text-align: center; }
.lp-hello__title { margin: 0; font-size: var(--text-lg); font-weight: var(--weight-bold); }
.lp-hello__text { margin: 0; font-size: var(--text-sm); color: var(--color-text-muted); max-width: 40ch; }
.lp-hello .lp-empty__actions .btn { flex: 1 1 140px; }

/* =========================================================
   Detail Aktivitas
   ========================================================= */
.lp-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-2); }
.lp-tabs__item { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 64px; padding: var(--space-2) 2px; border-radius: var(--radius-md); background: var(--color-surface); border: 1px solid var(--color-border); font-size: var(--text-xs); font-weight: var(--weight-semibold); color: var(--color-text); min-width: 0; }
.lp-tabs__item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.lp-tabs__item .icon { color: var(--color-primary); }
.lp-tabs__item[aria-selected="true"] { background: var(--color-primary); border-color: var(--color-primary); color: #fff; box-shadow: var(--shadow-button); }
.lp-tabs__item[aria-selected="true"] .icon { color: #fff; }

.lp-dsum__body { display: flex; align-items: center; gap: var(--space-4); }
.lp-ring { flex: none; width: 92px; height: 92px; }
.lp-ring__track { fill: none; stroke: var(--color-primary-soft); stroke-width: 9; }
.lp-ring__value { fill: none; stroke: var(--color-primary); stroke-width: 9; stroke-linecap: round; }
.lp-ring__text { font-size: 16px; font-weight: 800; fill: var(--color-primary-dark); font-family: var(--font-sans); }
.lp-dsum__rows { flex: 1; min-width: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.lp-dsum__rows div { display: flex; justify-content: space-between; gap: var(--space-2); font-size: var(--text-sm); border-bottom: 1px dashed var(--color-border); padding-bottom: 4px; }
.lp-dsum__rows div:last-child { border-bottom: 0; }
.lp-dsum__rows dt { color: var(--color-text-muted); min-width: 0; }
.lp-dsum__rows dd { margin: 0; font-weight: var(--weight-bold); text-align: right; white-space: nowrap; }

.lp-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.lp-list > li + li { border-top: 1px solid var(--color-border); }
.lp-item { display: flex; align-items: flex-start; gap: var(--space-3); padding: var(--space-3) 0; color: var(--color-text); }
.lp-item--link > .icon { flex: none; align-self: center; color: var(--color-text-muted); }
.lp-item__thumb, .lp-pcover { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 64px; height: 64px; overflow: hidden; border-radius: var(--radius-sm); background: var(--color-primary-soft); color: var(--color-primary); }
.lp-item__thumb img, .lp-pcover img { width: 100%; height: 100%; object-fit: cover; }
.lp-pcover--empty .pod-cover__title { display: none; }
.lp-item__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.lp-item__title { font-size: var(--text-sm); font-weight: var(--weight-bold); line-height: var(--leading-tight); overflow-wrap: anywhere; }
.lp-item__meta { font-size: var(--text-xs); color: var(--color-text-muted); }
.lp-item__bar { display: flex; align-items: center; gap: var(--space-2); }
.lp-item__bar .progress { flex: 1; }
.lp-item__actions { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-1); }
.lp-status { flex: none; font-size: var(--text-xs); font-weight: var(--weight-semibold); color: var(--color-gold-strong); white-space: nowrap; }
.lp-status.is-done { color: var(--color-success); }
.lp-status .icon { width: 14px; height: 14px; margin-right: 4px; vertical-align: -2px; }
.lp-load { margin-top: var(--space-2); }

.lp-shelf { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: var(--space-3); }
.lp-shelf__item { display: flex; flex-direction: column; gap: 4px; color: var(--color-text); min-width: 0; }
.lp-shelf__item .book-cover { width: 100%; }
.lp-shelf__title { font-size: var(--text-xs); font-weight: var(--weight-bold); line-height: var(--leading-tight); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.lp-shelf__meta { font-size: 10px; color: var(--color-text-muted); }

/* ---------- Layar kecil ---------- */
@media (max-width: 380px) {
  .lp-dist { flex-direction: column; align-items: stretch; }
  .lp-donut { align-self: center; }
  .lp-sum { grid-template-columns: minmax(0, 1fr); }
  .lp-sum__cell + .lp-sum__cell { padding-left: 0; border-left: 0; padding-top: var(--space-3); border-top: 1px solid var(--color-border); }
  .lp-dsum__body { flex-direction: column; align-items: stretch; }
  .lp-ring { align-self: center; }
  .lp-goal-form__opts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* ---------- Layar lebar ---------- */
@media (min-width: 768px) {
  .lp-cats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lp-badges--all { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
