﻿/* ================================================
   PerkoP App — owner.css (portal pemilik cafe)
   ================================================ */

:root {
  --amber:      #d97706;
  --amber-dark: #b45309;
  --dark:       #1c1009;
  --light:      #fffbf5;
  --muted:      #78716c;
  --border:     #e7e5e4;
  --success:    #059669;
  --danger:     #dc2626;
  --card-bg:    #ffffff;
  --sidebar-w:  240px;
}

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

body {
  font-family: 'Poppins', sans-serif;
  background: #f6f3ef;
  color: #292524;
  min-height: 100vh;
}

/* ── AUTH PAGES (login / register) ─────────────────── */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--dark);
  padding: 24px;
}

.auth-box {
  background: var(--card-bg);
  border-radius: 20px;
  padding: 40px 36px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
}

.auth-logo {
  text-align: center;
  margin-bottom: 28px;
}

.auth-logo h1 {
  font-size: 20px;
  font-weight: 700;
  color: var(--amber);
  letter-spacing: .04em;
}

.auth-logo p { font-size: 13px; color: var(--muted); margin-top: 4px; }

.auth-box h2 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 20px;
  color: var(--dark);
}

/* ── FORM ELEMENTS ───────────────────────────────── */
.form-group { margin-bottom: 16px; }

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: #44403c;
  margin-bottom: 5px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-family: inherit;
  font-size: 14px;
  color: var(--dark);
  background: white;
  transition: border-color .2s;
  outline: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--amber);
  box-shadow: 0 0 0 3px rgba(217,119,6,.1);
}

.form-group textarea { resize: vertical; min-height: 80px; }

.form-hint { font-size: 11px; color: var(--muted); margin-top: 4px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px 20px;
  border: none;
  border-radius: 10px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
  text-decoration: none;
}

.btn-primary {
  background: var(--amber);
  color: var(--dark);
  width: 100%;
}

.btn-primary:hover { background: var(--amber-dark); }
.btn-primary:disabled { opacity: .6; cursor: not-allowed; }

.btn-secondary {
  background: #f5f0eb;
  color: var(--dark);
  border: 1px solid var(--border);
}

.btn-secondary:hover { background: #ede8e3; }

.btn-danger {
  background: #fee2e2;
  color: var(--danger);
  border: 1px solid #fecaca;
}

.btn-danger:hover { background: #fecaca; }

.btn-ghost {
  background: transparent;
  color: var(--amber-dark);
  padding: 8px 12px;
}

.btn-ghost:hover { background: #fef3c7; }

.btn-sm { padding: 6px 12px; font-size: 12px; border-radius: 8px; }

.auth-switch {
  text-align: center;
  margin-top: 18px;
  font-size: 13px;
  color: var(--muted);
}

.auth-switch a { color: var(--amber-dark); font-weight: 600; text-decoration: none; }
.auth-switch a:hover { text-decoration: underline; }

/* ── CAPTCHA ─────────────────────────────────────── */
.captcha-wrap {
  background: #fffbf0;
  border: 1.5px solid #fcd34d;
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.captcha-question {
  font-size: 20px;
  font-weight: 700;
  color: var(--amber);
  letter-spacing: .05em;
  min-width: 80px;
}
.captcha-eq { font-size: 15px; color: var(--muted); white-space: nowrap; }
.captcha-wrap input[type="number"] {
  width: 86px;
  padding: 7px 10px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 16px;
  font-family: inherit;
  text-align: center;
  -moz-appearance: textfield;
}
.captcha-wrap input[type="number"]::-webkit-outer-spin-button,
.captcha-wrap input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; }
.captcha-refresh {
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 10px;
  cursor: pointer;
  color: var(--muted);
  font-size: 16px;
  line-height: 1;
  transition: all .15s;
}
.captcha-refresh:hover { background: var(--border); color: var(--dark); }

/* ── GANTI PASSWORD MODAL ─────────────────────────── */
.cpwd-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.55);
  display: flex; align-items: center; justify-content: center;
  z-index: 9999; padding: 20px;
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
.cpwd-overlay.open { opacity: 1; pointer-events: all; }
.cpwd-box {
  background: #fff; border-radius: 18px; padding: 32px 28px;
  width: 100%; max-width: 400px; position: relative;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
  transform: translateY(12px); transition: transform .2s;
}
.cpwd-overlay.open .cpwd-box { transform: translateY(0); }
.cpwd-box h3 { font-size: 17px; font-weight: 700; color: var(--dark); margin-bottom: 6px; }
.cpwd-box p  { font-size: 13px; color: var(--muted); margin-bottom: 20px; }
.cpwd-close {
  position: absolute; top: 14px; right: 16px;
  background: none; border: none; font-size: 22px; cursor: pointer;
  color: var(--muted); line-height: 1; padding: 2px 6px; border-radius: 6px;
}
.cpwd-close:hover { background: var(--border); }
.cpwd-msg { font-size: 13px; padding: 9px 12px; border-radius: 8px; margin-bottom: 14px; display: none; }
.cpwd-msg.ok  { background: #d1fae5; color: #065f46; display: block; }
.cpwd-msg.err { background: #fee2e2; color: #991b1b; display: block; }

/* sidebar ganti password button */
.sidebar-bottom button.btn-cpwd {
  margin-bottom: 8px;
  border-color: #3d2c1e;
  color: #c4a882;
}
.sidebar-bottom button.btn-cpwd:hover { background: #2e1a0e; color: #fcd34d; }

/* ── ALERT MESSAGES ──────────────────────────────── */
.alert {
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 16px;
  display: none;
  line-height: 1.5;
}

.alert.show { display: block; }
.alert-error   { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.alert-success { background: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; }
.alert-info    { background: #dbeafe; color: #1e40af; border: 1px solid #bfdbfe; }

/* ── PORTAL LAYOUT ───────────────────────────────── */
.portal-layout {
  display: flex;
  min-height: 100vh;
}

/* ── SIDEBAR ─────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--dark);
  padding: 0;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 100;
}

.sidebar-logo {
  padding: 24px 20px 16px;
  border-bottom: 1px solid #2e1a0e;
}

.sidebar-logo a {
  font-size: 16px;
  font-weight: 700;
  color: var(--amber);
  text-decoration: none;
  letter-spacing: .04em;
}

.sidebar-logo p {
  font-size: 11px;
  color: #8a7060;
  margin-top: 2px;
}

.sidebar-owner {
  padding: 14px 20px;
  border-bottom: 1px solid #2e1a0e;
}

.sidebar-owner .owner-name {
  font-size: 13px;
  font-weight: 600;
  color: #e7d5c5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-owner .owner-email {
  font-size: 11px;
  color: #78716c;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-nav { padding: 12px 10px; flex: 1; }

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  color: #a8927e;
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: all .15s;
  margin-bottom: 2px;
}

.sidebar-nav a:hover { background: #2e1a0e; color: #e7d5c5; }
.sidebar-nav a.active { background: var(--amber); color: var(--dark); font-weight: 600; }
.sidebar-nav .icon { font-size: 16px; width: 20px; text-align: center; }

.sidebar-bottom {
  padding: 16px 10px;
  border-top: 1px solid #2e1a0e;
}

.sidebar-bottom button {
  width: 100%;
  padding: 10px;
  background: transparent;
  border: 1px solid #5d3412;
  border-radius: 8px;
  color: #a8927e;
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: all .2s;
}

.sidebar-bottom button:hover { background: #2e1a0e; color: #e7d5c5; }

/* ── MAIN CONTENT ────────────────────────────────── */
.portal-main {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-width: 0;
}

.portal-header {
  background: white;
  border-bottom: 1px solid var(--border);
  padding: 20px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.portal-header h1 {
  font-size: 20px;
  font-weight: 600;
}

.portal-content { padding: 28px; }

/* ── STATS GRID ──────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  background: white;
  border-radius: 14px;
  padding: 20px;
  box-shadow: 0 1px 6px rgba(0,0,0,.06);
}

.stat-label { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.stat-value { font-size: 28px; font-weight: 700; color: var(--dark); line-height: 1; }
.stat-sub   { font-size: 11px; color: var(--muted); margin-top: 4px; }

/* ── CAFE CARDS (dashboard) ──────────────────────── */
.cafe-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.cafe-card {
  background: white;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 1px 6px rgba(0,0,0,.06);
  transition: box-shadow .2s;
}

.cafe-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.1); }

.cafe-card-photo {
  width: 100%;
  height: 140px;
  object-fit: cover;
}

.cafe-card-photo-placeholder {
  width: 100%;
  height: 140px;
  background: #f5f0eb;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
}

.cafe-card-body { padding: 14px 16px; }

.cafe-card-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 6px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.cafe-card-meta {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 12px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.cafe-card-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ── FORM PAGE (tambah-cafe) ─────────────────────── */
.form-page { max-width: 800px; }

.form-section {
  background: white;
  border-radius: 14px;
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: 0 1px 6px rgba(0,0,0,.06);
}

.form-section h3 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

/* ── MAP PICKER ───────────────────────────────────── */
#map-picker {
  height: 300px;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  margin-bottom: 12px;
  overflow: hidden;
}

.map-coords {
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 8px;
}

.map-coords span {
  background: #f5f0eb;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--dark);
}

/* ── PRICE RANGE SELECTOR ────────────────────────── */
.price-selector { display: flex; gap: 10px; }

.price-option { display: none; }

.price-option + label {
  padding: 8px 16px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  transition: all .2s;
}

.price-option:checked + label {
  border-color: var(--amber);
  background: #fef3c7;
  color: var(--amber-dark);
}

/* ── FACILITIES ───────────────────────────────────── */
.facilities-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
}

.facility-item { display: none; }

.facility-item + label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  color: var(--muted);
  transition: all .2s;
  user-select: none;
}

.facility-item:checked + label {
  border-color: var(--amber);
  background: #fef3c7;
  color: var(--amber-dark);
  font-weight: 500;
}

/* ── HOURS TABLE ─────────────────────────────────── */
.hours-table { width: 100%; border-collapse: collapse; }

.hours-table th {
  text-align: left;
  padding: 6px 8px;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}

.hours-table td { padding: 5px 8px; }

.hours-table input[type="time"] {
  width: 100%;
  padding: 6px 10px;
  border: 1.5px solid var(--border);
  border-radius: 7px;
  font-family: inherit;
  font-size: 13px;
  outline: none;
  transition: border-color .2s;
}

.hours-table input[type="time"]:focus { border-color: var(--amber); }
.hours-table input:disabled { background: #f5f5f5; color: #aaa; }

.hours-table .closed-check { display: flex; align-items: center; gap: 6px; }
.hours-table .closed-check input { accent-color: var(--danger); }
.hours-table .closed-check label { font-size: 12px; color: var(--muted); cursor: pointer; }

/* ── PHOTO UPLOAD ─────────────────────────────────── */
.photo-upload-zone {
  border: 2px dashed var(--border);
  border-radius: 10px;
  padding: 28px;
  text-align: center;
  cursor: pointer;
  transition: border-color .2s, background .2s;
  margin-bottom: 12px;
}

.photo-upload-zone:hover { border-color: var(--amber); background: #fffbf5; }
.photo-upload-zone p { font-size: 13px; color: var(--muted); margin-top: 6px; }
.photo-upload-zone .upload-icon { font-size: 32px; }

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 8px;
}

.photo-item {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  aspect-ratio: 1;
}

.photo-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-item .photo-delete {
  position: absolute;
  top: 4px;
  right: 4px;
  background: rgba(0,0,0,.6);
  color: white;
  border: none;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s;
}

.photo-item .photo-delete:hover { background: var(--danger); }

/* ── MENU BUILDER ─────────────────────────────────── */
.menu-list { margin-bottom: 12px; }

.menu-item-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: #f9f7f4;
  border-radius: 8px;
  margin-bottom: 6px;
  font-size: 13px;
}

.menu-item-row .menu-name { font-weight: 500; flex: 1; }
.menu-item-row .menu-cat  { color: var(--muted); font-size: 11px; background: #ede8e3; padding: 2px 7px; border-radius: 999px; }
.menu-item-row .menu-price { font-weight: 600; color: var(--amber-dark); white-space: nowrap; }

.menu-add-form {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  gap: 8px;
  align-items: end;
}

.menu-add-form input,
.menu-add-form select { font-size: 13px; }

/* ── LOADING OVERLAY ─────────────────────────────── */
.loading-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 9999;
  align-items: center;
  justify-content: center;
}

.loading-overlay.show { display: flex; }

.loading-spinner {
  background: white;
  border-radius: 14px;
  padding: 28px 36px;
  text-align: center;
  font-size: 14px;
  color: var(--dark);
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--amber);
  border-radius: 50%;
  animation: spin .8s linear infinite;
  margin: 0 auto 12px;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── OSM CLAIM BANNER ────────────────────────────── */
.claim-osm-banner {
  background: #fffbeb;
  border: 1px solid #fbbf24;
  border-left: 4px solid #d97706;
  border-radius: 10px;
  padding: 14px 18px;
  margin-bottom: 20px;
  font-size: 13px;
  color: #78350f;
  line-height: 1.65;
}

.claim-osm-banner strong {
  font-size: 13.5px;
  display: block;
  margin-bottom: 5px;
}

/* Input pre-filled from OSM data — subtle amber tint */
input.osm-prefilled {
  background: #fffbeb;
  border-color: #fbbf24;
}

/* ── CLAIM VERIFICATION STEPS ───────────────────── */
.verify-section {
  background: #f9f7f4;
  border: 1.5px solid #e7e5e4;
}

.verify-step {
  background: var(--card-bg);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  margin-bottom: 14px;
  overflow: hidden;
  transition: border-color .2s;
}

.verify-step-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 18px 14px;
  cursor: default;
}

.verify-num {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #e7e5e4;
  color: #78716c;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all .25s;
}

.verify-step-header > div { flex: 1; }
.verify-step-header > div strong { font-size: 14px; color: var(--dark); }

.verify-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.verify-badge {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}

.verify-step-body {
  padding: 0 18px 16px;
  font-size: 13px;
}

/* State variants */
.step-ok   { border-color: #059669; }
.step-ok   .verify-num { background: #059669; color: #fff; }
.step-ok   .verify-badge { color: #059669; }

.step-warn { border-color: #d97706; }
.step-warn .verify-num { background: #fef3c7; color: #d97706; }
.step-warn .verify-badge { color: #d97706; }

.step-error { border-color: #dc2626; }
.step-error .verify-num { background: #fee2e2; color: #dc2626; }
.step-error .verify-badge { color: #dc2626; }

/* GPS result boxes */
.gps-result {
  padding: 10px 14px;
  border-radius: 8px;
  margin-top: 10px;
  font-size: 13px;
  line-height: 1.5;
}

.gps-ok   { background: #d1fae5; color: #065f46; }
.gps-warn { background: #fef3c7; color: #78350f; }
.gps-error { background: #fee2e2; color: #7f1d1d; }

/* Selfie upload zone */
.selfie-upload-zone {
  border: 2px dashed var(--border);
  border-radius: 10px;
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color .2s, background .2s;
  min-height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.selfie-upload-zone:hover {
  border-color: var(--amber);
  background: #fffbf5;
}

/* Inline text button */
.btn-link {
  background: none;
  border: none;
  color: var(--amber);
  font-size: inherit;
  font-family: inherit;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}

/* ── EMPTY STATE ─────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
}

.empty-state .empty-icon { font-size: 48px; margin-bottom: 12px; }
.empty-state h3 { font-size: 16px; font-weight: 600; margin-bottom: 8px; }
.empty-state p  { font-size: 13px; color: var(--muted); margin-bottom: 20px; }

/* ── MOBILE SIDEBAR TOGGLE ───────────────────────── */
.sidebar-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  background: transparent;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 20px;
  cursor: pointer;
  color: var(--dark);
  transition: all .15s;
}
.sidebar-toggle:hover { background: #f5f0eb; }

/* Mobile overlay (shown when sidebar open) */
.mobile-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 150;
  cursor: pointer;
}

/* ── RESPONSIVE ──────────────────────────────────── */

/* Tablet (769px – 1024px) */
@media (max-width: 1024px) {
  :root { --sidebar-w: 210px; }
  .portal-content { padding: 20px; }
  .portal-header  { padding: 16px 20px; }
  .stats-grid     { grid-template-columns: repeat(2, 1fr); }
  .cafe-grid      { grid-template-columns: 1fr; }
}

/* Mobile (≤ 768px) */
@media (max-width: 768px) {
  /* Show hamburger button */
  .sidebar-toggle { display: flex; }

  /* Sidebar: slide-in drawer */
  .sidebar {
    position: fixed;
    top: 0;
    left: -270px;
    width: 260px;
    height: 100vh;
    z-index: 200;
    transition: left .28s cubic-bezier(.4,0,.2,1);
  }

  /* Open state */
  body.sidebar-open .sidebar       { left: 0; box-shadow: 4px 0 24px rgba(0,0,0,.3); }
  body.sidebar-open .mobile-overlay { display: block; }

  /* Main content: full width */
  .portal-layout  { flex-direction: row; }
  .portal-main    { margin-left: 0; width: 100%; }

  /* Header */
  .portal-header  { padding: 12px 16px; gap: 8px; }
  .portal-header h1 { font-size: 16px; flex: 1; min-width: 0; }

  /* Content */
  .portal-content { padding: 14px; }

  /* Form */
  .form-row       { grid-template-columns: 1fr; }
  .form-section   { padding: 16px; }
  .form-page      { max-width: 100%; }

  /* Menu builder */
  .menu-add-form  { grid-template-columns: 1fr 1fr; gap: 8px; }

  /* Price selector: wrap on small screens */
  .price-selector { flex-wrap: wrap; gap: 8px; }

  /* Prevent iOS zoom on inputs (must be 16px) */
  .form-group input,
  .form-group select,
  .form-group textarea { font-size: 16px; }

  /* Stats grid: 2 columns */
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 20px; }
  .stat-card  { padding: 14px; }
  .stat-value { font-size: 24px; }

  /* Cafe grid: 1 column */
  .cafe-grid { grid-template-columns: 1fr; }

  /* Hours table: horizontal scroll */
  .hours-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -4px; padding: 0 4px; }
  .hours-table      { min-width: 340px; }
  .hours-table th,
  .hours-table td   { padding: 4px 6px; }
  .hours-table input[type="time"] { padding: 5px 6px; font-size: 13px; }

  /* Map picker */
  #map-picker { height: 240px; }

  /* Auth box: less padding */
  .auth-box { padding: 28px 20px; }

  /* Empty state */
  .empty-state { padding: 40px 16px; }
}

/* Small mobile (≤ 480px) */
@media (max-width: 480px) {
  .portal-header h1 { font-size: 15px; }
  .stats-grid  { grid-template-columns: 1fr 1fr; gap: 8px; }
  .stat-value  { font-size: 20px; }
  .menu-add-form { grid-template-columns: 1fr; }
  .map-coords  { flex-wrap: wrap; gap: 6px; }
  .map-coords > div { width: 100%; }
}

/* ================================================
   WARUNG IDE — Forum Privat Pemilik Cafe
   ================================================ */

/* ── Banner info ─────────────────────────────── */
.forum-banner {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: #fef9f0;
  border: 1px solid #fde68a;
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 13px;
  color: #78450a;
  line-height: 1.55;
  margin-bottom: 20px;
}
.forum-banner-icon { font-size: 20px; flex-shrink: 0; }

/* ── Loading / empty states ──────────────────── */
.forum-loading,
.forum-empty {
  text-align: center;
  padding: 48px 16px;
  color: var(--muted);
  font-size: 14px;
}
.forum-no-replies {
  background: #f9f7f4;
  border-radius: 10px;
  padding: 20px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  margin: 12px 0;
}

/* ── Topic row (list page) ───────────────────── */
.forum-topic-row {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 16px;
  background: var(--card-bg);
  border-radius: 12px;
  box-shadow: 0 1px 4px rgba(0,0,0,.07);
  margin-bottom: 10px;
  text-decoration: none;
  color: inherit;
  transition: box-shadow .15s, transform .15s;
}
.forum-topic-row:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,.12);
  transform: translateY(-1px);
}
.forum-topic-row.pinned {
  border-left: 3px solid var(--amber);
}

.forum-topic-main { flex: 1; min-width: 0; }

.forum-pin-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  color: var(--amber-dark);
  background: #fef3c7;
  border-radius: 6px;
  padding: 2px 8px;
  margin-bottom: 6px;
}
.forum-closed-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  background: #f1f5f9;
  border-radius: 6px;
  padding: 2px 8px;
  margin-left: 6px;
}

.forum-topic-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--dark);
  margin-bottom: 4px;
  line-height: 1.4;
}
.forum-topic-preview {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 8px;
}
.forum-topic-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  font-size: 11px;
  color: var(--muted);
}
.forum-author { font-weight: 500; color: #57534e; }

.forum-topic-stats {
  flex-shrink: 0;
  text-align: center;
  min-width: 64px;
}
.forum-stat { display: flex; flex-direction: column; align-items: center; }
.forum-stat-num  { font-size: 18px; font-weight: 700; color: var(--dark); }
.forum-stat-lbl  { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing:.04em; }
.forum-stat-time { font-size: 10px; color: var(--muted); margin-top: 6px; white-space: nowrap; }

/* ── Pagination (forum) ──────────────────────── */
.forum-pagination { margin-top: 16px; }
.forum-pg-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.forum-pg-btn {
  padding: 6px 16px;
  background: var(--amber);
  color: #fff;
  border: none;
  border-radius: 20px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}
.forum-pg-btn:hover { background: var(--amber-dark); }
.forum-pg-info { font-size: 12px; color: var(--muted); }

/* ── Back button ─────────────────────────────── */
.forum-back-btn {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: color .15s;
}
.forum-back-btn:hover { color: var(--amber); }

/* ── Topic detail: header card ───────────────── */
.forum-topic-card,
.forum-reply-card {
  display: flex;
  gap: 14px;
  background: var(--card-bg);
  border-radius: 14px;
  padding: 18px;
  box-shadow: 0 1px 4px rgba(0,0,0,.07);
  margin-bottom: 10px;
}
.forum-topic-card { margin-bottom: 6px; }

/* ── Avatar circle ───────────────────────────── */
.forum-post-avatar {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--amber);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
}
.forum-post-avatar--sm {
  width: 34px;
  height: 34px;
  font-size: 14px;
}

.forum-post-content { flex: 1; min-width: 0; }

.forum-post-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.forum-post-author { font-size: 13px; font-weight: 600; color: var(--dark); }
.forum-post-time   { font-size: 11px; color: var(--muted); }
.forum-reply-num   { font-size: 11px; color: #a8a29e; margin-left: auto; }

.forum-topic-heading {
  font-size: 17px;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 10px;
  line-height: 1.4;
}

.forum-post-body {
  font-size: 13px;
  line-height: 1.7;
  color: #292524;
  word-break: break-word;
}

.forum-post-actions {
  margin-top: 10px;
  display: flex;
  gap: 8px;
}
.forum-del-btn {
  background: none;
  border: none;
  font-size: 11px;
  color: #a8a29e;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
  transition: color .15s;
}
.forum-del-btn:hover { color: var(--danger); }

/* ── Replies section ─────────────────────────── */
.forum-replies-header {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin: 20px 0 12px;
}

/* ── Reply form ──────────────────────────────── */
.forum-reply-form {
  background: var(--card-bg);
  border-radius: 14px;
  padding: 20px;
  box-shadow: 0 1px 4px rgba(0,0,0,.07);
  margin-top: 20px;
}
.forum-reply-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--dark);
  margin-bottom: 12px;
}

/* ── Closed notice ───────────────────────────── */
.forum-closed-notice {
  background: #f1f5f9;
  border-radius: 10px;
  padding: 14px 16px;
  font-size: 13px;
  color: #64748b;
  text-align: center;
  margin-top: 20px;
}

/* ── Char counter ────────────────────────────── */
.char-count {
  font-size: 11px;
  color: var(--muted);
  text-align: right;
  margin-top: 3px;
}

/* ── Modal: Topik Baru ───────────────────────── */
.forum-modal-bg {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 900;
  background: rgba(0,0,0,.45);
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.forum-modal-bg.open { display: flex; }

.forum-modal {
  background: var(--card-bg);
  border-radius: 16px;
  width: 100%;
  max-width: 540px;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
  display: flex;
  flex-direction: column;
  max-height: 90vh;
}
.forum-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 12px;
  border-bottom: 1px solid var(--border);
}
.forum-modal-header h3 { font-size: 16px; font-weight: 700; }
.forum-modal-close {
  background: none;
  border: none;
  font-size: 18px;
  color: var(--muted);
  cursor: pointer;
  line-height: 1;
  padding: 2px 6px;
}
.forum-modal-close:hover { color: var(--danger); }
.forum-modal-body {
  padding: 16px 20px;
  overflow-y: auto;
  flex: 1;
}
.forum-modal-footer {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding: 12px 20px 16px;
  border-top: 1px solid var(--border);
}

/* ── Threading ───────────────────────────────── */

/* Wrapper root reply + anak-anaknya */
.forum-thread {
  margin-bottom: 10px;
}

/* Slot untuk inline form — tidak mengambil ruang saat kosong */
.forum-inline-slot:empty { display: none; }

/* Indent container untuk balasan balasan */
.forum-thread-children {
  margin-left: 28px;
  padding-left: 12px;
  border-left: 2px solid #e7e5e4;
  margin-top: 6px;
}

/* Child thread tidak punya margin bawah sebesar root */
.forum-thread--child {
  margin-bottom: 6px;
}

/* Nested card: background lebih terang, tanpa shadow */
.forum-reply-card--nested {
  background: #f9f7f5;
  border: 1px solid #e7e5e4;
  box-shadow: none;
}

/* Avatar nested sedikit lebih kecil */
.forum-avatar--nested {
  width: 30px;
  height: 30px;
  font-size: 12px;
  background: #a8855a;
}

/* Tombol Balas di footer kartu */
.forum-reply-btn {
  background: none;
  border: none;
  font-size: 11px;
  font-weight: 600;
  color: var(--amber);
  cursor: pointer;
  padding: 0;
  font-family: inherit;
  transition: color .15s;
}
.forum-reply-btn:hover { color: var(--amber-dark); }

/* ── Inline reply form ───────────────────────── */
.forum-inline-reply {
  background: #fef9f0;
  border: 1px solid #fde68a;
  border-radius: 10px;
  padding: 12px 14px;
  margin: 6px 0 8px;
}

.forum-inline-label {
  font-size: 12px;
  color: #78450a;
  margin-bottom: 8px;
}

.forum-inline-textarea {
  width: 100%;
  border: 1px solid #e7d5b3;
  border-radius: 8px;
  padding: 8px 10px;
  font-family: inherit;
  font-size: 13px;
  line-height: 1.5;
  resize: vertical;
  min-height: 72px;
  background: #fff;
  outline: none;
  transition: border-color .15s;
}
.forum-inline-textarea:focus { border-color: var(--amber); }

.forum-inline-char {
  font-size: 10px;
  color: var(--muted);
  text-align: right;
  margin-top: 2px;
}

.forum-inline-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 8px;
}

/* ── Responsive ──────────────────────────────── */
@media (max-width: 600px) {
  .forum-topic-row    { gap: 10px; }
  .forum-topic-stats  { min-width: 50px; }
  .forum-stat-num     { font-size: 15px; }
  .forum-topic-card,
  .forum-reply-card   { gap: 10px; padding: 14px; }
  .forum-post-avatar  { width: 32px; height: 32px; font-size: 13px; }
  .forum-topic-heading { font-size: 15px; }
  .forum-thread-children { margin-left: 14px; padding-left: 8px; }
}
