/* ============================================================
   Dakwah Reminder — gaya zen / wabi-sabi
   palet kertas, lumut, tanah liat; banyak ruang; tenang
   ============================================================ */
:root {
  --paper: #FAF8F3;   /* latar utama */
  --stone: #EFE9DC;   /* kartu / permukaan */
  --fog:   #E3DCD0;   /* garis pembatas */
  --ink:   #3A3632;   /* teks utama */
  --earth: #8C8275;   /* teks sekunder */
  --moss:  #7A8B72;   /* aksen utama — lumut */
  --moss-deep: #5B6B55;
  --clay:  #B89B7A;   /* aksen sekunder — tanah liat */
  --rust:  #A0735C;
  --white: #FFFDF8;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.7;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: 'Noto Serif JP', Georgia, serif; font-weight: 500; letter-spacing: .02em; }

a { color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--fog); transition: color .3s ease, border-color .3s ease; }
a:hover { color: var(--moss-deep); border-color: var(--moss); }

code { font-size: .85em; background: var(--stone); padding: 1px 6px; border-radius: 4px; }

.wrap { max-width: 720px; margin: 0 auto; padding: 0 20px; }

/* ---------- header ---------- */
.top { border-bottom: 1px solid var(--fog); background: transparent; position: relative; z-index: 20; }
.top-in { display: flex; align-items: center; justify-content: space-between; padding-top: 22px; padding-bottom: 18px; gap: 12px; flex-wrap: wrap; }
.brand { font-family: 'Noto Serif JP', serif; font-size: 1.25rem; letter-spacing: .05em; color: var(--ink); border: none; }
.brand:hover { color: var(--moss-deep); }

/* ---------- hamburger & sidebar ---------- */
.burger {
  background: none; border: 1px solid var(--fog); border-radius: 4px;
  font-size: 1.1rem; line-height: 1; color: var(--earth);
  padding: 8px 12px; cursor: pointer; transition: all .3s ease;
  font-family: 'Inter', sans-serif;
}
.burger:hover { border-color: var(--earth); color: var(--ink); }
.scrim {
  position: fixed; inset: 0; background: rgba(58,54,50,.32);
  opacity: 0; pointer-events: none; transition: opacity .3s ease; z-index: 40;
}
.sidebar {
  position: fixed; top: 0; left: 0; bottom: 0; width: 264px; max-width: 82vw;
  background: var(--white); border-right: 1px solid var(--fog);
  transform: translateX(-102%); transition: transform .35s ease;
  display: flex; flex-direction: column; z-index: 50;
  padding: 22px 10px 26px;
}
.nav-open .sidebar { transform: translateX(0); }
.nav-open .scrim { opacity: 1; pointer-events: auto; }
.side-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 12px 18px; }
.side-brand { font-family: 'Noto Serif JP', serif; letter-spacing: .06em; color: var(--ink); }
.burger.close { border: none; font-size: 1.4rem; padding: 2px 8px; }
.side-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.side-nav a {
  font-size: .95rem; color: var(--earth); border: none;
  padding: 11px 14px; border-radius: 4px; letter-spacing: .02em;
  transition: color .3s ease, background .3s ease;
}
.side-nav a:hover { color: var(--ink); background: var(--stone); }
.side-nav a.on { color: var(--moss-deep); background: var(--stone); }
.side-foot { border-top: 1px solid var(--fog); padding: 16px 14px 4px; display: flex; flex-direction: column; gap: 10px; font-size: .85rem; }
.side-foot a { color: var(--earth); border: none; }
.side-foot a:hover { color: var(--ink); }

/* ---------- hero & heading ---------- */
.hero { padding: 56px 0 20px; }
.h-serif { font-size: 1.9rem; line-height: 1.45; color: var(--ink); font-weight: 500; }
.hero-sub { color: var(--earth); margin-top: 12px; max-width: 480px; font-size: .95rem; }
.page-head { padding: 40px 0 6px; }
.back { padding-top: 26px; font-size: .9rem; }
.back a { color: var(--earth); border: none; }
.back a:hover { color: var(--ink); }

/* ---------- stats ---------- */
.grid-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin: 26px 0 8px; }
.stat {
  background: var(--white);
  border: 1px solid var(--fog);
  border-left: 2px solid var(--clay);
  border-radius: 4px;
  padding: 20px 22px;
  display: flex; flex-direction: column; gap: 2px;
}
.stat-num { font-family: 'Noto Serif JP', serif; font-size: 2rem; line-height: 1.2; }
.stat-label { font-size: .8rem; color: var(--earth); letter-spacing: .04em; text-transform: uppercase; }

/* ---------- panel ---------- */
.panel { margin: 34px 0 8px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.h-panel { font-size: 1.1rem; letter-spacing: .03em; }
.hint { font-size: .8rem; color: var(--earth); }
.narrow { max-width: 460px; }

.hasil-row { display: flex; gap: 10px; flex-wrap: wrap; }

.banner-draft {
  background: var(--white);
  border: 1px solid var(--fog);
  border-left: 2px solid var(--moss);
  border-radius: 4px;
  padding: 18px 20px;
  margin-top: 22px;
}
.banner-draft .panel-head { margin-bottom: 0; }
.draft-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 18px; }
.draft-item-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }

/* ---------- pengaturan pesan ---------- */
.plist { list-style: none; }
.plist li { margin-bottom: 14px; }
.pcard {
  background: var(--white);
  border: 1px solid var(--fog);
  border-left: 2px solid var(--clay);
  border-radius: 4px;
  padding: 16px 18px;
}
.p-nama { font-family: 'Noto Serif JP', serif; font-size: 1.05rem; }
.pform { margin-top: 12px; }
.p-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--fog); }
.logbalasan {
  font-size: .85rem; color: var(--moss-deep);
  background: #EDF2EA; border-radius: 4px; padding: 8px 12px;
  margin-top: 10px; white-space: pre-wrap;
}

/* ---------- badge (tonal lembut) ---------- */
.badge {
  display: inline-block;
  font-size: .72rem; letter-spacing: .03em;
  padding: 3px 12px; border-radius: 999px;
  white-space: nowrap;
}
.b-info { background: var(--stone); color: var(--earth); }
.b-sila { background: #E7ECE2; color: var(--moss-deep); }
.b-bina { background: #F0E6D8; color: #8A6B4A; }
.b-sel  { background: #EDEAE4; color: #6E675E; }
.h-ya   { background: #E4EAE0; color: #4F6252; }
.h-no   { background: #F2E4DE; color: #8A5A48; }
.h-null { background: #EDEAE6; color: #7A746C; }
.st-ok    { background: #E4EAE0; color: #4F6252; }
.st-queue { background: #F3E7D3; color: #8A6B4A; }
.st-wait  { background: #E5E8EC; color: #5A6B7A; }
.st-cancel { background: #ECE9E4; color: #7A746C; }
.st-expire { background: #EAE7E2; color: #8C8275; }
.st-skip  { background: #EDEAE6; color: #7A746C; }
.st-fail { background: #F2E4DE; color: #8A5A48; }
.b-null  { background: #EDEAE6; color: #7A746C; }

/* ---------- buttons ---------- */
.btn {
  font-family: 'Inter', sans-serif;
  font-size: .83rem; letter-spacing: .05em;
  color: var(--earth);
  background: transparent;
  border: 1px solid var(--fog);
  border-radius: 4px;
  padding: 9px 22px;
  cursor: pointer;
  transition: all .35s ease;
}
.btn:hover { border-color: var(--earth); color: var(--ink); }
.btn-primary {
  background: var(--moss); border-color: var(--moss); color: var(--white);
}
.btn-primary:hover { background: var(--moss-deep); border-color: var(--moss-deep); color: var(--white); }
.btn-danger { color: var(--rust); border-color: #D8C4B8; }
.btn-danger:hover { border-color: var(--rust); color: var(--rust); }
.btn-mini { padding: 4px 14px; font-size: .75rem; }
.linklike {
  background: none; border: none; cursor: pointer;
  font-family: 'Inter', sans-serif; font-size: .8rem; color: var(--earth);
  padding: 0; border-bottom: 1px solid transparent;
  transition: color .3s ease;
}
.linklike:hover { color: var(--ink); border-color: var(--fog); }
.linklike.danger { color: var(--rust); }
.linklike.danger:hover { color: #7d4a3c; }

/* ---------- forms ---------- */
.stack { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field span { font-size: .78rem; color: var(--earth); letter-spacing: .04em; }
input, select, textarea {
  font-family: 'Inter', sans-serif; font-size: 1rem;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--fog);
  border-radius: 4px;
  padding: 10px 12px;
  width: 100%;
  transition: border-color .3s ease;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--moss); }
textarea { resize: vertical; line-height: 1.6; }
.inline { display: inline; }
.inline-field { flex-direction: row; align-items: center; gap: 8px; }
.inline-field select { width: auto; }

/* ---------- add box (details) ---------- */
.addbox {
  border: 1px dashed var(--fog);
  border-radius: 4px;
  padding: 14px 18px;
  margin: 16px 0;
  background: transparent;
  transition: border-color .3s ease;
}
.addbox summary {
  cursor: pointer; font-size: .9rem; color: var(--earth);
  letter-spacing: .03em; user-select: none;
}
.addbox summary:hover { color: var(--ink); }
.addbox .stack { margin-top: 14px; }
.addbox.small { padding: 10px 14px; margin: 12px 0 4px; }

/* ---------- lists ---------- */
.jlist, .tlist, .tpllist, .loglist { list-style: none; }
.jlist li { margin-bottom: 12px; }
.jcard {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--white);
  border: 1px solid var(--fog);
  border-left: 2px solid var(--clay);
  border-radius: 4px;
  padding: 16px 18px;
  transition: border-color .3s ease, transform .3s ease;
}
.jcard:hover { border-color: var(--clay); border-left-color: var(--moss); transform: translateY(-1px); }
.j-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.j-nama { font-family: 'Noto Serif JP', serif; font-size: 1.05rem; }
.j-wa { font-size: .8rem; color: var(--earth); }
.j-side { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.j-total { font-size: .75rem; color: var(--earth); }
.j-arrow { color: var(--clay); }

.tlist li { margin-bottom: 14px; }
.tcard {
  background: var(--white);
  border: 1px solid var(--fog);
  border-radius: 4px;
  padding: 16px 18px;
}
.t-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.t-nama { font-size: 1rem; }
.t-hub { font-size: .78rem; color: var(--earth); }
.t-catatan { font-size: .85rem; color: var(--earth); margin: 8px 0 10px; font-style: italic; }

/* chip satu-tap: ganti tahap / hasil langsung */
.chiprow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--fog); }
.chiprow-label { font-size: .78rem; color: var(--earth); letter-spacing: .03em; margin-right: 2px; }
.chip {
  font-family: 'Inter', sans-serif;
  font-size: .8rem;
  color: var(--earth);
  background: transparent;
  border: 1px solid var(--fog);
  border-radius: 999px;
  padding: 6px 16px;
  cursor: pointer;
  transition: all .3s ease;
}
.chip:hover { border-color: var(--moss); color: var(--ink); }
.chip.on { border-color: transparent; }
.chip.on.b-info { background: var(--stone); color: #5C534A; }
.chip.on.b-sila { background: #DDE4D8; color: var(--moss-deep); border-color: transparent; }
.chip.on.b-bina { background: #EFE2CF; color: #8A6B4A; border-color: transparent; }
.chip.on.b-sel  { background: #E5E1D9; color: #6E675E; border-color: transparent; }
.chip.on.h-ya   { background: #DCE5D7; color: #4F6252; border-color: transparent; }
.chip.on.h-no   { background: #EFDDD4; color: #8A5A48; border-color: transparent; }
.chip.on.h-null { background: #E5E1DB; color: #7A746C; border-color: transparent; }

.tpllist li { margin-bottom: 14px; }
.tplcard { background: var(--white); border: 1px solid var(--fog); border-radius: 4px; padding: 16px 18px; }
.tpl-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tpl-judul { font-family: 'Noto Serif JP', serif; font-size: 1rem; }
.tpl-isi { font-size: .9rem; color: #5C534A; margin: 10px 0; white-space: pre-wrap; }
.tpl-actions { display: flex; align-items: center; gap: 14px; }

.loglist li { margin-bottom: 12px; }
.logitem {
  background: var(--white);
  border: 1px solid var(--fog);
  border-left: 2px solid var(--clay);
  border-radius: 4px;
  padding: 14px 18px;
}
.logline { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.logtime { font-size: .75rem; color: var(--earth); letter-spacing: .02em; }
.logtpl { font-size: .75rem; color: var(--earth); margin-top: 2px; }
.logmsg { font-size: .88rem; color: #5C534A; margin-top: 8px; white-space: pre-wrap; }
.logket { font-size: .75rem; color: var(--rust); margin-top: 4px; }

.empty { color: var(--earth); font-size: .9rem; padding: 18px 0 8px; }

/* ---------- notes ---------- */
.note { font-size: .88rem; border-radius: 4px; padding: 10px 14px; margin: 14px 0 4px; }
.note-ok { background: #E7ECE2; color: var(--moss-deep); }
.note-err { background: #F2E4DE; color: #8A5A48; }

/* ---------- footer ---------- */
.foot {
  display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-top: 64px; padding-bottom: 34px;
  border-top: 1px solid var(--fog);
  padding-top: 22px;
  font-size: .78rem; color: var(--earth);
}
.foot-links { display: flex; align-items: center; gap: 14px; }
.foot form { display: inline; }

/* ---------- login ---------- */
.login-body {
  min-height: 100vh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 24px;
}
.login-card {
  width: 100%; max-width: 400px;
  background: var(--white);
  border: 1px solid var(--fog);
  border-radius: 6px;
  padding: 44px 34px 38px;
  text-align: center;
}
.login-mark {
  width: 56px; height: 56px;
  margin: 0 auto 18px;
  border: 2px solid var(--clay);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--clay);
  font-size: 1.4rem;
  position: relative;
}
.login-mark::after {
  content:''; position: absolute; inset: 7px;
  border: 1px solid var(--fog); border-radius: 50%;
}
.brand-lg { font-size: 1.6rem; letter-spacing: .06em; }
.login-sub { color: var(--earth); font-size: .85rem; margin: 4px 0 26px; }
.login-card .stack { text-align: left; }
.login-card .btn-primary { margin-top: 6px; }
.login-foot { margin-top: 22px; font-size: .75rem; color: var(--earth); }

/* ---------- mobile ---------- */
@media (max-width: 520px) {
  .hero { padding: 40px 0 10px; }
  .h-serif { font-size: 1.6rem; }
  .grid-stats { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stat { padding: 16px 16px; }
  .stat-num { font-size: 1.6rem; }
  .top-in { padding-top: 16px; padding-bottom: 14px; }
  .tstep .btn { margin-left: 0; width: 100%; }
}