/* ========================================================
   GENERATOR NOTA DIGITAL - MULKAN PRINTING
   Modern Design System & Print Layout
======================================================== */

:root {
  --primary: #c62828;
  --primary-hover: #b71c1c;
  --secondary: #1e293b;
  --accent-blue: #1565c0;
  --bg-app: #0f172a;
  --bg-surface: #1e293b;
  --bg-surface-elevated: #334155;
  --border-ui: #475569;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --paper-bg: #ffffff;
  --paper-text: #111827;
  --paper-border: #1f2937;
  --success: #16a34a;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --shadow-paper: 0 20px 40px -15px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(0, 0, 0, 0.1);
  --shadow-ui: 0 4px 12px rgba(0, 0, 0, 0.25);
}

* {
  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-app);
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* App Container Layout */
.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Top App Header */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 24px;
  background: rgba(30, 41, 59, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-ui);
  position: sticky;
  top: 0;
  z-index: 100;
}

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

.badge-icon {
  font-size: 26px;
}

.brand-text h1 {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #ffffff;
}

.brand-text p {
  font-size: 0.82rem;
  color: var(--text-muted);
}

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

/* Button Styles */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-primary {
  background: linear-gradient(135deg, #e53935, #c62828);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(198, 40, 40, 0.4);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #ef5350, #d32f2f);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(198, 40, 40, 0.5);
}

.btn-new {
  background: var(--bg-surface-elevated);
  color: #f1f5f9;
  border: 1px solid var(--border-ui);
}

.btn-new:hover {
  background: #475569;
  border-color: #64748b;
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-surface-elevated);
  color: #f1f5f9;
  border: 1px solid var(--border-ui);
}

.btn-secondary:hover {
  background: #475569;
  transform: translateY(-1px);
}

.btn-secondary.active {
  background: #0284c7;
  border-color: #38bdf8;
  color: #ffffff;
}

.btn-outline {
  background: transparent;
  border: 1px dashed #64748b;
  color: #38bdf8;
}

.btn-outline:hover {
  background: rgba(56, 189, 248, 0.1);
  border-color: #38bdf8;
}

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

/* Main Split View */
.app-main {
  display: grid;
  grid-template-columns: 460px 1fr;
  flex: 1;
  overflow: hidden;
  height: calc(100vh - 65px);
}

/* Left Editor Panel */
.editor-panel {
  background: var(--bg-surface);
  border-right: 1px solid var(--border-ui);
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.panel-section {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 16px;
}

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

.section-title.space-between {
  justify-content: space-between;
}

.section-title .title-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title h3 {
  font-size: 0.92rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #cbd5e1;
}

.section-title .icon {
  font-size: 16px;
}

/* Form Controls */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
}

.form-group label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

.form-group input,
.form-group select {
  background: #0f172a;
  border: 1px solid var(--border-ui);
  border-radius: var(--radius-sm);
  color: #ffffff;
  padding: 8px 12px;
  font-size: 0.85rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
}

.input-with-action {
  display: flex;
  gap: 6px;
}

.input-with-action input {
  flex: 1;
}

.input-with-action button {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-ui);
  color: #fff;
  border-radius: var(--radius-sm);
  padding: 0 10px;
  cursor: pointer;
  transition: 0.2s;
}

.input-with-action button:hover {
  background: #475569;
}

/* Presets Chips */
.preset-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  background: rgba(30, 41, 59, 0.9);
  color: #e2e8f0;
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 5px 10px;
  border-radius: 20px;
  font-size: 0.76rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.chip:hover {
  background: #c62828;
  color: #ffffff;
  border-color: #e53935;
  transform: translateY(-1px);
}

/* Header Kolom Berlabel */
.items-header-bar {
  display: grid;
  grid-template-columns: 75px minmax(0, 1fr) 95px 28px;
  gap: 8px;
  padding: 0 4px 6px 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 8px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #94a3b8;
}

.items-header-bar .col-head-qty {
  text-align: center;
}

.items-header-bar .col-head-price {
  text-align: right;
}

/* Items Editor List */
.items-editor-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
  max-height: 290px;
  overflow-y: auto;
  overflow-x: hidden; /* Hilangkan scrollbar horizontal */
  padding-right: 2px;
}

.item-edit-row {
  display: grid;
  grid-template-columns: 75px minmax(0, 1fr) 95px 28px;
  gap: 8px;
  align-items: center;
  background: rgba(15, 23, 42, 0.75);
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-sizing: border-box;
  width: 100%;
  transition: all 0.15s ease;
}

.item-edit-row:hover {
  background: rgba(15, 23, 42, 0.95);
  border-color: rgba(56, 189, 248, 0.3);
}

.item-edit-row input {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  background: #1e293b;
  border: 1px solid #475569;
  border-radius: 4px;
  color: #fff;
  padding: 6px 8px;
  font-size: 0.82rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
}

.item-edit-row input:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 0 1px #38bdf8;
}

.item-edit-row input.edit-qty {
  text-align: center;
}

.item-edit-row input.edit-price {
  text-align: right;
  font-family: 'Space Mono', monospace;
}

.btn-del-item {
  width: 28px;
  height: 28px;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #f87171;
  font-size: 14px;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.15s ease;
}

.btn-del-item:hover {
  background: #ef4444;
  color: #ffffff;
  border-color: #ef4444;
  transform: scale(1.05);
}

.summary-inputs {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 12px;
  margin-top: 10px;
}

.help-text {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Right Panel: Live Receipt Preview */
.preview-panel {
  background: #090d16;
  overflow-y: auto;
  padding: 30px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.paper-wrapper {
  perspective: 1000px;
}

/* The Paper Sheet (¼ F4 proportioned: 10.5cm x 16.5cm) */
.nota-paper {
  width: 396px; /* 10.5cm at 96 DPI */
  min-height: 624px; /* 16.5cm at 96 DPI */
  background: var(--paper-bg);
  color: var(--paper-text);
  padding: 12px 14px;
  border-radius: 4px;
  box-shadow: var(--shadow-paper);
  position: relative;
  overflow: hidden;
  font-family: 'Plus Jakarta Sans', Arial, sans-serif;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease;
}


/* Nota Header */
.nota-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
  gap: 12px;
}

.brand-left {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.logo-box {
  width: 36px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.mp-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.company-details {
  display: flex;
  flex-direction: column;
}

.company-name {
  font-size: 0.70rem;
  font-weight: 900;
  color: #c62828;
  letter-spacing: 0.01em;
  line-height: 1.15;
  white-space: nowrap;
}

.company-sub {
  font-family: 'Dancing Script', cursive, serif;
  font-size: 0.85rem;
  font-weight: 700;
  color: #1565c0;
  line-height: 1.15;
  margin-top: 1px;
}

.company-address {
  font-size: 0.58rem;
  font-weight: 600;
  color: #4b5563;
  margin-top: 1px;
}

.company-phone {
  font-size: 0.64rem;
  font-weight: 800;
  color: #c62828;
  margin-top: 1px;
  display: flex;
  align-items: center;
  gap: 3px;
}

.phone-icon {
  font-size: 8px;
}


/* Right Meta Info (Clean Aligned Grid - Professional Commercial Receipt) */
.meta-right.meta-grid {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 214px;
  gap: 2.5px;
  padding-top: 1px;
}

.meta-grid .meta-row {
  display: flex;
  align-items: baseline;
  width: 100%;
  font-size: 0.62rem;
  line-height: 1.35;
}

.meta-grid .meta-lbl {
  width: 50px;
  flex-shrink: 0;
  color: #111827;
  font-weight: 700;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.meta-grid .meta-sep {
  width: 8px;
  flex-shrink: 0;
  text-align: center;
  color: #111827;
  font-weight: 700;
}

.meta-grid .meta-val {
  flex: 1;
  min-width: 0;
  color: #111827;
  font-weight: 500;
  padding-left: 2px;
  line-height: 1.25;
}

.meta-grid .meta-val.meta-val-no,
.meta-grid .meta-row:nth-child(2) .meta-val {
  white-space: nowrap;
}

.meta-grid .meta-val.meta-val-no {
  font-weight: 800;
  letter-spacing: 0.02em;
  font-size: 0.66rem;
}

.meta-grid .meta-val.meta-val-cust {
  font-weight: 700;
  font-size: 0.62rem;
}

/* Table Design */
.nota-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.66rem;
  margin-bottom: 4px;
  table-layout: fixed;
}

.nota-table th {
  background: #f8fafc;
  color: #c62828;
  font-weight: 700;
  font-size: 0.66rem;
  letter-spacing: 0.01em;
  padding: 4px 4px;
  border: 1px solid #1f2937;
  line-height: 1.2;
  text-align: center;
  vertical-align: middle;
}

.nota-table th.col-banyak {
  width: 14%;
  text-align: center;
  vertical-align: middle;
  padding: 3px 2px;
}

.nota-table th.col-nama {
  width: 42%;
  text-align: left;
  vertical-align: middle;
  padding-left: 6px;
}

.nota-table th.col-harga {
  width: 20%;
  text-align: center;
  vertical-align: middle;
  padding: 3px 4px;
}

.nota-table th.col-jumlah {
  width: 24%;
  text-align: center;
  vertical-align: middle;
  padding: 3px 4px;
}

.nota-table td {
  padding: 3px 5px;
  border: 1px solid #374151;
  color: #111827;
  line-height: 1.25;
  vertical-align: middle;
  font-weight: 400; /* Regular, tidak bold */
}

.col-banyak { width: 14%; text-align: center; font-weight: 400; }
.col-nama   { width: 42%; word-break: break-word; font-weight: 400; }
.col-harga  { width: 20%; font-weight: 400; font-size: 0.65rem; }
.col-jumlah { width: 24%; font-weight: 400; font-size: 0.65rem; }

/* Split Currency Layout: "Rp" di kiri, angka di kanan lurus sejajar */
.cell-currency {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  width: 100%;
}

.curr-sym {
  font-size: 0.60rem;
  color: #111827;
  font-weight: 400;
  flex-shrink: 0;
  margin-right: 4px;
  line-height: 1;
}

.curr-num {
  font-size: 0.65rem;
  color: #111827;
  font-weight: 400;
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
  line-height: 1;
  margin-left: auto;
}

.text-center { text-align: center; }
.text-right  { text-align: right; }
.font-bold   { font-weight: 700; }
.text-red    { color: #c62828; }

.empty-row td {
  height: 21px;
}

/* Footer Table Summary */
.nota-table tfoot td {
  border: 1px solid #374151;
  background: #ffffff;
}

.nota-table tfoot td.blank-cell {
  border-left: none;
  border-bottom: none;
  border-right: none;
  background: transparent !important;
}

.row-calc td {
  padding: 2.5px 5px;
  font-size: 0.64rem;
  vertical-align: middle;
}

.grand-title {
  font-size: 0.78rem;
  font-weight: 800;
  font-style: italic;
  color: #c62828 !important;
  background: #ffffff !important;
  white-space: nowrap;
  vertical-align: middle;
  letter-spacing: 0.04em;
  padding: 3px 5px;
  border-top: 1px solid #1f2937 !important;
  border-bottom: 3px double #1f2937 !important;
  border-left: 1px solid #1f2937 !important;
  border-right: 1px solid #1f2937 !important;
}

.grand-amount {
  font-size: 0.68rem;
  color: #111827;
  background: #ffffff !important;
  vertical-align: middle;
  padding: 3px 5px;
  border-top: 1px solid #1f2937 !important;
  border-bottom: 3px double #1f2937 !important;
  border-left: 1px solid #1f2937 !important;
  border-right: 1px solid #1f2937 !important;
}

.grand-amount .curr-sym {
  font-size: 0.62rem;
  font-weight: 600;
  color: #111827;
}

.grand-amount .curr-num {
  font-size: 0.68rem;
  font-weight: 600;
  color: #111827;
  font-variant-numeric: tabular-nums;
}

/* Section Bawah: Box Perhatian & Tanda Tangan */
.nota-bottom-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 6px;
}

.perhatian-wrapper {
  display: flex;
  justify-content: flex-start;
}

/* Rounded Red Warning Box (TB Sinar Abadi / Ajat Plastik / Bakul @lit standard) */
.perhatian-box {
  border: 1.5px solid #c62828;
  border-radius: 6px;
  box-shadow: 2px 2px 0px #c62828;
  padding: 3px 7px;
  display: inline-block;
  background: #ffffff;
  max-width: 220px;
}

.perhatian-title {
  font-size: 0.58rem;
  font-weight: 900;
  color: #c62828;
  letter-spacing: 0.03em;
  margin-bottom: 1px;
}

.perhatian-desc {
  font-size: 0.46rem;
  font-weight: 700;
  color: #111827;
  line-height: 1.25;
  text-transform: uppercase;
}

/* Signatures & Barcode Section */
.nota-footer {
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  margin-top: 6px;
}

.sig-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  text-align: center;
  width: 130px;
}

.sig-title {
  font-size: 0.68rem;
  font-weight: 700;
  color: #111827;
  line-height: 1.2;
}

.sig-spacer {
  flex: 1;
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sig-dots {
  font-size: 0.65rem;
  font-weight: 700;
  color: #111827;
  letter-spacing: 0.01em;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

/* QR Code E-Signature Card */
.qr-signature-card {
  position: relative;
  margin: 2px 0;
  padding: 2px;
  background: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 5px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  display: inline-flex;
  flex-direction: column;
  align-items: center;
}

.qr-canvas-holder {
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
}

.qr-canvas-holder img,
.qr-canvas-holder canvas {
  width: 52px !important;
  height: 52px !important;
  display: block;
}

.sig-signer-name {
  font-size: 0.68rem;
  font-weight: 800;
  color: #111827;
  letter-spacing: 0.01em;
  line-height: 1.2;
}

/* Blanko Mode Specific Adjustments */
body.blanko-mode .meta-grid .meta-val {
  border-bottom: 1px dotted #111827;
  min-height: 14px;
}

/* ========================================================
   PRINT MEDIA STYLES (Optimized for 1/4 F4: 10.5cm x 16.5cm)
======================================================== */
@media print {
  @page {
    size: 105mm 165mm;
    margin: 4mm 5mm;
  }

  html, body {
    background: #ffffff !important;
    color: #000000 !important;
    height: auto !important;
    overflow: visible !important;
  }

  .no-print {
    display: none !important;
  }

  .app-container, .app-main, .preview-panel, .paper-wrapper {
    display: block !important;
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
    height: auto !important;
    overflow: visible !important;
  }

  .nota-paper {
    width: 100% !important;
    max-width: 105mm !important;
    min-height: auto !important;
    box-shadow: none !important;
    border: none !important;
    padding: 0 !important;
    border-radius: 0 !important;
  }

  /* Make sure borders print crisp */
  .nota-table th,
  .nota-table td {
    border-color: #000000 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .mp-logo-img,
  .qr-signature-card {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}

/* Responsive UI */
@media (max-width: 1100px) {
  .app-main {
    grid-template-columns: 1fr;
    height: auto;
    overflow: visible;
  }
  .editor-panel {
    border-right: none;
    border-bottom: 1px solid var(--border-ui);
    height: auto;
  }
  .preview-panel {
    padding: 20px 10px;
    height: auto;
  }
  .nota-paper {
    width: 100%;
    max-width: 595px;
  }
}

/* Elegant Notification Toast */
#app-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #0f172a;
  color: #38bdf8;
  border: 1px solid #0284c7;
  padding: 10px 20px;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 700;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
  opacity: 0;
  transform: translateY(15px);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
  z-index: 9999;
}
#app-toast.toast-show {
  opacity: 1;
  transform: translateY(0);
}

/* Custom Instant Confirmation Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 16px;
  animation: modalFadeIn 0.12s ease-out;
}

.modal-card {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 16px;
  padding: 24px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
  animation: modalPopIn 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.modal-icon {
  font-size: 26px;
  line-height: 1;
}

.modal-header h3 {
  font-size: 1.15rem;
  font-weight: 800;
  color: #ffffff;
  margin: 0;
}

.modal-desc {
  font-size: 0.88rem;
  color: #cbd5e1;
  line-height: 1.55;
  margin-bottom: 22px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.btn-modal-confirm {
  background: #2563eb !important;
  color: #ffffff !important;
  border: none !important;
}

.btn-modal-confirm:hover {
  background: #1d4ed8 !important;
  transform: translateY(-1px);
}

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

@keyframes modalPopIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

/* History Modal & Dashboard Styles */
.modal-card-lg {
  max-width: 720px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-history-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 14px;
}

.modal-history-header h3 {
  font-size: 1.2rem;
  font-weight: 800;
  color: #ffffff;
  margin: 0;
}

.history-subtitle {
  font-size: 0.78rem;
  color: #94a3b8;
  margin-top: 2px;
}

.btn-close-modal {
  background: transparent;
  border: none;
  font-size: 1.6rem;
  color: #94a3b8;
  cursor: pointer;
  line-height: 1;
  padding: 0 4px;
}

.btn-close-modal:hover {
  color: #ffffff;
}

.history-stats-bar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 14px;
}

.stat-box {
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 10px;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
}

.stat-label {
  font-size: 0.72rem;
  color: #94a3b8;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.stat-value {
  font-size: 1.15rem;
  font-weight: 800;
  color: #f8fafc;
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
}

.stat-highlight .stat-value {
  color: #38bdf8;
}

.history-search-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.history-search-bar input {
  flex: 1;
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 8px 12px;
  color: #ffffff;
  font-size: 0.82rem;
}

.history-search-bar input:focus {
  outline: none;
  border-color: #38bdf8;
}

.history-table-container {
  flex: 1;
  overflow-y: auto;
  border: 1px solid #334155;
  border-radius: 10px;
  background: #0f172a;
  min-height: 180px;
  max-height: 380px;
}

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

.history-table th {
  position: sticky;
  top: 0;
  background: #1e293b;
  padding: 10px 12px;
  font-size: 0.72rem;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  border-bottom: 1px solid #334155;
  z-index: 1;
}

.history-table td {
  padding: 10px 12px;
  font-size: 0.8rem;
  color: #e2e8f0;
  border-bottom: 1px solid #1e293b;
  vertical-align: middle;
}

.history-table tr:hover td {
  background: rgba(56, 189, 248, 0.05);
}

.history-nota-badge {
  font-family: 'Space Mono', monospace;
  font-weight: 700;
  color: #38bdf8;
  font-size: 0.78rem;
}

.history-state-text {
  text-align: center;
  padding: 30px;
  color: #94a3b8;
  font-size: 0.85rem;
}

.btn-reprint {
  background: #0284c7;
  color: #ffffff;
  border: none;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-reprint:hover {
  background: #0369a1;
  transform: translateY(-1px);
}

.btn-del-record {
  background: none;
  border: none;
  color: #ef4444;
  font-size: 0.9rem;
  cursor: pointer;
  padding: 4px;
  margin-left: 6px;
  border-radius: 4px;
}

.btn-del-record:hover {
  background: rgba(239, 68, 68, 0.15);
}

.status-tag {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
}

.status-tag.lunas {
  background: #064e3b;
  color: #34d399;
}

.status-tag.dp {
  background: #78350f;
  color: #fbbf24;
}

.status-tag.tempo {
  background: #450a0a;
  color: #f87171;
}

