:root {
  --peach: #f0a184;
  --peach-light: #fbe2d3;
  --peach-pale: #fff4ee;
  --plum: #3d2a2c;
  --plum-soft: #6b4d4f;
  --ivory: #fff8f3;
  --rose: #d98a82;
  --sage: #8a9a78;
  --sage-pale: #eef1e8;
  --gold: #cf9b4e;
  --white: #ffffff;
  --line: #e7d8cd;
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Plus Jakarta Sans", -apple-system, "Segoe UI", Roboto, sans-serif;
  --radius: 16px;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: var(--font-body); background: var(--ivory); color: var(--plum); }
h1, h2, h3 { font-family: var(--font-display); margin: 0; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }

/* ---------------- LOGIN ---------------- */
.login-screen { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: linear-gradient(160deg, var(--peach-pale), var(--sage-pale)); }
.login-card { background: var(--white); border-radius: 26px; padding: 44px 38px; width: 100%; max-width: 380px; box-shadow: 0 20px 50px -20px rgba(61,42,44,0.3); text-align: center; }
.login-card .mark { width: 52px; height: 52px; margin: 0 auto 14px; color: var(--peach); }
.login-card h1 { font-size: 1.4rem; margin-bottom: 4px; }
.login-card p.sub { color: var(--plum-soft); font-size: 0.88rem; margin-bottom: 26px; }
.field { text-align: left; margin-bottom: 16px; }
.field label { display: block; font-size: 0.82rem; font-weight: 600; margin-bottom: 6px; color: var(--plum-soft); }
.field input, .field select, .field textarea {
  width: 100%; padding: 11px 14px; border-radius: 12px; border: 1.5px solid var(--line); font-size: 0.95rem; outline: none; background: var(--ivory);
  transition: border-color 0.15s ease;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--peach); }
.field small { display: block; margin-top: 5px; color: var(--plum-soft); font-size: 0.76rem; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 22px; border-radius: 999px; font-weight: 600; font-size: 0.92rem; border: none; transition: 0.15s; }
.btn-primary { background: var(--plum); color: var(--peach-pale); width: 100%; }
.btn-primary:hover { opacity: 0.9; }
.btn-outline { background: var(--white); border: 1.5px solid var(--line); color: var(--plum); }
.btn-outline:hover { border-color: var(--plum); }
.btn-danger { background: #fbe4e1; color: #b03a2e; }
.btn-danger:hover { background: #f6cfc9; }
.error-msg { color: #b03a2e; font-size: 0.85rem; margin-top: 10px; min-height: 18px; }

/* ---------------- LAYOUT DASHBOARD ---------------- */
.dashboard { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.sidebar { background: var(--plum); color: var(--peach-pale); padding: 28px 20px; display: flex; flex-direction: column; }
.sidebar .brand { font-family: var(--font-display); font-size: 1.2rem; margin-bottom: 34px; display: flex; align-items: center; gap: 10px; }
.sidebar .brand svg { width: 26px; height: 26px; color: var(--peach); }
.side-nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.side-nav button {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; background: none; border: none;
  color: #d9c3bb; font-size: 0.92rem; text-align: left; width: 100%; font-weight: 500;
}
.side-nav button svg { width: 18px; height: 18px; }
.side-nav button:hover { background: rgba(255,255,255,0.06); color: var(--peach-pale); }
.side-nav button.active { background: var(--peach); color: var(--plum); font-weight: 700; }
.sidebar-foot { display: flex; flex-direction: column; gap: 10px; padding-top: 20px; border-top: 1px solid rgba(255,255,255,0.12); }
.sidebar-foot a, .sidebar-foot button { color: #d9c3bb; font-size: 0.86rem; background: none; border: none; text-align: left; padding: 6px 4px; }
.sidebar-foot a:hover, .sidebar-foot button:hover { color: var(--peach); }

.main-content { padding: 36px 44px; overflow-y: auto; }
.view { display: none; }
.view.active { display: block; }
.view-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 28px; flex-wrap: wrap; gap: 14px; }
.view-header p { color: var(--plum-soft); font-size: 0.9rem; margin-top: 4px; }

.card { background: var(--white); border-radius: var(--radius); padding: 26px; box-shadow: 0 6px 24px -14px rgba(61,42,44,0.18); }

/* ---------------- TABEL PRODUK ---------------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 720px; }
thead th { text-align: left; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--plum-soft); padding: 10px 12px; border-bottom: 2px solid var(--line); }
tbody td { padding: 12px; border-bottom: 1px solid var(--line); font-size: 0.9rem; vertical-align: middle; }
.prod-thumb { width: 52px; height: 52px; border-radius: 10px; object-fit: cover; background: var(--peach-light); display: grid; place-items: center; }
.prod-thumb svg { width: 24px; height: 24px; color: var(--plum); opacity: 0.5; }
.badge-pill { padding: 3px 10px; border-radius: 999px; font-size: 0.74rem; font-weight: 700; background: var(--sage-pale); color: var(--sage); }
.badge-pill.diskon { background: #fbe4e1; color: #b03a2e; }
.badge-pill.baru { background: var(--peach-light); color: var(--peach); }
.row-actions { display: flex; gap: 8px; }
.row-actions button { padding: 7px 13px; border-radius: 8px; font-size: 0.8rem; border: 1px solid var(--line); background: var(--white); }
.row-actions button:hover { background: var(--peach-pale); }
.row-actions .del:hover { background: #fbe4e1; color: #b03a2e; border-color: #f0b5ab; }
.empty-row td { text-align: center; padding: 40px; color: var(--plum-soft); }

/* ---------------- MODAL FORM PRODUK ---------------- */
.overlay { position: fixed; inset: 0; background: rgba(61,42,44,0.5); display: none; align-items: center; justify-content: center; padding: 20px; z-index: 200; }
.overlay.open { display: flex; }
.modal { background: var(--white); border-radius: 22px; width: 100%; max-width: 640px; max-height: 90vh; overflow-y: auto; padding: 32px; position: relative; }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 22px; }
.modal-head button { width: 34px; height: 34px; border-radius: 50%; background: var(--peach-pale); border: none; display: grid; place-items: center; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }
.image-drop { border: 2px dashed var(--line); border-radius: 14px; padding: 18px; text-align: center; cursor: pointer; }
.image-drop:hover { border-color: var(--peach); }
.image-drop img { max-height: 140px; margin: 0 auto 10px; border-radius: 10px; }
.image-drop span { display: block; font-size: 0.84rem; color: var(--plum-soft); }
.image-drop.small { padding: 12px; }
.image-drop.small img { max-height: 90px; }
.image-drop.small svg { width: 26px; height: 26px; }

.form-section-title { font-size: 1rem; margin-bottom: 16px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.hint { font-size: 0.82rem; color: var(--plum-soft); margin: -8px 0 16px; }
.checkbox-field { display: flex; align-items: flex-start; gap: 9px; padding: 11px 4px; }
.checkbox-field input { width: 18px; height: 18px; accent-color: var(--peach); flex-shrink: 0; margin-top: 2px; }
.checkbox-field label { flex: 1; min-width: 0; font-size: 0.88rem; font-weight: 600; color: var(--plum); margin: 0; }

.settings-card { margin-bottom: 20px; }
.logo-upload-row { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; }
.logo-upload-row .image-drop { flex: 1 1 200px; min-width: 0; }
.hero-images-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.hero-img-slot { display: flex; flex-direction: column; gap: 8px; }
.btn-sm { padding: 8px 14px; font-size: 0.8rem; }
.mini-input { width: 100%; padding: 7px 10px; border-radius: 9px; border: 1.5px solid var(--line); font-size: 0.76rem; background: var(--ivory); margin-top: 6px; outline: none; }
.mini-input:focus { border-color: var(--peach); }
.add-category-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.add-category-row .mini-input { flex: 1 1 200px; min-width: 0; font-size: 0.88rem; padding: 10px 14px; }
.add-category-row .btn { flex-shrink: 0; }
@media (max-width: 480px) {
  .add-category-row { flex-direction: column; align-items: stretch; }
  .logo-upload-row { flex-direction: column; align-items: stretch; }
}

.cat-list { display: flex; flex-direction: column; gap: 10px; }
.cat-row { display: flex; align-items: center; gap: 16px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; }
.cat-row-thumb {
  width: 56px; height: 56px; border-radius: 12px; overflow: hidden; flex-shrink: 0; cursor: pointer;
  background: var(--peach-pale); display: grid; place-items: center; border: 2px dashed transparent; transition: border-color 0.15s ease;
}
.cat-row-thumb:hover { border-color: var(--peach); }
.cat-row-thumb img { width: 100%; height: 100%; object-fit: cover; }
.cat-row-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cat-row-info strong { font-size: 0.95rem; }
.cat-row-info span { font-size: 0.78rem; color: var(--plum-soft); }
.cat-row-actions { display: flex; gap: 8px; flex-shrink: 0; flex-wrap: wrap; }
@media (max-width: 640px) {
  .cat-row { flex-wrap: wrap; }
  .cat-row-actions { width: 100%; margin-top: 4px; }
}

.faq-admin-list { display: flex; flex-direction: column; gap: 10px; }
.faq-admin-row { display: flex; align-items: flex-start; gap: 14px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; }
.faq-admin-info { flex: 1; min-width: 0; }
.faq-admin-info strong { display: block; font-size: 0.92rem; margin-bottom: 4px; }
.faq-admin-info p {
  font-size: 0.8rem; color: var(--plum-soft); margin: 0;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.faq-admin-actions { display: flex; gap: 8px; flex-shrink: 0; flex-wrap: wrap; }
@media (max-width: 640px) {
  .faq-admin-row { flex-wrap: wrap; }
  .faq-admin-actions { width: 100%; }
}
@media (max-width: 640px) { .hero-images-grid { grid-template-columns: 1fr; } }
.form-actions { display: flex; gap: 12px; margin-top: 24px; }
.form-actions .btn { flex: 1; }

/* ---------------- TOAST ---------------- */
.toast { position: fixed; left: 50%; bottom: 30px; transform: translate(-50%, 20px); background: var(--plum); color: var(--peach-pale);
  padding: 13px 24px; border-radius: 999px; font-size: 0.88rem; opacity: 0; transition: 0.25s ease; z-index: 900; pointer-events: none; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: #b03a2e; }

@media (max-width: 860px) {
  .dashboard { grid-template-columns: 1fr; }
  .sidebar { flex-direction: row; align-items: center; padding: 16px 20px; overflow-x: auto; }
  .sidebar .brand { margin-bottom: 0; margin-right: 20px; }
  .side-nav { flex-direction: row; }
  .sidebar-foot { flex-direction: row; border: none; padding: 0; margin-left: auto; }
  .main-content { padding: 24px 18px; }
  .form-grid { grid-template-columns: 1fr; }
}
