/* ============================================================
   Rumah Impian v2 — Fully Responsive Stylesheet
   MOBILE: Card view, no horizontal scroll
   IPAD:   Compact table + 2-col grid
   INPUT:  16px font-size (prevent iOS auto-zoom)
   ============================================================ */

:root {
  --pink-50:   #fff0f6;
  --pink-100:  #ffe0ef;
  --pink-200:  #ffb3d1;
  --pink-300:  #ff80b3;
  --pink-400:  #f9518c;
  --pink-500:  #e8306e;
  --rose-400:  #fb7185;
  --rose-500:  #f43f5e;
  --cream-50:  #fffdf8;
  --petal:     #fce7f3;
  --white:     #ffffff;
  --text-dark:  #3d1a2e;
  --text-mid:   #6b3a52;
  --text-soft:  #9d6b82;
  --text-muted: #c49ab4;
  --shadow-xs: 0 1px 3px rgba(232,48,110,.08);
  --shadow-sm: 0 2px 8px rgba(232,48,110,.12);
  --shadow-md: 0 6px 20px rgba(232,48,110,.15);
  --shadow-lg: 0 16px 48px rgba(232,48,110,.18);
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body:    'Nunito', 'Segoe UI', sans-serif;
  --nav-h: 68px;
  --tr: 0.25s cubic-bezier(.4,0,.2,1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; overflow-x: hidden; }
body {
  font-family: var(--font-body);
  font-size: 15px; line-height: 1.65;
  color: var(--text-dark); background: var(--cream-50);
  min-height: 100vh; overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: var(--pink-500); text-decoration: none; transition: color var(--tr); }
a:hover { color: var(--rose-500); }
ul { list-style: none; }

/* ── Floating Hearts ── */
.hearts-bg { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.heart { position: absolute; bottom: -40px; font-size: 16px; opacity: 0; animation: floatHeart linear infinite; user-select: none; color: var(--pink-300); }
.heart-1  { left:5%;  font-size:14px; animation-duration:14s; animation-delay:0s;   }
.heart-2  { left:10%; font-size:18px; animation-duration:16s; animation-delay:2s;   }
.heart-3  { left:18%; font-size:12px; animation-duration:12s; animation-delay:4s;   }
.heart-4  { left:25%; font-size:20px; animation-duration:18s; animation-delay:1s;   }
.heart-5  { left:32%; font-size:10px; animation-duration:13s; animation-delay:6s;   }
.heart-6  { left:40%; font-size:16px; animation-duration:15s; animation-delay:3s;   }
.heart-7  { left:48%; font-size:14px; animation-duration:17s; animation-delay:8s;   }
.heart-8  { left:55%; font-size:22px; animation-duration:20s; animation-delay:2.5s; }
.heart-9  { left:62%; font-size:12px; animation-duration:11s; animation-delay:5s;   }
.heart-10 { left:70%; font-size:18px; animation-duration:16s; animation-delay:1.5s; }
.heart-11 { left:77%; font-size:10px; animation-duration:13s; animation-delay:7s;   }
.heart-12 { left:83%; font-size:20px; animation-duration:19s; animation-delay:0.5s; }
.heart-13 { left:88%; font-size:14px; animation-duration:14s; animation-delay:4.5s; }
.heart-14 { left:93%; font-size:16px; animation-duration:18s; animation-delay:9s;   }
.heart-15 { left:97%; font-size:12px; animation-duration:12s; animation-delay:3.5s; }
@keyframes floatHeart {
  0%   { transform:translateY(0) rotate(0deg);    opacity:0; }
  10%  { opacity:.6; }
  90%  { opacity:.3; }
  100% { transform:translateY(-105vh) rotate(360deg); opacity:0; }
}

/* ── Navbar ── */
.navbar {
  position: sticky; top: 0; z-index: 100;
  height: var(--nav-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 1.5rem;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--pink-100);
  box-shadow: var(--shadow-sm);
  width: 100%; max-width: 100vw;
}
.navbar-brand { display: flex; align-items: center; gap: .75rem; }
.brand-icon { font-size: 26px; animation: pulse 2.5s ease-in-out infinite; }
@keyframes pulse { 0%,100%{transform:scale(1)} 50%{transform:scale(1.1)} }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-title { font-family: var(--font-display); font-size: 1.1rem; font-weight: 700; color: var(--pink-500); }
.brand-sub   { font-size: .7rem; color: var(--text-soft); font-weight: 500; }
.nav-menu { display: flex; align-items: center; gap: .2rem; }
.nav-link {
  display: flex; align-items: center; gap: .4rem;
  padding: .5rem .85rem; border-radius: var(--radius-xl);
  font-weight: 600; font-size: .86rem; color: var(--text-mid);
  transition: background var(--tr), color var(--tr);
  white-space: nowrap; -webkit-tap-highlight-color: transparent;
}
.nav-link:hover { background: var(--petal); color: var(--pink-500); }
.nav-link.active { background: linear-gradient(135deg, var(--pink-400), var(--rose-400)); color: white; box-shadow: 0 4px 12px rgba(232,48,110,.35); }
.nav-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: .5rem; -webkit-tap-highlight-color: transparent; }
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--pink-500); border-radius: 4px; transition: var(--tr); }

/* ── Main Content ── */
.main-content { position: relative; z-index: 1; max-width: 1200px; margin: 0 auto; padding: 2rem 1.25rem 5rem; overflow-x: hidden; }

/* ── Page Header ── */
.page-header { text-align: center; margin-bottom: 2rem; }
.page-header h1 { font-family: var(--font-display); font-size: clamp(1.5rem,4vw,2.3rem); color: var(--pink-500); margin-bottom: .35rem; }
.page-header p  { color: var(--text-soft); font-size: .9rem; }

/* ── Love Banner ── */
.love-banner {
  background: linear-gradient(135deg,#ff80b3,#f9518c 50%,#e8306e);
  border-radius: var(--radius-lg); padding: 1.75rem 1.5rem;
  text-align: center; margin-bottom: 1.75rem;
  position: relative; overflow: hidden; box-shadow: var(--shadow-lg);
}
.love-banner::before { content:'❤️'; position:absolute; top:-20px; left:-20px; font-size:100px; opacity:.08; }
.love-banner::after  { content:'🏡'; position:absolute; bottom:-20px; right:-20px; font-size:100px; opacity:.08; }
.love-banner h2 { font-family: var(--font-display); font-size: clamp(1.1rem,3.5vw,1.85rem); color: white; text-shadow: 0 2px 8px rgba(0,0,0,.15); margin-bottom: .35rem; }
.love-banner p  { color: rgba(255,255,255,.88); font-size: clamp(.82rem,2.5vw,.92rem); font-style: italic; }

/* ── Stats Grid ── */
.stats-grid {
  display: grid; grid-template-columns: repeat(2,1fr);
  gap: 1rem; margin-bottom: 1.5rem;
}
.stat-card {
  background: white; border-radius: var(--radius-md);
  padding: 1.2rem 1rem;
  display: flex; align-items: center; gap: .85rem;
  box-shadow: var(--shadow-sm); border: 1px solid var(--pink-100);
  transition: transform var(--tr); min-width: 0;
}
.stat-card:hover { transform: translateY(-3px); }
.stat-icon { font-size: 2rem; width: 46px; height: 46px; display: flex; align-items: center; justify-content: center; border-radius: 50%; flex-shrink: 0; }
.stat-icon.pink   { background: var(--petal); }
.stat-icon.green  { background: #d1fae5; }
.stat-icon.amber  { background: #fef3c7; }
.stat-icon.purple { background: #ede9fe; }
.stat-info { flex: 1; min-width: 0; }
.stat-value { font-family: var(--font-display); font-size: 1.2rem; font-weight: 700; color: var(--text-dark); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stat-label { font-size: .72rem; color: var(--text-soft); font-weight: 600; line-height: 1.3; }

/* ── Progress Bar ── */
.progress-section { background:white; border-radius:var(--radius-md); padding:1.4rem; margin-bottom:1.75rem; box-shadow:var(--shadow-sm); border:1px solid var(--pink-100); }
.progress-header { display:flex; justify-content:space-between; align-items:center; margin-bottom:.85rem; }
.progress-title  { font-family:var(--font-display); font-size:1rem; color:var(--text-dark); }
.progress-pct    { font-weight:700; font-size:1.25rem; color:var(--pink-500); }
.progress-bar-wrap { background:var(--pink-100); border-radius:100px; height:14px; overflow:hidden; }
.progress-bar-fill {
  height:100%; width:0%;
  background: linear-gradient(90deg,var(--pink-400),var(--rose-400));
  border-radius:100px; transition:width 1.2s cubic-bezier(.4,0,.2,1);
  box-shadow:0 0 10px rgba(249,81,140,.5);
  position:relative; overflow:hidden;
}
.progress-bar-fill::after { content:''; position:absolute; top:0; left:-100%; width:100%; height:100%; background:linear-gradient(90deg,transparent,rgba(255,255,255,.4),transparent); animation:shimmer 2s infinite; }
@keyframes shimmer { to { left:200%; } }

/* ── Filter Bar ── */
.filter-bar { background:white; border-radius:var(--radius-md); padding:1rem 1.1rem; box-shadow:var(--shadow-sm); border:1px solid var(--pink-100); margin-bottom:1.5rem; display:flex; flex-wrap:wrap; gap:.7rem; align-items:flex-end; }
.filter-group { display:flex; flex-direction:column; gap:.28rem; flex:1; min-width:130px; }
.filter-group label { font-size:.73rem; font-weight:700; color:var(--text-soft); text-transform:uppercase; letter-spacing:.06em; }

/* ── Inputs — 16px prevents iOS auto-zoom ── */
.input, .select, textarea {
  font-family: var(--font-body);
  font-size: 16px;           /* MUST be 16px — prevents iOS Safari auto-zoom */
  color: var(--text-dark);
  background: var(--cream-50);
  border: 1.5px solid var(--pink-200);
  border-radius: var(--radius-sm);
  padding: .5rem .8rem;
  width: 100%; outline: none;
  transition: border-color var(--tr), box-shadow var(--tr);
  -webkit-appearance: none; appearance: none;
  -webkit-tap-highlight-color: transparent;
}
.input:focus, .select:focus, textarea:focus { border-color:var(--pink-400); box-shadow:0 0 0 3px rgba(249,81,140,.15); background:white; }
.input::placeholder { color:var(--text-muted); }
.select { cursor:pointer; background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23e8306e' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat:no-repeat; background-position:right 12px center; background-color:var(--cream-50); padding-right:2rem; }
textarea { resize:vertical; min-height:80px; }

/* ── Buttons ── */
.btn {
  display:inline-flex; align-items:center; gap:.4rem;
  padding:.62rem 1.15rem; border-radius:var(--radius-xl);
  font-family:var(--font-body); font-weight:700; font-size:.88rem;
  border:none; cursor:pointer; text-decoration:none;
  transition:transform var(--tr), box-shadow var(--tr);
  white-space:nowrap; -webkit-tap-highlight-color:transparent;
  touch-action:manipulation; user-select:none;
}
.btn:active { transform:scale(.96); }
.btn-primary  { background:linear-gradient(135deg,var(--pink-400),var(--rose-400)); color:white; box-shadow:0 4px 14px rgba(232,48,110,.35); }
.btn-primary:hover  { transform:translateY(-2px); box-shadow:0 6px 20px rgba(232,48,110,.45); color:white; }
.btn-secondary { background:var(--petal); color:var(--pink-500); border:1.5px solid var(--pink-200); }
.btn-secondary:hover { background:var(--pink-100); color:var(--pink-500); }
.btn-warning  { background:linear-gradient(135deg,#fbbf24,#f59e0b); color:white; box-shadow:0 4px 12px rgba(245,158,11,.3); }
.btn-warning:hover  { transform:translateY(-2px); color:white; }
.btn-danger   { background:linear-gradient(135deg,#f87171,#dc2626); color:white; box-shadow:0 4px 12px rgba(220,38,38,.3); }
.btn-danger:hover   { transform:translateY(-2px); color:white; }
.btn-ghost    { background:transparent; color:var(--text-mid); border:1.5px solid var(--pink-200); }
.btn-ghost:hover    { background:var(--pink-50); color:var(--pink-500); }
.btn-sm  { padding:.38rem .75rem; font-size:.8rem; }
.btn-icon { padding:.42rem .6rem; }

/* ── Category Section ── */
.category-section { margin-bottom: 2.25rem; }
.category-header {
  display:flex; align-items:center; justify-content:space-between;
  background:white; padding:1rem 1.25rem;
  border:1px solid var(--pink-100); border-bottom:2px solid var(--pink-200);
  border-radius:var(--radius-md) var(--radius-md) 0 0;
  cursor:pointer; transition:background var(--tr);
  -webkit-tap-highlight-color:transparent; touch-action:manipulation;
}
.category-header:hover { background:var(--pink-50); }
.category-name { font-family:var(--font-display); font-size:1rem; color:var(--text-dark); display:flex; align-items:center; gap:.55rem; flex:1; min-width:0; }
.category-badge { font-size:.72rem; font-weight:700; padding:.18rem .5rem; border-radius:100px; background:var(--petal); color:var(--pink-500); white-space:nowrap; }
.category-subtotal { font-weight:700; font-size:.85rem; color:var(--pink-500); margin-right:.75rem; white-space:nowrap; }
.category-toggle { color:var(--text-muted); font-size:1rem; transition:transform var(--tr); flex-shrink:0; }
.category-header.collapsed .category-toggle { transform:rotate(-90deg); }

/* ── Desktop Table ── */
.items-table-wrap { overflow:hidden; border:1px solid var(--pink-100); border-top:none; border-radius:0 0 var(--radius-md) var(--radius-md); }
.items-table { width:100%; border-collapse:collapse; font-size:.84rem; }
.items-table th { background:var(--pink-50); color:var(--text-soft); font-weight:700; font-size:.7rem; text-transform:uppercase; letter-spacing:.06em; padding:.7rem 1rem; text-align:left; white-space:nowrap; border-bottom:1px solid var(--pink-100); }
.items-table td { padding:.8rem 1rem; border-bottom:1px solid var(--pink-50); vertical-align:middle; color:var(--text-dark); }
.items-table tr:last-child td { border-bottom:none; }
.items-table tr:hover td { background:var(--cream-50); }
.items-table tr.status-dibeli td { opacity:.65; }
.items-table tr.status-dibeli .nama-barang { text-decoration:line-through; }
.items-table tfoot td { padding:.7rem 1rem; font-weight:700; background:var(--pink-50); }

/* ── Mobile Item Cards (shown only on mobile) ── */
.item-cards-wrap { display: none; }  /* hidden by default, shown via media query */

.item-card {
  background: white;
  border-radius: var(--radius-md);
  border: 1px solid var(--pink-100);
  box-shadow: var(--shadow-xs);
  margin-bottom: .85rem;
  overflow: hidden;
}
.item-card.status-dibeli { opacity: .7; }
.item-card.status-dibeli .ic-name { text-decoration: line-through; color: var(--text-soft); }

.ic-header { display:flex; align-items:flex-start; justify-content:space-between; padding:1rem 1rem .8rem; gap:.75rem; }
.ic-name-block { flex:1; min-width:0; }
.ic-name { font-weight:700; font-size:.95rem; color:var(--text-dark); line-height:1.35; }
.ic-desc { font-size:.77rem; color:var(--text-soft); margin-top:.2rem; }
.ic-actions { display:flex; gap:.4rem; flex-shrink:0; }

.ic-badges { display:flex; gap:.35rem; flex-wrap:wrap; padding:0 1rem .7rem; }

.ic-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  border-top: 1px solid var(--pink-50);
}
.ic-field {
  padding: .6rem .85rem;
  border-bottom: 1px solid var(--pink-50);
  display: flex; flex-direction: column; gap: .12rem;
}
.ic-field:nth-child(odd) { border-right: 1px solid var(--pink-50); }
.ic-label { font-size:.67rem; font-weight:700; text-transform:uppercase; letter-spacing:.06em; color:var(--text-muted); }
.ic-value { font-size:.85rem; color:var(--text-dark); font-weight:600; }
.ic-value.total   { color:var(--pink-500); }
.ic-value.muted   { font-weight:400; color:var(--text-soft); }

.ic-market {
  padding: .65rem .85rem; border-top: 1px solid var(--pink-50);
  display: flex; flex-wrap: wrap; gap: .45rem; align-items: center;
}
.ic-market-row { display:flex; align-items:center; gap:.35rem; font-size:.8rem; }

/* Cat subtotal bar */
.cat-subtotal-bar {
  display:flex; justify-content:space-between; align-items:center;
  background:var(--pink-50); border:1px solid var(--pink-100); border-top:none;
  border-radius:0 0 var(--radius-md) var(--radius-md);
  padding:.7rem 1rem; font-size:.84rem;
}
.cat-subtotal-bar strong { color:var(--pink-500); }

/* ── Badges ── */
.badge { display:inline-flex; align-items:center; gap:.2rem; padding:.18rem .52rem; border-radius:100px; font-size:.71rem; font-weight:700; white-space:nowrap; }
.badge-wishlist { background:#ede9fe; color:#7c3aed; }
.badge-akan     { background:#fef3c7; color:#d97706; }
.badge-dibeli   { background:#d1fae5; color:#059669; }
.badge-rendah   { background:#f3f4f6; color:#6b7280; }
.badge-sedang   { background:#fef3c7; color:#d97706; }
.badge-tinggi   { background:#fee2e2; color:#dc2626; }
.badge-shopee   { background:#fff0e6; color:#ee4d2d; }
.badge-tokped   { background:#e8f5e9; color:#00aa5b; }
.badge-equal    { background:#f3f4f6; color:#6b7280; }

/* ── Price comparison (desktop table) ── */
.price-cmp { display:flex; flex-direction:column; gap:.2rem; }
.price-row { display:flex; align-items:center; gap:.3rem; font-size:.78rem; }
.price-tag { font-size:.67rem; font-weight:700; padding:.1rem .32rem; border-radius:4px; }
.price-tag.s { background:#fff0e6; color:#ee4d2d; }
.price-tag.t { background:#e8f5e9; color:#00aa5b; }
.price-link { font-size:.72rem; padding:.18rem .38rem; border-radius:4px; background:var(--pink-100); color:var(--pink-500); font-weight:600; }
.price-link:hover { background:var(--pink-200); }

/* ── Form ── */
.form-card { background:white; border-radius:var(--radius-lg); padding:2rem; box-shadow:var(--shadow-md); border:1px solid var(--pink-100); max-width:780px; margin:0 auto; }
.form-section { margin-bottom:1.75rem; }
.form-section-title { font-family:var(--font-display); font-size:1rem; color:var(--pink-500); margin-bottom:.9rem; padding-bottom:.4rem; border-bottom:1.5px solid var(--pink-100); display:flex; align-items:center; gap:.5rem; }
.form-row { display:grid; grid-template-columns:1fr 1fr; gap:.85rem; margin-bottom:.85rem; }
.form-row.single { grid-template-columns:1fr; }
.form-row.triple { grid-template-columns:1fr 1fr 1fr; }
.form-group { display:flex; flex-direction:column; gap:.28rem; }
.form-group label { font-size:.78rem; font-weight:700; color:var(--text-mid); }
.form-group label .req { color:var(--rose-400); }
.form-group .hint { font-size:.73rem; color:var(--text-muted); margin-top:.12rem; }
.form-actions { display:flex; gap:.7rem; justify-content:flex-end; flex-wrap:wrap; margin-top:1.5rem; padding-top:1.25rem; border-top:1px solid var(--pink-100); }

/* ── Empty State ── */
.empty-state { text-align:center; padding:3rem 1.5rem; background:white; border-radius:var(--radius-md); border:2px dashed var(--pink-200); }
.empty-state .empty-icon { font-size:3.5rem; margin-bottom:.85rem; animation:bounce 2s infinite; }
.empty-state h3 { font-family:var(--font-display); color:var(--text-dark); margin-bottom:.45rem; }
.empty-state p  { color:var(--text-soft); margin-bottom:1.25rem; font-size:.88rem; }
@keyframes bounce { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-10px)} }

/* ── Modal ── */
.modal-overlay { position:fixed; inset:0; background:rgba(61,26,46,.45); backdrop-filter:blur(6px); z-index:999; display:flex; align-items:center; justify-content:center; opacity:0; pointer-events:none; transition:opacity var(--tr); padding:1rem; }
.modal-overlay.open { opacity:1; pointer-events:auto; }
.modal-box { background:white; border-radius:var(--radius-lg); padding:2rem 1.75rem; text-align:center; max-width:360px; width:100%; box-shadow:var(--shadow-lg); transform:scale(.9); transition:transform var(--tr); }
.modal-overlay.open .modal-box { transform:scale(1); }
.modal-icon { font-size:2.75rem; margin-bottom:.85rem; }
.modal-box h3 { font-family:var(--font-display); font-size:1.3rem; color:var(--text-dark); margin-bottom:.5rem; }
.modal-box p  { color:var(--text-soft); margin-bottom:1.25rem; font-size:.88rem; }
.modal-actions { display:flex; gap:.65rem; justify-content:center; }

/* ── Toast ── */
.toast { position:fixed; bottom:1.5rem; right:1.25rem; z-index:1100; background:white; border-radius:var(--radius-md); padding:.85rem 1.2rem; box-shadow:var(--shadow-lg); font-weight:600; font-size:.86rem; color:var(--text-dark); border-left:4px solid var(--pink-400); transform:translateY(120%); opacity:0; transition:transform .35s cubic-bezier(.4,0,.2,1), opacity .35s; max-width:calc(100vw - 2.5rem); }
.toast.show { transform:translateY(0); opacity:1; }

/* ── Alert ── */
.alert { padding:.85rem 1.1rem; border-radius:var(--radius-sm); font-size:.88rem; margin-bottom:1.25rem; border-left:4px solid transparent; }
.alert-success { background:#d1fae5; color:#065f46; border-color:#10b981; }
.alert-error   { background:#fee2e2; color:#991b1b; border-color:#f87171; }

/* ── Category Manager ── */
.cat-manager-grid { display:grid; grid-template-columns:1fr 1.6fr; gap:2rem; align-items:start; }
.categories-list { display:flex; flex-direction:column; gap:.75rem; }
.category-item { background:white; border-radius:var(--radius-md); padding:.9rem 1.1rem; display:flex; align-items:center; gap:.8rem; border:1.5px solid var(--pink-100); box-shadow:var(--shadow-xs); }
.cat-color-dot { width:12px; height:12px; border-radius:50%; flex-shrink:0; }
.cat-icon  { font-size:1.35rem; }
.cat-name  { font-weight:600; color:var(--text-dark); flex:1; min-width:0; font-size:.9rem; }
.cat-count { font-size:.76rem; color:var(--text-soft); }
.cat-actions { display:flex; gap:.4rem; }

/* ── Footer ── */
.site-footer { position:relative; z-index:1; background:white; border-top:1px solid var(--pink-100); text-align:center; padding:1.5rem 1rem; }
.footer-quote { font-family:var(--font-display); font-style:italic; color:var(--text-mid); margin-bottom:.4rem; font-size:.88rem; }
.footer-copy  { font-size:.76rem; color:var(--text-muted); }
.quote-heart  { animation:pulse 2s infinite; display:inline-block; }

/* ============================================================
   RESPONSIVE — TABLET / iPAD (768px – 1024px)
   ============================================================ */
@media (min-width: 768px) and (max-width: 1024px) {
  :root { --nav-h: 64px; }
  .main-content { padding: 1.5rem 1.25rem 4rem; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .items-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  /* iPad: hide less critical columns */
  .col-hide-tablet { display: none !important; }
  .form-row.triple { grid-template-columns: 1fr 1fr; }
  .stat-value { font-size: 1.1rem; }
}

/* ============================================================
   RESPONSIVE — MOBILE (≤ 767px)
   ============================================================ */
@media (max-width: 767px) {
  :root { --nav-h: 58px; }

  /* Navbar */
  .nav-toggle { display: flex; }
  .nav-menu {
    position: fixed; top: var(--nav-h); left: 0; right: 0;
    background: rgba(255,255,255,.97);
    flex-direction: column; align-items: stretch;
    padding: .65rem .75rem; gap: .3rem;
    border-bottom: 1px solid var(--pink-100);
    transform: translateY(-110%);
    transition: transform var(--tr);
    box-shadow: var(--shadow-md); z-index: 99;
  }
  .nav-menu.open { transform: translateY(0); }
  .nav-link { justify-content: center; padding: .72rem; font-size: .92rem; border-radius: var(--radius-md); }
  .brand-title { font-size: .98rem; }
  .brand-sub   { font-size: .65rem; }
  .brand-icon  { font-size: 22px; }

  /* Main */
  .main-content { padding: .85rem .8rem 5rem; }

  /* Stats — 2 col */
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: .7rem; }
  .stat-card  { padding: .9rem .8rem; gap: .6rem; }
  .stat-icon  { width: 40px; height: 40px; font-size: 1.55rem; }
  .stat-value { font-size: 1rem; }
  .stat-label { font-size: .67rem; }

  /* Love banner */
  .love-banner { padding: 1.35rem 1.1rem; }

  /* Progress */
  .progress-section { padding: 1.1rem; }
  .progress-title { font-size: .88rem; }

  /* Filter — full width stack */
  .filter-bar { flex-direction: column; gap: .6rem; padding: .9rem; }
  .filter-group { min-width: 0; width: 100%; }
  .filter-bar > .btn { width: 100%; justify-content: center; }

  /* SWITCH: hide table, show cards */
  .items-table-wrap { display: none !important; }
  .item-cards-wrap  { display: block; }

  /* Category header on mobile */
  .category-header  { padding: .85rem .9rem; }
  .category-name    { font-size: .9rem; }
  .category-subtotal { margin-right: .5rem; font-size: .8rem; }
  .category-section { margin-bottom: 1.5rem; }

  /* Forms */
  .form-card { padding: 1.1rem .9rem; }
  .form-row, .form-row.triple { grid-template-columns: 1fr; }
  .form-section-title { font-size: .9rem; }
  .form-actions { flex-direction: column; }
  .form-actions .btn { width: 100%; justify-content: center; }

  /* Category manager */
  .cat-manager-grid { grid-template-columns: 1fr !important; gap: 1.25rem; }
  .sticky-form-card { position: static !important; }

  /* Toast */
  .toast { bottom: 1rem; left: .75rem; right: .75rem; font-size: .84rem; }

  /* Modal */
  .modal-box { padding: 1.75rem 1.1rem; }
}

/* ============================================================
   VERY SMALL MOBILE (≤ 380px)
   ============================================================ */
@media (max-width: 380px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .stat-value { font-size: .88rem; }
  /* Stack card grid to single col on tiny screens */
  .ic-grid { grid-template-columns: 1fr; }
  .ic-field:nth-child(odd) { border-right: none; }
  .ic-field { border-right: none; }
}

/* ── Info Box (panduan isi link) ── */
.info-box {
  background: #fffbf0;
  border: 1.5px solid #fde68a;
  border-radius: var(--radius-sm);
  padding: .85rem 1rem;
  font-size: .85rem;
  color: var(--text-mid);
  margin-bottom: 1.25rem;
  line-height: 1.6;
}
.info-box code {
  background: var(--pink-50);
  border: 1px solid var(--pink-100);
  padding: .1rem .4rem;
  border-radius: 4px;
  font-size: .8rem;
  color: var(--pink-500);
  word-break: break-all;
}
.info-box ol li { margin-bottom: .1rem; }

/* ── Marketplace Block ── */
.marketplace-block {
  border: 1.5px solid var(--pink-100);
  border-radius: var(--radius-md);
  padding: 1rem 1rem .5rem;
  margin-bottom: 1rem;
}
.shopee-block { border-color: #ffd5c2; background: #fffaf8; }
.tokped-block { border-color: #b8e8c8; background: #f6fff9; }

.mkp-label {
  display: flex; align-items: center; gap: .5rem;
  margin-bottom: .75rem;
}
.mkp-icon { font-size: 1.2rem; }
.mkp-name { font-weight: 700; font-size: .9rem; color: var(--text-dark); }

/* ── Total Preview box ── */
.total-preview {
  background: var(--petal) !important;
  font-weight: 700;
  color: var(--pink-500) !important;
  font-family: var(--font-display);
  font-size: 1rem;
  cursor: default;
}

/* ── Marketplace Preview box ── */
.mkp-preview {
  background: var(--cream-50) !important;
  font-weight: 600;
  font-size: .9rem;
  color: var(--text-mid) !important;
  cursor: default;
  min-height: 48px;
  display: flex;
  align-items: center;
}
