:root {
  --bg-dark: #07090e;
  --bg-card: rgba(17, 24, 39, 0.75);
  --bg-card-hover: rgba(31, 41, 55, 0.85);
  --bg-glass: rgba(15, 23, 42, 0.65);
  
  --border-color: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.18);
  
  --primary-blue: #0284c7;
  --primary-blue-glow: rgba(2, 132, 199, 0.25);
  --costco-red: #e11d48;
  --costco-red-glow: rgba(225, 29, 72, 0.25);
  --savings-green: #10b981;
  --savings-green-glow: rgba(16, 185, 129, 0.2);
  --accent-purple: #8b5cf6;
  --accent-amber: #f59e0b;

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-subtle: #64748b;
  
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  
  --shadow-card: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 25px rgba(2, 132, 199, 0.2);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-dark);
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.5;
  overflow-x: hidden;
  position: relative;
  -webkit-font-smoothing: antialiased;
}

/* Background Ambient Glows */
.bg-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  pointer-events: none;
  z-index: 0;
}

.bg-glow-blue {
  width: 500px;
  height: 500px;
  top: -100px;
  left: 10%;
  background: radial-gradient(circle, rgba(2, 132, 199, 0.18) 0%, transparent 70%);
}

.bg-glow-red {
  width: 450px;
  height: 450px;
  top: 150px;
  right: 5%;
  background: radial-gradient(circle, rgba(225, 29, 72, 0.12) 0%, transparent 70%);
}

/* Top App Header */
.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(7, 9, 14, 0.8);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
  padding: 16px 24px;
}

.header-container {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-logo {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.logo-costco {
  font-size: 1.4rem;
  color: #ffffff;
  background: linear-gradient(135deg, #ffffff 40%, #e2e8f0 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.logo-tag {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--costco-red);
  letter-spacing: 1px;
}

/* Badges & Buttons */
.badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  letter-spacing: 0.3px;
}

.badge-pulse {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
  position: relative;
}

.badge-pulse::before {
  content: '';
  width: 6px;
  height: 6px;
  background: #10b981;
  border-radius: 50%;
  margin-right: 6px;
  box-shadow: 0 0 8px #10b981;
}

.badge-blue {
  background: rgba(2, 132, 199, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(2, 132, 199, 0.3);
}

.badge-purple {
  background: rgba(139, 92, 246, 0.15);
  color: #a78bfa;
  border: 1px solid rgba(139, 92, 246, 0.3);
}

.badge-green {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 9px 18px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-primary {
  background: linear-gradient(135deg, var(--costco-red) 0%, #be123c 100%);
  color: white;
  box-shadow: 0 4px 14px var(--costco-red-glow);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(225, 29, 72, 0.4);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-main);
  border-color: var(--border-color);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--border-hover);
}

.icon {
  width: 16px;
  height: 16px;
}

/* Main Container */
.main-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 32px 24px 80px;
  position: relative;
  z-index: 1;
}

/* Stats Section */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  box-shadow: var(--shadow-card);
  transition: transform 0.2s, border-color 0.2s;
}

.stat-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-hover);
}

.stat-label {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.stat-value {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -1px;
  line-height: 1.1;
  margin-bottom: 6px;
}

.stat-meta {
  font-size: 0.8rem;
  color: var(--text-subtle);
}

.text-gradient-blue {
  background: linear-gradient(135deg, #38bdf8 0%, #0284c7 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.text-gradient-green {
  background: linear-gradient(135deg, #34d399 0%, #059669 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.text-gradient-purple {
  background: linear-gradient(135deg, #c084fc 0%, #7c3aed 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.text-gradient-amber {
  background: linear-gradient(135deg, #fbbf24 0%, #d97706 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Search Hero Section */
.search-section {
  margin-bottom: 32px;
}

.search-container {
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-card);
}

.search-bar-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  margin-bottom: 14px;
}

.search-icon {
  position: absolute;
  left: 18px;
  width: 20px;
  height: 20px;
  color: var(--primary-blue);
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 15px 120px 15px 50px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  color: white;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 500;
  outline: none;
  transition: all 0.2s;
}

.search-input:focus {
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 3px var(--primary-blue-glow);
  background: rgba(0, 0, 0, 0.6);
}

.search-input::placeholder {
  color: var(--text-subtle);
  font-weight: 400;
}

.btn-clear {
  position: absolute;
  right: 85px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  padding: 4px 8px;
}

.shortcut-pill {
  position: absolute;
  right: 14px;
  font-size: 0.75rem;
  color: var(--text-subtle);
  pointer-events: none;
}

.shortcut-pill kbd {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 2px 6px;
  font-family: var(--font-mono);
  font-weight: 600;
}

/* Filter & Tabs Bar */
.filters-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-label {
  font-size: 0.8rem;
  color: var(--text-subtle);
  font-weight: 600;
  margin-right: 4px;
}

.filter-chip {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.filter-chip:hover {
  background: rgba(255, 255, 255, 0.09);
  color: var(--text-main);
}

.filter-chip.active {
  background: var(--primary-blue);
  color: white;
  border-color: var(--primary-blue);
  box-shadow: 0 2px 10px var(--primary-blue-glow);
}

.view-switch-group {
  display: flex;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 3px;
}

.btn-tab {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 6px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-tab.active {
  background: rgba(255, 255, 255, 0.12);
  color: white;
}

/* Results Section */
.results-section {
  margin-top: 10px;
}

.results-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 20px;
  padding: 0 4px;
}

.results-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: white;
}

.results-count {
  font-size: 0.85rem;
  color: var(--text-subtle);
  font-weight: 500;
}

/* Purchases Cards Grid */
.purchases-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 18px;
}

.purchase-card {
  background: var(--bg-card);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-card);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.purchase-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
  transform: translateY(-3px);
  box-shadow: 0 12px 35px -8px rgba(0, 0, 0, 0.7);
}

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.item-badge-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.item-num-tag {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.05);
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px solid var(--border-color);
}

.channel-tag {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 4px;
}

.channel-warehouse {
  background: rgba(2, 132, 199, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(2, 132, 199, 0.3);
}

.channel-online {
  background: rgba(139, 92, 246, 0.15);
  color: #c084fc;
  border: 1px solid rgba(139, 92, 246, 0.3);
}

.item-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: white;
  line-height: 1.35;
  cursor: pointer;
  transition: color 0.15s;
}

.item-name:hover {
  color: var(--primary-blue);
}

.card-pricing {
  text-align: right;
  flex-shrink: 0;
}

.price-net {
  font-size: 1.3rem;
  font-weight: 800;
  color: white;
  font-family: var(--font-mono);
}

.price-meta {
  font-size: 0.75rem;
  color: var(--text-subtle);
  font-family: var(--font-mono);
}

.discount-pill {
  display: inline-flex;
  font-size: 0.7rem;
  font-weight: 700;
  color: #34d399;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 1px 6px;
  border-radius: 4px;
  margin-top: 4px;
}

.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border-color);
  padding-top: 14px;
  margin-top: 14px;
  font-size: 0.8rem;
  color: var(--text-subtle);
}

.footer-location {
  display: flex;
  align-items: center;
  gap: 5px;
}

.btn-receipt-link {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s;
}

.btn-receipt-link:hover {
  background: rgba(255, 255, 255, 0.08);
  color: white;
  border-color: var(--border-hover);
}

/* Data Table (Receipts & History) */
.receipts-container {
  background: var(--bg-card);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.data-table th {
  background: rgba(0, 0, 0, 0.4);
  padding: 14px 18px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-color);
}

.data-table td {
  padding: 14px 18px;
  font-size: 0.875rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-main);
}

.data-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  background: var(--bg-card);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-lg);
}

.empty-icon {
  width: 48px;
  height: 48px;
  color: var(--text-subtle);
  margin-bottom: 16px;
}

.empty-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: white;
  margin-bottom: 6px;
}

.empty-desc {
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.hidden, .hidden {
  display: none !important;
}

.modal-card {
  background: #0f172a;
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-lg);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8);
  width: 100%;
  max-width: 580px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  animation: modalIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-lg {
  max-width: 800px;
}

.modal-xl {
  max-width: 1050px;
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
}

.modal-title {
  font-size: 1.3rem;
  font-weight: 800;
  color: white;
  margin-top: 4px;
}

.modal-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.btn-modal-close {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  transition: all 0.15s;
}

.btn-modal-close:hover {
  background: rgba(255, 255, 255, 0.15);
  color: white;
}

.modal-body {
  padding: 24px;
}

/* Item History Modal Stats Strip */
.item-stats-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

.item-stat-box {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 14px;
}

.item-stat-box .lbl {
  font-size: 0.7rem;
  text-transform: uppercase;
  color: var(--text-subtle);
  font-weight: 700;
}

.item-stat-box .val {
  font-size: 1.25rem;
  font-weight: 800;
  color: white;
  font-family: var(--font-mono);
  margin-top: 2px;
}

.section-subtitle {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

/* Receipt Viewer Two-Column Layout */
.receipt-viewer-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

@media (max-width: 850px) {
  .receipt-viewer-body {
    grid-template-columns: 1fr;
  }
}

.receipt-summary-box {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 20px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.receipt-summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.receipt-summary-row.total-row {
  grid-column: span 2;
  border-top: 1px solid var(--border-color);
  padding-top: 10px;
  font-size: 1.1rem;
  font-weight: 800;
  color: white;
}

.receipt-items-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.receipt-item-row {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.receipt-preview-wrapper {
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 380px;
}

.receipt-preview-wrapper img {
  max-width: 100%;
  max-height: 500px;
  object-fit: contain;
}

/* Upload Dropzone */
.upload-dropzone {
  border: 2px dashed rgba(255, 255, 255, 0.18);
  border-radius: var(--radius-lg);
  padding: 40px 20px;
  text-align: center;
  background: rgba(0, 0, 0, 0.25);
  cursor: pointer;
  transition: all 0.2s;
}

.upload-dropzone:hover {
  border-color: var(--costco-red);
  background: rgba(225, 29, 72, 0.04);
}

.upload-icon {
  width: 44px;
  height: 44px;
  color: var(--costco-red);
  margin-bottom: 12px;
}

.upload-text {
  font-size: 0.95rem;
  color: var(--text-main);
  margin-bottom: 4px;
}

.upload-hint {
  font-size: 0.75rem;
  color: var(--text-subtle);
}

.upload-status {
  margin-top: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: var(--primary-blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ==========================================================================
   Return Voucher & Official Barcode (For Costco Returns Desk)
   ========================================================================== */
.return-voucher-card {
  background: #ffffff;
  color: #1e293b;
  border-radius: var(--radius-md);
  padding: 22px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  text-align: left;
}

.return-voucher-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px dashed #cbd5e1;
  padding-bottom: 12px;
  margin-bottom: 14px;
}

.voucher-brand {
  font-size: 1.25rem;
  font-weight: 900;
  color: #e11d48;
  letter-spacing: 0.5px;
}

.voucher-brand span {
  color: #0284c7;
}

.voucher-barcode-wrapper {
  background: #ffffff;
  padding: 12px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  text-align: center;
  margin-bottom: 14px;
}

.voucher-barcode-wrapper svg {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
}

.voucher-ref {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: #475569;
  margin-top: 6px;
  font-weight: 600;
}

.voucher-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  background: #f8fafc;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  margin-bottom: 14px;
}

.voucher-field label {
  font-size: 0.65rem;
  font-weight: 800;
  color: #64748b;
  letter-spacing: 0.5px;
  display: block;
  margin-bottom: 2px;
}

.voucher-field .field-val {
  font-size: 0.85rem;
  font-weight: 600;
  color: #0f172a;
}

.voucher-field .field-val.highlight {
  font-family: var(--font-mono);
  font-weight: 800;
  color: #0284c7;
}

.voucher-return-policy {
  font-size: 0.75rem;
  line-height: 1.45;
  color: #334155;
  background: #f1f5f9;
  padding: 10px 12px;
  border-left: 3px solid #0284c7;
  border-radius: 4px;
  margin-bottom: 14px;
}

.voucher-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

/* ==========================================================================
   OFFICIAL COSTCO RETURN SLIP PRINT STYLES
   - Hides browser headers (title, date) and footers (localhost URL, page numbers)
   - Eliminates blank pages by removing all app elements from print layout
   - Renders a clean, official single-page Costco Proof of Purchase / Return Slip
   ========================================================================== */

@page {
  size: letter portrait;
  margin: 0; /* Suppresses browser default headers (URL, title) and footers */
}

@media screen {
  #print-area {
    display: none !important;
  }
}

@media print {
  html, body {
    margin: 0 !important;
    padding: 0 !important;
    background: #ffffff !important;
    color: #000000 !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  /* Completely remove all application UI, headers, and modals from print flow */
  header, main, footer, .modal-overlay, body > *:not(#print-area) {
    display: none !important;
  }

  #print-area {
    display: block !important;
    visibility: visible !important;
    position: relative !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding: 12mm 16mm !important;
    margin: 0 auto !important;
    background: #ffffff !important;
    color: #000000 !important;
  }

  #print-area * {
    visibility: visible !important;
    box-sizing: border-box !important;
  }

  .print-slip {
    border: 2px solid #000000;
    border-radius: 4px;
    padding: 16px 20px;
    max-width: 720px;
    margin: 0 auto;
    background: #ffffff;
    page-break-inside: avoid;
  }

  .print-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #005e9e;
    padding-bottom: 10px;
    margin-bottom: 12px;
  }

  .print-brand {
    display: flex;
    align-items: baseline;
    gap: 8px;
  }

  .print-brand-costco {
    font-size: 26px;
    font-weight: 900;
    color: #e31837; /* Costco Red */
    font-family: Arial, sans-serif;
    letter-spacing: -0.5px;
  }

  .print-brand-sub {
    font-size: 15px;
    font-weight: 700;
    color: #005e9e; /* Costco Blue */
    font-family: Arial, sans-serif;
    letter-spacing: 1px;
  }

  .print-title-box {
    text-align: right;
  }

  .print-doc-title {
    font-size: 13px;
    font-weight: 800;
    color: #000000;
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }

  .print-doc-channel {
    font-size: 11px;
    font-weight: 600;
    color: #475569;
  }

  .print-barcode-box {
    background: #f8fafc;
    border: 1px dashed #64748b;
    border-radius: 4px;
    padding: 8px;
    text-align: center;
    margin-bottom: 12px;
  }

  #print-barcode-svg {
    max-width: 320px;
    height: 50px;
    margin: 0 auto;
    display: block;
  }

  .print-barcode-num {
    font-family: "Courier New", Courier, monospace;
    font-size: 13px;
    font-weight: 700;
    color: #000000;
    margin-top: 3px;
    letter-spacing: 1.5px;
  }

  .print-barcode-hint {
    font-size: 10px;
    color: #475569;
    margin-top: 2px;
  }

  .print-meta-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px 14px;
    font-size: 11px;
    line-height: 1.4;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    padding: 8px 12px;
    margin-bottom: 12px;
    background: #ffffff;
  }

  .print-meta-grid strong {
    color: #000000;
  }

  .print-meta-grid span {
    color: #1e293b;
  }

  .print-meta-grid .col-span-2 {
    grid-column: span 2;
  }

  .print-items-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 12px;
    font-size: 11px;
  }

  .print-items-table th {
    background: #f1f5f9;
    border-top: 1px solid #94a3b8;
    border-bottom: 2px solid #475569;
    padding: 6px 8px;
    text-align: left;
    font-weight: 700;
    color: #000000;
    font-size: 10px;
    text-transform: uppercase;
  }

  .print-items-table td {
    padding: 6px 8px;
    border-bottom: 1px solid #e2e8f0;
    color: #000000;
  }

  .print-items-table tr:nth-child(even) {
    background: #f8fafc;
  }

  .text-center { text-align: center; }
  .text-right { text-align: right; }

  .print-item-desc {
    font-weight: 600;
  }

  .print-item-disc {
    font-size: 10px;
    color: #047857;
    font-weight: 600;
  }

  .print-totals-wrapper {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 12px;
  }

  .print-totals-table {
    width: 260px;
    font-size: 11px;
    border-collapse: collapse;
  }

  .print-totals-table td {
    padding: 3px 6px;
  }

  .print-totals-table .total-label {
    text-align: left;
    color: #334155;
  }

  .print-totals-table .total-amount {
    text-align: right;
    font-family: "Courier New", Courier, monospace;
    font-weight: 700;
    color: #000000;
  }

  .print-totals-table .savings-row td {
    color: #047857;
  }

  .print-totals-table .grand-total-row td {
    border-top: 2px solid #000000;
    border-bottom: 2px solid #000000;
    font-size: 13px;
    font-weight: 800;
    padding: 5px 6px;
    color: #000000;
  }

  .print-footer-box {
    border-top: 1px solid #cbd5e1;
    padding-top: 8px;
    font-size: 10px;
    color: #475569;
    line-height: 1.4;
    text-align: center;
  }
}
