:root {
  --bg: #eef5fb;
  --bg-soft: #f7fbff;
  --surface: rgba(255, 255, 255, 0.78);
  --surface-solid: #ffffff;
  --ink: #1e3a4c;
  --muted: #5a7a8f;
  --line: rgba(140, 185, 220, 0.35);
  --blue-50: #f0f7fc;
  --blue-100: #d9ecf8;
  --blue-200: #b8daf0;
  --blue-300: #8ec4e6;
  --blue-400: #5aa8d4;
  --blue-500: #3d8fbf;
  --blue-600: #2f759e;
  --shadow: 0 18px 40px rgba(80, 140, 180, 0.12);
  --shadow-sm: 0 8px 20px rgba(80, 140, 180, 0.1);
  --radius: 22px;
  --radius-sm: 14px;
  --font: "Outfit", sans-serif;
  --display: "Sora", sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 10% -10%, #d7ebf8 0%, transparent 55%),
    radial-gradient(900px 500px at 90% 0%, #e4f2fb 0%, transparent 50%),
    linear-gradient(180deg, var(--bg-soft), var(--bg));
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.55;
}

body.modal-open,
body.locked {
  overflow: hidden;
}

body.locked .app-shell {
  filter: blur(6px);
  pointer-events: none;
  user-select: none;
}

.hidden {
  display: none !important;
}

/* Login */
.login-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 1.25rem;
  background: rgba(60, 110, 145, 0.28);
  backdrop-filter: blur(10px);
  animation: fadeIn 0.3s ease;
}

.login-screen.hidden {
  display: none !important;
}

.login-card {
  width: min(420px, 100%);
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 1.6rem;
  box-shadow: var(--shadow);
  animation: modalIn 0.4s var(--ease);
}

.login-brand {
  text-align: center;
  margin-bottom: 1.25rem;
}

.login-brand .logo-mark {
  margin: 0 auto 0.75rem;
}

.login-brand h1 {
  margin: 0;
  font-family: var(--display);
  font-size: 1.6rem;
  letter-spacing: -0.03em;
  color: var(--blue-600);
}

.login-brand p {
  margin: 0.4rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

#loginForm {
  display: grid;
  gap: 0.85rem;
}

#loginForm label {
  display: grid;
  gap: 0.35rem;
  font-size: 0.9rem;
  font-weight: 600;
}

#loginForm input {
  font: inherit;
  font-weight: 400;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.75rem 0.9rem;
  background: var(--blue-50);
  color: var(--ink);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

#loginForm input:focus {
  border-color: var(--blue-300);
  box-shadow: 0 0 0 3px rgba(142, 196, 230, 0.28);
}

.login-error {
  margin: 0;
  color: #c04545;
  background: #fdecec;
  border-radius: 10px;
  padding: 0.55rem 0.75rem;
  font-size: 0.88rem;
  font-weight: 550;
}

.login-hint {
  margin-top: 1rem;
  padding: 0.85rem;
  border-radius: 14px;
  background: var(--blue-50);
  border: 1px dashed var(--blue-200);
  color: var(--muted);
  font-size: 0.82rem;
}

.login-hint p {
  margin: 0.2rem 0;
}

.user-pill {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.7rem 0.35rem 0.35rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid var(--line);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink);
  max-width: 180px;
}

.user-role {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.28rem 0.45rem;
  border-radius: 999px;
  background: var(--blue-100);
  color: var(--blue-600);
  font-weight: 700;
}

.user-role.is-admin {
  background: #dff0ea;
  color: #2f7a68;
}

.btn-logout {
  padding: 0.55rem 0.9rem !important;
  font-size: 0.88rem;
}

.admin-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
  margin-top: 0.2rem;
}

.btn-edit,
.btn-delete {
  border: none;
  border-radius: 12px;
  padding: 0.6rem;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
  transition: transform 0.2s, background 0.2s;
}

.btn-edit {
  background: rgba(142, 196, 230, 0.28);
  color: var(--blue-600);
}

.btn-edit:hover {
  background: var(--blue-200);
  transform: scale(1.02);
}

.btn-delete {
  background: rgba(224, 100, 100, 0.12);
  color: #c04545;
}

.btn-delete:hover {
  background: rgba(224, 100, 100, 0.2);
  transform: scale(1.02);
}

body.role-admin .user-only {
  display: none !important;
}

body.role-user .admin-only {
  display: none !important;
}

/* Admin history layer (halaman terpisah) */
.history-layer {
  position: fixed;
  inset: 0;
  z-index: 70;
  background:
    radial-gradient(900px 500px at 10% -10%, #d7ebf8 0%, transparent 55%),
    linear-gradient(180deg, var(--bg-soft), var(--bg));
  overflow: auto;
  animation: fadeIn 0.25s ease;
}

.history-layer.hidden {
  display: none !important;
}

.history-layer-inner {
  width: min(1100px, calc(100% - 2rem));
  margin: 1.25rem auto 2.5rem;
}

.history-layer-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.1rem;
  flex-wrap: wrap;
}

.history-layer-head h2 {
  margin: 0 0 0.25rem;
  font-family: var(--display);
  letter-spacing: -0.02em;
}

.history-layer-head .modal-sub {
  margin: 0;
}

.history-toolbar {
  display: grid;
  gap: 0.85rem;
  margin-bottom: 0.75rem;
}

.history-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: end;
  padding: 0.9rem 1rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--line);
}

.history-filter label {
  display: grid;
  gap: 0.3rem;
  font-size: 0.82rem;
  font-weight: 650;
  color: var(--muted);
}

.history-filter input[type="date"] {
  font: inherit;
  font-weight: 500;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.6rem 0.75rem;
  background: var(--blue-50);
  outline: none;
  min-width: 160px;
}

.history-filter input[type="date"]:focus {
  border-color: var(--blue-300);
  box-shadow: 0 0 0 3px rgba(142, 196, 230, 0.25);
}

.history-filter-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.history-filter-info {
  margin: 0 0 1rem;
  color: var(--blue-600);
  font-size: 0.88rem;
  font-weight: 600;
}

.history-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  justify-content: flex-end;
}

.history-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.85rem;
  margin-bottom: 1.25rem;
}

.stat-card.highlight {
  background: linear-gradient(145deg, rgba(217, 236, 248, 0.95), rgba(255, 255, 255, 0.9));
  border-color: var(--blue-300);
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 1rem 1.1rem;
  box-shadow: var(--shadow-sm);
  display: grid;
  gap: 0.25rem;
}

.stat-card span {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 550;
}

.stat-card strong {
  font-size: 1.25rem;
  color: var(--blue-600);
  font-family: var(--display);
}

.stat-card small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 550;
}

.history-table-wrap {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 0.5rem;
  box-shadow: var(--shadow-sm);
  overflow-x: auto;
}

.history-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.history-table th {
  text-align: left;
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.75rem 0.85rem;
  border-bottom: 1px solid var(--line);
}

.history-table td {
  padding: 0.85rem;
  border-bottom: 1px solid rgba(140, 185, 220, 0.22);
  vertical-align: top;
}

.history-table tr:last-child td {
  border-bottom: none;
}

.history-table .mono {
  font-family: var(--display);
  font-size: 0.82rem;
  letter-spacing: 0.02em;
}

.history-items {
  color: var(--muted);
  font-size: 0.82rem;
  max-width: 280px;
}

.history-items div {
  margin-bottom: 0.25rem;
}

.history-total,
.history-profit {
  font-weight: 700;
  white-space: nowrap;
}

.history-total {
  color: var(--blue-600);
}

.history-profit {
  color: #2f7a68;
}

body.history-open {
  overflow: hidden;
}

@media (max-width: 860px) {
  .history-stats {
    grid-template-columns: 1fr 1fr;
  }

  .history-actions {
    width: 100%;
  }

  .history-actions .btn-outline,
  .history-actions .btn-primary {
    flex: 1;
  }
}

@media (max-width: 520px) {
  .history-stats {
    grid-template-columns: 1fr;
  }
}

.bg-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.55;
  pointer-events: none;
  z-index: 0;
  animation: orbDrift 18s ease-in-out infinite alternate;
}

.bg-orb-1 {
  width: 320px;
  height: 320px;
  background: #c5e4f7;
  top: 12%;
  left: -80px;
}

.bg-orb-2 {
  width: 280px;
  height: 280px;
  background: #dceef9;
  top: 48%;
  right: -60px;
  animation-delay: -6s;
}

.bg-orb-3 {
  width: 220px;
  height: 220px;
  background: #b9daf0;
  bottom: 8%;
  left: 35%;
  animation-delay: -11s;
}

@keyframes orbDrift {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(30px, -24px) scale(1.08); }
}

.container {
  width: min(1120px, calc(100% - 2rem));
  margin-inline: auto;
  position: relative;
  z-index: 1;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(16px);
  background: rgba(247, 251, 255, 0.75);
  border-bottom: 1px solid var(--line);
  animation: slideDown 0.6s var(--ease);
}

@keyframes slideDown {
  from { transform: translateY(-100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.header-inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 1rem;
  align-items: center;
  padding: 0.85rem 0;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  color: var(--ink);
}

.logo-mark {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, var(--blue-300), var(--blue-500));
  color: white;
  font-family: var(--display);
  font-weight: 700;
  box-shadow: 0 8px 18px rgba(61, 143, 191, 0.28);
}

.logo-text {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.search-wrap {
  position: relative;
  max-width: 420px;
  width: 100%;
  justify-self: center;
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--blue-400);
  pointer-events: none;
}

.search-wrap input {
  width: 100%;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.85);
  border-radius: 999px;
  padding: 0.72rem 1rem 0.72rem 2.5rem;
  font: inherit;
  color: var(--ink);
  outline: none;
  transition: border-color 0.25s, box-shadow 0.25s, transform 0.25s;
}

.search-wrap input:focus {
  border-color: var(--blue-300);
  box-shadow: 0 0 0 4px rgba(142, 196, 230, 0.25);
  transform: translateY(-1px);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.btn-primary,
.btn-outline,
.btn-ghost {
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  border-radius: 999px;
  transition: transform 0.25s var(--ease), box-shadow 0.25s, background 0.25s, color 0.25s;
}

.btn-primary {
  border: none;
  background: linear-gradient(135deg, var(--blue-400), var(--blue-600));
  color: white;
  padding: 0.8rem 1.35rem;
  box-shadow: 0 10px 24px rgba(61, 143, 191, 0.28);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(61, 143, 191, 0.35);
}

.btn-outline {
  border: 1.5px solid var(--blue-300);
  background: rgba(255, 255, 255, 0.55);
  color: var(--blue-600);
  padding: 0.75rem 1.25rem;
}

.btn-outline:hover {
  background: white;
  transform: translateY(-2px);
}

.btn-ghost {
  border: none;
  background: transparent;
  color: var(--blue-600);
  padding: 0.55rem 0.9rem;
}

.btn-ghost:hover {
  background: var(--blue-100);
}

.btn-primary.full,
.btn-outline.full {
  width: 100%;
}

.cart-btn {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.8);
  color: var(--blue-600);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: transform 0.25s var(--ease), background 0.25s;
}

.cart-btn:hover {
  transform: translateY(-2px) scale(1.04);
  background: white;
}

.cart-count {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--blue-500);
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  display: grid;
  place-items: center;
  transform: scale(0);
  transition: transform 0.3s var(--ease);
}

.cart-count.show {
  transform: scale(1);
}

.cart-count.pop {
  animation: pop 0.35s var(--ease);
}

@keyframes pop {
  0% { transform: scale(0.7); }
  50% { transform: scale(1.25); }
  100% { transform: scale(1); }
}

/* Hero */
.hero {
  padding: 3.5rem 0 2.5rem;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 2rem;
  align-items: center;
  min-height: min(68vh, 560px);
}

.hero-copy {
  animation: fadeUp 0.8s var(--ease) both;
}

.brand-tag {
  margin: 0 0 0.75rem;
  font-family: var(--display);
  font-size: clamp(2rem, 5vw, 3.4rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  color: var(--blue-500);
  line-height: 1;
}

.hero-copy h1 {
  margin: 0 0 0.9rem;
  font-family: var(--display);
  font-size: clamp(1.45rem, 3.2vw, 2.15rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.25;
  max-width: 16ch;
}

.hero-sub {
  margin: 0 0 1.5rem;
  color: var(--muted);
  max-width: 38ch;
  font-size: 1.05rem;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.hero-visual {
  position: relative;
  height: 360px;
  animation: fadeUp 0.9s 0.15s var(--ease) both;
}

.hero-card {
  position: absolute;
  width: 160px;
  padding: 1.1rem;
  border-radius: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  display: grid;
  gap: 0.2rem;
}

.hero-card strong {
  font-size: 0.95rem;
}

.hero-card small {
  color: var(--blue-600);
  font-weight: 600;
}

.hero-thumb {
  width: 100%;
  height: 78px;
  object-fit: cover;
  border-radius: 12px;
  margin-bottom: 0.45rem;
  display: block;
  background: var(--blue-100);
}

.float-a {
  top: 18%;
  left: 8%;
  animation: floatY 5s ease-in-out infinite;
}

.float-b {
  top: 8%;
  right: 10%;
  animation: floatY 6s 0.8s ease-in-out infinite;
}

.float-c {
  bottom: 12%;
  left: 28%;
  animation: floatY 5.5s 1.4s ease-in-out infinite;
}

@keyframes floatY {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-14px); }
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Catalog */
.catalog {
  padding: 1rem 0 4.5rem;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 1rem;
  margin-bottom: 1.25rem;
  animation: fadeUp 0.7s 0.1s var(--ease) both;
}

.section-head h2 {
  margin: 0 0 0.25rem;
  font-family: var(--display);
  font-size: 1.55rem;
  letter-spacing: -0.02em;
}

.section-head p {
  margin: 0;
  color: var(--muted);
}

.result-count {
  font-weight: 600;
  color: var(--blue-600);
  white-space: nowrap;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-bottom: 1.5rem;
  animation: fadeUp 0.7s 0.18s var(--ease) both;
}

.chip {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.7);
  color: var(--muted);
  border-radius: 999px;
  padding: 0.5rem 1rem;
  font: inherit;
  font-weight: 550;
  cursor: pointer;
  transition: all 0.25s var(--ease);
}

.chip:hover {
  border-color: var(--blue-300);
  color: var(--blue-600);
  transform: translateY(-1px);
}

.chip.active {
  background: linear-gradient(135deg, var(--blue-400), var(--blue-500));
  border-color: transparent;
  color: white;
  box-shadow: 0 8px 18px rgba(61, 143, 191, 0.25);
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.1rem;
}

.product-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem;
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(8px);
  cursor: pointer;
  display: grid;
  gap: 0.65rem;
  opacity: 0;
  transform: translateY(18px);
  animation: cardIn 0.55s var(--ease) forwards;
  transition: transform 0.3s var(--ease), box-shadow 0.3s, border-color 0.3s;
}

.product-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow);
  border-color: var(--blue-300);
}

@keyframes cardIn {
  to { opacity: 1; transform: translateY(0); }
}

.product-icon {
  width: 100%;
  aspect-ratio: 1.35;
  border-radius: 16px;
  background: linear-gradient(160deg, var(--blue-50), var(--blue-100));
  overflow: hidden;
  transition: transform 0.35s var(--ease);
}

.product-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.45s var(--ease);
}

.product-card:hover .product-icon {
  transform: none;
}

.product-card:hover .product-img {
  transform: scale(1.08);
}

.product-meta {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  align-items: center;
}

.badge {
  font-size: 0.72rem;
  font-weight: 650;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  background: var(--blue-100);
  color: var(--blue-600);
}

.badge.bekas { background: #e8f0f6; color: #4d6d82; }
.badge.refurbished { background: #dff0ea; color: #2f7a68; }

.product-card h3 {
  margin: 0;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}

.product-card .price {
  margin: 0;
  font-weight: 700;
  color: var(--blue-600);
  font-size: 1.08rem;
}

.product-card .seller {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.add-btn {
  margin-top: 0.2rem;
  border: none;
  border-radius: 12px;
  padding: 0.65rem;
  background: rgba(142, 196, 230, 0.22);
  color: var(--blue-600);
  font: inherit;
  font-weight: 650;
  cursor: pointer;
  transition: background 0.25s, transform 0.25s;
}

.add-btn:hover {
  background: var(--blue-200);
  transform: scale(1.02);
}

.empty-state {
  text-align: center;
  color: var(--muted);
  padding: 3rem 1rem;
  background: rgba(255, 255, 255, 0.5);
  border: 1px dashed var(--blue-200);
  border-radius: var(--radius);
}

.hidden {
  display: none !important;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.45);
  padding: 2rem 0;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: end;
}

.footer-inner p {
  margin: 0.35rem 0 0;
  color: var(--muted);
  max-width: 36ch;
}

.copy {
  font-size: 0.9rem;
}

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(40, 70, 95, 0.28);
  backdrop-filter: blur(6px);
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 1rem;
  animation: fadeIn 0.25s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal {
  width: min(520px, 100%);
  max-height: min(90vh, 760px);
  overflow: auto;
  background: var(--surface-solid);
  border-radius: 24px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  position: relative;
  animation: modalIn 0.35s var(--ease);
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(18px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 10px;
  background: var(--blue-50);
  color: var(--blue-600);
  font-size: 1.4rem;
  cursor: pointer;
  line-height: 1;
  transition: background 0.2s, transform 0.2s;
}

.modal-close:hover {
  background: var(--blue-100);
  transform: rotate(90deg);
}

.modal h2 {
  margin: 0 0 0.35rem;
  font-family: var(--display);
  letter-spacing: -0.02em;
}

.modal-sub {
  margin: 0 0 1.2rem;
  color: var(--muted);
}

.detail-modal {
  width: min(560px, 100%);
}

.detail-icon {
  width: 100%;
  aspect-ratio: 1.45;
  border-radius: 18px;
  background: linear-gradient(160deg, var(--blue-50), var(--blue-100));
  overflow: hidden;
  margin-bottom: 1rem;
}

.detail-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.detail-body h3 {
  margin: 0 0 0.4rem;
  font-size: 1.4rem;
  font-family: var(--display);
}

.detail-price {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--blue-600);
  margin: 0.4rem 0 0.8rem;
}

.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.9rem;
}

.detail-desc {
  color: var(--muted);
  margin: 0 0 1.2rem;
}

.detail-actions {
  display: flex;
  gap: 0.6rem;
}

#sellForm,
#settingsForm {
  display: grid;
  gap: 0.85rem;
}

.price-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.profit-preview {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0.9rem;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(223, 240, 234, 0.9), rgba(240, 247, 252, 0.95));
  border: 1px solid rgba(47, 122, 104, 0.2);
}

.profit-preview span {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 550;
}

.profit-preview strong {
  color: #2f7a68;
  font-size: 1.05rem;
}

.settings-hint {
  margin: -0.35rem 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.settings-actions {
  display: grid;
  gap: 0.55rem;
}

@media (max-width: 520px) {
  .price-fields {
    grid-template-columns: 1fr;
  }
}

#sellForm label,
#settingsForm label {
  display: grid;
  gap: 0.35rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink);
}

#sellForm input,
#sellForm select,
#sellForm textarea,
#settingsForm input {
  font: inherit;
  font-weight: 400;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.7rem 0.85rem;
  background: var(--blue-50);
  color: var(--ink);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

#sellForm input:focus,
#sellForm select:focus,
#sellForm textarea:focus,
#settingsForm input:focus {
  border-color: var(--blue-300);
  box-shadow: 0 0 0 3px rgba(142, 196, 230, 0.28);
}

/* Cart drawer */
#cartOverlay {
  place-items: stretch end;
  padding: 0;
}

.cart-drawer {
  width: min(380px, 100%);
  height: 100%;
  background: white;
  border-left: 1px solid var(--line);
  box-shadow: var(--shadow);
  display: grid;
  grid-template-rows: auto 1fr auto;
  animation: slideInRight 0.35s var(--ease);
}

@keyframes slideInRight {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

.cart-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.1rem 1.2rem;
  border-bottom: 1px solid var(--line);
}

.cart-head h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 1.2rem;
}

.cart-head .modal-close {
  position: static;
}

.cart-items {
  overflow: auto;
  padding: 1rem;
  display: grid;
  gap: 0.75rem;
  align-content: start;
}

.cart-empty {
  text-align: center;
  color: var(--muted);
  padding: 2rem 1rem;
}

.cart-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.75rem;
  border-radius: 14px;
  background: var(--blue-50);
  border: 1px solid var(--line);
  animation: fadeUp 0.3s var(--ease);
}

.cart-thumb {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  overflow: hidden;
  background: white;
  flex-shrink: 0;
}

.cart-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.cart-item h4 {
  margin: 0;
  font-size: 0.92rem;
}

.cart-item p {
  margin: 0.15rem 0 0;
  color: var(--blue-600);
  font-weight: 650;
  font-size: 0.85rem;
}

.qty-controls {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.qty-controls button {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: white;
  cursor: pointer;
  color: var(--blue-600);
  font-weight: 700;
  transition: background 0.2s;
}

.qty-controls button:hover {
  background: var(--blue-100);
}

.qty-controls span {
  min-width: 1.2rem;
  text-align: center;
  font-weight: 650;
}

.cart-foot {
  padding: 1rem 1.2rem 1.3rem;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 0.8rem;
}

.cart-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cart-total strong {
  font-size: 1.2rem;
  color: var(--blue-600);
}

/* Payment */
.pay-modal {
  width: min(520px, 100%);
}

.pay-step-label {
  margin: 0 0 0.35rem;
  font-size: 0.8rem;
  font-weight: 650;
  color: var(--blue-500);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.pay-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.9rem 1rem;
  margin-bottom: 1rem;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--blue-50), var(--blue-100));
  border: 1px solid var(--line);
}

.pay-summary span {
  color: var(--muted);
  font-weight: 550;
}

.pay-summary strong {
  font-size: 1.15rem;
  color: var(--blue-600);
}

.pay-methods {
  display: grid;
  gap: 0.55rem;
  margin-bottom: 1.15rem;
}

.pay-method {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.8rem;
  align-items: center;
  width: 100%;
  text-align: left;
  padding: 0.8rem 0.9rem;
  border-radius: 16px;
  border: 1.5px solid var(--line);
  background: rgba(255, 255, 255, 0.9);
  cursor: pointer;
  font: inherit;
  color: var(--ink);
  transition: border-color 0.25s, background 0.25s, transform 0.25s var(--ease), box-shadow 0.25s;
}

.pay-method:hover {
  border-color: var(--blue-300);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.pay-method.active {
  border-color: var(--blue-400);
  background: linear-gradient(135deg, rgba(240, 247, 252, 0.95), rgba(217, 236, 248, 0.7));
  box-shadow: 0 0 0 3px rgba(142, 196, 230, 0.25);
}

.pay-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: white;
}

.pay-qris { background: linear-gradient(145deg, #4a9fd4, #2f759e); }
.pay-gopay { background: linear-gradient(145deg, #00aed6, #008eb8); }
.pay-ovo { background: linear-gradient(145deg, #6b5ce7, #4f46c8); }
.pay-dana { background: linear-gradient(145deg, #118eea, #0b6fbc); }
.pay-shopee,
.pay-shopeepay { background: linear-gradient(145deg, #ee6b45, #d94f2b); }
.pay-va { background: linear-gradient(145deg, #5aa8d4, #3d8fbf); }

.pay-info {
  display: grid;
  gap: 0.1rem;
}

.pay-info strong {
  font-size: 0.95rem;
}

.pay-info small {
  color: var(--muted);
  font-size: 0.8rem;
}

.pay-check {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--blue-200);
  position: relative;
  transition: border-color 0.2s, background 0.2s;
}

.pay-method.active .pay-check {
  border-color: var(--blue-500);
  background: var(--blue-500);
}

.pay-method.active .pay-check::after {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: white;
  transform: scale(0.7);
}

.pay-panel {
  margin-bottom: 1.15rem;
  animation: fadeUp 0.35s var(--ease);
}

.pay-qris-box {
  display: grid;
  justify-items: center;
  gap: 0.75rem;
  padding: 1.2rem;
  border-radius: 18px;
  background: var(--blue-50);
  border: 1px solid var(--line);
}

.qris-frame {
  width: 180px;
  height: 180px;
  padding: 12px;
  border-radius: 16px;
  background: white;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  animation: softPulse 2.4s ease-in-out infinite;
}

@keyframes softPulse {
  0%, 100% { box-shadow: 0 8px 20px rgba(80, 140, 180, 0.1); }
  50% { box-shadow: 0 12px 28px rgba(61, 143, 191, 0.22); }
}

.qris-grid {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  grid-template-rows: repeat(7, 1fr);
  gap: 3px;
}

.qris-grid span {
  background: var(--ink);
  border-radius: 2px;
  opacity: 0.85;
}

.qris-grid span.off {
  background: transparent;
}

.pay-ewallet-box,
.pay-va-box {
  padding: 1.1rem;
  border-radius: 18px;
  background: var(--blue-50);
  border: 1px solid var(--line);
  display: grid;
  gap: 0.75rem;
}

.pay-ewallet-box .app-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 700;
}

.pay-code {
  font-family: var(--display);
  font-size: 1.35rem;
  letter-spacing: 0.08em;
  text-align: center;
  padding: 0.85rem;
  border-radius: 12px;
  background: white;
  border: 1px dashed var(--blue-300);
  color: var(--blue-600);
  user-select: all;
}

.pay-hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  text-align: center;
}

.pay-va-list {
  display: grid;
  gap: 0.45rem;
}

.pay-va-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 0.75rem;
  border-radius: 12px;
  background: white;
  border: 1px solid var(--line);
  font-size: 0.9rem;
}

.pay-va-row strong {
  font-family: var(--display);
  letter-spacing: 0.04em;
  color: var(--blue-600);
  font-size: 0.85rem;
}

.pay-actions {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 0.6rem;
}

.pay-success {
  text-align: left;
  padding: 0.25rem 0 0.25rem;
  animation: fadeUp 0.4s var(--ease);
}

.success-head {
  text-align: center;
  margin-bottom: 1rem;
}

.success-head h2 {
  margin-bottom: 0.25rem;
}

.success-ring {
  width: 64px;
  height: 64px;
  margin: 0.2rem auto 0.85rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 1.75rem;
  font-weight: 700;
  color: white;
  background: linear-gradient(145deg, var(--blue-400), var(--blue-600));
  box-shadow: 0 12px 28px rgba(61, 143, 191, 0.35);
  animation: pop 0.45s var(--ease);
}

.invoice {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(180deg, #fff, var(--blue-50));
  padding: 1.1rem;
  margin-bottom: 1rem;
}

.invoice-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: start;
  padding-bottom: 0.9rem;
  border-bottom: 1px dashed var(--blue-200);
  margin-bottom: 0.9rem;
}

.invoice-brand {
  margin: 0;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--blue-600);
  letter-spacing: -0.02em;
}

.invoice-tag {
  margin: 0.15rem 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.invoice-meta {
  text-align: right;
  display: grid;
  gap: 0.35rem;
}

.invoice-meta p {
  margin: 0;
  display: grid;
  gap: 0.05rem;
}

.invoice-meta span {
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.invoice-meta strong {
  font-size: 0.88rem;
}

.invoice-pay {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0.85rem;
  margin-bottom: 0.9rem;
  border-radius: 12px;
  background: rgba(142, 196, 230, 0.18);
  border: 1px solid var(--line);
}

.invoice-pay span {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 550;
}

.invoice-pay strong {
  color: var(--blue-600);
  font-size: 0.95rem;
}

.invoice-table-wrap {
  overflow-x: auto;
  margin-bottom: 0.85rem;
}

.invoice-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.invoice-table th {
  text-align: left;
  color: var(--muted);
  font-weight: 650;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0.4rem 0.35rem;
  border-bottom: 1px solid var(--line);
}

.invoice-table td {
  padding: 0.55rem 0.35rem;
  border-bottom: 1px solid rgba(140, 185, 220, 0.22);
  vertical-align: top;
}

.invoice-table th:nth-child(2),
.invoice-table td:nth-child(2),
.invoice-table th:nth-child(3),
.invoice-table td:nth-child(3),
.invoice-table th:nth-child(4),
.invoice-table td:nth-child(4) {
  text-align: right;
  white-space: nowrap;
}

.invoice-item-cell {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.invoice-thumb {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--blue-100);
}

.invoice-item-name {
  font-weight: 650;
  display: block;
}

.invoice-item-seller {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 400;
  margin-top: 0.1rem;
}

.invoice-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.85rem 0.9rem;
  border-radius: 12px;
  background: white;
  border: 1px solid var(--line);
  margin-bottom: 0.75rem;
}

.invoice-total span {
  font-weight: 600;
  color: var(--muted);
}

.invoice-total strong {
  font-size: 1.15rem;
  color: var(--blue-600);
}

.invoice-note {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
  text-align: center;
}

.invoice-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}

@media (max-width: 520px) {
  .pay-actions,
  .invoice-actions {
    grid-template-columns: 1fr;
  }

  .invoice-head {
    flex-direction: column;
  }

  .invoice-meta {
    text-align: left;
  }
}

@media print {
  @page {
    size: A4 portrait;
    margin: 12mm;
  }

  html,
  body {
    width: 100% !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    background: white !important;
    overflow: hidden !important;
  }

  body * {
    visibility: hidden !important;
  }

  #invoiceSheet,
  #invoiceSheet * {
    visibility: visible !important;
  }

  .no-print,
  .bg-orb,
  .site-header,
  .hero,
  .catalog,
  .site-footer,
  .toast,
  .modal-close,
  .success-head,
  .invoice-actions,
  #payStepSelect,
  #payStepConfirm {
    display: none !important;
    visibility: hidden !important;
  }

  .modal-overlay,
  .pay-modal,
  .pay-success {
    position: static !important;
    inset: auto !important;
    display: block !important;
    width: 100% !important;
    max-height: none !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    animation: none !important;
  }

  #invoiceSheet {
    position: absolute !important;
    left: 0 !important;
    top: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 8mm !important;
    border: 1px solid #cfe3f2 !important;
    border-radius: 0 !important;
    background: white !important;
    box-shadow: none !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
    page-break-after: avoid !important;
  }

  #invoiceSheet .invoice-head {
    padding-bottom: 6px !important;
    margin-bottom: 8px !important;
  }

  #invoiceSheet .invoice-brand {
    font-size: 16pt !important;
  }

  #invoiceSheet .invoice-tag,
  #invoiceSheet .invoice-meta span,
  #invoiceSheet .invoice-note,
  #invoiceSheet .invoice-item-seller {
    font-size: 8pt !important;
  }

  #invoiceSheet .invoice-meta strong,
  #invoiceSheet .invoice-pay,
  #invoiceSheet .invoice-table {
    font-size: 9.5pt !important;
  }

  #invoiceSheet .invoice-pay {
    padding: 6px 8px !important;
    margin-bottom: 8px !important;
  }

  #invoiceSheet .invoice-table th,
  #invoiceSheet .invoice-table td {
    padding: 4px 3px !important;
  }

  #invoiceSheet .invoice-thumb {
    width: 28px !important;
    height: 28px !important;
    border-radius: 6px !important;
  }

  #invoiceSheet .invoice-total {
    padding: 6px 8px !important;
    margin-bottom: 6px !important;
  }

  #invoiceSheet .invoice-total strong {
    font-size: 12pt !important;
  }

  #invoiceSheet .invoice-note {
    margin: 0 !important;
  }
}

/* Toast */
.toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--ink);
  color: white;
  padding: 0.85rem 1.25rem;
  border-radius: 999px;
  z-index: 80;
  font-weight: 550;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s, transform 0.3s var(--ease);
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Responsive */
@media (max-width: 860px) {
  .header-inner {
    grid-template-columns: auto auto;
    grid-template-areas:
      "logo actions"
      "search search";
  }

  .logo { grid-area: logo; }
  .header-actions { grid-area: actions; justify-self: end; }
  .search-wrap {
    grid-area: search;
    max-width: none;
    justify-self: stretch;
  }

  .hero-grid {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .hero-visual {
    height: 280px;
    order: -1;
  }

  .hero-copy h1 {
    max-width: none;
  }

  .btn-ghost {
    display: none;
  }

  .user-pill span:last-child {
    max-width: 72px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

@media (max-width: 520px) {
  .hero-card {
    width: 132px;
    padding: 0.85rem;
  }

  .float-c {
    left: 18%;
  }

  .detail-actions {
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
