/* ============================================================
   ADMIN (v10) — admin-wp.css (fallback ramping untuk admin.html)
   Layout utama memakai Tailwind (CDN + config inline di HTML).
   File ini hanya memuat mekanik yang tidak mungkin dibuat
   Tailwind: tampil/sembunyi layar-login · aplikasi · panel,
   menu-aktif, filter-tab, toast, editor WordPress, chips
   kategori/tag, status terbit, dan off-canvas mobile.
   ============================================================ */
* { -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; }
body { font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }

/* ---------- Bidang isian: garis batas jelas (outline-variant) ----------
   Mockup Stitch memakai border #c1c7d2 (outline-variant) pada hampir
   semua input/select/textarea (Pengaturan, Tulis, Widget, Artikel).
   Aturan ini menyamakan seluruh field agar garisnya selalu terlihat,
   termasuk layar login dan field yang dipakai ulang oleh admin.js. */
input:not([type]), input[type="text"], input[type="password"], input[type="email"], input[type="url"],
input[type="search"], input[type="tel"], input[type="number"], input[type="date"],
select, textarea {
  border: 1px solid #c1c7d2;
}
input:not([type]):focus, input[type="text"]:focus, input[type="password"]:focus, input[type="email"]:focus,
input[type="url"]:focus, input[type="search"]:focus, input[type="tel"]:focus,
input[type="number"]:focus, input[type="date"]:focus, select:focus, textarea:focus {
  border-color: #005891;
}

/* ---------- Layar login · aplikasi · panel ---------- */
.layar { display: none; }
.layar.tampil { display: flex; }
.aplikasi { display: none; }
.aplikasi.tampil { display: block; }
.panel { display: none; }
.panel.aktif { display: block; }

/* ---------- Menu samping ---------- */
.menu-item { background: none; border: none; cursor: pointer; font-family: inherit; text-align: left; }
.menu-item.aktif { background: #2271b1; color: #e9f1ff; font-weight: 600; }
.menu-item.aktif:hover { background: #2271b1; color: #e9f1ff; }

/* ---------- Filter tab artikel ---------- */
.filter-tab {
  background: none; border: none; cursor: pointer; font-family: inherit;
  padding: 6px 10px; border-radius: 6px; font-size: 14px; font-weight: 600;
  color: #414750; transition: all .15s; display: inline-flex; align-items: center; gap: 4px;
}
.filter-tab:hover { background: #f3f3f4; color: #005891; }
.filter-tab.aktif { color: #005891; }
.filter-tab span { font-size: 11px; font-weight: 500; color: #8f969e; margin-left: 2px; }
.filter-tab.aktif span { color: #005891; }
.filter-tab.sampah-tab:hover { color: #ba1a1a; }
.filter-tab.sampah-tab.aktif { color: #ba1a1a; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(90px);
  background: #1d2327; color: #fff; padding: 11px 20px; border-radius: 8px;
  font-size: 13px; opacity: 0; transition: all .3s ease; z-index: 300;
  box-shadow: 0 6px 16px rgba(0, 0, 0, .22); max-width: 90vw; pointer-events: none; line-height: 1.5;
}
.toast.tampil { transform: translateX(-50%) translateY(0); opacity: 1; }
.toast.gagal { background: #ba1a1a; }
.toast.sukses { background: #059669; }

/* ---------- Avatar pengguna (huruf inisial putih) ---------- */
#avatUser { color: #fff; font-weight: 700; font-size: 13px; line-height: 1; }

/* ---------- Editor ala WordPress ---------- */
.wp-editor {
  min-height: 440px; font-size: 14px; line-height: 1.75; color: #1a1c1d;
  background: #ffffff; padding: 24px; outline: none; overflow-y: auto;
}
.wp-editor:focus { box-shadow: inset 0 0 0 1px rgba(34, 113, 177, .45); }
.wp-editor[data-placeholder]:empty::before { content: attr(data-placeholder); color: #9aa0a6; pointer-events: none; }
.wp-editor h2, .wp-editor h3, .wp-editor h4 { line-height: 1.35; color: #1a1c1d; margin: 16px 0 8px; }
.wp-editor h2 { font-size: 20px; } .wp-editor h3 { font-size: 17px; } .wp-editor h4 { font-size: 15px; }
.wp-editor p { margin: 0 0 14px; }
.wp-editor ul, .wp-editor ol { padding-left: 24px; margin: 0 0 14px; }
.wp-editor a { color: #2271b1; text-decoration: underline; }
.wp-editor blockquote { border-left: 3px solid #ba1a1a; margin: 0 0 14px; padding: 2px 12px; color: #414750; font-style: italic; }
.wp-editor img { max-width: 100%; height: auto; border-radius: 4px; }
.wp-editor img.gambar-isi { display: block; margin: 8px 0 16px; }
.wp-btn.aktif { background: #2271b1; border-color: #2271b1; color: #fff; }

/* ---------- Pratinjau gambar utama ---------- */
.pratinjau-gambar img {
  max-height: 120px; max-width: 100%; width: auto; object-fit: contain; border-radius: 6px;
}

/* ---------- Kategori chips ---------- */
.kat-pil {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px;
  border-radius: 6px; font-size: 12.5px; cursor: pointer; background: #f3f3f4;
  color: #1a1c1d; border: 1px solid transparent; user-select: none; transition: all .15s;
}
.kat-pil:hover { border-color: #9ccaff; }
.kat-pil.pilih { background: #e9f1ff; color: #2271b1; border-color: #9ccaff; font-weight: 500; }
.kat-pil .cek-kat {
  width: 14px; height: 14px; border-radius: 4px; border: 1.5px solid #c1c7d2;
  flex: none; display: inline-flex; align-items: center; justify-content: center; position: relative;
}
.kat-pil.pilih .cek-kat { border-color: #2271b1; background: #2271b1; }
.kat-pil.pilih .cek-kat::after { content: "✓"; color: #fff; font-size: 10px; font-weight: 700; line-height: 1; }

/* ---------- Tag chips & saran ---------- */
.tag-chip {
  background: rgba(34, 113, 177, .08); border: 1px solid rgba(34, 113, 177, .22);
  border-radius: 6px; padding: 3px 8px; font-size: 12px; color: #005891;
  display: inline-flex; align-items: center; gap: 6px;
}
.tag-chip a { color: #8f969e; font-weight: 700; text-decoration: none; }
.tag-chip a:hover { color: #ba1a1a; }
.tag-saran {
  display: inline-block; background: rgba(34, 113, 177, .08);
  border: 1px solid rgba(34, 113, 177, .22); border-radius: 12px;
  padding: 3px 11px; margin: 3px 4px 0 0; font-size: 12px; color: #005891; text-decoration: none;
}
.tag-saran:hover { background: rgba(34, 113, 177, .15); border-color: #2271b1; }
.info-kecil { font-size: 12px; color: #717881; }

/* ---------- Status terbitkan ---------- */
.wp-status-titik { width: 8px; height: 8px; border-radius: 50%; background: #2271b1; flex: none; display: inline-block; }
.wp-status-titik.hijau { background: #059669; box-shadow: 0 0 0 3px rgba(5, 150, 105, .15); }
.wp-status-titik.abu { background: #c1c7d2; box-shadow: none; }
.wp-hasil-simpan { margin-top: 10px; padding: 9px 11px; border-radius: 6px; font-size: 12.5px; line-height: 1.5; }
.wp-hasil-simpan.oke { background: rgba(5, 150, 105, .1); border: 1px solid rgba(5, 150, 105, .25); color: #059669; }
.wp-hasil-simpan.oke a { color: #005891; font-weight: 700; text-decoration: underline; }
.wp-hasil-simpan.draft { background: rgba(34, 113, 177, .1); border: 1px solid rgba(34, 113, 177, .25); color: #2271b1; }

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: #b6bcc4; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- Off-canvas mobile (di bawah md = 768px) ---------- */
.overlay-menu { display: none; }
@media (max-width: 767.98px) {
  #sidebarAdmin { transform: translateX(-105%); transition: transform .25s ease; }
  body.menu-buka #sidebarAdmin { transform: translateX(0); box-shadow: 4px 0 24px rgba(0, 0, 0, .35); }
  body.menu-buka #overlayMenu { display: block; }
  #overlayMenu { position: fixed; inset: 0; background: rgba(0, 0, 0, .4); z-index: 60; }
  header { left: 0 !important; }
  .pl-64 { padding-left: 0 !important; }
}