:root {
  --red: #D92B2B;
  --red-light: #E53935;
  --red-dark: #B71C1C;
  --green: #16a34a;
  --amber: #d97706;
  --font: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Navbar (tetap gelap) */
  --nav-bg: #0D0D0D;
  --nav-surface: #1C1C1C;
  --nav-border: rgba(255,255,255,0.08);
  --nav-text: #F3F4F6;
  --nav-muted: #9CA3AF;

  /* Konten (putih & bersih) */
  --bg: #F3F4F6;
  --surface: #FFFFFF;
  --surface2: #F9FAFB;
  --border: #E5E7EB;
  --text: #111827;
  --muted: #6B7280;
}

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── NAVBAR ── */
.r-nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(13,13,13,0.95);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--nav-border);
  padding: 0 32px;
  display: flex; align-items: center; gap: 20px;
  height: 64px;
}

.logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
}
.logo-img {
  height: 70px;
  width: auto;
  display: block;
  object-fit: contain;
}

.search-bar {
  flex: 1;
  position: relative;
  max-width: 520px;
}
.search-bar input {
  width: 100%;
  background: var(--nav-surface);
  border: 1px solid var(--nav-border);
  border-radius: 10px;
  padding: 10px 16px 10px 42px;
  color: var(--nav-text);
  font-family: var(--font);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s, background 0.2s;
}
.search-bar input::placeholder { color: var(--nav-muted); }
.search-bar input:focus {
  border-color: var(--red);
  background: #252525;
}
.search-icon {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: var(--nav-muted);
  pointer-events: none;
}

.nav-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.btn-ghost {
  background: none;
  border: 1px solid var(--nav-border);
  color: var(--nav-text);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
  text-decoration: none;
  display: inline-flex; align-items: center;
}
.btn-ghost:hover { border-color: var(--red); color: #fff; }

.nav-profile { position: relative; }

.nav-profile-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 8px 6px 12px;
  border: none;
  border-radius: 12px;
  background: transparent;
  font-family: var(--font);
  cursor: pointer;
  transition: background 0.2s;
  max-width: 280px;
}
.nav-profile-toggle:hover,
.nav-profile.open .nav-profile-toggle {
  background: rgba(255, 255, 255, 0.06);
}

.nav-profile-text {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  text-align: right;
  min-width: 0;
  gap: 2px;
}
.nav-profile-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--nav-text);
  line-height: 1.25;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nav-profile-email {
  font-size: 12px;
  font-weight: 400;
  color: var(--nav-muted);
  line-height: 1.25;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nav-profile-avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--nav-border);
  background: #fff;
  padding: 4px;
  object-fit: contain;
  flex-shrink: 0;
}
.nav-profile-avatar.is-photo {
  padding: 0;
  object-fit: cover;
}

.nav-profile-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 168px;
  background: #1A1A1A;
  border: 1px solid var(--nav-border);
  border-radius: 10px;
  padding: 6px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.45);
  z-index: 200;
}
.nav-profile-item {
  display: block;
  width: 100%;
  padding: 10px 12px;
  border: none;
  border-radius: 7px;
  background: none;
  color: var(--nav-text);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.nav-profile-item:hover {
  background: var(--nav-surface);
  color: #fff;
}
.nav-profile-item--danger { color: #FCA5A5; }
.nav-profile-item--danger:hover {
  background: rgba(217, 43, 43, 0.15);
  color: #FECACA;
}
.nav-profile-logout {
  margin: 4px 0 0;
  padding-top: 4px;
  border-top: 1px solid var(--nav-border);
}

.cart-btn {
  position: relative;
  background: var(--nav-surface);
  border: 1px solid var(--nav-border);
  color: var(--nav-text);
  width: 40px; height: 40px;
  border-radius: 10px;
  display: grid; place-items: center;
  cursor: pointer;
  transition: border-color 0.2s;
  text-decoration: none;
}
.cart-btn:hover { border-color: var(--red); }
.cart-count {
  position: absolute; top: -5px; right: -5px;
  background: var(--red);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  min-width: 18px; height: 18px;
  padding: 0 4px;
  border-radius: 50%;
  display: grid; place-items: center;
}

/* ── LIKES (suka) ── */
.nav-likes { position: relative; }
.like-nav-btn {
  position: relative;
  background: var(--nav-surface);
  border: 1px solid var(--nav-border);
  color: var(--nav-text);
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
  font-family: var(--font);
}
.like-nav-btn:hover,
.nav-likes.open .like-nav-btn {
  border-color: #F87171;
  color: #FCA5A5;
  background: rgba(217, 43, 43, 0.12);
}
.like-count {
  position: absolute;
  top: -5px;
  right: -5px;
  background: var(--red);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 50%;
  display: grid;
  place-items: center;
}
.likes-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: min(400px, calc(100vw - 32px));
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(0,0,0,0.18);
  z-index: 220;
  overflow: hidden;
}
.likes-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface2);
}
.likes-panel-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}
.likes-panel-all {
  font-size: 12px;
  font-weight: 600;
  color: var(--red);
  text-decoration: none;
}
.likes-panel-all:hover { color: var(--red-dark); }
.likes-list {
  max-height: 360px;
  overflow-y: auto;
}
.likes-empty {
  padding: 36px 20px;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
}
.likes-item {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid #F3F4F6;
}
.likes-item:last-child { border-bottom: none; }
.likes-item-main {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 10px;
  align-items: center;
  text-decoration: none;
  color: inherit;
  min-width: 0;
}
.likes-item-main:hover .likes-item-name { color: var(--red); }
.likes-item-thumb {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: var(--surface2);
  border: 1px solid var(--border);
  overflow: hidden;
  display: grid;
  place-items: center;
}
.likes-item-thumb img { width: 100%; height: 100%; object-fit: cover; }
.likes-item-thumb svg { opacity: 0.25; stroke: #9CA3AF; }
.likes-item-body { min-width: 0; }
.likes-item-name {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.likes-item-price {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--red);
  margin-top: 2px;
}
.likes-item-cart { margin: 0; }
.likes-item-add {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 8px;
  background: var(--red);
  color: #fff;
  font-size: 18px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  font-family: var(--font);
  transition: background 0.15s;
}
.likes-item-add:hover { background: var(--red-light); }
.likes-item-oos {
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
  padding: 0 4px;
}
.likes-item-unlike {
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface2);
  color: #9CA3AF;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.likes-item-unlike:hover,
.likes-item-unlike.liked {
  border-color: #FECACA;
  background: #FEF2F2;
  color: var(--red);
}

.card-img-wrap {
  position: relative;
  margin-bottom: 12px;
}
.like-btn {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 3;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.96);
  color: #9CA3AF;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform 0.15s, color 0.15s, background 0.15s, box-shadow 0.15s;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(6px);
}
.like-btn:hover { transform: scale(1.06); color: var(--red); box-shadow: 0 4px 12px rgba(15, 23, 42, 0.1); }
.like-btn.liked {
  color: var(--red);
  background: #FEF2F2;
  box-shadow: 0 2px 10px rgba(226, 75, 74, 0.15);
}
.like-btn svg { pointer-events: none; }
.like-btn--detail {
  position: static;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
}
.product-tags-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.product-tags-row .product-tags { margin-bottom: 0; }

.likes-page {
  width: 100%;
  min-height: calc(100vh - 105px);
  background: var(--surface);
  padding: 28px 32px;
}
.likes-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.nav-notif { position: relative; }
.notif-btn {
  position: relative;
  background: var(--nav-surface);
  border: 1px solid var(--nav-border);
  color: var(--nav-text);
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  font-family: var(--font);
}
.notif-btn:hover { border-color: var(--red); background: #252525; }
.notif-count {
  position: absolute;
  top: -5px;
  right: -5px;
  background: var(--red);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 50%;
  display: grid;
  place-items: center;
}
.notif-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: min(380px, calc(100vw - 32px));
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(0,0,0,0.18);
  z-index: 220;
  overflow: hidden;
}
.notif-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface2);
}
.notif-panel-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}
.notif-mark-all {
  border: none;
  background: none;
  color: var(--red);
  font-family: var(--font);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 0;
}
.notif-mark-all:hover { color: var(--red-dark); }
.notif-list {
  max-height: 320px;
  overflow-y: auto;
}
.notif-empty {
  padding: 36px 20px;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
}
.notif-item {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  gap: 10px;
  align-items: start;
  padding: 12px 16px;
  border-bottom: 1px solid #F3F4F6;
  text-decoration: none;
  color: inherit;
  transition: background 0.15s;
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: var(--surface2); }
.notif-item.unread { background: #FEF2F2; }
.notif-item-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}
.notif-item-icon.ok { background: #DCFCE7; color: #15803D; }
.notif-item-icon.danger { background: #FEE2E2; color: #B91C1C; }
.notif-item-icon.info { background: #DBEAFE; color: #1D4ED8; }
.notif-item-body { min-width: 0; }
.notif-item-title {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}
.notif-item-msg {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.notif-item-time {
  display: block;
  font-size: 11px;
  color: #9CA3AF;
  margin-top: 4px;
}
.notif-item-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--red);
  margin-top: 6px;
  flex-shrink: 0;
}

/* ── SUBNAV ── */
.subnav {
  position: relative;
  z-index: 50;
  background: #141414;
  border-bottom: 1px solid var(--nav-border);
  padding: 0 32px;
  display: flex; gap: 0;
}
.subnav a {
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  padding: 12px 16px;
  color: var(--nav-muted);
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}
.subnav a.active { color: #fff; border-color: var(--red); }
.subnav a:hover { color: var(--nav-text); }

/* ── ALERTS ── */
.alert-banner {
  margin: 16px 32px 0;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 13px;
  border: 1px solid;
}
.alert-banner a { color: inherit; font-weight: 600; }
.alert-danger {
  background: #FEF2F2;
  border-color: #FECACA;
  color: #B91C1C;
}
.alert-success {
  background: #F0FDF4;
  border-color: #BBF7D0;
  color: #15803D;
}
.alert-warning {
  background: #FFFBEB;
  border-color: #FDE68A;
  color: #B45309;
}

/* ── LAYOUT ── */
.page {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 0;
  min-height: calc(100vh - 105px);
  background: var(--surface);
}

aside,
.catalog-sidebar {
  background: var(--surface2);
  border-right: 1px solid var(--border);
  position: sticky;
  top: 64px;
  height: calc(100vh - 105px);
  overflow-y: auto;
}

.catalog-sidebar {
  padding: 24px 20px;
}

.filter-toggle {
  display: none;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.filter-toggle:hover,
.catalog-sidebar.is-open .filter-toggle {
  border-color: #FECACA;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.filter-toggle-left {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.filter-toggle-left svg { stroke: var(--red); flex-shrink: 0; }
.filter-toggle-badge {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 20px;
  background: var(--red);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: inline-grid;
  place-items: center;
}
.filter-toggle-chevron {
  flex-shrink: 0;
  stroke: var(--muted);
  transition: transform 0.25s;
}
.catalog-sidebar.is-open .filter-toggle-chevron { transform: rotate(180deg); }

.filter-panel {
  display: block;
}

.filter-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 20px;
}

.filter-group { margin-bottom: 28px; }
.filter-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 8px;
}

.filter-select {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--font);
  font-size: 13px;
  padding: 10px 14px;
  border-radius: 10px;
  outline: none;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  transition: border-color 0.2s;
}
.filter-select:focus { border-color: var(--red); }

.filter-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  font-size: 12px;
  font-weight: 500;
  padding: 5px 12px;
  border-radius: 20px;
  border: 1px solid var(--border);
  color: var(--muted);
  background: var(--surface);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  text-decoration: none;
  display: inline-block;
}
.chip:hover { border-color: var(--red); color: var(--red); }
.chip.active { background: var(--red); border-color: var(--red); color: #fff; }

.filter-divider {
  height: 1px;
  background: var(--border);
  margin: 20px 0;
}

.clear-btn {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted);
  font-family: var(--font);
  font-size: 12px;
  font-weight: 500;
  padding: 9px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  display: block;
  text-align: center;
}
.clear-btn:hover { border-color: var(--red); color: var(--red); }

.catalog-sidebar-search {
  margin-bottom: 4px;
}

.catalog-search-field {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.catalog-search-field:focus-within {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(226, 75, 74, 0.1);
}

.catalog-search-field svg {
  flex-shrink: 0;
  stroke: var(--muted);
}

.catalog-search-input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  font-family: var(--font);
  font-size: 13px;
  color: var(--text);
  padding: 10px 0;
  outline: none;
}

.catalog-search-input::placeholder {
  color: #9ca3af;
}

.catalog-search-btn {
  width: 100%;
  margin-top: 8px;
  padding: 9px 12px;
  border: none;
  border-radius: 10px;
  background: var(--red);
  color: #fff;
  font-family: var(--font);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}

.catalog-search-btn:hover {
  background: #d43f3e;
}

.catalog-search-active {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin: -8px 0 20px;
  padding: 10px 14px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  font-size: 13px;
  color: #64748b;
}

.catalog-search-active strong {
  color: #111827;
  font-weight: 600;
}

.catalog-search-clear {
  margin-left: auto;
  font-size: 12px;
  font-weight: 600;
  color: var(--red);
  text-decoration: none;
}

.catalog-search-clear:hover {
  text-decoration: underline;
}

/* ── MAIN ── */
main.catalog-main { padding: 28px 32px; background: var(--surface); }
.reseller-main { padding: 28px 32px; max-width: 1100px; background: var(--surface); }

.catalog-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap; gap: 12px;
}

.catalog-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
  margin-bottom: 6px;
  letter-spacing: -0.3px;
}
.catalog-sub {
  font-size: 13px;
  color: var(--muted);
  display: flex; align-items: center; gap: 6px;
}
.catalog-sub span {
  background: #FEF2F2;
  color: var(--red);
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid #FECACA;
}

.catalog-meta {
  display: flex; align-items: center; gap: 12px;
  flex-wrap: wrap;
}

.catalog-filters-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px 20px;
  margin-bottom: 24px;
  box-shadow: 0 4px 18px rgba(15, 23, 42, .04);
}

.catalog-filters-toggle {
  display: none;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.catalog-filters-toggle-left {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.catalog-filters-toggle-left svg { stroke: var(--red); flex-shrink: 0; }

.catalog-filters-panel {
  display: block;
}

.catalog-filters-form {
  margin-bottom: 16px;
}

.catalog-filters-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 20px;
  align-items: flex-end;
}

.catalog-filters-row--selects {
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid #f1f5f9;
}

.catalog-filter-field {
  flex: 1;
  min-width: 160px;
}

.catalog-filter-field--chips {
  flex: 1 1 280px;
}

.catalog-filters-active {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding-top: 14px;
  border-top: 1px solid #f1f5f9;
}

.catalog-active-pill {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border-radius: 999px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
  font-size: 11px;
  font-weight: 600;
}

.catalog-filters-reset {
  margin-left: auto;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  transition: color .15s ease;
}

.catalog-filters-reset:hover {
  color: var(--red);
}

.catalog-filters-card.is-open .filter-toggle-chevron { transform: rotate(180deg); }

@media (min-width: 901px) {
  .catalog-filters-panel {
    max-height: none !important;
    opacity: 1 !important;
    overflow: visible !important;
    padding-top: 0 !important;
  }
}

.product-count {
  font-size: 13px;
  color: var(--muted);
}
.product-count strong { color: var(--text); font-weight: 600; }

.sort-select {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--font);
  font-size: 12px;
  padding: 8px 32px 8px 12px;
  border-radius: 8px;
  outline: none;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}

/* ── GRID ── */
.product-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
}

.product-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
  animation: fadeUp 0.35s ease both;
  display: flex;
  flex-direction: column;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
  padding: 12px;
}
.product-card:hover {
  border-color: #FECACA;
  transform: translateY(-3px);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
}

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

.card-img {
  height: 168px;
  background: #fff;
  display: block;
  position: relative;
  border: 1px solid rgba(15, 23, 42, 0.06);
  border-radius: 14px;
  text-decoration: none;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05);
}
.card-img img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}
.card-img svg {
  position: absolute;
  inset: 0;
  margin: auto;
  opacity: 0.2;
  stroke: #9CA3AF;
}
.brand-tag {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1.5px;
  color: var(--muted);
  text-transform: uppercase;
}

.stock-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  font-size: 10px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
}
.stock-ok { background: #DCFCE7; color: #15803D; border: 1px solid #BBF7D0; }
.stock-low { background: #FEF3C7; color: #B45309; border: 1px solid #FDE68A; }
.stock-crit { background: #FEE2E2; color: #B91C1C; border: 1px solid #FECACA; }

.card-body { padding: 0 2px 4px; flex: 1; display: flex; flex-direction: column; }

.card-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
  margin-bottom: 4px;
  text-decoration: none;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-name:hover { color: var(--red); }

.js-katalog-open { cursor: pointer; }

.card-sku {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 12px;
}

.card-price {
  font-size: 17px;
  font-weight: 700;
  color: var(--red);
  margin-bottom: 12px;
  letter-spacing: -0.3px;
}

.add-btn {
  width: 100%;
  background: var(--red);
  color: #fff;
  border: none;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  padding: 10px;
  border-radius: 8px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  transition: background 0.2s, transform 0.15s;
  margin-top: auto;
  text-decoration: none;
}
.add-btn:hover { background: var(--red-light); transform: scale(1.01); }
.add-btn:active { transform: scale(0.99); }
.add-btn:disabled, .add-btn.disabled {
  background: var(--border);
  color: var(--muted);
  cursor: not-allowed;
  transform: none;
}

.blocked-note {
  font-size: 11px;
  color: var(--red);
  text-align: center;
  margin-top: auto;
  padding-top: 8px;
}

.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 48px 24px;
  color: var(--muted);
  font-size: 14px;
  border: 1px dashed var(--border);
  border-radius: 12px;
  background: var(--surface2);
}

/* ── PAGINATION ── */
.pagination {
  display: flex; align-items: center; justify-content: center;
  gap: 6px;
  margin-top: 40px; padding-bottom: 32px;
  flex-wrap: wrap;
}
.page-btn {
  min-width: 36px; height: 36px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: grid; place-items: center;
  transition: all 0.2s;
  text-decoration: none;
}
.page-btn:hover:not(.disabled):not(.active) { border-color: var(--red); color: var(--red); }
.page-btn.active { background: var(--red); border-color: var(--red); color: #fff; }
.page-btn.disabled { opacity: 0.4; cursor: not-allowed; }

/* ── PANELS ── */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px 28px;
  margin-bottom: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.panel-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
  letter-spacing: -0.3px;
}
.panel-sub {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 20px;
}
.section-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 14px;
}

.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th {
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--muted);
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--surface2);
}
.data-table td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  color: var(--text);
}
.data-table tr:last-child td { border-bottom: none; }
.data-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.data-table .center { text-align: center; }
.data-table .cell-title { font-weight: 600; color: var(--text); }
.data-table .cell-muted { font-size: 12px; color: var(--muted); margin-top: 2px; }
.data-table .cell-price { font-weight: 700; color: var(--red); }

.status-pill {
  display: inline-flex;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--border);
}
.status-pill.ok { background: #DCFCE7; color: #15803D; border-color: #BBF7D0; }
.status-pill.warn { background: #FEF3C7; color: #B45309; border-color: #FDE68A; }
.status-pill.danger { background: #FEE2E2; color: #B91C1C; border-color: #FECACA; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin: 20px 0;
}
.stat-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
}
.stat-card .label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  margin-bottom: 6px;
  font-weight: 500;
}
.stat-card .value {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.3px;
}
.stat-card .value.price { color: var(--red); }
.stat-card .value.due { color: #B91C1C; }

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 6px;
}
.form-input, .form-textarea {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  padding: 10px 14px;
  border-radius: 10px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.form-input:focus, .form-textarea:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(217,43,43,0.1);
}
.form-input.qty { width: 80px; text-align: center; }
.form-textarea { resize: vertical; min-height: 80px; }
.form-error { font-size: 12px; color: #B91C1C; margin-top: 4px; }

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.btn-primary {
  background: var(--red);
  color: #fff;
  border: none;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex; align-items: center; gap: 6px;
  transition: background 0.2s, transform 0.15s;
}
.btn-primary:hover { background: var(--red-light); transform: translateY(-1px); }

.btn-secondary {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex; align-items: center;
  transition: border-color 0.2s, color 0.2s;
}
.btn-secondary:hover { border-color: var(--red); color: var(--red); }

.btn-success {
  background: #F0FDF4;
  border: 1px solid #BBF7D0;
  color: #15803D;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
}
.btn-success:hover { background: #DCFCE7; }

.total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0;
  border-top: 1px solid var(--border);
  margin-top: 8px;
}
.total-row .label { font-size: 14px; color: var(--muted); }
.total-row .amount {
  font-size: 24px;
  font-weight: 700;
  color: var(--red);
  letter-spacing: -0.3px;
}

.checkout-list { list-style: none; }
.checkout-list li {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.checkout-list li:last-child { border-bottom: none; }
.checkout-list .item-name { font-weight: 600; color: var(--text); }
.checkout-list .item-meta { font-size: 12px; color: var(--muted); margin-top: 2px; }

.back-link {
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  transition: color 0.2s;
}
.back-link:hover { color: var(--red); }

.link-action {
  font-size: 13px;
  font-weight: 600;
  color: var(--red);
  text-decoration: none;
}
.link-action:hover { color: var(--red-dark); }

/* ── PRODUCT DETAIL (katalog/show) ── */
.pd-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 20px;
}
.pd-breadcrumb a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s;
}
.pd-breadcrumb a:hover { color: var(--red); }
.pd-breadcrumb svg { flex-shrink: 0; opacity: 0.35; stroke: var(--muted); }
.pd-breadcrumb span {
  color: var(--text);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.product-detail-center {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
}

.product-detail-card {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.product-detail-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  align-items: start;
}

.product-gallery {
  min-width: 0;
  width: 100%;
  overflow: hidden;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  border-right: 1px solid var(--border);
}

.product-gallery-img {
  position: relative;
  width: 100%;
  max-width: 100%;
  aspect-ratio: 1;
  background: linear-gradient(160deg, #FAFAFA 0%, #F3F4F6 55%, #ECEFF3 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.product-gallery-img .stock-badge {
  top: 16px;
  right: 16px;
  font-size: 11px;
  padding: 5px 10px;
  border-radius: 20px;
  z-index: 2;
}
.product-gallery-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.product-detail-card:hover .product-gallery-img img { transform: scale(1.02); }

.product-gallery-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  height: 100%;
  padding: 40px;
  color: var(--muted);
}
.product-gallery-placeholder-icon {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: rgba(255,255,255,0.7);
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
}
.product-gallery-placeholder-icon svg { opacity: 0.25; stroke: #9CA3AF; }
.product-gallery-placeholder-brand {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--muted);
}

.product-info {
  min-width: 0;
  padding: 15px 36px 0px 32px;
  display: flex;
  flex-direction: column;
}

.product-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}
.product-tag {
  font-size: 10px;
  font-weight: 600;
  padding: 5px 11px;
  border-radius: 20px;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}
.product-tag.brand {
  background: #FEF2F2;
  border-color: #FECACA;
  color: var(--red);
}

.product-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
  letter-spacing: -0.4px;
  margin-bottom: 6px;
}
.product-sku {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 0;
  font-family: ui-monospace, 'SF Mono', monospace;
  letter-spacing: 0.2px;
}

.product-price-hero {
  margin: 22px 0;
  padding: 18px 20px;
  background: linear-gradient(135deg, #FEF2F2 0%, #FFF7F7 100%);
  border: 1px solid #FECACA;
  border-radius: 12px;
}
.product-price-label {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 4px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.product-price {
  font-size: 30px;
  font-weight: 700;
  color: var(--red);
  letter-spacing: -0.5px;
  line-height: 1.1;
}

.product-add-form { margin-bottom: 4px; }
.product-add-form .form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.product-add-controls {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.qty-stepper--detail {
  align-self: flex-start;
  border-radius: 10px;
}
.qty-stepper--detail input {
  width: 64px;
  height: 44px;
  font-size: 16px;
}
.qty-stepper-btn {
  width: 44px;
  height: 44px;
  border: none;
  background: var(--surface2);
  color: var(--text);
  font-size: 20px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
  font-family: var(--font);
}
.qty-stepper-btn:hover { background: #E5E7EB; color: var(--red); }
.product-add-btn {
  width: 100%;
  padding: 14px 20px;
  font-size: 14px;
  border-radius: 10px;
  box-shadow: 0 4px 14px rgba(217, 43, 43, 0.25);
}
.product-add-btn:hover { box-shadow: 0 6px 20px rgba(217, 43, 43, 0.35); }

.product-blocked-box {
  padding: 14px 16px;
  background: #FEF2F2;
  border: 1px solid #FECACA;
  border-radius: 10px;
  font-size: 13px;
  color: #B91C1C;
  line-height: 1.5;
  margin-bottom: 8px;
}

.product-specs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}
.product-spec {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 10px;
  text-align: center;
}
.product-spec-label {
  display: block;
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 5px;
}
.product-spec-value {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}

.pd-back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 24px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s, gap 0.2s;
}
.pd-back-link:hover { color: var(--red); gap: 8px; }
.pd-back-link svg { stroke: currentColor; }

/* Sidebar terlaris */
.product-bestsellers {
  position: sticky;
  top: 88px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 22px 20px;
  box-shadow: 0 4px 20px rgba(17, 24, 39, 0.05);
}
.product-bestsellers-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.product-bestsellers-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, #FEF2F2, #FEE2E2);
  border: 1px solid #FECACA;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.product-bestsellers-icon svg { stroke: var(--red); fill: rgba(217,43,43,0.12); }
.product-bestsellers-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.2px;
}
.product-bestsellers-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.bestseller-list {
  display: flex;
  flex-direction: column;
}
.bestseller-item {
  display: grid;
  grid-template-columns: 28px 48px 1fr 16px;
  gap: 10px;
  align-items: center;
  padding: 11px 6px;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
  transition: background 0.15s, padding 0.15s;
  border-radius: 8px;
}
.bestseller-item:last-child { border-bottom: none; }
.bestseller-item:hover {
  background: var(--surface2);
  padding-left: 10px;
  padding-right: 10px;
}
.bestseller-rank {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-align: center;
}
.bestseller-rank.top {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
}
.bestseller-rank.rank-1 { background: #FEE2E2; color: var(--red); }
.bestseller-rank.rank-2 { background: #FFEDD5; color: #C2410C; }
.bestseller-rank.rank-3 { background: #FEF3C7; color: #B45309; }
.bestseller-thumb {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  background: var(--surface2);
  border: 1px solid var(--border);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.bestseller-thumb img { width: 100%; height: 100%; object-fit: cover; }
.bestseller-thumb svg { opacity: 0.2; stroke: #9CA3AF; }
.bestseller-info { min-width: 0; }
.bestseller-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.bestseller-item:hover .bestseller-name { color: var(--red); }
.bestseller-price {
  font-size: 12px;
  font-weight: 700;
  color: var(--red);
  margin-top: 3px;
}
.bestseller-arrow {
  opacity: 0;
  stroke: var(--muted);
  transition: opacity 0.15s, transform 0.15s;
}
.bestseller-item:hover .bestseller-arrow {
  opacity: 1;
  transform: translateX(2px);
  stroke: var(--red);
}
.bestseller-empty {
  font-size: 13px;
  color: var(--muted);
  text-align: center;
  padding: 28px 12px;
  background: var(--surface2);
  border-radius: 10px;
}

.qty-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }

/* ── TOAST ── */
.toast {
  position: fixed; bottom: 24px; right: 24px;
  background: var(--surface);
  border: 1px solid #BBF7D0;
  color: #15803D;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  padding: 12px 20px;
  border-radius: 10px;
  display: flex; align-items: center; gap: 8px;
  transform: translateY(80px); opacity: 0;
  transition: transform 0.3s, opacity 0.3s;
  z-index: 999;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  pointer-events: none;
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast.error {
  border-color: #FECACA;
  color: #B91C1C;
}

.table-scroll { overflow-x: auto; }

/* ── KERANJANG ── */
.cart-layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 24px;
  align-items: start;
  width: 100%;
}
.cart-layout--single {
  grid-template-columns: 1fr;
}

.cart-main { min-width: 0; width: 100%; }

.cart-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.cart-header-meta {
  font-size: 13px;
  color: var(--muted);
}
.cart-header-meta strong { color: var(--text); font-weight: 600; }

.cart-items { display: flex; flex-direction: column; gap: 12px; }

.cart-item {
  display: grid;
  grid-template-columns: 88px 1fr auto auto auto;
  gap: 16px;
  align-items: center;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.cart-item:hover {
  border-color: #FECACA;
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

.cart-item-thumb {
  width: 88px;
  height: 88px;
  border-radius: 10px;
  background: var(--surface2);
  border: 1px solid var(--border);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  text-decoration: none;
}
.cart-item-thumb img { width: 100%; height: 100%; object-fit: cover; }
.cart-item-thumb svg { opacity: 0.2; stroke: #9CA3AF; }

.cart-item-info { min-width: 0; }
.cart-item-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
}
.cart-item-name:hover { color: var(--red); }
.cart-item-sku {
  font-size: 11px;
  color: var(--muted);
  margin-top: 4px;
}
.cart-item-stock {
  font-size: 11px;
  font-weight: 600;
  margin-top: 6px;
  display: inline-flex;
  padding: 2px 8px;
  border-radius: 4px;
}

.cart-item-price {
  font-size: 13px;
  color: var(--muted);
  text-align: right;
  white-space: nowrap;
}
.cart-item-price strong {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}

.qty-stepper {
  display: flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface);
}
.qty-stepper input {
  width: 48px;
  height: 36px;
  border: none;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  text-align: center;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  background: var(--surface);
  outline: none;
  -moz-appearance: textfield;
}
.qty-stepper input::-webkit-outer-spin-button,
.qty-stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.cart-item-subtotal {
  font-size: 16px;
  font-weight: 700;
  color: var(--red);
  text-align: right;
  white-space: nowrap;
  min-width: 100px;
}

.btn-remove {
  background: none;
  border: none;
  color: var(--muted);
  font-family: var(--font);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 6px;
  transition: color 0.2s, background 0.2s;
  white-space: nowrap;
}
.btn-remove:hover { color: #B91C1C; background: #FEF2F2; }

.cart-summary {
  position: sticky;
  top: 80px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.06);
}
.cart-summary-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.cart-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 10px;
}
.cart-summary-row strong { color: var(--text); font-weight: 600; }
.cart-summary-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0;
  margin: 12px 0 20px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.cart-summary-total span:first-child {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}
.cart-summary-total span:last-child {
  font-size: 22px;
  font-weight: 700;
  color: var(--red);
  letter-spacing: -0.3px;
}

.cart-summary-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.cart-summary-actions .btn-primary,
.cart-summary-actions .btn-secondary {
  width: 100%;
  justify-content: center;
  padding: 12px 20px;
}
.cart-summary-actions .btn-primary.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.cart-summary-note {
  margin-top: 0;
  padding: 12px;
  background: #FFFBEB;
  border: 1px solid #FDE68A;
  border-radius: 8px;
  font-size: 12px;
  color: #B45309;
  line-height: 1.5;
}

.cart-empty {
  text-align: center;
  padding: 64px 24px;
  background: var(--surface2);
  border: 1px dashed var(--border);
  border-radius: 12px;
}
.cart-empty svg {
  width: 64px;
  height: 64px;
  color: #D1D5DB;
  margin: 0 auto 16px;
}
.cart-empty h2 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}
.cart-empty p {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 24px;
}

/* ── PESANAN & halaman konten full-width ── */
.orders-page,
.order-detail-page,
.cart-page-full {
  width: 100%;
  min-height: calc(100vh - 105px);
  background: var(--surface);
  /* padding: 28px 32px; */
}

.product-detail-page {
  width: 100%;
  min-height: calc(100vh - 105px);
  background: var(--bg);
  padding: 20px 32px 40px;
}

.orders-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.order-list { display: flex; flex-direction: column; gap: 12px; }

.order-card {
  display: block;
  text-decoration: none;
  color: inherit;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}
.order-card:hover {
  border-color: #FECACA;
  box-shadow: 0 6px 20px rgba(0,0,0,0.08);
  transform: translateY(-2px);
}

.order-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.order-card-kode {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.2px;
}
.order-card-date {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

.order-card-body {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  padding: 14px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.order-card-stat .label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  margin-bottom: 4px;
  font-weight: 500;
}
.order-card-stat .value {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}
.order-card-stat .value.due { color: #B91C1C; }
.order-card-stat .value.total { color: var(--red); }

.order-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  flex-wrap: wrap;
}
.order-card-due {
  font-size: 12px;
  font-weight: 500;
  padding: 6px 10px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.order-card-due.warn { background: #FFFBEB; color: #B45309; border: 1px solid #FDE68A; }
.order-card-due.danger { background: #FEF2F2; color: #B91C1C; border: 1px solid #FECACA; }

.order-card-link {
  font-size: 13px;
  font-weight: 600;
  color: var(--red);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.order-detail-main { min-width: 0; }

.order-detail-sidebar {
  position: sticky;
  top: 80px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.order-breadcrumb {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 16px;
}
.order-breadcrumb a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s;
}
.order-breadcrumb a:hover { color: var(--red); }

.order-detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.order-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 24px;
  margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.order-section-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.order-item-row {
  display: grid;
  grid-template-columns: 64px 1fr auto auto;
  gap: 14px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.order-item-row:last-child { border-bottom: none; padding-bottom: 0; }
.order-item-row:first-child { padding-top: 0; }

.order-item-thumb {
  width: 64px;
  height: 64px;
  border-radius: 8px;
  background: var(--surface2);
  border: 1px solid var(--border);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.order-item-thumb img { width: 100%; height: 100%; object-fit: cover; }
.order-item-thumb svg { opacity: 0.2; stroke: #9CA3AF; }

.order-item-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
}
.order-item-meta { font-size: 11px; color: var(--muted); margin-top: 3px; }
.order-item-qty {
  font-size: 13px;
  color: var(--muted);
  text-align: center;
  min-width: 48px;
}
.order-item-subtotal {
  font-size: 14px;
  font-weight: 700;
  color: var(--red);
  text-align: right;
  min-width: 100px;
}

.payment-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.payment-card:last-child { border-bottom: none; padding-bottom: 0; }
.payment-card:first-child { padding-top: 0; }
.payment-card-info { flex: 1; min-width: 0; }
.payment-card-date { font-size: 12px; color: var(--muted); }
.payment-card-nominal {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-top: 4px;
}
.payment-card-reject {
  font-size: 12px;
  color: #B91C1C;
  margin-top: 6px;
}

.sidebar-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 22px 24px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.06);
}
.sidebar-card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.sidebar-stat {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 10px;
}
.sidebar-stat strong { color: var(--text); font-weight: 600; }
.sidebar-stat.due strong { color: #B91C1C; }
.sidebar-stat.total {
  padding: 14px 0;
  margin: 8px 0 0;
  border-top: 1px solid var(--border);
  font-size: 14px;
  color: var(--text);
}
.sidebar-stat.total strong {
  font-size: 20px;
  font-weight: 700;
  color: var(--red);
}

.sidebar-alert {
  margin-top: 14px;
  padding: 12px;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.5;
  border: 1px solid;
}
.sidebar-alert.warn { background: #FFFBEB; border-color: #FDE68A; color: #B45309; }
.sidebar-alert.danger { background: #FEF2F2; border-color: #FECACA; color: #B91C1C; }
.sidebar-alert.ok { background: #F0FDF4; border-color: #BBF7D0; color: #15803D; }

.upload-box {
  margin-top: 4px;
}
.upload-box .form-label { margin-top: 12px; }
.upload-box .form-label:first-child { margin-top: 0; }
.upload-box .btn-success {
  width: 100%;
  justify-content: center;
  margin-top: 16px;
  display: inline-flex;
  align-items: center;
}

.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.info-field .label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  margin-bottom: 4px;
  font-weight: 500;
}
.info-field .value {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

/* ── PROFILE PAGE ── */
.profile-page {
  width: 100%;
  min-height: calc(100vh - 105px);
  background: var(--bg);
  padding: 28px 32px 40px;
}
.profile-center {
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.profile-hero {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(17, 24, 39, 0.06);
}
.profile-hero-main {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 28px 28px 24px;
  background: linear-gradient(135deg, #FEF2F2 0%, #FFFFFF 55%);
  border-bottom: 1px solid var(--border);
}
.profile-hero-avatar {
  width: 72px;
  height: 72px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: #fff;
  padding: 10px;
  object-fit: contain;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.profile-hero-avatar.is-photo {
  padding: 0;
  object-fit: cover;
}
.profile-avatar-wrap {
  position: relative;
  flex-shrink: 0;
  width: 72px;
  height: 72px;
}
.profile-avatar-form {
  position: absolute;
  inset: 0;
  margin: 0;
}
.profile-avatar-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}
.profile-avatar-upload {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border-radius: 16px;
  background: rgba(17, 24, 39, 0.55);
  color: #fff;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s ease;
}
.profile-avatar-wrap:hover .profile-avatar-upload,
.profile-avatar-wrap:focus-within .profile-avatar-upload {
  opacity: 1;
}
.profile-avatar-upload-icon {
  display: grid;
  place-items: center;
}
.profile-avatar-upload-text {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.profile-avatar-hint {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--muted, #6b7280);
}
.profile-avatar-error {
  margin: 6px 0 0;
  font-size: 12px;
  color: #b91c1c;
  font-weight: 500;
}
.profile-avatar-remove-form {
  margin-top: 8px;
}
.profile-avatar-remove {
  border: none;
  background: transparent;
  color: #b91c1c;
  font-size: 12px;
  font-weight: 600;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.profile-avatar-remove:hover {
  color: #991b1b;
}
.profile-hero-info { min-width: 0; }
.profile-hero-name {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.3px;
  line-height: 1.25;
  margin-bottom: 4px;
}
.profile-hero-email {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 12px;
  word-break: break-all;
}
.profile-hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.profile-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.profile-badge.ok {
  background: #DCFCE7;
  border-color: #BBF7D0;
  color: #15803D;
}
.profile-badge.muted {
  background: #F3F4F6;
  border-color: #E5E7EB;
  color: #6B7280;
}
.profile-hero-warehouse {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 28px;
  background: var(--surface);
}
.profile-hero-warehouse-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.profile-hero-warehouse-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.profile-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 22px 24px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.profile-panel-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 16px;
  padding-bottom: 12px;
}
.profile-rows {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.profile-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 12px;
}
.profile-info-grid .profile-row--full {
  grid-column: 1 / -1;
}
.profile-row {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 14px;
  align-items: center;
  padding: 12px 8px;
  border-radius: 10px;
  transition: background 0.15s;
}
.profile-row:hover { background: var(--surface2); }
.profile-row-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--surface2);
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  color: var(--red);
}
.profile-row-body { min-width: 0; }
.profile-row-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 3px;
}
.profile-row-value {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
  word-break: break-word;
}
.profile-address-text {
  font-size: 14px;
  color: var(--text);
  line-height: 1.65;
  padding: 4px 8px;
}

.profile-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 4px;
}
.profile-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 16px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: border-color 0.2s, color 0.2s, box-shadow 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.profile-action-btn:hover {
  border-color: #FECACA;
  color: var(--red);
}
.profile-action-btn.primary {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
  box-shadow: 0 4px 14px rgba(217, 43, 43, 0.25);
}
.profile-action-btn.primary:hover {
  background: var(--red-light);
  border-color: var(--red-light);
  color: #fff;
}

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--surface2); }
::-webkit-scrollbar-thumb { background: #D1D5DB; border-radius: 3px; }

@media (max-width: 900px) {
  .r-nav { padding: 0 16px; gap: 12px; }
  .logo-img { height: 30px; }
  .search-bar { max-width: none; }
  .nav-profile-text { display: none; }
  .nav-profile-toggle { padding: 4px; max-width: none; }
  .subnav { padding: 0 16px; }
  .page { grid-template-columns: 1fr; }
  aside,
  .catalog-sidebar {
    position: static;
    height: auto;
    overflow: visible;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 12px 16px;
  }
  .catalog-filters-card {
    padding: 14px 16px;
    border-radius: 16px;
  }
  .catalog-filters-toggle { display: flex; }
  .catalog-filters-panel {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.35s ease, opacity 0.25s ease, padding 0.25s ease;
    padding-top: 0;
  }
  .catalog-filters-card.is-open .catalog-filters-panel {
    max-height: 1200px;
    opacity: 1;
    padding-top: 14px;
    overflow: visible;
  }
  .catalog-filters-row--selects {
    margin-bottom: 12px;
    padding-bottom: 12px;
  }
  .catalog-filter-field {
    min-width: 100%;
  }
  .filter-toggle { display: flex; }
  .filter-title { display: none; }
  .catalog-sidebar .filter-panel {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.35s ease, opacity 0.25s ease, padding 0.25s ease;
    padding-top: 0;
  }
  .catalog-sidebar.is-open .filter-panel {
    max-height: 1400px;
    opacity: 1;
    padding-top: 14px;
    overflow: visible;
  }
  .catalog-sidebar .filter-group:last-of-type { margin-bottom: 20px; }
  main.catalog-main, .reseller-main { padding: 20px 16px; }
  .product-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
  }
  .orders-page,
  .cart-page-full,
  .product-detail-page,
  .likes-page,
  .profile-page { padding: 20px 16px; }
  .profile-hero-main { flex-direction: column; text-align: center; padding: 24px 20px 20px; }
  .profile-hero-badges { justify-content: center; }
  .profile-actions { grid-template-columns: 1fr; }
  .cart-layout { grid-template-columns: 1fr; }
  .cart-summary { position: static; }
  .cart-item {
    grid-template-columns: 72px 1fr;
    grid-template-rows: auto auto;
    gap: 12px;
  }
  .cart-item-thumb { width: 72px; height: 72px; grid-row: span 2; }
  .cart-item-price,
  .cart-item-subtotal,
  .cart-item .qty-stepper,
  .cart-item .btn-remove {
    grid-column: 2;
  }
  .cart-item-price { text-align: left; }
  .cart-item-subtotal { text-align: left; }
  .order-detail-page { padding: 20px 16px; }
  .order-detail-sidebar { position: static; }
  .order-item-row {
    grid-template-columns: 56px 1fr;
    grid-template-rows: auto auto;
  }
  .order-item-thumb { width: 56px; height: 56px; grid-row: span 2; }
  .order-item-qty,
  .order-item-subtotal { grid-column: 2; text-align: left; }
  .info-grid { grid-template-columns: 1fr; }
  .alert-banner { margin: 12px 16px 0; }
  .product-detail-inner { grid-template-columns: 1fr; }
  .product-gallery { border-right: none; border-bottom: 1px solid var(--border); }
  .product-info { padding: 24px 20px; }
  .product-specs { grid-template-columns: 1fr; }
  .product-title { font-size: 20px; }
  .product-price { font-size: 26px; }
  .catalog-title { font-size: 20px; }
}

@media (max-width: 540px) {
  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
}

/* ── TAGIHAN RESELLER ── */
.tagihan-page {
  width: 100%;
  max-width: none;
  margin: 0;
  position: relative;
}

.tagihan-page-bg {
  position: absolute;
  inset: 0 -16px 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 75% 55% at 5% -5%, rgba(248, 113, 113, .11), transparent 58%),
    radial-gradient(ellipse 50% 35% at 98% 0%, rgba(148, 163, 184, .08), transparent 52%),
    linear-gradient(180deg, #FAFBFC 0%, #fff 42%);
  background-color: #fff;
}

.tagihan-page > :not(.tagihan-page-bg) {
  position: relative;
  z-index: 1;
}

.tagihan-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.tagihan-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  margin-bottom: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .92);
  border: 1px solid rgba(226, 232, 240, .9);
  color: var(--red);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .02em;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}

.tagihan-hero-badge svg { flex-shrink: 0; opacity: .85; }

.tagihan-hero-title {
  background: linear-gradient(135deg, #0F172A 0%, #475569 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.tagihan-hero-highlight {
  align-self: center;
  min-width: 180px;
  padding: 16px 20px;
  border-radius: 18px;
  background: linear-gradient(145deg, #FFF5F5 0%, #fff 100%);
  border: 1px solid #FECACA;
  box-shadow: 0 8px 24px rgba(220, 38, 38, .08);
  text-align: right;
}

.tagihan-hero-highlight-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  margin-bottom: 4px;
}

.tagihan-hero-highlight strong {
  display: block;
  font-size: 22px;
  font-weight: 800;
  color: #B91C1C;
  letter-spacing: -.02em;
  line-height: 1.2;
}

.tagihan-hero-highlight-meta {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
}

.tagihan-flash {
  padding: 12px 16px;
  border-radius: 14px;
  font-size: 14px;
  margin-bottom: 16px;
  border: 1px solid transparent;
  backdrop-filter: blur(8px);
}
.tagihan-flash.success { background: rgba(236, 253, 245, .95); color: #065F46; border-color: #A7F3D0; }
.tagihan-flash.error { background: rgba(254, 242, 242, .95); color: #991B1B; border-color: #FECACA; }
.tagihan-flash.info { background: rgba(239, 246, 255, .95); color: #1E40AF; border-color: #BFDBFE; }

.tagihan-week-card-list {
  margin-bottom: 20px;
}
.tagihan-week-card .tagihan-week-card-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.tagihan-week-card-row .po-order-item-info {
  min-width: 0;
  flex: 1;
}
.tagihan-week-bulk {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}
.tagihan-week-bulk-hint {
  margin: 0 0 12px;
  font-size: 12.5px;
  color: #1D4ED8;
}
.tagihan-week-bulk-hint.is-error {
  color: #B91C1C;
}
.po-btn.is-loading {
  opacity: .7;
  cursor: wait;
  pointer-events: none;
}

.tagihan-pay-loading {
  position: fixed;
  inset: 0;
  z-index: 1300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(15, 23, 42, .42);
  backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity .18s ease;
}
.tagihan-pay-loading[hidden] {
  display: none !important;
}
.tagihan-pay-loading.is-open {
  opacity: 1;
}
.tagihan-pay-loading-card {
  width: min(360px, 100%);
  background: #fff;
  border-radius: 16px;
  padding: 28px 24px;
  text-align: center;
  box-shadow: 0 24px 48px rgba(15, 23, 42, .18);
}
.tagihan-pay-loading-card .tagihan-modal-spinner {
  margin: 0 auto 14px;
}
.tagihan-pay-loading-card strong {
  display: block;
  font-size: 15px;
  font-weight: 700;
  color: #0F172A;
}
.tagihan-pay-loading-card p {
  margin: 6px 0 0;
  font-size: 13px;
  color: #64748B;
  line-height: 1.45;
}

.tagihan-week-pay-modal {
  z-index: 1210;
}
.tagihan-week-pay-dialog {
  width: min(1080px, 100%);
  max-height: min(92vh, 880px);
  background: #F8FAFC;
}
.tagihan-week-pay-table-wrap {
  max-height: min(48vh, 420px);
}
.tagihan-week-pay-history {
  margin: 0;
  border: 0;
  border-top: 1px solid #EEF2F7;
  border-radius: 0;
  background: #F8FAFC;
}
.tagihan-week-pay-empty {
  padding: 24px 16px;
  text-align: center;
  color: #94A3B8;
  font-size: 13px;
}

.tagihan-week-list-modal {
  z-index: 1190;
}
.tagihan-week-list-dialog {
  width: min(840px, 100%);
  max-height: min(92vh, 880px);
  background: #F8FAFC;
}
.tagihan-week-list-content {
  padding: 16px;
}
.tagihan-week-list-meta {
  margin: 6px 0 0;
  font-size: 13px;
  color: #64748B;
  line-height: 1.45;
}
.tagihan-week-list-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 16px 12px;
  padding: 10px 14px;
  border: 1px solid #E8EDF3;
  border-radius: 12px;
  background: #F8FAFC;
  color: #94A3B8;
}
.tagihan-week-list-toolbar:focus-within {
  border-color: #fecaca;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, .08);
  color: #64748B;
}
.tagihan-week-list-toolbar input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  font-size: 13px;
  color: #0F172A;
  padding: 0;
}
.tagihan-week-list-toolbar input:focus {
  outline: none;
}
.tagihan-week-list-toolbar input::placeholder {
  color: #94A3B8;
}
.tagihan-week-list-table-wrap {
  max-height: min(52vh, 480px);
}
.tagihan-week-list-row.is-lunas .tm-subtotal {
  color: #16A34A;
}
.tagihan-week-list-empty {
  padding: 48px 16px;
  text-align: center;
  color: #94A3B8;
  font-size: 13px;
}

.tagihan-due-alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 0 0 14px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid;
  font-size: 13px;
  line-height: 1.45;
}
.tagihan-due-alert-icon {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 8px;
}
.tagihan-due-alert-body { min-width: 0; }
.tagihan-due-alert-body strong {
  display: block;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 2px;
}
.tagihan-due-alert-body p {
  margin: 0;
  opacity: .92;
}
.tagihan-due-alert--danger {
  background: #FEF2F2;
  border-color: #FECACA;
  color: #991B1B;
}
.tagihan-due-alert--danger .tagihan-due-alert-icon {
  background: #FEE2E2;
  color: #DC2626;
}
.tagihan-due-alert--warn {
  background: #FFFBEB;
  border-color: #FDE68A;
  color: #92400E;
}
.tagihan-due-alert--warn .tagihan-due-alert-icon {
  background: #FEF3C7;
  color: #D97706;
}

.tagihan-toolbar {
  margin-bottom: 20px;
  padding: 16px 18px;
  background: rgba(255, 255, 255, .88);
  border: 1px solid rgba(226, 232, 240, .9);
  border-radius: 18px;
  box-shadow: 0 4px 20px rgba(15, 23, 42, .04);
  backdrop-filter: blur(10px);
}

.tagihan-period-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
  padding: 14px 18px;
  background: rgba(255, 255, 255, .92);
  border: 1px solid rgba(226, 232, 240, .9);
  border-radius: 18px;
  box-shadow: 0 4px 20px rgba(15, 23, 42, .04);
  backdrop-filter: blur(10px);
}

.tagihan-period-bar--combined {
  align-items: center;
  gap: 14px 18px;
}

.tagihan-period-bar--combined .tagihan-filter-strip {
  flex: 1 1 auto;
  min-width: min(100%, 280px);
}

.tagihan-period-bar--combined .tagihan-segment {
  flex: 0 1 auto;
  margin-left: auto;
  max-width: 100%;
  overflow-x: auto;
}

.tagihan-period-bar .tagihan-filter-strip {
  flex: 1;
  min-width: min(100%, 360px);
}

.tagihan-period-bar .tagihan-period-hint {
  margin: 0;
  white-space: nowrap;
}

.tagihan-toolbar--status {
  padding: 10px 12px;
  margin-bottom: 18px;
}

.tagihan-toolbar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.tagihan-filter-strip {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
}

.tagihan-filter-strip--inline {
  flex: 1;
  min-width: min(100%, 320px);
}

.tagihan-filter-strip-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: .02em;
}

.tagihan-filter-select,
.tagihan-filter-date {
  appearance: none;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 12px;
  padding: 9px 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  font-family: inherit;
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}

.tagihan-filter-select {
  padding-right: 34px;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

.tagihan-filter-date { min-width: 150px; }
.tagihan-filter-date-year { width: 110px; min-width: 110px; }

.tagihan-filter-range-sep {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.tagihan-filter-select:focus,
.tagihan-filter-date:focus {
  border-color: #FCA5A5;
  box-shadow: 0 0 0 3px rgba(248, 113, 113, .1);
  background: #fff;
}

.tagihan-filter-apply {
  border: none;
  border-radius: 12px;
  padding: 9px 18px;
  background: var(--red);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease, opacity .15s ease;
  box-shadow: 0 4px 14px rgba(220, 38, 38, .2);
}

.tagihan-filter-apply:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(220, 38, 38, .26);
}

.tagihan-period-hint {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
}

.tagihan-period-hint strong {
  color: var(--text);
  font-weight: 700;
}

.tagihan-segment {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
  border-radius: 14px;
  background: #F1F5F9;
  border: 1px solid #E2E8F0;
}

.tagihan-segment-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: #64748B;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition:
    background .2s ease,
    color .2s ease,
    box-shadow .2s ease,
    transform .2s ease;
}

.tagihan-segment-count {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: #e2e8f0;
  color: #475569;
  font-size: 11px;
  font-weight: 700;
  display: inline-grid;
  place-items: center;
  line-height: 1;
}

.tagihan-segment-item.is-active .tagihan-segment-count {
  background: #fee2e2;
  color: #b91c1c;
}

.tagihan-segment-item:hover {
  color: var(--text);
  background: rgba(255, 255, 255, .65);
}

.tagihan-segment-item.is-active {
  background: #fff;
  color: var(--red);
  border-color: rgba(254, 202, 202, .8);
  box-shadow: 0 2px 8px rgba(15, 23, 42, .06);
}

.tagihan-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.tagihan-summary-card {
  background: rgba(255, 255, 255, .92);
  border: 1px solid rgba(226, 232, 240, .9);
  border-radius: 18px;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(8px);
  transition:
    transform .25s cubic-bezier(.22, 1, .36, 1),
    box-shadow .25s ease,
    border-color .25s ease;
}

.tagihan-summary-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, .55) 0%, transparent 60%);
  opacity: 0;
  transition: opacity .25s ease;
  pointer-events: none;
}

.tagihan-summary-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 32px rgba(15, 23, 42, .07);
}

.tagihan-summary-card:hover::after { opacity: 1; }

.tagihan-summary-card.highlight {
  border-color: #FECACA;
  background: linear-gradient(145deg, rgba(255, 245, 245, .95) 0%, rgba(255, 255, 255, .95) 55%);
}

.tagihan-summary-card .label {
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.tagihan-summary-card .amount {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.2;
  letter-spacing: -.02em;
}

.tagihan-summary-card .amount.ok { color: #059669; }
.tagihan-summary-card .meta { font-size: 12px; color: var(--muted); }

.tagihan-summary-icon {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
  transition: transform .3s cubic-bezier(.22, 1, .36, 1);
}

.tagihan-summary-card:hover .tagihan-summary-icon { transform: scale(1.06) rotate(-3deg); }

.tagihan-summary-icon.due {
  background: linear-gradient(135deg, #FEE2E2, #FECACA);
  color: #B91C1C;
}

.tagihan-summary-icon.warn {
  background: linear-gradient(135deg, #FEF3C7, #FDE68A);
  color: #B45309;
}

.tagihan-summary-icon.ok {
  background: linear-gradient(135deg, #D1FAE5, #A7F3D0);
  color: #047857;
}

.tagihan-summary-icon.total {
  background: linear-gradient(135deg, #DBEAFE, #BFDBFE);
  color: #1D4ED8;
}

.tagihan-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.tagihan-card {
  width: 100%;
  height: 100%;
  background: #fff;
  border: 1px solid rgba(226, 232, 240, .9);
  border-radius: 18px;
  padding: 0;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(15, 23, 42, .04);
  transition:
    transform .28s cubic-bezier(.22, 1, .36, 1),
    box-shadow .28s ease,
    border-color .28s ease,
    background .28s ease;
}

.tagihan-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 36px rgba(15, 23, 42, .08);
}

.tagihan-card--lunas {
  background: linear-gradient(145deg, #D1FAE5 0%, #ECFDF5 38%, #F7FEF9 100%);
  border-color: rgba(110, 231, 183, .45);
}

.tagihan-card--lunas:hover {
  box-shadow: 0 16px 36px rgba(5, 150, 105, .1);
}

.tagihan-card--partial {
  background: linear-gradient(145deg, #FEF3C7 0%, #FFFBEB 42%, #FFFEF7 100%);
  border-color: rgba(252, 211, 77, .5);
}

.tagihan-card--partial:hover {
  box-shadow: 0 16px 36px rgba(180, 83, 9, .08);
}

.tagihan-card--unpaid {
  background: linear-gradient(145deg, #FECACA 0%, #FEF2F2 42%, #FFF8F8 100%);
  border-color: rgba(252, 165, 165, .5);
}

.tagihan-card--unpaid:hover {
  box-shadow: 0 16px 36px rgba(220, 38, 38, .08);
}

.tagihan-card--piutang {
  background: linear-gradient(145deg, #EDE9FE 0%, #F5F3FF 45%, #FAFAFF 100%);
  border-color: rgba(196, 181, 253, .55);
}

.tagihan-card--batal {
  background: linear-gradient(145deg, #F3F4F6 0%, #F9FAFB 100%);
  border-color: #E5E7EB;
  opacity: .88;
}

.tagihan-card.is-overdue {
  box-shadow: 0 4px 18px rgba(15, 23, 42, .08);
}

.tagihan-card--unpaid.is-overdue {
  border-color: rgba(248, 113, 113, .7);
  box-shadow: 0 4px 18px rgba(220, 38, 38, .12);
}

.tagihan-card--partial.is-overdue {
  border-color: rgba(245, 158, 11, .65);
  box-shadow: 0 4px 18px rgba(180, 83, 9, .12);
}

.tagihan-card-inner {
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1;
  padding: 18px 16px 16px;
}

.tagihan-card-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}

.tagihan-card .status-pill {
  flex-shrink: 0;
  font-size: 10px;
  padding: 4px 8px;
}

.tagihan-card-kode {
  font-size: 14px;
  font-weight: 700;
  color: #0F172A;
  word-break: break-all;
  letter-spacing: -.01em;
  line-height: 1.35;
}

.tagihan-card-meta {
  font-size: 11px;
  color: #94A3B8;
  margin-top: 4px;
  line-height: 1.45;
}

.tagihan-card-amounts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.tagihan-card-stat--full {
  grid-column: 1 / -1;
}

.tagihan-card-stat {
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .78);
  border: 1px solid rgba(255, 255, 255, .92);
  backdrop-filter: blur(6px);
  transition: background .2s ease, border-color .2s ease;
}

.tagihan-card:hover .tagihan-card-stat {
  background: rgba(255, 255, 255, .92);
  border-color: rgba(255, 255, 255, 1);
}

.tagihan-card--batal .tagihan-card-stat {
  background: rgba(255, 255, 255, .65);
  border-color: rgba(229, 231, 235, .9);
}

.tagihan-card-amounts .mini-label {
  display: block;
  font-size: 10px;
  color: #94A3B8;
  margin-bottom: 3px;
  text-transform: uppercase;
  letter-spacing: .04em;
  font-weight: 600;
}

.tagihan-card-amounts strong {
  font-size: 14px;
  color: #0F172A;
  font-weight: 700;
}

.tagihan-card-amounts .due { color: #DC2626; }
.tagihan-card-amounts .ok { color: #059669; }

.tagihan-card-actions {
  display: flex;
  gap: 8px;
  width: 100%;
  margin-top: auto;
}

.tagihan-progress {
  height: 5px;
  background: rgba(255, 255, 255, .55);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .4);
}

.tagihan-card--lunas .tagihan-progress-bar {
  background: linear-gradient(90deg, #6EE7B7, #059669);
}

.tagihan-card--partial .tagihan-progress-bar {
  background: linear-gradient(90deg, #FCD34D, #D97706);
}

.tagihan-card--unpaid .tagihan-progress-bar {
  background: linear-gradient(90deg, #FCA5A5, #DC2626);
}

.tagihan-progress-bar {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #FCA5A5, var(--red));
  border-radius: 999px;
  position: relative;
  transition: width 1s cubic-bezier(.22, 1, .36, 1);
}

.tagihan-page.is-ready .tagihan-progress-bar {
  width: var(--progress, 0%);
}

.tagihan-progress-bar::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, .45) 50%, transparent 100%);
  transform: translateX(-100%);
  animation: tagihan-shine 2.2s ease-in-out infinite;
  animation-delay: 1s;
}

@keyframes tagihan-shine {
  0% { transform: translateX(-100%); }
  60%, 100% { transform: translateX(200%); }
}

.btn-tagihan-detail,
.btn-tagihan-manual {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid #E2E8F0;
  background: #fff;
  color: #334155;
  cursor: pointer;
  font-family: inherit;
  transition:
    transform .2s ease,
    background .15s ease,
    border-color .15s ease,
    box-shadow .2s ease;
}

.btn-tagihan-detail:hover,
.btn-tagihan-manual:hover {
  transform: translateY(-1px);
  border-color: #CBD5E1;
  box-shadow: 0 4px 12px rgba(15, 23, 42, .06);
  background: #F8FAFC;
}

.btn-tagihan-pay,
.btn-midtrans-pay {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  border: none;
  background: linear-gradient(135deg, #EF4444, #DC2626);
  color: #fff;
  cursor: pointer;
  transition:
    transform .2s ease,
    box-shadow .2s ease,
    opacity .15s ease;
  box-shadow: 0 4px 14px rgba(220, 38, 38, .22);
}

.btn-tagihan-pay:hover,
.btn-midtrans-pay:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(220, 38, 38, .3);
  opacity: 1;
  color: #fff;
}

.btn-midtrans-pay.is-loading { opacity: .7; cursor: wait; }
.btn-midtrans-pay:disabled { opacity: .65; cursor: not-allowed; }

.tagihan-empty {
  margin-top: 12px;
  padding: 48px 24px;
  border-radius: 20px;
  background: rgba(255, 255, 255, .85);
  border: 1px dashed #E2E8F0;
}

.tagihan-empty-icon { color: #CBD5E1; margin-bottom: 8px; }

.tagihan-page .tagihan-reveal {
  opacity: 0;
  transform: translateY(16px);
  transition:
    opacity .55s cubic-bezier(.22, 1, .36, 1),
    transform .55s cubic-bezier(.22, 1, .36, 1);
  transition-delay: var(--reveal-delay, 0ms);
}

.tagihan-page.is-ready .tagihan-reveal {
  opacity: 1;
  transform: translateY(0);
}

.tagihan-flash.tagihan-reveal { transform: translateY(-8px); }
.tagihan-page.is-ready .tagihan-flash.tagihan-reveal { transform: translateY(0); }

.tagihan-page.is-ready .tagihan-empty {
  animation: tagihan-float 5s ease-in-out 1s infinite;
}

@keyframes tagihan-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.tagihan-empty-icon {
  animation: tagihan-pulse 2.5s ease-in-out infinite;
}

@keyframes tagihan-pulse {
  0%, 100% { opacity: .55; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.05); }
}

.tagihan-detail-page .tagihan-detail-grid { align-items: start; }
.tagihan-section-card { background: #fff; border: 1px solid var(--border); border-radius: 16px; padding: 20px; }
.tagihan-pay-sidebar .sidebar-card { border-radius: 16px; }
.tagihan-pay-card { margin-bottom: 14px; }
.tagihan-pay-desc { font-size: 13px; color: var(--muted); line-height: 1.55; margin-bottom: 14px; }
.tagihan-pay-note { font-size: 12px; color: var(--muted); margin-top: 10px; }
.tagihan-pay-note.error { color: #B91C1C; }

.tagihan-pay-progress-wrap { margin-bottom: 14px; }
.tagihan-pay-progress { height: 8px; background: #F3F4F6; border-radius: 999px; overflow: hidden; }
.tagihan-pay-progress-bar { height: 100%; background: linear-gradient(90deg, #34D399, #059669); }
.tagihan-pay-progress-label { display: block; font-size: 11px; color: var(--muted); margin-top: 6px; }

.due-text { color: #B91C1C !important; }
.ok-text { color: #059669 !important; }
.purple-text { color: #7C3AED !important; }

.tagihan-page .status-pill {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .02em;
  padding: 5px 11px;
  border-radius: 999px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}

.sidebar-alert.danger { background: #FEF2F2; color: #991B1B; border: 1px solid #FECACA; }
.sidebar-alert.ok { background: #ECFDF5; color: #065F46; border: 1px solid #A7F3D0; }

.tagihan-history-list { display: flex; flex-direction: column; gap: 10px; }
.tagihan-history-item {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #FAFAFA;
}
.tagihan-history-item div { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.tagihan-history-item span { font-size: 12px; color: var(--muted); }
.tagihan-history-item p { font-size: 12px; color: var(--muted); margin-top: 6px; line-height: 1.5; }

.status-pill.muted { background: #F3F4F6; color: #6B7280; }
.status-pill.purple { background: #EDE9FE; color: #6D28D9; border-color: #DDD6FE; }

/* ── TAGIHAN MODAL (clean / modern) ── */
body.tagihan-modal-open { overflow: hidden; }

.tagihan-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 16px;
}
.tagihan-modal[hidden] { display: none !important; }

.tagihan-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, .38);
  backdrop-filter: blur(10px);
}

.tagihan-modal-dialog {
  position: relative;
  z-index: 1;
  width: min(1080px, 100%);
  max-height: min(92vh, 880px);
  background: #F8FAFC;
  border-radius: 24px;
  box-shadow: 0 40px 80px rgba(15, 23, 42, .16), 0 0 0 1px rgba(15, 23, 42, .04);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.tagihan-modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 5;
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 12px;
  background: #fff;
  color: #64748B;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(15, 23, 42, .08);
  transition: background .15s ease, color .15s ease, transform .15s ease;
}
.tagihan-modal-close:hover {
  background: #F1F5F9;
  color: #0F172A;
  transform: scale(1.04);
}

.tagihan-modal-body {
  overflow: auto;
  padding: 0;
}

.tagihan-modal-loading,
.tagihan-modal-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 64px 24px;
  text-align: center;
  color: #64748B;
  font-size: 14px;
}
.tagihan-modal-error { color: #DC2626; }

.tagihan-modal-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid #E2E8F0;
  border-top-color: var(--red);
  border-radius: 50%;
  animation: tm-spin .7s linear infinite;
}
@keyframes tm-spin { to { transform: rotate(360deg); } }

/* ── KATALOG PRODUCT MODAL (template) ── */
.catalog-product-modal .tagihan-modal-backdrop {
  background: rgba(15, 23, 42, .38);
  backdrop-filter: blur(8px);
}

.catalog-product-modal .tagihan-modal-dialog {
  width: min(1040px, calc(100% - 2rem));
  max-height: min(94vh, 960px);
  background: #fff;
  border-radius: 24px;
  border: none;
  box-shadow: 0 24px 48px rgba(15, 23, 42, .14), 0 0 0 1px rgba(15, 23, 42, .04);
  overflow: hidden;
}

.catalog-product-modal .tagihan-modal-body {
  background: #fff;
  padding: 0;
}

.catalog-product-modal .tagihan-modal-close {
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(8px);
  border: none;
  color: #64748b;
  box-shadow: 0 2px 10px rgba(15, 23, 42, .08);
}

.catalog-product-modal .tagihan-modal-close:hover {
  background: #fff;
  color: #334155;
  box-shadow: 0 4px 14px rgba(15, 23, 42, .1);
}

.pd-modal-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #fff;
}

.pd-modal-body {
  display: flex;
  align-items: stretch;
  min-height: 460px;
}

.pd-modal-media {
  width: 420px;
  flex-shrink: 0;
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  position: relative;
  align-self: stretch;
}

.pd-modal-stock {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 2;
  font-size: 11px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 999px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, .08);
  backdrop-filter: blur(8px);
}

.pd-modal-stock--ok {
  background: #EAF3DE;
  color: #3B6D11;
}

.pd-modal-stock--low {
  background: #FEF3C7;
  color: #92400E;
}

.pd-modal-stock--crit {
  background: #FEE2E2;
  color: #991B1B;
}

.pd-modal-like {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  width: 36px;
  height: 36px;
  padding: 0;
  background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(8px);
  border: none;
  border-radius: 999px;
  cursor: pointer;
  color: #94a3b8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(15, 23, 42, .08);
  transition: color .15s ease, transform .15s ease, box-shadow .15s ease;
}

.pd-modal-like:hover {
  color: #E24B4A;
  transform: scale(1.04);
  box-shadow: 0 4px 12px rgba(15, 23, 42, .1);
}

.pd-modal-like:hover,
.pd-modal-like.liked {
  color: #E24B4A;
}

.pd-modal-like svg {
  pointer-events: none;
  width: 20px;
  height: 20px;
}

.pd-modal-media-visual {
  position: relative;
  flex: 1;
  width: 100%;
  height: 100%;
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border-radius: 20px;
  border: 1px solid rgba(15, 23, 42, .06);
  box-shadow: 0 8px 24px rgba(15, 23, 42, .08);
  overflow: hidden;
}

.pd-modal-media-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  background: #fff;
}

.pd-modal-media-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-height: 320px;
  color: #94a3b8;
  background: linear-gradient(180deg, #fff 0%, #f8fafc 100%);
}

.pd-modal-detail {
  flex: 1;
  min-width: 0;
  padding: 2rem 2.25rem 1.75rem;
  display: flex;
  flex-direction: column;
  background: #fff;
}

.pd-modal-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.pd-modal-tag {
  font-size: 11px;
  font-weight: 600;
  background: #f1f5f9;
  color: #64748b;
  padding: 4px 12px;
  border-radius: 999px;
}

.pd-modal-tag--brand {
  background: #FCEBEB;
  color: #A32D2D;
}

.pd-modal-sku {
  font-size: 11px;
  color: #9ca3af;
  margin: 0 0 8px;
  font-family: ui-monospace, 'SF Mono', monospace;
}

.pd-modal-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 1.25rem;
}

.pd-modal-title {
  flex: 1;
  min-width: 0;
  font-size: 24px;
  font-weight: 500;
  margin: 0;
  color: #111827;
  line-height: 1.35;
}

.pd-modal-price-badge {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  padding: 10px 18px;
  border-radius: 14px;
  background: linear-gradient(135deg, #fff5f5 0%, #feecec 100%);
  border: 1px solid rgba(226, 75, 74, .2);
  box-shadow: 0 4px 16px rgba(226, 75, 74, .12);
  font-size: 22px;
  font-weight: 700;
  color: #E24B4A;
  line-height: 1;
  white-space: nowrap;
  letter-spacing: -.01em;
}

.pd-modal-descbox {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 16px 18px;
  margin-bottom: 1.25rem;
}

.pd-modal-desc-label {
  font-size: 11px;
  color: #64748b;
  margin: 0 0 12px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.pd-modal-desc {
  margin: 0;
}

.pd-modal-desc p {
  font-size: 14px;
  color: #64748b;
  line-height: 1.75;
  margin: 0 0 12px;
}

.pd-modal-desc p:last-child {
  margin-bottom: 0;
}

.pd-modal-features {
  display: flex;
  gap: 10px;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.pd-modal-feature {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px 7px 7px;
  border-radius: 999px;
  background: #f8fafc;
  border: 1px solid #e8edf2;
  font-size: 12px;
  font-weight: 600;
  color: #475569;
  line-height: 1;
}

.pd-modal-feature-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid #e2e8f0;
  color: #64748b;
  flex-shrink: 0;
}

.pd-modal-feature-icon svg {
  width: 13px;
  height: 13px;
}

.pd-modal-feature-icon--stock {
  color: #059669;
  background: #ecfdf5;
  border-color: #bbf7d0;
}

.pd-modal-feature-text {
  padding-right: 2px;
}

.pd-modal-blocked {
  margin-top: auto;
  padding: 12px 14px;
  border-radius: 8px;
  background: #FEF2F2;
  border: .5px solid #FECACA;
  font-size: 13px;
  color: #991B1B;
  line-height: 1.5;
}

.pd-modal-cart-form {
  margin-top: auto;
}

.pd-modal-cart-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.pd-modal-qty-label {
  font-size: 11px;
  color: #6b7280;
  margin: 0;
  font-weight: 500;
}

.pd-modal-qty {
  display: flex;
  align-items: center;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}

.pd-modal-qty-btn {
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 18px;
  color: #374151;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
}

.pd-modal-qty-btn:hover {
  background: #f9fafb;
  color: #111827;
}

.pd-modal-qty-input {
  min-width: 44px;
  width: 44px;
  height: 40px;
  border: none;
  border-left: .5px solid #e5e7eb;
  border-right: .5px solid #e5e7eb;
  text-align: center;
  font-size: 15px;
  font-weight: 500;
  color: #111827;
  background: #fff;
  font-family: inherit;
  padding: 0;
  -moz-appearance: textfield;
}

.pd-modal-qty-input::-webkit-outer-spin-button,
.pd-modal-qty-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.pd-modal-add-btn {
  flex: 1;
  min-width: 200px;
  height: 42px;
  background: #E24B4A;
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  transition: background .15s ease, transform .15s ease, box-shadow .15s ease;
  box-shadow: 0 4px 14px rgba(226, 75, 74, .24);
}

.pd-modal-add-btn:hover {
  background: #D43F3E;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(226, 75, 74, .28);
}

.pd-modal-footer {
  border-top: 1px solid #f1f5f9;
  padding: 16px 2.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.75rem;
  background: #fafbfc;
  flex-wrap: wrap;
}

.pd-modal-footer span {
  font-size: 13px;
  color: #6b7280;
}

.pd-modal-footer span::before {
  margin-right: 4px;
}

.pd-modal-footer span:nth-child(1)::before { content: '🚚'; }
.pd-modal-footer span:nth-child(2)::before { content: '📦'; }
.pd-modal-footer span:nth-child(3)::before { content: '🏅'; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.pd-modal-loaded .pd-modal-card {
  animation: pd-modal-in .35s cubic-bezier(.22, 1, .36, 1) both;
}

@keyframes pd-modal-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 700px) {
  .catalog-product-modal .tagihan-modal-dialog {
    width: min(100%, calc(100% - 1rem));
    max-height: 94vh;
    border-radius: 20px;
  }

  .pd-modal-body {
    flex-direction: column;
    min-height: 0;
  }

  .pd-modal-media {
    width: 100%;
    min-height: 0;
    padding: 1rem 1rem 0;
    background: #f8fafc;
  }

  .pd-modal-media-visual {
    min-height: 260px;
    border-radius: 18px;
  }

  .pd-modal-detail {
    padding: 1.25rem 1.25rem 1.5rem;
  }

  .pd-modal-heading {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }

  .pd-modal-price-badge {
    align-self: flex-end;
    font-size: 20px;
    padding: 9px 16px;
  }

  .pd-modal-cart-row {
    flex-direction: column;
    align-items: stretch;
  }

  .pd-modal-add-btn {
    width: 100%;
  }

  .pd-modal-footer {
    padding: 12px 1.25rem;
    gap: 10px;
    justify-content: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pd-modal-loaded .pd-modal-card {
    animation: none;
  }
}

/* Modal inner layout (.tm) */
.tm { display: flex; flex-direction: column; min-height: 100%; }

.tm-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 64px 20px 24px;
  background: #fff;
  border-bottom: 1px solid #EEF2F7;
}
.tm-header-main { min-width: 0; flex: 1; }
.tm-eyebrow {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #94A3B8;
  margin-bottom: 6px;
}
.tm-title {
  margin: 0;
  font-size: clamp(17px, 2vw, 22px);
  font-weight: 700;
  color: #0F172A;
  line-height: 1.35;
  word-break: break-word;
}
.tm-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.tm-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  color: #475569;
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
}
.tm-chip svg { flex-shrink: 0; opacity: .75; }
.tm-chip-link {
  text-decoration: none;
  color: #b91c1c;
  background: #fef2f2;
  border-color: #fecaca;
}
.tm-chip-link:hover { background: #fee2e2; }

.tm-grid {
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 16px;
  padding: 16px;
  align-items: start;
}

.tm-panel {
  background: #fff;
  border: 1px solid #E8EDF3;
  border-radius: 18px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
  overflow: hidden;
}
.tm-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 16px 18px 12px;
}
.tm-panel-head.compact { padding-top: 18px; }
.tm-panel-head h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: #0F172A;
}
.tm-panel-head span {
  font-size: 12px;
  color: #94A3B8;
  font-weight: 600;
}

.tm-table-wrap {
  max-height: 320px;
  overflow: auto;
  border-top: 1px solid #EEF2F7;
  border-bottom: 1px solid #EEF2F7;
}
.tm-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.tm-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #F8FAFC;
  padding: 10px 14px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #94A3B8;
  border-bottom: 1px solid #EEF2F7;
}
.tm-table tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid #F1F5F9;
  color: #334155;
  vertical-align: top;
}
.tm-table tbody tr:last-child td { border-bottom: none; }
.tm-table tbody tr:hover { background: #FAFCFF; }
.tm-product-name { font-weight: 600; color: #0F172A; line-height: 1.4; }
.tm-product-code { font-size: 11px; color: #94A3B8; margin-top: 2px; }
.tm-qty {
  display: inline-flex;
  min-width: 28px;
  justify-content: center;
  padding: 2px 8px;
  border-radius: 8px;
  background: #F1F5F9;
  font-weight: 700;
  font-size: 12px;
}
.tm-subtotal { font-weight: 700; color: #0F172A; white-space: nowrap; }

.tm-table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  background: #F8FAFC;
  font-size: 13px;
  color: #64748B;
}
.tm-table-footer strong {
  font-size: 16px;
  color: #0F172A;
}

.tm-history { border-top: 1px solid #EEF2F7; }
.tm-history-row {
  padding: 12px 18px;
  border-bottom: 1px solid #F1F5F9;
}
.tm-history-row:last-child { border-bottom: none; }
.tm-history-row div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}
.tm-history-row strong { color: #0F172A; font-size: 14px; }
.tm-history-row span { font-size: 12px; color: #94A3B8; }
.tm-history-row p { margin: 6px 0 0; font-size: 12px; color: #64748B; line-height: 1.45; }

.tm-panel-pay { display: flex; flex-direction: column; }

.tm-pay-breakdown {
  margin: 0 16px 14px;
  padding: 14px 16px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid #E8EDF3;
}
.tm-pay-breakdown-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #94A3B8;
  margin-bottom: 12px;
}
.tm-pay-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 0;
  font-size: 13px;
  color: #64748B;
  border-bottom: 1px dashed #EEF2F7;
}
.tm-pay-row:last-child { border-bottom: none; }
.tm-pay-row strong {
  color: #0F172A;
  font-size: 13px;
  font-weight: 700;
  text-align: right;
}
.tm-pay-row-total {
  margin-top: 4px;
  padding-top: 12px;
  border-top: 1px solid #E2E8F0;
  border-bottom: none;
}
.tm-pay-row-total span {
  font-weight: 600;
  color: #334155;
}
.tm-pay-row-total strong { font-size: 16px; }

.tm-pay-hero {
  margin: 0 16px 14px;
  padding: 0 2px;
}
.tm-pay-hero-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #64748B;
}
.tm-pay-hero-amount {
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -.02em;
}
.tm-pay-hero-amount.is-due { color: #DC2626; }
.tm-pay-hero-amount.is-ok { color: #059669; font-size: 28px; }
.tm-pay-hero-amount.is-purple { color: #7C3AED; }

.tm-pay-progress { margin-top: 0; }
.tm-pay-progress-track {
  height: 8px;
  background: #FEE2E2;
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 8px;
}
.tm-pay-progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #F87171, var(--red));
}
.tm-pay-progress span {
  font-size: 11px;
  color: #64748B;
  line-height: 1.4;
}

.tm-alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0 16px 14px;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.45;
}
.tm-alert svg { flex-shrink: 0; margin-top: 1px; }
.tm-alert.is-warn { background: #FFFBEB; color: #92400E; border: 1px solid #FDE68A; }
.tm-alert.is-danger { background: #FEF2F2; color: #991B1B; border: 1px solid #FECACA; }
.tm-alert.is-ok { background: #ECFDF5; color: #065F46; border: 1px solid #A7F3D0; }
.tm-alert.is-purple { background: #F5F3FF; color: #5B21B6; border: 1px solid #DDD6FE; }

.tm-pay-section {
  margin: 0 16px 16px;
  padding: 16px;
  border-radius: 14px;
  background: #F8FAFC;
  border: 1px solid #E8EDF3;
}
.tm-pay-section-head { margin-bottom: 14px; }
.tm-pay-section-head p {
  margin: 8px 0 0;
  font-size: 12px;
  color: #64748B;
  line-height: 1.5;
}
.tm-pay-badge {
  display: inline-flex;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
}
.tm-pay-badge.online { background: #FEE2E2; color: #B91C1C; }
.tm-pay-badge.manual { background: #E0F2FE; color: #0369A1; }

.tm-btn-primary,
.tm-btn-secondary {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 16px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  border: none;
  transition: transform .15s ease, box-shadow .15s ease, opacity .15s ease;
}
.tm-btn-primary {
  background: var(--red);
  color: #fff;
  box-shadow: 0 8px 20px rgba(220, 38, 38, .22);
  text-decoration: none;
}
.tm-btn-primary:hover { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(220, 38, 38, .28); }
.tm-btn-primary:disabled,
.tm-btn-primary.is-loading { opacity: .7; cursor: wait; transform: none; }
.tm-btn-invoice { margin-top: 12px; }
.tm-btn-secondary {
  background: #fff;
  color: #0F172A;
  border: 1px solid #CBD5E1;
}
.tm-btn-secondary:hover { background: #F8FAFC; }

.tm-form { display: flex; flex-direction: column; gap: 12px; }
.tm-field { display: flex; flex-direction: column; gap: 6px; }
.tm-field span {
  font-size: 12px;
  font-weight: 600;
  color: #475569;
}
.tm-file,
.tm-input,
.tm-textarea {
  width: 100%;
  border: 1px solid #CBD5E1;
  border-radius: 10px;
  background: #fff;
  font-family: inherit;
  font-size: 13px;
  color: #0F172A;
}
.tm-file { padding: 10px; }
.tm-input {
  padding: 10px 12px;
}
.tm-input-rp {
  display: flex;
  align-items: stretch;
  border: 1px solid #CBD5E1;
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
}
.tm-input-rp:focus-within {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, .12);
}
.tm-input-rp-prefix {
  display: flex;
  align-items: center;
  padding-left: 12px;
  font-size: 13px;
  font-weight: 600;
  color: #64748B;
  flex-shrink: 0;
  user-select: none;
}
.tm-input-rp-field {
  border: none !important;
  box-shadow: none !important;
  flex: 1;
  min-width: 0;
  padding-left: 6px;
}
.tm-input-rp-field:focus {
  outline: none;
  box-shadow: none !important;
}
.tm-textarea {
  padding: 10px 12px;
  min-height: 72px;
  resize: vertical;
}
.tm-file:focus,
.tm-input:focus,
.tm-textarea:focus {
  outline: none;
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, .12);
}

.tm-pay-note {
  margin: 10px 0 0;
  font-size: 12px;
  color: #64748B;
  text-align: center;
}
.tm-pay-note.tm-pay-note-hint {
  margin: 6px 0 24px;
  text-align: left;
}

.tm-pay-note.error { color: #DC2626; }

.tm-pay-history {
  margin: 0 16px 14px;
  padding: 14px 16px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid #E8EDF3;
}

.tm-pay-history-row + .tm-pay-history-row {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed #EEF2F7;
}

.tm-pay-history-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.tm-pay-history-top strong {
  font-size: 14px;
  color: #0F172A;
}

.tm-pay-history-meta {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: #94A3B8;
}

.tm-pay-history-note {
  margin: 6px 0 0;
  font-size: 12px;
  color: #64748B;
  line-height: 1.45;
}

.tm-pay-history-note.is-danger {
  color: #DC2626;
}

.tm-pay-history-row .status-pill {
  flex-shrink: 0;
  font-size: 10px;
  padding: 3px 8px;
}

.tm-pay-history-row .po-modal-link {
  display: inline-block;
  margin-top: 6px;
  font-size: 12px;
}

/* ── TAGIHAN MODAL ANIMATIONS ── */
.tagihan-modal-backdrop {
  opacity: 0;
  transition: opacity .22s ease;
}

.tagihan-modal-dialog {
  opacity: 0;
  transform: scale(.96) translateY(16px);
  transition:
    opacity .22s cubic-bezier(.22, 1, .36, 1),
    transform .22s cubic-bezier(.22, 1, .36, 1);
}

.tagihan-modal.is-open .tagihan-modal-backdrop { opacity: 1; }

.tagihan-modal.is-open .tagihan-modal-dialog {
  opacity: 1;
  transform: scale(1) translateY(0);
}

.tm-header {
  background: linear-gradient(180deg, #fff 0%, #FAFCFF 100%);
}

.tm-panel-animate {
  opacity: 0;
  transform: translateY(14px);
  transition:
    opacity .45s cubic-bezier(.22, 1, .36, 1),
    transform .45s cubic-bezier(.22, 1, .36, 1);
  transition-delay: var(--panel-delay, 0ms);
}

.tm-loaded .tm-panel-animate {
  opacity: 1;
  transform: translateY(0);
}

.tm-loaded .tm-header {
  animation: tm-header-in .4s cubic-bezier(.22, 1, .36, 1) both;
}

@keyframes tm-header-in {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.tm-pay-progress-fill {
  transition: width 1s cubic-bezier(.22, 1, .36, 1);
  position: relative;
  overflow: hidden;
}

.tm-loaded .tm-pay-progress-fill::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .35), transparent);
  animation: tagihan-shine 2s ease-in-out 1;
}

.tm-btn-primary,
.tm-btn-secondary {
  transition:
    transform .2s ease,
    box-shadow .2s ease,
    opacity .15s ease;
}

.tm-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(220, 38, 38, .28);
}

.tm-btn-secondary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(15, 23, 42, .08);
}

@media (prefers-reduced-motion: reduce) {
  .tagihan-page .tagihan-reveal,
  .tagihan-progress-bar,
  .tm-panel-animate,
  .tm-loaded .tm-header,
  .tagihan-empty,
  .tagihan-empty-icon {
    animation: none !important;
    transition: none !important;
    transform: none !important;
    opacity: 1 !important;
  }

  .tagihan-page.is-ready .tagihan-progress-bar,
  .tm-pay-progress-fill {
    width: var(--progress, auto) !important;
  }

  .tagihan-modal-backdrop,
  .tagihan-modal-dialog {
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}

@media (max-width: 900px) {
  .tagihan-hero-highlight { width: 100%; text-align: left; }
  .tagihan-period-bar { flex-direction: column; align-items: stretch; }
  .tagihan-period-bar--combined .tagihan-segment { margin-left: 0; width: 100%; }
  .tagihan-period-bar .tagihan-period-hint { white-space: normal; }
  .tagihan-toolbar-top { flex-direction: column; align-items: stretch; }
  .tagihan-period-hint { white-space: normal; }
  .tagihan-filter-apply { width: 100%; }
  .tagihan-segment { width: 100%; }
  .tagihan-segment-item { flex: 1; justify-content: center; }
  .tagihan-summary-grid { grid-template-columns: 1fr; }
  .tagihan-list { grid-template-columns: 1fr; }
  .tagihan-card-amounts { grid-template-columns: 1fr 1fr; }
  .tm-grid { grid-template-columns: 1fr; padding: 12px; }
  .tm-header { padding: 18px 56px 16px 16px; }
  .tagihan-modal-dialog { max-height: 94vh; border-radius: 18px; }
  .tagihan-modal-close { top: 12px; right: 12px; }
}

@media (max-width: 1200px) and (min-width: 901px) {
  .tagihan-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tagihan-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .tagihan-card-head { flex-direction: column; gap: 8px; }
  .tagihan-card-amounts { grid-template-columns: 1fr; }
}

/* ── ACCOUNT PAGE (pesanan / profil / suka / notifikasi / voucher) ── */
.account-page {
  background: var(--surface);
}
.account-sidebar {
  background: var(--surface2);
  border-right: 1px solid var(--border);
  position: sticky;
  top: 64px;
  height: calc(100vh - 105px);
  overflow-y: auto;
  padding: 20px 16px;
}
.account-sidebar-toggle {
  display: none;
}
.account-sidebar-profile {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
  padding: 8px 8px 20px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 14px;
}
.account-sidebar-avatar {
  width: 88px;
  height: 88px;
  border-radius: 999px;
  border: 2px solid #fecaca;
  background: #fff;
  padding: 12px;
  object-fit: contain;
  box-shadow: 0 4px 14px rgba(220, 38, 38, 0.12);
}
.account-sidebar-avatar.is-photo {
  padding: 0;
  object-fit: cover;
}
.account-sidebar-name {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
  word-break: break-word;
}
.account-sidebar-email {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--muted, #6b7280);
  word-break: break-all;
}
.account-sidebar-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin-top: 8px;
}
.account-sidebar-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  background: #f3f4f6;
  color: #4b5563;
}
.account-sidebar-badge.ok {
  background: #ecfdf5;
  color: #047857;
}
.account-sidebar-badge.muted {
  background: #f3f4f6;
  color: #9ca3af;
}
.account-sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.account-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border-radius: 12px;
  color: #374151;
  text-decoration: none;
  font-size: 13px;
  font-weight: 550;
  transition: background 0.15s ease, color 0.15s ease;
}
.account-nav-item:hover {
  background: #fff;
  color: #111827;
}
.account-nav-item.is-active {
  background: #fef2f2;
  color: #b91c1c;
  font-weight: 700;
}
.account-nav-icon {
  display: grid;
  place-items: center;
  width: 20px;
  color: inherit;
  flex-shrink: 0;
}
.account-nav-label {
  flex: 1;
  min-width: 0;
}
.account-nav-count {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: #dc2626;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: grid;
  place-items: center;
}
.account-main {
  padding: 28px 32px 40px;
  background: var(--surface);
  min-width: 0;
}
.account-content-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.account-action-btn {
  border: 1px solid var(--border);
  background: #fff;
  color: #374151;
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.account-action-btn:hover {
  border-color: #fca5a5;
  color: #b91c1c;
}
.account-action-btn--ghost {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-color: transparent;
  background: transparent;
  color: #64748b;
  padding: 6px 8px;
}
.account-action-btn--ghost:hover {
  border-color: transparent;
  background: #f8fafc;
  color: #0f172a;
}
.notif-unread-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: #fee2e2;
  color: #b91c1c;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}
.notif-page .likes-header {
  margin-bottom: 18px;
}
.account-notif-list {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
  overflow: hidden;
}
.account-notif-item {
  display: flex;
  gap: 12px;
  padding: 16px 18px;
  border: 0;
  border-bottom: 1px solid #f1f5f9;
  border-radius: 0;
  background: #fff;
  text-decoration: none;
  color: inherit;
  transition: background 0.15s ease;
}
.account-notif-item:last-child {
  border-bottom: 0;
}
.account-notif-item:hover {
  background: #f8fafc;
  box-shadow: none;
}
.account-notif-item.is-unread {
  background: #fff;
}
.account-notif-item.is-unread:hover {
  background: #fafafa;
}
.account-notif-item.is-read .account-notif-top strong {
  font-weight: 500;
  color: #334155;
}
.account-notif-item.is-read .account-notif-body p {
  color: #94a3b8;
}
.account-notif-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: transparent;
  margin-top: 7px;
  flex-shrink: 0;
}
.account-notif-item.is-unread .account-notif-dot {
  background: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12);
}
.account-notif-body {
  min-width: 0;
  flex: 1;
}
.account-notif-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}
.account-notif-top strong {
  font-size: 14px;
  font-weight: 600;
  color: #0f172a;
  letter-spacing: -0.01em;
}
.account-notif-top time {
  font-size: 11px;
  color: #94a3b8;
  flex-shrink: 0;
  white-space: nowrap;
}
.account-notif-body p {
  margin: 4px 0 0;
  font-size: 13px;
  color: #64748b;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.notif-empty {
  border: 1px dashed #e2e8f0;
  border-radius: 14px;
  background: #fff;
  padding: 48px 24px;
}
.notif-empty-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 14px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: #f8fafc;
  color: #94a3b8;
  border: 1px solid #eef2f7;
}
.notif-empty h2 {
  font-size: 16px;
  font-weight: 600;
  color: #0f172a;
}
.notif-empty p {
  color: #94a3b8;
}
@media (max-width: 640px) {
  .account-notif-item {
    padding: 14px 14px;
  }
  .account-notif-top {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
}
.profile-page--embedded,
.likes-page--embedded {
  min-height: 0;
  padding: 0;
  background: transparent;
}
.account-page .cart-page--embedded {
  min-height: 0;
  padding: 0;
  background: transparent;
}
.account-page .checkout-page--embedded {
  min-height: 0;
  padding: 0;
  background: transparent;
}
.account-page .order-page--embedded.order-detail-page {
  min-height: 0;
  padding: 0;
  background: transparent;
}
.account-page .order-page--embedded .order-detail-inner,
.account-page .order-page--embedded .tagihan-flash {
  position: relative;
  z-index: 1;
}
.account-page .checkout-page--embedded .checkout-info,
.account-page .checkout-page--embedded .tagihan-flash,
.account-page .checkout-page--embedded .cart-layout {
  position: relative;
  z-index: 1;
}
.checkout-item-readonly {
  grid-template-columns: 96px 1fr auto !important;
  align-items: center;
}
.checkout-item-readonly .cart-item-accent {
  display: none;
}
.checkout-item-readonly .cart-item-subtotal {
  justify-self: end;
  text-align: right;
}
@media (max-width: 900px) {
  .checkout-item-readonly {
    grid-template-columns: 80px 1fr !important;
    grid-template-areas:
      "thumb info"
      "thumb subtotal" !important;
  }
  .checkout-item-readonly .cart-item-thumb { grid-area: thumb; }
  .checkout-item-readonly .cart-item-info { grid-area: info; }
  .checkout-item-readonly .cart-item-subtotal {
    grid-area: subtotal;
    text-align: left;
    justify-self: start;
  }
}
.cart-account-header {
  position: relative;
  z-index: 1;
  margin-bottom: 18px;
  align-items: flex-start;
}
.cart-account-header .cart-hero-stats {
  align-self: flex-start;
}
.account-page .cart-page--embedded .cart-layout {
  position: relative;
  z-index: 1;
}
.account-page .cart-page--embedded .tagihan-flash {
  position: relative;
  z-index: 1;
  margin-bottom: 14px;
}
.account-page .cart-page--embedded .cart-empty .btn-primary {
  display: inline-flex;
  margin-top: 8px;
}
.profile-page--embedded .profile-grid {
  display: grid;
  grid-template-columns: minmax(240px, 320px) minmax(0, 1fr);
  gap: 16px;
  align-items: stretch;
  max-width: none;
}
.profile-page--embedded .profile-hero,
.profile-page--embedded .profile-panel {
  height: 100%;
  margin: 0;
}
.profile-hero-main--stack {
  flex-direction: column;
  align-items: center;
  text-align: center;
  border-bottom: none;
  padding: 28px 24px 20px;
}
.profile-hero-info--center {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.profile-hero-badges--center {
  justify-content: center;
}
.profile-avatar-wrap--lg,
.profile-hero-avatar--lg {
  width: 96px;
  height: 96px;
}
.profile-avatar-wrap--lg .profile-avatar-upload {
  border-radius: 18px;
}
.profile-hero-avatar--lg {
  border-radius: 18px;
}
.profile-row-value--wrap {
  white-space: normal;
  line-height: 1.45;
}
@media (max-width: 900px) {
  .profile-page--embedded .profile-grid {
    grid-template-columns: 1fr;
  }
  .profile-info-grid {
    grid-template-columns: 1fr;
  }
}
.account-page .pesanan-page.orders-page,
.account-page .tagihan-page {
  min-height: 0;
}
.account-page .tagihan-page-bg {
  display: none;
}

@media (max-width: 900px) {
  .account-sidebar {
    position: static;
    height: auto;
    overflow: visible;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 12px 16px;
  }
  .account-sidebar-toggle {
    display: flex;
  }
  .account-sidebar-panel {
    display: none;
    padding-top: 14px;
  }
  .account-sidebar.is-open .account-sidebar-panel {
    display: block;
  }
  .account-sidebar.is-open .filter-toggle-chevron {
    transform: rotate(180deg);
  }
  .account-main {
    padding: 20px 16px 32px;
  }
  .account-sidebar-profile {
    flex-direction: row;
    text-align: left;
    align-items: center;
  }
  .account-sidebar-avatar {
    width: 64px;
    height: 64px;
  }
  .account-sidebar-badges {
    justify-content: flex-start;
  }
}

/* ── PESANAN RESELLER (premium, shared tagihan tokens) ── */
.pesanan-page.orders-page {
  position: relative;
  background: transparent;
}

.pesanan-order-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.po-order {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.po-order.is-overdue {
  border-color: #fecaca;
}

.po-order.is-due-soon {
  border-color: #fde68a;
}

.po-order.is-lunas {
  border-color: #86efac;
  box-shadow: 0 1px 3px rgba(16, 185, 129, 0.08);
}

.po-order-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-bottom: 1px solid #f1f5f9;
}

.po-order-shop {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
}

.po-order-shop-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #fef2f2;
  color: #dc2626;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.po-order-shop-meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.po-order-shop-meta strong {
  font-size: 13px;
  font-weight: 700;
  color: #111827;
}

.po-order-shop-meta span {
  font-size: 11px;
  color: #94a3b8;
}

.po-order-due {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin-top: 2px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
  color: #475569;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
}

.po-order-due.is-due-soon {
  color: #b45309;
  background: #fffbeb;
  border-color: #fde68a;
}

.po-order-due.is-overdue {
  color: #b91c1c;
  background: #fef2f2;
  border-color: #fecaca;
}

.po-order-status {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  text-align: right;
  flex-shrink: 0;
  max-width: 48%;
}

.po-order-status-hint {
  font-size: 12px;
  color: #64748b;
  line-height: 1.35;
}

.po-order-status-hint.ok { color: #059669; }
.po-order-status-hint.warn { color: #d97706; }
.po-order-status-hint.danger { color: #dc2626; }
.po-order-status-hint.muted { color: #94a3b8; }
.po-order-status-hint.info { color: #2563eb; }

.po-order-status-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #dc2626;
  text-transform: uppercase;
}

.po-order-status-label.ok { color: #059669; }
.po-order-status-label.warn { color: #d97706; }
.po-order-status-label.danger { color: #dc2626; }
.po-order-status-label.muted { color: #94a3b8; }
.po-order-status-label.info { color: #2563eb; }

.po-order-items {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px 16px;
}

.po-order-item {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: flex-start;
}

.po-order-item--empty {
  grid-template-columns: 1fr;
  color: #94a3b8;
  font-size: 13px;
}

.po-order-thumb {
  width: 64px;
  height: 64px;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  background: #f8fafc;
  overflow: hidden;
  flex-shrink: 0;
}

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

.po-order-thumb-fallback {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: #cbd5e1;
}

.po-order-item-info {
  min-width: 0;
}

.po-order-item-name {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: #111827;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.po-order-item-sku,
.po-order-item-qty {
  margin: 3px 0 0;
  font-size: 12px;
  color: #94a3b8;
}

.po-order-item-price {
  font-size: 13px;
  font-weight: 600;
  color: #111827;
  white-space: nowrap;
}

.po-order-more {
  border: none;
  background: transparent;
  color: #64748b;
  font-size: 12px;
  font-weight: 600;
  padding: 0;
  cursor: pointer;
  text-align: left;
  width: fit-content;
}

.po-order-more:hover {
  color: #dc2626;
}

.po-order-total {
  display: flex;
  justify-content: flex-end;
  align-items: baseline;
  gap: 8px;
  padding: 0 16px 14px;
  border-bottom: 1px solid #f1f5f9;
}

.po-order-total span {
  font-size: 13px;
  color: #64748b;
}

.po-order-total strong {
  font-size: 18px;
  font-weight: 700;
  color: #dc2626;
}

.po-order-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px 14px;
  flex-wrap: wrap;
}

.po-order-foot-note {
  font-size: 12px;
  color: #64748b;
  line-height: 1.4;
  min-width: 0;
  flex: 1;
}

.po-order-foot-note strong {
  color: #dc2626;
  font-weight: 700;
}

.po-order-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.po-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.po-btn-secondary {
  border: 1px solid #d1d5db;
  background: #fff;
  color: #374151;
}

.po-btn-secondary:hover {
  border-color: #fca5a5;
  color: #b91c1c;
}

.po-btn-primary {
  border: 1px solid #dc2626;
  background: #dc2626;
  color: #fff;
}

.po-btn-primary:hover {
  background: #b91c1c;
  border-color: #b91c1c;
}

@media (max-width: 640px) {
  .po-order-head {
    flex-direction: column;
    align-items: stretch;
  }
  .po-order-status {
    align-items: flex-start;
    text-align: left;
    max-width: none;
  }
  .po-order-item {
    grid-template-columns: 56px minmax(0, 1fr);
  }
  .po-order-item-price {
    grid-column: 2;
  }
  .po-order-foot {
    flex-direction: column;
    align-items: stretch;
  }
  .po-order-actions {
    width: 100%;
  }
  .po-order-actions .po-btn {
    flex: 1;
    text-align: center;
  }
}

.pesanan-card {
  cursor: default;
}

.pesanan-card .tagihan-card-actions {
  margin-top: 4px;
}

.po-modal-link {
  color: var(--red);
  font-weight: 600;
  text-decoration: none;
}

.po-modal-link:hover {
  text-decoration: underline;
}

.tm-history-row .status-pill {
  margin-top: 6px;
}

.pesanan-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
  flex-wrap: wrap;
}

.pesanan-card-alerts {
  min-width: 0;
  flex: 1;
}

.pesanan-alert {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.3;
  background: rgba(255, 255, 255, .78);
  color: #64748B;
  border: 1px solid rgba(255, 255, 255, .92);
  backdrop-filter: blur(4px);
}

.pesanan-alert.warn {
  background: rgba(255, 251, 235, .92);
  color: #B45309;
  border-color: rgba(253, 230, 138, .85);
}

.pesanan-alert.danger {
  background: rgba(254, 242, 242, .92);
  color: #B91C1C;
  border-color: rgba(254, 202, 202, .85);
}

.pesanan-card-link {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--red);
  transition: transform .2s ease, opacity .2s ease;
}

.pesanan-card:hover .pesanan-card-link {
  transform: translateX(2px);
}

.pesanan-card .pesanan-card-foot {
  margin-bottom: 0;
}

.pesanan-page .pagination-wrap {
  margin-top: 20px;
}

.pesanan-page .cart-empty-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

/* ── KERANJANG ENHANCED UI & ANIMATIONS ── */
.cart-page {
  position: relative;
}

.cart-page-bg {
  position: absolute;
  inset: 0 -16px 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 70% 45% at 8% 0%, rgba(248, 113, 113, .14), transparent 55%),
    radial-gradient(ellipse 55% 40% at 95% 5%, rgba(220, 38, 38, .08), transparent 50%),
    linear-gradient(180deg, #FFF5F5 0%, #fff 100%);
  background-color: #fff;
}

.cart-page > :not(.cart-page-bg) {
  position: relative;
  z-index: 1;
}

.cart-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}

.cart-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  margin-bottom: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .9);
  border: 1px solid rgba(254, 202, 202, .55);
  color: var(--red);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .02em;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}

.cart-hero-title {
  background: linear-gradient(135deg, #0F172A 0%, #334155 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.cart-hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-self: center;
}

.cart-hero-stat {
  min-width: 110px;
  padding: 12px 16px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid var(--border);
  box-shadow: 0 2px 8px rgba(15, 23, 42, .04);
  transition: transform .25s ease, box-shadow .25s ease;
}

.cart-hero-stat:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(15, 23, 42, .07);
}

.cart-hero-stat.highlight {
  border-color: #FECACA;
  background: linear-gradient(145deg, #FFF5F5 0%, #fff 100%);
}

.cart-hero-stat .label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
  margin-bottom: 4px;
}

.cart-hero-stat strong {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

.cart-hero-stat.highlight strong { color: var(--red); }

.cart-page .cart-reveal {
  opacity: 0;
  transform: translateY(16px);
  transition:
    opacity .5s cubic-bezier(.22, 1, .36, 1),
    transform .5s cubic-bezier(.22, 1, .36, 1);
  transition-delay: var(--reveal-delay, 0ms);
}

.cart-page.is-ready .cart-reveal {
  opacity: 1;
  transform: translateY(0);
}

.cart-page .cart-item {
  position: relative;
  overflow: hidden;
  grid-template-columns: 96px 1fr auto auto auto auto;
  gap: 18px;
  padding: 18px 20px;
  border-radius: 16px;
  transition:
    transform .28s cubic-bezier(.22, 1, .36, 1),
    box-shadow .28s ease,
    border-color .28s ease;
}

.cart-page .cart-item--selectable .cart-item-accent {
  display: none;
}

.cart-page .cart-item--selectable {
  grid-template-columns: 28px 96px 1fr auto auto auto auto;
}

.cart-page .cart-item--selectable:not(.is-selected) {
  opacity: .72;
}

.cart-page .cart-item--selectable.is-selected {
  border-color: #E5E7EB;
  background: #fff;
}

.cart-select-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
}

.cart-select-all {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  user-select: none;
}

.cart-select-all input {
  width: 16px;
  height: 16px;
  accent-color: var(--red);
}

.cart-select-hint {
  font-size: 12px;
  color: var(--muted);
}

.cart-item-check {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.cart-item-check input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.cart-item-check-box {
  width: 18px;
  height: 18px;
  border: 1.5px solid #CBD5E1;
  border-radius: 5px;
  background: #fff;
  display: inline-block;
  position: relative;
  transition: border-color .15s ease, background .15s ease;
}

.cart-item-check input:checked + .cart-item-check-box {
  border-color: var(--red);
  background: var(--red);
}

.cart-item-check input:checked + .cart-item-check-box::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 2px;
  width: 4px;
  height: 8px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.cart-item-check input:focus-visible + .cart-item-check-box {
  box-shadow: 0 0 0 3px rgba(220, 38, 38, .15);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.checkout-submit-btn.disabled,
.checkout-submit-btn:disabled {
  opacity: .55;
  cursor: not-allowed;
  pointer-events: none;
}

.cart-page .cart-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 36px rgba(15, 23, 42, .08);
  border-color: #FECACA;
}

.cart-item-accent {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, #FCA5A5, var(--red));
  transform: scaleY(0);
  transform-origin: top center;
  transition: transform .45s cubic-bezier(.22, 1, .36, 1);
}

.cart-page.is-ready .cart-item-accent {
  transform: scaleY(1);
}

.cart-page .cart-item-thumb {
  width: 96px;
  height: 96px;
  border-radius: 14px;
  transition: transform .25s ease;
}

.cart-page .cart-item:hover .cart-item-thumb {
  transform: scale(1.03);
}

.cart-page .cart-item-price .mini-label,
.cart-page .cart-item-subtotal .mini-label {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 3px;
  font-weight: 500;
}

.cart-page .cart-item-subtotal strong {
  display: block;
  font-size: 17px;
  font-weight: 700;
  color: var(--red);
}

.qty-stepper--modern {
  display: inline-flex;
  align-items: center;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #F9FAFB;
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, .03);
}

.qty-stepper--modern .qty-btn {
  width: 36px;
  height: 38px;
  border: none;
  background: #fff;
  color: var(--text);
  font-size: 18px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
  font-family: inherit;
}

.qty-stepper--modern .qty-btn:hover:not(:disabled) {
  background: #FEF2F2;
  color: var(--red);
}

.qty-stepper--modern .qty-btn:disabled {
  opacity: .35;
  cursor: not-allowed;
}

.qty-stepper--modern input {
  width: 52px;
  height: 38px;
  border: none;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  background: #fff;
}

.cart-page .btn-remove {
  width: 38px;
  height: 38px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  border: 1px solid transparent;
  color: #9CA3AF;
  transition:
    transform .2s ease,
    color .2s ease,
    background .2s ease,
    border-color .2s ease;
}

.cart-page .btn-remove:hover {
  color: #B91C1C;
  background: #FEF2F2;
  border-color: #FECACA;
  transform: scale(1.05);
}

.cart-page .cart-summary {
  position: sticky;
  top: 88px;
  overflow: hidden;
  border-radius: 18px;
  padding: 0;
  border: 1px solid #E8EDF3;
  box-shadow: 0 12px 32px rgba(15, 23, 42, .08);
  transition: transform .3s ease, box-shadow .3s ease;
}

.cart-page .cart-summary:hover {
  box-shadow: 0 16px 40px rgba(15, 23, 42, .1);
}

.cart-summary-accent {
  height: 4px;
  background: linear-gradient(90deg, #F87171, var(--red));
}

.cart-summary-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 22px 16px;
  border-bottom: 1px solid var(--border);
  background: transparent;
}

.cart-summary-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #FEE2E2, #FECACA);
  color: var(--red);
  flex-shrink: 0;
}

.cart-page .cart-summary-title {
  margin: 0;
  padding: 0;
  border: none;
  font-size: 16px;
}

.cart-summary-breakdown {
  padding: 16px 22px 0;
}

.cart-page .cart-summary-total {
  margin: 8px 22px 20px;
  padding: 16px 18px;
  border: none;
  border-radius: 14px;
  background: linear-gradient(135deg, #FFF5F5 0%, #FFF 100%);
  border: 1px solid #FECACA;
}

.cart-summary-actions {
  padding: 0 22px 22px;
}

.cart-checkout-btn,
.cart-continue-btn,
.cart-empty-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.cart-checkout-btn {
  box-shadow: 0 6px 18px rgba(220, 38, 38, .25);
  transition: transform .2s ease, box-shadow .2s ease;
}

.cart-checkout-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(220, 38, 38, .3);
}

.cart-page .cart-empty {
  padding: 72px 28px;
  border-radius: 18px;
  background: linear-gradient(160deg, #FAFAFA 0%, #fff 100%);
  border: 1px dashed #D1D5DB;
}

.cart-empty-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #F3F4F6;
  animation: cart-empty-pulse 2.8s ease-in-out infinite;
}

.cart-empty-icon svg {
  width: 40px;
  height: 40px;
  color: #9CA3AF;
  margin: 0;
}

@keyframes cart-empty-pulse {
  0%, 100% { transform: scale(1); opacity: .7; }
  50% { transform: scale(1.06); opacity: 1; }
}

.cart-page.is-ready .cart-empty {
  animation: cart-empty-float 5s ease-in-out 1s infinite;
}

@keyframes cart-empty-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

@media (prefers-reduced-motion: reduce) {
  .cart-page .cart-reveal,
  .cart-item-accent,
  .cart-empty-icon,
  .cart-page.is-ready .cart-empty {
    animation: none !important;
    transition: none !important;
    transform: none !important;
    opacity: 1 !important;
  }
}

@media (max-width: 900px) {
  .cart-hero { flex-direction: column; }
  .cart-hero-stats { width: 100%; }
  .cart-hero-stat { flex: 1; min-width: 0; }
  .cart-account-header .cart-hero-stats { width: 100%; }
  .cart-page .cart-item {
    grid-template-columns: 80px 1fr auto;
    grid-template-areas:
      "thumb info remove"
      "thumb price remove"
      "qty qty subtotal";
    gap: 12px 14px;
  }
  .cart-page .cart-item--selectable {
    grid-template-columns: 24px 80px 1fr auto;
    grid-template-areas:
      "check thumb info remove"
      "check thumb price remove"
      "check qty qty subtotal";
  }
  .cart-page .cart-item--selectable .cart-item-check { grid-area: check; align-self: start; padding-top: 4px; }
  .cart-page .cart-item-thumb { width: 80px; height: 80px; grid-area: thumb; }
  .cart-page .cart-item-info { grid-area: info; }
  .cart-page .cart-item-price { grid-area: price; text-align: left; }
  .cart-qty-form { grid-area: qty; }
  .cart-page .cart-item-subtotal { grid-area: subtotal; text-align: right; }
  .cart-remove-form,
  .cart-page .cart-item--selectable .btn-remove { grid-area: remove; align-self: start; }
}

/* ── CHECKOUT ENHANCED UI & ANIMATIONS ── */
.checkout-page {
  position: relative;
}

.checkout-page-bg {
  position: absolute;
  inset: 0 -16px 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 70% 45% at 8% 0%, rgba(248, 113, 113, .14), transparent 55%),
    radial-gradient(ellipse 55% 40% at 95% 5%, rgba(220, 38, 38, .08), transparent 50%),
    linear-gradient(180deg, #FFF5F5 0%, #fff 100%);
  background-color: #fff;
}

.checkout-page > :not(.checkout-page-bg) {
  position: relative;
  z-index: 1;
}

.checkout-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.checkout-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  margin-bottom: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .92);
  border: 1px solid rgba(253, 230, 138, .7);
  color: #B45309;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .02em;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}

.checkout-hero-title {
  background: linear-gradient(135deg, #0F172A 0%, #334155 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.checkout-hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-self: center;
}

.checkout-hero-stat {
  min-width: 110px;
  padding: 12px 16px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid var(--border);
  box-shadow: 0 2px 8px rgba(15, 23, 42, .04);
  transition: transform .25s ease, box-shadow .25s ease;
}

.checkout-hero-stat:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(15, 23, 42, .07);
}

.checkout-hero-stat.highlight {
  border-color: #FDE68A;
  background: linear-gradient(145deg, #FFFBEB 0%, #fff 100%);
}

.checkout-hero-stat .label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
  margin-bottom: 4px;
}

.checkout-hero-stat strong {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

.checkout-hero-stat.highlight strong { color: var(--red); }

.checkout-page .checkout-reveal {
  opacity: 0;
  transform: translateY(16px);
  transition:
    opacity .5s cubic-bezier(.22, 1, .36, 1),
    transform .5s cubic-bezier(.22, 1, .36, 1);
  transition-delay: var(--reveal-delay, 0ms);
}

.checkout-page.is-ready .checkout-reveal {
  opacity: 1;
  transform: translateY(0);
}

.checkout-info {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.55;
  margin-bottom: 14px;
  border: 1px solid transparent;
}

.checkout-info svg { flex-shrink: 0; margin-top: 1px; }

.checkout-info--warn {
  background: linear-gradient(135deg, #FFFBEB 0%, #FEFCE8 100%);
  border-color: #FDE68A;
  color: #92400E;
}

.checkout-info--warn svg { color: #D97706; }

.checkout-info--danger {
  background: linear-gradient(135deg, #FEF2F2 0%, #FFF5F5 100%);
  border-color: #FECACA;
  color: #991B1B;
}

.checkout-info--danger svg { color: #DC2626; }

.checkout-layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 24px;
  align-items: start;
}

.checkout-main {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.checkout-panel {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(15, 23, 42, .04);
  transition: box-shadow .25s ease;
}

.checkout-panel:hover {
  box-shadow: 0 8px 24px rgba(15, 23, 42, .06);
}

.checkout-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, #fff 0%, #FAFCFF 100%);
}

.checkout-panel-head h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.checkout-panel-head span {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.checkout-items {
  list-style: none;
  margin: 0;
  padding: 12px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.checkout-item {
  position: relative;
  display: grid;
  grid-template-columns: 72px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: #fff;
  transition:
    transform .25s ease,
    background .25s ease,
    box-shadow .25s ease,
    border-color .25s ease;
}

.checkout-item:hover {
  background: #FFFBFB;
  border-color: #FECACA;
  box-shadow: 0 4px 14px rgba(15, 23, 42, .06);
  transform: translateY(-1px);
}

.checkout-item-accent {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  border-radius: 14px 0 0 14px;
  background: linear-gradient(180deg, #FCA5A5, var(--red));
  transform: scaleY(0);
  transform-origin: top center;
  transition: transform .4s cubic-bezier(.22, 1, .36, 1);
}

.checkout-page.is-ready .checkout-item-accent {
  transform: scaleY(1);
}

.checkout-item-thumb {
  width: 72px;
  height: 72px;
  border-radius: 12px;
  background: var(--surface2);
  border: 1px solid var(--border);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.checkout-item-thumb svg {
  opacity: .25;
  stroke: #9CA3AF;
}

.checkout-item-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
}

.checkout-item-meta {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

.checkout-item-price {
  font-size: 15px;
  font-weight: 700;
  color: var(--red);
  white-space: nowrap;
}

.checkout-form-panel {
  padding-bottom: 4px;
}

.checkout-summary-form {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  margin-top: 0;
}

.checkout-summary-form.checkout-form {
  padding: 14px 20px;
}

.checkout-summary-form .checkout-field span em {
  font-style: normal;
  font-weight: 500;
  color: var(--muted);
}

.checkout-form {
  padding: 16px 20px 20px;
}

.checkout-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.checkout-field span {
  font-size: 12px;
  font-weight: 600;
  color: #475569;
}

.checkout-textarea {
  min-height: 96px;
  border-radius: 12px;
  transition: border-color .2s ease, box-shadow .2s ease;
}

.checkout-textarea:focus {
  border-color: #FCA5A5;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, .08);
}

.checkout-summary-form .checkout-input,
.checkout-summary-form .checkout-file {
  border-radius: 12px;
  transition: border-color .2s ease, box-shadow .2s ease;
}

.checkout-summary-form .checkout-input:focus,
.checkout-summary-form .checkout-file:focus {
  border-color: #FCA5A5;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, .08);
  outline: none;
}

.checkout-field-hint {
  font-size: 11px;
  font-weight: 500;
  color: var(--muted, #94a3b8);
}

.checkout-field-error {
  font-size: 12px;
  font-weight: 600;
  color: #dc2626;
}

.checkout-summary-row--discount strong {
  color: #059669;
}

.checkout-voucher-box {
  padding: 0 20px 12px;
}

.checkout-voucher-picker {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px dashed #FECACA;
  border-radius: 12px;
  background: #FFF8F8;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  font-family: var(--font);
  transition: border-color .2s ease, background .2s ease;
}

.checkout-voucher-picker:hover {
  border-color: #FCA5A5;
  background: #FEF2F2;
}

.checkout-voucher-picker-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border: 1px solid #FECACA;
  color: var(--red);
  flex-shrink: 0;
}

.checkout-voucher-picker-copy {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.checkout-voucher-picker-copy strong {
  font-size: 13px;
  font-weight: 700;
}

.checkout-voucher-picker-copy em {
  font-style: normal;
  font-size: 12px;
  color: var(--muted);
}

.checkout-voucher-picker-chevron {
  color: #94A3B8;
  flex-shrink: 0;
}

.checkout-voucher-applied-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.checkout-voucher-change {
  border: none;
  background: transparent;
  color: #047857;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
}

.checkout-voucher-change:hover {
  background: #D1FAE5;
}

.checkout-voucher-form .checkout-field {
  gap: 6px;
}

.checkout-voucher-input-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.checkout-voucher-input {
  flex: 1;
  min-width: 0;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0 12px;
  font-size: 13px;
  font-family: var(--font);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.checkout-voucher-input:focus {
  outline: none;
  border-color: #FCA5A5;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, .08);
}

.checkout-voucher-apply {
  flex-shrink: 0;
  height: 40px;
  padding: 0 14px;
  border-radius: 10px;
  white-space: nowrap;
}

.checkout-voucher-applied {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid #A7F3D0;
  border-radius: 12px;
  background: #ECFDF5;
}

.checkout-voucher-applied strong {
  display: block;
  font-size: 13px;
  color: #065F46;
}

.checkout-voucher-applied span {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  color: #047857;
}

.checkout-voucher-remove {
  border: none;
  background: transparent;
  color: #B91C1C;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
}

.checkout-voucher-remove:hover {
  background: #FEF2F2;
}

.checkout-voucher-hint {
  margin: 8px 0 0;
  font-size: 12px;
  color: #B45309;
}

body.checkout-voucher-modal-open {
  overflow: hidden;
}

.checkout-voucher-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.checkout-voucher-modal[hidden] {
  display: none !important;
}

.checkout-voucher-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, .45);
}

.checkout-voucher-modal-dialog {
  position: relative;
  z-index: 1;
  width: min(520px, 100%);
  max-height: min(82vh, 640px);
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 18px 18px 0 0;
  box-shadow: 0 -8px 32px rgba(15, 23, 42, .18);
}

@media (min-width: 640px) {
  .checkout-voucher-modal {
    align-items: center;
    padding: 24px;
  }
  .checkout-voucher-modal-dialog {
    border-radius: 16px;
    box-shadow: 0 20px 48px rgba(15, 23, 42, .2);
  }
}

.checkout-voucher-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 18px 14px;
  border-bottom: 1px solid var(--border);
}

.checkout-voucher-modal-head h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.checkout-voucher-modal-head p {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.checkout-voucher-modal-close {
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: #64748B;
  cursor: pointer;
  flex-shrink: 0;
}

.checkout-voucher-modal-close:hover {
  background: #F8FAFC;
}

.checkout-voucher-modal-body {
  overflow-y: auto;
  padding: 12px 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.checkout-voucher-option {
  margin: 0;
}

.checkout-voucher-option-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  text-align: left;
  cursor: pointer;
  font-family: var(--font);
  color: inherit;
  transition: border-color .2s ease, background .2s ease;
}

.checkout-voucher-option:not(.is-disabled) .checkout-voucher-option-btn:hover {
  border-color: #FCA5A5;
  background: #FFF8F8;
}

.checkout-voucher-option.is-selected .checkout-voucher-option-btn {
  border-color: #6EE7B7;
  background: #ECFDF5;
}

.checkout-voucher-option.is-disabled .checkout-voucher-option-btn {
  opacity: .55;
  cursor: not-allowed;
  background: #F8FAFC;
}

.checkout-voucher-option-value {
  min-width: 72px;
  font-size: 15px;
  font-weight: 700;
  color: var(--red);
  flex-shrink: 0;
}

.checkout-voucher-option-copy {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.checkout-voucher-option-copy strong {
  font-size: 13px;
  color: var(--text);
}

.checkout-voucher-option-copy em,
.checkout-voucher-option-copy small {
  font-style: normal;
  font-size: 12px;
  color: var(--muted);
}

.checkout-voucher-option-check {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--red);
}

.checkout-voucher-option.is-selected .checkout-voucher-option-check {
  color: #047857;
}

.checkout-voucher-empty {
  padding: 28px 12px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

.voucher-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}

.voucher-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
}

.voucher-card-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--red);
  letter-spacing: -0.02em;
}

.voucher-card-body strong {
  display: block;
  font-size: 14px;
  color: var(--text);
}

.voucher-card-body code {
  display: inline-block;
  margin-top: 6px;
  padding: 3px 8px;
  border-radius: 6px;
  background: #F8FAFC;
  border: 1px solid var(--border);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.voucher-card-body p,
.voucher-card-body ul {
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
}

.voucher-card-cta {
  margin-top: auto;
  justify-content: center;
}

.checkout-summary {
  position: sticky;
  top: 88px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: none;
}

.checkout-summary:hover {
  box-shadow: none;
}

.checkout-summary-accent {
  height: 4px;
  background: linear-gradient(90deg, #FBBF24, #F59E0B);
}

.checkout-summary-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border);
  background: transparent;
}

.checkout-summary-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #FEF3C7, #FDE68A);
  color: #B45309;
  flex-shrink: 0;
}

.checkout-summary-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}

.checkout-summary-rows {
  padding: 14px 20px 4px;
}

.checkout-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 7px 0;
  font-size: 13px;
  color: var(--muted);
}

.checkout-summary-row strong {
  color: var(--text);
  font-weight: 600;
}

.checkout-summary-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 8px 20px 16px;
  padding: 14px 0 0;
  border-radius: 0;
  background: transparent;
  border: none;
  border-top: 1px solid var(--border);
}

.checkout-summary-total span:first-child {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.checkout-summary-total span:last-child {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -.02em;
}

.checkout-summary-steps {
  padding: 0 22px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.checkout-step {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: #64748B;
  line-height: 1.4;
}

.checkout-step-num {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: #FEF3C7;
  color: #B45309;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.checkout-summary-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 20px 20px;
}

.checkout-submit-btn,
.checkout-cancel-btn,
.checkout-continue-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 11px 18px;
  border-radius: 10px;
}

.checkout-continue-btn {
  color: var(--text);
  border-color: var(--border);
  background: #fff;
}

.checkout-continue-btn:hover {
  background: var(--surface2);
}

.checkout-cancel-btn {
  color: #B91C1C;
  border-color: #FECACA;
  background: #FFF;
}

.checkout-cancel-btn:hover {
  background: #FEF2F2;
  border-color: #FCA5A5;
  color: #991B1B;
}

.checkout-submit-btn {
  box-shadow: none;
  transition: background .2s ease, border-color .2s ease;
}

.checkout-submit-btn:hover {
  transform: none;
  box-shadow: none;
}

@media (prefers-reduced-motion: reduce) {
  .checkout-page .checkout-reveal,
  .checkout-item-accent {
    transition: none !important;
    transform: none !important;
    opacity: 1 !important;
  }

  .checkout-item:hover {
    transform: none;
  }
}

@media (max-width: 900px) {
  .checkout-hero { flex-direction: column; }
  .checkout-hero-stats { width: 100%; }
  .checkout-hero-stat { flex: 1; min-width: 0; }
  .checkout-layout { grid-template-columns: 1fr; }
  .checkout-summary { position: static; }
  .checkout-item {
    grid-template-columns: 64px 1fr;
    grid-template-areas:
      "thumb body"
      "thumb price";
  }
  .checkout-item-thumb { width: 64px; height: 64px; grid-area: thumb; }
  .checkout-item-body { grid-area: body; }
  .checkout-item-price { grid-area: price; justify-self: start; }
}

/* ── PESANAN DETAIL ENHANCED UI ── */
.order-page.order-detail-page {
  display: block;
  background: #fff;
}

.order-page {
  position: relative;
}

.order-page-bg {
  position: absolute;
  inset: 0 -16px 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 70% 45% at 8% 0%, rgba(248, 113, 113, .14), transparent 55%),
    radial-gradient(ellipse 55% 40% at 95% 5%, rgba(220, 38, 38, .08), transparent 50%),
    linear-gradient(180deg, #FFF5F5 0%, #fff 100%);
  background-color: #fff;
}

.order-detail-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 24px;
  align-items: start;
}

.order-page .order-reveal {
  opacity: 0;
  transform: translateY(16px);
  transition:
    opacity .5s cubic-bezier(.22, 1, .36, 1),
    transform .5s cubic-bezier(.22, 1, .36, 1);
  transition-delay: var(--reveal-delay, 0ms);
}

.order-page.is-ready .order-reveal {
  opacity: 1;
  transform: translateY(0);
}

.order-hero-title {
  background: linear-gradient(135deg, #0F172A 0%, #334155 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.order-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

.order-breadcrumb span:last-child {
  color: var(--text);
  font-weight: 600;
}

.order-panel {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
  margin-bottom: 16px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, .04);
  transition: box-shadow .25s ease;
}

.order-panel:hover {
  box-shadow: 0 8px 24px rgba(15, 23, 42, .06);
}

.order-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: transparent;
}

.order-panel-head h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.order-panel-head span {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.order-panel-body {
  padding: 16px 20px 20px;
}

.order-items {
  list-style: none;
  margin: 0;
  padding: 12px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.order-page .order-item-row {
  position: relative;
  display: grid;
  grid-template-columns: 72px 1fr auto auto;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
  border-bottom: none;
  transition:
    transform .25s ease,
    border-color .25s ease,
    box-shadow .25s ease;
}

.order-page .order-item-row:hover {
  border-color: #FECACA;
  box-shadow: 0 4px 14px rgba(15, 23, 42, .06);
  transform: translateY(-1px);
}

.order-item-accent {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  border-radius: 14px 0 0 14px;
  background: linear-gradient(180deg, #FCA5A5, var(--red));
  transform: scaleY(0);
  transform-origin: top center;
  transition: transform .4s cubic-bezier(.22, 1, .36, 1);
}

.order-page.is-ready .order-item-accent {
  transform: scaleY(1);
}

.order-page .order-item-thumb {
  width: 72px;
  height: 72px;
  border-radius: 12px;
}

.order-item-body { min-width: 0; }

.order-page .order-item-name {
  font-size: 14px;
}

.order-page .order-item-qty,
.order-page .order-item-subtotal {
  text-align: right;
}

.order-page .order-item-qty .mini-label,
.order-page .order-item-subtotal .mini-label {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 3px;
  font-weight: 500;
}

.order-page .order-item-qty strong,
.order-page .order-item-subtotal strong {
  display: block;
  font-size: 14px;
  color: var(--text);
}

.order-page .order-item-subtotal strong {
  font-size: 15px;
  color: var(--red);
}

.order-item-unit {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-top: 3px;
}

.order-note {
  margin: 0 16px 16px;
  padding: 14px 16px;
  border-radius: 12px;
  background: #F9FAFB;
  border: 1px solid var(--border);
  font-size: 13px;
  line-height: 1.55;
}

.order-note strong {
  display: block;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
  margin-bottom: 6px;
}

.order-note p {
  margin: 0;
  color: var(--text);
}

.order-form-actions {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.order-payments {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 4px;
}

.order-page .payment-card {
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #FAFAFA;
  border-bottom: none;
}

.order-page .payment-card:hover {
  border-color: #FECACA;
  background: #FFFBFB;
}

.payment-card-side {
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.order-detail-sidebar {
  top: 88px;
  gap: 16px;
  background: transparent;
}

.order-page .checkout-summary .sidebar-alert {
  margin: 0 22px 16px;
}

.order-pay-section {
  padding: 18px 22px 22px;
  border-top: 1px solid var(--border);
  background: linear-gradient(180deg, #FFFBFB 0%, #fff 100%);
}

.order-pay-hint {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 14px;
}

.order-pay-btn {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 20px;
  border: none;
  border-radius: 12px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #fff;
  cursor: pointer;
  background: linear-gradient(135deg, #EF4444 0%, #DC2626 55%, #B91C1C 100%);
  box-shadow:
    0 8px 22px rgba(220, 38, 38, .28),
    inset 0 1px 0 rgba(255, 255, 255, .18);
  transition:
    transform .2s ease,
    box-shadow .2s ease,
    opacity .2s ease;
}

.order-pay-btn svg {
  flex-shrink: 0;
  opacity: .95;
}

.order-pay-btn:hover {
  transform: translateY(-2px);
  box-shadow:
    0 12px 28px rgba(220, 38, 38, .34),
    inset 0 1px 0 rgba(255, 255, 255, .22);
}

.order-pay-btn:active {
  transform: translateY(0);
  box-shadow:
    0 4px 14px rgba(220, 38, 38, .24),
    inset 0 1px 0 rgba(255, 255, 255, .12);
}

.order-pay-btn:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 3px rgba(254, 202, 202, .9),
    0 8px 22px rgba(220, 38, 38, .28);
}

.order-pay-btn:disabled,
.order-pay-btn.is-loading {
  opacity: .72;
  cursor: wait;
  transform: none;
  box-shadow: 0 4px 14px rgba(220, 38, 38, .18);
}

.order-pay-status {
  margin-top: 12px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}

.order-pay-status.is-error {
  color: #B91C1C;
}

.order-pay-pending {
  margin: 0 22px 16px;
}

.order-upload-wrap {
  padding: 0 22px 22px;
}

.order-upload-hint {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 14px;
}

.warn-text { color: #B45309; font-weight: 600; }

.order-file-input { padding: 8px !important; }

.order-upload-btn {
  width: 100%;
  justify-content: center;
  margin-top: 16px;
  display: inline-flex;
  align-items: center;
  border-radius: 10px;
}

@media (prefers-reduced-motion: reduce) {
  .order-page .order-reveal,
  .order-item-accent {
    transition: none !important;
    transform: none !important;
    opacity: 1 !important;
  }

  .order-page .order-item-row:hover {
    transform: none;
  }

  .order-pay-btn:hover,
  .order-pay-btn:active {
    transform: none;
  }
}

@media (max-width: 900px) {
  .order-detail-inner { grid-template-columns: 1fr; }
  .order-detail-sidebar { position: static; }
  .order-page .order-item-row {
    grid-template-columns: 64px 1fr;
    grid-template-areas:
      "thumb body"
      "thumb qty"
      "thumb subtotal";
  }
  .order-page .order-item-thumb { grid-area: thumb; width: 64px; height: 64px; }
  .order-item-body { grid-area: body; }
  .order-page .order-item-qty { grid-area: qty; text-align: left; }
  .order-page .order-item-subtotal { grid-area: subtotal; text-align: left; }
}

/* —— Floating chat (reseller ↔ warehouse) —— */
.r-chat {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 90;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
  font-family: Inter, system-ui, sans-serif;
}
.r-chat-fab {
  position: relative;
  width: 56px;
  height: 56px;
  border: none;
  border-radius: 50%;
  background: #dc2626;
  color: #fff;
  box-shadow: 0 10px 28px rgba(220, 38, 38, 0.35);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: transform 0.15s ease, background 0.15s ease;
}
.r-chat-fab:hover { background: #b91c1c; transform: translateY(-1px); }
.r-chat-fab.is-open { background: #111827; box-shadow: 0 8px 20px rgba(0,0,0,0.25); }
.r-chat-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 999px;
  background: #111827;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: none;
  place-items: center;
  border: 2px solid #fff;
  line-height: 1;
  z-index: 2;
  pointer-events: none;
  box-sizing: border-box;
}
.r-chat-badge.is-visible,
.r-chat-badge:not([hidden]) {
  display: grid !important;
}
.r-chat-badge[hidden] {
  display: none !important;
}
.r-chat-fab.is-open .r-chat-badge {
  background: #dc2626;
}
.r-chat-panel {
  width: min(360px, calc(100vw - 32px));
  height: min(520px, calc(100vh - 120px));
  background: #fff;
  border-radius: 18px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.18);
  display: none;
  flex-direction: column;
  overflow: hidden;
}
.r-chat-panel.is-open {
  display: flex;
}
.r-chat-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  background: linear-gradient(135deg, #111827, #1f2937);
  color: #fff;
}
.r-chat-title { margin: 0; font-size: 14px; font-weight: 700; }
.r-chat-sub { margin: 2px 0 0; font-size: 11px; color: rgba(255,255,255,0.65); }
.r-chat-close {
  border: none;
  background: rgba(255,255,255,0.1);
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.r-chat-close:hover { background: rgba(255,255,255,0.18); }
.r-chat-messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 14px;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.r-chat-empty {
  margin: auto;
  text-align: center;
  font-size: 13px;
  color: #94a3b8;
  padding: 24px 12px;
  max-width: 220px;
  line-height: 1.45;
}
.r-chat-bubble { display: flex; }
.r-chat-bubble.is-mine { justify-content: flex-end; }
.r-chat-bubble-inner {
  max-width: 82%;
  padding: 9px 12px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid #e5e7eb;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.r-chat-bubble.is-mine .r-chat-bubble-inner {
  background: #dc2626;
  border-color: #dc2626;
  color: #fff;
  border-bottom-right-radius: 5px;
}
.r-chat-bubble:not(.is-mine) .r-chat-bubble-inner {
  border-bottom-left-radius: 5px;
}
.r-chat-bubble-text {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}
.r-chat-bubble-time {
  display: block;
  margin-top: 4px;
  font-size: 10px;
  opacity: 0.65;
}
.r-chat-compose {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid #e5e7eb;
  background: #fff;
}
.r-chat-compose textarea {
  flex: 1;
  min-height: 40px;
  max-height: 96px;
  resize: none;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 10px 12px;
  font: inherit;
  font-size: 13px;
  outline: none;
}
.r-chat-compose textarea:focus {
  border-color: #fca5a5;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
}
.r-chat-send {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 12px;
  background: #dc2626;
  color: #fff;
  cursor: pointer;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.r-chat-send:hover { background: #b91c1c; }
@media (max-width: 480px) {
  .r-chat { right: 12px; bottom: 12px; }
  .r-chat-panel { width: calc(100vw - 24px); height: min(70vh, 520px); }
}

/* ── RESELLER REKAP LAPORAN ── */
.account-page .laporan-page {
  min-height: 0;
  gap: 16px;
}

.laporan-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.laporan-summary-card {
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
}

.laporan-summary-card.is-accent {
  border-color: #FECACA;
  background: linear-gradient(145deg, #FFF5F5 0%, #fff 100%);
}

.laporan-summary-label {
  display: block;
  margin-bottom: 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
}

.laporan-summary-card strong {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -.02em;
}

.laporan-summary-card.is-accent strong {
  color: var(--red);
}

.laporan-panel {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
  overflow: hidden;
}

.laporan-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--surface2, #F8FAFC);
}

.laporan-panel-head h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.laporan-panel-head p {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}

.laporan-table-wrap {
  overflow-x: auto;
}

.laporan-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1040px;
  font-size: 12px;
}

.laporan-table th,
.laporan-table td {
  border-bottom: 1px solid #EEF2F7;
  padding: 10px 12px;
  white-space: nowrap;
  vertical-align: middle;
  color: var(--text);
}

.laporan-table thead th {
  background: #F8FAFC;
  color: #64748B;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.laporan-table tbody tr:hover {
  background: #FFF8F8;
}

.laporan-table tbody tr.is-empty-row {
  color: #94A3B8;
}

.laporan-table tfoot th {
  background: #FFF5F5;
  border-top: 1px solid #FECACA;
  color: var(--text);
  font-weight: 700;
}

.laporan-table .is-center { text-align: center; }
.laporan-table .is-right { text-align: right; font-variant-numeric: tabular-nums; }
.laporan-table .is-left {
  text-align: left;
  white-space: normal;
  min-width: 160px;
  max-width: 260px;
  line-height: 1.35;
}

.laporan-table .is-cut {
  background: #FFFBEB;
}

.laporan-table thead th.is-cut,
.laporan-table--harian thead tr:last-child th {
  background: #FFF7ED;
  color: #9A3412;
}

.laporan-table .is-emphasis {
  font-weight: 700;
  color: var(--red);
}

.laporan-table tfoot .is-emphasis {
  color: var(--red);
}

@media (max-width: 900px) {
  .laporan-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .laporan-summary-grid {
    grid-template-columns: 1fr;
  }
}
