/* Page layouts adapted from the prototype */
.hero { padding: 72px 0 30px; }
.hero-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 56px; align-items: center; }
.hero h1 { font-size: 42px; margin-bottom: 18px; }
.hero p.lead { font-size: 17.5px; color: var(--muted); max-width: 46ch; margin-bottom: 28px; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 22px; }
.hero-note { font-size: 13.5px; color: var(--muted); }
.hero-art { border: 1px solid var(--border); border-radius: var(--r); background: var(--card); padding: 22px; }
.hero-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.hero-row:last-child { border-bottom: none; }
.hero-ico, .tool-ico { width: 38px; height: 38px; border-radius: 10px; background: var(--primary-tint); color: var(--primary); display: flex; align-items: center; justify-content: center; flex: none; }
.bars { display: flex; align-items: flex-end; gap: 6px; height: 56px; margin-left: auto; }
.bars i { width: 12px; border-radius: 4px 4px 0 0; background: var(--primary-tint); display: block; }
.bar-1 { height: 18px; background: #4F6F52 !important; }
.bar-2 { height: 30px; background: #C9A45C !important; }
.bar-3 { height: 22px; background: #B5694A !important; }
.bar-4 { height: 40px; background: #4F6F52 !important; }
.hero-check { color: var(--primary); margin-left: auto; }
.tools-sec { padding: 56px 0; }
.sec-head { margin-bottom: 30px; }
.sec-head h2 { margin-bottom: 8px; }
.sec-head p { color: var(--muted); max-width: 56ch; }
.tools-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 18px; }
.tool-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--r); padding: 26px 22px; display: flex; flex-direction: column; gap: 12px; transition: border-color .18s ease; color: var(--text); }
.tool-card:hover { border-color: var(--primary); }
.tool-head { display: flex; align-items: center; gap: 14px; }
.tool-head h2 { font-size: 19px; margin: 0; }
.tool-ico { width: 44px; height: 44px; }
.tool-card p { font-size: 15px; color: var(--muted); }
.tool-card-go { margin-top: auto; font-size: 14px; font-weight: 500; color: var(--primary); display: flex; align-items: center; gap: 7px; }
.how-sec { padding: 26px 0 64px; }
.how-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 18px; }
.how-num { font-family: 'Fraunces', serif; font-size: 26px; font-weight: 700; color: var(--accent); }
.how-item h3 { margin: 8px 0 6px; }
.how-item p { font-size: 15px; color: var(--muted); }
.foot { border-top: 1px solid var(--border); padding: 26px 0 40px; font-size: 13.5px; color: var(--muted); display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.container > .foot { margin-bottom: 30px; }

/* Pricing selection and payment instructions */
.bundles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 18px; margin: 30px 0 14px; align-items: stretch; }
.bundle { background: var(--card); border: 1px solid var(--border); border-radius: var(--r); padding: 26px 22px; display: flex; flex-direction: column; position: relative; transition: border-color .18s ease; }
.bundle:hover { border-color: var(--primary); }
.bundle.pop { border: 2px solid var(--primary); box-shadow: 0 6px 24px var(--shadow-pop); }
.pop-badge { position: absolute; top: -13px; left: 22px; }
.bundle h3 { font-size: 21px; margin-bottom: 2px; }
.bundle-sub { font-size: 13.5px; color: var(--muted); margin-bottom: 16px; }
.price-line { display: flex; align-items: baseline; gap: 9px; flex-wrap: wrap; margin-bottom: 4px; }
.price-now { font-family: 'Fraunces', serif; font-size: 32px; font-weight: 700; }
.price-old { font-size: 15px; color: var(--muted); text-decoration: line-through; }
.save-badge { margin-bottom: 16px; }
.bundle ul { list-style: none; margin: 4px 0 22px; display: flex; flex-direction: column; gap: 9px; }
.bundle ul li { display: flex; gap: 9px; align-items: flex-start; font-size: 14.5px; }
.bundle ul li .ic { color: var(--primary); margin-top: 3px; }
.bundle .btn { margin-top: auto; }
.bundle.selected { border-color: var(--accent); }
.singles-sec { margin: 42px 0 40px; }
.singles-head { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.singles-head::before, .singles-head::after { content: ""; height: 1px; background: var(--border); flex: 1; }
.singles-head h2 { font-size: 13.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 500; margin: 0; }
.singles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 14px; }
.single { background: transparent; border: 1px dashed var(--border); border-radius: var(--rs); padding: 16px; display: flex; align-items: center; gap: 12px; }
.single-ico { width: 34px; height: 34px; border-radius: 8px; background: var(--tint); color: var(--muted); display: flex; align-items: center; justify-content: center; flex: none; }
.single b { font-size: 14.5px; font-weight: 500; display: block; }
.single .muted { font-size: 13px; }
.single .btn { margin-left: auto; }
.single.selected { border: 1px solid var(--accent); }
.singles-note { display: flex; align-items: center; gap: 8px; margin-top: 14px; font-size: 13.5px; color: var(--accent-dark); }
.pay-section { margin: 16px 0 70px; scroll-margin-top: 80px; }
.pay-section h2 { margin-bottom: 8px; }
.co-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin: 24px 0 0; align-items: start; }
.qris-box { border: 1px solid var(--border); background: var(--card); border-radius: var(--r); padding: 22px; }
.qris-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.qr-frame { width: 246px; max-width: 100%; margin: 0 auto; padding: 14px; background: var(--card); border: 1px solid var(--border); border-radius: var(--rs); text-align: center; }
.qr-frame img { display: block; width: 100%; height: auto; }
.qr-placeholder { aspect-ratio: 1; display: grid; place-items: center; border: 1px dashed var(--border); border-radius: var(--rs); color: var(--muted); font-family: 'Fraunces', serif; font-weight: 600; letter-spacing: .08em; }
.qr-cap { font-size: 13px; color: var(--muted); margin-top: 9px; }
.detail-row { display: flex; justify-content: space-between; gap: 18px; padding: 6px 0; }
.detail-row dt { color: var(--muted); }
.detail-row dd { text-align: right; overflow-wrap: anywhere; }
.whats-box { margin-top: 16px; }
#selection-summary { margin: 0 0 14px; }

/* App layout */
.shell { display: grid; grid-template-columns: 250px 1fr; min-height: calc(100vh - 59px); }
.side { border-right: 1px solid var(--border); padding: 22px 16px; background: var(--card); }
.side-user { padding: 0 8px 18px; border-bottom: 1px solid var(--border); margin-bottom: 14px; }
.side-user b { display: block; font-family: 'Fraunces', serif; font-size: 19px; }
.side-user .muted { font-size: 13px; }
.side-label { font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 0 8px; margin: 14px 0 8px; }
.side-nav { display: flex; flex-direction: column; gap: 3px; }
.side-btn { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: var(--rs); font-size: 14.5px; color: var(--muted); text-align: left; transition: background .15s ease, color .15s ease; width: 100%; }
.side-btn:hover { background: var(--tint); color: var(--text); }
.side-btn.on { background: var(--primary-tint); color: var(--primary); font-weight: 500; }
.main { padding: 34px 34px 70px; min-width: 0; }
.main-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 24px; flex-wrap: wrap; }
.main-head h1 { font-size: 27px; }
.main-head p { color: var(--muted); font-size: 14.5px; }
.dash-intro { max-width: 62ch; color: var(--muted); margin-bottom: 24px; }
.local-note { margin-bottom: 22px; max-width: 620px; }
.dash-note { margin-top: 24px; max-width: 620px; }

/* Summaries */
.lib-search { display: flex; gap: 10px; margin-bottom: 24px; max-width: 520px; }
.lib-search input { flex: 1; min-width: 120px; font-family: 'DM Sans', sans-serif; font-size: 15px; color: var(--text); background: var(--card); border: 1px solid var(--border); border-radius: var(--rs); padding: 11px 13px; }
.courses { display: flex; flex-direction: column; gap: 26px; }
.course-block { background: var(--card); border: 1px solid var(--border); border-radius: var(--r); padding: 24px; }
.course-block h2 { font-size: 20px; margin-bottom: 6px; }
.course-meta { font-size: 13px; color: var(--muted); margin-bottom: 16px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.sum-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap: 12px; }
.sum-card { border: 1px solid var(--border); border-radius: var(--rs); padding: 16px; background: var(--bg); color: var(--text); display: flex; flex-direction: column; gap: 6px; transition: border-color .18s ease; }
.sum-card:hover { border-color: var(--primary); }
.sum-card .wk { font-size: 12px; letter-spacing: .05em; text-transform: uppercase; color: var(--accent-dark); font-weight: 500; }
.sum-card b { font-size: 14.5px; font-weight: 500; line-height: 1.4; }
.sum-card .muted { font-size: 12.5px; }
.reader { max-width: 680px; }
.reader-top { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.reader-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.reader-body { background: var(--card); border: 1px solid var(--border); border-radius: var(--r); padding: 34px 34px 40px; }
.reader-body h2 { font-size: 25px; margin-bottom: 18px; }
#markdown h1, #markdown h2, #markdown h3 { margin: 24px 0 8px; }
#markdown h1 { font-size: 23px; }
#markdown h2 { font-size: 20px; }
#markdown p { margin-bottom: 12px; color: var(--body-text); }
#markdown ul, #markdown ol { margin: 0 0 14px 20px; display: flex; flex-direction: column; gap: 6px; }
#markdown li { color: var(--body-text); }
#markdown code { background: var(--tint); border: 1px solid var(--border); border-radius: 4px; padding: 1px 4px; font-size: .9em; }
#markdown a { text-decoration: underline; text-underline-offset: 2px; }
.pdf-box { max-width: 620px; }

/* Admin publishing helper */
.admin-form-card { max-width: 780px; }
.admin-form-card h2 { font-size: 19px; margin-bottom: 8px; }
.admin-form-card #index-note { margin-bottom: 20px; }
.admin-field-row { display: grid; grid-template-columns: minmax(0, 1fr) 170px; gap: 14px; }
.admin-content { resize: vertical; min-height: 240px; font-family: ui-monospace, SFMono-Regular, Consolas, monospace !important; line-height: 1.55 !important; }
.admin-output { padding-top: 34px; padding-bottom: 70px; }
.admin-preview-head { margin-bottom: 18px; }
.admin-preview-head h2 { margin-bottom: 6px; }
.admin-output .reader-body { max-width: 780px; margin-bottom: 20px; }
.admin-export { margin-top: 18px; max-width: 780px; }
.admin-export h2 { font-size: 17px; margin-bottom: 8px; }
.admin-export .inline-actions { margin-top: 16px; }
.admin-export .inline-actions h2 { margin: 0; }
.admin-export .inline-actions:has(h2) { justify-content: space-between; }
.json-entry { width: 100%; resize: vertical; min-height: 220px; margin-top: 14px; background: var(--bg); color: var(--text); border: 1px solid var(--border); border-radius: var(--rs); padding: 13px; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 13px; line-height: 1.55; }
#pdf-preview { max-width: 780px; margin-bottom: 20px; }
.admin-payment-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 20px; }
.payment-card h3 { text-transform: capitalize; }
.payment-card p { overflow-wrap: anywhere; }
.payment-reference { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12.5px; color: var(--muted); }
.payment-actions { margin-top: 16px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.admin-output code, .form-note code { background: var(--tint); border-radius: 4px; padding: 1px 4px; }

/* Money tracker */
.mt-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 320px); gap: 22px; align-items: start; }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr)); gap: 14px; margin-bottom: 22px; }
.stat { background: var(--card); border: 1px solid var(--border); border-radius: var(--r); padding: 16px 18px; }
.stat .lbl { font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.stat .val { font-family: 'Fraunces', serif; font-size: 23px; font-weight: 700; }
.stat .val.in { color: var(--primary); }
.stat .val.out { color: var(--accent); }
.mt-form { background: var(--card); border: 1px solid var(--border); border-radius: var(--r); padding: 20px; margin-bottom: 22px; }
.mt-form h2 { font-size: 19px; margin-bottom: 14px; }
.mt-row { display: grid; grid-template-columns: minmax(90px, 110px) minmax(0, 1fr) minmax(110px, 150px) minmax(120px, 170px) auto; gap: 10px; align-items: end; }
.tx-list { background: var(--card); border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; }
.tx-head { display: flex; justify-content: space-between; align-items: center; padding: 15px 20px; border-bottom: 1px solid var(--border); }
.tx-head h2 { font-size: 17px; margin: 0; }
.tx { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--border); font-size: 14.5px; }
.tx:last-child { border-bottom: none; }
.tx-ico { width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center; flex: none; }
.tx-ico.in { background: var(--primary-tint); color: var(--primary); }
.tx-ico.out { background: var(--tint-danger); color: var(--accent); }
.tx b { font-weight: 500; display: block; }
.tx .muted { font-size: 12.5px; }
.tx-main { min-width: 0; overflow-wrap: anywhere; }
.tx-amt { margin-left: auto; font-weight: 500; white-space: nowrap; }
.tx-amt.in { color: var(--primary); }
.tx-amt.out { color: var(--accent); }
.del-btn { border: none; background: none; cursor: pointer; color: var(--muted); padding: 5px; border-radius: 6px; display: flex; transition: color .15s ease; }
.del-btn:hover { color: var(--accent); }
.chart-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--r); padding: 20px; }
.chart-card h2 { font-size: 16px; margin-bottom: 16px; }
.legend { display: flex; flex-direction: column; gap: 10px; }
.leg-row { display: flex; align-items: center; gap: 9px; font-size: 13.5px; }
.leg-dot { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.cat-Makan { background: #B5694A; }
.cat-Transport { background: #4F6F52; }
.cat-Kuliah { background: #C9A45C; }
.cat-Hiburan { background: #6E675C; }
.cat-Lainnya { background: #B8AD97; }
.leg-row .pct { margin-left: auto; font-weight: 500; }
.donut-wrap { display: flex; justify-content: center; padding: 6px 0 14px; }
.donut-center { font-family: 'Fraunces', serif; font-weight: 600; font-size: 12.5px; fill: var(--text); }
.donut-label { font-family: 'DM Sans', sans-serif; font-size: 10px; fill: var(--muted); }
.donut-empty { fill: var(--tint); }
.chart-card .empty { padding: 16px; margin-bottom: 18px; }

/* Study planner */
.pl-grid { display: grid; grid-template-columns: minmax(260px, 340px) minmax(0,1fr); gap: 22px; align-items: start; }
#task-form-title { font-size: 19px; margin-bottom: 14px; }
.week-bar h2 { font-size: 19px; margin: 0; }
.task-list .tx-head h2 { font-size: 17px; margin: 0; }
.week-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.week-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 120px), 1fr)); gap: 8px; }
.day-col { background: var(--card); border: 1px solid var(--border); border-radius: var(--rs); padding: 10px; min-height: 170px; }
.day-col.today { border-color: var(--primary); }
.day-name { font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; display: flex; justify-content: space-between; align-items: center; }
.day-date { font-family: 'Fraunces', serif; font-size: 15px; font-weight: 600; }
.day-tasks { display: flex; flex-direction: column; gap: 6px; }
.task-chip { border: 1px solid var(--border); background: var(--bg); border-radius: 8px; padding: 7px 9px; font-size: 12.5px; line-height: 1.4; overflow-wrap: anywhere; }
.task-chip.done { opacity: .55; text-decoration: line-through; }
.task-chip.overdue { border-color: var(--accent); color: var(--accent-dark); }
.task-list { background: var(--card); border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; margin-top: 18px; }
.task-list .list-body:empty { display: none; }
.t-row { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--border); font-size: 14.5px; }
.t-row:last-child { border-bottom: none; }
.t-check { width: 19px; height: 19px; flex: none; cursor: pointer; accent-color: var(--primary); }
.t-row b { font-weight: 500; }
.t-row.done b { text-decoration: line-through; opacity: .6; }
.t-row .muted { font-size: 12.5px; }
.t-main { min-width: 0; overflow-wrap: anywhere; }
.t-del { margin-left: auto; }
.list-empty { padding: 22px 18px; color: var(--muted); }

@media (max-width: 1120px) {
  .mt-row { grid-template-columns: 110px 1fr 150px; }
  .mt-row .mt-cat { grid-column: 1 / 2; }
}
@media (max-width: 920px) {
  .hero-grid { grid-template-columns: 1fr; gap: 34px; }
  .hero { padding: 44px 0 10px; }
  .hero h1 { font-size: 33px; }
  .tools-grid, .how-grid { grid-template-columns: 1fr; }
  .bundles { grid-template-columns: 1fr; max-width: 460px; }
  .singles { grid-template-columns: 1fr; }
  .co-grid, .admin-field-row { grid-template-columns: 1fr; }
  .mt-grid { grid-template-columns: 1fr; }
  .pl-grid { grid-template-columns: 1fr; }
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { border-right: none; border-bottom: 1px solid var(--border); padding: 14px 16px; min-width: 0; }
  .side-nav { flex-direction: row; overflow-x: auto; gap: 6px; padding-bottom: 2px; }
  .side-btn { white-space: nowrap; width: auto; }
  .side-label, .side-user { display: none; }
  .main { padding: 22px 20px 70px; }
  .stat-row { grid-template-columns: 1fr; }
  .sum-grid { grid-template-columns: 1fr 1fr; }
  .admin-payment-list { grid-template-columns: 1fr; }
  .week-grid { grid-template-columns: repeat(2, 1fr); }
  .mt-row { grid-template-columns: 1fr 1fr; }
  .mt-row .mt-cat { grid-column: auto; }
}
@media (max-width: 560px) {
  .sum-grid { grid-template-columns: 1fr; }
  .week-grid { grid-template-columns: 1fr; }
  .reader-body { padding: 24px 20px; }
  .hero h1 { font-size: 29px; }
  .mt-row { grid-template-columns: 1fr; }
  .tx { align-items: flex-start; flex-wrap: wrap; }
  .tx-amt { margin-left: 44px; }
  .lib-search { flex-wrap: wrap; }
  .detail-row { flex-direction: column; gap: 0; }
  .detail-row dd { text-align: left; }
}
