/* Maje POS - Custom CSS (Vanilla CSS & Modern Design System) */

:root {
  /* Colors */
  --bg-main: #0c0d14;
  --bg-sidebar: #121420;
  --bg-card: rgba(22, 25, 41, 0.7);
  --bg-card-hover: rgba(31, 35, 56, 0.85);
  --border-color: rgba(255, 255, 255, 0.08);

  --primary: #ff6b35;
  --primary-hover: #fa5c23;
  --primary-light: rgba(255, 107, 53, 0.15);

  --success: #10b981;
  --success-hover: #059669;
  --success-light: rgba(16, 185, 129, 0.1);

  --warning: #f59e0b;
  --warning-light: rgba(245, 158, 11, 0.1);

  --danger: #ef4444;
  --danger-hover: #dc2626;
  --danger-light: rgba(239, 68, 68, 0.1);

  --text-primary: #f3f4f6;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;

  /* Typography */
  --font-family: "Plus Jakarta Sans", system-ui, -apple-system, sans-serif;
  --font-heading: "Outfit", sans-serif;

  /* UI Elements */
  --sidebar-width: 260px;
  --header-height: 70px;
  --border-radius-sm: 6px;
  --border-radius-md: 12px;
  --border-radius-lg: 18px;
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 10px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.5);
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* RESET & BASE STYLES */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-main);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.5;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-heading);
  font-weight: 600;
  letter-spacing: -0.02em;
}

/* Scrollbar customization */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* GLOBAL HELPER CLASSES */
.hidden {
  display: none !important;
}
.text-center {
  text-align: center;
}
.text-right {
  text-align: right;
}
.text-primary {
  color: var(--primary) !important;
}
.text-success {
  color: var(--success) !important;
}
.text-warning {
  color: var(--warning) !important;
}
.text-danger {
  color: var(--danger) !important;
}
.text-muted {
  color: var(--text-muted) !important;
}
.font-sm {
  font-size: 0.85rem;
}
.font-md {
  font-size: 1rem;
}
.font-lg {
  font-size: 1.2rem;
}
.font-bold {
  font-weight: 700;
}
.mt-1 {
  margin-top: 0.25rem;
}
.mt-2 {
  margin-top: 0.5rem;
}
.mt-3 {
  margin-top: 1rem;
}
.mb-2 {
  margin-bottom: 0.5rem;
}
.mb-3 {
  margin-bottom: 1rem;
}
.mb-4 {
  margin-bottom: 1.5rem;
}
.border-left-primary {
  border-left: 4px solid var(--primary);
}
.border-left-success {
  border-left: 4px solid var(--success);
}
.border-left-warning {
  border-left: 4px solid var(--warning);
}
.border-left-danger {
  border-left: 4px solid var(--danger);
}
.border-left-info {
  border-left: 4px solid #3b82f6;
}
.flex-1 {
  flex: 1;
}
.justify-center {
  justify-content: center;
}

/* REUSABLE GLASS CARD */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  padding: 1.25rem;
  box-shadow: var(--shadow-md);
  transition: var(--transition);
}
.glass-card:hover {
  box-shadow: var(--shadow-lg);
}

/* BUTTONS */
.btn {
  font-family: var(--font-family);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 1.2rem;
  border-radius: var(--border-radius-sm);
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid transparent;
  gap: 0.5rem;
  font-size: 0.9rem;
}
.btn-primary {
  background-color: var(--primary);
  color: #fff;
}
.btn-primary:hover {
  background-color: var(--primary-hover);
  transform: translateY(-1px);
}
.btn-primary:active {
  transform: translateY(0);
}
.btn-primary:disabled {
  background-color: var(--text-muted);
  cursor: not-allowed;
  transform: none;
}
.btn-outline {
  background-color: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-primary);
}
.btn-outline:hover {
  background-color: rgba(255, 255, 255, 0.05);
  border-color: var(--text-secondary);
}
.btn-outline-primary {
  background-color: transparent;
  border: 1px solid var(--primary);
  color: var(--primary);
}
.btn-outline-primary:hover {
  background-color: var(--primary-light);
}
.btn-outline-danger {
  background-color: transparent;
  border: 1px solid var(--danger);
  color: var(--danger);
}
.btn-outline-danger:hover {
  background-color: var(--danger-light);
}
.btn-danger {
  background-color: var(--danger);
  color: #fff;
}
.btn-danger:hover {
  background-color: var(--danger-hover);
  transform: translateY(-1px);
}
.btn-danger-link {
  background: transparent;
  color: var(--danger);
  border: none;
  font-size: 0.9rem;
  font-weight: 500;
}
.btn-danger-link:hover {
  background-color: var(--danger-light);
}
.btn-block {
  display: flex;
  width: 100%;
}
.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
  border-radius: var(--border-radius-sm);
}
.btn-lg {
  padding: 0.85rem 1.5rem;
  font-size: 1rem;
}

/* OVERLAYS (Auth, Modals, Loading) */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(6, 7, 12, 0.85);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 1.5rem 1rem;
  overflow-y: auto;
  box-sizing: border-box;
}

/* LOADING SPINNER */
.spinner-container {
  text-align: center;
}
.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(255, 255, 255, 0.1);
  border-left-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 1rem;
}
@keyframes spin {
  100% {
    transform: rotate(360deg);
  }
}

/* AUTHENTICATION / LOGIN CARD */
.auth-card {
  width: 90%;
  max-width: 400px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: var(--shadow-lg);
}
.auth-header {
  text-align: center;
  margin-bottom: 1.5rem;
}
.app-logo {
  font-size: 3rem;
  margin-bottom: 0.5rem;
}

.app-logo img {
  height: 3rem; /* Mengikuti ukuran tinggi emoji sebelumnya */
  width: auto; /* Lebar otomatis agar gambar tidak gepeng */
  object-fit: contain;
}

.auth-header h2 {
  font-size: 1.8rem;
  color: var(--text-primary);
}
.auth-header p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}
.auth-demo-hints {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px dashed var(--border-color);
  font-size: 0.8rem;
  color: var(--text-secondary);
}
.auth-demo-hints code {
  background-color: rgba(255, 255, 255, 0.08);
  padding: 0.1rem 0.3rem;
  border-radius: 3px;
  color: var(--primary);
}

/* FORM ELEMENTS */
.form-group {
  margin-bottom: 1.25rem;
}
.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
}
.form-group input,
.form-group select {
  width: 100%;
  padding: 0.7rem 0.9rem;
  background-color: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: 0.9rem;
  transition: var(--transition);
}
.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary);
  background-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.2);
}
.form-row {
  display: flex;
  gap: 1rem;
}
.input-prefix-container {
  display: flex;
  position: relative;
}
.input-prefix {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 600;
}
.input-prefix-container input {
  padding-left: 2.2rem;
}
.error-msg {
  color: var(--danger);
  font-size: 0.85rem;
  margin-bottom: 1rem;
  font-weight: 500;
}

/* APP LAYOUT */
.app-container {
  display: flex;
  min-height: 100vh;
}

/* SIDEBAR STYLES */
.sidebar {
  width: var(--sidebar-width);
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: var(--transition);
  z-index: 100;
}
.sidebar-brand {
  height: var(--header-height);
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-bottom: 1px solid var(--border-color);
}
.logo-emoji {
  font-size: 1.8rem;
}
.sidebar-brand h3 {
  font-size: 1.15rem;
  color: #fff;
}
.sub-brand {
  font-size: 0.75rem;
  color: var(--text-secondary);
  display: block;
  margin-top: -2px;
}
.user-profile-badge {
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-bottom: 1px solid var(--border-color);
  background-color: rgba(255, 255, 255, 0.01);
}
.user-profile-badge .avatar {
  width: 38px;
  height: 38px;
  background-color: rgba(255, 255, 255, 0.06);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  border: 1px solid var(--border-color);
}
.user-info {
  display: flex;
  flex-direction: column;
}
#user-display-name {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-primary);
}
.role-tag {
  font-size: 0.7rem;
  color: var(--primary);
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.05em;
  margin-top: 1px;
}
.sidebar-nav {
  padding: 1.25rem 0.75rem;
  flex-grow: 1;
}
.sidebar-nav ul {
  list-style: none;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.8rem 1rem;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: var(--border-radius-sm);
  font-weight: 500;
  font-size: 0.95rem;
  transition: var(--transition);
  margin-bottom: 0.25rem;
}
.nav-item:hover {
  background-color: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
}
.nav-item.active {
  background-color: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
}
.sidebar-footer {
  padding: 1rem 1rem 1.5rem;
  border-top: 1px solid var(--border-color);
}
.connection-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  margin-bottom: 1rem;
  justify-content: center;
  padding: 0.4rem;
  border-radius: 4px;
  background-color: rgba(0, 0, 0, 0.2);
}
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.connection-status.online .status-dot {
  background-color: var(--success);
  box-shadow: 0 0 8px var(--success);
}
.connection-status.offline .status-dot {
  background-color: var(--danger);
  box-shadow: 0 0 8px var(--danger);
}

/* CONTENT CONTAINER */
.content-wrapper {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* TOP BAR */
.top-bar {
  height: var(--header-height);
  background-color: rgba(12, 13, 20, 0.5);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-color);
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.menu-toggle-btn {
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-primary);
  display: none; /* Desktop hidden */
}
.top-bar-title h2 {
  font-size: 1.3rem;
  color: #fff;
}
.top-bar-title p {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: -1px;
}
.live-clock {
  font-family: monospace;
  font-size: 1rem;
  background-color: rgba(255, 255, 255, 0.06);
  padding: 0.4rem 0.8rem;
  border-radius: var(--border-radius-sm);
  border: 1px solid var(--border-color);
  letter-spacing: 0.05em;
  font-weight: bold;
}

/* VIEW PANEL MAIN LAYOUT */
.view-panels {
  flex-grow: 1;
  padding: 1.5rem 2rem;
  overflow-y: auto;
  height: calc(100vh - var(--header-height));
}
.view-panel {
  animation: fadeIn 0.2s ease-in-out;
}
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ========================================================
   POS VIEW LAYOUT
   ======================================================== */
.pos-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 1.5rem;
  height: 100%;
}
.pos-products-panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  height: 100%;
}
.search-and-filter {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  flex-shrink: 0;
}
.search-box {
  display: flex;
  align-items: center;
  background-color: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  padding: 0.6rem 1rem;
  gap: 0.75rem;
  transition: var(--transition);
}
.search-box:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
  background-color: rgba(255, 255, 255, 0.07);
}
.search-box input {
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: 0.95rem;
  width: 100%;
}
.search-box input:focus {
  outline: none;
}
.search-icon {
  color: var(--text-secondary);
}

.category-tabs {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
}
.category-tab {
  padding: 0.5rem 1.1rem;
  background-color: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  border-radius: 30px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}
.category-tab:hover {
  background-color: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}
.category-tab.active {
  background-color: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* Products Grid */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
  overflow-y: auto;
  padding-bottom: 2rem;
}
.product-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  padding: 0;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  position: relative;
  transition: var(--transition);
  min-height: 220px;
  overflow: hidden;
}
.product-card:hover {
  background-color: var(--bg-card-hover);
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.15);
}
.product-card-img-wrap {
  height: 110px;
  width: 100%;
  overflow: hidden;
  border-bottom: 1px solid var(--border-color);
  position: relative;
  background-color: rgba(0, 0, 0, 0.2);
}
.product-card-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition);
}
.product-card:hover .product-card-img-wrap img {
  transform: scale(1.05);
}
.product-card-img-wrap.placeholder-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
}
.placeholder-emoji {
  font-size: 2.2rem;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.3));
}
.product-card-body {
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}
.product-card-category {
  font-size: 0.7rem;
  color: var(--primary);
  text-transform: uppercase;
  font-weight: 700;
  margin-bottom: 0.25rem;
}
.product-card-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  word-break: break-word;
  line-height: 1.3;
}
.product-card-price {
  font-weight: 700;
  font-size: 1.1rem;
  color: #fff;
  margin-top: auto;
}
.product-card-stock {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.stock-pill {
  display: inline-block;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  font-weight: bold;
}
.stock-safe {
  background-color: var(--success-light);
  color: var(--success);
}
.stock-warning {
  background-color: var(--warning-light);
  color: var(--warning);
}
.stock-danger {
  background-color: var(--danger-light);
  color: var(--danger);
}

/* Cart Panel Layout */
.pos-cart-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-height: calc(100vh - var(--header-height) - 3rem);
}
.cart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-color);
}
.cart-header h3 {
  font-size: 1.1rem;
}
.cart-items-wrapper {
  flex-grow: 1;
  min-height: 120px; /* Guarantee enough room for items on short screens */
  overflow-y: auto;
  padding: 0.75rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.empty-cart-msg {
  text-align: center;
  margin: auto;
  color: var(--text-secondary);
  padding: 2rem 1rem;
}
.empty-cart-icon {
  font-size: 2.5rem;
  display: block;
  margin-bottom: 0.5rem;
  opacity: 0.4;
}

/* Cart Item Row */
.cart-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem;
  background-color: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  transition: var(--transition);
}
.cart-item-details {
  flex-grow: 1;
  padding-right: 0.5rem;
}
.cart-item-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  word-break: break-word;
}
.cart-item-price {
  font-size: 0.8rem;
  color: var(--text-secondary);
}
.cart-item-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.btn-qty {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  border: 1px solid var(--border-color);
  background-color: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  cursor: pointer;
  transition: var(--transition);
}
.btn-qty:hover {
  background-color: var(--primary);
  border-color: var(--primary);
}
.cart-item-qty {
  font-weight: bold;
  font-size: 0.9rem;
  min-width: 20px;
  text-align: center;
}
.cart-item-total {
  font-weight: 700;
  font-size: 0.9rem;
  color: #fff;
  min-width: 75px;
  text-align: right;
}

/* Cart Summary & Payments */
.cart-summary {
  border-top: 1px solid var(--border-color);
  padding-top: 1rem;
  margin-top: auto;
}
.summary-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}
.payment-method-selector {
  margin: 0.75rem 0;
}
.section-label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 600;
  margin-bottom: 0.4rem;
  text-transform: uppercase;
}
.payment-options {
  display: flex;
  gap: 0.5rem;
}
.pay-option {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.6rem;
  background-color: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  cursor: pointer;
  transition: var(--transition);
}
.pay-option input {
  display: none;
}
.pay-option:hover {
  background-color: rgba(255, 255, 255, 0.06);
}
.pay-option.active {
  border-color: var(--primary);
  background-color: var(--primary-light);
  color: var(--primary);
  font-weight: bold;
}
.option-icon {
  font-size: 1.2rem;
  margin-bottom: 0.1rem;
}
.option-label {
  font-size: 0.75rem;
}

/* Cash input area */
.cash-payment-inputs {
  background-color: rgba(0, 0, 0, 0.15);
  padding: 0.75rem;
  border-radius: var(--border-radius-sm);
  border: 1px solid var(--border-color);
  margin-top: 0.5rem;
  animation: slideDown 0.2s ease-out;
}
@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.quick-cash-buttons {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.25rem;
  margin-top: 0.4rem;
}
.quick-cash-buttons .btn {
  font-size: 0.75rem;
  padding: 0.35rem 0;
}
.change-row {
  border-top: 1px dashed var(--border-color);
  padding-top: 0.5rem;
}

/* ========================================================
   STOCK / INVENTORY STYLES
   ======================================================== */
.action-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}
.inline-search {
  width: 300px;
}
.grid-2-col {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 1.5rem;
  align-items: start;
}
.grid-4-col {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
}

/* DATA TABLE STYLES */
.table-card {
  padding: 0;
  overflow: hidden;
}
.card-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.card-header h3 {
  font-size: 1.1rem;
}
.table-responsive {
  width: 100%;
  max-height: 480px;
  overflow-x: auto;
  overflow-y: auto;
}
.table-responsive::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
.table-responsive::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.85rem;
}
.data-table th,
.data-table td {
  padding: 0.9rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
}
.data-table th {
  background-color: rgba(255, 255, 255, 0.02);
  color: var(--text-secondary);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
}
.data-table tr:hover td {
  background-color: rgba(255, 255, 255, 0.015);
}
.data-table tr:last-child td {
  border-bottom: none;
}
.action-btn-group {
  display: flex;
  gap: 0.5rem;
}

/* LOGS STYLES */
.logs-card {
  height: 520px;
  display: flex;
  flex-direction: column;
}
.log-badge-active {
  font-size: 0.7rem;
  font-weight: bold;
  padding: 0.2rem 0.5rem;
  border-radius: 20px;
  background-color: var(--success-light);
  color: var(--success);
  border: 1px solid var(--success);
}
.logs-container {
  flex-grow: 1;
  overflow-y: auto;
  padding: 1rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.log-empty-msg {
  color: var(--text-secondary);
  text-align: center;
  margin: auto;
  font-size: 0.85rem;
  padding: 2rem;
}
.log-item {
  background-color: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  padding: 0.75rem;
  font-size: 0.8rem;
  position: relative;
  border-left: 3px solid var(--warning);
  animation: slideIn 0.2s ease-out;
}
.log-item.out-of-stock {
  border-left-color: var(--danger);
}
.log-item-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.25rem;
  font-weight: bold;
}
.log-item-time {
  color: var(--text-muted);
  font-size: 0.7rem;
}
.log-item-msg {
  color: var(--text-secondary);
  white-space: pre-wrap;
  font-family: monospace;
  background-color: rgba(0, 0, 0, 0.2);
  padding: 0.4rem;
  border-radius: 4px;
  margin-top: 0.3rem;
  border: 1px solid rgba(255, 255, 255, 0.02);
}
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ========================================================
   REPORTS / ANALYTICS VIEW STYLES
   ======================================================== */
.stat-card {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1.25rem 1.5rem;
}
.stat-icon {
  font-size: 2.2rem;
  width: 50px;
  height: 50px;
  background-color: rgba(255, 255, 255, 0.04);
  border-radius: var(--border-radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}
.stat-info {
  display: flex;
  flex-direction: column;
}
.stat-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 500;
}
.stat-info h3 {
  font-size: 1.4rem;
  font-weight: 700;
  margin: 0.15rem 0;
}
.stat-help {
  font-size: 0.7rem;
}

.report-controls {
  padding: 1rem 1.5rem;
}
.form-row-align {
  display: flex;
  align-items: flex-end;
  gap: 1rem;
  flex-wrap: wrap;
}
.inline-group {
  margin-bottom: 0;
  flex-grow: 1;
  max-width: 240px;
}

.chart-card {
  padding: 1.25rem;
}
.chart-wrapper {
  height: 300px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1rem;
  position: relative;
}

/* ========================================================
   SETTINGS VIEW STYLES
   ======================================================== */
.settings-section {
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 1.5rem;
  margin-bottom: 1.5rem;
}
.settings-section:last-child {
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 0;
}
.pool-stats-box {
  background-color: rgba(0, 0, 0, 0.15);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  padding: 0.75rem 1rem;
}
.stat-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  margin-bottom: 0.4rem;
}
.stat-row:last-child {
  margin-bottom: 0;
}
.access-denied-box {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-secondary);
}
.lock-icon {
  font-size: 3rem;
  display: block;
  margin-bottom: 1rem;
  opacity: 0.4;
}

/* ========================================================
   MODAL CARDS SPECIFICS
   ======================================================== */
.modal-card {
  width: 90%;
  max-width: 520px;
  max-height: calc(100vh - 3rem);
  display: flex;
  flex-direction: column;
  animation: modalScale 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-sizing: border-box;
  margin: auto 0;
  overflow: hidden;
}
@keyframes modalScale {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
}
.btn-close-modal {
  font-size: 1.8rem;
  background: transparent;
  color: var(--text-secondary);
  border: none;
  cursor: pointer;
  transition: var(--transition);
  line-height: 1;
}
.btn-close-modal:hover {
  color: var(--danger);
}
#product-form {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  overflow-y: auto;
  padding-right: 6px;
  max-height: calc(100vh - 140px);
}
#product-form::-webkit-scrollbar {
  width: 6px;
}
#product-form::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.1);
  border-radius: 4px;
}
#product-form::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.25);
  border-radius: 4px;
}
#product-form::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border-color);
  background: rgba(18, 20, 32, 0.95);
  position: sticky;
  bottom: 0;
  z-index: 10;
  flex-shrink: 0;
}

/* QRIS MODAL SPECIFICS */
.qris-modal-content {
  max-width: 360px;
}
.qris-tag {
  background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
  color: #fff;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  font-size: 0.65rem;
  letter-spacing: 0.05em;
  display: inline-block;
  margin-top: 4px;
}
.qris-qr-code-wrapper {
  background-color: #fff;
  padding: 1.25rem;
  border-radius: var(--border-radius-md);
  display: inline-block;
  position: relative;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}
.qris-loading-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
  color: #0f172a;
  font-size: 0.85rem;
  font-weight: 600;
}
.pulse-indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: var(--warning);
  animation: pulse 1.5s infinite;
}
@keyframes pulse {
  0% {
    transform: scale(0.9);
    opacity: 0.6;
  }
  50% {
    transform: scale(1.2);
    opacity: 1;
    box-shadow: 0 0 10px var(--warning);
  }
  100% {
    transform: scale(0.9);
    opacity: 0.6;
  }
}

/* THERMAL RECEIPT STYLE (IN-MODAL VIEW) */
.receipt-modal-content {
  max-width: 380px;
}
.receipt-paper {
  background-color: #ffffff;
  color: #000000;
  font-family: "Courier New", Courier, monospace;
  padding: 1.5rem 1rem;
  border-radius: 2px;
  box-shadow:
    inset 0 0 15px rgba(0, 0, 0, 0.1),
    0 5px 15px rgba(0, 0, 0, 0.3);
  font-size: 0.85rem;
  line-height: 1.4;
  overflow-y: auto;
  max-height: 380px;
}
.receipt-paper * {
  color: #000000 !important;
}
.thermal-header {
  text-align: center;
  margin-bottom: 0.75rem;
}
.thermal-header h2 {
  font-family: "Courier New", Courier, monospace;
  font-size: 1.2rem;
  font-weight: bold;
}
.thermal-header p {
  font-size: 0.75rem;
  margin: 1px 0;
}
.thermal-divider {
  text-align: center;
  font-size: 0.75rem;
  margin: 0.5rem 0;
  user-select: none;
}
.thermal-meta {
  font-size: 0.75rem;
  margin-bottom: 0.5rem;
}
.thermal-items {
  width: 100%;
}
.t-item-row {
  display: flex;
  flex-direction: column;
  margin-bottom: 0.4rem;
}
.t-item-name {
  font-weight: bold;
}
.t-item-details {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  padding-left: 0.5rem;
}
.thermal-totals {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.r-total-row {
  display: flex;
  justify-content: space-between;
}
.thermal-footer {
  text-align: center;
  font-size: 0.75rem;
  margin-top: 0.75rem;
}

/* ========================================================
   RESPONSIVE DESIGN (MOBILE & TABLET)
   ======================================================== */
@media (max-width: 1024px) {
  .pos-layout {
    grid-template-columns: 1fr;
    max-height: none;
    overflow: visible;
  }
  .pos-cart-panel {
    max-height: 500px;
    height: auto;
  }
  .grid-2-col {
    grid-template-columns: 1fr;
  }
  .grid-4-col {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  /* Sidebar toggle layout */
  .sidebar {
    position: fixed;
    left: calc(-1 * var(--sidebar-width));
    top: 0;
    height: 100vh;
    box-shadow: var(--shadow-lg);
  }
  .sidebar.active {
    left: 0;
  }
  .menu-toggle-btn {
    display: block;
  }
  .top-bar {
    padding: 0 1.25rem;
  }
  .view-panels {
    padding: 1.25rem 1.25rem;
  }
  .grid-4-col {
    grid-template-columns: 1fr;
  }
  .form-row {
    flex-direction: column;
    gap: 0;
  }
  .form-row-align {
    flex-direction: column;
    align-items: stretch;
  }
  .inline-group {
    max-width: none;
  }
}

/* ========================================================
   PRINTER RECEIPT LAYOUT FOR PHYSICAL THERMAL PRINTING
   ======================================================== */
@media print {
  /* Hide main app content, sidebar, topbar, and all other dialogs during print */
  #main-app,
  .sidebar,
  .top-bar,
  #product-modal,
  #qris-modal,
  #trx-detail-modal,
  #loading-overlay,
  .hide-on-print {
    display: none !important;
  }

  /* Only show the print receipt wrapper */
  #receipt-modal {
    display: block !important;
    position: absolute !important;
    left: 0 !important;
    top: 0 !important;
    width: 100% !important;
    height: auto !important;
    background: transparent !important;
    backdrop-filter: none !important;
    z-index: 9999 !important;
  }

  .receipt-modal-content {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    width: 100% !important;
    max-width: none !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .receipt-paper {
    width: 58mm !important; /* Standard narrow thermal printer width */
    max-height: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
    background: #fff !important;
    color: #000 !important;
    font-size: 9pt !important;
  }

  /* Optional: handle 80mm thermal printers or generic roll margins */
  @page {
    margin: 0;
    size: auto;
  }
}

/* ========================================================
   CART ITEM QUANTITY EDITABLE INPUT STYLES
   ======================================================== */
.cart-item-qty-input {
  width: 42px;
  height: 28px;
  text-align: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: #fff;
  border-radius: var(--border-radius-sm);
  font-family: inherit;
  font-size: 0.85rem;
  padding: 0;
  margin: 0 4px;
  transition: var(--transition);
}
.cart-item-qty-input:focus {
  border-color: var(--primary);
  background: rgba(255, 255, 255, 0.1);
  outline: none;
}
/* Hide standard browser spin up/down buttons */
.cart-item-qty-input::-webkit-outer-spin-button,
.cart-item-qty-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.cart-item-qty-input {
  -moz-appearance: textfield;
}

/* ========================================================
   LANDSCAPE TABLET & SHORT SCREEN OPTIMIZATIONS
   ======================================================== */
@media (max-height: 750px) {
  .pos-cart-panel {
    max-height: none;
    height: auto;
  }
  .cart-summary {
    padding-top: 0.5rem;
  }
  .payment-method-selector {
    margin: 0.4rem 0;
  }
  .pay-option {
    padding: 0.4rem;
  }
  .option-icon {
    font-size: 1rem;
    margin-bottom: 0.05rem;
  }
  .option-label {
    font-size: 0.7rem;
  }
  .cash-payment-inputs {
    padding: 0.5rem;
    margin-top: 0.25rem;
  }
  .quick-cash-buttons {
    margin-top: 0.25rem;
  }
  .summary-row {
    margin-bottom: 0.25rem;
  }
  .cart-header {
    padding-bottom: 0.5rem;
  }
}

/* ========================================================
   PRODUCT IMAGE UPLOAD & PREVIEW COMPONENT
   ======================================================== */
.image-upload-wrapper {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.image-dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px 12px;
  border: 2px dashed rgba(255, 255, 255, 0.15);
  border-radius: var(--border-radius-md);
  background: rgba(255, 255, 255, 0.02);
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
}

.image-dropzone:hover,
.image-dropzone.dragover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.upload-icon {
  font-size: 1.8rem;
  margin-bottom: 4px;
}

.upload-text {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
}

.upload-subtext {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.image-preview-box {
  position: relative;
  width: 100%;
  height: 180px;
  max-height: 180px;
  border-radius: var(--border-radius-md);
  overflow: hidden;
  border: 1px solid var(--border-color);
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  box-sizing: border-box;
}

.image-preview-box img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: var(--border-radius-sm);
  display: block;
}

.btn-remove-image {
  position: absolute;
  top: 6px;
  right: 6px;
  background: rgba(239, 68, 68, 0.85);
  color: white;
  border: none;
  border-radius: 50%;
  width: 26px;
  height: 26px;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.btn-remove-image:hover {
  background: var(--danger);
  transform: scale(1.1);
}

