/* ============================================================
   OMNIWARGA WARGA - portal warga mobile-first (mode Operate)
   Mewarisi dunia "MADING RT" dari tokens.css / DESIGN.md.
   Token di-<link> terpisah dari HTML (tanpa @import).
   ============================================================ */

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

html { scrollbar-color: var(--wood) var(--wall-deep); scrollbar-width: thin; }
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--wall-deep); }
::-webkit-scrollbar-thumb { background: var(--wood); border-radius: 4px; border: 2px solid var(--wall-deep); }

body {
  background:
    repeating-linear-gradient(0deg, rgba(10,26,22,.05) 0 2px, transparent 2px 30px),
    radial-gradient(120% 100% at 80% -10%, rgba(240,233,214,.06), transparent 55%),
    var(--wall);
  color: var(--cream);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--red); color: var(--paper); }
:focus-visible { outline: 3px solid var(--red); outline-offset: 2px; border-radius: 2px; }

.ic { width: 1em; height: 1em; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -0.14em; flex: none; }
.mono-note { font-family: var(--font-mono); font-size: 0.74rem; letter-spacing: 0.09em; color: var(--ink-soft); font-variant-numeric: tabular-nums; }

.skip-link { position: fixed; left: 16px; top: -60px; z-index: 99; background: var(--paper); color: var(--ink); padding: 10px 16px; border-radius: 4px; font-weight: 700; text-decoration: none; transition: top .2s ease-out; }
.skip-link:focus { top: 12px; }

/* ---------- panggung desktop ---------- */
.stage { min-height: 100dvh; display: grid; place-items: center; gap: clamp(32px, 5vw, 72px); padding: clamp(20px, 4vw, 56px); }
@media (min-width: 760px) {
  .stage { grid-template-columns: minmax(280px, 460px) auto; justify-content: center; align-items: center; }
}
.stage-copy { display: grid; gap: 18px; max-width: 460px; }
.stage-copy .mono-note { color: var(--cream-70); }
.stage-copy > p { color: var(--cream-70); max-width: 44ch; }
.display-sm { font-family: var(--font-display); font-weight: 400; font-size: clamp(2rem, 3.6vw, 3rem); line-height: 1.02; text-transform: uppercase; }
.stage-points { list-style: none; display: grid; gap: 10px; }
.stage-points li { display: flex; gap: 10px; align-items: baseline; color: var(--cream); font-weight: 600; font-size: .95rem; }
.stage-points .ic { color: var(--gold-light); font-size: 1rem; }
.stage-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: 700 .92rem var(--font-body); line-height: 1; padding: 12px 16px; border-radius: 8px; border: 0; cursor: pointer; text-decoration: none; transition: transform .15s ease-out, background-color .15s ease-out; }
.btn-solid { background: var(--red); color: var(--btn-text); }
.btn-solid:hover { background: var(--red-deep); transform: translateY(-1px); }
.btn-ghost-dark { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--paper-edge); }
.btn-ghost-dark:hover { box-shadow: inset 0 0 0 1.5px var(--ink-soft); transform: translateY(-1px); }
.stage-copy .btn-ghost-dark { color: var(--cream); box-shadow: inset 0 0 0 1.5px var(--line-on-wall); }
.stage-copy .btn-ghost-dark:hover { box-shadow: inset 0 0 0 1.5px var(--cream-70); }
.btn-sm { padding: 10px 13px; font-size: .85rem; border-radius: 6px; }
.btn-block { width: 100%; }

/* ---------- ponsel ---------- */
.phone {
  width: min(100%, 400px); height: min(100dvh - 40px, 800px); min-height: 560px;
  display: flex; flex-direction: column;
  background: var(--paper); color: var(--ink);
  border: 10px solid transparent;
  border-image: repeating-linear-gradient(90deg, var(--wood-dark) 0 6px, var(--wood) 6px 14px, var(--wood-light) 14px 18px, var(--wood) 18px 30px) 10;
  outline: 2px solid var(--wood-dark);
  border-radius: 18px;
  box-shadow: var(--shadow-lift);
  overflow: hidden;
  position: relative;
}
@media (max-width: 759px) {
  .phone { width: 100%; height: 100dvh; border: 0; outline: 0; border-radius: 0; }
  .stage { padding: 0; }
  .stage-copy { display: none; }
}

.appbar {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px;
  background: var(--wall); color: var(--cream);
  border-bottom: 1px solid var(--line-on-wall);
}
.appbar-brand { display: inline-flex; align-items: center; gap: 8px; font-size: 1rem; margin-right: auto; }
.appbar-brand b { font-family: var(--font-display); font-weight: 400; text-transform: uppercase; letter-spacing: .02em; font-size: 1rem; }
.appbar-brand .ic { color: var(--btn-text); background: var(--red); border-radius: 6px; padding: 3px; width: 22px; height: 22px; }
.appbar-tenant { color: var(--cream-70); }
.appbar-bell { width: 44px; height: 44px; border-radius: 8px; display: grid; place-items: center; background: transparent; color: var(--cream-70); border: 0; font-size: 1rem; cursor: pointer; }
.appbar-bell:hover { color: var(--cream); }

.appview { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 14px 14px 20px; display: block; position: relative; }
.demo-strip { text-align: center; background: rgba(178,58,46,.1); color: var(--red-deep); border-radius: 6px; padding: 6px 8px; margin-bottom: 12px; }

.view { display: grid; gap: 14px; animation: view-in .28s ease-out; padding-bottom: 12px; }
.view[hidden] { display: none; }
@keyframes view-in { from { opacity: 0; translate: 0 8px; } to { opacity: 1; translate: 0 0; } }

.hello { font-size: 1.15rem; color: var(--ink-soft); }
.hello b { color: var(--ink); font-family: var(--font-display); font-weight: 400; font-size: 1.5rem; letter-spacing: .01em; text-transform: uppercase; }
.view-title { font-family: var(--font-display); font-weight: 400; font-size: 1.5rem; text-transform: uppercase; letter-spacing: .01em; }

/* ---------- kartu tagihan ---------- */
.billcard, .ajukan, .kkcard { background: var(--panel); border: 1px solid var(--paper-edge); border-radius: 12px; padding: 16px; display: grid; gap: 12px; box-shadow: var(--shadow-soft); }
.billcard-label { color: var(--red-deep); }
.billcard-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.billcard-row b { display: block; font-size: 1.05rem; }
.billcard-row strong { font-family: var(--font-display); font-weight: 400; font-size: 1.5rem; }
.billcard-actions { display: flex; justify-content: space-between; align-items: center; gap: 10px; }

.qris { display: grid; justify-items: center; gap: 10px; border-top: 1px dashed var(--paper-edge); padding-top: 12px; }
.qris[hidden] { display: none; }
.qr { width: 128px; height: 128px; }
.qr path { fill: var(--ink); }

.pill { font-style: normal; font-family: var(--font-mono); font-size: .62rem; letter-spacing: .08em; padding: 4px 8px; border-radius: 99px; white-space: nowrap; }
.pill-green { background: rgba(61,112,72,.14); color: var(--green); }
.pill-red { background: rgba(178,58,46,.12); color: var(--red-deep); }

/* ---------- aksi cepat ---------- */
.quick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.quick a { display: grid; justify-items: center; gap: 7px; background: var(--panel); border: 1px solid var(--paper-edge); border-radius: 10px; padding: 13px 8px; text-decoration: none; color: var(--ink); font: 700 .8rem var(--font-body); text-align: center; transition: transform .15s ease-out, box-shadow .15s ease-out; }
.quick a .ic { font-size: 1.25rem; color: var(--red-deep); }
.quick a:hover { transform: translateY(-2px); box-shadow: var(--shadow-soft); }

/* ---------- feed & daftar ---------- */
.feedblock { display: grid; gap: 8px; }
.feedblock h2, .ajukan h2 { font-size: 1rem; letter-spacing: -.01em; }
.feed { list-style: none; display: grid; }
.feed li { display: flex; gap: 12px; align-items: baseline; padding: 10px 0; border-bottom: 1px dashed var(--paper-edge); }
.feed li:last-child { border-bottom: 0; }
.feed-date { min-width: 40px; flex: none; }
.feed b { display: block; font-size: .92rem; }
.feed .small { display: block; font-size: .85rem; color: var(--ink-soft); }
.feed .small .ic { font-size: 0.75rem; }
.feed button { margin-left: auto; flex: none; }

.billlist, .agendalist, .toggles { list-style: none; display: grid; gap: 10px; }
.bill { background: var(--panel); border: 1px solid var(--paper-edge); border-radius: 10px; padding: 13px 14px; display: grid; gap: 10px; }
.bill-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.bill-row b { display: block; font-size: .95rem; }
.bill.is-open { border-color: rgba(178,58,46,.4); }

.agendalist li { display: flex; align-items: center; gap: 12px; background: var(--panel); border: 1px solid var(--paper-edge); border-radius: 10px; padding: 12px 14px; }
.ag-date { text-align: center; line-height: 1.3; background: var(--paper); border: 1px solid var(--paper-edge); border-radius: 8px; padding: 7px 9px; flex: none; }
.agendalist div { flex: 1; }
.agendalist b { display: block; font-size: .95rem; }
.agendalist .small { display: block; font-size: .8rem; color: var(--ink-soft); }
.agendalist [data-daftar].is-on { background: var(--green); color: var(--btn-text); box-shadow: none; }

/* ---------- form ---------- */
.field { display: grid; gap: 6px; }
.field input, .field select { font: 500 1rem var(--font-body); color: var(--ink); background: var(--paper); border: 1px solid var(--paper-edge); border-radius: 8px; padding: 11px 12px; width: 100%; }
.field input:focus, .field select:focus { outline: 3px solid var(--red); outline-offset: 1px; border-color: var(--red); }
.ajukan .mono-note { text-align: center; }

/* ---------- profil ---------- */
.kkcard ul { list-style: none; display: grid; gap: 0; }
.kkcard li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px dashed var(--paper-edge); font-size: .92rem; }
.kkcard li:last-child { border-bottom: 0; }
.kkcard li span { font-family: var(--font-mono); font-size: .62rem; letter-spacing: .09em; color: var(--blue-deep); align-self: center; text-transform: uppercase; }
.toggles li { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--panel); border: 1px solid var(--paper-edge); border-radius: 10px; padding: 12px 14px; }
.toggles b { display: block; font-size: .92rem; }
.toggles .small { display: block; font-size: .8rem; color: var(--ink-soft); }
.switch { width: 52px; height: 32px; border-radius: 99px; border: 0; background: rgba(38,33,23,.18); position: relative; cursor: pointer; transition: background-color .18s ease-out; }
.switch i { position: absolute; top: 4px; left: 4px; width: 24px; height: 24px; border-radius: 50%; background: var(--panel); box-shadow: 0 1px 3px rgba(10,26,22,.4); transition: translate .18s cubic-bezier(.2,.8,.3,1); }
.switch.is-on { background: var(--green); }
.switch.is-on i { translate: 20px 0; }

/* ---------- tabbar ---------- */
.tabbar {
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: var(--wall); border-top: 1px solid var(--line-on-wall);
  padding: 6px 4px calc(8px + env(safe-area-inset-bottom, 0px));
}
.tabbar a { display: grid; justify-items: center; gap: 3px; padding: 9px 2px; border-radius: 8px; text-decoration: none; color: var(--cream-70); font: 600 .68rem var(--font-body); letter-spacing: .02em; min-height: 48px; }
.tabbar a .ic { font-size: 1.25rem; }
.tabbar a:hover { color: var(--cream); }
.tabbar a[aria-current='page'] { color: var(--gold-light); }

/* ---------- toast ---------- */
.toast { position: sticky; bottom: 12px; z-index: 30; justify-self: center; background: var(--wall); color: var(--cream); padding: 11px 16px; border-radius: 8px; box-shadow: var(--shadow-lift); font-size: .62rem; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; animation: toast-in .25s ease-out; }
@keyframes toast-in { from { opacity: 0; translate: 0 8px; } to { opacity: 1; translate: 0 0; } }
.toast[hidden] { display: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0ms !important; transition-duration: .01ms !important; }
}
