/* Modern Responsive POS & Stock System CSS */
:root {
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-light: #eef2ff;
  --success: #10b981;
  --success-light: #d1fae5;
  --warning: #f59e0b;
  --warning-light: #fef3c7;
  --danger: #ef4444;
  --danger-light: #fee2e2;
  --slate-50: #f8fafc;
  --slate-100: #f1f5f9;
  --slate-200: #e2e8f0;
  --slate-300: #cbd5e1;
  --slate-400: #94a3b8;
  --slate-500: #64748b;
  --slate-600: #475569;
  --slate-700: #334155;
  --slate-800: #1e293b;
  --slate-900: #0f172a;
  
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
  
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-full: 9999px;
  
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 10px 25px rgba(0,0,0,0.12);
  --shadow-glow: 0 0 20px rgba(79, 70, 229, 0.25);
  
  --font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --touch-target: 48px;
  --nav-height: 64px;
}

[data-theme="dark"] {
  --bg-main: #0b0f19;
  --bg-card: #151c2c;
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --border-color: #26334d;
  --slate-100: #1a2336;
  --slate-200: #26334d;
  --slate-300: #3b4d6e;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  font-family: var(--font-family);
}

body {
  background-color: var(--bg-main);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  font-size: 15px;
}

/* Header & Demo Switcher Bar */
.top-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  padding: 8px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
[data-theme="dark"] .top-header {
  background: rgba(21, 28, 44, 0.85);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--primary);
}

.brand-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--primary), #818cf8);
  color: white;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  box-shadow: var(--shadow-glow);
}

.brand-subtitle {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 400;
}

/* Demo Role Switcher Toolbar */
.role-switcher-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--slate-100);
  padding: 4px 8px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
}

.role-switcher-bar label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.role-select {
  background: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  padding: 4px 10px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  outline: none;
}

.user-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 600;
  background: var(--primary-light);
  color: var(--primary);
}

/* Navigation Layout */
.app-container {
  display: flex;
  flex: 1;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  position: relative;
  padding-bottom: var(--nav-height);
}

@media (min-width: 769px) {
  .app-container {
    padding-bottom: 0;
  }
}

/* Tablet / Desktop Sidebar Nav */
.sidebar-nav {
  display: none;
  width: 240px;
  background: var(--bg-card);
  border-right: 1px solid var(--border-color);
  padding: 20px 12px;
  flex-direction: column;
  gap: 8px;
}

@media (min-width: 769px) {
  .sidebar-nav {
    display: flex;
  }
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  font-size: 0.95rem;
}

.nav-link:hover {
  background: var(--slate-100);
  color: var(--text-main);
}

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

.nav-link svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* Mobile Bottom Navigation */
.mobile-nav {
  display: flex;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: var(--bg-card);
  border-top: 1px solid var(--border-color);
  z-index: 99;
  justify-content: space-around;
  align-items: center;
  box-shadow: 0 -4px 12px rgba(0,0,0,0.05);
}

@media (min-width: 769px) {
  .mobile-nav {
    display: none;
  }
}

.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.72rem;
  font-weight: 600;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 6px;
  width: 25%;
}

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

.mobile-nav-item svg {
  width: 22px;
  height: 22px;
}

/* Main Content Area */
.main-content {
  flex: 1;
  padding: 16px;
  max-width: 100%;
  overflow-y: auto;
}

/* View Sections */
.view-section {
  display: none;
  animation: fadeIn 0.25s ease-in-out;
}
.view-section.active {
  display: block;
}

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

/* View Header */
.view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}

.view-title {
  font-size: 1.35rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: var(--touch-target);
  padding: 0 18px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
}

.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}
.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--slate-100);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}
.btn-secondary:hover {
  background: var(--slate-200);
}

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

/* POS Terminal Layout */
.pos-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 900px) {
  .pos-layout {
    grid-template-columns: 1fr 380px;
  }
}

.search-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.input-field {
  width: 100%;
  height: var(--touch-target);
  padding: 0 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-main);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s ease;
}

.input-field:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.categories-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 14px;
  scrollbar-width: none;
}

.categories-scroll::-webkit-scrollbar {
  display: none;
}

.cat-pill {
  padding: 8px 16px;
  border-radius: var(--radius-full);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s ease;
}

.cat-pill.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
}

/* Product Grid */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}

@media (min-width: 550px) {
  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  }
}

.product-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  user-select: none;
  position: relative;
}

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

.product-img-wrapper {
  aspect-ratio: 4 / 3;
  width: 100%;
  background: var(--slate-100);
  position: relative;
  overflow: hidden;
}

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

.stock-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 700;
  background: rgba(0,0,0,0.6);
  color: white;
  backdrop-filter: blur(4px);
}

.stock-badge.low {
  background: var(--warning);
  color: #fff;
}
.stock-badge.out {
  background: var(--danger);
  color: #fff;
}

.product-info {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.product-title {
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.2;
  color: var(--text-main);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-price {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--primary);
  margin-top: auto;
}

/* POS Cart Section */
.cart-panel {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  padding: 16px;
  display: flex;
  flex-direction: column;
  height: calc(100vh - 140px);
  position: sticky;
  top: 80px;
}

@media (max-width: 899px) {
  .cart-panel {
    height: auto;
    position: static;
    margin-top: 16px;
  }
}

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

.cart-title {
  font-weight: 700;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.cart-items-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-right: 4px;
  max-height: 380px;
}

.cart-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  background: var(--slate-50);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}
[data-theme="dark"] .cart-item {
  background: var(--slate-100);
}

.cart-item-details {
  flex: 1;
}

.cart-item-name {
  font-weight: 600;
  font-size: 0.85rem;
}

.cart-item-price {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.qty-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  padding: 2px 6px;
}

.qty-btn {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: none;
  background: var(--slate-100);
  color: var(--text-main);
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.qty-val {
  font-size: 0.85rem;
  font-weight: 700;
  min-width: 18px;
  text-align: center;
}

.cart-summary {
  border-top: 1px solid var(--border-color);
  padding-top: 12px;
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

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

.summary-row.total {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
  border-top: 1px dashed var(--border-color);
  padding-top: 8px;
}

/* Table & Orders Expandable Accordions */
.inventory-controls {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.table-wrapper {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

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

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

.data-table th {
  background: var(--slate-100);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  font-weight: 700;
}

.data-table tbody tr.order-main-row {
  cursor: pointer;
  transition: background 0.15s ease;
}
.data-table tbody tr.order-main-row:hover {
  background: var(--slate-50);
}
[data-theme="dark"] .data-table tbody tr.order-main-row:hover {
  background: var(--slate-100);
}

.order-details-row {
  display: none;
  background: var(--slate-50);
}
[data-theme="dark"] .order-details-row {
  background: var(--slate-100);
}
.order-details-row.active {
  display: table-row;
}

.order-expanded-card {
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  margin: 8px 0;
}

.table-img {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: var(--slate-100);
}

/* Permissions Matrix & User List */
.permission-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  padding: 20px;
  margin-bottom: 20px;
}

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

.role-title {
  font-weight: 700;
  font-size: 1.1rem;
}

.perm-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.perm-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--slate-50);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}
[data-theme="dark"] .perm-item {
  background: var(--slate-100);
}

.perm-label {
  font-size: 0.85rem;
  font-weight: 600;
}

/* Toggle Switch */
.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: var(--slate-300);
  transition: .2s;
  border-radius: 24px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .2s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--primary);
}

input:checked + .slider:before {
  transform: translateX(20px);
}

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

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
}

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

.modal-title {
  font-size: 1.15rem;
  font-weight: 700;
}

.close-btn {
  background: transparent;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.close-btn:hover {
  background: var(--slate-100);
  color: var(--text-main);
}

.modal-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  background: var(--slate-50);
}
[data-theme="dark"] .modal-footer {
  background: var(--slate-100);
}

/* Photo Picker Component */
.photo-picker-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.photo-preview-box {
  width: 100%;
  height: 180px;
  background: var(--slate-100);
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  overflow: hidden;
  position: relative;
}

.photo-preview-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-actions {
  display: flex;
  gap: 10px;
}

.photo-btn {
  flex: 1;
  height: 42px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  font-weight: 600;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
}

/* Camera Live Viewfinder Modal */
.camera-viewfinder {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #000;
  border-radius: var(--radius-md);
  overflow: hidden;
}

.camera-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.shutter-btn {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 4px solid white;
  background: var(--primary);
  margin: 12px auto;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  top: 70px;
  right: 16px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: var(--slate-900);
  color: white;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-size: 0.88rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideInRight 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: auto;
}

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

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

/* Thermal Receipt Styling - Pure 100% Black (No Greys for High Heat Contrast) */
.receipt-box {
  background: #ffffff !important;
  color: #000000 !important;
  padding: 16px;
  font-family: 'Courier New', Courier, monospace !important;
  font-size: 0.88rem;
  font-weight: 700 !important;
  border: 2px solid #000000;
  border-radius: var(--radius-sm);
  max-width: 320px;
  margin: 0 auto;
  -webkit-font-smoothing: none;
}

.receipt-box * {
  color: #000000 !important;
  font-weight: 700 !important;
}

.receipt-box.paper-58mm {
  max-width: 220px;
  font-size: 0.78rem;
  padding: 10px;
}

.receipt-header {
  text-align: center;
  margin-bottom: 12px;
  border-bottom: 2px dashed #000000;
  padding-bottom: 8px;
}

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

/* Product Characteristics & Photo Upload Badges */
.table-img-container {
  position: relative;
  display: inline-block;
  width: 60px;
  height: 60px;
}

.table-img-container .table-img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--slate-100);
}

.btn-add-photo-overlay {
  position: absolute;
  bottom: -2px;
  right: -2px;
  background: var(--primary);
  color: white;
  border: 2px solid white;
  border-radius: var(--radius-full);
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease;
}

.btn-add-photo-overlay:hover {
  transform: scale(1.15);
  background: var(--primary-hover);
}

.xtic-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  font-weight: 600;
}

.design-badge {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fcd34d;
}
[data-theme="dark"] .design-badge {
  background: #78350f;
  color: #fef3c7;
  border-color: #92400e;
}

.xtic-group {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  font-size: 0.75rem;
}

.xtic-pill {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
}

.size-pill {
  background: var(--slate-200);
  color: var(--slate-800);
}
[data-theme="dark"] .size-pill {
  background: var(--slate-700);
  color: var(--slate-100);
}

.color-pill {
  background: var(--primary-light);
  color: var(--primary);
  border: 1px solid rgba(79, 70, 229, 0.2);
}
[data-theme="dark"] .color-pill {
  background: rgba(79, 70, 229, 0.2);
  color: #a5b4fc;
}

/* Color Box Swatches */
.color-swatch-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 2px;
}

.color-swatch-box {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--slate-100);
  border: 1px solid var(--border-color);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-main);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.color-swatch-box:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.color-box-dot {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  display: inline-block;
  border: 1px solid rgba(0,0,0,0.25);
  box-shadow: inset 0 1px 2px rgba(255,255,255,0.3);
  flex-shrink: 0;
}

.color-swatch-interactive {
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 8px;
  border: 2px solid var(--border-color);
  background: var(--bg-card);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 600;
}

.color-swatch-interactive.selected {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
}

#thermal-print-area {
  display: none;
}

/* Pure Black Thermal Printer @media print Rules */
@media print {
  @page {
    margin: 0;
    size: 80mm auto;
  }
  
  html, body {
    width: 80mm !important;
    height: auto !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #ffffff !important;
    color: #000000 !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  body > *:not(#thermal-print-area) {
    display: none !important;
  }

  #thermal-print-area {
    display: block !important;
    width: 80mm !important;
    height: auto !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 4mm 2mm !important;
    background: #ffffff !important;
    color: #000000 !important;
    font-family: 'Courier New', Courier, monospace !important;
    font-size: 13px !important;
    font-weight: 800 !important;
    line-height: 1.35 !important;
  }

  #thermal-print-area * {
    color: #000000 !important;
    border-color: #000000 !important;
    font-weight: 800 !important;
  }
}

/* Mahir Stock System Custom Branding & High-Security Login Gate */
.login-gate-screen {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: radial-gradient(circle at top right, #1e1b4b 0%, #0f172a 60%, #020617 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
}

.login-gate-card {
  width: 100%;
  max-width: 440px;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6), 0 0 40px rgba(79, 70, 229, 0.18);
  border-radius: 20px;
  padding: 36px 30px;
  color: #ffffff;
  text-align: center;
}

.login-brand-logo {
  max-width: 170px;
  max-height: 80px;
  width: auto;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.4));
}

.brand-logo-img {
  height: 38px;
  max-width: 120px;
  width: auto;
  object-fit: contain;
  border-radius: var(--radius-sm);
  background: #ffffff;
  padding: 3px 6px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.login-input {
  background: rgba(30, 41, 59, 0.8) !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  color: #ffffff !important;
  height: 44px !important;
  border-radius: var(--radius-md) !important;
}

.login-input:focus {
  border-color: #6366f1 !important;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25) !important;
}

.login-error-alert {
  background: rgba(239, 68, 68, 0.18);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 16px;
  text-align: left;
  line-height: 1.4;
}

.active-user-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--slate-100);
  border: 1px solid var(--border-color);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
}

/* Mobile & Tablet Responsive Optimizations */
@media (max-width: 768px) {
  .top-header {
    padding: 8px 12px;
  }
  
  .brand-subtitle {
    display: none;
  }

  .brand-logo-img {
    height: 30px;
  }

  .active-user-badge {
    padding: 3px 8px;
    font-size: 0.75rem;
  }

  .main-content {
    padding: 10px;
    padding-bottom: 80px;
  }

  .product-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .modal-card {
    max-height: 88vh;
    border-radius: var(--radius-md);
  }

  .table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius-md);
  }

  .login-gate-card {
    padding: 28px 20px;
    max-width: 100%;
  }

  .action-btn {
    height: 44px;
    padding: 0 14px;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .product-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .sidebar-nav {
    width: 200px;
  }

  .pos-layout {
    grid-template-columns: 1fr 340px;
  }
}

/* Floating Mobile POS Checkout Bar */
.mobile-pos-floating-bar {
  position: fixed;
  bottom: calc(var(--nav-height) + 10px);
  left: 12px;
  right: 12px;
  z-index: 1050;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-full);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35), 0 0 20px rgba(79, 70, 229, 0.3);
  animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
}

@keyframes slideUp {
  from { transform: translateY(100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* Mobile Inventory Card Styling */
.mobile-inventory-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.1s ease;
}

.mobile-inventory-card:active {
  transform: scale(0.98);
}

/* Display visibility toggles for desktop vs mobile */
@media (max-width: 768px) {
  .desktop-only-table {
    display: none !important;
  }

  .mobile-only-inventory-grid,
  .mobile-only-users-grid {
    display: flex !important;
    flex-direction: column;
    gap: 12px;
  }

  /* Prevent iOS Safari input zoom on focus */
  input[type="text"],
  input[type="password"],
  input[type="tel"],
  select,
  textarea {
    font-size: 16px !important;
  }
}

@media (min-width: 769px) {
  .desktop-only-table {
    display: block !important;
  }

  .mobile-only-inventory-grid,
  .mobile-only-users-grid,
  .mobile-pos-floating-bar {
    display: none !important;
  }
}

