/* ==========================================================================
   Sistem Pembelian Pulsa & Bukti Transaksi (Mitra Bukalapak)
   ========================================================================== */

:root {
  --primary-color: #d91d57;
  --primary-hover: #b81446;
  --primary-light: #fff0f3;
  --accent-pink: #f89cb0;
  --text-dark: #1e293b;
  --text-muted: #64748b;
  --bg-page: #f1f5f9;
  --bg-card: #ffffff;
  --border-color: #e2e8f0;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.08), 0 2px 4px -1px rgba(0,0,0,0.04);
  --shadow-lg: 0 10px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.04);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
}

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

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-page);
  color: var(--text-dark);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

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

.logo-badge {
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.brand-mitra {
  font-size: 14px;
  font-weight: 800;
  color: var(--primary-color);
  letter-spacing: -0.2px;
}

.brand-bukalapak {
  font-size: 15px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.3px;
}

.pos-tag {
  background: var(--primary-light);
  color: var(--primary-color);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 20px;
  margin-left: 8px;
  border: 1px solid rgba(217, 29, 87, 0.2);
}

.header-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #059669;
  background: #ecfdf5;
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid #a7f3d0;
}

.status-dot {
  width: 8px;
  height: 8px;
  background-color: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.25);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

/* Layout Split: Left 30%, Right 70% */
.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.main-layout {
  display: flex;
  flex: 1;
  padding: 24px;
  gap: 28px;
  max-width: 1540px;
  margin: 0 auto;
  width: 100%;
}

.left-column {
  flex: 0 0 33%;
  max-width: 33%;
}

.right-column {
  flex: 0 0 67%;
  max-width: 67%;
  display: flex;
  flex-direction: column;
}

/* Card Styles */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-md);
  padding: 24px;
}

.card-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
}

.card-icon {
  width: 42px;
  height: 42px;
  background: var(--primary-light);
  color: var(--primary-color);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-title {
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
}

.card-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Form Styles */
.form-group {
  margin-bottom: 16px;
}

.form-group.mb-0 {
  margin-bottom: 0;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #334155;
  margin-bottom: 6px;
}

.label-with-badge {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.label-with-badge label {
  margin-bottom: 0 !important;
}

.locked-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  background-color: #f1f5f9;
  padding: 2px 8px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
}

.input-locked {
  background-color: #f1f5f9 !important;
  color: #334155 !important;
  font-weight: 700 !important;
  cursor: not-allowed !important;
  border-color: #cbd5e1 !important;
  user-select: none;
}

.input-locked:focus {
  box-shadow: none !important;
  border-color: #cbd5e1 !important;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  font-size: 14px;
  font-family: inherit;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background-color: #f8fafc;
  color: #1e293b;
  transition: all 0.2s ease;
}

.form-control-sm {
  padding: 8px 10px;
  font-size: 13px;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary-color);
  background-color: #ffffff;
  box-shadow: 0 0 0 3px rgba(217, 29, 87, 0.12);
}

.form-control:disabled {
  background-color: #f1f5f9;
  color: #94a3b8;
  cursor: not-allowed;
  border-color: #e2e8f0;
}

.btn-clear-input {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease;
}

.btn-clear-input:hover {
  color: var(--primary-color);
  background-color: var(--primary-light);
}

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

.flex-1 {
  flex: 1;
}

/* Custom Package Panel & Quick Save */
.add-pkg-box {
  background: #fdf2f4;
  border: 1px solid rgba(217, 29, 87, 0.25);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 14px;
  animation: slideDown 0.2s ease-out;
}

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

.add-pkg-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.add-pkg-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--primary-color);
}

.btn-close-sm {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 13px;
  padding: 2px 6px;
  border-radius: 4px;
  transition: all 0.15s;
}

.btn-close-sm:hover {
  background: rgba(217, 29, 87, 0.1);
  color: var(--primary-color);
}

.mb-2 {
  margin-bottom: 8px !important;
}

.add-pkg-actions {
  margin-top: 10px;
}

.custom-pkg-list-container {
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px dashed rgba(217, 29, 87, 0.25);
}

.custom-pkg-list-title {
  font-size: 11.5px;
  font-weight: 700;
  color: #64748b;
  margin-bottom: 8px;
}

.custom-pkg-items-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 140px;
  overflow-y: auto;
}

.pkg-item-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #ffffff;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(217, 29, 87, 0.15);
  font-size: 12px;
}

.pkg-item-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.pkg-item-name {
  font-weight: 700;
  color: #1e293b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pkg-item-price {
  font-size: 11px;
  color: var(--primary-color);
  font-weight: 600;
}

.btn-delete-pkg {
  background: #fee2e2;
  border: 1px solid #fca5a5;
  color: #dc2626;
  border-radius: 4px;
  padding: 4px 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  flex-shrink: 0;
  margin-left: 8px;
}

.btn-delete-pkg:hover {
  background: #dc2626;
  color: #ffffff;
  border-color: #dc2626;
}

.empty-custom-pkg {
  font-size: 11.5px;
  color: #94a3b8;
  font-style: italic;
  padding: 4px 0;
}

.btn-primary-sm {
  background-color: var(--primary-color);
  color: #ffffff;
  border: none;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 700;
  border-radius: var(--radius-sm);
  cursor: pointer;
  width: 100%;
  transition: background 0.2s;
}

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

.quick-save-pkg-row {
  margin-top: -8px;
  margin-bottom: 14px;
}

.btn-link-save {
  background: none;
  border: none;
  color: #0284c7;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 0;
  transition: color 0.15s;
}

.btn-link-save:hover {
  color: #0369a1;
  text-decoration: underline;
}

/* Datetime Settings Box */
.datetime-settings-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 14px;
  margin: 18px 0;
}

.datetime-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.section-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 0 !important;
}

.btn-text-action {
  background: none;
  border: none;
  color: var(--primary-color);
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: background 0.15s;
}

.btn-text-action:hover {
  background: var(--primary-light);
  text-decoration: underline;
}

.datetime-mode-toggle {
  display: flex;
  gap: 16px;
  margin-bottom: 12px;
  background: #ffffff;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid #e2e8f0;
}

.radio-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
}

.radio-label input[type="radio"] {
  accent-color: var(--primary-color);
  cursor: pointer;
}

.datetime-inputs-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.9fr 0.7fr;
  gap: 8px;
  transition: opacity 0.2s ease;
}

.sub-label {
  font-size: 11.5px !important;
  color: #64748b !important;
  font-weight: 600 !important;
  margin-bottom: 4px !important;
}

/* Button Group */
.button-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 20px;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  width: 100%;
}

.btn-primary {
  background-color: var(--primary-color);
  color: #ffffff;
  box-shadow: 0 2px 4px rgba(217, 29, 87, 0.3);
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(217, 29, 87, 0.35);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-download {
  background-color: #0284c7;
  color: #ffffff;
  box-shadow: 0 2px 4px rgba(2, 132, 199, 0.25);
  flex: 1;
}

.btn-download:hover {
  background-color: #0369a1;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(2, 132, 199, 0.35);
}

.btn-download:active {
  transform: translateY(0);
}

.btn-secondary {
  background-color: #f1f5f9;
  color: #334155;
  border: 1px solid var(--border-color);
  flex: 1;
}

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

/* Preset Quick Helpers */
.quick-helpers {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
}

.helper-title {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}

.helper-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.btn-tag {
  background: #f8fafc;
  border: 1px solid var(--border-color);
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 600;
  color: #475569;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-tag:hover {
  background: var(--primary-light);
  border-color: rgba(217, 29, 87, 0.3);
  color: var(--primary-color);
}

/* ==========================================================================
   RIGHT COLUMN & RECEIPT PREVIEW (USING COVER TEMPLATE)
   ========================================================================== */

.preview-wrapper {
  background: #ffffff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-md);
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100%;
}

.preview-toolbar {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 18px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border-color);
}

.toolbar-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  color: #334155;
}

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

.btn-tool {
  background: #f8fafc;
  border: 1px solid var(--border-color);
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  color: #475569;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.btn-tool:hover {
  background: #e2e8f0;
  color: #0f172a;
}

/* ==========================================================================
   RECEIPT CONTAINER WITH COVER BACKGROUND (cover.png)
   ========================================================================== */

.receipt-outer {
  position: relative;
  background-color: #ffffff;
  width: 440px;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  box-shadow: 0 4px 25px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(0, 0, 0, 0.04);
  border-radius: 4px;
  font-family: 'Roboto', 'Arial', sans-serif;
  color: #000000;
  user-select: text;
}

.receipt-with-cover {
  background-image: url('cover.png');
  background-size: 100% 100%;
  background-position: center top;
  background-repeat: no-repeat;
  min-height: 720px;
}

/* Spacer to match top logo in cover.png */
.cover-logo-spacer {
  height: 155px;
  width: 100%;
  flex-shrink: 0;
}

/* Receipt Inner Body */
.receipt-inner {
  padding: 0 38px 45px 38px;
  display: flex;
  flex-direction: column;
  background: transparent;
}

/* Header Titles */
.receipt-header-titles {
  text-align: center;
  margin-bottom: 24px;
}

.receipt-title {
  font-size: 23px;
  font-weight: 900;
  color: #000000;
  margin-bottom: 6px;
  letter-spacing: -0.2px;
}

.receipt-agent {
  font-size: 16px;
  font-weight: 800;
  color: #000000;
  letter-spacing: 0.2px;
}

/* Package Title */
.receipt-package-title {
  font-size: 16.5px;
  font-weight: 800;
  color: #000000;
  margin-bottom: 12px;
  padding-left: 2px;
  word-break: break-word;
}

/* Data Rows & Separators */
.receipt-data-rows {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.receipt-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  font-size: 16px;
  line-height: 1.35;
  color: #000000;
  font-weight: 800;
  padding: 4px 2px;
}

.row-label {
  font-weight: 800;
  letter-spacing: 0.1px;
  flex-shrink: 0;
}

.row-value-group {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  text-align: right;
  font-weight: 800;
}

.row-value {
  font-weight: 800;
  text-align: right;
  word-break: break-all;
}

.serial-val {
  font-size: 15px;
  letter-spacing: -0.1px;
  font-weight: 800;
}

.total-val {
  font-size: 17px;
  font-weight: 900;
}

/* Exact 7 rounded dashed line pills matching image_3.png & 100% html2canvas exportable */
.receipt-divider-dashes {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: 10px 0;
  width: 100%;
}

.dash-pill {
  flex: 1;
  height: 5.5px;
  background-color: #7d7882;
  border-radius: 3px;
  display: block;
  -webkit-print-color-adjust: exact !important;
  print-color-adjust: exact !important;
}

/* Receipt Footer Messages */
.receipt-footer {
  margin-top: 36px;
  text-align: center;
  font-size: 15.5px;
  font-weight: 800;
  color: #000000;
  line-height: 1.35;
}

.footer-msg-1 {
  margin-bottom: 28px;
}

.footer-msg-2 {
  margin-bottom: 10px;
}

/* Toast Message */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background-color: #0f172a;
  color: #ffffff;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 8px;
}

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

/* ==========================================================================
   PRINT SPECIFICATION (@media print)
   ========================================================================== */
@media print {
  body {
    background: #ffffff !important;
    padding: 0 !important;
    margin: 0 !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  .app-header,
  .left-column,
  .preview-toolbar,
  .quick-helpers,
  .toast {
    display: none !important;
  }

  .main-layout {
    display: block !important;
    padding: 0 !important;
    margin: 0 !important;
    max-width: none !important;
  }

  .right-column,
  .preview-wrapper {
    background: none !important;
    box-shadow: none !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  .receipt-outer {
    box-shadow: none !important;
    border: none !important;
    width: 440px !important;
    margin: 0 auto !important;
    page-break-inside: avoid;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
}

/* ==========================================================================
   HEADER RIGHT ACTIONS & HISTORY MODAL POPUP
   ========================================================================== */

.header-right-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-header-history {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background-color: #f8fafc;
  color: #334155;
  border: 1px solid var(--border-color);
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 700;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-header-history:hover {
  background-color: #f1f5f9;
  border-color: #cbd5e1;
  color: #0f172a;
}

.header-badge-count {
  background-color: var(--primary-color);
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
  padding: 1px 7px;
  border-radius: 12px;
}

/* Modal Overlay & Dialog */
.modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease-out;
}

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

.modal-dialog {
  background: #ffffff;
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(0, 0, 0, 0.05);
  width: 100%;
  max-width: 1120px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalScaleUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalScaleUp {
  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: center;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-color);
  background: #ffffff;
}

.modal-close-btn {
  background: #f1f5f9;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: #64748b;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.modal-close-btn:hover {
  background: #fee2e2;
  color: #dc2626;
}

.modal-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 24px;
  background: #f8fafc;
  border-bottom: 1px solid var(--border-color);
  flex-wrap: wrap;
}

.modal-body {
  padding: 0;
  overflow-y: auto;
  flex: 1;
}

.history-title-group {
  display: flex;
  align-items: center;
  gap: 14px;
}

.history-icon {
  background: #f0fdf4;
  color: #16a34a;
}

.title-with-count {
  display: flex;
  align-items: center;
  gap: 10px;
}

.badge-counter {
  background: #e2e8f0;
  color: #334155;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
}

.history-search-wrapper {
  width: 240px;
}

.history-filter-select {
  width: 170px;
  background-color: #ffffff;
}

.btn-tool-danger {
  color: #dc2626 !important;
}

.btn-tool-danger:hover {
  background-color: #fee2e2 !important;
  color: #b91c1c !important;
}

/* History Table */
.history-table-wrapper {
  overflow-x: auto;
  background: #ffffff;
}

.history-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
}

.history-table th {
  background: #f8fafc;
  color: #475569;
  font-weight: 700;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 10;
}

.history-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  color: #1e293b;
  vertical-align: middle;
}

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

.history-table tr:hover {
  background-color: #f8fafc;
}

.history-empty-cell {
  text-align: center;
  color: #94a3b8;
  padding: 40px !important;
  font-style: italic;
}

/* History Type Badges */
.history-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 20px;
  white-space: nowrap;
}

.badge-proses {
  background-color: #eff6ff;
  color: #2563eb;
  border: 1px solid #bfdbfe;
}

.badge-unduh {
  background-color: #f0fdf4;
  color: #16a34a;
  border: 1px solid #bbf7d0;
}

.badge-cetak {
  background-color: #faf5ff;
  color: #9333ea;
  border: 1px solid #e9d5ff;
}

.sn-code {
  font-family: 'Courier New', Courier, monospace;
  font-size: 11.5px;
  font-weight: 700;
  color: #334155;
  background: #f1f5f9;
  padding: 2px 6px;
  border-radius: 4px;
}

.pkg-cell-name {
  font-weight: 700;
  color: #0f172a;
}

.pkg-cell-price {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--primary-color);
}

.table-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-table-load {
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  color: #0284c7;
  padding: 5px 8px;
  font-size: 11.5px;
  font-weight: 700;
  border-radius: 4px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s;
}

.btn-table-load:hover {
  background: #0284c7;
  color: #ffffff;
}

.btn-table-del {
  background: #fee2e2;
  border: 1px solid #fca5a5;
  color: #dc2626;
  padding: 5px 6px;
  border-radius: 4px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.btn-table-del:hover {
  background: #dc2626;
  color: #ffffff;
}

/* ==========================================================================
   RESPONSIVE DESIGN (Tablets and Mobile)
   ========================================================================== */
@media (max-width: 960px) {
  .main-layout {
    flex-direction: column;
    padding: 16px;
    gap: 20px;
  }

  .left-column,
  .right-column {
    flex: 0 0 100%;
    max-width: 100%;
  }

  .receipt-outer {
    width: 100%;
    max-width: 420px;
  }

  .modal-dialog {
    max-height: 95vh;
  }

  .modal-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .history-search-wrapper,
  .history-filter-select {
    width: 100%;
  }
}
