/* ========================================================
   MODERN POS CASHIER STYLESHEET (PHP NATIVE)
   Sleek, Clean, Modern POS Interface & Thermal Print Engine
   ======================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  --font-main: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Color Palette */
  --bg-app: #f1f5f9;
  --bg-card: #ffffff;
  --bg-sidebar: #0f172a;
  
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  --primary-border: #bfdbfe;

  --success: #059669;
  --success-hover: #047857;
  --success-light: #ecfdf5;

  --warning: #d97706;
  --warning-light: #fffbeb;

  --danger: #dc2626;
  --danger-light: #fef2f2;

  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;

  --border: #e2e8f0;
  --border-focus: #3b82f6;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.03);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
}

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

body {
  font-family: var(--font-main);
  background-color: var(--bg-app);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

/* NAVBAR HEADER */
.navbar {
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  padding: 0.35rem 1.25rem;
  min-height: 48px;
  height: 50px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  flex-wrap: nowrap;
  gap: 0.75rem;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  color: inherit;
  flex-shrink: 0;
  max-width: 290px;
}

.brand-icon {
  width: 30px;
  height: 30px;
  min-width: 30px;
  min-height: 30px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.95rem;
  box-shadow: 0 2px 5px rgba(37, 99, 235, 0.2);
  flex-shrink: 0;
}

.brand-logo-container {
  width: 32px;
  height: 32px;
  max-width: 32px;
  max-height: 32px;
  min-width: 32px;
  min-height: 32px;
  border-radius: var(--radius-sm);
  background: #ffffff;
  border: 1px solid var(--border);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 1px;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.brand-wrapper:hover .brand-logo-container {
  transform: scale(1.05);
}

.brand-logo-img {
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: contain !important;
  display: block !important;
}

.receipt-logo-img {
  max-height: 48px;
  max-width: 120px;
  object-fit: contain;
  margin: 0 auto 6px auto;
  display: block;
  filter: grayscale(100%) contrast(140%);
}

.brand-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  min-width: 0;
}

.brand-text h1 {
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: #0f172a;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-text span {
  font-size: 0.65rem;
  color: var(--text-muted);
  font-weight: 500;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-shrink: 0;
}

.nav-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.65rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.nav-item i {
  font-size: 0.825rem;
}

.nav-item:hover {
  background: #f8fafc;
  color: var(--primary);
}

.nav-item.active {
  background: var(--primary-light);
  color: var(--primary);
}

.header-clock {
  font-family: var(--font-mono);
  font-size: 0.725rem;
  color: var(--text-muted);
  background: #f8fafc;
  border: 1px solid var(--border);
  padding: 0.25rem 0.6rem;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}

.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
  display: inline-block;
  animation: pulse 2s infinite;
  flex-shrink: 0;
}

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

/* MAIN LAYOUT WRAPPERS */
.main-wrapper {
  flex: 1;
  padding: 1.25rem;
  max-width: 1600px;
  width: 100%;
  margin: 0 auto;
}

/* POS SCREEN TWO-COLUMN LAYOUT */
.pos-container {
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 1.25rem;
  height: calc(100vh - 72px);
}

@media (max-width: 1024px) {
  .pos-container {
    grid-template-columns: 1fr;
    height: auto;
  }
}

/* CATALOG SECTION (LEFT) */
.pos-catalog {
  background: #ffffff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.catalog-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  background: #ffffff;
}

.catalog-toolbar {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.search-box {
  flex: 1;
  position: relative;
}

.search-box input {
  width: 100%;
  padding: 0.65rem 1rem 0.65rem 2.5rem;
  font-size: 0.875rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-family: inherit;
  background: #f8fafc;
  outline: none;
  transition: all 0.15s ease;
}

.search-box input:focus {
  background: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.search-icon {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-light);
  font-size: 0.95rem;
}

.category-tabs {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
  scrollbar-width: none;
}
.category-tabs::-webkit-scrollbar {
  display: none;
}

.category-pill {
  padding: 0.4rem 0.9rem;
  border-radius: 9999px;
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--text-muted);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.category-pill:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.category-pill.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
}

/* TICKET GRID */
.ticket-grid {
  padding: 1.25rem;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 1rem;
  flex: 1;
}

.ticket-card {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  background: #ffffff;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-sm);
  user-select: none;
}

.ticket-card:hover:not(.out-of-stock) {
  transform: translateY(-2px);
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
}

.ticket-card:active:not(.out-of-stock) {
  transform: translateY(0);
}

.ticket-card.out-of-stock {
  opacity: 0.6;
  background: #f8fafc;
  cursor: not-allowed;
  filter: grayscale(0.5);
}

.ticket-card-accent {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
}

.ticket-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.5rem;
}

.ticket-code {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  background: #f1f5f9;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
}

.stock-tag {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.stock-tag.in-stock {
  background: #dcfce7;
  color: #15803d;
}

.stock-tag.low-stock {
  background: #fef3c7;
  color: #b45309;
}

.stock-tag.out-stock {
  background: #fee2e2;
  color: #b91c1c;
}

.ticket-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.35;
  margin-bottom: 0.35rem;
}

.ticket-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.3;
  margin-bottom: 0.75rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ticket-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 0.5rem;
  border-top: 1px dashed var(--border);
  margin-top: auto;
}

.ticket-price {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--primary);
  font-family: var(--font-mono);
}

.add-badge-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.1rem;
  transition: all 0.15s ease;
}

.ticket-card:hover .add-badge-btn {
  background: var(--primary);
  color: white;
}

/* CART DRAWER / PANEL (RIGHT) */
.pos-cart {
  background: #ffffff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.cart-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f8fafc;
}

.cart-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1rem;
  font-weight: 800;
}

.cart-count-badge {
  background: var(--primary);
  color: white;
  padding: 0.15rem 0.55rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
}

.clear-cart-btn {
  background: transparent;
  border: none;
  color: var(--danger);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  transition: background 0.15s ease;
}

.clear-cart-btn:hover {
  background: var(--danger-light);
}

.cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.cart-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-light);
  text-align: center;
  padding: 2rem 1rem;
}

.cart-empty-icon {
  font-size: 3rem;
  margin-bottom: 0.5rem;
  opacity: 0.5;
}

.cart-item {
  display: flex;
  flex-direction: column;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.75rem;
  gap: 0.5rem;
  transition: border-color 0.15s;
}

.cart-item:hover {
  border-color: #cbd5e1;
}

.cart-item-row-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.cart-item-name {
  font-size: 0.875rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.25;
  flex: 1;
}

.cart-item-price-unit {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.cart-item-row-bot {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.qty-control {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.15rem;
}

.qty-btn {
  width: 26px;
  height: 26px;
  border: none;
  background: #f1f5f9;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

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

.qty-input {
  width: 38px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  font-weight: 700;
  border: none;
  outline: none;
  background: transparent;
}

.cart-item-subtotal {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.95rem;
  color: #0f172a;
}

/* CART FOOTER / TOTALS */
.cart-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border);
  background: #ffffff;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.customer-field {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.customer-field input {
  width: 100%;
  padding: 0.45rem 0.75rem;
  font-size: 0.8125rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  outline: none;
}

.customer-field input:focus {
  border-color: var(--primary);
}

.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.summary-row.total-row {
  margin-top: 0.25rem;
  padding-top: 0.75rem;
  border-top: 2px dashed var(--border);
  font-size: 1.15rem;
  font-weight: 800;
  color: #0f172a;
}

.summary-row.total-row .total-amount {
  color: var(--primary);
  font-family: var(--font-mono);
  font-size: 1.35rem;
}

.btn-checkout {
  width: 100%;
  padding: 0.85rem;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
  transition: all 0.2s ease;
}

.btn-checkout:hover:not(:disabled) {
  background: linear-gradient(135deg, #1d4ed8, #1e40af);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.4);
}

.btn-checkout:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

/* MODALS */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-box {
  background: #ffffff;
  border-radius: var(--radius-xl);
  max-width: 540px;
  width: 100%;
  box-shadow: var(--shadow-xl);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.96);
  transition: transform 0.2s ease;
  max-height: 90vh;
}

.modal-backdrop.open .modal-box {
  transform: scale(1);
}

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  font-size: 1.15rem;
  font-weight: 800;
}

.modal-close-btn {
  background: #f1f5f9;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: var(--text-muted);
  transition: all 0.15s ease;
}

.modal-close-btn:hover {
  background: var(--danger-light);
  color: var(--danger);
}

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  background: #f8fafc;
}

/* PAYMENT SELECTOR TABS */
.payment-methods-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.method-choice {
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  transition: all 0.15s ease;
  background: #ffffff;
}

.method-choice:hover {
  border-color: #93c5fd;
  background: #f8fafc;
}

.method-choice.selected {
  border-color: var(--primary);
  background: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.method-icon {
  font-size: 1.75rem;
}

.method-title {
  font-weight: 800;
  font-size: 0.95rem;
}

.method-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* CASH INPUT CALCULATOR */
.cash-box {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-label {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--text-muted);
}

.input-cash-wrap {
  position: relative;
}

.input-cash-wrap .currency-prefix {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--text-muted);
}

.input-cash-lg {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 3.25rem;
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 800;
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  outline: none;
  background: #ffffff;
  transition: border-color 0.15s;
}

.input-cash-lg:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15);
}

.quick-cash-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.cash-chip {
  padding: 0.4rem 0.75rem;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  font-weight: 700;
  font-family: var(--font-mono);
  cursor: pointer;
  transition: all 0.15s ease;
}

.cash-chip:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}

.cash-chip.chip-exact {
  background: #ecfdf5;
  border-color: #6ee7b7;
  color: #047857;
}

/* CHANGE DUE DISPLAY */
.change-box {
  padding: 1rem;
  border-radius: var(--radius-md);
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.2s ease;
}

.change-box.success {
  background: #ecfdf5;
  border: 1.5px solid #a7f3d0;
  color: #065f46;
}

.change-box.insufficient {
  background: #fef2f2;
  border: 1.5px solid #fecaca;
  color: #991b1b;
}

.change-label {
  font-size: 0.875rem;
  font-weight: 700;
}

.change-value {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 800;
}

/* QRIS MANUAL BOX */
.qris-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  text-align: center;
  padding: 1rem;
  background: #f8fafc;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}

.qris-preview-img {
  max-width: 220px;
  width: 100%;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  background: white;
}

.qris-confirm-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: #0f172a;
  background: #ffffff;
  padding: 0.65rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  cursor: pointer;
  width: 100%;
  justify-content: center;
}

.qris-confirm-check input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  cursor: pointer;
}

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.6rem 1.15rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  border: none;
  text-decoration: none;
}

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

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

.btn-success {
  background: var(--success);
  color: white;
}
.btn-success:hover {
  background: var(--success-hover);
}

.btn-danger {
  background: var(--danger);
  color: white;
}
.btn-danger:hover {
  background: #b91c1c;
}

/* TABLES & CARDS (FOR TICKETS & REPORTS) */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.page-title h2 {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.page-title p {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-top: 0.2rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 1rem;
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.stat-icon.blue { background: #eff6ff; color: #2563eb; }
.stat-icon.green { background: #ecfdf5; color: #059669; }
.stat-icon.purple { background: #faf5ff; color: #7c3aed; }
.stat-icon.amber { background: #fffbeb; color: #d97706; }

.stat-info {
  display: flex;
  flex-direction: column;
}

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

.stat-value {
  font-size: 1.35rem;
  font-weight: 800;
  color: #0f172a;
  font-family: var(--font-mono);
  margin-top: 0.15rem;
}

.data-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  margin-bottom: 1.5rem;
}

.data-card-header {
  padding: 1.15rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.data-card-header h3 {
  font-size: 1.1rem;
  font-weight: 800;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.875rem;
}

.data-table th {
  background: #f8fafc;
  padding: 0.85rem 1.25rem;
  font-weight: 700;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.data-table td {
  padding: 0.9rem 1.25rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.data-table tbody tr:hover {
  background: #f8fafc;
}

/* BADGES */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
}

.badge-cash {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.badge-qris {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

/* THERMAL RECEIPT STYLING (ON SCREEN & PRINT) */
.thermal-receipt {
  width: 320px;
  margin: 0 auto;
  background: #ffffff;
  padding: 1.25rem;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.4;
  color: #000000;
  border: 1px solid #cbd5e1;
  box-shadow: var(--shadow-md);
  border-radius: 4px;
}

.receipt-header {
  text-align: center;
  margin-bottom: 10px;
}

.receipt-title {
  font-size: 16px;
  font-weight: 800;
  text-transform: uppercase;
}

.receipt-subtitle {
  font-size: 11px;
}

.receipt-divider {
  border-top: 1px dashed #000;
  margin: 8px 0;
}

.receipt-double-divider {
  border-top: 2px double #000;
  margin: 8px 0;
}

.receipt-meta {
  font-size: 11px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.receipt-meta-row {
  display: flex;
  justify-content: space-between;
}

.receipt-items-table {
  width: 100%;
  margin: 8px 0;
}

.receipt-items-table td {
  padding: 2px 0;
  font-size: 12px;
}

.receipt-totals {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 12px;
}

.receipt-totals-row {
  display: flex;
  justify-content: space-between;
}

.receipt-totals-row.grand {
  font-weight: 800;
  font-size: 14px;
}

.receipt-footer {
  text-align: center;
  font-size: 10px;
  margin-top: 12px;
  line-height: 1.3;
}

/* ========================================================
   MODAL OVERLAY SYSTEM (users.php, settings.php, etc.)
   ======================================================== */

/* Modal Overlay Backdrop */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: modalFadeIn 0.18s ease;
}

.modal-overlay.open {
  display: flex;
}

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

/* Modal Card Container */
.modal-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(0,0,0,0.04);
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalSlideUp 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalSlideUp {
  from { opacity: 0; transform: translateY(20px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Modal Header */
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.4rem;
  border-bottom: 1px solid var(--border);
  background: #f8fafc;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  flex-shrink: 0;
}

.modal-header h3 {
  font-size: 1rem;
  font-weight: 800;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
}

/* Modal Close Button */
.btn-close-modal {
  background: none;
  border: none;
  cursor: pointer;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  color: var(--text-muted);
  line-height: 1;
  transition: background 0.15s, color 0.15s;
  flex-shrink: 0;
}
.btn-close-modal:hover {
  background: #fee2e2;
  color: #dc2626;
}

/* Modal Body */
.modal-body {
  padding: 1.4rem;
  overflow-y: auto;
  flex: 1;
}

/* Modal Footer */
.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 1rem 1.4rem;
  border-top: 1px solid var(--border);
  background: #f8fafc;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  flex-shrink: 0;
}

/* ========================================================
   FORM COMPONENTS (inputs, labels, selects)
   ======================================================== */

/* Form Group wrapper */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 1rem;
}

/* Form Label */
.form-label {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Large input (input-cash-lg) */
.input-cash-lg {
  width: 100%;
  padding: 0.65rem 0.85rem;
  font-size: 0.95rem;
  font-family: var(--font-main);
  font-weight: 500;
  color: var(--text-main);
  background: #ffffff;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
}

.input-cash-lg:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
  background: #fafcff;
}

.input-cash-lg::placeholder {
  color: var(--text-light);
  font-weight: 400;
}

/* Select styled like input */
select.input-cash-lg,
.modal-body select,
.modal-card select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.65rem center;
  background-size: 14px;
  padding-right: 2.25rem;
  cursor: pointer;
}

/* General select inside modal */
.modal-body select,
.modal-card select {
  width: 100%;
  padding: 0.65rem 2.25rem 0.65rem 0.85rem;
  font-size: 0.875rem;
  font-family: var(--font-main);
  font-weight: 600;
  color: var(--text-main);
  background-color: #ffffff;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color 0.18s, box-shadow 0.18s;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}

.modal-body select:focus,
.modal-card select:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

/* ========================================================
   PRINT MEDIA QUERY
   - Thermal receipt printing (index.php / receipt modal)
   - Report printing (reports.php) — must stay visible
   ======================================================== */
@media print {
  @page {
    margin: 1cm;
    size: auto;
  }

  /* ---- SHARED: basic reset ---- */
  html, body {
    margin: 0 !important;
    padding: 0 !important;
    background: #ffffff !important;
    color: #000000 !important;
    width: 100% !important;
    height: auto !important;
    overflow: visible !important;
  }

  /* ---- REPORT PRINT MODE (reports.php uses body.print-report) ----
     Show main content, hide header/nav/buttons only */
  body.print-report > header,
  body.print-report .no-print,
  body.print-report .btn,
  body.print-report .filter-bar,
  body.print-report canvas {
    display: none !important;
  }

  body.print-report > main {
    display: block !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  body.print-report .data-card {
    box-shadow: none !important;
    border: 1px solid #ccc !important;
    break-inside: avoid;
  }

  /* ---- THERMAL RECEIPT MODE (index.php uses body.printing-receipt) ---- */
  body.printing-receipt > header,
  body.printing-receipt > main,
  body.printing-receipt > #toastContainer,
  body.printing-receipt .no-print,
  body.printing-receipt .modal-close-btn,
  body.printing-receipt .modal-header,
  body.printing-receipt .modal-footer {
    display: none !important;
  }

  /* Reset modal container so it never clips thermal receipt */
  body.printing-receipt .modal-backdrop.open {
    position: static !important;
    background: transparent !important;
    padding: 0 !important;
    margin: 0 !important;
    display: block !important;
    inset: auto !important;
    width: 100% !important;
    height: auto !important;
    overflow: visible !important;
  }

  body.printing-receipt .modal-backdrop.open .modal-box {
    box-shadow: none !important;
    border: none !important;
    max-width: 100% !important;
    max-height: none !important;
    width: auto !important;
    overflow: visible !important;
    transform: none !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  body.printing-receipt .modal-backdrop.open .modal-body {
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
    overflow: visible !important;
    display: block !important;
  }

  /* ---- FALLBACK: no body class set — hide nav only ---- */
  body:not(.print-report):not(.printing-receipt) > header,
  body:not(.print-report):not(.printing-receipt) .no-print {
    display: none !important;
  }

  /* Dedicated 58mm Thermal Receipt styling */
  .thermal-receipt {
    display: block !important;
    width: 58mm !important;
    max-width: 58mm !important;
    margin: 0 !important;
    padding: 4mm 2mm !important;
    border: none !important;
    box-shadow: none !important;
    position: static !important;
    overflow: visible !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
    font-size: 11px !important;
    line-height: 1.35 !important;
    color: #000000 !important;
  }

  .thermal-receipt * {
    visibility: visible !important;
    color: #000000 !important;
  }
}

