/* ยุพาสังฆภัณฑ์ POS - Liquid Glass Yellow/Gold Edition */

/* --- CSS VARIABLES & THEMES --- */
:root {
  --font-family: 'Sarabun', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  
  /* LIQUID GLASS GLASSMORPHISM THEME */
  --bg-primary: #08090b;        /* Deeper charcoal black */
  --bg-secondary: #0e1014;      /* Darker gray */
  --bg-card: rgba(20, 22, 26, 0.55); /* Deeper frosted glass card fill */
  --bg-input: rgba(0, 0, 0, 0.5);  /* Deep dark glass for inputs */
  --border-color: rgba(255, 255, 255, 0.05); /* Softer frosted border */
  --border-glow: rgba(252, 193, 15, 0.15);  /* Golden border highlight */
  
  --text-main: #ffffff;         /* Clean white text */
  --text-muted: #94a3b8;        /* Soft slate text */
  --text-inverse: #08090b;
  
  /* Liquid Yellow / Gold Gradients (Saffron gold for Sangkhaphan theme) */
  --accent-yellow: #fcc10f;
  --gold-glow: rgba(252, 193, 15, 0.35);
  --yellow-grad: linear-gradient(135deg, #ffe57f 0%, #ffc107 100%);
  --yellow-grad-hover: linear-gradient(135deg, #fff0b3 0%, #ffb300 100%);
  
  --color-success: #10b981;     /* Emerald green */
  --color-danger: #ef4444;      /* Neon red */
  --color-warning: #f59e0b;     /* Amber */
  --color-info: #06b6d4;        /* Cyan */
  --color-primary: #3b82f6;     /* Royal blue */
  
  /* LCD Neon Glowing Display */
  --lcd-bg: rgba(8, 9, 11, 0.85);
  --lcd-text: #ffd54f;
  
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  
  --glass-blur: blur(20px) saturate(210%);
  --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
}

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

body {
  font-family: var(--font-family);
  background-color: var(--bg-primary);
  color: var(--text-main);
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* Background Blobs container */
.glass-bg-blobs {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  overflow: hidden;
  z-index: -2;
  pointer-events: none;
}

.glass-bg-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.22;
  mix-blend-mode: screen;
  pointer-events: none;
  animation: float-blob 22s infinite alternate ease-in-out;
}

.blob-1 {
  width: 450px;
  height: 450px;
  background: radial-gradient(circle, var(--accent-yellow) 0%, transparent 70%);
  top: -10%;
  left: 5%;
}

.blob-2 {
  width: 550px;
  height: 550px;
  background: radial-gradient(circle, #f39c12 0%, transparent 70%);
  bottom: -15%;
  right: 5%;
  animation-duration: 28s;
  animation-delay: -5s;
}

.blob-3 {
  width: 350px;
  height: 350px;
  background: radial-gradient(circle, #fff 0%, transparent 70%);
  top: 35%;
  left: 45%;
  opacity: 0.08;
  animation-duration: 32s;
  animation-delay: -10s;
}

@keyframes float-blob {
  0% {
    transform: translate(0, 0) scale(1);
  }
  50% {
    transform: translate(60px, 90px) scale(1.15);
  }
  100% {
    transform: translate(-40px, -60px) scale(0.9);
  }
}

/* Scrollbar styling for a modern look */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.1);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent-yellow);
}

/* Icons */
.icon {
  width: 18px;
  height: 18px;
  fill: currentColor;
  vertical-align: middle;
}
.icon-status {
  width: 14px;
  height: 14px;
  fill: var(--accent-yellow);
  margin-right: 6px;
}

/* --- SYSTEM TOP NAV BAR --- */
.system-nav-bar {
  background: rgba(18, 20, 24, 0.8);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--border-color);
  height: 48px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
  z-index: 50;
}

.nav-brand .brand-title {
  font-weight: 800;
  font-size: 18px;
  background: var(--yellow-grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: 0.5px;
}
.nav-brand .brand-light {
  color: var(--text-main);
  font-weight: 300;
  font-style: normal;
}

.nav-menu {
  display: flex;
  gap: 8px;
  height: 100%;
  align-items: center;
}

.nav-btn {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  font-family: var(--font-family);
  font-size: 13px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

.nav-btn:hover {
  background-color: rgba(255, 255, 255, 0.07);
  color: var(--text-main);
  border-color: rgba(254, 193, 15, 0.3);
}

.nav-btn.active {
  background: var(--yellow-grad);
  color: #000;
  font-weight: 700;
  border: none;
  box-shadow: 0 0 15px var(--gold-glow);
}

.nav-status {
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-role-badge {
  background-color: rgba(255,255,255,0.05);
  border: 1px solid var(--border-color);
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-yellow);
}

.admin-lock-btn {
  background-color: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
  color: var(--text-main);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-family);
  transition: all 0.2s;
}
.admin-lock-btn:hover {
  background-color: rgba(254, 193, 15, 0.1);
  border-color: rgba(254, 193, 15, 0.3);
  color: var(--accent-yellow);
}

/* --- APP WRAPPER --- */
.app-container {
  flex: 1;
  position: relative;
  overflow: hidden;
}

.tab-content {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  opacity: 0;
  visibility: hidden;
  transform: scale(0.99) translateY(5px);
  transition: opacity 0.3s, transform 0.3s, visibility 0.3s;
  padding: 15px;
  overflow-y: auto;
}

.tab-content.active {
  opacity: 1;
  visibility: visible;
  transform: scale(1) translateY(0);
}

/* --- 1. CASHIER SCREEN (Liquid Glass Yellow Theme) --- */
#tab-cashier {
  padding: 0;
}

.cashier-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  height: 100%;
}

.cashier-left {
  display: flex;
  flex-direction: column;
  background-color: transparent;
  overflow: hidden;
  border-right: 1px solid rgba(255, 255, 255, 0.05);
}

/* Top Liquid Header Bar */
.cashier-header {
  background: rgba(18, 22, 28, 0.45);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding: 10px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 95px;
}

.header-left {
  display: flex;
  align-items: center;
}

.logo-modern {
  font-weight: 800;
  font-size: 22px;
  color: var(--text-main);
  letter-spacing: 0.5px;
}
.logo-highlight {
  background: var(--yellow-grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 300;
  font-style: italic;
}

.header-center {
  display: flex;
  gap: 10px;
  color: var(--text-main);
  font-size: 12px;
}

.status-item {
  display: flex;
  align-items: center;
  background-color: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 6px 12px;
  border-radius: 20px;
  font-weight: 600;
}

.header-right {
  display: flex;
  align-items: center;
}

/* Glowing LCD Total Price */
.lcd-display {
  background-color: var(--lcd-bg);
  border: 1px solid rgba(252, 193, 15, 0.35);
  border-radius: var(--radius-md);
  padding: 6px 20px;
  text-align: right;
  min-width: 240px;
  box-shadow: 0 0 25px rgba(252, 193, 15, 0.12), inset 0 2px 12px rgba(0, 0, 0, 0.9);
}

.lcd-value {
  font-family: sans-serif;
  font-size: 46px;
  font-weight: 800;
  color: var(--lcd-text);
  line-height: 1.1;
  text-shadow: 0 0 10px rgba(252, 193, 15, 0.7), 0 0 20px rgba(252, 193, 15, 0.3);
  letter-spacing: 0.5px;
}

/* Product Sales Table Grid */
.sales-grid-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: rgba(20, 22, 26, 0.45);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-color);
  margin: 15px;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--glass-shadow);
}

.sales-grid-title {
  background: rgba(255, 255, 255, 0.03);
  color: var(--accent-yellow);
  padding: 8px 12px;
  font-size: 16px;
  font-weight: 700;
  text-align: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.table-scroll-wrapper {
  flex: 1;
  overflow-y: auto;
}

.sales-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.sales-table th {
  background: rgba(252, 193, 15, 0.08);
  color: var(--accent-yellow);
  font-weight: 700;
  padding: 12px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  text-align: left;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.sales-table td {
  padding: 12px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.02);
  background-color: transparent;
  color: var(--text-main);
  font-weight: 500;
}

/* Glowing Selected Row (Liquid Gold Gradient) */
.sales-table tbody tr.selected td {
  background: var(--yellow-grad) !important;
  color: #000000 !important;
  font-weight: 700;
  text-shadow: none;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  border-bottom: 1px solid rgba(0, 0, 0, 0.15);
}
.sales-table tbody tr.selected {
  box-shadow: 0 0 20px var(--gold-glow);
}

.sales-table tbody tr.empty-row td {
  background-color: transparent;
  color: var(--text-muted);
  text-align: center;
  font-style: italic;
  padding: 80px 0;
  font-size: 14px;
}

.sales-table tbody tr:hover td {
  background-color: rgba(255, 255, 255, 0.02);
  cursor: pointer;
}

/* Bottom Bar Controls */
.cashier-bottom-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  background-color: rgba(18, 22, 28, 0.4);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  height: 70px;
}

.barcode-input-container {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  max-width: 400px;
}

#barcode-input {
  width: 100%;
  height: 42px;
  font-size: 15px;
  font-weight: 600;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  background-color: var(--bg-input);
  color: var(--text-main);
  outline: none;
  transition: all 0.25s;
}
#barcode-input:focus {
  border-color: var(--accent-yellow);
  box-shadow: 0 0 15px var(--gold-glow);
}

.multiplier-indicator {
  background-color: var(--color-warning);
  color: #fff;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: bold;
}

.subtotal-container {
  display: flex;
  align-items: center;
  gap: 12px;
}
.subtotal-label {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-muted);
}
.subtotal-box {
  background-color: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--accent-yellow);
  font-size: 26px;
  font-weight: 800;
  padding: 4px 15px;
  min-width: 180px;
  text-align: right;
  border-radius: var(--radius-sm);
  font-family: sans-serif;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

/* Footer Info Bar */
.cashier-footer-info {
  background-color: rgba(18, 20, 24, 0.5);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding: 6px 20px;
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
  height: 32px;
}
.cashier-footer-info .info-block {
  display: flex;
  align-items: center;
  gap: 5px;
}
.points-badge {
  background-color: var(--color-success);
  color: #fff;
  padding: 1px 6px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 700;
  margin-left: 4px;
}

/* --- RIGHT SIDEBAR BUTTON PANEL --- */
.cashier-right-panel {
  display: flex;
  flex-direction: column;
  background-color: rgba(18, 20, 24, 0.4);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  padding: 15px 12px;
  justify-content: space-between;
  gap: 12px;
  box-shadow: inset 1px 0 0 rgba(255,255,255,0.05);
}

.grid-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  flex: 1;
}

/* Glass Buttons with Glow Hover */
.grid-btn {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  padding: 10px 4px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  font-family: var(--font-family);
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.grid-btn:hover {
  background: rgba(252, 193, 15, 0.1);
  border-color: rgba(252, 193, 15, 0.4);
  box-shadow: 0 4px 15px rgba(252, 193, 15, 0.2);
  transform: translateY(-2px);
}

.grid-btn:active {
  transform: translateY(1px);
}

.grid-btn .btn-lbl {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
}

.grid-btn .btn-sh {
  font-size: 10px;
  color: var(--accent-yellow);
  margin-top: 4px;
  font-weight: 700;
  opacity: 0.8;
}

/* Sidebar Button overrides colors */
.grid-btn.primary {
  border-color: rgba(59, 130, 246, 0.2);
}
.grid-btn.primary:hover {
  border-color: var(--color-primary);
  background: rgba(59, 130, 246, 0.08);
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.15);
}

.grid-btn.warning {
  border-color: rgba(245, 158, 11, 0.2);
}
.grid-btn.warning:hover {
  border-color: var(--color-warning);
  background: rgba(245, 158, 11, 0.08);
}

.grid-btn.danger {
  border-color: rgba(239, 68, 68, 0.2);
}
.grid-btn.danger:hover {
  border-color: var(--color-danger);
  background: rgba(239, 68, 68, 0.08);
}

.drawer-btn {
  background-color: rgba(255, 255, 255, 0.01);
}

/* Giant Checkout Button (Liquid Gold Style) */
.btn-pay-giant {
  background: var(--yellow-grad);
  border: none;
  border-radius: var(--radius-md);
  color: #000000;
  padding: 12px;
  cursor: pointer;
  font-family: var(--font-family);
  box-shadow: 0 4px 20px rgba(252, 193, 15, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.4);
  text-align: center;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  height: 75px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.btn-pay-giant:hover {
  background: var(--yellow-grad-hover);
  box-shadow: 0 6px 25px rgba(252, 193, 15, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.5);
  transform: translateY(-2px);
}

.btn-pay-giant:active {
  transform: translateY(1px);
}

.btn-pay-giant .pay-title {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.btn-pay-giant .pay-shortcut {
  font-size: 11px;
  font-weight: 700;
  margin-top: 3px;
  opacity: 0.8;
}

/* --- BACKOFFICE CARDS & TABLES --- */
.backoffice-card {
  background: rgba(20, 22, 26, 0.45);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 15px;
  box-shadow: var(--glass-shadow);
}

.backoffice-card h2 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 15px;
  color: var(--accent-yellow);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 8px;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}
.card-header h2 {
  margin-bottom: 0;
  border: none;
  padding: 0;
}

.filter-bar {
  display: flex;
  gap: 15px;
  margin-bottom: 15px;
}

.filter-bar input[type="text"] {
  flex: 1;
  height: 40px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.08);
  background-color: var(--bg-input);
  color: var(--text-main);
  outline: none;
}
.filter-bar input[type="text"]:focus {
  border-color: var(--accent-yellow);
}

.filter-bar select {
  width: 180px;
  height: 40px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.08);
  background-color: var(--bg-input);
  color: var(--text-main);
  outline: none;
}

.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

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

.admin-table th {
  background-color: rgba(254, 193, 15, 0.05);
  color: var(--accent-yellow);
  padding: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-weight: 700;
}

.admin-table td {
  padding: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  color: var(--text-muted);
}
.admin-table tr:hover td {
  background-color: rgba(255, 255, 255, 0.01);
  color: var(--text-main);
}

/* Action button configurations */
.action-btn-primary {
  background: var(--yellow-grad);
  color: #000;
  border: none;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  cursor: pointer;
  font-family: var(--font-family);
  transition: all 0.2s;
}
.action-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 10px var(--gold-glow);
}

.action-btn-secondary {
  background-color: rgba(255, 255, 255, 0.04);
  color: var(--text-main);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-family);
}
.action-btn-secondary:hover {
  background-color: rgba(255, 255, 255, 0.08);
}

.action-btn-success {
  background-color: var(--color-success);
  color: #fff;
  border: none;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  cursor: pointer;
  font-family: var(--font-family);
}
.action-btn-success:hover {
  opacity: 0.9;
}

.action-btn-danger {
  background-color: var(--color-danger);
  color: #fff;
  border: none;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  cursor: pointer;
  font-family: var(--font-family);
}
.action-btn-danger:hover {
  opacity: 0.9;
}

.action-btn-warning {
  background-color: var(--color-warning);
  color: #fff;
  border: none;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  cursor: pointer;
  font-family: var(--font-family);
}

.btn-small {
  padding: 3px 8px;
  font-size: 11px;
}
.btn-large {
  padding: 10px 20px;
}

.row-actions {
  display: flex;
  gap: 4px;
}

/* --- REPORTS SCREEN LAYOUT --- */
.reports-layout {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 15px;
  height: 100%;
}

.report-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}

.stat-card {
  background-color: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 12px;
  border-radius: var(--radius-sm);
}
.stat-card .stat-title {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 4px;
  font-weight: bold;
}
.stat-card .stat-value {
  font-size: 16px;
  font-weight: 800;
}
.text-success { color: var(--color-success); }
.text-danger { color: var(--color-danger); }

.report-details-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}

.best-sellers-box, .payment-method-box {
  background-color: rgba(255, 255, 255, 0.01);
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 12px;
  border-radius: var(--radius-sm);
}
.best-sellers-box h3, .payment-method-box h3 {
  font-size: 14px;
  margin-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding-bottom: 4px;
  color: var(--accent-yellow);
}

.best-sellers-list, .payment-ratio-list {
  list-style: none;
  font-size: 13px;
}
.best-sellers-list li, .payment-ratio-list .payment-row-rep {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px dotted rgba(255, 255, 255, 0.06);
}

.ej-log-card {
  display: flex;
  flex-direction: column;
  height: 100%;
}
.ej-search-bar {
  margin-bottom: 10px;
}
.ej-search-bar input {
  width: 100%;
  height: 38px;
  padding: 0 12px;
  background-color: var(--bg-input);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  border-radius: var(--radius-sm);
  outline: none;
}
.ej-log-viewer {
  flex: 1;
  overflow-y: auto;
  background-color: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 12px;
  font-family: monospace;
  font-size: 12px;
  color: var(--accent-yellow);
  border-radius: var(--radius-sm);
  max-height: 450px;
}
.ej-log-row {
  line-height: 1.4;
  white-space: pre-wrap;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  padding: 4px 0;
}
.ej-time {
  color: var(--text-muted);
  margin-right: 6px;
}
.ej-role-cashier {
  color: #fd9726;
}
.ej-role-admin {
  color: #f85149;
}

/* --- SETTINGS SCREEN LAYOUT --- */
.settings-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}

.form-group {
  margin-bottom: 12px;
}
.form-group label {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 4px;
  font-weight: 600;
}
.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="password"],
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background-color: var(--bg-input);
  color: var(--text-main);
  border-radius: var(--radius-sm);
  outline: none;
  font-family: var(--font-family);
  font-size: 13px;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--accent-yellow);
}

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.form-row-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}

.input-with-button {
  display: flex;
  gap: 4px;
}

.db-actions-section {
  display: flex;
  flex-direction: column;
  gap: 15px;
}
.db-action-item {
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding-bottom: 10px;
}
.db-action-item h3 {
  font-size: 14px;
  font-weight: 700;
}
.db-action-item p {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.db-buttons-row {
  display: flex;
  gap: 8px;
}

/* --- POPUP MODAL OVERLAYS (Glassmorphic) --- */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-box {
  background-color: rgba(22, 26, 32, 0.85);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  box-shadow: var(--glass-shadow);
  display: flex;
  flex-direction: column;
  max-height: 85vh;
  transform: scale(0.97);
  transition: transform 0.2s;
}

.modal-overlay.active .modal-box {
  transform: scale(1);
}

.modal-small { width: 340px; }
.modal-medium { width: 640px; }
.modal-large { width: 950px; }
.modal-receipt-box { width: 380px; }
.modal-tax-preview-box { width: 800px; }

.modal-header {
  padding: 12px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.modal-header h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--accent-yellow);
}
.modal-close {
  font-size: 20px;
  color: var(--text-muted);
  cursor: pointer;
}
.modal-close:hover {
  color: #fff;
}

.modal-body {
  padding: 15px 18px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 12px 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* Pinpad Grid */
.pinpad-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 12px;
}
.pin-btn {
  height: 48px;
  font-size: 18px;
  font-weight: bold;
  background-color: rgba(255, 255, 255, 0.02);
  color: var(--text-main);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.pin-btn:hover {
  background-color: rgba(254, 193, 15, 0.1);
  border-color: var(--accent-yellow);
}
.pin-btn.success {
  background: var(--yellow-grad);
  color: #000;
  border: none;
}
.pin-btn.danger {
  background-color: var(--color-danger);
  border: none;
}

.modal-instruction {
  font-size: 12px;
  text-align: center;
  margin-bottom: 8px;
  color: var(--text-muted);
}

.modal-table-container {
  overflow-y: auto;
  max-height: 320px;
  margin-top: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.modal-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.modal-table th {
  background-color: rgba(254, 193, 15, 0.05);
  color: var(--accent-yellow);
  padding: 8px;
  font-weight: bold;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  text-align: left;
}
.modal-table td {
  padding: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.02);
  color: var(--text-muted);
}
.modal-table tr:hover td {
  background-color: rgba(255, 255, 255, 0.01);
  color: var(--text-main);
  cursor: pointer;
}

/* --- PAYMENT SCREEN MODAL --- */
.payment-grid-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 15px;
}

.pay-summary-col {
  background-color: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  padding: 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.pay-summary-card-inner {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pay-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
}
.pay-row.small-row {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: -4px;
}
.pay-row.border-top {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 10px;
}
.pay-row.change-row {
  background-color: var(--bg-input);
  padding: 8px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(254, 193, 15, 0.2);
}

.val-large {
  font-size: 26px;
  font-weight: 800;
  font-family: sans-serif;
}
.val-medium {
  font-size: 18px;
  font-weight: 700;
  font-family: sans-serif;
}

.pay-member-assign {
  margin-top: 15px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 12px;
}
.pay-member-assign h4 {
  font-size: 12px;
  margin-bottom: 6px;
}
.member-search-row {
  display: flex;
  gap: 4px;
}
.member-search-row input {
  flex: 1;
  height: 32px;
  padding: 0 8px;
  border-radius: var(--radius-sm);
  background-color: var(--bg-input);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 13px;
}
.member-assigned-status {
  margin-top: 6px;
  font-size: 11px;
}

.pay-methods-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pay-methods-applied-box {
  background-color: rgba(255, 255, 255, 0.01);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 8px;
  min-height: 100px;
  border-radius: var(--radius-sm);
}
.pay-methods-applied-box h4 {
  font-size: 12px;
  margin-bottom: 6px;
}
.pay-applied-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.pay-applied-table th {
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 4px;
}
.pay-applied-table td {
  padding: 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.02);
}

.payment-type-selector {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  margin-bottom: 10px;
}
.pay-type-btn {
  background-color: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  padding: 8px 2px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  cursor: pointer;
  font-weight: 700;
  font-family: var(--font-family);
  transition: all 0.2s;
}
.pay-type-btn:hover {
  background-color: rgba(255, 255, 255, 0.08);
}
.pay-type-btn.active {
  background: var(--yellow-grad);
  color: #000;
  border: none;
}

.payment-inputs-row {
  display: flex;
  gap: 10px;
}

.quick-cash-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  margin-top: 8px;
}
.quick-cash-btn {
  background-color: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  height: 36px;
  font-weight: bold;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}
.quick-cash-btn:hover {
  background-color: rgba(254, 193, 15, 0.1);
  border-color: var(--accent-yellow);
}

/* --- THERMAL RECEIPT --- */
.receipt-paper {
  background-color: #ffffff;
  color: #000000;
  padding: 15px;
  font-family: monospace;
  font-size: 12px;
  width: 100%;
}
.receipt-header {
  text-align: center;
  margin-bottom: 12px;
}
.receipt-header h2 {
  font-size: 15px;
  font-weight: bold;
  margin-bottom: 4px;
  color: #000;
}
.receipt-header p {
  font-size: 11px;
  margin-bottom: 2px;
}
.receipt-header h3 {
  font-size: 12px;
  font-weight: bold;
  margin: 4px 0;
}
.receipt-divider {
  margin: 6px 0;
  letter-spacing: -1px;
}
.receipt-meta {
  font-size: 11px;
}
.meta-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 2px;
}
.receipt-items-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
  margin: 8px 0;
}
.receipt-items-table th {
  border-bottom: 1px dashed #000;
  padding: 4px 0;
}
.receipt-items-table td {
  padding: 3px 0;
}
.receipt-totals {
  font-size: 11px;
}
.total-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 2px;
}
.total-row.font-bold {
  font-weight: bold;
  font-size: 12px;
}
.receipt-payments {
  font-size: 11px;
  margin: 8px 0;
}
.receipt-footer {
  text-align: center;
  margin-top: 12px;
  font-size: 10px;
}
.receipt-footer .sub-msg {
  font-size: 8px;
  color: #555;
}

/* --- FULL TAX INVOICE A4 --- */
.tax-invoice-a4 {
  background-color: #ffffff;
  color: #000000;
  padding: 25px;
  font-family: var(--font-family);
  font-size: 13px;
  line-height: 1.4;
}
.tax-header-section {
  display: flex;
  justify-content: space-between;
  border-bottom: 2px solid #000;
  padding-bottom: 10px;
}
.tax-header-section .company-details h2 {
  font-size: 18px;
  font-weight: bold;
  margin-bottom: 4px;
  color: #000;
}
.tax-header-section .document-title {
  text-align: right;
}
.tax-header-section .document-title h2 {
  font-size: 22px;
  font-weight: bold;
  color: #000;
}
.tax-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  margin: 15px 0;
}
.tax-info-block {
  padding: 8px;
  font-size: 12px;
}
.tax-info-block h4 {
  border-bottom: 1px solid #000;
  padding-bottom: 2px;
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: bold;
}
.tax-info-block p {
  margin-bottom: 2px;
}

.border-all {
  border: 1px solid #000 !important;
}

.tax-items-table {
  width: 100%;
  border-collapse: collapse;
  margin: 15px 0;
  font-size: 12px;
}
.tax-items-table th, .tax-items-table td {
  border: 1px solid #000;
  padding: 6px;
}
.table-header-bg {
  background-color: #f2f2f2;
}

.tax-footer-section {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 15px;
  margin-top: 25px;
}
.tax-signatures {
  display: flex;
  justify-content: space-between;
  padding-top: 15px;
}
.sig-box {
  text-align: center;
  font-size: 11px;
}
.sig-box p {
  margin-top: 6px;
}

.tax-summary-a4 {
  padding: 8px;
  font-size: 12px;
}
.tax-sum-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 3px;
}
.bg-total-a4 {
  background-color: #e2e8f0;
  padding: 4px;
}

/* --- CUSTOMER DISPLAY SCREEN SIMULATOR --- */
.vfd-vbox {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.customer-display-screen {
  background-color: #0f172a;
  border: 1px solid #334155;
  border-radius: var(--radius-sm);
  padding: 15px;
  color: #f1f5f9;
}
.cust-disp-header {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid #334155;
  padding-bottom: 8px;
  margin-bottom: 12px;
}
.cust-disp-body {
  display: grid;
  grid-template-columns: 1fr 180px;
  gap: 15px;
}
.cust-disp-table-wrapper {
  background-color: #020617;
  border: 1px solid #1e293b;
  padding: 8px;
  height: 160px;
  overflow-y: auto;
}
.cust-disp-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}
.cust-disp-table th {
  text-align: left;
  border-bottom: 1px solid #1e293b;
  padding-bottom: 4px;
}
.cust-disp-table td {
  padding: 3px 0;
}
.cust-disp-totals {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.cust-disp-totals .total-box {
  background-color: #020617;
  border: 1px solid #1e293b;
  padding: 10px;
  text-align: right;
}
.cust-disp-totals .lbl {
  display: block;
  font-size: 10px;
  color: #64748b;
  margin-bottom: 4px;
}
.cust-disp-totals .val {
  font-size: 20px;
  font-weight: bold;
  color: var(--accent-yellow);
}
.payment-qr-box {
  background-color: #ffffff;
  color: #000;
  padding: 8px;
  border-radius: var(--radius-sm);
  text-align: center;
  margin-top: 8px;
}
.payment-qr-box p {
  font-size: 10px;
  font-weight: bold;
  margin-bottom: 4px;
}
.qr-mock {
  width: 80px;
  height: 80px;
  background-color: #eee;
  margin: 0 auto;
}

/* --- PRINT SYSTEM STYLES --- */
@media print {
  body {
    background-color: #ffffff !important;
    color: #000000 !important;
    height: auto !important;
    overflow: auto !important;
  }
  
  /* Hide UI elements */
  .no-print,
  .system-nav-bar,
  .app-container,
  .modal-overlay,
  .modal-box {
    display: none !important;
  }
  
  /* Show only printing target */
  #modal-receipt-preview.active,
  #modal-tax-preview.active {
    display: block !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: auto !important;
    background: none !important;
  }
  
  #modal-receipt-preview.active .modal-box,
  #modal-tax-preview.active .modal-box {
    border: none !important;
    box-shadow: none !important;
    background: none !important;
    transform: none !important;
    width: 100% !important;
    max-height: none !important;
  }
  
  #modal-receipt-preview.active .modal-body,
  #modal-tax-preview.active .modal-body {
    padding: 0 !important;
    overflow: visible !important;
  }

  /* Thermal Receipt adjustments */
  .receipt-paper {
    width: 80mm !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  /* Full tax invoice adjustments */
  .tax-invoice-a4 {
    width: 210mm !important;
    height: 297mm !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
  }
}
