/* ==========================================================================
   0xnLabs POS & SHIPPING LABEL SYSTEM
   Styles & Thermal Print Precision Engine
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600;700;800&family=Outfit:wght@400;600;700;800;900&display=swap');

:root {
  --bg-dark: #ebf0f7;
  --bg-card: #ebf0f7;
  --bg-card-elevated: #f4f7fb;
  --bg-card-hover: #ffffff;
  --bg-input: #e2e8f0;

  --neu-flat: 8px 8px 20px rgba(166, 180, 200, 0.45), -8px -8px 20px #ffffff;
  --neu-elevated: 12px 12px 28px rgba(166, 180, 200, 0.55), -10px -10px 24px #ffffff;
  --neu-inset: inset 3px 3px 7px rgba(166, 180, 200, 0.45), inset -3px -3px 7px #ffffff;
  --neu-pressed: inset 2px 2px 5px rgba(166, 180, 200, 0.5), inset -2px -2px 5px #ffffff;

  --border-subtle: rgba(203, 213, 225, 0.8);
  --border-glow: rgba(124, 58, 237, 0.25);
  --border-active: #7c3aed;

  --cyan: #7c3aed;
  --cyan-dim: rgba(124, 58, 237, 0.1);
  --emerald: #059669;
  --emerald-dim: rgba(5, 150, 105, 0.1);
  --crimson: #e11d48;
  --crimson-dim: rgba(225, 29, 72, 0.1);
  --amber: #d97706;
  --amber-dim: rgba(217, 119, 6, 0.1);

  --text-main: #0f172a;
  --text-muted: #475569;
  --text-dim: #64748b;

  --font-brand: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --trans-fast: 0.15s ease;
  --trans-smooth: 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Dark Mode Theme */
body.dark-mode {
  --bg-dark: #0b0f19;
  --bg-card: #111827;
  --bg-card-elevated: #162032;
  --bg-card-hover: #1e293b;
  --bg-input: #0f172a;

  --neu-flat: 6px 6px 16px rgba(0, 0, 0, 0.6), -6px -6px 16px rgba(30, 41, 59, 0.4);
  --neu-elevated: 10px 10px 24px rgba(0, 0, 0, 0.7), -8px -8px 20px rgba(30, 41, 59, 0.5);
  --neu-inset: inset 3px 3px 6px rgba(0, 0, 0, 0.6), inset -3px -3px 6px rgba(30, 41, 59, 0.3);
  --neu-pressed: inset 2px 2px 4px rgba(0, 0, 0, 0.7), inset -2px -2px 4px rgba(30, 41, 59, 0.3);

  --border-subtle: #243048;
  --border-glow: rgba(139, 92, 246, 0.35);

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-body);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Top App Header */
.pos-header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-subtle);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
}

.pos-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text-main);
}

.pos-brand-badge {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--cyan-dim);
  color: var(--cyan);
  border: 1px solid var(--cyan);
}

.pos-mode-pills {
  display: flex;
  background: var(--bg-input);
  padding: 4px;
  border-radius: 999px;
  box-shadow: var(--neu-inset);
  gap: 4px;
}

.pos-mode-btn {
  border: none;
  background: transparent;
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 700;
  font-family: var(--font-brand);
  color: var(--text-muted);
  border-radius: 999px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: var(--trans-fast);
}

.pos-mode-btn.active {
  background: var(--bg-card);
  color: var(--cyan);
  box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.1);
}

.pos-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Base Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 10px;
  font-family: var(--font-brand);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: var(--trans-fast);
  text-decoration: none;
}

.btn-primary {
  background: var(--cyan);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(124, 58, 237, 0.35);
}

.btn-primary:hover {
  background: #6d28d9;
  transform: translateY(-1px);
}

.btn-emerald {
  background: var(--emerald);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(5, 150, 105, 0.35);
}

.btn-emerald:hover {
  background: #047857;
  transform: translateY(-1px);
}

.btn-outline {
  background: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
  box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.05);
}

.btn-outline:hover {
  border-color: var(--cyan);
  color: var(--cyan);
}

.btn-icon {
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 10px;
  background: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--trans-fast);
}

.btn-icon:hover {
  border-color: var(--cyan);
  color: var(--cyan);
}

/* Main Two-Column Layout */
.pos-workspace {
  flex: 1;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 20px;
  padding: 20px;
  max-width: 1540px;
  margin: 0 auto;
  width: 100%;
}

@media (max-width: 1100px) {
  .pos-workspace {
    grid-template-columns: 1fr;
  }
}

/* Left Panel: Catalog & Form */
.pos-panel {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.pos-card {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 20px;
  border: 1px solid var(--border-subtle);
  box-shadow: var(--neu-flat);
}

.pos-card-title {
  font-family: var(--font-brand);
  font-size: 16px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  letter-spacing: -0.01em;
}

/* Catalog Toolbar */
.catalog-toolbar {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.catalog-search {
  flex: 1;
  min-width: 200px;
  position: relative;
}

.catalog-search input {
  width: 100%;
  padding: 9px 14px 9px 38px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 13px;
  outline: none;
  box-shadow: var(--neu-inset);
  transition: var(--trans-fast);
}

.catalog-search input:focus {
  border-color: var(--cyan);
}

.catalog-search svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
}

.category-chips {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.category-chip {
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  font-family: var(--font-brand);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: var(--trans-fast);
}

.category-chip.active,
.category-chip:hover {
  background: var(--cyan-dim);
  border-color: var(--cyan);
  color: var(--cyan);
}

/* Products Grid */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 12px;
  max-height: 520px;
  overflow-y: auto;
  padding-right: 4px;
}

.product-item {
  background: var(--bg-card-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 12px;
  cursor: pointer;
  transition: var(--trans-smooth);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  position: relative;
  overflow: hidden;
}

.product-item:hover {
  transform: translateY(-2px);
  border-color: var(--cyan);
  box-shadow: 0 8px 20px rgba(124, 58, 237, 0.15);
}

.product-item-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 10px;
  font-family: var(--font-mono);
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--bg-input);
  color: var(--text-dim);
}

.product-item-name {
  font-family: var(--font-brand);
  font-size: 14px;
  font-weight: 800;
  color: var(--text-main);
  padding-right: 32px;
}

.product-item-desc {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
}

.product-item-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px dashed var(--border-subtle);
}

.product-item-price {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 800;
  color: var(--emerald);
}

.product-item-btn {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: none;
  background: var(--cyan);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--trans-fast);
}

.product-item-btn:hover {
  transform: scale(1.1);
}

/* Custom Item Row */
.custom-item-bar {
  display: grid;
  grid-template-columns: 2fr 1.2fr 0.8fr auto;
  gap: 8px;
  align-items: center;
  background: var(--bg-card-elevated);
  padding: 10px;
  border-radius: 12px;
  border: 1px dashed var(--border-subtle);
}

.input-flat {
  padding: 8px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  color: var(--text-main);
  font-size: 13px;
  font-family: var(--font-body);
  outline: none;
  box-shadow: var(--neu-inset);
}

.input-flat:focus {
  border-color: var(--cyan);
}

/* Shipping Details Form (Resi Pengiriman) */
.shipping-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-group-full {
  grid-column: 1 / -1;
}

.form-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  font-family: var(--font-brand);
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.courier-picker {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.courier-option {
  padding: 8px;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  text-align: center;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  font-family: var(--font-brand);
  color: var(--text-muted);
  transition: var(--trans-fast);
}

.courier-option.active,
.courier-option:hover {
  border-color: var(--cyan);
  color: var(--cyan);
  background: var(--cyan-dim);
}

/* Right Panel: Cart & Live Receipt */
.pos-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 8px;
}

.pos-tab-link {
  border: none;
  background: transparent;
  padding: 8px 14px;
  font-family: var(--font-brand);
  font-size: 14px;
  font-weight: 800;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: var(--trans-fast);
}

.pos-tab-link.active {
  background: var(--bg-card-elevated);
  color: var(--cyan);
  border: 1px solid var(--border-subtle);
}

/* Cart Items Table */
.cart-items-wrap {
  max-height: 280px;
  overflow-y: auto;
  margin-bottom: 16px;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: var(--bg-card-elevated);
}

.cart-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.cart-table th {
  background: var(--bg-input);
  padding: 8px 12px;
  text-align: left;
  font-size: 11px;
  font-family: var(--font-brand);
  color: var(--text-dim);
  text-transform: uppercase;
}

.cart-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-subtle);
}

.cart-qty-ctrl {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-card);
  padding: 2px 6px;
  border-radius: 6px;
  border: 1px solid var(--border-subtle);
}

.cart-qty-btn {
  border: none;
  background: transparent;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
  color: var(--text-main);
  padding: 0 4px;
}

.cart-qty-val {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 12px;
}

.cart-del-btn {
  border: none;
  background: transparent;
  color: var(--crimson);
  cursor: pointer;
  font-size: 16px;
  padding: 4px;
}

/* Billing Calculation Summary */
.billing-summary {
  background: var(--bg-card-elevated);
  border-radius: 12px;
  padding: 14px;
  border: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.billing-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--text-muted);
}

.billing-row.total {
  font-size: 18px;
  font-weight: 900;
  color: var(--text-main);
  border-top: 1px dashed var(--border-subtle);
  padding-top: 8px;
  margin-top: 4px;
}

.billing-val {
  font-family: var(--font-mono);
  font-weight: 700;
}

.billing-val.total-val {
  color: var(--emerald);
  font-size: 20px;
}

/* Payment Methods & Quick Cash Buttons */
.pay-methods {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.pay-method-btn {
  padding: 10px;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  text-align: center;
  cursor: pointer;
  font-family: var(--font-brand);
  font-weight: 800;
  font-size: 12px;
  color: var(--text-muted);
  transition: var(--trans-fast);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.pay-method-btn.active,
.pay-method-btn:hover {
  border-color: var(--cyan);
  color: var(--cyan);
  background: var(--cyan-dim);
}

.quick-cash-row {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.quick-cash-chip {
  padding: 4px 10px;
  background: var(--bg-input);
  border-radius: 6px;
  font-size: 11px;
  font-family: var(--font-mono);
  font-weight: 700;
  cursor: pointer;
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
}

.quick-cash-chip:hover {
  border-color: var(--emerald);
  color: var(--emerald);
}

/* ==========================================================================
   REALISTIC THERMAL PAPER RECEIPT PREVIEW (Screen Visual)
   ========================================================================== */
.receipt-stage-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.receipt-controls-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  flex-wrap: wrap;
  gap: 10px;
}

.paper-width-switch {
  display: inline-flex;
  background: var(--bg-input);
  padding: 3px;
  border-radius: 8px;
  box-shadow: var(--neu-inset);
  gap: 3px;
}

.paper-width-btn {
  border: none;
  background: transparent;
  padding: 4px 10px;
  font-size: 11px;
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--text-muted);
  border-radius: 6px;
  cursor: pointer;
}

.paper-width-btn.active {
  background: var(--bg-card);
  color: var(--cyan);
  box-shadow: 1px 1px 4px rgba(0, 0, 0, 0.1);
}

/* Thermal Paper Visual */
.thermal-sheet {
  background: #ffffff;
  color: #000000;
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15), 0 2px 6px rgba(0, 0, 0, 0.08);
  position: relative;
  margin: 0 auto;
  transition: width 0.2s ease;
  user-select: text;
  box-sizing: border-box;
  max-width: 100%;
}

/* 58mm Width: ~320px screen width representation */
.thermal-sheet.width-58mm {
  width: 310px;
  max-width: 100%;
  padding: 16px 12px;
  font-size: 11px;
  line-height: 1.35;
  box-sizing: border-box;
}

/* 80mm Width: ~380px screen width representation */
.thermal-sheet.width-80mm {
  width: 380px;
  max-width: 100%;
  padding: 16px 12px;
  font-size: 11px;
  line-height: 1.35;
  box-sizing: border-box;
}

/* 100x150mm Shipping Label Sticker: ~420px screen width representation */
.thermal-sheet.width-shipping-label {
  width: 420px;
  max-width: 100%;
  padding: 16px 14px;
  font-size: 11px;
  line-height: 1.35;
  border: 2px solid #000;
  box-sizing: border-box;
}

/* PDF Generation Mode: 100% responsive width inside html2pdf container so borders and text never get clipped */
.html2pdf__overlay {
  opacity: 1 !important;
  background: transparent !important;
  pointer-events: none !important;
}

.html2pdf__container,
.html2pdf__container * {
  box-sizing: border-box !important;
}

.html2pdf__container {
  background: #ffffff !important;
  color: #000000 !important;
}

.thermal-sheet,
.thermal-sheet * {
  box-sizing: border-box !important;
}

.html2pdf__container .thermal-sheet,
.thermal-sheet.pdf-export-active {
  box-sizing: border-box !important;
  margin: 0 auto !important;
  box-shadow: none !important;
}

.html2pdf__container .thermal-sheet.width-80mm,
.thermal-sheet.pdf-export-active.width-80mm {
  width: 262px !important;
  max-width: 262px !important;
  min-width: 262px !important;
  padding: 8px 8px !important;
  font-size: 9.5px !important;
  line-height: 1.35 !important;
}

.html2pdf__container .thermal-sheet.width-shipping-label,
.thermal-sheet.pdf-export-active.width-shipping-label {
  width: 330px !important;
  max-width: 330px !important;
  min-width: 330px !important;
  padding: 12px 10px !important;
  font-size: 10px !important;
}

.html2pdf__container .thermal-sheet::before,
.html2pdf__container .thermal-sheet::after,
.thermal-sheet.pdf-export-active::before,
.thermal-sheet.pdf-export-active::after {
  display: none !important;
}

#receipt-render-area {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.pdf-batch-sheet-wrap,
.pdf-continuous-sheet-wrap,
.pdf-page-sheet-wrap {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 auto !important;
  box-sizing: border-box !important;
  background: #ffffff !important;
}

.pdf-batch-separator {
  display: block !important;
  width: 100% !important;
  margin: 4mm auto !important;
  padding: 3mm 0 1mm 0 !important;
  border-top: 1.5px dashed #000000 !important;
  text-align: center !important;
  font-family: 'Space Grotesk', 'Courier New', monospace !important;
  font-size: 10px !important;
  font-weight: 800 !important;
  letter-spacing: 1px !important;
  color: #000000 !important;
  background: #ffffff !important;
  box-sizing: border-box !important;
}

.html2pdf__page-break {
  display: block !important;
  height: 0 !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  clear: both !important;
}

/* Paper Jagged Tear Top & Bottom Effect */
.thermal-sheet::before,
.thermal-sheet::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 8px;
  background-size: 12px 8px;
}

.thermal-sheet::before {
  top: -8px;
  background-image: radial-gradient(circle at 6px 8px, transparent 6px, #ffffff 6px);
}

.thermal-sheet::after {
  bottom: -8px;
  background-image: radial-gradient(circle at 6px 0px, transparent 6px, #ffffff 6px);
}

/* No jagged effect for shipping label stickers (sharp cut sticker) */
.thermal-sheet.width-shipping-label::before,
.thermal-sheet.width-shipping-label::after {
  display: none;
}

/* Thermal Content Elements */
.th-center {
  text-align: center;
}

.th-bold {
  font-weight: 800;
}

.th-divider {
  border: none;
  border-top: 1px dashed #000;
  margin: 8px 0;
}

.th-double-divider {
  border: none;
  border-top: 2px solid #000;
  margin: 8px 0;
}

.th-row {
  display: flex;
  justify-content: space-between;
}

.th-title {
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 1px;
}

.th-subtitle {
  font-size: 10px;
  color: #333;
}

.th-table {
  width: 100%;
  border-collapse: collapse;
}

.th-table td {
  padding: 2px 0;
  vertical-align: top;
}

.th-barcode-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 10px 0 4px;
}

.th-barcode-svg {
  max-width: 90%;
  height: 48px;
}

.th-qr-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 10px 0;
}

.th-qr-canvas {
  width: 96px;
  height: 96px;
}

/* Shipping Label Layout Components */
.ship-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2px solid #000;
  padding-bottom: 8px;
  margin-bottom: 8px;
}

.ship-courier-logo {
  font-size: 22px;
  font-weight: 900;
  letter-spacing: -1px;
}

.ship-service-type {
  font-size: 14px;
  font-weight: 900;
  border: 2px solid #000;
  padding: 2px 8px;
  border-radius: 4px;
}

.ship-awb-box {
  text-align: center;
  border-bottom: 2px solid #000;
  padding: 6px 0 10px;
  margin-bottom: 8px;
}

.ship-awb-num {
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 1px;
  margin-top: 4px;
}

.ship-party-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 10px;
  border-bottom: 2px solid #000;
  padding-bottom: 8px;
  margin-bottom: 8px;
}

.ship-party-box {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ship-party-title {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  background: #000;
  color: #fff;
  padding: 1px 4px;
  display: inline-block;
  align-self: flex-start;
  margin-bottom: 2px;
}

.ship-party-name {
  font-size: 13px;
  font-weight: 800;
}

.ship-party-phone {
  font-size: 11px;
  font-weight: 700;
}

.ship-party-addr {
  font-size: 10px;
  line-height: 1.3;
}

.ship-meta-row {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid #000;
  padding: 4px 0;
  font-size: 10px;
}

.ship-fragile-alert {
  border: 2px solid #000;
  padding: 6px;
  text-align: center;
  font-weight: 900;
  font-size: 11px;
  letter-spacing: 0.5px;
  margin: 8px 0;
  background: #f0f0f0;
}

/* QRIS Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  z-index: 999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-backdrop.open {
  display: flex;
}

.modal-dialog {
  background: var(--bg-card);
  border-radius: 18px;
  padding: 24px;
  max-width: 440px;
  width: 100%;
  border: 1px solid var(--border-subtle);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Toast Notification */
.pos-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--text-main);
  color: var(--bg-dark);
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 1000;
  pointer-events: none;
}

.pos-toast.show {
  transform: translateY(0);
  opacity: 1;
}

/* Multi-Buyer Orders Queue */
.orders-queue-box {
  background: var(--bg-card-elevated);
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  margin-bottom: 16px;
}

.orders-queue-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.orders-tabs-scroll {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
}

.order-tab-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 11px;
  border-radius: 8px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--trans-fast);
  user-select: none;
}

.order-tab-pill:hover {
  border-color: var(--cyan);
  color: var(--text-main);
}

.order-tab-pill.active {
  background: #000;
  color: #fff;
  border-color: #000;
}

body.dark-mode .order-tab-pill.active {
  background: #fff;
  color: #000;
  border-color: #fff;
}

.order-tab-idx {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(125, 125, 125, 0.2);
}

.order-tab-name {
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.order-tab-del {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 4px;
  font-size: 11px;
  line-height: 1;
  opacity: 0.6;
  transition: opacity 0.2s, background-color 0.2s;
  cursor: pointer;
  margin-left: 2px;
}

.order-tab-del:hover {
  opacity: 1;
  background: rgba(239, 68, 68, 0.25);
  color: #ef4444;
}

.btn-blue {
  background: #2563eb !important;
  color: #ffffff !important;
  border: 1px solid #2563eb !important;
}

.btn-blue:hover {
  background: #1d4ed8 !important;
  border-color: #1d4ed8 !important;
  color: #ffffff !important;
}

.receipt-action-bar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
}

.receipt-action-row {
  display: flex;
  gap: 10px;
  width: 100%;
}

/* ==========================================================================
   SMART PASTE & BUYER FORM MODAL
   ========================================================================== */
.pos-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.pos-modal-backdrop.show {
  opacity: 1;
  pointer-events: auto;
}

.pos-modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  width: 100%;
  max-width: 540px;
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.6);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: posModalPop 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes posModalPop {
  from {
    transform: scale(0.94) translateY(10px);
    opacity: 0;
  }
  to {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
}

.pos-modal-header {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-card-elevated);
}

.pos-modal-body {
  padding: 18px 20px;
}

/* ==========================================================================
   PRINT ENGINE STYLES (@media print)
   Optimized for 58mm roll, 80mm roll, and 100x150mm shipping sticker
   ========================================================================== */
@media print {
  html, body {
    background: #ffffff !important;
    color: #000000 !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: visible !important;
    display: block !important;
  }

  /* Sembunyikan seluruh elemen antarmuka layar input dan navigasi */
  .pos-header,
  .pos-form-panel,
  .pos-card-title,
  .paper-width-switch,
  .receipt-controls-bar,
  .receipt-action-bar,
  .orders-queue-box,
  .pos-toast,
  .modal-backdrop,
  .pos-modal-backdrop,
  .no-print {
    display: none !important;
  }

  .pos-workspace,
  .pos-preview-panel,
  .pos-card,
  .receipt-stage-wrap,
  #receipt-render-area {
    display: block !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    box-shadow: none !important;
    background: transparent !important;
  }

  .thermal-sheet {
    box-sizing: border-box !important;
    box-shadow: none !important;
    margin: 0 auto !important;
    padding: 2mm 3mm !important;
    color: #000000 !important;
    background: #ffffff !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
    page-break-after: avoid !important;
    break-after: avoid !important;
    height: auto !important;
    min-height: 0 !important;
  }
  .thermal-sheet * {
    box-sizing: border-box !important;
  }

  .thermal-sheet::before,
  .thermal-sheet::after {
    display: none !important;
  }

  /* Ukuran Cetak Dinamis */
  body.print-mode-80mm {
    width: 80mm !important;
    max-width: 80mm !important;
  }
  body.print-mode-80mm .thermal-sheet {
    width: 72mm !important;
    max-width: 72mm !important;
    padding: 2mm 2.5mm !important;
    font-size: 8.5pt !important;
    border: 1.5px solid #000 !important;
  }

  body.print-mode-shipping {
    width: 100mm !important;
    max-width: 100mm !important;
  }
  body.print-mode-shipping .thermal-sheet {
    width: 96mm !important;
    max-width: 96mm !important;
    font-size: 10pt !important;
    border: 2px solid #000 !important;
  }

  @page {
    margin: 0;
  }
}
