/* CSS VARIABLES - THEME SYSTEM */
:root {
  --primary-color: #6366f1; /* Indigo */
  --primary-hover: #4f46e5;
  --secondary-color: #f3f4f6;
  --success-color: #10b981; /* Emerald */
  --success-hover: #059669;
  --danger-color: #ef4444; /* Rose */
  --danger-hover: #dc2626;
  --warning-color: #f59e0b; /* Amber */
  --text-main: #111827; /* Slate 900 */
  --text-muted: #6b7280; /* Slate 500 */
  --bg-app: #f9fafb;
  --bg-card: #ffffff;
  --border-color: #e5e7eb;
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-pos: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  
  --font-sans: 'Outfit', sans-serif;
  --font-mono: 'Courier Prime', monospace;
}

/* BASIC RESET */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-sans);
  background-color: #0f172a; /* Slate 900 for background */
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow-x: hidden;
  padding: 20px 0;
}

/* PHYSICAL TERMINAL FRAME (For Desktop/Laptop demonstration) */
.pos-terminal-frame {
  position: relative;
  width: 440px;
  background: linear-gradient(135deg, #334155 0%, #1e293b 100%);
  border: 12px solid #475569;
  border-radius: 40px;
  box-shadow: var(--shadow-pos);
  padding: 15px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  transition: all 0.3s ease;
  z-index: 10;
}

/* physical screen housing */
.pos-screen {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 680px;
  background-color: var(--bg-app);
  border-radius: 20px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: 4px solid #0f172a;
  box-shadow: inset 0 0 10px rgba(0,0,0,0.5);
}

/* PHYSICAL THERMAL PRINTER SLOT */
.physical-printer-slot {
  position: relative;
  width: 90%;
  height: 14px;
  background-color: #0f172a;
  border-radius: 6px;
  border-bottom: 2px solid #64748b;
  margin-top: 10px;
  box-shadow: inset 0 3px 5px rgba(0,0,0,0.8);
  z-index: 50; /* Garante que o papel que sai da impressora fique por cima da tela do celular/maquininha */
}

.printer-paper-tear {
  position: absolute;
  top: 12px;
  left: 5%;
  width: 90%;
  height: 6px;
  background-image: linear-gradient(45deg, transparent 50%, #475569 50%), linear-gradient(-45deg, transparent 50%, #475569 50%);
  background-size: 8px 12px;
  background-repeat: repeat-x;
  z-index: 12;
  pointer-events: none;
  opacity: 0.8;
}

/* THERMAL RECEIPT PAPER OUTFLOW ANIMATION */
.receipt-paper {
  position: absolute;
  top: 12px;
  left: 7.5%;
  width: 85%;
  max-height: 0px;
  background-color: #fcfcfc;
  color: #111;
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.3;
  overflow: hidden;
  box-shadow: 0 10px 20px rgba(0,0,0,0.25);
  border-left: 1px solid #ddd;
  border-right: 1px solid #ddd;
  z-index: 100; /* Garante empilhamento superior absoluto para leitura do recibo */
  transition: max-height 1.8s cubic-bezier(0.1, 0.8, 0.25, 1);
  padding: 0 15px;
}

/* When active, receipt slides out */
.receipt-paper.printing {
  max-height: 480px;
  padding: 20px 15px;
  overflow-y: auto;
  border-bottom: 6px dashed #ccc;
}

/* Scrollbar styling for receipt in frame */
.receipt-paper::-webkit-scrollbar {
  width: 4px;
}
.receipt-paper::-webkit-scrollbar-thumb {
  background-color: rgba(0,0,0,0.15);
  border-radius: 2px;
}

/* PHYSICAL NFC/LED READER INDICATOR */
.physical-nfc-indicator {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.nfc-led {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: #334155;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.4);
  transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

/* LED blinking classes */
.nfc-led.active-blink {
  animation: nfcLedBlink 1s infinite alternate;
}
.nfc-led.success-solid {
  background-color: var(--success-color);
  box-shadow: 0 0 8px var(--success-color), inset 0 1px 2px rgba(255,255,255,0.4);
}

.nfc-label {
  font-size: 11px;
  color: #94a3b8;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

@keyframes nfcLedBlink {
  0% { background-color: #334155; box-shadow: none; }
  100% { background-color: var(--primary-color); box-shadow: 0 0 6px var(--primary-color); }
}

/* ANDROID STATUS BAR */
.android-status-bar {
  height: 24px;
  background-color: #000;
  color: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 12px;
  font-size: 11px;
  font-weight: 500;
  user-select: none;
}

.status-bar-left, .status-bar-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.status-time {
  font-weight: 600;
}

.status-icon {
  opacity: 0.85;
}

/* APP HEADER */
.app-header {
  height: 60px;
  background-color: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 16px;
  box-shadow: var(--shadow-sm);
  z-index: 8;
}

.app-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--primary-color);
  letter-spacing: -0.5px;
}

.app-subtitle {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 500;
}

.icon-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease, color 0.2s ease;
}

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

/* MAIN APP CONTENT HOUSING */
.app-main-content {
  flex: 1;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* VIEW PANELS */
.view-panel {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-app);
  opacity: 0;
  visibility: hidden;
  transform: translateX(30px);
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
  z-index: 1;
}

.view-panel.active-view {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
  z-index: 2;
}

/* VIEW 1: CATALOG VIEW - CATEGORIES & PRODUCT GRID */
.category-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 12px 16px;
  scrollbar-width: none; /* Firefox */
  background-color: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
}

.category-tabs::-webkit-scrollbar {
  display: none; /* Chrome/Safari */
}

.category-tab {
  background-color: var(--secondary-color);
  color: var(--text-muted);
  border: none;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.category-tab.active {
  background-color: var(--primary-color);
  color: #fff;
  box-shadow: var(--shadow-sm);
}

.product-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  padding: 12px 16px 100px 16px; /* Padding bottom accounts for Cart Bar */
  overflow-y: auto;
  align-content: start;
}

/* PRODUCT CARD STYLING */
.product-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  user-select: none;
  box-shadow: var(--shadow-sm);
}

.product-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-color);
}

.product-card:active {
  transform: scale(0.97);
}

.product-img-container {
  width: 90px;
  height: 90px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #f8fafc;
}

/* If no product image file, SVG gets loaded styling */
.product-img-container svg {
  width: 54px;
  height: 54px;
  color: var(--primary-color);
  opacity: 0.85;
}

.product-img-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 4px;
  height: 18px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  width: 100%;
}

.product-price {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary-color);
}

/* STICKY BOTTOM CART BAR */
.bottom-cart-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 76px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 16px;
  z-index: 10;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.1, 0.8, 0.25, 1);
}

.bottom-cart-bar.visible {
  transform: translateY(0);
}

.cart-bar-info {
  display: flex;
  flex-direction: column;
}

.cart-count-badge {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
}

.cart-total-container {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.total-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
}

.total-price-value {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-main);
}

.checkout-btn {
  background-color: var(--primary-color);
  color: #fff;
  border: none;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 4px 6px rgba(99, 102, 241, 0.2);
  transition: background-color 0.2s ease, transform 0.15s ease;
}

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

.checkout-btn:active {
  transform: scale(0.96);
}

/* VIEW 2: CHECKOUT VIEW */
.checkout-container {
  padding: 16px;
  overflow-y: auto;
  flex: 1;
}

.back-link-btn {
  background: none;
  border: none;
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--primary-color);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  margin-bottom: 16px;
}

.back-link-btn:hover {
  color: var(--primary-hover);
}

.section-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.checkout-items-list {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.checkout-item-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
}

.checkout-item-row:last-child {
  border-bottom: none;
}

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

.item-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
}

.item-sub-price {
  font-size: 11px;
  color: var(--text-muted);
}

.item-quantity-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  background-color: var(--secondary-color);
  border-radius: var(--radius-sm);
  padding: 4px;
}

.qty-btn {
  background-color: #fff;
  border: 1px solid var(--border-color);
  color: var(--text-main);
  width: 24px;
  height: 24px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: all 0.15s ease;
}

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

.qty-val {
  font-size: 13px;
  font-weight: 700;
  min-width: 14px;
  text-align: center;
}

.checkout-summary-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}

.summary-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 13px;
  color: var(--text-muted);
}

.summary-row:last-child {
  margin-bottom: 0;
}

.font-large {
  font-size: 16px !important;
}

.font-bold {
  font-weight: 800 !important;
  color: var(--text-main) !important;
}

/* PAYMENT SELECTOR GRID */
.payment-methods-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-bottom: 20px;
}

.payment-method-card {
  background-color: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 16px;
  cursor: pointer;
  text-align: left;
  font-family: var(--font-sans);
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
  width: 100%;
}

.payment-method-card:hover {
  border-color: var(--primary-color);
  transform: translateY(-1px);
}

.payment-method-card:active {
  transform: scale(0.98);
}

.payment-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}

.card-icon {
  background: linear-gradient(135deg, #4f46e5 0%, #312e81 100%);
}

.pix-icon {
  background: linear-gradient(135deg, #0d9488 0%, #115e59 100%);
}

.payment-label {
  display: flex;
  flex-direction: column;
}

.payment-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
}

.payment-desc {
  font-size: 11px;
  color: var(--text-muted);
}

/* VIEW 3: SIMULATED PAYMENT PROCESSING */
.payment-process-container {
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  height: 100%;
  align-items: center;
}

.payment-header {
  text-align: center;
  margin-bottom: 24px;
}

.payment-title {
  font-size: 16px;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.payment-amount {
  font-size: 32px;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.5px;
}

.payment-screen-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.payment-instructions {
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
  margin-top: 16px;
  font-weight: 500;
}

.demo-trigger-btn {
  background-color: var(--secondary-color);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 15px;
  transition: all 0.2s ease;
}

.demo-trigger-btn:hover {
  background-color: var(--border-color);
  border-color: var(--text-muted);
}

/* CARD TRANS-NFC WAVE ANIMATION */
.card-animation-area {
  position: relative;
  width: 180px;
  height: 140px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.contactless-wave-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  position: relative;
}

.contactless-wave-icon span {
  position: absolute;
  border: 2px solid var(--primary-color);
  border-radius: 50%;
  animation: nfcWave 1.6s infinite linear;
  opacity: 0;
}

.contactless-wave-icon span:nth-child(1) { animation-delay: 0s; width: 12px; height: 12px; }
.contactless-wave-icon span:nth-child(2) { animation-delay: 0.4s; width: 24px; height: 24px; }
.contactless-wave-icon span:nth-child(3) { animation-delay: 0.8s; width: 36px; height: 36px; }
.contactless-wave-icon span:nth-child(4) { animation-delay: 1.2s; width: 48px; height: 48px; }

@keyframes nfcWave {
  0% { transform: scale(0.5); opacity: 0; }
  30% { opacity: 0.8; }
  100% { transform: scale(1.6); opacity: 0; }
}

.pos-terminal-illustration {
  width: 40px;
  height: 24px;
  background-color: #64748b;
  border-radius: 4px;
  margin-top: 12px;
  position: relative;
}

.card-insert-slot-animation {
  position: absolute;
  bottom: 0;
  left: 5px;
  width: 30px;
  height: 4px;
  background-color: #0f172a;
}

/* PIX QR CODE */
.pix-qr-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.pix-qr-code {
  width: 170px;
  height: 170px;
  background-color: #fff;
  border: 8px solid #fff;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="150" height="150" viewBox="0 0 100 100"><path fill="%230f172a" d="M0 0h30v10H10v20H0V0zm70 0h30v30H90V10H70V0zM0 70h10v20h20v10H0V70zm90 20H70v10h30V70H90v20zM30 30h40v40H30V30zm10 10v20h20V40H40z M20 20h5v5h-5z M25 75h5v5h-5z M75 25h5v5h-5z M80 80h5v5h-5z M50 20h5v5h-5z M20 50h5v5h-5z"/></svg>');
  background-size: cover;
  background-position: center;
}

.pix-countdown {
  font-size: 13px;
  font-weight: 700;
  color: var(--danger-color);
  background-color: rgba(239, 68, 68, 0.1);
  padding: 4px 10px;
  border-radius: 20px;
}

.pix-copiapasta-container {
  display: flex;
  margin-top: 15px;
  width: 100%;
  max-width: 280px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background-color: #fff;
}

.pix-code-input {
  flex: 1;
  border: none;
  padding: 8px 12px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  background: none;
}

.pix-copy-btn {
  background-color: var(--secondary-color);
  border: none;
  border-left: 1px solid var(--border-color);
  color: var(--primary-color);
  padding: 0 12px;
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.pix-copy-btn:hover {
  background-color: var(--border-color);
}

/* PROCESSING OVERLAY STATE */
.processing-state-overlay, .success-state-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--bg-app);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 15;
}

.custom-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--border-color);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spinnerAnim 0.8s infinite linear;
  margin-bottom: 20px;
}

@keyframes spinnerAnim {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.processing-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 6px;
}

.processing-subtitle {
  font-size: 12px;
  color: var(--text-muted);
}

/* SUCCESS STATE */
.success-checkmark-circle {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background-color: rgba(16, 185, 129, 0.1);
  color: var(--success-color);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.2);
  animation: scaleIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.checkmark-svg {
  animation: drawCheckmark 0.6s ease-out forwards;
}

@keyframes scaleIn {
  0% { transform: scale(0.6); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.success-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 6px;
}

.success-subtitle {
  font-size: 13px;
  color: var(--success-color);
  font-weight: 600;
  margin-bottom: 20px;
}

.success-details {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 12px 20px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.6;
  text-align: center;
  max-width: 240px;
  box-shadow: var(--shadow-sm);
}

.cancel-payment-btn {
  background: none;
  border: none;
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--danger-color);
  font-weight: 600;
  cursor: pointer;
  margin-top: auto;
  padding: 10px;
}

.cancel-payment-btn:hover {
  color: var(--danger-hover);
}

/* UTILITY SPACING */
.mt-20 { margin-top: 20px; }
.hidden { display: none !important; }
.text-right { text-align: right; }

/* VIEW 4: ADMIN VIEW & MODALS */
.admin-container {
  padding: 16px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.admin-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.admin-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-main);
}

.admin-close-btn {
  background-color: var(--secondary-color);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-family: var(--font-sans);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.admin-close-btn:hover {
  background-color: var(--border-color);
}

.admin-tabs-nav {
  display: flex;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 16px;
}

.admin-tab-btn {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 700;
  padding: 10px 12px;
  cursor: pointer;
  flex: 1;
  transition: all 0.2s ease;
}

.admin-tab-btn.active {
  color: var(--primary-color);
  border-bottom-color: var(--primary-color);
}

.admin-tab-content {
  display: none;
  flex-direction: column;
  flex: 1;
}

.admin-tab-content.active {
  display: flex;
}

.admin-action-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.admin-sub-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
}

.primary-btn {
  background-color: var(--primary-color);
  color: #fff;
  border: none;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

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

.secondary-btn {
  background-color: var(--secondary-color);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.secondary-btn:hover {
  background-color: var(--border-color);
}

.danger-btn-outline {
  background: none;
  border: 1px solid var(--danger-color);
  color: var(--danger-color);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.danger-btn-outline:hover {
  background-color: var(--danger-color);
  color: #fff;
}

/* ADMIN TABLES */
.admin-table-container {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow-y: auto;
  flex: 1;
  max-height: 320px;
  box-shadow: var(--shadow-sm);
}

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

.admin-table th, .admin-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-color);
}

.admin-table th {
  background-color: #f8fafc;
  font-weight: 700;
  color: var(--text-muted);
}

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

.table-row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.table-action-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  color: var(--text-muted);
  transition: background-color 0.15s ease, color 0.15s ease;
}

.table-action-btn.edit-btn:hover {
  background-color: rgba(99, 102, 241, 0.1);
  color: var(--primary-color);
}

.table-action-btn.delete-btn:hover {
  background-color: rgba(239, 68, 68, 0.1);
  color: var(--danger-color);
}

/* STATS DASHBOARD */
.dashboard-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.stat-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px;
  box-shadow: var(--shadow-sm);
}

.stat-label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
}

.stat-value {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-main);
  margin-top: 4px;
}

/* FORMS */
.settings-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

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

.form-group label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-main);
}

.form-group input, .form-group select {
  border: 1px solid var(--border-color);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 13px;
  outline: none;
  background-color: var(--bg-card);
  transition: border-color 0.2s ease;
}

.form-group input:focus, .form-group select:focus {
  border-color: var(--primary-color);
}

.form-actions-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
}

/* MODAL SCREEN OVERLAYS */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 16px;
}

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

.modal-card {
  background-color: var(--bg-card);
  border-radius: var(--radius-md);
  width: 100%;
  max-width: 380px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: modalScaleIn 0.3s cubic-bezier(0.1, 0.8, 0.25, 1);
}

@keyframes modalScaleIn {
  0% { transform: scale(0.9); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

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

.modal-title {
  font-size: 15px;
  font-weight: 800;
}

.modal-close-btn {
  background: none;
  border: none;
  font-size: 24px;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
}

.modal-close-btn:hover {
  color: var(--text-main);
}

#productForm {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 6px;
}

/* TOASTS NOTIFICATIONS */
.toast-container {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 200;
  width: 90%;
  max-width: 320px;
  pointer-events: none;
}

.toast {
  background-color: #1e293b;
  color: #fff;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 0;
  transform: translateY(20px);
  animation: toastFadeInUp 0.3s forwards, toastFadeOut 0.3s 2.7s forwards;
  pointer-events: auto;
}

.toast.toast-success {
  border-left: 4px solid var(--success-color);
}

.toast.toast-error {
  border-left: 4px solid var(--danger-color);
}

@keyframes toastFadeInUp {
  to { opacity: 1; transform: translateY(0); }
}

@keyframes toastFadeOut {
  to { opacity: 0; transform: translateY(-10px); }
}

/* MONOSPACE RECEIPT DETAILS TYPOGRAPHY */
.receipt-header {
  text-align: center;
  margin-bottom: 12px;
  font-size: 11px;
}

.receipt-store-title {
  font-weight: 700;
  text-transform: uppercase;
  font-size: 13px;
}

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

.receipt-item-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 2px;
}

.receipt-totals {
  margin-top: 6px;
}

.receipt-total-row {
  display: flex;
  justify-content: space-between;
  font-weight: 700;
}

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

.receipt-barcode {
  width: 80%;
  height: 30px;
  margin: 10px auto 4px auto;
  background: repeating-linear-gradient(90deg, #111, #111 2px, #fff 2px, #fff 5px);
}

.receipt-print-btn {
  display: block;
  width: 100%;
  margin-top: 15px;
  background-color: var(--text-main);
  color: #fff;
  border: none;
  padding: 8px;
  border-radius: 4px;
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 11px;
  cursor: pointer;
  transition: opacity 0.2s;
}

.receipt-print-btn:hover {
  opacity: 0.9;
}

/* RESPONSIVENESS AND DEVICE FULLSCREEN FOR MOBILE/POS TERMINALS */
@media (max-width: 600px) {
  body {
    padding: 0;
    background-color: var(--bg-app);
  }
  
  .pos-terminal-frame {
    width: 100%;
    height: 100vh;
    border: none;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
    background: none;
  }
  
  .pos-screen {
    height: 100%;
    border: none;
    border-radius: 0;
    box-shadow: none;
  }
  
  .physical-printer-slot {
    display: none; /* Hide simulated print outflow on real smaller touch screens */
  }
  
  .physical-nfc-indicator {
    display: none;
  }
}

/* PRINT MEDIA OVERRIDE FOR PHYSICAL PRINTERS */
@media print {
  body * {
    visibility: hidden;
  }
  
  #receiptPaper, #receiptPaper * {
    visibility: visible;
  }
  
  #receiptPaper {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    box-shadow: none;
    border: none;
    max-height: none !important;
    padding: 0;
    margin: 0;
    overflow: visible;
  }
  
  .receipt-print-btn {
    display: none; /* Hide print button on real paper print */
  }
}
