/* ══ Bottom sheet — SATU sumber gaya untuk semua sheet & modal ══
   Keluarga kelas (markup lama dipertahankan): ors-* (Pesanan), pbs-* (Page Manager/Produk/Kursus/Form), lus-* (list terpadu:
   Funnel/Link/Kupon/Tag/dst.), kb-* (editor kursus), aq-more-* ("Lainnya"), dan .modal-backdrop > .modal-box (modal tambah/edit,
   konfirmasi, pilihan dropdown, notifikasi). SEMUA nilai dari SATU set token --sheet-* (tokens.css) — acuannya sheet menu 3 titik.
   Ponsel: sheet naik dari bawah (slide-up). ≥640px: dialog di tengah. */
.ors-ov, .pbs-ov, .lus-ov, .kb-ov { position:fixed; inset:0; background:var(--backdrop); z-index:var(--sheet-z); display:none; align-items:flex-end; justify-content:center; }
.ors-ov.is-on, .pbs-ov.is-on, .lus-ov.is-on, .kb-ov.is-on { display:flex; }

/* Tampilan panel (latar, bayangan, sudut atas) — satu aturan untuk semua */
:is(.ors-sheet, .pbs-sheet, .lus-sheet, .kb-sheet, .modal-box, .aq-more-sheet) {
  background:var(--sheet-bg); box-shadow:var(--sheet-shadow);
  border-radius:var(--sheet-radius) var(--sheet-radius) 0 0;
}
.ors-sheet, .pbs-sheet, .lus-sheet, .kb-sheet {
  width:100%; max-width:var(--sheet-max-width); max-height:var(--sheet-max-height); overflow:auto;
  padding:var(--sheet-pad-top) var(--sheet-pad-x) calc(var(--sheet-pad-bottom) + env(safe-area-inset-bottom, 0px));
  animation:aqSheetUp var(--dur-base) ease-out;
}
@keyframes aqSheetUp { from { transform:translateY(40px); opacity:.4; } }
@media (min-width:640px) {
  .ors-ov, .pbs-ov, .lus-ov, .kb-ov { align-items:center; }
  :is(.ors-sheet, .pbs-sheet, .lus-sheet, .kb-sheet, .modal-box) { border-radius:var(--sheet-radius); }
  .ors-sheet, .pbs-sheet, .lus-sheet, .kb-sheet { padding-bottom:var(--sheet-pad-bottom); }
}
@media (prefers-reduced-motion:reduce) { .ors-sheet, .pbs-sheet, .lus-sheet, .kb-sheet, .modal-box { animation:none !important; } }

/* Handle (grab bar) — sama untuk semua, termasuk modal (::before) */
.ors-grab, .pbs-grab, .lus-grab, .kb-grab, .aq-more-handle {
  width:var(--sheet-handle-w); height:var(--sheet-handle-h); border-radius:var(--radius-pill); background:var(--sheet-handle-bg);
  margin:4px auto var(--sheet-handle-mb);
}

/* Judul & teks */
.ors-sheet h2, .pbs-sheet h2, .lus-sheet h2, .kb-sheet h2, .aq-more-title,
html body .modal-header :is(.modal-title, [style*="font-weight:var(--weight-bold)"]) { font-size:var(--sheet-title-size) !important; font-weight:var(--sheet-title-weight) !important; }
.ors-sheet h2, .pbs-sheet h2, .lus-sheet h2, .kb-sheet h2 { margin:0 0 4px; word-break:break-word; }
.ors-sheet p, .pbs-sheet p, .lus-sheet p, .kb-sheet p { font-size:var(--text-sm); color:var(--text-muted); margin:0 0 8px; overflow-wrap:anywhere; }
.ors-sheet p, .pbs-sheet p { font-family:var(--font-mono); } /* no. pesanan / slug */

/* Baris menu */
.ors-act, .pbs-act, .lus-act, .kb-act {
  display:flex; align-items:center; gap:var(--space-5-5); width:100%; min-height:var(--sheet-row-height); padding:var(--space-5) var(--space-2);
  border:0; background:transparent; font:inherit; font-weight:var(--weight-semibold); color:var(--text);
  border-radius:0; text-align:left; cursor:pointer; text-decoration:none; /* siku lurus: garis pemisah antar baris tidak melengkung */
}
.ors-act:hover, .pbs-act:hover, .lus-act:hover, .kb-act:hover,
.ors-act:active, .pbs-act:active, .lus-act:active, .kb-act:active { background:var(--hover); }
.ors-act:focus-visible, .pbs-act:focus-visible, .lus-act:focus-visible, .kb-act:focus-visible { outline:2px solid var(--brand); outline-offset:2px; }
.ors-act svg, .pbs-act svg, .lus-act svg, .kb-act svg { width:var(--icon-lg); height:var(--icon-lg); flex:none; display:block; }
.ors-act.is-danger, .pbs-act.is-danger, .lus-act.is-danger, .kb-act.is-danger { color:var(--color-danger-text); }
:is(.ors-act, .pbs-act, .lus-act, .kb-act).is-current { color:var(--color-neutral); cursor:not-allowed; background:var(--hover); } /* pilihan yang sedang aktif (mis. status saat ini) */

/* Garis pemisah antar menu — SATU aturan, SATU token */
:is(.ors-act, .pbs-act, .lus-act, .kb-act) + :is(.ors-act, .pbs-act, .lus-act, .kb-act) { border-top:1px solid var(--sheet-divider); }

/* ── Modal sebagai sheet ──────────────────────────────────────────────────────
   Markup modal tidak diubah; hanya cara tampilnya. Ponsel: dari bawah, selebar layar, handle di atas
   (tarik ke bawah untuk menutup — layout.js). Header/isi/footer memakai padding & garis token yang sama. */
.modal-header, .modal-footer { background:var(--sheet-bg); border-color:var(--sheet-divider); }
@media (max-width: 639px) {
  html body .modal-backdrop { align-items:flex-end; padding:0; }
  html body .modal-box {
    max-width:var(--sheet-max-width) !important; /* menimpa max-width inline per-modal: selalu selebar layar */
    max-height:var(--sheet-max-height);
    padding-top:var(--sheet-pad-top);
    animation:aqSheetUp var(--dur-base) ease-out;
  }
  html body .modal-box::before {
    content:""; display:block; flex:none;
    width:var(--sheet-handle-w); height:var(--sheet-handle-h); border-radius:var(--radius-pill); background:var(--sheet-handle-bg);
    margin:4px auto var(--sheet-handle-mb);
  }
  html body .modal-header { gap:var(--space-5); padding:0 var(--sheet-pad-x) var(--space-3); border-bottom:0; }
  html body .modal-header > :first-child { min-width:0; overflow-wrap:anywhere; }
  html body .modal-header > button { flex:none; }
  html body .modal-body { padding:var(--space-3) var(--sheet-pad-x) var(--space-6); }
  html body .modal-body[style*="padding:0"] { padding:0 !important; } /* daftar pilihan / notifikasi: edge-to-edge */
  html body .modal-footer { flex-wrap:wrap; padding:var(--space-5) var(--sheet-pad-x); padding-bottom:calc(var(--space-5) + env(safe-area-inset-bottom, 0px)); }
  html body .modal-footer > form { display:contents; } /* tombol di dalam <form> (mis. Hapus Pesanan) ikut jadi anak flex footer */
  html body .modal-footer > :is(button, a, summary), html body .modal-footer > form > :is(button, a) { flex:1 1 auto; justify-content:center; min-height:var(--ctl-h-lg); }
  html body .modal-box:not(:has(.modal-footer)) { padding-bottom:env(safe-area-inset-bottom, 0px); }
  /* Baris pilihan dropdown = baris menu sheet */
  html body .aq-select-modal-item { min-height:var(--sheet-row-height); padding-left:var(--sheet-pad-x); padding-right:var(--sheet-pad-x); font-weight:var(--weight-semibold); }
  /* Konfirmasi: Batal / Ya berbagi lebar sama */
  #aqConfirmModal .modal-footer > button { flex:1 1 0; }
}
@media (min-width:640px) { html body .modal-box { animation:aqSheetUp var(--dur-base) ease-out; } }

/* Saat modal terbuka, halaman di belakangnya tidak ikut tergulir */
body:has(.modal-backdrop:not(.hidden)) { overflow:hidden; }
/* Sedang ditarik (drag-to-close): tanpa transisi supaya mengikuti jari */
.modal-box.is-dragging { transition:none; animation:none; }

/* ── Tombol tutup (X) sheet & modal — SATU gaya: ikon "xmark" ala iOS, tanpa pembungkus (tanpa lingkaran/latar/border) ──
   Area sentuh tetap selebar --ctl-h-sm; ikon digeser ke tepi kanan supaya sejajar dengan isi sheet. */
.modal-close, .aq-more-close {
  display:inline-flex; align-items:center; justify-content:center; flex:none;
  width:var(--ctl-h-sm); height:var(--ctl-h-sm); padding:0; margin:0 calc((var(--icon-lg) - var(--ctl-h-sm)) / 2) 0 0;
  background:none; border:0; border-radius:0; box-shadow:none;
  color:var(--text-faint); line-height:var(--lh-none); cursor:pointer; -webkit-tap-highlight-color:transparent;
  transition:color var(--dur-fast), opacity var(--dur-fast);
}
.modal-close svg, .aq-more-close svg { width:var(--icon-lg); height:var(--icon-lg); display:block; }
.modal-close:hover, .aq-more-close:hover { background:none; color:var(--text); }
.modal-close:active, .aq-more-close:active { opacity:var(--opacity-muted); }
.modal-close:focus-visible, .aq-more-close:focus-visible { outline:2px solid var(--brand); outline-offset:-4px; border-radius:var(--radius-md); }

/* ── Sheet editor halaman (Page Manager, tampilan Kanban) ──────────────────────────────────────────
   Pakai kerangka .pbs-ov/.pbs-sheet + token --sheet-*; hanya mengubah isi: header ringkas + iframe editor (?embed=1)
   yang memenuhi tinggi sheet. Ponsel: sheet penuh dari bawah. ≥640px: dialog tengah yang lebih lebar. */
.pbs-sheet.pbs-edit {
  display:flex; flex-direction:column; overflow:hidden; padding:var(--sheet-pad-top) 0 0;
  height:var(--sheet-max-height); max-width:var(--sheet-max-width);
}
.pbs-edit-head { display:flex; align-items:center; justify-content:space-between; gap:var(--space-5); flex:none; padding:0 var(--sheet-pad-x) var(--space-3); border-bottom:1px solid var(--sheet-divider); }
.pbs-edit-head h2 { margin:0; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.pbs-edit-frame { flex:1 1 auto; width:100%; min-height:0; border:0; background:var(--sheet-bg); display:block; padding-bottom:env(safe-area-inset-bottom, 0px); }
@media (min-width:640px) { .pbs-sheet.pbs-edit { padding-bottom:0; } }
