:root {
  /* Warna brand Al-Hafizh: hijau tua, emas, krem (sama dengan aplikasi lain) */
  --brand: #124020; --brand-2: #1d5a30; --gold: #a59c46; --gold-light: #d8cf86; --cream: #eee8d8;
  --bg: #f6f4ec; --card: #fff; --text: #17251b; --muted: #5f6a5a; --line: #e3dfcf;
  --primary: #124020; --primary-ink: #fff; --primary-soft: #f1eedb;
  --ok: #15803d; --ok-soft: #dcfce7; --warn: #8a6d1c; --warn-soft: #f6efcf; --bad: #b91c1c; --bad-soft: #fee2e2;
  --serif: Georgia, "Times New Roman", serif;
  --radius: 12px;
}
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); }
.hidden { display: none !important; }
a { color: var(--primary); }
h1, h2, h3 { margin: 0; line-height: 1.2; text-wrap: balance; }
h2 { font-size: 1.15rem; } h3 { font-size: 1rem; }
p { margin: 0; }
.muted { color: var(--muted); font-size: .88em; }
.error { color: var(--bad); min-height: 1em; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 20px 16px 64px; display: grid; gap: 20px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* form & tombol */
label { display: grid; gap: 4px; font-size: .88rem; color: var(--muted); }
input, select, textarea { font: inherit; color: var(--text); padding: 10px 11px; border: 1px solid #d4cfba; border-radius: 8px; background: #fff; width: 100%; min-width: 0; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--gold); border-color: var(--brand); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-weight: 600; padding: 9px 14px; border-radius: 8px; border: 1px solid #d4cfba; background: #fff; color: var(--text); cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { filter: brightness(.97); }
.btn:focus-visible, a:focus-visible, .tile:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.btn.primary:hover { background: var(--brand-2); filter: none; }
.btn.danger { color: var(--bad); border-color: #fca5a5; }
.btn.ghost { background: transparent; }
.btn.small { padding: 5px 10px; font-size: .85rem; }
.btn.big { padding: 12px 18px; font-size: 1rem; }
.linkbtn { background: none; border: 0; padding: 0; font: inherit; color: var(--primary); text-decoration: underline; cursor: pointer; }
.badge { display: inline-block; font-size: .75rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--line); color: var(--text); white-space: nowrap; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }

/* halaman depan */
.hero { background: var(--brand); color: var(--cream); border-bottom: 4px solid var(--gold); }
.hero-in { max-width: 1080px; margin: 0 auto; padding: 36px 16px 40px; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 40px; align-items: center; }
.hero-text { display: grid; gap: 28px; justify-items: start; }
.hero-logo { width: min(200px, 48vw); height: auto; }
.login-card { display: grid; gap: 12px; max-width: 400px; width: 100%; margin-left: auto; color: var(--text); }
.login-card h1 { color: var(--brand); font-size: 1.35rem; }
@media (max-width: 760px) {
  .hero-in { grid-template-columns: minmax(0, 1fr); gap: 24px; padding-top: 24px; }
  .hero-text { justify-items: center; text-align: center; }
  .login-card { margin: 0 auto; }
}

/* kalimat founder */
.founder { margin: 0; display: grid; gap: 14px; max-width: 60ch; }
.founder blockquote { margin: 0; font-family: var(--serif); font-style: italic; font-size: clamp(1.25rem, 2.6vw, 1.75rem); line-height: 1.45; white-space: pre-line; position: relative; }
.founder blockquote::before { content: "\201C"; font-size: 3.2em; line-height: 0; position: relative; top: .42em; margin-right: .06em; color: var(--gold); font-style: normal; }
.founder figcaption { font-size: .92rem; color: var(--gold-light); letter-spacing: .02em; }
.founder figcaption b { color: var(--cream); font-weight: 700; }
.founder-band { background: var(--brand); color: var(--cream); border-radius: var(--radius); padding: 24px 24px 22px; border-bottom: 4px solid var(--gold); }
.founder-band .founder { max-width: 70ch; }
.founder-band .founder blockquote { font-size: clamp(1.1rem, 2.2vw, 1.45rem); }
.founder-empty { background: var(--primary-soft); border: 1px dashed var(--gold); border-radius: var(--radius); padding: 18px; display: grid; gap: 8px; }

/* value perusahaan */
.values { display: grid; gap: 14px; }
.values-head { display: grid; gap: 4px; }
.eyebrow { font-size: .75rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--gold-dark, #736b37); }
.values-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.value { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: grid; gap: 6px; align-content: start; }
.value .num { font-family: var(--serif); font-style: italic; color: var(--gold); font-size: 1.1rem; }
.value h3 { font-size: 1.08rem; color: var(--brand); }
.value p { color: var(--muted); font-size: .92rem; }

/* atas & menu aplikasi */
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 16px; background: var(--brand); color: var(--cream); border-bottom: 3px solid var(--gold); }
.topbar a { color: var(--gold-light); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.15rem; font-family: var(--serif); font-style: italic; }
.brand small { font-family: system-ui, sans-serif; font-style: normal; font-weight: 600; font-size: .75rem; color: var(--gold-light); letter-spacing: 1px; text-transform: uppercase; margin-left: 4px; }
.brand-logo { height: 34px; width: auto; }
.me { font-size: .9rem; }
.greet { display: grid; gap: 2px; }
.greet h1 { font-size: 1.45rem; color: var(--brand); }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.tile { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 14px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; text-decoration: none; color: var(--text); text-align: left; font: inherit; cursor: pointer; min-height: 88px; }
.tile:hover { border-color: var(--gold); background: var(--primary-soft); }
.tile .ico { grid-row: span 2; width: 46px; height: 46px; border-radius: 12px; background: var(--primary-soft); display: grid; place-items: center; font-size: 1.45rem; }
.tile b { font-size: 1.05rem; color: var(--brand); }
.tile span.d { color: var(--muted); font-size: .86rem; }
.tile.soon { cursor: default; opacity: .7; border-style: dashed; }
.tile.soon:hover { background: var(--card); border-color: var(--line); }

/* tugas hari ini */
.taskbox { display: grid; gap: 10px; }
.task-list { display: grid; gap: 10px; margin-top: 8px; }
.task { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: grid; gap: 8px; min-width: 0; }
.task.imp { border-color: var(--gold); box-shadow: inset 4px 0 0 var(--gold); }
.task.done, .task.snoozed { opacity: .8; }
.task h3 { font-size: 1.02rem; overflow-wrap: anywhere; }
.task-head { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; }
.task-detail { white-space: pre-line; color: var(--muted); font-size: .9rem; margin-top: 6px; overflow-wrap: anywhere; }
.task details summary, .taskbox > details summary { cursor: pointer; color: var(--primary); font-size: .9rem; }
.task-sum { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.task-sum > div { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; display: grid; }
.task-sum b { font-size: 1.7rem; color: var(--brand); }
.task-sum span { color: var(--muted); font-size: .85rem; }
.task-sum .bad b { color: var(--bad); }
.ok-line { color: var(--ok); font-weight: 600; }

/* daftar akun */
.acc-list { display: grid; gap: 8px; }
.acc { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.acc.off { opacity: .6; }
.acc .who { display: grid; gap: 2px; min-width: 0; }
.acc .who b { overflow-wrap: anywhere; }
@media (max-width: 560px) { .acc { grid-template-columns: minmax(0, 1fr); } }
.pinshow { font-family: ui-monospace, Menlo, monospace; font-size: 2.2rem; letter-spacing: .3em; text-align: center; padding: 14px; background: var(--primary-soft); border: 1px dashed var(--gold); border-radius: 10px; color: var(--brand); }
.sess { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.sess li { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: .9rem; }
.val-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr) auto; gap: 8px; align-items: start; }
@media (max-width: 560px) { .val-row { grid-template-columns: minmax(0, 1fr) auto; } .val-row textarea { grid-column: 1 / -1; grid-row: 2; } }

/* dialog & toast */
dialog { border: 0; border-radius: 14px; padding: 0; width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 32px); }
dialog::backdrop { background: rgba(10, 30, 15, .45); }
#dlgBody { padding: 18px; display: grid; gap: 12px; }
#dlgBody h2 { color: var(--brand); }
.toast { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--text); color: #fff; padding: 10px 16px; border-radius: 10px; opacity: 0; pointer-events: none; transition: opacity .2s; max-width: calc(100vw - 32px); z-index: 50; }
.toast.show { opacity: 1; }
.toast.err { background: var(--bad); }
@media (prefers-reduced-motion: reduce) { .toast { transition: none; } }
