/* ==========================================================
   dtrx - TRANSACTION GENERATOR STYLESHEET
   ========================================================== */

:root {
  --primary: #00aa5b;
  --primary-hover: #03934f;
  --primary-light: #e8f8ee;
  --dark-text: #0f172a;
  --muted-text: #475569;
  --divider-color: #e2e8f0;
  --border-color: #cbd5e1;
  --bg-app: #f8fafc;
  --bg-card: #ffffff;
  --danger: #ef4444;
  --danger-light: #fee2e2;
  --font-tokopedia: 'Open Sans', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-ui: 'Inter', system-ui, -apple-system, sans-serif;
}

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

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

/* App Header */
.app-header {
  height: 56px;
  background-color: #ffffff;
  border-bottom: 1.5px solid var(--border-color);
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-badge {
  background: #0f172a;
  color: #ffffff;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.8px;
}

.header-brand h1 {
  font-size: 20px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.6px;
  text-transform: lowercase;
}

.header-brand .tag {
  font-size: 11.5px;
  background-color: var(--primary-light);
  color: var(--primary);
  border: 1px solid rgba(0, 170, 91, 0.3);
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 700;
}

.header-actions {
  display: flex;
  gap: 8px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 700;
  padding: 7px 14px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  border: 1.5px solid transparent;
  text-decoration: none;
}

.btn:active {
  transform: scale(0.98);
}

.btn-secondary {
  background-color: #ffffff;
  border-color: #cbd5e1;
  color: #0f172a;
}

.btn-secondary:hover {
  background-color: #f1f5f9;
  border-color: #0f172a;
}

.btn-primary {
  background-color: var(--primary);
  border-color: var(--primary);
  color: white;
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  border-color: var(--primary-hover);
}

.btn-tokopedia {
  background-color: #00aa5b;
  border-color: #008a4b;
  color: white;
}

.btn-tokopedia:hover {
  background-color: #03934f;
}

.btn-outline {
  background-color: #ffffff;
  border: 1.5px dashed #94a3b8;
  color: #0f172a;
  font-weight: 700;
}

.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
  background-color: var(--primary-light);
}

.btn-danger-outline {
  background-color: #ffffff;
  border: 1.5px solid #f87171;
  color: var(--danger);
  padding: 3px 8px;
  font-size: 11px;
  border-radius: 4px;
}

.btn-danger-outline:hover {
  background-color: var(--danger-light);
}

.btn-icon-text {
  padding: 7px 14px;
}

.full-width {
  width: 100%;
}

/* Layout */
.main-layout {
  display: grid;
  grid-template-columns: 460px 1fr;
  min-height: calc(100vh - 56px);
}

@media (max-width: 1024px) {
  .main-layout {
    grid-template-columns: 1fr;
  }
}

/* Left Pane: Editor */
.editor-pane {
  background-color: #f1f5f9;
  border-right: 1.5px solid var(--border-color);
  overflow-y: auto;
  max-height: calc(100vh - 56px);
}

.editor-scroll {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Form Cards */
.form-card {
  background-color: #ffffff;
  border-radius: 8px;
  border: 1.5px solid #cbd5e1;
  overflow: hidden;
}

.form-card-header {
  padding: 10px 14px;
  border-bottom: 1.5px solid #e2e8f0;
  background-color: #f8fafc;
}

.form-card-header h3 {
  font-size: 11.5px;
  font-weight: 800;
  color: #0f172a;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-card-body {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Form Controls */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.form-row {
  display: flex;
  gap: 10px;
}

.form-row .col {
  flex: 1;
}

.form-row .col-3 { flex: 3; }
.form-row .col-4 { flex: 4; }
.form-row .col-5 { flex: 5; }
.form-row .col-7 { flex: 7; }
.form-row .col-8 { flex: 8; }

label {
  font-size: 11px;
  font-weight: 700;
  color: #334155;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.sub-label {
  font-size: 10.5px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.2px;
}

.label-with-action {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.text-link-btn {
  background: none;
  border: none;
  color: #0f172a;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  transition: color 0.15s ease;
}

.text-link-btn:hover {
  color: var(--primary);
}

.date-quick-actions {
  display: flex;
  gap: 6px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.btn-chip {
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  color: #0f172a;
  font-weight: 600;
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-chip:hover {
  border-color: #0f172a;
  background-color: #f1f5f9;
}

input[type="text"],
input[type="number"],
input[type="date"],
input[type="time"],
select,
textarea {
  width: 100%;
  padding: 7px 10px;
  font-size: 13px;
  font-weight: 500;
  border: 1.5px solid #cbd5e1;
  border-radius: 6px;
  color: #0f172a;
  background-color: #ffffff;
  outline: none;
  font-family: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input[type="text"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
input[type="time"]:focus,
select:focus,
textarea:focus {
  border-color: #0f172a;
  box-shadow: 0 0 0 2px rgba(15, 23, 42, 0.12);
}

.input-readonly {
  background-color: #f1f5f9;
  color: #475569;
  border-color: #e2e8f0;
  cursor: not-allowed;
}

.input-highlight {
  font-weight: 800;
  color: var(--primary);
  border-color: var(--primary);
  font-size: 14px;
}

textarea {
  resize: vertical;
}

.section-subtitle {
  display: flex;
  align-items: center;
  font-size: 11px;
  font-weight: 800;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 4px;
}

/* Platform Segmented Control */
.platform-segmented-control {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.platform-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 8px;
  border: 2px solid #cbd5e1;
  background-color: #ffffff;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: left;
}

.platform-btn .platform-icon {
  font-size: 18px;
  line-height: 1;
}

.platform-btn-text strong {
  display: block;
  font-size: 13px;
  font-weight: 800;
  color: #0f172a;
}

.platform-btn-text small {
  display: block;
  font-size: 10.5px;
  font-weight: 500;
  color: #64748b;
}

.platform-btn:hover {
  border-color: #94a3b8;
  background-color: #f8fafc;
}

.platform-btn.active[data-platform="tokopedia"] {
  border-color: #008a4b;
  background-color: #00aa5b;
}

.platform-btn.active[data-platform="tokopedia"] strong {
  color: #ffffff;
}

.platform-btn.active[data-platform="tokopedia"] small {
  color: rgba(255, 255, 255, 0.9);
}

.platform-btn.active[data-platform="shopee"] {
  border-color: #c2410c;
  background-color: #ee4d2d;
}

.platform-btn.active[data-platform="shopee"] strong {
  color: #ffffff;
}

.platform-btn.active[data-platform="shopee"] small {
  color: rgba(255, 255, 255, 0.9);
}

/* Toggle Switch */
.toggle-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background-color: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 6px;
}

.toggle-label strong {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: #0f172a;
}

.toggle-label small {
  display: block;
  font-size: 10.5px;
  color: #64748b;
}

.switch {
  position: relative;
  display: inline-block;
  width: 42px;
  height: 22px;
  flex-shrink: 0;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #cbd5e1;
  transition: .2s;
  border-radius: 22px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .2s;
  border-radius: 50%;
  box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

input:checked + .slider {
  background-color: var(--primary);
}

input:checked + .slider:before {
  transform: translateX(20px);
}

/* Product Item in Form */
.product-form-item {
  background-color: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 6px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
}

.product-form-top {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.product-thumb-upload {
  width: 50px;
  height: 50px;
  border-radius: 6px;
  border: 1.5px solid #cbd5e1;
  overflow: hidden;
  position: relative;
  background-color: #fff;
  flex-shrink: 0;
  cursor: pointer;
}

.product-thumb-upload img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-thumb-upload .upload-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  opacity: 0;
  transition: opacity 0.15s ease;
  font-size: 9.5px;
  font-weight: 700;
  text-align: center;
}

.product-thumb-upload:hover .upload-overlay {
  opacity: 1;
}

.product-form-fields {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.product-form-bottom {
  display: flex;
  gap: 8px;
  align-items: center;
}

.product-form-bottom .col-price {
  flex: 2;
}

.product-form-bottom .col-qty {
  flex: 1;
}

/* Saved Templates List */
.saved-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 6px;
  max-height: 160px;
  overflow-y: auto;
}

.saved-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 10px;
  background-color: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-size: 11.5px;
}

.saved-item-title {
  font-weight: 600;
  color: #0f172a;
  cursor: pointer;
  flex: 1;
}

.saved-item-title:hover {
  color: var(--primary);
  text-decoration: underline;
}

.saved-item-actions {
  display: flex;
  gap: 5px;
}

/* Utility */
.hidden {
  display: none !important;
}

/* ==========================================================
   RIGHT PANE: LIVE PREVIEW & TOOLBAR
   ========================================================== */

.preview-pane {
  background-color: #e2e8f0;
  display: flex;
  flex-direction: column;
  height: calc(100vh - 56px);
  overflow: hidden;
}

.preview-toolbar {
  height: 50px;
  background-color: #ffffff;
  border-bottom: 1.5px solid var(--border-color);
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 20;
  flex-shrink: 0;
}

.toolbar-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 800;
  color: #0f172a;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: #00aa5b;
  display: inline-block;
  box-shadow: 0 0 0 3px rgba(0, 170, 91, 0.2);
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(0.9); }
}

.toolbar-buttons {
  display: flex;
  gap: 8px;
}

.btn-primary-action {
  background-color: var(--primary);
  border: 1.5px solid #008a4b;
  color: white;
  font-weight: 700;
}

.btn-primary-action:hover {
  background-color: var(--primary-hover);
}

.preview-viewport {
  flex: 1;
  overflow-y: auto;
  padding: 30px 20px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

body.shopee-active {
  --primary: #ee4d2d;
  --primary-hover: #d73211;
  --primary-light: #fef0ed;
}

body.shopee-active input[type="text"]:focus,
body.shopee-active input[type="number"]:focus,
body.shopee-active input[type="date"]:focus,
body.shopee-active input[type="time"]:focus,
body.shopee-active select:focus,
body.shopee-active textarea:focus {
  border-color: #ee4d2d;
  box-shadow: 0 0 0 2px rgba(238, 77, 45, 0.15);
}

body.shopee-active .header-brand .tag {
  background-color: #fef0ed;
  color: #ee4d2d;
  border-color: rgba(238, 77, 45, 0.3);
}

body.shopee-active .btn-primary-action {
  background-color: #ee4d2d;
  border-color: #cb381a;
}

body.shopee-active .btn-primary-action:hover {
  background-color: #d73211;
}

/* ==========================================================
   TOKOPEDIA RECEIPT COMPONENT (PIXEL-PERFECT REPLICA)
   ========================================================== */

.tokopedia-card-container {
  width: 525px;
  background-color: #ffffff;
  font-family: var(--font-tokopedia);
  color: var(--dark-text);
  line-height: 1.4;
  overflow: hidden;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
  border: 1px solid #e5e7eb;
}

/* ==========================================================
   SHOPEE RECEIPT REPLICA COMPONENT
   ========================================================== */

.shopee-card-container {
  width: 413px;
  background-color: #f6f6f6;
  font-family: 'Roboto', 'Open Sans', -apple-system, sans-serif;
  color: #222222;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
  padding-bottom: 20px;
}

.shopee-top-banner {
  background-color: #26aa99;
  padding: 14px 16px;
  color: #ffffff;
  display: flex;
  align-items: center;
}

.shopee-banner-title {
  font-size: 15.5px;
  font-weight: 700;
  letter-spacing: -0.1px;
}

.shopee-card {
  background-color: #ffffff;
  border-radius: 6px;
  margin: 8px 8px 0 8px;
  padding: 12px 14px;
}

.shopee-card-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.shopee-card-title {
  font-size: 13px;
  font-weight: 700;
  color: #222222;
}

.shopee-shipping-sub {
  font-size: 11.5px;
  color: #757575;
  margin: 3px 0 10px 0;
}

.shopee-shipping-status-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.shopee-truck-icon {
  margin-top: 1px;
  flex-shrink: 0;
}

.shopee-status-text {
  font-size: 12px;
  font-weight: 600;
  color: #26aa99;
  line-height: 1.35;
}

.shopee-status-date {
  font-size: 11px;
  color: #888888;
  margin-top: 2px;
}

.shopee-card-divider {
  height: 1px;
  background-color: #f0f0f0;
  margin: 10px 0;
}

.shopee-address-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 6px;
}

.shopee-pin-icon {
  margin-top: 2px;
  flex-shrink: 0;
}

.shopee-address-name-phone {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
}

.shopee-address-name-phone strong {
  font-weight: 700;
  color: #222222;
}

.shopee-phone {
  color: #757575;
  font-size: 11.5px;
}

.shopee-address-text {
  font-size: 11.5px;
  color: #555555;
  line-height: 1.35;
  margin-top: 3px;
}

.shopee-link-more {
  color: #888888;
  font-size: 11px;
  cursor: pointer;
}

/* Shopee Product Card */
.shopee-shop-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.shopee-shop-left {
  display: flex;
  align-items: center;
  gap: 6px;
}

.shopee-badge-mall {
  display: inline-flex;
  border-radius: 2px;
  overflow: hidden;
  line-height: 1;
}

.badge-mall-tag {
  background-color: #d0011b;
  color: white;
  font-size: 9.5px;
  font-weight: 800;
  padding: 1px 4px;
}

.badge-ori-tag {
  background-color: #ee4d2d;
  color: white;
  font-size: 9.5px;
  font-weight: 800;
  padding: 1px 4px;
}

.shopee-shop-name {
  font-size: 12.5px;
  font-weight: 700;
  color: #222222;
}

.shopee-view-products-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.shopee-view-products-list .shopee-product-item + .shopee-product-item {
  padding-top: 12px;
  border-top: 1px dashed #e8e8e8;
}

.shopee-product-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.shopee-product-img {
  width: 72px;
  height: 72px;
  border-radius: 4px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid #f0f0f0;
}

.shopee-product-details {
  flex: 1;
  min-width: 0;
}

.shopee-product-title {
  font-size: 12px;
  font-weight: 600;
  color: #222222;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.shopee-variant-qty-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 4px;
  font-size: 11px;
  color: #757575;
}

.shopee-price-row {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
}

.shopee-price-strike {
  font-size: 11px;
  color: #9e9e9e;
  text-decoration: line-through;
}

.shopee-price-active {
  font-size: 13px;
  font-weight: 700;
  color: #222222;
}

.shopee-total-row {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
  padding-top: 4px;
}

.shopee-total-label {
  font-size: 12px;
  color: #222222;
}

.shopee-total-amount {
  font-size: 13.5px;
  font-weight: 700;
  color: #222222;
}

/* Shopee Help Card */
.shopee-help-title {
  font-size: 13px;
  font-weight: 700;
  color: #222222;
  margin-bottom: 12px;
}

.shopee-help-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid #f5f5f5;
  cursor: pointer;
}

.shopee-help-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.shopee-help-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.shopee-help-text-wrap {
  display: flex;
  flex-direction: column;
}

.shopee-help-name {
  font-size: 12px;
  font-weight: 600;
  color: #222222;
}

.shopee-help-sub {
  font-size: 10.5px;
  color: #757575;
  margin-top: 1px;
}

/* Shopee Order Meta Card */
.shopee-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11.5px;
  padding: 4px 0;
}

.shopee-meta-label {
  color: #757575;
}

.shopee-meta-val {
  color: #222222;
}

.shopee-meta-val.bold {
  font-weight: 700;
}

.shopee-meta-val-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}

.shopee-copy-btn {
  border: 1px solid #d0d0d0;
  background-color: #ffffff;
  color: #444444;
  font-size: 10.5px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 3px;
  cursor: pointer;
}

.shopee-meta-link {
  display: flex;
  align-items: center;
  gap: 2px;
  color: #757575;
  font-size: 11.5px;
}

.shopee-footer-collapse {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-top: 12px;
  padding-top: 8px;
  border-top: 1px solid #f0f0f0;
  color: #757575;
  font-size: 11px;
  cursor: pointer;
}

/* Cropped Mode Header */
.receipt-header-cropped {
  padding: 18px 18px 12px 18px;
}

.receipt-main-title {
  font-size: 20px;
  font-weight: 800;
  color: #212121;
  letter-spacing: -0.3px;
}

/* Section Shared */
.receipt-section {
  padding: 14px 18px;
}

.section-divider {
  height: 8px;
  background-color: #f3f4f5;
  width: 100%;
}

/* Section 1: Status Transaksi */
.status-section {
  padding-top: 6px;
  padding-bottom: 14px;
}

.status-heading-row {
  margin-bottom: 12px;
}

.status-label-title {
  font-size: 14.5px;
  font-weight: 800;
  color: #212121;
}

.meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.meta-row:last-child {
  margin-bottom: 0;
}

.meta-label {
  font-size: 12px;
  color: #6d7588;
  font-weight: 400;
}

.meta-value {
  font-size: 12px;
  font-weight: 500;
}

.meta-value.green-link {
  color: #00aa5b;
  font-weight: 700;
  letter-spacing: 0.1px;
}

.meta-value.dark-text {
  color: #212121;
  font-weight: 500;
}

/* Section 2: Detail Produk */
.products-section {
  padding-top: 14px;
  padding-bottom: 14px;
}

.store-heading-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.section-title {
  font-size: 14.5px;
  font-weight: 800;
  color: #212121;
}

.store-badge-wrap {
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
}

.store-badge-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
}

.store-badge-icon img,
.store-badge-icon svg {
  width: 15px;
  height: 15px;
}

.store-name-text {
  font-size: 12.5px;
  font-weight: 700;
  color: #212121;
}

.chevron-icon {
  margin-left: -1px;
}

/* Product Item Replica */
.receipt-products-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.receipt-product-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  position: relative;
}

.product-thumb {
  width: 48px;
  height: 48px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
  background-color: #f3f4f6;
}

.product-info {
  flex: 1;
  min-width: 0;
  padding-right: 80px; /* Space for Beli Lagi button */
}

.product-name {
  font-size: 12.5px;
  font-weight: 700;
  color: #212121;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.product-qty-price {
  margin-top: 4px;
  font-size: 11.5px;
  color: #6d7588;
  font-weight: 400;
}

.btn-buy-again {
  position: absolute;
  right: 0;
  bottom: 0;
  border: 1px solid #d0d5dd;
  background-color: #ffffff;
  color: #212121;
  font-size: 11.5px;
  font-weight: 700;
  padding: 5px 14px;
  border-radius: 7px;
  cursor: pointer;
  user-select: none;
  font-family: inherit;
  white-space: nowrap;
}

/* Section 3: Info Pengiriman */
.shipping-section {
  padding-top: 14px;
  padding-bottom: 14px;
}

.shipping-heading-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.view-detail-link {
  font-size: 12px;
  font-weight: 700;
  color: #00aa5b;
  cursor: pointer;
}

.shipping-table {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.shipping-row {
  display: flex;
  align-items: flex-start;
  font-size: 12px;
  line-height: 1.45;
}

.ship-col-label {
  width: 55px;
  color: #6d7588;
  flex-shrink: 0;
}

.ship-col-colon {
  width: 22px;
  text-align: center;
  color: #6d7588;
  flex-shrink: 0;
}

.ship-col-val {
  flex: 1;
  color: #212121;
}

.courier-val {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
}

.badge-gratis-ongkir {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 9px;
  font-weight: 800;
  color: #00aa5b;
  border: 1px solid #00aa5b;
  padding: 1px 4px;
  border-radius: 3px;
  letter-spacing: -0.2px;
  line-height: 1.1;
}

.badge-gratis-ongkir.badge-hidden {
  display: none;
}

.resi-val {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
}

.icon-copy-resi {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  opacity: 0.8;
  vertical-align: middle;
}

.address-row {
  margin-top: 2px;
}

.address-val {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.recipient-name {
  font-weight: 700;
  color: #212121;
}

.recipient-phone {
  color: #212121;
  font-weight: 400;
}

.recipient-address-line {
  color: #212121;
  font-weight: 400;
}

/* Section 4: Rincian Pembayaran */
.payment-section {
  padding-top: 14px;
  padding-bottom: 24px;
}

.payment-heading-row {
  margin-bottom: 12px;
}

.payment-table {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.payment-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
}

.pay-label {
  color: #6d7588;
  font-weight: 400;
}

.pay-value {
  color: #212121;
  font-weight: 500;
}

.pay-value.dark {
  font-weight: 600;
}

.pay-sub-spacer {
  height: 4px;
}

.payment-row.total-row {
  margin-top: 8px;
  padding-top: 6px;
}

.total-label {
  font-size: 13.5px;
  font-weight: 800;
  color: #212121;
}

.total-amount {
  font-size: 13.5px;
  font-weight: 800;
  color: #212121;
}

/* Footer Notice Note */
.receipt-footer-note {
  margin-top: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.bulb-icon-wrap {
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.note-text {
  font-size: 11.5px;
  color: #6d7588;
  line-height: 1.35;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background-color: #111827;
  color: white;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: all 0.2s ease;
  z-index: 100;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================================
   DATE PICKER QUICK ACTIONS & HELPER STYLES
   ========================================================== */

.date-quick-actions {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.btn-chip {
  background-color: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 9999px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  color: #374151;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.btn-chip:hover {
  background-color: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
}

.sub-label {
  font-size: 11px;
  color: #6b7280;
  margin-bottom: 2px;
  display: block;
}

.helper-text {
  font-size: 11px;
  color: #00aa5b;
  margin-top: 3px;
  display: block;
}

/* ==========================================================
   MOBILE TAB BAR & RESPONSIVE CONTAINER
   ========================================================== */

.mobile-tab-nav {
  display: none;
  background-color: #ffffff;
  border-bottom: 1.5px solid var(--border-color);
  position: sticky;
  top: 56px;
  z-index: 40;
}

.mobile-tab-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 16px;
  font-size: 13px;
  font-weight: 700;
  border: none;
  background: transparent;
  color: #475569;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: all 0.15s ease;
}

.mobile-tab-btn.active {
  color: #0f172a;
  border-bottom-color: #0f172a;
  background-color: #f1f5f9;
}

.preview-scale-wrapper {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  width: 100%;
  transform-origin: top center;
  transition: transform 0.15s ease;
}

.mobile-floating-actions {
  display: none;
}

/* ==========================================================
   MOBILE MEDIA QUERIES (<= 768px)
   ========================================================== */

@media (max-width: 768px) {
  .app-header {
    height: 56px;
    padding: 0 14px;
  }

  .header-brand h1 {
    font-size: 18px;
  }

  .header-brand .tag {
    display: inline-block;
  }

  .btn-sm {
    padding: 6px 10px;
    font-size: 12px;
  }

  .mobile-tab-nav {
    display: flex;
    top: 56px;
  }

  .main-layout {
    display: block;
    min-height: calc(100vh - 104px);
  }

  .desktop-only-buttons {
    display: none !important;
  }

  /* Dynamic Tab Switching on Mobile */
  .main-layout.tab-editor .editor-pane {
    display: block;
    height: auto;
    max-height: none;
  }

  .main-layout.tab-editor .preview-pane {
    display: none;
  }

  .main-layout.tab-preview .editor-pane {
    display: none;
  }

  .main-layout.tab-preview .preview-pane {
    display: flex;
    height: calc(100vh - 104px);
  }

  .preview-viewport {
    padding: 16px 8px 90px 8px;
    overflow-x: hidden;
  }

  /* Floating Bottom Actions in Preview Tab */
  .main-layout.tab-preview .mobile-floating-actions {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid var(--border-color);
    padding: 10px 14px;
    gap: 10px;
    z-index: 60;
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.1);
  }

  .btn-mobile-action {
    flex: 1;
    height: 44px;
    font-size: 13.5px;
    font-weight: 700;
    border-radius: 8px;
  }

  /* Form and Touch Targets */
  input[type="text"],
  input[type="number"],
  input[type="date"],
  input[type="time"],
  select,
  textarea {
    font-size: 14px;
    padding: 10px 12px;
    border-radius: 8px;
  }

  .editor-scroll {
    padding: 14px 12px 80px 12px;
  }

  .form-card {
    border-radius: 10px;
  }
}
