/* ==========================================================================
   Smartive CRM - Enterprise Construction Materials Store Design System
   ========================================================================== */

:root {
  /* Color Tokens */
  --bg-main: #f8fafc;
  --bg-surface: #ffffff;
  --bg-surface-subtle: #f1f5f9;
  --bg-surface-hover: #e2e8f0;
  
  --sidebar-bg: #0f172a;
  --sidebar-hover: #1e293b;
  --sidebar-active: #334155;
  --sidebar-text: #94a3b8;
  --sidebar-text-active: #ffffff;

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

  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;

  --success: #10b981;
  --success-light: #ecfdf5;
  --success-dark: #047857;

  --warning: #f59e0b;
  --warning-light: #fffbeb;
  --warning-dark: #b45309;

  --danger: #ef4444;
  --danger-light: #fef2f2;
  --danger-dark: #b91c1c;

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

  /* Typography */
  --font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-full: 9999px;

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

  /* Transitions */
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html, body {
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
  font-family: var(--font-family);
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}

/* App Container Layout */
.app-container {
  display: flex;
  min-height: 100vh;
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
}

/* -------------------------------------------------------------
   Custom Sleek Scrollbars (No ugly white OS scrollbars)
   ------------------------------------------------------------- */
::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.3);
  border-radius: 9999px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(148, 163, 184, 0.6);
}

* {
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.3) transparent;
}

/* -------------------------------------------------------------
   Sidebar (Collapsible, Compact & NO SCROLLBAR)
   ------------------------------------------------------------- */
.sidebar {
  width: 260px;
  background-color: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 40;
  user-select: none;
  transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1), transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: width;
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
  overflow: hidden;
}

.sidebar::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

/* Collapsed Sidebar State (Chaproqqa surilgan / Ixcham rejim) */
.sidebar.collapsed {
  width: 72px;
}

.sidebar.collapsed .brand-title,
.sidebar.collapsed .brand-sub,
.sidebar.collapsed .menu-category-label,
.sidebar.collapsed .nav-item span:not(.icon),
.sidebar.collapsed .nav-item .badge,
.sidebar.collapsed .user-name,
.sidebar.collapsed .user-role,
.sidebar.collapsed #shiftStatusText,
.sidebar.collapsed .shift-status-pill span:last-child {
  display: none !important;
}

.sidebar.collapsed .sidebar-header {
  padding: 12px 6px;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.sidebar.collapsed .brand-header-left {
  justify-content: center;
}

.sidebar.collapsed .nav-item {
  justify-content: center;
  padding: 10px 6px;
  position: relative;
}

.sidebar.collapsed .nav-item .icon {
  font-size: 18px;
  margin: 0;
}

.sidebar.collapsed .shift-status-pill {
  justify-content: center;
  padding: 8px 4px;
}

.sidebar.collapsed .shift-status-pill div {
  display: flex;
  justify-content: center;
}

.sidebar.collapsed .status-dot {
  margin-right: 0;
}

.sidebar.collapsed .user-profile-row {
  justify-content: center;
}

.sidebar.collapsed .user-info {
  justify-content: center;
}

.sidebar.collapsed #logoutBtn {
  display: none;
}

/* Tooltip on Hover in Collapsed Mode */
.sidebar.collapsed .nav-item[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 78px;
  top: 50%;
  transform: translateY(-50%);
  background-color: #1e293b;
  color: #ffffff;
  padding: 6px 12px;
  border-radius: var(--radius-md);
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: var(--shadow-xl);
  border: 1px solid rgba(255, 255, 255, 0.15);
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease, visibility 0.15s ease;
  z-index: 100;
}

.sidebar.collapsed .nav-item:hover::after {
  opacity: 1;
  visibility: visible;
}

/* Sidebar Toggle Buttons */
.sidebar-toggle-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #94a3b8;
  width: 26px;
  height: 26px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 11px;
  transition: var(--transition);
  margin-left: auto;
  flex-shrink: 0;
}

.sidebar-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
}

.sidebar.collapsed .sidebar-toggle-btn {
  margin: 0 auto;
}

.sidebar-header {
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.brand-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-logo-img {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-md);
  object-fit: cover;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.15);
  flex-shrink: 0;
}

.login-logo-img {
  width: 84px;
  height: 84px;
  border-radius: var(--radius-lg);
  object-fit: cover;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  border: 2px solid rgba(255, 255, 255, 0.15);
  margin-bottom: 14px;
}

.receipt-logo-img {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  margin-bottom: 6px;
}

.brand-title {
  font-size: 14.5px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.3px;
  white-space: nowrap;
}

.brand-sub {
  font-size: 10px;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.sidebar-menu {
  padding: 8px 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1;
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
}

.sidebar-menu::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

.menu-category-label {
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #64748b;
  padding: 6px 8px 2px;
  font-weight: 600;
  white-space: nowrap;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: var(--radius-md);
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 12.5px;
  font-weight: 500;
  transition: var(--transition);
  cursor: pointer;
  white-space: nowrap;
}

.nav-item:hover {
  background-color: var(--sidebar-hover);
  color: var(--sidebar-text-active);
}

.nav-item.active {
  background-color: var(--primary);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.3);
}

.nav-item .icon {
  font-size: 16px;
  width: 18px;
  text-align: center;
  flex-shrink: 0;
}

.sidebar-footer {
  padding: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.shift-status-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;
  background-color: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-md);
  margin-bottom: 8px;
  font-size: 11.5px;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.shift-status-pill:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 6px;
}
.status-dot.active { background-color: var(--success); box-shadow: 0 0 8px var(--success); }
.status-dot.inactive { background-color: var(--danger); }

.user-profile-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: #334155;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  flex-shrink: 0;
}

.user-name {
  font-size: 12.5px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role {
  font-size: 11px;
  color: #94a3b8;
  white-space: nowrap;
}

/* -------------------------------------------------------------
   Main Content Area & Topbar
   ------------------------------------------------------------- */
.main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  max-width: 100%;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
}

.topbar {
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 30;
  width: 100%;
  max-width: 100%;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-sidebar-toggle {
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border);
  color: var(--text-main);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 15px;
  font-weight: 700;
  transition: var(--transition);
  flex-shrink: 0;
}

.topbar-sidebar-toggle:hover {
  background: var(--bg-surface-hover);
  border-color: #cbd5e1;
  transform: scale(1.03);
}

.page-heading {
  font-size: 19px;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.4px;
  white-space: nowrap;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.content-body {
  padding: 20px 24px;
  flex: 1;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

/* -------------------------------------------------------------
   Buttons & Controls
   ------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 16px;
  font-size: 13.5px;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  font-family: inherit;
}

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

.btn-success {
  background-color: var(--success);
  color: #ffffff;
}
.btn-success:hover {
  background-color: var(--success-dark);
}

.btn-danger {
  background-color: var(--danger);
  color: #ffffff;
}
.btn-danger:hover {
  background-color: var(--danger-dark);
}

.btn-secondary {
  background-color: var(--bg-surface);
  border-color: var(--border);
  color: var(--text-main);
}
.btn-secondary:hover {
  background-color: var(--bg-surface-subtle);
  border-color: #cbd5e1;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

.btn-lg {
  padding: 13px 24px;
  font-size: 15px;
}

/* Form Inputs */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 6px;
}

.form-control, .form-select {
  width: 100%;
  padding: 9px 14px;
  font-size: 13.5px;
  font-family: inherit;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background-color: #ffffff;
  color: var(--text-main);
  transition: var(--transition);
  outline: none;
}

.form-control:focus, .form-select:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

/* -------------------------------------------------------------
   Cards, Badges & Tables
   ------------------------------------------------------------- */
.card {
  background-color: var(--bg-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  padding: 20px;
  margin-bottom: 20px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  font-size: 11.5px;
  font-weight: 600;
}

.badge-success { background-color: var(--success-light); color: var(--success-dark); }
.badge-warning { background-color: var(--warning-light); color: var(--warning-dark); }
.badge-danger { background-color: var(--danger-light); color: var(--danger-dark); }
.badge-primary { background-color: var(--primary-light); color: var(--primary); }
.badge-neutral { background-color: var(--bg-surface-subtle); color: var(--text-muted); }

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

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

.data-table th {
  background-color: var(--bg-surface-subtle);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

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

.data-table tr:hover {
  background-color: rgba(241, 245, 249, 0.6);
}

/* -------------------------------------------------------------
   POS Counter (Kassa) Ergonomic Responsive Layout
   Left: Cart & Total / Right Top: Top Sellers / Right Main: Catalog & Search
   ------------------------------------------------------------- */
/* -------------------------------------------------------------
   POS Counter (Kassa) Ergonomic Responsive Layout
   Left: Cart & Total / Right Top: Top Sellers / Right Main: Catalog & Search
   ------------------------------------------------------------- */
/* -------------------------------------------------------------
   POS Counter (Kassa) Ergonomic Responsive Layout
   Left: Cart & Total / Right Top: Top Sellers / Right Main: Catalog & Search
   ------------------------------------------------------------- */
/* -------------------------------------------------------------
   POS Counter (Kassa) Ergonomic Responsive Layout
   Left: Cart & Total / Right Top: Top Sellers / Right Main: Catalog & Search
   ------------------------------------------------------------- */
.pos-layout {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 12px;
  height: calc(100vh - 65px);
  max-height: calc(100vh - 65px);
  min-height: 0;
  width: 100%;
  box-sizing: border-box;
}

/* Left Side: Cart & Chek Panel */
.pos-cart-panel {
  background-color: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.cart-header {
  padding: 10px 12px;
  background-color: #ffffff;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.cart-customer-box {
  margin-top: 6px;
  padding: 6px 8px;
  background-color: var(--bg-surface-subtle);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.cart-items-list {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
}

.cart-item-row {
  background-color: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 8px 10px;
  transition: var(--transition);
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}

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

.cart-item-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  font-weight: 700;
  font-size: 12.5px;
  margin-bottom: 4px;
}

.cart-item-subinfo {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  font-size: 11px;
}

.cart-item-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  border-top: 1px dashed var(--border);
  padding-top: 6px;
}

.qty-counter {
  display: flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: #ffffff;
  overflow: hidden;
}

.qty-btn {
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background-color: var(--bg-surface-subtle);
  cursor: pointer;
  font-weight: bold;
  font-size: 13px;
  color: var(--text-main);
  transition: var(--transition);
}

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

.qty-input {
  width: 44px;
  text-align: center;
  border: none;
  font-size: 12px;
  font-weight: 700;
  outline: none;
}

.cart-summary {
  padding: 10px 12px;
  border-top: 1px solid var(--border);
  background: linear-gradient(to bottom, #ffffff, #f8fafc);
  flex-shrink: 0;
}

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

.summary-total-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 17px;
  font-weight: 800;
  color: var(--text-main);
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px dashed var(--border);
}

/* Right Side: Products, Top Sellers & Controls */
.pos-right-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  gap: 6px;
}

/* Top-Sellers (Ko'p sotilgan tovarlar) Section */
.top-sellers-panel {
  background-color: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 6px 10px;
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}

.top-sellers-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.top-sellers-title {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 4px;
}

.top-sellers-scroll {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
  max-height: 56px;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 2px;
  width: 100%;
  box-sizing: border-box;
}

.top-seller-chip {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 3px 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: var(--transition);
  min-width: 0;
  box-sizing: border-box;
  user-select: none;
}

.top-seller-chip:hover {
  border-color: var(--primary);
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(37, 99, 235, 0.08);
  background: #f8fafc;
}

.top-seller-chip.out-of-stock {
  opacity: 0.6;
  background: #fee2e2;
  border-color: #fca5a5;
  cursor: not-allowed;
}

.top-seller-name {
  font-size: 11px;
  font-weight: 700;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.top-seller-price {
  font-size: 11.5px;
  font-weight: 800;
  color: var(--primary);
  white-space: nowrap;
}

/* Main Catalog Area */
.pos-catalog-area {
  flex: 1;
  background-color: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  width: 100%;
  box-sizing: border-box;
}

.pos-search-bar {
  display: flex;
  gap: 6px;
  margin-bottom: 5px;
  width: 100%;
  flex-shrink: 0;
}

.pos-categories-tabs {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  padding-bottom: 3px;
  margin-bottom: 5px;
  width: 100%;
  flex-shrink: 0;
}

.category-tab {
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 600;
  border-radius: var(--radius-full);
  background-color: var(--bg-surface-subtle);
  border: 1px solid var(--border);
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
  color: var(--text-muted);
}

.category-tab.active, .category-tab:hover {
  background-color: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

.pos-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 4px;
  flex: 1;
  min-height: 0;
  width: 100%;
  box-sizing: border-box;
  align-content: start;
}

.product-pos-card {
  background-color: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  min-width: 0;
  box-sizing: border-box;
}

.product-pos-card:hover {
  border-color: var(--primary);
  background-color: #f8fafc;
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(37, 99, 235, 0.08);
}

.product-pos-card.out-of-stock {
  background: #fff8f8;
  border-color: #fecaca;
  opacity: 0.75;
  cursor: not-allowed;
}

.product-pos-top {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 5px;
  min-width: 0;
}

.product-pos-title {
  font-size: 13.5px;
  font-weight: 700;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.product-pos-body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

/* POS Statusbar on Bottom */
.pos-statusbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 3px 8px;
  background-color: var(--bg-surface-subtle);
  border-radius: var(--radius-md);
  font-size: 10.5px;
  color: var(--text-muted);
  margin-top: 4px;
  flex-shrink: 0;
}

/* Responsive Media Queries for Screens */
@media (max-width: 1440px) {
  .sidebar {
    width: 220px;
  }
  .pos-layout {
    grid-template-columns: 320px 1fr;
    gap: 10px;
  }
}

@media (max-width: 1280px) {
  .sidebar {
    width: 200px;
  }
  .pos-layout {
    grid-template-columns: 310px 1fr;
    gap: 8px;
  }
}

/* Quick Pay Buttons & POS Tabs */
.pos-view-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  border-bottom: 1.5px solid #e2e8f0;
  padding-bottom: 8px;
}

.pos-view-tab-btn {
  padding: 8px 16px;
  font-size: 13.5px;
  font-weight: 700;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #475569;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

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

.pos-view-tab-btn:hover:not(.active) {
  background: #f1f5f9;
  color: #0f172a;
}

.quick-pay-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px 12px;
  border-radius: 12px;
  border: 2px solid #e2e8f0;
  background: #ffffff;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  text-align: center;
}

.quick-pay-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.quick-pay-card.cash {
  border-color: #86efac;
  background: #f0fdf4;
}

.quick-pay-card.cash:hover {
  border-color: #16a34a;
  background: #dcfce7;
}

.quick-pay-card.card {
  border-color: #93c5fd;
  background: #eff6ff;
}

.quick-pay-card.card:hover {
  border-color: #2563eb;
  background: #dbeafe;
}

.quick-pay-card.transfer {
  border-color: #c4b5fd;
  background: #f5f3ff;
}

.quick-pay-card.transfer:hover {
  border-color: #7c3aed;
  background: #ede9fe;
}

.quick-pay-card.debt {
  border-color: #fde047;
  background: #fefce8;
}

.quick-pay-card.debt:hover {
  border-color: #ca8a04;
  background: #fef9c3;
}

/* -------------------------------------------------------------
   Modals & Overlays (Positioned Nicely at the Top)
   ------------------------------------------------------------- */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  z-index: 1000;
  padding: 20px 16px 30px 16px;
  overflow-y: auto;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

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

.modal-overlay.drawer-right {
  display: flex;
  justify-content: flex-end;
  align-items: stretch;
  padding: 0;
  overflow: hidden;
}

.modal-content {
  background-color: #ffffff;
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  width: 100%;
  max-width: 560px;
  max-height: calc(100vh - 40px);
  margin-top: 10px;
  overflow-y: auto;
  animation: modalPop 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-content.lg {
  max-width: 860px;
}

.modal-content.drawer {
  width: 650px;
  max-width: 95vw;
  height: 100vh;
  max-height: 100vh;
  margin: 0;
  border-radius: 18px 0 0 18px;
  box-shadow: -10px 0 40px rgba(0, 0, 0, 0.28);
  display: flex;
  flex-direction: column;
  animation: slideDrawerRight 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideDrawerRight {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-12px); }
  to { opacity: 1; transform: translateY(0); }
}

.inline-action-panel {
  background: #ffffff;
  border: 2px solid #3b82f6;
  border-radius: var(--radius-lg);
  box-shadow: 0 6px 24px rgba(59, 130, 246, 0.14);
  padding: 20px 24px;
  animation: slideDown 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  margin-bottom: 22px;
}

@keyframes modalPop {
  from { transform: translateY(-15px) scale(0.98); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

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

.modal-title {
  font-size: 17px;
  font-weight: 700;
}

.modal-close {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: var(--text-muted);
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  background-color: var(--bg-surface-subtle);
  border-bottom-left-radius: var(--radius-lg);
  border-bottom-right-radius: var(--radius-lg);
}

/* -------------------------------------------------------------
   Toasts Notifications (Always on Top in Front of All Modals)
   ------------------------------------------------------------- */
.toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 999999 !important;
  max-width: 440px;
  pointer-events: none;
}

.toast {
  color: #ffffff;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.15);
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  animation: toastSlideDown 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  min-width: 320px;
  max-width: 440px;
  pointer-events: auto;
  backdrop-filter: blur(8px);
  position: relative;
  z-index: 999999 !important;
}

.toast.success { 
  border-left: 5px solid #22c55e;
  background-color: #064e3b;
}

.toast.danger { 
  border-left: 5px solid #ef4444; 
  background-color: #7f1d1d;
}

.toast.warning { 
  border-left: 5px solid #f59e0b; 
  background-color: #78350f;
}

.toast.info, .toast.neutral {
  border-left: 5px solid #3b82f6;
  background-color: #1e293b;
}

@keyframes toastSlideDown {
  from { transform: translateX(50px) translateY(-10px); opacity: 0; }
  to { transform: translateX(0) translateY(0); opacity: 1; }
}

/* -------------------------------------------------------------
   Receipt Print Styles (POS Termal Chek)
   ------------------------------------------------------------- */
.receipt-box {
  width: 320px;
  margin: 0 auto;
  padding: 16px;
  background: #ffffff;
  border: 1px dashed #cbd5e1;
  font-family: 'Courier New', Courier, monospace;
  font-size: 12px;
  color: #000000;
}

.receipt-header {
  text-align: center;
  border-bottom: 1px dashed #000;
  padding-bottom: 8px;
  margin-bottom: 8px;
}

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

.receipt-total {
  border-top: 1px dashed #000;
  border-bottom: 1px dashed #000;
  padding: 6px 0;
  margin: 8px 0;
  font-weight: bold;
  font-size: 14px;
}

/* -------------------------------------------------------------
   Reorders (Buyurtma Berish) Two-Column Split Layout
   Left: All Products & Stocks / Right: Reorders List & 1-Click Copy
   ------------------------------------------------------------- */
.reorders-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  height: calc(100vh - 120px);
}

.reorder-panel {
  background-color: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  height: 100%;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.reorder-panel-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background-color: #ffffff;
}

.reorder-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
}

.reorder-panel-footer {
  padding: 14px 18px;
  border-top: 1px solid var(--border);
  background: linear-gradient(to bottom, #ffffff, #f8fafc);
}

.reorder-product-card {
  background-color: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  transition: var(--transition);
}

.reorder-product-card:hover {
  border-color: #cbd5e1;
  box-shadow: var(--shadow-sm);
}

.reorder-product-card.critical {
  border-left: 4px solid var(--danger);
  background-color: rgba(239, 68, 68, 0.02);
}

.reorder-target-card {
  background-color: #ffffff;
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: var(--transition);
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}

.reorder-target-card:hover {
  border-color: var(--primary);
}

.copy-btn-glow {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
  transition: var(--transition);
}

.copy-btn-glow:hover {
  background: linear-gradient(135deg, #059669, #047857);
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.45);
  transform: translateY(-1px);
}

/* -------------------------------------------------------------
   Unified Inventory Sub-Navigation Tabs
   ------------------------------------------------------------- */
.subnav-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  background-color: var(--bg-surface-subtle);
  padding: 6px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  margin-bottom: 20px;
  width: fit-content;
}

.subnav-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-muted);
  border-radius: var(--radius-md);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: var(--transition);
}

.subnav-tab:hover {
  color: var(--text-main);
  background-color: rgba(255, 255, 255, 0.8);
}

.subnav-tab.active {
  background-color: #ffffff;
  color: var(--primary);
  box-shadow: var(--shadow-sm);
  font-weight: 700;
}


/* -------------------------------------------------------------
   Professional Add Product Modal & Scanner Hub Styles
   ------------------------------------------------------------- */
.prod-modal-card {
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px 18px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.03);
  transition: var(--transition);
}

.prod-modal-card:focus-within {
  border-color: #93c5fd;
  box-shadow: 0 4px 12px rgba(37,99,235,0.08);
}

.prod-modal-card-title {
  font-size: 13.5px;
  font-weight: 800;
  color: #1e293b;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1.5px solid #f1f5f9;
  letter-spacing: 0.3px;
}

.margin-preset-btn {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #334155;
  font-size: 11.5px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition);
}

.margin-preset-btn:hover {
  background: #2563eb;
  border-color: #2563eb;
  color: #ffffff;
  transform: translateY(-1px);
}

.live-margin-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  margin-top: 4px;
}

.scanner-live-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: #15803d;
  background: #dcfce7;
  border: 1px solid #bbf7d0;
  padding: 3px 10px;
  border-radius: 20px;
}

.scanner-live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.4);
  animation: pulse-dot 1.5s infinite;
}

@keyframes pulse-dot {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.2); opacity: 1; box-shadow: 0 0 8px rgba(34, 197, 94, 0.8); }
  100% { transform: scale(0.95); opacity: 0.8; }
}

/* 4cm x 6cm (60mm x 40mm) Mahsulot Narx va Shtrix-kod Yorlig'i (Label) */
.product-label-4x6 {
  width: 58mm;
  height: 38mm;
  box-sizing: border-box;
  padding: 3mm 4mm;
  margin: 0 auto;
  background: #ffffff;
  color: #000000;
  border: 1.5px solid #000000;
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  font-family: 'Inter', 'Segoe UI', Arial, sans-serif;
  overflow: hidden;
  page-break-inside: avoid;
}

.product-label-header {
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
  color: #000000;
  text-align: center;
  border-bottom: 1.5px solid #000000;
  padding-bottom: 2px;
  margin-bottom: 2px;
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-label-middle {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1px 0;
  margin-bottom: 2px;
}

.product-label-code {
  font-size: 13.5px;
  font-weight: 900;
  border: 1.5px solid #000000;
  border-radius: 4px;
  padding: 1px 6px;
  background: #f8fafc;
  display: inline-flex;
  align-items: center;
}

.product-label-price {
  text-align: right;
}

.product-label-price-val {
  font-size: 15px;
  font-weight: 900;
  color: #000000;
  letter-spacing: -0.5px;
}

.product-label-price-unit {
  font-size: 10px;
  font-weight: 700;
  color: #333333;
}

.product-label-barcode-container {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.product-label-barcode-svg {
  width: 100%;
  max-height: 14mm;
}

@media print {
  @page {
    margin: 0;
    size: auto;
  }
  body * { visibility: hidden !important; }
  #printableReceipt, #printableReceipt *,
  #printableAllDebtsStatement, #printableAllDebtsStatement *,
  #printablePreorderReceipt, #printablePreorderReceipt *,
  #printableProductLabel, #printableProductLabel * { visibility: visible !important; }
  #printableReceipt, #printableAllDebtsStatement, #printablePreorderReceipt {
    position: absolute !important;
    left: 0 !important;
    top: 0 !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 10px !important;
    border: none !important;
    background: #ffffff !important;
    color: #000000 !important;
  }
  #printableProductLabel {
    position: absolute !important;
    left: 0 !important;
    top: 0 !important;
    width: 60mm !important;
    height: 40mm !important;
    margin: 0 !important;
    padding: 1mm !important;
    border: none !important;
    background: #ffffff !important;
    color: #000000 !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
  }
}


