/* ============================================================
   RESET & GLOBAL
   ============================================================ */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
  background: #f0f2f5;
  min-height: 100vh;
  padding: 16px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.app {
  max-width: 1300px;
  width: 100%;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  padding: 20px 24px;
  position: relative;
}

/* ============================================================
   HEADER
   ============================================================ */
.header-pos {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 3px solid #1a3a5c;
  padding-bottom: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 10px;
}

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

.header-pos .title h1 {
  font-size: 24px;
  font-weight: 700;
  color: #1a3a5c;
}

.header-pos .title i {
  font-size: 28px;
  color: #e67e22;
}

.header-pos .store-info {
  text-align: right;
  font-size: 13px;
  color: #555;
  line-height: 1.5;
}

.header-pos .store-info strong {
  color: #1a3a5c;
}

/* ============================================================
   GRID LAYOUT
   ============================================================ */
.grid-pos {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
}

.grid-pos .card {
  flex: 1 1 calc(50% - 12px);
  min-width: 320px;
  background: #fff;
  border-radius: 12px;
  border: 1px solid #e0e4e8;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
}

@media (max-width: 760px) {
  .grid-pos .card {
    flex: 1 1 100%;
  }
}

.card-title {
  font-weight: 600;
  font-size: 15px;
  color: #1a3a5c;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid #eef2f6;
  padding-bottom: 10px;
  flex-wrap: wrap;
}

.card-title i {
  font-size: 15px;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  padding: 5px 12px;
  border: none;
  border-radius: 6px;
  font-weight: 500;
  cursor: pointer;
  font-size: 12px;
  transition: 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.btn-sm {
  padding: 3px 10px;
  font-size: 11px;
}

.btn-primary {
  background: #1a3a5c;
  color: #fff;
}
.btn-primary:hover {
  background: #0f2a44;
}

.btn-success {
  background: #27ae60;
  color: #fff;
}
.btn-success:hover {
  background: #1e8449;
}

.btn-danger {
  background: #e74c3c;
  color: #fff;
}
.btn-danger:hover {
  background: #c0392b;
}

.btn-warning {
  background: #f39c12;
  color: #fff;
}
.btn-warning:hover {
  background: #d68910;
}

.btn-outline {
  background: transparent;
  border: 1px solid #b0b8c2;
  color: #333;
}
.btn-outline:hover {
  background: #f0f2f5;
}

.btn-upload {
  background: #27ae60;
  color: #fff;
  padding: 6px 14px;
  border: none;
  border-radius: 6px;
  font-weight: 500;
  cursor: pointer;
  font-size: 12px;
  transition: 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-upload:hover {
  background: #1e8449;
}
.btn-upload input[type="file"] {
  display: none;
}

.btn-refresh {
  background: #2980b9;
  color: #fff;
  padding: 6px 14px;
  border: none;
  border-radius: 6px;
  font-weight: 500;
  cursor: pointer;
  font-size: 12px;
  transition: 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-refresh:hover {
  background: #1c5980;
}
.btn-refresh:disabled {
  background: #888;
  cursor: not-allowed;
}

.btn-thermal {
  background: #1a3a5c;
  color: #fff;
  padding: 10px 24px;
  border: none;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
  font-size: 16px;
  transition: 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  justify-content: center;
}
.btn-thermal:hover {
  background: #0f2a44;
}
.btn-thermal:disabled {
  background: #888;
  cursor: not-allowed;
}

.btn-bayar {
  background: #e67e22;
  color: #fff;
  padding: 10px 24px;
  border: none;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
  font-size: 16px;
  transition: 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  justify-content: center;
}
.btn-bayar:hover {
  background: #d35400;
}
.btn-bayar:disabled {
  background: #888;
  cursor: not-allowed;
}

.btn-submenu {
  background: #8e44ad;
  color: #fff;
  padding: 5px 14px;
  border: none;
  border-radius: 6px;
  font-weight: 500;
  cursor: pointer;
  font-size: 12px;
  transition: 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}
.btn-submenu:hover {
  background: #6c3483;
}

.btn-add-nota {
  background: #27ae60;
  color: #fff;
  padding: 8px 20px;
  border: none;
  border-radius: 30px;
  font-weight: 600;
  cursor: pointer;
  font-size: 13px;
  transition: 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  min-width: 110px;
  justify-content: center;
}
.btn-add-nota:hover {
  background: #1e8449;
  transform: scale(1.02);
}
.btn-add-nota i {
  font-size: 14px;
}

/* ============================================================
   BADGES
   ============================================================ */
.badge-count {
  background: #1a3a5c;
  color: #fff;
  padding: 0px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  line-height: 20px;
  display: inline-block;
}

.badge-history {
  background: #e67e22;
  color: #fff;
  padding: 0px 8px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 600;
  margin-left: 4px;
  line-height: 18px;
  display: inline-block;
}

/* ============================================================
   UPLOAD AREA
   ============================================================ */
.upload-area {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.upload-area .file-name {
  font-size: 12px;
  color: #555;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upload-progress {
  display: none;
  font-size: 13px;
  color: #1a3a5c;
}
.upload-progress.show {
  display: inline;
}

/* ============================================================
   SEARCH BOX
   ============================================================ */
.search-box {
  display: flex;
  gap: 8px;
  margin: 10px 0 12px;
  position: relative;
}

.search-box input {
  flex: 1;
  padding: 8px 14px;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 14px;
  outline: none;
  transition: 0.2s;
}
.search-box input:focus {
  border-color: #1a3a5c;
  box-shadow: 0 0 0 3px rgba(26, 58, 92, 0.1);
}

.search-box .search-hint {
  position: absolute;
  right: 50px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 11px;
  color: #aaa;
  pointer-events: none;
  background: #f5f5f5;
  padding: 2px 10px;
  border-radius: 4px;
  border: 1px solid #e0e0e0;
  transition: all 0.2s;
  cursor: pointer;
}
.search-box .search-hint:hover {
  background: #e8e8e8;
}
.search-box .search-hint.active {
  color: #1a3a5c;
  font-weight: 600;
  border-color: #1a3a5c;
  background: #eef6ff;
}

/* ============================================================
   TABLES
   ============================================================ */
.table-wrap {
  max-height: 390px;
  overflow-y: auto;
  border-radius: 8px;
  border: 1px solid #e8ecf1;
  flex: 1;
  overflow-x: hidden;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  table-layout: fixed;
}

th {
  background: #f7f9fc;
  text-align: left;
  padding: 8px 6px;
  font-weight: 600;
  color: #1a3a5c;
  border-bottom: 2px solid #dce1e8;
  position: sticky;
  top: 0;
  z-index: 2;
}

td {
  padding: 6px 6px;
  border-bottom: 1px solid #edf0f4;
  vertical-align: middle;
  font-weight: normal;
}

tr:hover td {
  background: #f8faff;
}

/* Kolom lebar fix */
.table-wrap table th:nth-child(1),
.table-wrap table td:nth-child(1) {
  width: 55px;
  min-width: 55px;
  max-width: 55px;
}
.table-wrap table th:nth-child(2),
.table-wrap table td:nth-child(2) {
  width: auto;
  min-width: 120px;
  white-space: normal;
  word-wrap: break-word;
}
.table-wrap table th:nth-child(3),
.table-wrap table td:nth-child(3) {
  width: 110px;
  min-width: 110px;
  max-width: 110px;
  text-align: right;
}
.table-wrap table th:nth-child(4),
.table-wrap table td:nth-child(4) {
  width: auto;
  min-width: 160px;
}
.table-wrap table td:nth-child(3) {
  text-align: right;
}

/* ============================================================
   QTY CELL
   ============================================================ */
.qty-cell {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: nowrap;
  justify-content: flex-end;
}

.qty-cell input.qty-input {
  width: 44px;
  padding: 4px 2px;
  border: 1px solid #ccc;
  border-radius: 4px;
  text-align: center;
  font-size: 12px;
  font-weight: normal;
  flex-shrink: 0;
}
.qty-cell input.qty-input:focus {
  border-color: #1a3a5c;
  outline: none;
  box-shadow: 0 0 0 2px rgba(26, 58, 92, 0.15);
}

.qty-cell input.price-input {
  width: 60px;
  padding: 4px 2px;
  border: 1px solid #e67e22;
  border-radius: 4px;
  text-align: right;
  font-size: 11px;
  font-weight: normal;
  color: #e67e22;
  display: none;
  background: #fffdf7;
  flex-shrink: 0;
}
.qty-cell input.price-input:focus {
  border-color: #e67e22;
  outline: none;
  box-shadow: 0 0 0 2px rgba(230, 126, 34, 0.2);
  background: #fff;
}
.qty-cell input.price-input.show {
  display: inline-block;
}

.qty-cell .price-label {
  font-size: 9px;
  color: #e67e22;
  font-weight: 600;
  display: none;
  margin-left: 2px;
  flex-shrink: 0;
}
.qty-cell .price-label.show {
  display: inline;
}

.qty-cell .btn-add-nota {
  padding: 4px 10px;
  font-size: 11px;
  min-width: 65px;
  flex-shrink: 0;
  border-radius: 20px;
}
.qty-cell .btn-add-nota i {
  font-size: 11px;
}

/* ============================================================
   FILTER BUTTONS
   ============================================================ */
.filter-buttons {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.filter-buttons .btn {
  background: #f0f2f5;
  border: 1px solid #dce1e8;
  color: #333;
}
.filter-buttons .btn:hover {
  background: #e0e4e8;
}
.filter-buttons .btn.active-filter {
  background: #1a3a5c;
  color: #fff;
  border-color: #1a3a5c;
}
.filter-buttons .btn .filter-count {
  background: rgba(0, 0, 0, 0.15);
  padding: 0 6px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 700;
  margin-left: 2px;
}
.filter-buttons .btn.active-filter .filter-count {
  background: rgba(255, 255, 255, 0.25);
}

/* ============================================================
   DB INFO BOX
   ============================================================ */
.db-info-box {
  background: #eef6ff;
  border: 1px solid #b8d4f0;
  border-radius: 6px;
  padding: 8px 12px;
  margin-top: 8px;
  font-size: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
}

.db-info-box .label {
  color: #1a3a5c;
  font-weight: 600;
}
.db-info-box .value {
  color: #0f2a44;
  font-family: monospace;
  font-size: 11px;
}
.db-info-box .file-source {
  color: #27ae60;
  font-weight: 600;
  font-size: 11px;
}

/* ============================================================
   RECEIPT
   ============================================================ */
.receipt {
  background: #fafbfc;
  border: 1px solid #dce1e8;
  border-radius: 8px;
  padding: 16px;
  min-height: 200px;
  font-size: 13px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Customer Info */
.customer-info {
  background: #f8faff;
  border: 1px solid #e0e8f0;
  border-radius: 6px;
  padding: 10px 12px;
  margin-bottom: 10px;
  font-size: 12px;
}

.customer-info .row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 2px 0;
}

.customer-info .row label {
  font-weight: 600;
  color: #1a3a5c;
  min-width: 85px;
  font-size: 12px;
}

.customer-info .row .invoice-value {
  font-weight: 700;
  color: #1a3a5c;
  font-family: monospace;
  font-size: 13px;
  background: #eef6ff;
  padding: 2px 10px;
  border-radius: 4px;
  border: 1px solid #b8d4f0;
}

.customer-info .row input {
  padding: 4px 8px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 12px;
  flex: 1;
  min-width: 120px;
  background: #fff;
}
.customer-info .row input:focus {
  border-color: #1a3a5c;
  outline: none;
  box-shadow: 0 0 0 2px rgba(26, 58, 92, 0.1);
}

/* ============================================================
   AUTOCOMPLETE
   ============================================================ */
.autocomplete-wrapper {
  position: relative;
  flex: 1;
  min-width: 120px;
}

.autocomplete-wrapper input {
  width: 100%;
  padding: 4px 8px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 12px;
  background: #fff;
}
.autocomplete-wrapper input:focus {
  border-color: #1a3a5c;
  outline: none;
  box-shadow: 0 0 0 2px rgba(26, 58, 92, 0.1);
}

.autocomplete-list {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #ccc;
  border-top: none;
  border-radius: 0 0 4px 4px;
  max-height: 180px;
  overflow-y: auto;
  z-index: 100;
  display: none;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}
.autocomplete-list.show {
  display: block;
}

.autocomplete-list .item {
  padding: 6px 10px;
  cursor: pointer;
  font-size: 12px;
  transition: 0.1s;
}
.autocomplete-list .item:hover {
  background: #eef6ff;
}
.autocomplete-list .item.active {
  background: #1a3a5c;
  color: #fff;
}

/* ============================================================
   CASH SECTION
   ============================================================ */
.cash-section {
  background: linear-gradient(135deg, #f8f9fa, #e9ecef);
  border: 2px solid #1a3a5c;
  border-radius: 8px;
  padding: 6px 12px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  flex-wrap: nowrap;
  overflow-x: auto;
  min-height: 38px;
}

.cash-section .cash-label {
  font-weight: 700;
  color: #1a3a5c;
  font-size: 12px;
  white-space: nowrap;
  min-width: 45px;
  flex-shrink: 0;
}
.cash-section .cash-label i {
  color: #8e44ad;
  margin-right: 3px;
  font-size: 13px;
}

.cash-section .cash-input-group {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  min-width: 0;
  flex-shrink: 1;
}
.cash-section .cash-input-group input {
  padding: 3px 8px;
  border: 2px solid #1a3a5c;
  border-radius: 5px;
  font-size: 14px;
  font-weight: 700;
  width: 100px;
  text-align: right;
  background: #fff;
  color: #1a3a5c;
  transition: all 0.3s ease;
  height: 30px;
  flex-shrink: 0;
}
.cash-section .cash-input-group input:focus {
  border-color: #8e44ad;
  outline: none;
  box-shadow: 0 0 0 3px rgba(142, 68, 173, 0.2);
}
.cash-section .cash-input-group input::placeholder {
  color: #aaa;
  font-weight: 400;
  font-size: 12px;
}

.cash-quick-buttons {
  display: flex;
  gap: 3px;
  flex-shrink: 0;
}
.cash-quick-buttons .btn {
  font-size: 10px;
  padding: 2px 7px;
  min-width: 30px;
  justify-content: center;
  font-weight: 700;
  border-radius: 4px;
  border: none;
  transition: all 0.2s ease;
  background: linear-gradient(135deg, #8e44ad, #6c3483);
  color: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  height: 24px;
  line-height: 1;
  white-space: nowrap;
  flex-shrink: 0;
}
.cash-quick-buttons .btn:hover {
  transform: scale(1.06);
  box-shadow: 0 3px 10px rgba(142, 68, 173, 0.35);
  background: linear-gradient(135deg, #9b59b6, #7d3c98);
}
.cash-quick-buttons .btn:active {
  transform: scale(0.92);
}
.cash-quick-buttons .btn-cash-exact {
  background: linear-gradient(135deg, #8e44ad, #6c3483);
  color: #fff;
  font-weight: 700;
  min-width: 36px;
}
.cash-quick-buttons .btn-cash-exact:hover {
  background: linear-gradient(135deg, #9b59b6, #7d3c98);
  transform: scale(1.06);
  box-shadow: 0 3px 10px rgba(142, 68, 173, 0.35);
}
.cash-quick-buttons .btn-cash-exact:active {
  transform: scale(0.92);
}

.cash-section .cash-change {
  font-weight: 700;
  font-size: 13px;
  width: 110px;
  min-width: 110px;
  max-width: 110px;
  text-align: center;
  padding: 2px 8px;
  border-radius: 5px;
  background: #fff;
  border: 2px solid #27ae60;
  height: 30px;
  line-height: 1.5;
  white-space: nowrap;
  flex-shrink: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cash-section .cash-change.negative {
  color: #e74c3c;
  border-color: #e74c3c;
  background: #fdf2f2;
}
.cash-section .cash-change.zero {
  color: #888;
  border-color: #888;
  background: #f5f5f5;
}
.cash-section .cash-change:not(.negative):not(.zero) {
  color: #27ae60;
  border-color: #27ae60;
  background: #f0faf4;
}

/* ============================================================
   RECEIPT ITEMS
   ============================================================ */
.receipt-items {
  max-height: 280px;
  overflow-y: auto;
  flex: 1;
}

.receipt-item {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  border-bottom: 1px dashed #e0e4e8;
  font-size: 13px;
  align-items: center;
}

.receipt-item .left {
  display: flex;
  gap: 12px;
  flex: 1;
}
.receipt-item .left .name {
  flex: 1;
}
.receipt-item .left .qty {
  color: #555;
  min-width: 40px;
}
.receipt-item .right {
  font-weight: 600;
  min-width: 80px;
  text-align: right;
}

.receipt-total {
  display: flex;
  justify-content: space-between;
  font-weight: 700;
  font-size: 16px;
  border-top: 2px solid #1a3a5c;
  padding-top: 10px;
  margin-top: 8px;
}

.receipt-empty {
  text-align: center;
  color: #999;
  padding: 40px 0;
}

.receipt-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.receipt-actions .btn-group-main {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.btn-group-bayar {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}
.btn-group-bayar .btn-bayar,
.btn-group-bayar .btn-thermal {
  flex: 1;
}

@media (max-width: 600px) {
  .btn-group-bayar {
    flex-direction: column;
  }
  .btn-group-bayar .btn-bayar,
  .btn-group-bayar .btn-thermal {
    flex: none;
    width: 100%;
  }
}

/* ============================================================
   INFO NOTA
   ============================================================ */
.info-nota {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f8faff;
  border: 1px solid #e0e8f0;
  border-radius: 6px;
  padding: 6px 12px;
  margin-bottom: 10px;
  font-size: 12px;
  font-weight: 600;
  color: #1a3a5c;
}
.info-nota .jumlah-item {
  color: #e67e22;
  font-size: 14px;
}

/* ============================================================
   FOOTER
   ============================================================ */
.footer-status {
  margin-top: 16px;
  font-size: 12px;
  color: #888;
  border-top: 1px solid #e8ecf1;
  padding-top: 12px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
}

/* ============================================================
   TOAST
   ============================================================ */
.toast {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: #1a3a5c;
  color: #fff;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 500;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.25s;
  pointer-events: none;
  z-index: 999;
  font-size: 14px;
}
.toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================================
   MODALS
   ============================================================ */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  justify-content: center;
  align-items: center;
}
.modal-overlay.show {
  display: flex;
}

.modal {
  background: #fff;
  padding: 24px;
  border-radius: 12px;
  max-width: 950px;
  width: 95%;
  max-height: 85vh;
  overflow-y: auto;
}
.modal h3 {
  margin-bottom: 12px;
  color: #1a3a5c;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.modal h3 .close-modal {
  cursor: pointer;
  color: #999;
  font-size: 20px;
}
.modal h3 .close-modal:hover {
  color: #e74c3c;
}

.modal-table-wrap {
  max-height: 300px;
  overflow-y: auto;
  border: 1px solid #e8ecf1;
  border-radius: 6px;
}

/* History Tabs */
.history-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 16px;
  border-bottom: 2px solid #e0e4e8;
  flex-wrap: wrap;
}

.history-tabs .tab-btn {
  padding: 8px 20px;
  border: none;
  background: transparent;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  color: #888;
  border-bottom: 3px solid transparent;
  transition: 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
}
.history-tabs .tab-btn:hover {
  color: #1a3a5c;
  background: #f7f9fc;
}
.history-tabs .tab-btn.active {
  color: #1a3a5c;
  border-bottom-color: #1a3a5c;
}
.history-tabs .tab-btn .tab-badge {
  background: #e0e4e8;
  color: #555;
  padding: 0 8px;
  border-radius: 12px;
  font-size: 10px;
  font-weight: 700;
}
.history-tabs .tab-btn.active .tab-badge {
  background: #1a3a5c;
  color: #fff;
}
.history-tabs .tab-btn.save-tab .tab-badge {
  background: #27ae60;
  color: #fff;
}
.history-tabs .tab-btn.bayar-tab .tab-badge {
  background: #e67e22;
  color: #fff;
}

.tab-content {
  display: none;
}
.tab-content.active {
  display: block;
}

/* History Item */
.history-item {
  border: 1px solid #e0e4e8;
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 10px;
  background: #fafbfc;
}
.history-item .hdr {
  display: flex;
  justify-content: space-between;
  font-weight: 600;
  color: #1a3a5c;
  margin-bottom: 6px;
  flex-wrap: wrap;
}
.history-item .detail {
  font-size: 12px;
  color: #555;
}
.history-item .items {
  margin-top: 4px;
  font-size: 12px;
  background: #fff;
  padding: 6px 10px;
  border-radius: 4px;
  border: 1px solid #edf0f4;
}
.history-item .items .row {
  display: flex;
  justify-content: space-between;
  padding: 2px 0;
  border-bottom: 1px dashed #f0f0f0;
}
.history-item .items .row:last-child {
  border-bottom: none;
}
.history-empty {
  text-align: center;
  padding: 30px;
  color: #999;
  font-size: 13px;
}

/* Export Filter */
.export-filter-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 8px;
}
.export-filter-group select {
  padding: 4px 8px;
  border-radius: 4px;
  border: 1px solid #ccc;
  font-size: 12px;
}

/* Debug Log */
.debug-log-entry {
  padding: 4px 0;
  border-bottom: 1px solid #f0f0f0;
  font-family: 'Courier New', monospace;
  font-size: 12px;
}
.debug-log-entry.found {
  color: #27ae60;
}
.debug-log-entry.notfound {
  color: #e74c3c;
}
.debug-log-entry .badge-het {
  background: #8e44ad;
  color: #fff;
  padding: 0 6px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 600;
  margin-left: 4px;
}
.debug-log-entry .badge-harga {
  background: #1a3a5c;
  color: #fff;
  padding: 0 6px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 600;
  margin-left: 4px;
}

/* History Quick Buttons */
.history-quick-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 14px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: 0.15s;
  white-space: nowrap;
}
.history-quick-btn.save-btn {
  background: #27ae60;
  color: #fff;
}
.history-quick-btn.save-btn:hover {
  background: #1e8449;
}
.history-quick-btn.bayar-btn {
  background: #e67e22;
  color: #fff;
}
.history-quick-btn.bayar-btn:hover {
  background: #d35400;
}
.history-quick-btn .badge-quick {
  background: rgba(255, 255, 255, 0.25);
  padding: 0 8px;
  border-radius: 12px;
  font-size: 10px;
  font-weight: 700;
  line-height: 18px;
}
.history-quick-btn i {
  font-size: 12px;
}

/* Printer Button */
.printer-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 14px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: 0.15s;
  white-space: nowrap;
}
.printer-btn.online {
  background: #27ae60;
  color: #fff;
}
.printer-btn.online:hover {
  background: #1e8449;
}
.printer-btn.offline {
  background: #e74c3c;
  color: #fff;
}
.printer-btn.offline:hover {
  background: #c0392b;
}
.printer-btn i {
  font-size: 12px;
}
.printer-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

/* History Print Button */
.btn-history-print {
  background: #1a3a5c;
  color: #fff;
  padding: 2px 8px;
  border: none;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.btn-history-print:hover {
  background: #0f2a44;
}
.btn-history-print:disabled {
  background: #888;
  cursor: not-allowed;
}
.btn-history-print i {
  font-size: 10px;
}

/* ============================================================
   BADGES
   ============================================================ */
.price-custom-badge {
  font-size: 9px;
  color: #e67e22;
  background: #fff3e0;
  padding: 0 6px;
  border-radius: 3px;
  border: 1px solid #e67e22;
  margin-left: 4px;
}
.het-badge {
  font-size: 9px;
  color: #8e44ad;
  background: #f3e8ff;
  padding: 0 6px;
  border-radius: 3px;
  border: 1px solid #8e44ad;
  margin-left: 4px;
}
.het-cell {
  font-size: 11px;
  color: #8e44ad;
  font-weight: 600;
}
.no-het-cell {
  font-size: 11px;
  color: #999;
}
.oli-convert-badge {
  font-size: 9px;
  color: #2980b9;
  background: #eaf2f8;
  padding: 0 6px;
  border-radius: 3px;
  border: 1px solid #2980b9;
  margin-left: 4px;
}

/* ============================================================
   PRINT STYLES
   ============================================================ */
@media print {
  @page {
    margin: 0 !important;
    padding: 0 !important;
    size: 80mm auto !important;
  }

  body {
    background: #fff !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 80mm !important;
    font-family: 'Courier New', Courier, monospace !important;
  }

  .app {
    box-shadow: none !important;
    padding: 2px 4px !important;
    max-width: 80mm !important;
    width: 80mm !important;
    margin: 0 !important;
    border-radius: 0 !important;
    background: #fff !important;
  }

  .header-pos,
  .grid-pos .card:first-child,
  .receipt-actions,
  .footer-status,
  .card-title,
  .badge-count,
  .badge-history,
  .btn-submenu,
  .toast,
  .modal-overlay,
  .btn-group-bayar,
  .info-nota,
  .cash-section {
    display: none !important;
  }

  .receipt {
    border: none !important;
    background: #fff !important;
    padding: 0 !important;
    box-shadow: none !important;
    width: 100% !important;
    font-size: 10px !important;
    font-family: 'Courier New', Courier, monospace !important;
    line-height: 1.2 !important;
  }

  .customer-info {
    border: none !important;
    background: transparent !important;
    padding: 2px 0 !important;
    margin-bottom: 3px !important;
    font-size: 9px !important;
    font-family: 'Courier New', Courier, monospace !important;
  }
  .customer-info .row {
    padding: 1px 0 !important;
    gap: 2px !important;
    align-items: center !important;
  }
  .customer-info .row label {
    min-width: 50px !important;
    font-size: 9px !important;
    font-weight: 600 !important;
    color: #000 !important;
  }
  .customer-info .row input {
    border: none !important;
    background: transparent !important;
    padding: 0 !important;
    font-weight: 600 !important;
    font-size: 9px !important;
    font-family: 'Courier New', Courier, monospace !important;
    color: #000 !important;
    min-width: 80px !important;
  }
  .customer-info .row .invoice-value {
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    font-size: 9px !important;
    font-weight: 700 !important;
    font-family: 'Courier New', Courier, monospace !important;
    color: #000 !important;
  }

  .receipt-items {
    max-height: none !important;
    margin-bottom: 3px !important;
  }

  .receipt-item {
    display: flex !important;
    justify-content: space-between !important;
    border-bottom: 1px dotted #ccc !important;
    padding: 1px 0 !important;
    font-size: 9px !important;
    font-family: 'Courier New', Courier, monospace !important;
  }
  .receipt-item .left {
    display: flex !important;
    gap: 6px !important;
    flex: 1 !important;
  }
  .receipt-item .left .name {
    flex: 1 !important;
    font-size: 9px !important;
    color: #000 !important;
  }
  .receipt-item .left .qty {
    font-size: 9px !important;
    min-width: 20px !important;
    color: #000 !important;
  }
  .receipt-item .right {
    font-size: 9px !important;
    min-width: 50px !important;
    font-weight: 600 !important;
    text-align: right !important;
    color: #000 !important;
  }

  .receipt-total {
    display: flex !important;
    justify-content: space-between !important;
    border-top: 2px solid #000 !important;
    padding-top: 4px !important;
    margin-top: 3px !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    font-family: 'Courier New', Courier, monospace !important;
    color: #000 !important;
  }

  .receipt-empty {
    font-size: 9px !important;
    color: #999 !important;
    padding: 8px 0 !important;
  }
}

/* ============================================================
   MISC
   ============================================================ */
#hiddenFileInput {
  display: none;
}

.fa-spin {
  animation: fa-spin 2s infinite linear;
}
@keyframes fa-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Badge status */
.badge-status.save {
  background: #27ae60;
  color: #fff;
  padding: 0 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  line-height: 18px;
  display: inline-block;
}
.badge-status.bayar {
  background: #e67e22;
  color: #fff;
  padding: 0 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  line-height: 18px;
  display: inline-block;
}

/* ============================================================
   LOGIN STYLES (VERSI BARU - BACKGROUND PUTIH)
   ============================================================ */

.login-wrapper {
    background: #fff0;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    margin: 0;
}

/* Hapus efek background pattern */

.login-container {
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 30px 80px rgba(26, 58, 92, 0.15);
    padding: 45px 40px 35px;
    max-width: 420px;
    width: 100%;
    animation: fadeInUp 0.6s ease;
    border: 1px solid #eef2f6;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.logo-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #1a3a5c, #2c5f8a);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
    box-shadow: 0 8px 25px rgba(26, 58, 92, 0.2);
}

.logo-icon i {
    font-size: 40px;
    color: #e67e22;
}

.login-header h1 {
    font-size: 26px;
    font-weight: 700;
    color: #1a3a5c;
    margin: 0 0 4px;
    letter-spacing: 1px;
}

.login-header p {
    font-size: 14px;
    color: #888;
    margin: 4px 0;
}

.login-header .divider {
    width: 50px;
    height: 3px;
    background: linear-gradient(90deg, #1a3a5c, #e67e22);
    margin: 12px auto;
    border-radius: 3px;
}

.login-header .address {
    font-size: 12px;
    color: #aaa;
    margin-top: 4px;
}

.login-box .input-group {
    margin-bottom: 20px;
}

.login-box .input-group label {
    display: block;
    font-weight: 600;
    font-size: 13px;
    color: #333;
    margin-bottom: 6px;
}

.login-box .input-group label i {
    margin-right: 6px;
    color: #e67e22;
}

.password-wrapper {
    position: relative;
    width: 100%;
}

.password-wrapper input {
    width: 100%;
    padding: 14px 45px 14px 16px;
    border: 2px solid #e0e4e8;
    border-radius: 10px;
    font-size: 15px;
    transition: 0.3s;
    background: #fafbfc;
}

.password-wrapper input:focus {
    border-color: #1a3a5c;
    outline: none;
    box-shadow: 0 0 0 4px rgba(26, 58, 92, 0.08);
    background: #fff;
}

.password-wrapper input::placeholder {
    color: #bbb;
    font-size: 14px;
}

.toggle-password {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #aaa;
    cursor: pointer;
    transition: 0.2s;
    padding: 5px;
}

.toggle-password:hover {
    color: #1a3a5c;
}

.toggle-password i {
    font-size: 18px;
}

.login-box button[type="submit"] {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #1a3a5c, #2c5f8a);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.3s;
    margin-top: 4px;
    letter-spacing: 1px;
}

.login-box button[type="submit"] i {
    margin-right: 10px;
}

.login-box button[type="submit"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(26, 58, 92, 0.3);
    background: linear-gradient(135deg, #0f2a44, #1a3a5c);
}

.login-box button[type="submit"]:active {
    transform: translateY(0);
}

.error-message {
    color: #e74c3c;
    font-size: 13px;
    font-weight: 500;
    text-align: center;
    margin-top: 14px;
    display: none;
    padding: 10px 14px;
    background: #fdf2f2;
    border-radius: 8px;
    border: 1px solid #f5c6cb;
}

.login-info {
    text-align: center;
    margin-top: 16px;
    padding: 10px;
    background: #f8faff;
    border-radius: 8px;
    border: 1px dashed #b8d4f0;
}

.login-info small {
    font-size: 12px;
    color: #888;
}

.login-info small strong {
    color: #1a3a5c;
}

.login-footer {
    text-align: center;
    margin-top: 24px;
    color: #ccc;
    font-size: 11px;
    border-top: 1px solid #f0f2f5;
    padding-top: 18px;
}

.login-footer small {
    color: #bbb;
}

/* ============================================================
   RESPONSIVE LOGIN
   ============================================================ */

@media (max-width: 480px) {
    .login-container {
        padding: 30px 20px 25px;
    }
    .logo-icon {
        width: 60px;
        height: 60px;
    }
    .logo-icon i {
        font-size: 30px;
    }
    .login-header h1 {
        font-size: 22px;
    }
    .password-wrapper input {
        padding: 12px 40px 12px 14px;
        font-size: 14px;
    }
    .login-box button[type="submit"] {
        padding: 13px;
        font-size: 15px;
    }
}
