/* D:\Área de Trabalho\Apps Dev\style.css */

/* --- Modern Design Token / Variables --- */
:root {
  /* APG365 botanical green theme */
  --bg-primary: #F3F6F1;
  --bg-secondary: #ffffff;
  --bg-tertiary: #E2EADF;
  --nude-secondary: #A8B8A5;
  --nude-secondary-rgb: 168, 184, 165;
  --border-color: #D5E0D2;
  
  --glass-bg: rgba(255, 255, 255, 0.94);
  --glass-border: rgba(47, 93, 70, 0.14);
  --glass-shadow: 0 12px 30px rgba(47, 93, 70, 0.07), 0 2px 8px rgba(31, 46, 39, 0.04);
  --surface-shadow: 0 18px 44px rgba(31, 46, 39, 0.12), 0 3px 10px rgba(31, 46, 39, 0.05);
  --overlay-bg: rgba(24, 43, 34, 0.62);
  
  --text-primary: #1F2E27;
  --text-secondary: #66766D;
  --text-inverse: #ffffff;
  
  --accent-color: #2F5D46;
  --accent-color-rgb: 47, 93, 70;
  --accent-gradient: linear-gradient(135deg, #2F5D46 0%, #4C7A5D 100%);
  --accent-glow: rgba(47, 93, 70, 0.20);
  --highlight-color: #8AA17F;
  --highlight-color-rgb: 138, 161, 127;
  --dropdown-selected-bg: #2F5D46;
  --dropdown-selected-color: #ffffff;
  
  --success-color: #2E7D5A;
  --success-bg: rgba(46, 125, 90, 0.08);
  --warning-color: #E4A62A;
  --warning-bg: rgba(228, 166, 42, 0.08);
  --danger-color: #D9534F;
  --danger-bg: rgba(217, 83, 79, 0.08);
  --inactive-color: #D6D0CB;
  --inactive-bg: rgba(214, 208, 203, 0.38);
  --info-color: #4C7A5D;
  --info-bg: rgba(76, 122, 93, 0.09);
  --button-highlight-gradient: linear-gradient(135deg, #3F7054 0%, #274C3A 100%);
  
  --border-radius-lg: 20px;
  --border-radius-md: 12px;
  --border-radius-sm: 8px;
  
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  
  /* Additional SaaS tokens */
  --bg-card: #ffffff;
  color-scheme: light;
}

/* --- Base Resets & Typography --- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Inter', -apple-system, sans-serif;
  scrollbar-width: thin;
  scrollbar-color: var(--border-color) transparent;
}

body {
  background-color: var(--bg-primary);
  background-image: radial-gradient(circle at top left, rgba(var(--nude-secondary-rgb), 0.26), transparent 34%),
                    linear-gradient(180deg, #FCFDFB 0%, var(--bg-primary) 34%, #EAF0E7 100%);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  transition: background-color var(--transition-normal), color var(--transition-normal);
}

/* Custom Sleek Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 20px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-secondary);
}

a {
  color: inherit;
  text-decoration: none;
}

button, input, select, textarea {
  background: none;
  border: none;
  font: inherit;
  color: inherit;
  outline: none;
}

/* Perfect native & custom dropdown visibility override for light and dark themes */
select option {
  background-color: var(--bg-card) !important;
  color: var(--text-primary) !important;
}

select option:checked {
  background-color: var(--dropdown-selected-bg) !important;
  color: var(--dropdown-selected-color) !important;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* Helper utilities */
.text-secondary { color: var(--text-secondary); }
.text-success { color: var(--success-color); }
.text-warning { color: var(--warning-color); }
.text-danger { color: var(--danger-color); }
.text-primary { color: var(--accent-color); }
.text-right { text-align: right; }

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 30px;
  font-size: 11px;
  font-weight: 600;
  gap: 4px;
}
.badge-success { background: var(--success-bg); color: var(--success-color); }
.badge-warning { background: var(--warning-bg); color: var(--warning-color); }
.badge-danger { background: var(--danger-bg); color: var(--danger-color); }
.badge-info { background: var(--info-bg); color: var(--info-color); }
.badge-inactive { background: var(--inactive-bg); color: #6D6D6D; }

/* --- App Layout Structure --- */
.app-container {
  display: flex;
  min-height: 100vh;
}

/* --- SIDEBAR --- */
.sidebar {
  width: 260px;
  background-color: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: fixed;
  height: 100vh;
  z-index: 100;
  transition: background-color var(--transition-normal), border-color var(--transition-normal);
}

.sidebar-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 24px 16px 20px 16px;
  border-bottom: 1px solid var(--border-color);
  text-align: center;
}

.brand-logo {
  width: 96px;
  height: 96px;
  background: transparent;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: none;
  overflow: hidden;
  border: none;
  transition: transform var(--transition-normal);
}

.brand-logo:hover {
  transform: scale(1.05);
}

.brand-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 50%;
}

.logo-icon {
  color: var(--text-inverse);
  width: 64px;
  height: 64px;
  background: var(--accent-gradient);
  border-radius: 50%;
  padding: 16px;
  box-shadow: 0 8px 18px var(--accent-glow);
}

.brand-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.brand-text h1 {
  font-size: 17px;
  line-height: 1.2;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 850;
  letter-spacing: -0.5px;
  margin: 0;
  max-width: 190px;
  word-wrap: break-word;
}

.brand-text span {
  font-size: 10.5px;
  color: var(--text-secondary);
  font-weight: 600;
  letter-spacing: 0.3px;
}

.sidebar-menu {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 24px;
  flex-grow: 1;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--border-radius-md);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  transition: all var(--transition-fast);
  position: relative;
}

.menu-item i {
  width: 18px;
  height: 18px;
  transition: transform var(--transition-fast);
}

.menu-item:hover {
  color: var(--text-primary);
  background-color: rgba(var(--nude-secondary-rgb), 0.45);
}

.menu-item:hover i {
  transform: translateX(2px);
}

.menu-item.active {
  color: var(--text-inverse);
  background: var(--accent-color);
  box-shadow: 0 10px 24px -8px rgba(var(--accent-color-rgb), 0.45);
}

/* Shortcut Badge Styles (Alt+1~7 Hints) */
.shortcut-badge {
  font-size: 10px;
  font-weight: 700;
  font-family: Consolas, Monaco, monospace;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(0, 0, 0, 0.1);
  color: var(--text-secondary);
  opacity: 0.75;
  white-space: nowrap;
  line-height: 1.4;
  letter-spacing: 0.5px;
  transition: all var(--transition-fast);
}

/* Contrast adjustment when the parent menu-item is active */
.menu-item.active .shortcut-badge {
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: var(--text-inverse) !important;
  opacity: 1;
}

/* Shortcut badge styling */

.cart-badge-indicator {
  position: absolute;
  top: 15px;
  right: 18px;
  width: 8px;
  height: 8px;
  background-color: var(--danger-color);
  border-radius: 50%;
  box-shadow: 0 0 0 2px var(--bg-secondary), 0 0 8px var(--danger-color);
  display: none;
}

.sidebar-footer {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
}

.theme-toggle-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: var(--bg-tertiary);
  padding: 8px 12px;
  border-radius: var(--border-radius-md);
}

.theme-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
  min-width: 85px;
}

.theme-toggle-btn {
  width: 48px;
  height: 24px;
  background-color: var(--border-color);
  border-radius: 30px;
  position: relative;
  cursor: pointer;
  transition: background-color var(--transition-normal);
}



.toggle-circle {
  width: 18px;
  height: 18px;
  background-color: white;
  border-radius: 50%;
  position: absolute;
  top: 3px;
  left: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--transition-normal);
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}



.toggle-circle i {
  width: 11px;
  height: 11px;
  position: absolute;
  transition: opacity var(--transition-fast);
}

.sun-icon { opacity: 1; color: #fbbf24; }
.moon-icon { opacity: 0; color: #8b5cf6; }



.user-profile {
  display: flex;
  align-items: center;
  gap: 12px;
}

.profile-avatar {
  width: 38px;
  height: 38px;
  background: var(--accent-gradient);
  border-radius: 50%;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-family: 'Outfit', sans-serif;
  box-shadow: 0 4px 10px var(--accent-glow);
}

.profile-info {
  display: flex;
  flex-direction: column;
}

.profile-name {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
}

.profile-role {
  font-size: 11px;
  color: var(--text-secondary);
}

.sidebar-copyright {
  font-size: 10px;
  color: var(--text-secondary);
  opacity: 0.6;
  margin-top: 14px;
  text-align: center;
  line-height: 1.4;
  border-top: 1px dashed var(--border-color);
  padding-top: 12px;
}

/* --- MAIN CONTENT AREA --- */
.main-content {
  flex-grow: 1;
  margin-left: 260px;
  padding-top: 64px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  min-width: 0;
  width: 100%;
  overflow-x: hidden; /* Prevents tables and large components from stretching the main viewport */
}

/* --- TOP HEADER --- */
.top-header {
  height: 64px;
  background-color: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-color);
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: fixed;
  top: 0;
  left: 260px;
  right: 0;
  z-index: 90;
  transition: background-color var(--transition-normal), border-color var(--transition-normal);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.menu-toggle-btn {
  display: none;
  font-size: 18px;
  cursor: pointer;
}

.page-title-area h2 {
  font-size: 18px;
  font-weight: 700;
}

.page-title-area p {
  font-size: 11px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.live-clock-card {
  display: flex;
  align-items: center;
  gap: 8px;
  background-color: rgba(var(--nude-secondary-rgb), 0.42);
  padding: 8px 16px;
  border-radius: 30px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

.live-clock-card i {
  width: 14px;
  height: 14px;
  color: var(--accent-color);
}

.header-action-btn {
  width: 40px;
  height: 40px;
  background-color: rgba(var(--nude-secondary-rgb), 0.30);
  border: 1px solid rgba(var(--accent-color-rgb), 0.10);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: all var(--transition-fast);
}

.header-action-btn:hover {
  background-color: rgba(var(--nude-secondary-rgb), 0.58);
  transform: translateY(-2px);
}

.header-action-btn i {
  width: 18px;
  height: 18px;
}

.notification-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background-color: var(--danger-color);
  color: white;
  font-size: 10px;
  font-weight: 700;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg-secondary);
  box-shadow: 0 2px 6px rgba(239, 68, 68, 0.4);
}

/* --- GLASSMORPHIC COMPONENT CARD --- */
.glassmorphic {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--glass-shadow);
  transition: background var(--transition-normal), border var(--transition-normal), box-shadow var(--transition-normal);
}

.glassmorphic:hover {
  border-color: rgba(var(--accent-color-rgb), 0.18);
}

/* --- CONTENT BODY & SPA VIEW TRANSITION --- */
.content-body {
  padding: 32px;
  flex-grow: 1;
}

.content-section {
  display: none;
  animation: fadeIn var(--transition-normal);
}

.content-section.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --- SECTION: DASHBOARD --- */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.metric-card {
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  position: relative;
  overflow: hidden;
}

.metric-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: transparent;
}

.metric-card:nth-child(1)::after { background: var(--accent-gradient); }
.metric-card:nth-child(2)::after { background: linear-gradient(135deg, #2E7D5A 0%, #1e5c41 100%); }
.metric-card:nth-child(3)::after { background: linear-gradient(135deg, #C96B4B 0%, #a44f32 100%); }
.metric-card:nth-child(4)::after { background: linear-gradient(135deg, #E4A62A 0%, #b88118 100%); }

/* First Metric Card Custom Mocha styling to match design guide */
.metric-card:nth-child(1) {
  background-color: var(--accent-color) !important;
  color: #ffffff !important;
  box-shadow: 0 10px 24px rgba(107, 79, 71, 0.18) !important;
}

.metric-card:nth-child(1) .metric-title {
  color: rgba(255, 255, 255, 0.8) !important;
}

.metric-card:nth-child(1) .metric-value {
  color: #ffffff !important;
}

.metric-card:nth-child(1) .metric-footer span {
  color: rgba(255, 255, 255, 0.8) !important;
}

.metric-card:nth-child(1) .metric-icon-box {
  background: rgba(255, 255, 255, 0.15) !important;
}

.metric-card:nth-child(1) .metric-icon-box i {
  color: #ffffff !important;
}

.metric-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.metric-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.metric-icon-box {
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  flex-shrink: 0;
  border-radius: var(--border-radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.metric-icon-box i { width: 18px; height: 18px; color: var(--text-inverse); }
.sales-bg { background: var(--accent-gradient); }
.profit-bg { background: linear-gradient(135deg, #2E7D5A 0%, #1e5c41 100%); }
.orders-bg { background: linear-gradient(135deg, #C96B4B 0%, #a44f32 100%); }
.stock-bg { background: linear-gradient(135deg, #E4A62A 0%, #b88118 100%); }

.metric-value {
  font-size: 28px;
  font-weight: 800;
  font-family: 'Outfit', sans-serif;
  letter-spacing: -0.03em;
  margin-top: 4px;
}

.metric-footer {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
}

.metric-footer i {
  width: 14px;
  height: 14px;
}

/* Dashboard Details Grid */
.dashboard-details-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 20px;
}

.chart-container-card {
  grid-column: span 6;
}

.low-stock-alerts-card {
  grid-column: span 12;
}

@media (min-width: 1200px) {
  .chart-container-card:nth-of-type(1) { grid-column: span 4; }
  .chart-container-card:nth-of-type(2) { grid-column: span 4; }
  .low-stock-alerts-card { grid-column: span 4; }
}

.details-card {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--glass-border);
}

.card-header h3 {
  font-size: 16px;
  font-weight: 700;
}

.card-header span {
  font-size: 11px;
}

.chart-wrapper {
  height: 250px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.donut-wrapper {
  height: 250px;
}

/* Low Stock Alerts items rendering */
.alerts-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 250px;
  overflow-y: auto;
}

.alert-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background-color: var(--bg-tertiary);
  border-radius: var(--border-radius-md);
  border: 1px solid transparent;
  transition: background-color var(--transition-fast), border-color var(--transition-fast);
}

.alert-item:hover {
  background-color: var(--border-color);
  border-color: rgba(var(--accent-color-rgb), 0.15);
}

.alert-item-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.alert-color-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.alert-item-info h4 {
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.3;
  word-break: break-word;
}

.alert-item-info span {
  font-size: 10px;
  color: var(--text-secondary);
}

.alert-item-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.alert-qty-tag {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
}

.alert-restock-btn {
  background-color: var(--accent-color);
  color: var(--text-inverse);
  font-size: 11px;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: var(--border-radius-sm);
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.alert-restock-btn:hover {
  opacity: 0.9;
  transform: scale(1.03);
}

.alert-restock-btn i {
  width: 12px;
  height: 12px;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 0;
  gap: 12px;
  color: var(--text-secondary);
  text-align: center;
}

.empty-icon {
  width: 40px;
  height: 40px;
}

.empty-state p {
  font-size: 13px;
  font-weight: 500;
}

/* --- COMMON SECTION CONTROLS --- */
.section-controls {
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 24px;
  background: rgba(255, 255, 255, 0.96) !important;
  border: 1px solid rgba(var(--accent-color-rgb), 0.12) !important;
  box-shadow: 0 16px 40px rgba(48, 40, 37, 0.08), 0 2px 8px rgba(48, 40, 37, 0.03) !important;
}

.search-and-filters {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  flex-grow: 1;
}

.search-input-box {
  position: relative;
  display: flex;
  align-items: center;
  flex-grow: 1;
  max-width: 320px;
  min-width: 200px;
}

.search-input-box i:first-child {
  position: absolute;
  left: 14px;
  width: 16px;
  height: 16px;
  color: var(--text-secondary);
  pointer-events: none;
  z-index: 1;
}

.search-input-box input {
  width: 100%;
  background-color: #F5EAE3;
  border: 1px solid rgba(var(--nude-secondary-rgb), 0.78);
  padding: 12px 36px 12px 42px;
  border-radius: var(--border-radius-md);
  font-size: 14.5px;
  color: var(--text-primary);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.search-input-box input:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

/* Clear (X) Button */
.search-clear-btn {
  position: absolute;
  right: 10px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--text-secondary);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 0.18s ease, transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.15s ease;
  z-index: 2;
  flex-shrink: 0;
}

.search-clear-btn[style*="display: flex"],
.search-clear-btn.visible {
  opacity: 1;
  transform: scale(1);
}

.search-clear-btn i {
  position: static !important;
  width: 12px !important;
  height: 12px !important;
  color: white !important;
  stroke-width: 2.5px;
}

.search-clear-btn:hover {
  background: var(--danger-color);
  transform: scale(1.12);
}

.search-clear-btn:active {
  transform: scale(0.92);
}

.filter-dropdowns {
  display: flex;
  align-items: center;
  gap: 10px;
}

.custom-select {
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  padding: 10px 16px;
  border-radius: var(--border-radius-md);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.50);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background-color var(--transition-fast);
}

.custom-select:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px var(--accent-glow), inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.app-dropdown-menu {
  position: absolute;
  z-index: 3000;
  top: calc(100% + 7px);
  left: 0;
  right: 0;
  max-height: 220px;
  overflow-y: auto;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  box-shadow: 0 12px 30px rgba(48, 40, 37, 0.16);
  color: var(--text-primary);
  padding: 4px 0;
}

.app-dropdown-menu::before {
  content: "";
  position: absolute;
  top: -7px;
  left: 20px;
  width: 12px;
  height: 12px;
  background: var(--bg-card);
  border-left: 1px solid var(--border-color);
  border-top: 1px solid var(--border-color);
  transform: rotate(45deg);
}

.app-dropdown-option {
  position: relative;
  z-index: 1;
  padding: 9px 12px;
  font-size: 12.5px;
  line-height: 1.35;
  cursor: pointer;
  color: var(--text-primary);
  background: var(--bg-card);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-dropdown-option:hover,
.app-dropdown-option.active {
  background: var(--dropdown-selected-bg);
  color: var(--dropdown-selected-color);
}

.app-dropdown-empty {
  padding: 9px 12px;
  font-size: 12.5px;
  color: var(--text-secondary);
  background: var(--bg-card);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--border-radius-md);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn i {
  width: 16px;
  height: 16px;
}

.btn-primary {
  background: var(--button-highlight-gradient);
  color: var(--text-inverse);
  box-shadow: 0 6px 16px rgba(var(--highlight-color-rgb), 0.18), 0 2px 6px rgba(var(--accent-color-rgb), 0.08);
  border: 1px solid rgba(var(--highlight-color-rgb), 0.18);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 9px 22px rgba(var(--highlight-color-rgb), 0.24), 0 4px 10px rgba(var(--accent-color-rgb), 0.10);
}

.btn-secondary {
  background-color: var(--nude-secondary);
  border: 1px solid rgba(var(--accent-color-rgb), 0.12);
  color: var(--text-primary);
}

.btn-secondary:hover {
  background-color: #E2C4B5;
  border-color: rgba(var(--accent-color-rgb), 0.18);
  transform: translateY(-1px);
}

.btn-warning {
  background-color: var(--warning-bg);
  border: 1px solid var(--warning-color);
  color: var(--warning-color);
}

.btn-warning:hover {
  background-color: var(--warning-color);
  color: white;
}

.btn-danger {
  background-color: var(--danger-bg);
  border: 1px solid var(--danger-color);
  color: var(--danger-color);
}

.btn-danger:hover {
  background-color: var(--danger-color);
  color: white;
}

/* --- PREMIUM DATA TABLE --- */
.table-container {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  border-radius: var(--border-radius-lg);
  position: relative;
  -webkit-overflow-scrolling: touch; /* Smooth inertial touch scrolling on mobile */
}

.data-table {
  width: 100%;
  min-width: 100%; /* Adapts to full content area dynamically without forcing horizontal scroll on standard screens */
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
}

.data-table th {
  background-color: rgba(var(--nude-secondary-rgb), 0.28);
  padding: 12px 14px; /* Reduced padding from 16px 24px to fit columns perfectly */
  color: var(--text-secondary);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--glass-border);
}



.data-table td {
  padding: 12px 14px; /* Reduced padding from 16px 24px to fit columns perfectly */
  border-bottom: 1px solid var(--glass-border);
  vertical-align: middle;
}

.data-table td.currency-cell {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.data-table tbody tr {
  transition: background-color var(--transition-fast);
}

.data-table tbody tr:hover {
  background-color: rgba(var(--nude-secondary-rgb), 0.22);
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

/* Cell components */
.product-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}

.product-avatar-box {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.08);
}

.product-thumbnail,
.pos-product-thumbnail {
  position: relative;
  flex: 0 0 auto;
  overflow: hidden;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  display: grid;
  place-items: center;
  color: var(--text-tertiary);
}

.product-thumbnail {
  width: 46px;
  height: 46px;
  border-radius: 6px;
}

.pos-product-thumbnail {
  width: 52px;
  height: 52px;
  border-radius: 6px;
}

.product-thumbnail img,
.pos-product-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.product-thumbnail i,
.pos-product-thumbnail i {
  width: 20px;
  height: 20px;
}

.product-image-editor {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 18px;
  align-items: stretch;
}

.product-image-preview {
  width: 190px;
  aspect-ratio: 1;
  border: 1px dashed var(--border-color);
  border-radius: 6px;
  background: var(--bg-tertiary);
  overflow: hidden;
  display: grid;
  place-items: center;
}

.product-image-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #fff;
}

.product-image-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
}

.product-image-placeholder i {
  width: 30px;
  height: 30px;
  stroke-width: 1.5;
}

.product-image-editor-content {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
}

.product-image-editor-content strong {
  display: block;
  font-size: 14px;
  color: var(--text-primary);
}

.product-image-editor-content p,
.product-image-status {
  margin-top: 4px;
  color: var(--text-secondary);
  font-size: 11px;
  line-height: 1.45;
}

.product-image-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.product-image-actions .btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.product-image-actions .btn i {
  width: 15px;
  height: 15px;
}

.product-image-preview img[hidden],
.product-image-preview .product-image-placeholder[hidden],
.product-image-actions .btn[hidden] {
  display: none !important;
}

@media (max-width: 640px) {
  .product-image-editor {
    grid-template-columns: 1fr;
  }

  .product-image-preview {
    width: min(100%, 260px);
    justify-self: center;
  }
}

.product-meta h4 {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
}

.product-meta span {
  font-size: 11px;
  color: var(--text-secondary);
}

.quick-stock-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.btn-icon {
  width: 28px;
  height: 28px;
  border-radius: var(--border-radius-sm);
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-icon:hover {
  background-color: var(--border-color);
  color: var(--accent-color);
}

.btn-icon i {
  width: 14px;
  height: 14px;
}

.btn-edit:hover { background-color: var(--info-bg); color: var(--info-color); border-color: var(--info-color); }
.btn-delete:hover { background-color: var(--danger-bg); color: var(--danger-color); border-color: var(--danger-color); }
.btn-view { background-color: var(--info-bg); color: var(--info-color); border-color: rgba(59, 130, 246, 0.2); }
.btn-view:hover { background-color: var(--info-color); color: #ffffff; border-color: var(--info-color); }

.btn-whatsapp { background-color: rgba(16, 185, 129, 0.15); color: #10b981; border-color: rgba(16, 185, 129, 0.3); }
.btn-whatsapp:hover { background-color: #10b981; color: #ffffff; border-color: #10b981; }

/* --- SECTION: POS LAYOUT --- */
.pos-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 20px;
  min-height: calc(100vh - 170px);
}

.pos-products-panel {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0; /* Crucial: Allows the products grid to shrink and respect the 1fr column width */
}

.pos-controls {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.pos-controls .search-input-box {
  max-width: 320px;
}

.category-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  max-width: calc(100% - 340px);
}

.category-tab {
  padding: 10px 18px;
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 30px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
}

.category-tab:hover {
  color: var(--text-primary);
  background-color: var(--border-color);
}

.category-tab.active {
  background: var(--accent-gradient);
  color: var(--text-inverse);
  border-color: transparent;
  box-shadow: 0 4px 10px var(--accent-glow);
}

.pos-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: calc(100vh - 270px);
  overflow-y: auto;
  padding-right: 4px;
}

.pos-card {
  padding: 12px 16px;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  position: relative;
  transition: all var(--transition-fast);
  overflow: hidden;
  border-radius: var(--border-radius-md);
  min-height: 64px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.pos-card:not(.out-of-stock):hover {
  transform: translateX(3px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.12);
  border-color: rgba(99, 102, 241, 0.35);
  background: rgba(255, 255, 255, 0.05);
}

.pos-card-color-stripe {
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
}

.pos-card-info {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.pos-card-info-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 2;
}

.pos-card-info h4 {
  font-size: 15px;
  font-weight: 700;
  margin: 0 0 2px 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  height: auto;
  line-height: 1.3;
  color: var(--text-primary);
}

.pos-card-info span {
  font-size: 11px;
  color: var(--text-secondary);
  font-family: monospace;
}

.pos-card-specs {
  font-size: 11.5px;
  color: var(--accent-color);
  font-weight: 700;
  white-space: nowrap;
  flex: 1;
  background: rgba(99, 102, 241, 0.08);
  padding: 4px 8px;
  border-radius: var(--border-radius-sm);
  border: 1.5px solid rgba(99, 102, 241, 0.25);
  text-align: center;
}

.pos-card-price {
  font-size: 17px;
  font-weight: 850;
  font-family: 'Outfit', sans-serif;
  color: var(--accent-color);
  margin: 0;
  min-width: 90px;
  text-align: right;
}

.pos-card-stock-status {
  margin-top: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  min-width: 120px;
}

.stock-meter-bg {
  width: 90px;
  height: 5px;
  background-color: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  overflow: hidden;
}

.stock-meter-bar {
  height: 100%;
  border-radius: 10px;
}

.stock-meter-label {
  display: flex;
  justify-content: flex-end;
  font-size: 11px;
  font-weight: 700;
  margin-top: 0;
}

.pos-card.out-of-stock {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
  background: rgba(15, 23, 42, 0.4) !important;
  border-color: rgba(239, 68, 68, 0.15) !important;
}

.pos-card.out-of-stock::after {
  content: 'ESGOTADO';
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(239, 68, 68, 0.15);
  border: 1.5px solid rgba(239, 68, 68, 0.3);
  padding: 4px 10px;
  border-radius: 4px;
  color: #ef4444;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.5px;
  pointer-events: none;
}

.pos-card.low-stock {
  border-color: rgba(245, 158, 11, 0.3) !important;
  background: rgba(245, 158, 11, 0.02);
}

/* POS CART CONTAINER (Right Column) */
.pos-cart-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: calc(100vh - 170px);
  position: sticky;
  top: 110px;
  z-index: 10;
}

.pos-cart-block {
  display: flex;
  flex-direction: column;
  padding: 12px 14px;
}

.pos-checkout-block {
  display: flex;
  flex-direction: column;
  padding: 12px 14px;
}

.cart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.cart-header h3 {
  font-size: 15px;
  font-weight: 700;
}

.btn-clear-cart {
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  opacity: 0.8;
  transition: opacity var(--transition-fast);
}

.btn-clear-cart:hover { opacity: 1; }
.btn-clear-cart i { width: 12px; height: 12px; }

.cart-items-container {
  height: auto;
  max-height: none; /* No artificial capping of the items list */
  overflow: visible; /* Prevent internal scrollbar */
  flex-grow: 1;
  flex-shrink: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
  padding-right: 4px;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--accent-color) transparent;
}

.cart-items-container::-webkit-scrollbar {
  width: 7px;
}

.cart-items-container::-webkit-scrollbar-track {
  background: transparent;
}

.cart-items-container::-webkit-scrollbar-thumb {
  background: var(--accent-color);
  border: 2px solid transparent;
  border-radius: 999px;
  background-clip: padding-box;
}

.cart-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-grow: 1;
  gap: 12px;
  color: var(--text-secondary);
  text-align: center;
  padding: 20px;
}

.cart-empty-state i {
  width: 40px;
  height: 40px;
  stroke-width: 1.5;
}

.cart-empty-state p {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.cart-empty-state span {
  font-size: 11px;
}

/* Premium Two-Line Cart Item Layout */
.cart-item {
  display: flex;
  flex-direction: column;
  flex: 0 0 auto;
  min-height: 66px;
  padding: 6px 10px;
  background-color: var(--bg-tertiary);
  border-radius: var(--border-radius-md);
  gap: 4px;
  border: 1px solid rgba(255, 255, 255, 0.03);
  transition: all var(--transition-fast);
  box-shadow: inset 3px 0 0 rgba(var(--accent-color-rgb), 0.45);
  box-sizing: border-box;
}

body.light-theme .cart-item {
  border: 1px solid rgba(0, 0, 0, 0.03);
}

.cart-item:hover {
  background-color: rgba(255, 255, 255, 0.05);
}

body.light-theme .cart-item:hover {
  background-color: rgba(0, 0, 0, 0.02);
}

.cart-item-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.cart-item-name {
  font-size: 14.5px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex-grow: 1;
}

.cart-item-index {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(var(--accent-color-rgb), 0.12);
  color: var(--accent-color);
  font-size: 10px;
  font-weight: 850;
  line-height: 1;
}

.cart-item-remove {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 17px;
  line-height: 1;
  padding: 0 6px;
  transition: color var(--transition-fast);
}

.cart-item-remove:hover {
  color: var(--danger-color);
}

.cart-item-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.cart-item-price-qty {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 130px;
  min-width: 130px;
  flex-shrink: 0;
  overflow: hidden;
}

.cart-item-price-qty span {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cart-item-price {
  font-size: 12.5px;
  color: var(--text-secondary);
  font-weight: 600;
}

.cart-item-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 20px; /* Capsule pill design */
  padding: 2px 4px;
  width: 100px;
  min-width: 100px;
  flex-shrink: 0;
  box-sizing: border-box;
}

.cart-qty-btn {
  width: 28px;
  height: 28px;
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 15px;
  font-weight: bold;
  border-radius: 50%;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.cart-qty-btn:hover {
  background-color: var(--accent-color);
  color: var(--text-inverse);
  transform: scale(1.08);
}

.cart-qty-val {
  font-size: 14.5px;
  font-weight: 700;
  flex-grow: 1;
  text-align: center;
  color: var(--text-primary);
}

.cart-item-total {
  font-size: 15px;
  font-weight: 750;
  color: var(--text-primary);
  font-family: 'Outfit', sans-serif;
  text-align: right;
  flex-grow: 1;
  min-width: 0;
}

/* Cart Summary Calculations */
.cart-summary {
  border-top: 1px dashed var(--border-color);
  padding: 8px 0;
  display: flex;
  flex-direction: column;
  flex: 0 0 auto;
  gap: 4px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-secondary);
}

.summary-row span:last-child {
  font-weight: 600;
  color: var(--text-primary);
}

.cart-discount-input {
  width: 110px;
  text-align: right;
  background-color: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(99, 102, 241, 0.45);
  border-radius: var(--border-radius-sm);
  color: var(--text-primary);
  padding: 4px 2px 4px 8px;
  font-family: inherit;
  outline: none;
  font-weight: bold;
  font-size: 12px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

body.light-theme .cart-discount-input {
  background-color: rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(0, 0, 0, 0.25);
}

.cart-discount-input:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.25);
}

.summary-total-divider {
  height: 1px;
  background-color: var(--border-color);
  margin: 4px 0;
}

.summary-row.total-row {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}

.summary-row.total-row span:last-child {
  font-size: 15px;
  font-weight: 800;
  font-family: 'Outfit', sans-serif;
}

/* Step Section Header & Badge */
.step-section-header {
  border-bottom: 1px solid var(--glass-border);
  padding-bottom: 8px;
  margin-bottom: 12px;
}

.step-section-header h3 {
  font-size: 14px;
  font-weight: 800;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: -0.01em;
}

.step-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent-gradient);
  color: var(--text-inverse);
  font-size: 13px;
  font-weight: 800;
  box-shadow: 0 3px 8px var(--accent-glow);
}

.cart-header h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 800;
}

.cart-total-items {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 54px;
  height: 24px;
  padding: 0 9px;
  border: 1px solid rgba(var(--accent-color-rgb), 0.24);
  border-radius: 999px;
  background: rgba(var(--accent-color-rgb), 0.1);
  color: var(--accent-color);
  font-size: 10.5px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
  flex-shrink: 0;
  box-sizing: border-box;
}

/* Enormous High-Contrast Total Display (Emerald Glow Box) */
.elderly-total-box {
  margin-top: 14px;
  padding: 14px 18px;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.12) 0%, rgba(5, 150, 105, 0.04) 100%);
  border: 1.5px solid rgba(16, 185, 129, 0.35);
  border-radius: var(--border-radius-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  box-shadow: 0 8px 24px -10px rgba(16, 185, 129, 0.15);
  transition: all var(--transition-normal);
}



.total-label {
  font-size: 13px;
  font-weight: 800;
  color: var(--text-secondary);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.total-value {
  font-size: 38px;
  font-weight: 850;
  color: #10b981; /* Emerald Green */
  font-family: 'Outfit', sans-serif;
  letter-spacing: -0.02em;
}



/* Cart Checkout Actions & Selectors */
.payment-method-selector {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.selector-title {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
}

.payment-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  width: 100%;
}

.payment-option input {
  display: none;
}

.option-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 10px 6px;
  min-width: 0;
  height: 64px;
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  cursor: pointer;
  text-align: center;
  transition: all var(--transition-fast);
}

.payment-option-icon {
  width: 20px !important;
  height: 20px !important;
  color: var(--text-secondary);
  transition: transform var(--transition-fast), color var(--transition-fast);
}

.payment-option-text {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-secondary);
  line-height: 1.15;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.payment-option input:checked + .option-card {
  border: 2px solid var(--accent-color) !important;
  background-color: var(--accent-glow);
  color: var(--accent-color);
  box-shadow: 0 4px 12px rgba(var(--accent-color-rgb), 0.1);
}

#card-options-container > div {
  display: grid !important;
  grid-template-columns: minmax(92px, 0.85fr) minmax(132px, 1.15fr);
  gap: 8px;
  width: 100%;
}

#card-options-container {
  min-height: 61px;
  transition: opacity var(--transition-fast);
}

#card-options-container.payment-options-disabled {
  opacity: 0;
  pointer-events: none;
  user-select: none;
}

#card-options-container .custom-select {
  width: 100% !important;
  min-width: 0;
  height: 40px;
  box-sizing: border-box;
}

.payment-option input:checked + .option-card .payment-option-icon {
  color: var(--accent-color);
  transform: scale(1.15);
}

.payment-option input:checked + .option-card .payment-option-text {
  color: var(--accent-color);
}

/* Giant Highly-Accessible Elderly Checkout Button */
.btn-checkout-elderly {
  width: 100%;
  padding: 15px 20px;
  font-size: 15px;
  font-weight: 800;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important; /* Highly intuitive Emerald Green for validation */
  color: white !important;
  border-radius: var(--border-radius-md);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.35) !important;
  letter-spacing: 0.02em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: all var(--transition-normal);
  
  /* Pulsing glow animation to guide elderly users visually */
  animation: elderlyPulse 2.5s infinite alternate;
}



.btn-checkout-elderly:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 8px 25px rgba(16, 185, 129, 0.55) !important;
  opacity: 0.95;
}

@keyframes elderlyPulse {
  0% {
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
  }
  100% {
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.65), 0 0 0 4px rgba(16, 185, 129, 0.15);
  }
}

/* --- SECTION: SALES HISTORY SPECIFICS --- */
.sales-summary-stat {
  font-size: 13px;
  font-weight: 500;
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  padding: 8px 16px;
  border-radius: 30px;
}

.sales-summary-stat strong {
  margin-left: 6px;
  font-weight: 700;
  font-size: 15px;
}

/* --- SECTION: SETTINGS --- */
.settings-grid {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.settings-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.settings-action-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  background-color: var(--bg-tertiary);
  border-radius: var(--border-radius-md);
  flex-wrap: wrap;
  gap: 12px;
}

.action-info {
  flex-grow: 1;
  max-width: 450px;
}

.action-info h4 {
  font-size: 14px;
  font-weight: 600;
}

.action-info p {
  font-size: 11px;
  margin-top: 4px;
}

.settings-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auto-backup-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  box-shadow: 0 8px 24px rgba(48, 40, 37, 0.05);
}

.auto-backup-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.auto-backup-header h4 {
  margin: 0;
  font-size: 13px;
  font-weight: 800;
  color: var(--text-primary);
}

.auto-backup-header p,
.auto-backup-detail {
  margin: 3px 0 0;
  font-size: 10.5px;
  line-height: 1.35;
  color: var(--text-secondary);
}

.auto-backup-status {
  flex-shrink: 0;
  padding: 5px 8px;
  border-radius: var(--border-radius-sm);
  background: rgba(var(--accent-color-rgb), 0.1);
  border: 1px solid rgba(var(--accent-color-rgb), 0.18);
  color: var(--accent-color);
  font-size: 10px;
  font-weight: 800;
}

.auto-backup-folder-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  border-radius: var(--border-radius-md);
  background: var(--bg-tertiary);
  border: 1px dashed var(--border-color);
  color: var(--text-primary);
  font-size: 11.5px;
  font-weight: 700;
  min-height: 38px;
}

.auto-backup-folder-row span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auto-backup-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.auto-backup-controls .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 10px;
  font-size: 11.5px;
  font-weight: 700;
  border-radius: var(--border-radius-md);
}

.auto-backup-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.auto-backup-options label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  color: var(--text-secondary);
  font-size: 10.5px;
  font-weight: 700;
}

.auto-backup-options select {
  height: 38px;
  padding: 8px 10px;
  border-radius: var(--border-radius-md);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-size: 12px;
}

.auto-backup-toggle {
  grid-column: span 2;
  flex-direction: row !important;
  align-items: center;
  padding: 9px 10px;
  border-radius: var(--border-radius-md);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  cursor: pointer;
}

.auto-backup-toggle input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent-color);
}

.auto-backup-toggle span {
  color: var(--text-primary);
  font-size: 12px;
}

.auto-backup-last {
  padding-top: 10px;
  border-top: 1px dashed var(--border-color);
  color: var(--text-secondary);
  font-size: 10.5px;
  line-height: 1.35;
}

.auto-backup-last strong {
  color: var(--text-primary);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

.required-label::after {
  content: " *";
  color: var(--danger-color);
}

.form-group input, .form-group select, .form-group textarea {
  width: 100%;
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  padding: 10px 14px;
  border-radius: var(--border-radius-md);
  font-size: 13px;
  color: var(--text-primary);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.50);
  transition: all var(--transition-fast);
}

.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px var(--accent-glow);
  outline: none;
}

.form-row-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.form-row-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

/* Color picker inside product modal */
.color-picker-grid {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding: 4px 0;
}

.color-option-label {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid transparent;
  transition: transform var(--transition-fast);
}

.color-option-label:hover {
  transform: scale(1.1);
}

.color-option-label input {
  display: none;
}

.color-option-label span {
  width: 8px;
  height: 8px;
  background-color: white;
  border-radius: 50%;
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.color-option-label input:checked + span {
  opacity: 1;
}

/* --- MODALS OVERLAY SYSTEM --- */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(8, 12, 20, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal);
  
  /* GPU Hardware Acceleration to eliminate Chromium backdrop-filter paint jitter (shaking) */
  will-change: opacity;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform: translate3d(0, 0, 0);
  -webkit-transform: translate3d(0, 0, 0);
}

body:has(.modal-overlay.active) {
  overflow: hidden;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  width: 100%;
  max-width: 500px;
  border-radius: var(--border-radius-lg);
  padding: 24px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.5);
  max-height: 90vh;
  overflow-y: auto;
  
  /* Retain scale transition but promote to independent GPU composite layer to cure shaking on hover/focus */
  transition: transform var(--transition-normal), background var(--transition-normal), border var(--transition-normal), box-shadow var(--transition-normal);
  will-change: transform;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform: scale(0.95) translate3d(0, 0, 0);
  -webkit-transform: scale(0.95) translate3d(0, 0, 0);
}

.modal-overlay.active .modal-card {
  transform: scale(1) translate3d(0, 0, 0);
  -webkit-transform: scale(1) translate3d(0, 0, 0);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--glass-border);
}

.modal-header h3 {
  font-size: 18px;
  font-weight: 700;
}

.modal-close-btn {
  font-size: 24px;
  font-weight: 300;
  cursor: pointer;
  color: var(--text-secondary);
  line-height: 1;
  transition: color var(--transition-fast);
}

.modal-close-btn:hover {
  color: var(--danger-color);
}

.modal-footer-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--glass-border);
}

.customer-history-card {
  max-width: 1240px !important;
  width: min(96vw, 1240px) !important;
  height: min(88vh, 860px);
  max-height: 88vh !important;
  display: flex;
  flex-direction: column;
  overflow: hidden !important;
}

.customer-history-body {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  padding: 20px;
}

.customer-history-layout {
  display: grid;
  grid-template-columns: minmax(360px, 0.9fr) minmax(520px, 1.1fr);
  gap: 18px;
  height: 100%;
  min-height: 0;
}

.customer-history-left,
.customer-history-right {
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.customer-history-left {
  gap: 16px;
  overflow-y: auto;
  padding-right: 4px;
}

.customer-history-right {
  overflow: hidden;
}

.customer-history-profile,
.customer-history-metrics,
.customer-history-preferences,
.customer-history-purchases {
  margin-top: 0 !important;
}

.customer-history-metrics {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}

.customer-history-preferences {
  grid-template-columns: 1fr !important;
}

.customer-history-purchases {
  flex: 1;
  min-height: 0;
}

.customer-history-table-wrap {
  max-height: none !important;
  min-height: 0;
}

.customer-history-table-wrap .custom-table {
  min-width: 660px !important;
}

@media (max-width: 1180px) {
  .customer-history-card {
    height: 90vh;
  }

  .customer-history-body {
    overflow-y: auto;
  }

  .customer-history-layout {
    grid-template-columns: 1fr;
    height: auto;
  }

  .customer-history-left {
    overflow: visible;
    padding-right: 0;
  }

  .customer-history-right {
    min-height: 420px;
  }
}

@media (max-width: 760px) {
  .customer-history-card {
    width: 96vw !important;
    height: 92vh;
  }

  .customer-history-body {
    padding: 14px;
  }

  .customer-history-metrics {
    grid-template-columns: 1fr !important;
  }
}

/* RECEIPT MODAL SPECIFIC */
.receipt-modal-card {
  max-width: 400px;
}

.receipt-scroll-area {
  max-height: 60vh;
  overflow-y: auto;
  padding-right: 4px;
}

.paper-receipt {
  background-color: #ffffff;
  color: #1e293b;
  padding: 24px;
  border-radius: 4px;
  font-family: 'Courier New', Courier, monospace;
  box-shadow: 0 4px 6px rgba(0,0,0,0.05);
  border: 1px solid #e2e8f0;
}

.paper-receipt h4 {
  font-family: 'Courier New', Courier, monospace;
  font-weight: bold;
  text-align: center;
  font-size: 16px;
  margin-bottom: 6px;
}

.paper-receipt p {
  font-size: 11px;
  line-height: 1.4;
  margin-bottom: 4px;
}

.receipt-divider {
  border-top: 1px dashed #94a3b8;
  margin: 12px 0;
}

.receipt-table {
  width: 100%;
  font-size: 11px;
  margin: 12px 0;
}

.receipt-table th {
  border-bottom: 1px dashed #94a3b8;
  padding-bottom: 4px;
  font-weight: bold;
  text-align: left;
}

.receipt-table td {
  padding: 6px 0;
}

.receipt-totals {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
  align-items: flex-end;
}

.receipt-totals div {
  width: 100%;
  display: flex;
  justify-content: space-between;
}

.receipt-total-large {
  font-size: 14px;
  font-weight: bold;
  border-top: 1px dashed #94a3b8;
  padding-top: 6px;
  margin-top: 4px;
}

.receipt-footer-msg {
  text-align: center;
  font-size: 10px;
  margin-top: 20px;
  color: #64748b;
}

/* --- TOAST NOTIFICATION CONTAINER --- */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 500;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  background-color: var(--bg-secondary);
  border-left: 4px solid var(--accent-color);
  border-radius: var(--border-radius-md);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  min-width: 250px;
  max-width: 380px;
  transform: translateX(120%);
  opacity: 0;
  transition: all 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.toast.show {
  transform: translateX(0);
  opacity: 1;
}

.toast i {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.toast-success { border-left-color: var(--success-color); }
.toast-success i { color: var(--success-color); }
.toast-warning { border-left-color: var(--warning-color); }
.toast-warning i { color: var(--warning-color); }
.toast-danger { border-left-color: var(--danger-color); }
.toast-danger i { color: var(--danger-color); }
.toast-info { border-left-color: var(--info-color); }
.toast-info i { color: var(--info-color); }

/* --- PREMIUM 2-BLOCK POS CART DESKTOP UPGRADE --- */
@media (min-width: 1025px) {
  .pos-layout {
    grid-template-columns: 1fr 410px !important;
    height: calc(100vh - 160px) !important;
    overflow: hidden !important;
  }
  
  .pos-cart-container {
    width: 410px !important;
    height: 100% !important;
    max-height: none !important;
    position: sticky !important;
    top: 110px !important;
    z-index: 10 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
    overflow-y: hidden !important; /* Disable parent scrolling since we fit everything */
    padding-right: 0 !important;
  }
  
  .pos-cart-block {
    flex: 1 1 auto !important;
    min-height: 240px !important;
    height: 380px !important; /* Set fixed size so checkout fits below */
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
  }
  
  .cart-items-container {
    flex: 1 1 auto !important;
    min-height: 100px !important;
    height: 140px !important; /* Fixed inner scroll area */
    max-height: 150px !important;
    overflow-y: auto !important; /* Enable scroll inside cart list */
    margin-bottom: 6px !important;
    padding-right: 4px !important;
  }
  
  .pos-checkout-block {
    flex-shrink: 0 !important;
    height: auto !important;
    max-height: calc(100vh - 560px) !important;
    overflow-y: auto !important; /* Safe scroll in checkout block if needed */
  }

  .cart-summary {
    border-top: 1px dashed var(--border-color) !important;
    padding-top: 6px !important;
    margin-bottom: 0 !important;
  }
}

/* Three columns require real horizontal space after the 260px sidebar. */
@media (min-width: 1800px) {
  .pos-layout {
    grid-template-columns: 1fr 380px 400px !important;
    height: calc(100vh - 165px) !important;
    overflow: hidden !important;
    gap: 16px !important;
  }
  
  .pos-cart-container {
    display: contents !important; /* Flatten DOM wrapper so children become direct grid items */
  }
  
  .pos-cart-block {
    grid-column: 2 !important;
    height: 100% !important;
    min-height: auto !important;
    max-height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
  }
  
  .cart-items-container {
    height: auto !important;
    max-height: calc(100vh - 430px) !important; /* Much larger scroll area */
    overflow-y: auto !important;
    margin-bottom: 8px !important;
  }
  
  .pos-checkout-block {
    grid-column: 3 !important;
    height: 100% !important;
    max-height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    overflow-y: auto !important; /* Safe scroll for all select inputs */
  }
}

/* --- RESPONSIVE ADAPTATIONS --- */
@media (max-width: 1024px) {
  .pos-layout {
    grid-template-columns: 1fr;
    height: auto;
  }
  
  .pos-cart-container {
    height: auto;
    position: static;
  }
  
  .pos-grid {
    max-height: 500px;
  }
  
  .sidebar {
    width: 80px;
    align-items: center;
    padding: 20px 8px;
  }
  
  .brand-text, .menu-item span, .theme-label, .profile-info, .sidebar-copyright {
    display: none;
  }
  
  .brand-logo {
    width: 36px;
    height: 36px;
  }
  
  .logo-icon {
    width: 20px;
    height: 20px;
  }
  
  .menu-item {
    justify-content: center;
    padding: 12px;
  }
  
  .menu-item i {
    transform: none !important;
  }
  
  .main-content {
    margin-left: 80px;
  }

  .top-header {
    left: 80px;
  }
  
  .theme-toggle-container {
    padding: 6px;
  }
  
  .theme-toggle-btn {
    width: 24px;
    height: 24px;
    background: none !important;
  }
  
  .toggle-circle {
    top: 3px;
    left: 3px;
    transform: none !important;
    background: none !important;
    box-shadow: none !important;
  }
  

  
  .toggle-circle i {
    width: 16px;
    height: 16px;
  }
  
  .pos-controls {
    flex-wrap: wrap;
  }
  
  .category-tabs {
    max-width: 100%;
  }
}

@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 260px;
    height: 100vh;
    transform: translateX(-100%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), background-color var(--transition-normal);
    z-index: 500;
    display: flex !important; /* Force flex display but control visibility via transform translate */
    box-shadow: none;
  }
  
  .sidebar.active {
    transform: translateX(0);
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
  }
  
  .sidebar .brand-text, 
  .sidebar .menu-item span, 
  .sidebar .theme-label, 
  .sidebar .profile-info,
  .sidebar .sidebar-copyright {
    display: block !important;
  }
  
  .sidebar .menu-item {
    justify-content: flex-start !important;
    padding: 12px 16px !important;
  }
  
  .sidebar .theme-toggle-container {
    padding: 8px 12px !important;
  }
  
  .sidebar .theme-toggle-btn {
    width: 48px !important;
    height: 24px !important;
    background-color: var(--border-color) !important;
  }
  
  .sidebar .toggle-circle {
    width: 18px !important;
    height: 18px !important;
    background-color: white !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2) !important;
    transform: none !important;
  }
  

  
  .main-content {
    margin-left: 0;
  }
  
  .menu-toggle-btn {
    display: block;
    width: 40px;
    height: 40px;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
  }
  
  .menu-toggle-btn:hover {
    background-color: var(--border-color);
  }
  
  .top-header {
    left: 0;
    padding: 0 20px;
  }
  
  .content-body {
    padding: 20px;
  }
  
  .form-row-grid, .form-row-grid-3 {
    grid-template-columns: 1fr;
  }
}

/* Printing receipt stylesheet */
@media print {
  body * {
    visibility: hidden;
  }
  #receipt-modal, #receipt-modal *, #paper-receipt-content, #paper-receipt-content *,
  #report-modal, #report-modal *, #paper-report-content, #paper-report-content * {
    visibility: visible;
  }
  #receipt-modal, #report-modal {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    background: none !important;
    backdrop-filter: none !important;
  }
  .print-footer-btn, .modal-header, .digital-receipt-box {
    display: none !important;
  }
  .receipt-modal-card {
    box-shadow: none !important;
    border: none !important;
    background: none !important;
  }
  .paper-receipt {
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
    color: black !important;
    background: white !important;
  }
}

/* APG Lojix CRM Style Rules */
.badge-purple {
  background-color: rgba(139, 92, 246, 0.15);
  color: #a78bfa;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4.5px;
  border: 1px solid rgba(139, 92, 246, 0.25);
}

body.light-theme .badge-purple {
  background-color: rgba(109, 40, 217, 0.10);
  color: #6d28d9;
  border: 1px solid rgba(109, 40, 217, 0.15);
}

.badge-purple i {
  width: 12px;
  height: 12px;
}

#cart-customer-select {
  transition: all var(--transition-fast);
}

#cart-customer-select:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
  outline: none;
}

/* --- MOBILE MAXIMUM OPTIMIZATIONS (<= 576px) --- */
@media (max-width: 576px) {
  .top-header {
    height: 64px;
    padding: 0 16px;
  }
  
  .page-title-area h2 {
    font-size: 18px;
  }
  
  .page-title-area p {
    display: none; /* Hide subtitle to preserve top header row sanity */
  }
  
  .live-clock-card {
    padding: 6px 10px;
    font-size: 11px;
  }
  
  .live-clock-card i {
    width: 12px;
    height: 12px;
  }
  
  .content-body {
    padding: 16px 12px;
  }
  
  .metrics-grid {
    grid-template-columns: repeat(2, 1fr) !important; /* Clean 2x2 grid for metrics cards */
    gap: 12px;
  }
  
  .metric-card {
    padding: 16px;
    gap: 10px;
  }
  
  .metric-value {
    font-size: 20px;
  }
  
  .metric-title {
    font-size: 10px;
  }
  
  .metric-icon-box {
    width: 28px;
    height: 28px;
    min-width: 28px;
    min-height: 28px;
    flex-shrink: 0;
  }
  
  .metric-icon-box i {
    width: 14px;
    height: 14px;
  }
  
  .metric-footer {
    font-size: 10px;
  }
  
  .dashboard-details-grid {
    gap: 16px;
  }
  
  .chart-container-card {
    grid-column: span 12 !important; /* Stack charts vertically */
  }
  
  .section-controls {
    padding: 16px;
    flex-direction: column;
    align-items: stretch;
  }
  
  .search-and-filters {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }
  
  .search-input-box {
    max-width: 100%;
    width: 100%;
  }
  
  .filter-dropdowns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    width: 100%;
  }
  
  .custom-select {
    width: 100%;
    padding: 10px;
    font-size: 12px;
  }
  
  .section-controls > div {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 8px;
  }
  
  .section-controls .btn {
    width: 100%;
  }
  
  .pos-controls {
    flex-direction: column;
    align-items: stretch;
    padding: 12px;
  }
  
  .pos-controls .search-input-box {
    max-width: 100%;
    width: 100%;
  }
  
  .category-tabs {
    max-width: 100%;
    width: 100%;
    margin-top: 8px;
  }
  
  .pos-grid {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)) !important;
    gap: 12px;
    max-height: 400px;
  }
  
  .pos-card {
    padding: 12px;
  }
  
  .pos-card-price {
    font-size: 14px;
  }
  
  .cart-qty-val {
    width: 14px;
  }
  
  .cart-qty-btn {
    width: 20px;
    height: 20px;
  }
  
  .cart-item-total {
    min-width: 60px;
    font-size: 12px;
  }
  
  .modal-card {
    padding: 16px;
    width: 95%;
  }
  
  .modal-footer-actions {
    flex-direction: column-reverse;
    gap: 8px;
  }
  
  .modal-footer-actions .btn {
    width: 100%;
  }
}

/* ==========================================================================
   SAAS AUTHENTICATION GATEWAY STYLING
   ========================================================================== */

.auth-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  z-index: 1000;
  overflow: hidden;
  will-change: opacity;
}

/* Password Visibility Toggle Style */
.password-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.password-input-wrapper input {
  padding-right: 36px !important;
  width: 100%;
}

.btn-toggle-password {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  color: var(--text-secondary);
  transition: color var(--transition-fast), transform var(--transition-fast);
  opacity: 0.75;
  z-index: 5;
}

.btn-toggle-password:hover {
  color: #2F5D46;
  opacity: 1;
  transform: translateY(-50%) scale(1.08);
}

.btn-toggle-password i,
.btn-toggle-password svg {
  width: 18px;
  height: 18px;
  pointer-events: none;
}

.auth-card {
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: row;
  border-radius: 0;
  box-shadow: none;
  background: #ffffff;
  overflow: hidden;
  z-index: 10;
  position: relative;
  animation: authFadeIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes authFadeIn {
  from { opacity: 0; transform: translateY(30px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Left Banner Styling - Luxury Closet Image and golden quote frame */
.auth-left-banner {
  flex: 1.1;
  background-image: url('login-background-v1.0.0.svg?v=20260901_v1.0.0-green2');
  background-size: cover;
  background-position: center;
  padding: 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  border-radius: 0;
  box-shadow: 6px 0 24px rgba(0, 0, 0, 0.02);
  z-index: 2;
}

.luxury-quote-frame {
  border: 1px solid #78917E;
  padding: 40px 50px;
  background-color: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(5px);
  text-align: center;
  max-width: 320px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

.quote-line {
  display: block;
  font-family: 'Playfair Display', 'Georgia', serif;
  font-size: 26px;
  font-weight: 300;
  color: #294B39;
  letter-spacing: 0.12em;
  line-height: 1.8;
  text-transform: lowercase;
}

/* Right Form Panel - Elegant White/Grey, clean serif titles */
.auth-right-form {
  flex: 1.2;
  padding: 40px 80px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background-color: #F2F6F1;
  z-index: 1;
  overflow-y: auto;
}

/* White compact card inside the right form panel */
.auth-form-card {
  background: #ffffff;
  border-radius: 12px;
  padding: 30px 40px;
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.auth-logo-wrapper {
  display: flex;
  justify-content: center;
  margin-bottom: 15px;
}

.auth-logo-img {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  border: none;
  object-fit: contain;
  padding: 0;
  background: transparent;
}

.auth-welcome-title {
  font-family: 'Playfair Display', 'Georgia', serif;
  font-size: 24px;
  font-weight: 400;
  color: #244C38;
  text-align: center;
  margin-bottom: 6px;
  letter-spacing: -0.01em;
}

.auth-helper-text {
  font-size: 13px;
  color: #66766D;
  text-align: center;
  margin-bottom: 20px;
}

.auth-form {
  display: none;
  flex-direction: column;
  gap: 16px;
}

.auth-form.active {
  display: flex;
}

.auth-form-feedback {
  padding: 10px 12px;
  border: 1px solid #d8dee8;
  border-radius: 10px;
  background: #f8fafc;
  color: #334155;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.45;
  text-align: center;
}

.auth-form-feedback[data-type="danger"] {
  border-color: #fecaca;
  background: #fef2f2;
  color: #991b1b;
}

.auth-form-feedback[data-type="success"] {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #166534;
}

.input-with-icon {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.input-with-icon .input-icon {
  position: absolute;
  left: 14px;
  color: #a0aec0;
  width: 16px;
  height: 16px;
  pointer-events: none;
  z-index: 4;
}

.input-with-icon input {
  width: 100%;
  padding: 10px 14px 10px 38px !important;
  border: 1px solid #cbd5e0;
  border-radius: 6px;
  font-size: 13px;
  color: #2d3748;
  background: #ffffff;
  font-weight: 500;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.input-with-icon input:focus {
  border-color: #2F5D46;
  box-shadow: 0 0 0 3px rgba(47, 93, 70, 0.12);
  outline: none;
}

.btn-wine {
  width: 100%;
  padding: 10px 20px;
  font-size: 13.5px;
  font-weight: 600;
  margin-top: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  background: #2F5D46;
  border: none;
  color: white;
  border-radius: 6px;
  box-shadow: 0 4px 10px rgba(47, 93, 70, 0.18);
  transition: all var(--transition-fast);
}

.btn-wine:hover {
  background: #244C38;
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(47, 93, 70, 0.26);
}

.btn-outline-gold {
  width: 100%;
  padding: 10px 20px;
  font-size: 13.5px;
  font-weight: 500;
  margin-top: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  background: transparent;
  border: 1px solid #6F8D77;
  color: #496B55;
  border-radius: 6px;
  transition: all var(--transition-fast);
}

.btn-outline-gold:hover {
  background: #6F8D77;
  color: white;
  transform: translateY(-1px);
}

.auth-security-footer {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 35px;
  padding: 14px 16px;
  background: #fafaf9;
  border-radius: 8px;
  border: 1px solid #f5f5f4;
}

.auth-security-footer .security-icon {
  color: #6F8D77;
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

.auth-security-footer .security-text {
  font-size: 12px;
  color: #718096;
  line-height: 1.5;
  margin: 0;
  text-align: left;
}

/* Responsive auth styles */
@media (max-width: 992px) {
  .auth-card {
    flex-direction: column;
  }

  .auth-left-banner {
    display: none;
  }

  .auth-right-form {
    flex: 1;
    padding: 40px 30px;
  }
}

.auth-form .form-group label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
}

.auth-form .form-group input, 
.auth-form .form-group select {
  font-size: 14px;
  font-weight: 600;
  padding: 12px 14px;
  background-color: #ffffff;
  border: 1px solid #e2e8f0;
  color: var(--text-primary);
  border-radius: var(--border-radius-md);
  transition: all var(--transition-fast);
}

.auth-form .form-group input::placeholder {
  color: #7E9185;
}

/* Keep auth icons and password controls outside the editable text area. */
.auth-form .input-with-icon > input,
.auth-form .input-with-icon .password-input-wrapper > input {
  padding-left: 44px !important;
}

.auth-form .input-with-icon .password-input-wrapper > input {
  padding-right: 44px !important;
}

.auth-form .input-with-icon .input-icon {
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
}

.auth-form .form-group input:focus, 
.auth-form .form-group select:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px var(--accent-glow);
  background-color: #ffffff;
  outline: none;
}

/* Responsive auth styles */
@media (max-width: 992px) {
  .auth-card {
    width: 100%;
    max-width: 500px;
    height: auto;
    flex-direction: column;
    border-radius: 20px;
  }

  .auth-left-banner {
    display: none;
  }

  .auth-right-form {
    padding: 40px 30px;
  }
}

/* Digital Receipt Selector Tabs styling */
.digital-receipt-box button.active {
  background: var(--accent-gradient) !important;
  color: white !important;
  border-color: transparent !important;
  box-shadow: 0 4px 12px var(--accent-glow) !important;
}

body.light-theme .digital-receipt-box button:not(.active) {
  background-color: #f1f5f9 !important;
  color: #64748b !important;
  border-color: #e2e8f0 !important;
}

body.light-theme .digital-receipt-box button:not(.active):hover {
  background-color: #e2e8f0 !important;
}

/* Force uppercase text styling inside store data inputs, but keep login/user fields natural. */
input[type="text"]:not(#login-email):not(#reg-email):not(#colab-email):not(#login-password):not(#reg-password):not(#barcode-input):not(#label-contact-social),
input[type="search"]:not(#barcode-input),
textarea {
  text-transform: uppercase;
}

/* Username, password and barcode fields preserve original case. */
#login-email,
#reg-email,
#colab-email,
#login-password,
#reg-password,
#colab-pass,
#edit-colab-new-password,
#label-contact-social,
#barcode-input {
  text-transform: none !important;
}

/* ==========================================
   NETWORK STATUS BADGE (PWA & OFFLINE-FIRST)
   ========================================== */
.network-status-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: var(--border-radius-full, 24px);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-sm);
  user-select: none;
}

.network-status-badge:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-1px);
}

.network-status-badge:active {
  transform: translateY(0);
}

.network-status-badge .status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  position: relative;
  transition: all 0.3s ease;
}

.network-inline-message {
  max-width: 340px;
  padding: 8px 12px;
  border-radius: var(--border-radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-primary);
  box-shadow: var(--glass-shadow);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.3;
  opacity: 0;
  transform: translateX(-8px);
  pointer-events: none;
  white-space: nowrap;
  transition: opacity var(--transition-fast), transform var(--transition-fast);
}

.network-inline-message.show {
  opacity: 1;
  transform: translateX(0);
}

.network-inline-message.success {
  color: #047857;
  border-color: rgba(16, 185, 129, 0.24);
  background: rgba(16, 185, 129, 0.08);
}

.network-inline-message.warning {
  color: #b45309;
  border-color: rgba(245, 158, 11, 0.26);
  background: rgba(245, 158, 11, 0.1);
}

.network-inline-message.danger {
  color: #dc2626;
  border-color: rgba(220, 38, 38, 0.24);
  background: rgba(220, 38, 38, 0.08);
}

.network-inline-message.info {
  color: var(--accent-color);
  border-color: rgba(var(--accent-color-rgb), 0.22);
  background: rgba(var(--accent-color-rgb), 0.08);
}

/* Online status */
.network-status-badge.online {
  border-color: rgba(16, 185, 129, 0.2);
}
.network-status-badge.online:hover {
  border-color: rgba(16, 185, 129, 0.4);
  background: rgba(16, 185, 129, 0.05);
}
.network-status-badge.online .status-dot {
  background: #10b981; /* Emerald */
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.8), 0 0 4px rgba(16, 185, 129, 0.4);
}

/* Offline status */
.network-status-badge.offline {
  border-color: rgba(245, 158, 11, 0.2);
  background: rgba(245, 158, 11, 0.03);
}
.network-status-badge.offline:hover {
  border-color: rgba(245, 158, 11, 0.4);
  background: rgba(245, 158, 11, 0.07);
}
.network-status-badge.offline .status-dot {
  background: #f59e0b; /* Amber */
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.8), 0 0 4px rgba(245, 158, 11, 0.4);
  animation: pulse-offline 2s infinite ease-in-out;
}

/* Syncing status */
.network-status-badge.syncing {
  border-color: rgba(59, 130, 246, 0.2);
  background: rgba(59, 130, 246, 0.03);
}
.network-status-badge.syncing:hover {
  border-color: rgba(59, 130, 246, 0.4);
  background: rgba(59, 130, 246, 0.07);
}
.network-status-badge.syncing .status-dot {
  background: #3b82f6; /* Blue */
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.8), 0 0 4px rgba(59, 130, 246, 0.4);
  animation: pulse-sync 1.2s infinite ease-in-out;
}

/* Animations */
@keyframes pulse-offline {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.6;
    transform: scale(0.9);
  }
}

@keyframes pulse-sync {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.4;
    transform: scale(0.85);
  }
}

/* Light theme support */
body.light-theme .network-status-badge {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.08);
  color: var(--text-primary);
}
body.light-theme .network-status-badge:hover {
  background: rgba(0, 0, 0, 0.05);
  border-color: rgba(0, 0, 0, 0.15);
}
body.light-theme .network-status-badge.online {
  border-color: rgba(16, 185, 129, 0.3);
}
body.light-theme .network-status-badge.online:hover {
  background: rgba(16, 185, 129, 0.05);
}
body.light-theme .network-status-badge.offline {
  border-color: rgba(245, 158, 11, 0.3);
}
body.light-theme .network-status-badge.offline:hover {
  background: rgba(245, 158, 11, 0.05);
}
body.light-theme .network-status-badge.syncing {
  border-color: rgba(59, 130, 246, 0.3);
}
body.light-theme .network-status-badge.syncing:hover {
  background: rgba(59, 130, 246, 0.05);
}

@media (max-width: 980px) {
  .network-inline-message {
    display: none;
  }
}


/* ==========================================================================
   BARCODE SCANNER SYSTEM - PDV (FAB + POPUP MODAL)
   ========================================================================== */

/* --- Floating Action Button (FAB) --- */
.barcode-fab {
  position: fixed;
  bottom: 36px;
  right: 36px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  box-shadow: 0 8px 32px rgba(16, 185, 129, 0.45), 0 0 0 0 rgba(16, 185, 129, 0.3);
  cursor: pointer;
  transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
  position: fixed;
  animation: fabEntrance 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes fabEntrance {
  from { transform: scale(0) rotate(-30deg); opacity: 0; }
  to   { transform: scale(1) rotate(0deg);  opacity: 1; }
}

.barcode-fab:hover {
  transform: scale(1.1) translateY(-3px);
  box-shadow: 0 14px 40px rgba(16, 185, 129, 0.55), 0 0 0 8px rgba(16, 185, 129, 0.12);
}

.barcode-fab:active {
  transform: scale(0.96);
}

.barcode-fab-pulse {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid rgba(16, 185, 129, 0.5);
  animation: fabPulse 2.2s infinite ease-out;
  pointer-events: none;
}

@keyframes fabPulse {
  0%   { transform: scale(1);    opacity: 0.8; }
  60%  { transform: scale(1.55); opacity: 0; }
  100% { transform: scale(1.55); opacity: 0; }
}

.barcode-fab-icon {
  width: 26px;
  height: 26px;
  color: white;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.25));
}

.barcode-fab-label {
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.9);
  text-transform: uppercase;
  line-height: 1;
}

/* FAB disabled state (scanner off) */
.barcode-fab.scanner-off {
  background: linear-gradient(135deg, #475569 0%, #334155 100%);
  box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

.barcode-fab.scanner-off .barcode-fab-pulse {
  display: none;
}

/* --- Barcode Modal Overlay --- */
.barcode-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 500;
  display: none;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 28px;
  animation: none;
}

.barcode-modal-overlay.active {
  display: flex;
  animation: barcodeOverlayIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes barcodeOverlayIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* --- Barcode Modal Card --- */
.barcode-modal-card {
  width: 100%;
  max-width: 580px;
  border-radius: 28px;
  overflow: hidden;
  background: linear-gradient(160deg,
    rgba(16, 185, 129, 0.08) 0%,
    rgba(15, 23, 42, 0.96) 40%
  ) !important;
  border: 1px solid rgba(16, 185, 129, 0.25) !important;
  box-shadow:
    0 0 0 1px rgba(16, 185, 129, 0.12),
    0 32px 64px -12px rgba(0, 0, 0, 0.6),
    0 0 80px -20px rgba(16, 185, 129, 0.2) !important;
  animation: barcodeModalSlideUp 0.32s cubic-bezier(0.34, 1.36, 0.64, 1);
  transform-origin: bottom center;
}

@keyframes barcodeModalSlideUp {
  from { transform: translateY(40px) scale(0.96); opacity: 0; }
  to   { transform: translateY(0)    scale(1);    opacity: 1; }
}

/* Flash states */
.barcode-modal-card.barcode-success-flash {
  border-color: rgba(16, 185, 129, 0.6) !important;
  box-shadow:
    0 0 0 1px rgba(16, 185, 129, 0.4),
    0 32px 64px -12px rgba(0, 0, 0, 0.6),
    0 0 60px -10px rgba(16, 185, 129, 0.4) !important;
  animation: barcodeSuccessPulse 0.4s ease;
}

.barcode-modal-card.barcode-error-flash {
  border-color: rgba(239, 68, 68, 0.6) !important;
  box-shadow:
    0 0 0 1px rgba(239, 68, 68, 0.4),
    0 32px 64px -12px rgba(0, 0, 0, 0.6),
    0 0 60px -10px rgba(239, 68, 68, 0.3) !important;
  animation: barcodeErrorShake 0.35s ease;
}

@keyframes barcodeSuccessPulse {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.012); }
  100% { transform: scale(1); }
}

@keyframes barcodeErrorShake {
  0%, 100% { transform: translateX(0); }
  20%       { transform: translateX(-6px); }
  40%       { transform: translateX(6px); }
  60%       { transform: translateX(-6px); }
  80%       { transform: translateX(6px); }
}

/* --- Modal Header --- */
.barcode-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid rgba(16, 185, 129, 0.12);
  gap: 12px;
}

.barcode-modal-title-group {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.barcode-modal-icon-wrap {
  position: relative;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.barcode-modal-pulse {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid rgba(16, 185, 129, 0.4);
  animation: barcodePulseRing 2s infinite ease-out;
}

@keyframes barcodePulseRing {
  0%   { transform: scale(0.85); opacity: 0.8; }
  60%  { transform: scale(1.4);  opacity: 0; }
  100% { transform: scale(1.4);  opacity: 0; }
}

.barcode-modal-icon {
  width: 24px;
  height: 24px;
  color: #10b981;
  filter: drop-shadow(0 0 8px rgba(16, 185, 129, 0.6));
  position: relative;
  z-index: 1;
}

.barcode-modal-title {
  font-size: 13px;
  font-weight: 800;
  color: #10b981;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0;
  font-family: 'Outfit', sans-serif;
}

.barcode-modal-subtitle {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  margin: 3px 0 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 280px;
}

.barcode-modal-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.barcode-modal-toggle-wrap {
  display: flex;
  align-items: center;
  gap: 7px;
}

.barcode-modal-toggle-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-secondary);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.barcode-modal-close {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  font-size: 20px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.barcode-modal-close:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.3);
  color: var(--danger-color);
}

/* --- Toggle Button (shared) --- */
.barcode-toggle-btn {
  width: 44px;
  height: 24px;
  border-radius: 12px;
  background-color: var(--border-color);
  border: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
  position: relative;
  transition: background-color 0.25s ease, box-shadow 0.25s ease;
  padding: 0;
  flex-shrink: 0;
}

.barcode-toggle-btn.active {
  background-color: #10b981;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
}

.barcode-toggle-circle {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 1px 4px rgba(0,0,0,0.35);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.barcode-toggle-btn.active .barcode-toggle-circle {
  transform: translateX(20px);
}

/* --- Modal Body --- */
.barcode-modal-body {
  padding: 20px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* --- Input Wrapper --- */
.barcode-modal-input-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(16, 185, 129, 0.05);
  border: 1.5px solid rgba(16, 185, 129, 0.25);
  border-radius: 16px;
  padding: 0 16px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.barcode-modal-input-wrap:focus-within {
  border-color: rgba(16, 185, 129, 0.55);
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.1), 0 0 24px -4px rgba(16, 185, 129, 0.2);
  background: rgba(16, 185, 129, 0.07);
}

.barcode-modal-input-icon {
  width: 20px;
  height: 20px;
  color: #10b981;
  flex-shrink: 0;
  filter: drop-shadow(0 0 5px rgba(16, 185, 129, 0.4));
}

.barcode-modal-input-field {
  flex: 1;
  background: none !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  padding: 14px 0 !important;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  text-transform: none !important;
  letter-spacing: 0.02em;
}

.barcode-modal-input-field::placeholder {
  font-size: 12.5px;
  font-weight: 400;
  color: var(--text-secondary);
  opacity: 0.65;
  text-transform: none !important;
}

.barcode-modal-input-field:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* --- Kbd hint --- */
.barcode-modal-kbd {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-bottom-width: 2px;
  border-radius: 6px;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
  white-space: nowrap;
  flex-shrink: 0;
  font-family: monospace;
}

/* --- Last Scan --- */
.barcode-modal-last-scan {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: 10px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--success-color);
  animation: fadeIn 0.25s ease;
}

.barcode-modal-last-scan span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-transform: none !important;
}

/* --- Tips Section --- */
.barcode-modal-tips {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.025);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.barcode-tip-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85); /* High legibility contrast */
}

/* --- Light theme overrides --- */
body.light-theme .barcode-modal-card {
  background: linear-gradient(160deg,
    rgba(16, 185, 129, 0.06) 0%,
    rgba(255, 255, 255, 0.97) 40%
  ) !important;
}

body.light-theme .barcode-modal-input-wrap {
  background: rgba(16, 185, 129, 0.04);
  border-color: rgba(16, 185, 129, 0.3);
}

body.light-theme .barcode-modal-kbd {
  background: rgba(0, 0, 0, 0.05);
  border-color: rgba(0, 0, 0, 0.12);
}

body.light-theme .barcode-modal-tips {
  background: rgba(0, 0, 0, 0.025);
  border-color: rgba(0, 0, 0, 0.06);
}

/* --- Responsive --- */
@media (max-width: 640px) {
  .barcode-modal-card {
    border-radius: 24px 24px 0 0;
    max-width: 100%;
  }
  .barcode-modal-overlay {
    padding-bottom: 0;
    align-items: flex-end;
  }
  .barcode-fab {
    bottom: 24px;
    right: 20px;
    width: 64px;
    height: 64px;
  }
  .barcode-modal-subtitle {
    max-width: 180px;
  }
}

/* ==========================================================================
   SCAN CONFIRM CARD
   ========================================================================== */

.scan-confirm-card {
  position: fixed;
  /*   */
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.8);
  z-index: 999999 !important; /*          */
  width: min(520px, calc(100vw - 32px));
  background: linear-gradient(160deg,
    rgba(16, 185, 129, 0.26) 0%,
    rgba(15, 23, 42, 0.98) 45%
  ) !important;
  border: 2.5px solid rgba(16, 185, 129, 0.65) !important;
  border-radius: 32px;
  padding: 40px 32px 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  box-shadow:
    0 0 0 1px rgba(16, 185, 129, 0.25),
    0 40px 100px -12px rgba(0, 0, 0, 0.95),
    0 0 120px -20px rgba(16, 185, 129, 0.45);
  text-align: center;
  /*  */
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.25s ease,
    transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.scan-confirm-card.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1.05); /*       */
  pointer-events: auto;
}

.scan-confirm-card.error {
  background: linear-gradient(160deg,
    rgba(239, 68, 68, 0.26) 0%,
    rgba(15, 23, 42, 0.98) 45%
  ) !important;
  border-color: rgba(239, 68, 68, 0.65) !important;
  box-shadow:
    0 0 0 1px rgba(239, 68, 68, 0.25),
    0 40px 100px -12px rgba(0, 0, 0, 0.95),
    0 0 120px -20px rgba(239, 68, 68, 0.4);
}

/* Status row */
.scan-confirm-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.scan-confirm-icon {
  width: 26px;
  height: 26px;
  color: var(--success-color);
  filter: drop-shadow(0 0 8px rgba(16, 185, 129, 0.7));
  flex-shrink: 0;
}

.scan-confirm-card.error .scan-confirm-icon {
  color: var(--danger-color);
  filter: drop-shadow(0 0 8px rgba(239, 68, 68, 0.7));
}

.scan-confirm-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--success-color);
}

.scan-confirm-card.error .scan-confirm-label {
  color: var(--danger-color);
}

/* Product row */
.scan-confirm-product {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  width: 100%;
}

.scan-confirm-color {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  flex-shrink: 0;
  box-shadow: 0 8px 20px rgba(0,0,0,0.4);
}

.scan-confirm-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  min-width: 0;
  width: 100%;
}

.scan-confirm-name {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
  font-family: 'Outfit', sans-serif;
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin: 0;
  text-transform: none;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.scan-confirm-sku {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-secondary);
  font-family: monospace;
  letter-spacing: 0.05em;
  text-transform: none;
}

.scan-confirm-price-block {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 10px;
  margin-top: 4px;
}

.scan-confirm-price {
  font-size: 42px;
  font-weight: 900;
  color: var(--success-color);
  font-family: 'Outfit', sans-serif;
  letter-spacing: -0.04em;
  line-height: 1;
  filter: drop-shadow(0 0 12px rgba(16, 185, 129, 0.4));
}

.scan-confirm-qty {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.09);
  padding: 4px 10px;
  border-radius: 8px;
  line-height: 1;
}

/* Cart total row */
.scan-confirm-cart-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 12px 16px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
}

.scan-confirm-cart-total strong {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-primary);
  font-family: 'Outfit', sans-serif;
  letter-spacing: -0.02em;
}

/* Light theme */
body.light-theme .scan-confirm-card {
  background: linear-gradient(160deg,
    rgba(16, 185, 129, 0.12) 0%,
    rgba(255, 255, 255, 0.99) 45%
  ) !important;
  border-color: rgba(16, 185, 129, 0.38) !important;
  box-shadow:
    0 0 0 1px rgba(16, 185, 129, 0.15),
    0 30px 80px -15px rgba(99, 102, 241, 0.1),
    0 0 80px -30px rgba(16, 185, 129, 0.2) !important;
}

body.light-theme .scan-confirm-card.error {
  background: linear-gradient(160deg,
    rgba(239, 68, 68, 0.12) 0%,
    rgba(255, 255, 255, 0.99) 45%
  ) !important;
  border-color: rgba(239, 68, 68, 0.38) !important;
  box-shadow:
    0 0 0 1px rgba(239, 68, 68, 0.15),
    0 30px 80px -15px rgba(99, 102, 241, 0.1),
    0 0 80px -30px rgba(239, 68, 68, 0.2) !important;
}

body.light-theme .scan-confirm-cart-total {
  background: rgba(0,0,0,0.04);
  border-color: rgba(0,0,0,0.08);
}

body.light-theme .scan-confirm-qty {
  background: rgba(0, 0, 0, 0.05);
  color: var(--text-secondary);
}

/*  */
@media (max-width: 480px) {
  .scan-confirm-card {
    padding: 24px 20px 20px;
    border-radius: 22px;
  }
  .scan-confirm-name  { font-size: 18px; }
  .scan-confirm-price { font-size: 34px; }
}

/* Progress Bar container */
.scan-confirm-progress {
  position: absolute;
  bottom: 2.5px;
  left: 2.5px;
  right: 2.5px;
  height: 6px;
  overflow: hidden;
  border-bottom-left-radius: 29px;
  border-bottom-right-radius: 29px;
  background: rgba(255, 255, 255, 0.05);
}

.scan-confirm-progress-fill {
  height: 100%;
  width: 100%;
  background: var(--success-color);
  box-shadow: 0 0 10px var(--success-color);
  transform-origin: left;
  transform: scaleX(0);
}

.scan-confirm-card.show .scan-confirm-progress-fill {
  animation: scanConfirmProgressAnim 4.5s linear forwards;
}

.scan-confirm-card.error .scan-confirm-progress-fill {
  background: var(--danger-color);
  box-shadow: 0 0 10px var(--danger-color);
}

body.light-theme .scan-confirm-progress {
  background: rgba(0, 0, 0, 0.05);
}

@keyframes scanConfirmProgressAnim {
  from {
    transform: scaleX(1);
  }
  to {
    transform: scaleX(0);
  }
}

/* Responsive progress bar corner radius adjustments */
@media (max-width: 480px) {
  .scan-confirm-progress {
    border-bottom-left-radius: 19px;
    border-bottom-right-radius: 19px;
  }
}

/* ==========================================================================
   SCAN HISTORY (inside barcode modal)
   ========================================================================== */

.barcode-scan-history {
  border: 1px solid rgba(16, 185, 129, 0.15);
  border-radius: 14px;
  overflow: hidden;
}

.barcode-history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 14px;
  background: rgba(16, 185, 129, 0.07);
  border-bottom: 1px solid rgba(16, 185, 129, 0.1);
}

.barcode-history-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--success-color);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.barcode-history-clear {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-secondary);
  background: none;
  border: none;
  cursor: pointer;
  padding: 3px 7px;
  border-radius: 6px;
  transition: all 0.15s ease;
}

.barcode-history-clear:hover {
  color: var(--danger-color);
  background: rgba(239, 68, 68, 0.1);
}

.barcode-history-list {
  max-height: 190px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

/* Each history row */
.barcode-history-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  transition: background 0.15s ease;
  animation: historyItemIn 0.25s cubic-bezier(0.34, 1.4, 0.64, 1);
}

@keyframes historyItemIn {
  from { opacity: 0; transform: translateX(-10px); }
  to   { opacity: 1; transform: translateX(0); }
}

.barcode-history-item:last-child { border-bottom: none; }

.barcode-history-item:hover { background: rgba(255,255,255,0.03); }

.barcode-history-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.barcode-history-item-name {
  flex: 1;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-transform: none;
}

.barcode-history-item-qty {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  background: rgba(255,255,255,0.07);
  padding: 2px 6px;
  border-radius: 5px;
  white-space: nowrap;
}

.barcode-history-item-price {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--success-color);
  white-space: nowrap;
  font-family: 'Outfit', sans-serif;
}

.barcode-history-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: rgba(255,255,255,0.025);
  border-top: 1px solid rgba(255,255,255,0.06);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
}

.barcode-history-total {
  font-size: 13px;
  font-weight: 800;
  color: var(--text-primary);
  font-family: 'Outfit', sans-serif;
}

/* Legacy classes kept for compatibility */
.barcode-scanner-banner {
  background: linear-gradient(135deg,
    rgba(16, 185, 129, 0.06) 0%,
    rgba(99, 102, 241, 0.06) 100%);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: var(--border-radius-lg);
  padding: 14px 16px;
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color 0.3s ease, background 0.3s ease, box-shadow 0.3s ease;
  position: relative;
  overflow: hidden;
}

.barcode-scanner-banner.barcode-success-flash {
  border-color: rgba(16, 185, 129, 0.6) !important;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.12) 0%, rgba(16, 185, 129, 0.04) 100%) !important;
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.15), 0 0 0 1px rgba(16, 185, 129, 0.3);
  animation: barcodeSuccessPulse 0.4s ease;
}

.barcode-scanner-banner.barcode-error-flash {
  border-color: rgba(239, 68, 68, 0.6) !important;
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.10) 0%, rgba(239, 68, 68, 0.03) 100%) !important;
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.15), 0 0 0 1px rgba(239, 68, 68, 0.3);
  animation: barcodeErrorShake 0.35s ease;
}

@keyframes barcodeSuccessPulse {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.008); }
  100% { transform: scale(1); }
}

@keyframes barcodeErrorShake {
  0%, 100% { transform: translateX(0); }
  20%       { transform: translateX(-4px); }
  40%       { transform: translateX(4px); }
  60%       { transform: translateX(-4px); }
  80%       { transform: translateX(4px); }
}

.barcode-scanner-status {
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
}

.barcode-pulse-ring {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid rgba(16, 185, 129, 0.35);
  animation: barcodePulseRing 2s infinite ease-out;
  pointer-events: none;
}

@keyframes barcodePulseRing {
  0%   { transform: translateY(-50%) scale(0.85); opacity: 0.8; }
  60%  { transform: translateY(-50%) scale(1.35); opacity: 0; }
  100% { transform: translateY(-50%) scale(1.35); opacity: 0; }
}

.barcode-icon-main {
  width: 22px;
  height: 22px;
  color: #10b981;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 0 6px rgba(16, 185, 129, 0.5));
}

.barcode-status-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  flex: 1;
  min-width: 0;
}

.barcode-label {
  font-size: 11px;
  font-weight: 800;
  color: #10b981;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.barcode-sublabel {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-transform: none;
}

.barcode-toggle-wrapper {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-shrink: 0;
}

.barcode-toggle-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.barcode-toggle-btn {
  width: 40px;
  height: 22px;
  border-radius: 11px;
  background-color: var(--border-color);
  border: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
  position: relative;
  transition: background-color 0.25s ease, box-shadow 0.25s ease;
  padding: 0;
  flex-shrink: 0;
}

.barcode-toggle-btn.active {
  background-color: #10b981;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.4);
}

.barcode-toggle-circle {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.barcode-toggle-btn.active .barcode-toggle-circle {
  transform: translateX(18px);
}

.barcode-input-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.barcode-input-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: var(--border-radius-md);
  padding: 0 12px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.barcode-input-wrapper:focus-within {
  border-color: rgba(16, 185, 129, 0.5);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.12);
  background: rgba(16, 185, 129, 0.04);
}

.barcode-input-wrapper > i {
  width: 16px;
  height: 16px;
  color: #10b981;
  flex-shrink: 0;
}

.barcode-input-field {
  flex: 1;
  background: none !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  padding: 10px 0 !important;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  font-family: var(--font-primary);
  text-transform: none !important;
  letter-spacing: 0.02em;
}

.barcode-input-field::placeholder {
  font-size: 12px;
  font-weight: 400;
  color: var(--text-secondary);
  opacity: 0.7;
  text-transform: none !important;
}

.barcode-input-field:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.barcode-kbd-hint {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-bottom-width: 2px;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
  white-space: nowrap;
  flex-shrink: 0;
  font-family: monospace;
}

.barcode-last-scan {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--success-color);
  padding: 0 2px;
  text-transform: none;
}

.barcode-last-scan span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-transform: none !important;
}

body.light-theme .barcode-scanner-banner {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.05) 0%, rgba(99, 102, 241, 0.04) 100%);
  border-color: rgba(16, 185, 129, 0.25);
}

body.light-theme .barcode-input-wrapper {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(16, 185, 129, 0.25);
}

body.light-theme .barcode-kbd-hint {
  background: rgba(0, 0, 0, 0.05);
  border-color: rgba(0, 0, 0, 0.12);
  color: var(--text-secondary);
}

@media (max-width: 576px) {
  .barcode-scanner-banner {
    padding: 10px 12px;
  }
  .barcode-toggle-label {
    display: none;
  }
  .barcode-kbd-hint {
    display: none;
  }
}

/* Barcode Label Modal Screen Layout Fixes */
.label-controls-panel label {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 10px !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  color: var(--text-primary) !important;
  cursor: pointer !important;
  user-select: none !important;
  text-align: left !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 4px 0 !important;
}

.label-controls-panel input[type="radio"],
.label-controls-panel input[type="checkbox"] {
  width: 18px !important;
  height: 18px !important;
  flex-shrink: 0 !important;
  cursor: pointer !important;
  margin: 0 !important;
  padding: 0 !important;
  accent-color: var(--accent-color) !important;
}

.label-controls-panel span {
  flex-grow: 1 !important;
  text-align: left !important;
  line-height: 1.3 !important;
}

/* Configurable barcode-label workspace. */
.label-config-modal-card { max-height: 96dvh; overflow: hidden; }
.label-config-modal-card .modal-body { overflow: hidden; padding: 18px 22px; }
.label-config-modal-card .label-generator-layout { grid-template-columns: minmax(620px, 1.12fr) minmax(470px, .88fr) !important; gap: 18px !important; min-height: 0; }
.label-config-modal-card .label-controls-panel { max-height: 73dvh; overflow-y: auto; align-content: start; gap: 13px !important; padding: 16px !important; scrollbar-gutter: stable; }
.label-config-modal-card .label-preview-panel { position: sticky; top: 0; align-self: start; min-height: 650px !important; padding: 18px !important; }
.label-config-modal-card .modal-footer-actions { flex-wrap: wrap; }
.label-config-section { display: grid; gap: 11px; padding: 14px; border: 1px solid var(--border-color); border-radius: var(--border-radius-md); background: rgba(var(--accent-color-rgb), .035); }
.label-config-section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding-bottom: 7px; border-bottom: 1px solid var(--border-color); }
.label-config-section-title span { font-size: 13px; font-weight: 800; color: var(--text-primary); }
.label-config-section-title small { font-size: 10px; color: var(--text-secondary); }
.label-profile-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(150px, .75fr); gap: 8px; }
.label-profile-row input,
.label-job-grid input,
.label-measure-grid input,
.label-contact-grid input { width: 100%; min-width: 0; height: 36px; padding: 7px 10px; border: 1px solid var(--border-color); border-radius: var(--border-radius-sm); background: var(--bg-tertiary); color: var(--text-primary); box-sizing: border-box; }
.label-profile-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.label-profile-actions .btn { min-height: 34px; padding: 6px 9px; font-size: 10.5px; }
.label-profile-actions .btn svg { width: 14px; height: 14px; }
.label-controls-panel .label-field-wide,
.label-controls-panel .label-batch-search-field,
.label-controls-panel .label-job-grid label,
.label-controls-panel .label-measure-grid label,
.label-controls-panel .label-printer-grid label,
.label-controls-panel .label-contact-grid label { display: grid !important; align-items: initial !important; gap: 4px !important; width: auto !important; padding: 0 !important; cursor: default !important; font-size: 9.5px !important; font-weight: 700 !important; color: var(--text-secondary) !important; }
.label-controls-panel .label-field-wide { gap: 5px !important; font-size: 10.5px !important; }
.label-controls-panel .label-batch-search-field { display: grid !important; gap: 5px !important; padding: 0 !important; color: var(--text-secondary) !important; font-size: 10.5px !important; font-weight: 700 !important; }
.label-batch-search-wrap { position: relative; display: flex; align-items: center; }
.label-batch-search-wrap > svg { position: absolute; left: 11px; width: 15px; height: 15px; color: var(--text-secondary); pointer-events: none; }
.label-batch-search-wrap input { width: 100%; height: 40px; padding: 8px 38px 8px 34px; border: 1px solid var(--border-color); border-radius: var(--border-radius-sm); background: var(--bg-tertiary); color: var(--text-primary); font-size: 11.5px; box-sizing: border-box; }
.label-batch-search-wrap input:focus { outline: none; border-color: var(--accent-color); box-shadow: 0 0 0 2px rgba(var(--accent-color-rgb), .12); }
.label-batch-search-wrap button { position: absolute; right: 6px; width: 28px; height: 28px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 7px; background: transparent; color: var(--text-secondary); cursor: pointer; }
.label-batch-search-wrap button:hover { background: var(--bg-secondary); color: var(--text-primary); }
.label-batch-search-wrap button svg { width: 14px; height: 14px; }
.label-job-grid { display: grid; grid-template-columns: minmax(0, 1fr) 120px auto; gap: 10px; align-items: end; }
.label-job-grid select,
.label-printer-grid select { width: 100%; min-width: 0; height: 38px; padding: 7px 30px 7px 10px; }
.label-batch-add-btn { min-height: 38px; padding: 7px 12px; white-space: nowrap; }
.label-batch-add-btn svg { width: 15px; height: 15px; }
.label-field-help { margin: -2px 0 0; color: var(--text-secondary); font-size: 9.5px; }
.label-scanner-hint { display: flex; align-items: center; gap: 7px; margin: 0; padding: 8px 10px; border: 1px solid rgba(16,185,129,.22); border-radius: var(--border-radius-sm); background: rgba(16,185,129,.08); color: #047857; font-size: 10px; font-weight: 700; line-height: 1.3; }
.label-scanner-hint svg { width: 15px; height: 15px; flex: 0 0 auto; }
.label-batch-list { display: grid; gap: 7px; max-height: 220px; overflow-y: auto; padding-right: 3px; }
.label-batch-empty { padding: 14px; border: 1px dashed var(--border-color); border-radius: var(--border-radius-sm); color: var(--text-secondary); font-size: 10.5px; text-align: center; }
.label-batch-item { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 9px; padding: 8px 9px; border: 1px solid var(--border-color); border-radius: var(--border-radius-sm); background: var(--bg-secondary); }
.label-batch-product { min-width: 0; display: grid; gap: 2px; }
.label-batch-product strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-primary); font-size: 11px; }
.label-batch-product small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-secondary); font-size: 9px; }
.label-batch-qty { display: flex; align-items: center; gap: 5px; }
.label-batch-qty button,
.label-batch-remove { width: 28px; height: 28px; display: inline-grid; place-items: center; padding: 0; border: 1px solid var(--border-color); border-radius: 8px; background: var(--bg-tertiary); color: var(--text-primary); cursor: pointer; }
.label-batch-qty button:hover { border-color: var(--accent-color); color: var(--accent-color); }
.label-batch-remove:hover { border-color: var(--danger-color); color: var(--danger-color); }
.label-batch-qty span { min-width: 25px; text-align: center; font-size: 12px; font-weight: 800; color: var(--text-primary); }
.label-batch-item svg { width: 14px; height: 14px; }
.label-batch-footer { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding-top: 8px; border-top: 1px solid var(--border-color); }
.label-batch-footer > span { color: var(--text-primary); font-size: 10.5px; font-weight: 800; }
.label-batch-footer .btn { min-height: 32px; padding: 5px 9px; font-size: 10px; }
.label-paper-groups { display: grid; gap: 9px; }
.label-config-subgroup { display: grid; gap: 8px; padding: 11px; border: 1px solid var(--border-color); border-radius: 10px; background: var(--bg-secondary); }
.label-config-subgroup > strong { font-size: 10.5px; color: var(--text-primary); }
.label-config-subgroup > small { margin-top: -4px; font-size: 9px; line-height: 1.35; color: var(--text-secondary); }
.label-measure-grid { display: grid; grid-template-columns: repeat(4, minmax(105px, 1fr)); gap: 9px; }
.label-appearance-grid { grid-template-columns: repeat(5, minmax(90px, 1fr)); }
.label-measure-grid label { position: relative; }
.label-measure-grid label > small { position: absolute; right: 9px; bottom: 10px; z-index: 1; font-size: 8.5px; font-weight: 700; color: var(--text-secondary); pointer-events: none; }
.label-measure-grid label:has(> small) input { padding-right: 28px; }
.label-measure-grid select { width: 100%; min-width: 0; height: 36px; padding: 6px 28px 6px 9px; font-size: 11px; }
#barcode-label-modal input[type="number"] { appearance: textfield; -moz-appearance: textfield; }
#barcode-label-modal input[type="number"]::-webkit-inner-spin-button,
#barcode-label-modal input[type="number"]::-webkit-outer-spin-button { margin: 0; -webkit-appearance: none; }
.label-number-stepper { display: grid; grid-template-columns: 34px minmax(28px, 1fr) 34px; align-items: center; width: 100%; min-width: 0; height: 40px; overflow: hidden; border: 1px solid var(--border-color); border-radius: var(--border-radius-sm); background: var(--bg-tertiary); box-sizing: border-box; }
.label-number-stepper:has(.label-stepper-unit) { grid-template-columns: 34px minmax(28px, 1fr) auto 34px; }
.label-number-stepper:focus-within { border-color: var(--accent-color); box-shadow: 0 0 0 2px rgba(var(--accent-color-rgb), .12); }
.label-number-stepper input[type="number"] { width: 100% !important; min-width: 0 !important; height: 38px !important; padding: 6px 3px !important; border: 0 !important; border-radius: 0 !important; outline: 0 !important; background: transparent !important; box-shadow: none !important; color: var(--text-primary); font-weight: 800; text-align: center; }
.label-stepper-button { display: grid; place-items: center; width: 34px; height: 100%; padding: 0; border: 0; background: var(--bg-secondary); color: var(--text-primary); font: 800 20px/1 Arial, sans-serif; cursor: pointer; transition: background-color .15s ease, color .15s ease; }
.label-stepper-button:hover { background: rgba(var(--accent-color-rgb), .12); color: var(--accent-color); }
.label-stepper-button:active { background: rgba(var(--accent-color-rgb), .2); }
.label-stepper-button:focus-visible { position: relative; z-index: 1; outline: 2px solid var(--accent-color); outline-offset: -3px; }
.label-stepper-decrease { border-right: 1px solid var(--border-color); }
.label-stepper-increase { border-left: 1px solid var(--border-color); }
.label-stepper-unit { position: static !important; right: auto !important; bottom: auto !important; z-index: auto !important; padding: 0 5px; color: var(--text-secondary); font-size: 8.5px; font-weight: 700; white-space: nowrap; pointer-events: none; }
.label-printer-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.label-content-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.label-controls-panel .label-content-options label { display: flex !important; align-items: center !important; gap: 7px !important; width: auto !important; min-height: 31px; padding: 6px 8px !important; border: 1px solid var(--border-color); border-radius: var(--border-radius-sm); background: var(--bg-secondary); color: var(--text-primary) !important; font-size: 10.5px !important; cursor: pointer !important; }
.label-content-options input { accent-color: var(--accent-color); }
.label-contact-subgroup { margin-top: 2px; }
.label-contact-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; align-items: end; }
.label-controls-panel .label-contact-grid label { font-size: 10.5px !important; }
.label-contact-grid input { height: 40px; padding: 8px 11px; font-size: 12.5px; font-weight: 600; }
.label-geometry-summary { min-height: 34px; padding: 8px 10px; border-radius: var(--border-radius-sm); background: rgba(16,185,129,.08); color: #059669; font-size: 10px; font-weight: 700; line-height: 1.35; }
.label-geometry-summary.invalid { background: rgba(239,68,68,.09); color: var(--danger-color); }
.label-preview-surface { width: 100%; min-height: 500px; display: grid; place-items: center; overflow: auto; padding: 24px; border-radius: var(--border-radius-md); background: repeating-linear-gradient(45deg, rgba(255,255,255,.022), rgba(255,255,255,.022) 8px, transparent 8px, transparent 16px); box-sizing: border-box; }
.label-preview-stage { display: grid; place-items: center; flex: 0 0 auto; transition: width .18s ease, height .18s ease; }
#live-label-preview-sticker { transform-origin: center center; transition: transform .18s ease, width .18s ease, height .18s ease; }
.label-preview-meta { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; color: var(--text-secondary); font-size: 10px; }
.label-preview-meta span { padding: 4px 7px; border: 1px solid var(--border-color); border-radius: 999px; background: var(--bg-secondary); }
@media (max-width: 1180px) {
  .label-config-modal-card { width: 98% !important; max-height: 96dvh; }
  .label-config-modal-card .modal-body { overflow-y: auto; }
  .label-config-modal-card .label-generator-layout { grid-template-columns: 1fr !important; }
  .label-config-modal-card .label-controls-panel { max-height: none; overflow: visible; }
  .label-config-modal-card .label-preview-panel { position: static; min-height: 560px !important; }
}
@media (max-width: 720px) {
  .label-measure-grid,
  .label-appearance-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .label-content-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .label-profile-row,
  .label-job-grid,
  .label-measure-grid,
  .label-printer-grid,
  .label-contact-grid,
  .label-content-options { grid-template-columns: 1fr; }
  .label-preview-surface { min-height: 390px; padding: 14px; }
  .label-batch-item { grid-template-columns: minmax(0, 1fr) auto; }
  .label-batch-product { grid-column: 1 / -1; }
}

/* ==========================================================================
   EAN-13 BARCODE LABEL PRINT SYSTEM (v1.32)
   ========================================================================== */

/* 1. Screen-only wrapper hidden by default (Render off-screen to ensure JsBarcode calculations work 100%) */
#print-labels-container {
  position: absolute !important;
  left: -9999mm !important;
  top: -9999mm !important;
  display: block !important;
}

/* 2. Print styles */
@media print {
  /* Hide only specific UI layers of Lojix, NOT html and body itself */
  .auth-container, 
  .app-container > *:not(.modal-overlay), 
  .modal-overlay:not(.active), 
  .toast-container, 
  #toast-container {
    display: none !important;
  }

  html, body {
    display: block !important;
    background: #ffffff !important;
    color: #000000 !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    height: auto !important;
  }

  /* Only show the print label container */
  #print-labels-container, #print-labels-container * {
    display: block !important;
  }

  #print-labels-container {
    display: block !important;
    position: absolute !important;
    left: 0 !important;
    top: 0 !important;
    width: 100% !important;
    height: auto !important;
    background: #ffffff !important;
    color: #000000 !important;
    margin: 0 !important;
    padding: 0 !important;
    z-index: 9999999 !important;
  }

  /* [A] IMPRESSORA TÉRMICA DE ROLO (40mm x 30mm) */
  .print-mode-roll {
    width: 40mm !important;
    height: 30mm !important;
  }

  .print-mode-roll .print-label-item {
    width: 40mm !important;
    height: 30mm !important;
    box-sizing: border-box !important;
    padding: 2mm 3mm !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    background: #ffffff !important;
    color: #000000 !important;
    text-align: center !important;
    page-break-after: always !important;
    break-after: page !important;
    overflow: hidden !important;
  }

  /* [B] FOLHA ADESIVA A4 (Grade de 3 Colunas) */
  .print-mode-a4 {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 3mm !important;
    padding: 5mm !important;
    box-sizing: border-box !important;
    background: #ffffff !important;
  }

  .print-mode-a4 .print-label-item {
    height: 32mm !important; /* Standard Pimaco labels size */
    box-sizing: border-box !important;
    padding: 3mm 4mm !important;
    border: 1px dashed #dddddd !important; /* Cut margins */
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    background: #ffffff !important;
    color: #000000 !important;
    text-align: center !important;
    overflow: hidden !important;
  }

  /* Label elements typography during printing */
  .print-label-item .print-store-name {
    font-size: 7pt !important;
    font-weight: 800 !important;
    letter-spacing: 0.3px !important;
    text-transform: uppercase !important;
    border-bottom: 0.5px solid #000000 !important;
    width: 100% !important;
    text-align: center !important;
    margin-bottom: 1.5mm !important;
    line-height: 1 !important;
    color: #000000 !important;
  }

  .print-label-item .print-product-name {
    font-size: 8pt !important;
    font-weight: 700 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    width: 100% !important;
    text-align: center !important;
    line-height: 1.1 !important;
    color: #000000 !important;
  }

  .print-label-item .print-specs {
    font-size: 6.5pt !important;
    font-weight: 500 !important;
    color: #444444 !important;
    text-align: center !important;
    width: 100% !important;
    line-height: 1.1 !important;
    margin-bottom: 1mm !important;
  }

  .print-label-item .print-barcode-svg {
    width: 100% !important;
    max-height: 10mm !important;
    margin: 1mm 0 !important;
  }

  .print-label-item .print-price {
    font-size: 9pt !important;
    font-weight: 800 !important;
    border-top: 0.5px dashed #000000 !important;
    width: 100% !important;
    text-align: center !important;
    padding-top: 1mm !important;
    margin-top: 1mm !important;
    line-height: 1 !important;
    color: #000000 !important;
  }
}

@keyframes pulseGlow {
  0% {
    box-shadow: 0 0 8px rgba(236, 72, 153, 0.2);
    border-color: rgba(236, 72, 153, 0.25);
  }
  100% {
    box-shadow: 0 0 18px rgba(236, 72, 153, 0.45);
    border-color: rgba(236, 72, 153, 0.5);
  }
}

/* Employee Mode Dashboard Layout */
#view-dashboard.employee-mode #dash-revenue-card,
#view-dashboard.employee-mode #dash-profit-card,
#view-dashboard.employee-mode #dash-trend-chart-card {
  display: none !important;
}

@media (min-width: 1025px) {
  #view-dashboard.employee-mode #dash-category-chart-card,
  #view-dashboard.employee-mode #dash-alerts-card {
    grid-column: span 6 !important;
  }
}

@media (max-width: 1024px) {
  #view-dashboard.employee-mode #dash-category-chart-card,
  #view-dashboard.employee-mode #dash-alerts-card {
    grid-column: span 12 !important;
  }
}

/* Commission Seller Detail Header */
.commission-seller-header {
  display: none;
  margin-bottom: 20px;
  padding: 14px 20px;
  background: rgba(99, 102, 241, 0.08);
  border-left: 4px solid var(--accent-color);
  border-radius: var(--border-radius-md);
  border-top: 1px solid rgba(255, 255, 255, 0.03);
  border-right: 1px solid rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.commission-seller-header span {
  font-size: 11px;
  font-weight: 750;
  text-transform: uppercase;
  color: var(--accent-color);
  display: block;
  letter-spacing: 0.08em;
}

.commission-seller-header h3 {
  margin: 4px 0 0;
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
  font-family: 'Outfit', sans-serif;
  letter-spacing: -0.02em;
}

/* Light Theme overrides */
body.light-theme .commission-seller-header {
  background: rgba(99, 102, 241, 0.05);
  border-top-color: rgba(0, 0, 0, 0.03);
  border-right-color: rgba(0, 0, 0, 0.03);
  border-bottom-color: rgba(0, 0, 0, 0.03);
}

/* Exchange & Return Management Custom Styles */
.search-results-dropdown div {
  padding: 10px 12px;
  cursor: pointer;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  transition: background 0.15s ease, color 0.15s ease;
}

.search-results-dropdown div:hover {
  background: rgba(99, 102, 241, 0.15);
  color: var(--accent-color);
}

body.light-theme .search-results-dropdown {
  background: #ffffff !important;
  border-color: #cbd5e1 !important;
}

body.light-theme .search-results-dropdown div {
  border-bottom-color: #f1f5f9;
  color: #334155;
}

body.light-theme .search-results-dropdown div:hover {
  background: #f1f5f9;
  color: var(--accent-color);
}

.exchange-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  transition: all 0.2s ease;
}

.exchange-item-row.active {
  background: rgba(99, 102, 241, 0.05);
  border-color: rgba(99, 102, 241, 0.3);
}

body.light-theme .exchange-item-row {
  background: #f8fafc;
}

body.light-theme .exchange-item-row.active {
  background: #e0e7ff;
  border-color: #818cf8;
}

.badge-exchange {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 9999px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.badge-exchange-success {
  background-color: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-exchange-danger {
  background-color: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge-exchange-neutral {
  background-color: rgba(148, 163, 184, 0.15);
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.3);
}


/* Exchange & Return Management Custom Styles */
.search-results-dropdown div {
  padding: 10px 12px;
  cursor: pointer;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  transition: background 0.15s ease, color 0.15s ease;
}

.search-results-dropdown div:hover {
  background: rgba(99, 102, 241, 0.15);
  color: var(--accent-color);
}

body.light-theme .search-results-dropdown {
  background: #ffffff !important;
  border-color: #cbd5e1 !important;
}

body.light-theme .search-results-dropdown div {
  border-bottom-color: #f1f5f9;
  color: #334155;
}

body.light-theme .search-results-dropdown div:hover {
  background: #f1f5f9;
  color: var(--accent-color);
}

.exchange-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  transition: all 0.2s ease;
}

.exchange-item-row.active {
  background: rgba(99, 102, 241, 0.05);
  border-color: rgba(99, 102, 241, 0.3);
}

body.light-theme .exchange-item-row {
  background: #f8fafc;
}

body.light-theme .exchange-item-row.active {
  background: #e0e7ff;
  border-color: #818cf8;
}

.badge-exchange {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 9999px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.badge-exchange-success {
  background-color: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-exchange-danger {
  background-color: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge-exchange-neutral {
  background-color: rgba(148, 163, 184, 0.15);
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.3);
}

/* --- Modal Tabbed Navigation & Color Chips --- */
.modal-tab-nav {
  scrollbar-width: none;
}
.modal-tab-nav::-webkit-scrollbar {
  display: none;
}
.tab-nav-item:hover {
  color: var(--text-primary) !important;
  border-bottom-color: rgba(var(--accent-color-rgb), 0.3) !important;
}
.tab-nav-item.active {
  color: var(--accent-color) !important;
  border-bottom-color: var(--accent-color) !important;
}
/* --- Performance Dashboard Premium Styling --- */
.perf-section-group {
  border-top: 1px solid var(--border-color);
  padding-top: 28px;
  margin-top: 28px;
}

.perf-section-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: -0.02em;
}

.perf-section-title i {
  color: var(--accent-color);
  width: 18px;
  height: 18px;
}

/* Tabular figures for monospaced number look in stats */
.tabular-nums {
  font-variant-numeric: tabular-nums;
}

/* Sleek Tables styling */
.perf-table-card {
  padding: 24px !important;
  border-radius: var(--border-radius-lg) !important;
  box-shadow: var(--glass-shadow);
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.perf-table-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.05), var(--glass-shadow);
}

.perf-table-card table.data-table {
  width: 100%;
  border-collapse: collapse;
}

.perf-table-card table.data-table th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  padding: 12px 14px;
  border-bottom: 2px solid var(--border-color);
  font-weight: 700;
}

.perf-table-card table.data-table td {
  padding: 12px 14px;
  font-size: 13px;
  border-bottom: 1px solid var(--border-color);
  transition: background var(--transition-fast), color var(--transition-fast);
}

.perf-table-card table.data-table tr:last-child td {
  border-bottom: none;
}

.perf-table-card table.data-table tr:hover td {
  background: rgba(var(--accent-color-rgb), 0.03);
}

.perf-kpi-card {
  position: relative;
  overflow: hidden;
  padding: 24px;
  border-radius: var(--border-radius-lg);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  transition: transform var(--transition-normal), box-shadow var(--transition-normal), border-color var(--transition-normal);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  cursor: default;
}

.perf-kpi-card:hover {
  transform: none;
  border-color: rgba(var(--accent-color-rgb), 0.35);
  box-shadow: var(--glass-shadow);
}

.perf-kpi-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.perf-kpi-title {
  font-size: 11px;
  color: var(--text-secondary);
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0;
}

.perf-kpi-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(var(--accent-color-rgb), 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-color);
  transition: background var(--transition-fast), color var(--transition-fast);
}

.perf-kpi-card:hover .perf-kpi-icon {
  background: var(--accent-gradient);
  color: var(--text-inverse);
}

.perf-kpi-icon i {
  width: 14px;
  height: 14px;
}

.perf-kpi-value {
  font-size: 26px;
  font-weight: 850;
  color: var(--text-primary);
  font-family: 'Outfit', sans-serif;
  letter-spacing: 0;
  line-height: 1.1;
}

.perf-kpi-help {
  min-height: 34px;
  color: var(--text-secondary);
  font-size: 10.5px;
  line-height: 1.35;
  font-weight: 500;
}

.perf-comparison-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.perf-comparison-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  border-radius: var(--border-radius-md);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  transition: all var(--transition-fast);
}

.perf-comparison-item:hover {
  background: rgba(var(--accent-color-rgb), 0.02);
  border-color: rgba(var(--accent-color-rgb), 0.2);
}

/* Responsive adjust for Grid layout 3 */

/* Responsive adjust for Grid layout 3 */
@media (max-width: 1200px) {
  .grid-layout-3 {
    grid-template-columns: 1fr 1fr !important;
  }
}
@media (max-width: 768px) {
  .grid-layout-2, .grid-layout-3 {
    grid-template-columns: 1fr !important;
  }
}

/* Dashboard Tabs styling */
.dashboard-tabs .tab-btn {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  padding: 10px 20px;
  font-size: 13.5px;
  font-weight: 700;
  border-radius: var(--border-radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 8px;
}

.dashboard-tabs .tab-btn.active {
  background: var(--accent-color);
  color: white;
  border-color: var(--accent-color);
  box-shadow: 0 4px 12px var(--accent-glow);
}

.dashboard-tabs .tab-btn:hover:not(.active) {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.dashboard-tab-content {
  animation: fadeIn var(--transition-fast) ease-in-out;
}

/* --- Analises Hub --- */
.analises-tab-nav {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px;
  margin-bottom: 18px;
  border-radius: var(--border-radius-md);
  border: 1px solid var(--glass-border);
}

.analises-tab-btn {
  min-height: 38px;
  padding: 8px 14px;
  border: 1px solid transparent;
  border-radius: var(--border-radius-sm);
  background: transparent;
  color: var(--text-secondary);
  font-size: 12.5px;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: all var(--transition-fast);
}

.analises-tab-btn i {
  width: 15px;
  height: 15px;
}

.analises-tab-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.06);
}

.analises-tab-btn.active {
  color: var(--text-primary);
  background: rgba(var(--accent-color-rgb), 0.12);
  border-color: rgba(var(--accent-color-rgb), 0.22);
}

.analises-pane {
  animation: fadeIn var(--transition-fast) ease-in-out;
}

/* --- Decisions Panel --- */
.decision-hero {
  padding: 24px;
  margin-bottom: 18px;
  border-radius: var(--border-radius-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.decision-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent-color);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
  margin-bottom: 8px;
}

.decision-eyebrow i {
  width: 14px;
  height: 14px;
}

.decision-hero h3 {
  font-size: 24px;
  line-height: 1.15;
  margin: 0 0 6px;
  color: var(--text-primary);
  font-family: 'Outfit', sans-serif;
  letter-spacing: 0;
}

.decision-hero p {
  margin: 0;
  max-width: 760px;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.45;
}

.decision-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.decision-kpi-card {
  padding: 18px;
  border-radius: var(--border-radius-lg);
  border: 1px solid var(--glass-border);
}

.decision-kpi-label {
  display: block;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
  margin-bottom: 10px;
}

.decision-kpi-card strong {
  display: block;
  color: var(--text-primary);
  font-family: 'Outfit', sans-serif;
  font-size: 25px;
  line-height: 1.1;
  letter-spacing: 0;
}

.decision-kpi-card small {
  display: block;
  margin-top: 8px;
  color: var(--text-secondary);
  font-size: 11px;
  line-height: 1.35;
}

.decision-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.decision-card {
  padding: 22px;
  border-radius: var(--border-radius-lg);
  border: 1px solid var(--glass-border);
  min-width: 0;
}

.decision-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.decision-card-header h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 5px;
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 850;
  letter-spacing: 0;
}

.decision-card-header h3 i {
  width: 16px;
  height: 16px;
  color: var(--accent-color);
}

.decision-card-header p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 11.5px;
  line-height: 1.35;
}

.decision-priority-tag {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
  border: 1px solid transparent;
}

.decision-priority-tag.urgent {
  color: #dc2626;
  background: rgba(220, 38, 38, 0.08);
  border-color: rgba(220, 38, 38, 0.18);
}

.decision-priority-tag.warning {
  color: #b45309;
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.22);
}

.decision-priority-tag.success {
  color: #047857;
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.22);
}

.decision-priority-tag.neutral {
  color: var(--accent-color);
  background: rgba(var(--accent-color-rgb), 0.08);
  border-color: rgba(var(--accent-color-rgb), 0.18);
}

.decision-table th,
.decision-table td {
  white-space: nowrap;
}

.decision-table td:first-child {
  white-space: normal;
  min-width: 160px;
}

.decision-action-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 10.5px;
  font-weight: 800;
  color: var(--text-primary);
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
}

@media (max-width: 1200px) {
  .decision-kpi-grid,
  .decision-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .decision-hero {
    align-items: stretch;
    flex-direction: column;
  }

  .decision-kpi-grid,
  .decision-grid {
    grid-template-columns: 1fr;
  }
}

/* --- Support Ticket --- */
.support-ticket-btn {
  margin-right: 8px;
  background: rgba(var(--accent-color-rgb), 0.08);
  border-color: rgba(var(--accent-color-rgb), 0.18);
  color: var(--accent-color);
}

.support-ticket-btn:hover {
  background: rgba(var(--accent-color-rgb), 0.14);
  border-color: rgba(var(--accent-color-rgb), 0.32);
}

.support-ticket-modal-card {
  max-width: 780px;
  width: 94%;
}

.support-ticket-body {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(240px, 0.8fr);
  gap: 18px;
}

.support-ticket-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.support-ticket-preview {
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  background: rgba(255, 255, 255, 0.03);
  overflow: hidden;
}

.support-ticket-preview-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 11px;
}

.support-ticket-preview-header strong {
  color: var(--text-primary);
  font-size: 12px;
}

#support-ticket-report-preview {
  width: 100%;
  min-height: 180px;
  border: none;
  border-radius: 0;
  font-family: Consolas, 'Courier New', monospace;
  font-size: 11px;
  line-height: 1.45;
  resize: vertical;
}

.support-ticket-history {
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  background: rgba(255, 255, 255, 0.025);
  padding: 14px;
  min-width: 0;
}

.support-ticket-history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.support-ticket-history-header h4 {
  margin: 0;
  font-size: 13px;
  color: var(--text-primary);
}

.support-ticket-history-header span {
  color: var(--text-secondary);
  font-size: 10.5px;
  font-weight: 700;
}

.support-ticket-history-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
  max-height: 430px;
  overflow-y: auto;
}

.support-ticket-history-item {
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  padding: 10px;
  background: var(--bg-secondary);
}

.support-ticket-history-item strong {
  display: block;
  color: var(--text-primary);
  font-size: 12px;
  margin-bottom: 4px;
}

.support-ticket-history-item span {
  display: block;
  color: var(--text-secondary);
  font-size: 10.5px;
  line-height: 1.35;
}

.support-tickets-panel {
  margin-top: 24px;
}

.support-tickets-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 14px;
  margin-bottom: 16px;
}

.support-tickets-panel-header h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 5px;
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 850;
}

.support-tickets-panel-header h3 i {
  width: 17px;
  height: 17px;
  color: var(--accent-color);
}

.support-tickets-panel-header p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.4;
}

.support-ticket-filters {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.support-ticket-filters .custom-select {
  width: auto;
  min-width: 180px;
}

.support-ticket-panel-count {
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 800;
  margin-left: auto;
}

.support-ticket-status-select {
  min-width: 120px;
  padding: 7px 9px;
  border-radius: var(--border-radius-sm);
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-size: 11px;
  font-weight: 700;
}

.support-ticket-priority-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0;
}

.support-ticket-priority-badge.urgent,
.support-ticket-priority-badge.urgente,
.support-ticket-priority-badge.alta {
  color: #dc2626;
  background: rgba(220, 38, 38, 0.1);
}

.support-ticket-priority-badge.media {
  color: #b45309;
  background: rgba(245, 158, 11, 0.12);
}

.support-ticket-priority-badge.baixa {
  color: #047857;
  background: rgba(16, 185, 129, 0.12);
}

.support-ticket-action-btn {
  width: 30px;
  height: 30px;
  border-radius: var(--border-radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin-left: 5px;
  transition: all var(--transition-fast);
}

.support-ticket-action-btn:hover {
  color: var(--accent-color);
  border-color: rgba(var(--accent-color-rgb), 0.35);
  background: rgba(var(--accent-color-rgb), 0.08);
}

.support-ticket-action-btn i {
  width: 14px;
  height: 14px;
}

@media (max-width: 860px) {
  .support-ticket-body {
    grid-template-columns: 1fr;
  }

  .support-tickets-panel-header {
    flex-direction: column;
  }

  .support-ticket-panel-count {
    margin-left: 0;
  }
}

/* --- HEADER PROFILE DROPDOWN MENU (v2.89) --- */
.profile-dropdown-container {
  position: relative;
  display: inline-block;
}

.header-profile-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.header-profile-btn:hover {
  background-color: var(--bg-tertiary);
  border-color: var(--text-secondary);
}

.header-profile-btn i,
.header-profile-btn svg {
  width: 18px;
  height: 18px;
}

.profile-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 280px;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 1000;
  padding: 16px 0 8px 0;
}

.profile-dropdown.active {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.dropdown-user-info {
  padding: 0 20px 12px 20px;
  display: flex;
  flex-direction: column;
  text-align: left;
}

.dropdown-user-info .user-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.dropdown-user-info .user-email {
  font-size: 12px;
  color: var(--text-secondary);
  word-break: break-all;
}

.dropdown-divider {
  height: 1px;
  background-color: var(--border-color);
  margin: 8px 0;
}

.dropdown-menu-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.dropdown-menu-list li {
  padding: 0;
  margin: 0;
}

.dropdown-item {
  width: 100%;
  padding: 10px 20px;
  background: transparent;
  border: none;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-primary);
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 500;
  text-align: left;
  transition: background-color var(--transition-fast);
}

.dropdown-item:hover {
  background-color: var(--bg-tertiary);
}

.dropdown-item i,
.dropdown-item svg {
  width: 16px;
  height: 16px;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.dropdown-item.text-danger {
  color: var(--danger-color);
}

.dropdown-item.text-danger i,
.dropdown-item.text-danger svg {
  color: var(--danger-color);
}

.dropdown-item-badge {
  margin-left: auto;
  font-size: 11px;
  background-color: var(--bg-tertiary);
  color: var(--text-secondary);
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
}

.dropdown-item .external-icon {
  margin-left: auto;
  width: 12px;
  height: 12px;
  color: var(--text-secondary);
  opacity: 0.7;
}

/* --- GLOBAL APP INPUTS STYLE CONSISTENCY (v2.92) --- */
.app-container input,
.app-container select,
.app-container textarea,
.modal-overlay input,
.modal-overlay select,
.modal-overlay textarea {
  background-color: var(--bg-tertiary) !important;
  border: 1px solid var(--border-color) !important;
  color: var(--text-primary) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.50);
}

.app-container input::placeholder,
.modal-overlay input::placeholder {
  color: var(--text-secondary) !important;
  opacity: 0.68 !important;
}

.app-container input:focus,
.app-container select:focus,
.app-container textarea:focus,
.modal-overlay input:focus,
.modal-overlay select:focus,
.modal-overlay textarea:focus {
  border-color: var(--accent-color) !important;
  box-shadow: 0 0 0 3px var(--accent-glow) !important;
  outline: none !important;
}

/* Pulse green border animation for available credits container */
@keyframes pulse-border {
  0% {
    border-color: rgba(16, 185, 129, 0.3);
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.05);
  }
  50% {
    border-color: rgba(16, 185, 129, 0.7);
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.2);
  }
  100% {
    border-color: rgba(16, 185, 129, 0.3);
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.05);
  }
}

/* --- SKU ENGINE SPECIALIZED CLASSES --- */
.sku-engine-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 20px;
  align-items: start;
}

@media (max-width: 1024px) {
  .sku-engine-grid {
    grid-template-columns: 1fr;
  }
}

/* Reorderable structure item row */
.sku-structure-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  transition: all var(--transition-fast);
}

.sku-structure-item:hover {
  border-color: var(--accent-color);
}

.sku-structure-item-left {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
}

.sku-structure-item-left input[type="checkbox"] {
  accent-color: var(--accent-color);
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.sku-structure-item-actions {
  display: flex;
  gap: 4px;
}

.sku-structure-arrow-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  width: 24px;
  height: 24px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 11px;
  transition: all var(--transition-fast);
}

.sku-structure-arrow-btn:hover:not(:disabled) {
  border-color: var(--accent-color);
  color: var(--accent-color);
  background: var(--bg-tertiary);
}

.sku-structure-arrow-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* Toggle and options button styling */
.sku-case-btn, .sku-sep-btn, .sku-seq-type-btn, .sku-dict-tab-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  transition: all var(--transition-fast);
  cursor: pointer;
}

.sku-case-btn:hover, .sku-sep-btn:hover, .sku-seq-type-btn:hover, .sku-dict-tab-btn:hover {
  border-color: var(--accent-color);
  color: var(--accent-color);
}

.sku-case-btn.active, .sku-sep-btn.active, .sku-seq-type-btn.active, .sku-dict-tab-btn.active {
  background: var(--accent-color) !important;
  border-color: var(--accent-color) !important;
  color: var(--text-inverse) !important;
}

/* Badge styling for attributes in queue table */
.sku-attr-tag {
  display: inline-block;
  padding: 2px 6px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  margin-right: 4px;
  margin-bottom: 4px;
  color: var(--text-primary);
}

.sku-attr-tag-label {
  color: var(--text-secondary);
  font-weight: 600;
  margin-right: 2px;
}

/* Monospace fonts for code elements */
.sku-monospace-code {
  font-family: 'Courier New', Courier, monospace;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.dict-action-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: all var(--transition-fast);
}

.dict-action-btn:hover {
  background: var(--bg-tertiary);
}

/* --- Unified floating surfaces: modals, popups, dropdowns --- */
.modal-overlay,
.barcode-modal-overlay,
#atendimento-modal,
#custom-confirm-modal,
#custom-alert-modal {
  background: var(--overlay-bg) !important;
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
}

.modal-card,
.barcode-modal-card,
.profile-dropdown,
.app-dropdown-menu,
.search-results-dropdown,
#atendimento-modal > div,
.scan-confirm-card {
  background: var(--glass-bg) !important;
  background-image: none !important;
  border: 1px solid var(--glass-border) !important;
  border-radius: var(--border-radius-lg) !important;
  box-shadow: var(--surface-shadow) !important;
  color: var(--text-primary) !important;
}

.modal-card,
.barcode-modal-card,
#atendimento-modal > div,
.scan-confirm-card {
  padding: 24px !important;
}

.modal-header,
.barcode-modal-header {
  border-bottom: 1px solid var(--border-color) !important;
  padding-bottom: 12px !important;
}

.modal-header h3,
.barcode-modal-title {
  color: var(--text-primary) !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
}

.modal-close-btn,
.barcode-modal-close {
  background: transparent !important;
  border: 0 !important;
  color: var(--text-secondary) !important;
  border-radius: var(--border-radius-sm) !important;
  box-shadow: none !important;
}

.modal-close-btn:hover,
.barcode-modal-close:hover {
  background: var(--danger-bg) !important;
  color: var(--danger-color) !important;
}

.modal-footer-actions {
  border-top: 1px solid var(--border-color) !important;
}

.profile-dropdown,
.app-dropdown-menu,
.search-results-dropdown {
  border-radius: var(--border-radius-md) !important;
  overflow: hidden;
}

.profile-dropdown {
  padding: 12px 0 8px !important;
}

.app-dropdown-menu::before {
  background: var(--glass-bg) !important;
  border-color: var(--glass-border) !important;
}

.search-results-dropdown div {
  background: var(--glass-bg) !important;
  border-bottom: 1px solid var(--border-color) !important;
  color: var(--text-primary) !important;
}

.search-results-dropdown div:hover,
.dropdown-item:hover {
  background: var(--bg-tertiary) !important;
  color: var(--text-primary) !important;
}

.toast {
  background: var(--glass-bg) !important;
  border: 1px solid var(--glass-border);
  border-left-width: 4px;
  box-shadow: var(--surface-shadow) !important;
}

.toast.toast-danger {
  background: #fff1f2 !important;
  border-color: #ef4444 !important;
  border-left-color: #b91c1c !important;
  color: #991b1b !important;
}

.toast.toast-danger i {
  color: #b91c1c !important;
}

/* Barcode scanner and scan result used to be a separate green/dark skin. */
.barcode-modal-overlay {
  align-items: center !important;
  padding: 24px !important;
}

.barcode-modal-card {
  max-width: 560px !important;
  overflow: hidden !important;
  animation: barcodeModalSlideUp 0.22s ease-out !important;
}

.barcode-modal-icon,
.barcode-modal-input-icon,
.scan-confirm-icon,
.scan-confirm-label,
.scan-confirm-price {
  color: var(--accent-color) !important;
  filter: none !important;
}

.barcode-modal-pulse {
  border-color: rgba(var(--accent-color-rgb), 0.26) !important;
}

.barcode-modal-input-wrap,
.barcode-modal-last-scan,
.barcode-modal-tips,
.scan-confirm-cart-total,
.scan-confirm-qty {
  background: var(--bg-tertiary) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: var(--border-radius-md) !important;
  color: var(--text-primary) !important;
}

.barcode-modal-input-wrap:focus-within {
  border-color: var(--accent-color) !important;
  box-shadow: 0 0 0 3px var(--accent-glow) !important;
}

.barcode-tip-item {
  color: var(--text-secondary) !important;
}

.barcode-modal-kbd {
  background: var(--bg-card) !important;
  border-color: var(--border-color) !important;
  color: var(--text-secondary) !important;
}

.barcode-toggle-btn.active {
  background: var(--accent-color) !important;
  box-shadow: 0 4px 12px var(--accent-glow) !important;
}

.scan-confirm-card {
  gap: 18px !important;
  border-radius: var(--border-radius-lg) !important;
}

.scan-confirm-card.error {
  border-color: rgba(217, 83, 79, 0.38) !important;
}

.scan-confirm-card.error .scan-confirm-icon,
.scan-confirm-card.error .scan-confirm-label {
  color: var(--danger-color) !important;
}

.scan-confirm-color {
  border-radius: var(--border-radius-md) !important;
  box-shadow: 0 8px 20px rgba(48, 40, 37, 0.14) !important;
}

.scan-confirm-progress {
  background: var(--bg-tertiary) !important;
}

.scan-confirm-progress-fill {
  background: var(--accent-color) !important;
  box-shadow: none !important;
}

.scan-confirm-card.error .scan-confirm-progress-fill {
  background: var(--danger-color) !important;
}

body.light-theme .barcode-modal-card,
body.light-theme .scan-confirm-card {
  background: var(--glass-bg) !important;
  background-image: none !important;
  border-color: var(--glass-border) !important;
  box-shadow: var(--surface-shadow) !important;
}

body.light-theme .scan-confirm-card.error {
  background: var(--glass-bg) !important;
  background-image: none !important;
  border-color: rgba(217, 83, 79, 0.38) !important;
  box-shadow: var(--surface-shadow) !important;
}

/* Product attribute management: master-detail workspace */
.variables-workspace {
  display: grid;
  grid-template-columns: minmax(190px, 230px) minmax(0, 1fr);
  min-height: 540px;
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  border-radius: 8px;
  overflow: hidden;
}

.variables-master-nav {
  padding: 16px 10px;
  border-right: 1px solid var(--border-color);
  background: color-mix(in srgb, var(--bg-tertiary) 62%, var(--bg-secondary));
}

.variables-master-heading {
  padding: 0 10px 10px;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.variables-master-tab {
  width: 100%;
  min-height: 42px;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-secondary);
  font: inherit;
  font-size: 12.5px;
  font-weight: 650;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.16s ease, color 0.16s ease;
}

.variables-master-tab:hover {
  background: color-mix(in srgb, var(--accent-color) 7%, transparent);
  color: var(--text-primary);
}

.variables-master-tab.active {
  background: color-mix(in srgb, var(--accent-color) 13%, var(--bg-secondary));
  color: var(--accent-color);
}

.variables-master-tab svg {
  width: 16px;
  height: 16px;
}

.variables-master-count {
  min-width: 24px;
  padding: 2px 6px;
  border-radius: 10px;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-size: 10px;
  font-weight: 750;
  text-align: center;
}

.variables-detail-panel {
  min-width: 0;
  padding: 22px 24px;
}

.variables-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  margin-bottom: 18px;
}

.variables-detail-title-wrap {
  display: flex;
  align-items: center;
  gap: 11px;
}

.variables-detail-icon {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: color-mix(in srgb, var(--accent-color) 11%, transparent);
  color: var(--accent-color);
}

.variables-detail-icon svg {
  width: 17px;
  height: 17px;
}

.variables-detail-title-wrap h3 {
  margin: 0;
  color: var(--text-primary);
  font-size: 16px;
  font-weight: 800;
}

.variables-detail-title-wrap span:not(.variables-detail-icon) {
  display: block;
  margin-top: 2px;
  color: var(--text-secondary);
  font-size: 11px;
}

.variables-add-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 9px;
  max-width: 650px;
  margin-bottom: 16px;
}

.variables-add-row .custom-input {
  min-width: 0;
  height: 40px;
  padding: 9px 12px;
  border-radius: 6px;
  font-size: 12.5px;
}

.variables-add-row .btn {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 14px;
  border-radius: 6px;
  font-size: 12px;
  white-space: nowrap;
}

.variables-add-row .btn svg {
  width: 14px;
  height: 14px;
}

.variables-search-row {
  position: relative;
  max-width: 650px;
  margin-bottom: 10px;
}

.variables-search-row svg {
  position: absolute;
  left: 12px;
  top: 50%;
  width: 15px;
  height: 15px;
  color: var(--text-secondary);
  transform: translateY(-50%);
  pointer-events: none;
}

.variables-search-row input {
  width: 100%;
  height: 38px;
  padding: 8px 12px 8px 36px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: var(--bg-primary);
  color: var(--text-primary);
  font: inherit;
  font-size: 12px;
  outline: none;
}

.variables-search-row input:focus {
  border-color: var(--accent-color);
}

.variables-item-list,
.variables-category-tree {
  max-height: 430px;
  overflow-y: auto;
  border-top: 1px solid var(--border-color);
}

.variables-item-row {
  min-height: 48px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 14px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border-color);
}

.variables-item-row:hover,
.variables-tree-root-row:hover,
.variables-tree-sub-row:hover {
  background: color-mix(in srgb, var(--accent-color) 4%, transparent);
}

.variables-item-name {
  min-width: 0;
  overflow: hidden;
  color: var(--text-primary);
  font-size: 12.5px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.variables-item-usage {
  color: var(--text-secondary);
  font-size: 10.5px;
  white-space: nowrap;
}

.variables-row-actions {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  opacity: 0;
  transition: opacity 0.16s ease;
}

.variables-item-row:hover .variables-row-actions,
.variables-tree-root-row:hover .variables-row-actions,
.variables-tree-sub-row:hover .variables-row-actions,
.variables-row-actions:focus-within {
  opacity: 1;
}

.variables-icon-btn {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
}

.variables-icon-btn:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.variables-icon-btn.danger:hover {
  background: rgba(239, 68, 68, 0.09);
  color: var(--danger-color);
}

.variables-icon-btn svg {
  width: 14px;
  height: 14px;
}

.variables-empty-state {
  padding: 54px 18px;
  color: var(--text-secondary);
  font-size: 12px;
  text-align: center;
}

.variables-tree-root {
  border-bottom: 1px solid var(--border-color);
}

.variables-tree-root-row,
.variables-tree-sub-row {
  min-height: 50px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
}

.variables-tree-toggle {
  width: 28px;
  height: 28px;
  border: 0;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
}

.variables-tree-toggle svg {
  width: 15px;
  height: 15px;
  transition: transform 0.16s ease;
}

.variables-tree-root.expanded > .variables-tree-root-row .variables-tree-toggle svg {
  transform: rotate(90deg);
}

.variables-tree-label {
  min-width: 0;
  color: var(--text-primary);
  font-size: 12.5px;
  font-weight: 750;
}

.variables-tree-meta {
  color: var(--text-secondary);
  font-size: 10.5px;
  white-space: nowrap;
}

.variables-tree-children {
  display: none;
  padding: 0 8px 8px 36px;
}

.variables-tree-root.expanded > .variables-tree-children {
  display: block;
}

.variables-tree-sub-row {
  min-height: 42px;
  grid-template-columns: 14px minmax(0, 1fr) auto;
  padding-left: 8px;
}

.variables-tree-branch {
  width: 10px;
  height: 18px;
  border-bottom: 1px solid var(--border-color);
  border-left: 1px solid var(--border-color);
}

.variables-tree-leaves {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding: 0 8px 8px 29px;
}

.variables-tree-leaf {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 7px;
  border-radius: 4px;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  font-size: 10.5px;
}

.variables-tree-leaf button {
  width: 16px;
  height: 16px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

@media (max-width: 840px) {
  .variables-workspace {
    grid-template-columns: 1fr;
  }

  .variables-master-nav {
    display: flex;
    gap: 4px;
    overflow-x: auto;
    padding: 10px;
    border-right: 0;
    border-bottom: 1px solid var(--border-color);
  }

  .variables-master-heading {
    display: none;
  }

  .variables-master-tab {
    width: auto;
    min-width: max-content;
    grid-template-columns: 16px auto auto;
  }

  .variables-detail-panel {
    padding: 18px 14px;
  }
}

@media (max-width: 520px) {
  .variables-add-row {
    grid-template-columns: 1fr;
  }

  .variables-row-actions {
    opacity: 1;
  }

  .variables-item-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .variables-item-usage {
    display: none;
  }

  .variables-tree-root-row {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .variables-tree-root-row .variables-tree-meta {
    display: none;
  }
}

/* --- UNIFIED FORM SYSTEM v1.65 --- */
.modal-overlay {
  padding: 24px;
}

.modal-card:not(#custom-confirm-modal .modal-card):not(#custom-alert-modal .modal-card) {
  display: flex;
  flex-direction: column;
  width: min(100%, 620px);
  max-height: min(90vh, 860px);
  padding: 0 !important;
  overflow: hidden !important;
  border-radius: 8px !important;
}

#customer-modal .modal-card,
#supplier-modal .modal-card {
  width: min(94vw, 680px);
  max-width: 680px;
}

#product-modal .modal-card {
  width: min(96vw, 1120px) !important;
  max-width: 1120px !important;
}

#stock-entry-modal .modal-card,
#support-ticket-modal .modal-card,
#audit-detail-modal .modal-card {
  width: min(94vw, 760px);
  max-width: 760px;
}

.modal-card > form,
#product-form {
  min-height: 0;
}

.modal-header {
  flex: 0 0 auto;
  min-height: 68px;
  margin: 0 !important;
  padding: 16px 24px !important;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color) !important;
}

.modal-header h3 {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  font-size: 17px !important;
  line-height: 1.25;
}

.modal-header h3 i,
.modal-header h3 svg {
  width: 18px;
  height: 18px;
}

.modal-close-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  padding: 0 !important;
  border-radius: 6px !important;
  font-size: 22px !important;
}

.modal-body {
  flex: 1 1 auto;
  min-height: 0;
  padding: 22px 24px !important;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.modal-body > form:not(#stock-entry-form),
#customer-form,
#supplier-form,
#supervisor-auth-form {
  display: grid;
  gap: 16px;
}

#product-form {
  gap: 0;
}

.modal-footer-actions {
  flex: 0 0 auto;
  grid-column: 1 / -1;
  min-height: 72px;
  margin: 20px -24px -22px !important;
  padding: 14px 24px !important;
  background: var(--bg-card);
  border-top: 1px solid var(--border-color) !important;
}

.modal-card > .modal-footer-actions,
#product-form > .modal-footer-actions {
  margin: 0 !important;
}

.modal-card {
  position: relative;
}

.modal-body:has(form > .modal-footer-actions) {
  padding-bottom: 94px !important;
}

.modal-body form > .modal-footer-actions {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 4;
  margin: 0 !important;
  box-shadow: 0 -8px 20px rgba(60, 42, 36, 0.06);
}

.form-group {
  min-width: 0;
  gap: 7px !important;
  margin: 0;
}

.form-group > label,
.settings-form .form-group > label {
  min-height: 16px;
  margin: 0 !important;
  color: var(--text-secondary) !important;
  font-size: 12px !important;
  font-weight: 650 !important;
  line-height: 1.3;
}

.form-group input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
.form-group select,
.form-group textarea,
.settings-form input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
.settings-form select,
.settings-form textarea {
  width: 100%;
  min-width: 0;
  height: 44px !important;
  padding: 10px 13px !important;
  border: 1px solid var(--border-color) !important;
  border-radius: 6px !important;
  background: var(--bg-tertiary) !important;
  color: var(--text-primary) !important;
  font-size: 13px !important;
  font-weight: 500;
  line-height: 1.4;
  box-shadow: none !important;
}

.form-group textarea,
.settings-form textarea {
  min-height: 96px;
  height: auto !important;
  resize: vertical;
}

.form-group input:not([type="checkbox"]):not([type="radio"]):focus,
.form-group select:focus,
.form-group textarea:focus,
.settings-form input:not([type="checkbox"]):not([type="radio"]):focus,
.settings-form select:focus,
.settings-form textarea:focus {
  border-color: var(--accent-color) !important;
  box-shadow: 0 0 0 3px var(--accent-glow) !important;
  outline: none !important;
}

.form-group input:disabled,
.form-group input[readonly],
.form-group select:disabled,
.form-group textarea:disabled {
  background: var(--bg-secondary) !important;
  color: var(--text-secondary) !important;
  cursor: not-allowed;
  opacity: 0.82;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--text-secondary) !important;
  font-weight: 400;
  opacity: 0.72 !important;
}

.required-label::after {
  margin-left: 2px;
}

.form-row-grid,
.form-row-grid-3 {
  gap: 16px !important;
  align-items: start;
}

.modal-footer-actions .btn,
.modal-body form > .btn,
.settings-form .btn {
  min-height: 42px;
  padding: 9px 16px;
  border-radius: 6px;
}

.form-mode-tabs,
.modal-tab-nav {
  flex: 0 0 auto;
  justify-content: flex-start !important;
  gap: 4px !important;
  margin: 0 !important;
  padding: 8px 24px 0 !important;
  background: var(--bg-secondary) !important;
  border-bottom: 1px solid var(--border-color) !important;
  overflow-x: auto;
}

.form-mode-tabs .btn,
.modal-tab-nav .tab-nav-item {
  min-height: 40px;
  padding: 9px 13px !important;
  border: 0 !important;
  border-bottom: 2px solid transparent !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: var(--text-secondary) !important;
  box-shadow: none !important;
  font-size: 12.5px !important;
}

.form-mode-tabs .btn-primary,
.modal-tab-nav .tab-nav-item.active {
  border-bottom-color: var(--accent-color) !important;
  color: var(--accent-color) !important;
}

.settings-form,
#add-collaborator-form {
  gap: 16px !important;
}

#custom-confirm-modal .modal-card,
#custom-alert-modal .modal-card {
  padding: 24px !important;
  border-radius: 8px !important;
}

@media (max-width: 720px) {
  .modal-overlay {
    align-items: flex-end;
    padding: 10px;
  }

  .modal-card:not(#custom-confirm-modal .modal-card):not(#custom-alert-modal .modal-card) {
    width: 100% !important;
    max-width: none !important;
    max-height: calc(100dvh - 20px);
  }

  .modal-header {
    min-height: 60px;
    padding: 12px 16px !important;
  }

  .modal-body {
    padding: 18px 16px !important;
  }

  .modal-footer-actions {
    margin: 18px -16px -18px !important;
    padding: 12px 16px !important;
  }

  .modal-body:has(form > .modal-footer-actions) {
    padding-bottom: 86px !important;
  }

  .form-row-grid,
  .form-row-grid-3 {
    grid-template-columns: 1fr !important;
  }

  .modal-footer-actions .btn {
    flex: 1 1 0;
  }

  .modal-tab-nav,
  .form-mode-tabs {
    padding-inline: 16px !important;
  }
}
/* Final auth-field safeguard: must remain after the unified form system. */
#auth-login-form #login-email,
#auth-register-form #reg-name,
#auth-register-form #reg-email,
#auth-register-form #reg-store-name {
  padding-left: 44px !important;
}

#auth-login-form #login-password,
#auth-register-form #reg-password {
  padding-left: 44px !important;
  padding-right: 44px !important;
}

/* Full-width login artwork with the form overlaid on its clear right side. */
.auth-card {
  background-image: url('login-background-v1.0.0.svg?v=20260901_v1.0.0-green2');
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
}

.auth-left-banner {
  position: absolute;
  inset: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
  pointer-events: none;
}

.auth-left-banner .luxury-quote-frame {
  display: none;
}

.auth-right-form {
  position: absolute;
  inset: 0 0 0 auto;
  width: 50%;
  padding: 40px 6vw;
  background: transparent;
  align-items: center;
}

.auth-form-card {
  background: rgba(252, 253, 251, 0.94);
  border-color: rgba(47, 93, 70, 0.12);
  box-shadow: 0 18px 48px rgba(31, 46, 39, 0.16);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

@media (max-width: 992px) {
  .auth-card {
    width: 100vw;
    max-width: none;
    height: 100vh;
    border-radius: 0;
    background-position: 36% center;
  }

  .auth-right-form {
    width: 100%;
    padding: 24px;
    background: rgba(235, 242, 232, 0.42);
    overflow-y: auto;
  }

  .auth-form-card {
    max-width: 420px;
    padding: 28px 30px;
  }
}

/* Prevent fixed headers and page content from shifting when vertical scroll appears. */
html {
  overflow-y: auto;
  scrollbar-gutter: stable;
}

/* Global search */
.top-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 520px minmax(0, 1fr);
  column-gap: 24px;
}
.header-left,
.header-right { min-width: 0; }
.header-left { overflow: hidden; }
.header-right { justify-self: end; }
.page-title-area { min-width: 0; overflow: hidden; }
.page-title-area h2,
.page-title-area p { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.global-search { position: relative; grid-column: 2; justify-self: center; width: 520px; min-width: 520px; max-width: 520px; margin: 0; z-index: 96; box-sizing: border-box; }
.global-search-input-row { height: 40px; display: flex; align-items: center; gap: 9px; padding: 0 8px 0 13px; background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 12px; transition: border-color .2s, box-shadow .2s; }
.global-search:focus-within .global-search-input-row { border-color: var(--accent-color); box-shadow: 0 0 0 3px rgba(116,83,75,.10); }
.global-search-icon { width: 17px; height: 17px; color: var(--text-secondary); flex-shrink: 0; }
#global-search-input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text-primary); font: inherit; font-size: 13px; }
#global-search-input::-webkit-search-cancel-button { cursor: pointer; }
.global-search-filter-btn { position: relative; width: 30px; height: 30px; border: 0; border-radius: 8px; display: grid; place-items: center; background: transparent; color: var(--text-secondary); cursor: pointer; flex-shrink: 0; }
.global-search-filter-btn:hover, .global-search-filter-btn.active { background: var(--nude-light); color: var(--accent-color); }
.global-search-filter-btn svg { width: 16px; height: 16px; }
.global-search-filter-dot { display: none; position: absolute; top: 4px; right: 4px; width: 6px; height: 6px; border-radius: 50%; background: var(--accent-color); }
.global-search-filter-dot.active { display: block; }
.global-search-popover { position: absolute; top: calc(100% + 9px); left: 50%; transform: translateX(-50%); width: min(720px, calc(100vw - 300px)); min-width: 430px; background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 14px; box-shadow: 0 18px 45px rgba(55,35,30,.18); overflow: hidden; }
.global-search-advanced { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)) auto; gap: 10px; align-items: end; padding: 14px; background: var(--bg-secondary); border-bottom: 1px solid var(--border-color); }
.global-search-advanced label { display: grid; gap: 5px; font-size: 10px; font-weight: 700; text-transform: uppercase; color: var(--text-secondary); }
.global-search-advanced select { min-width: 0; height: 36px; font-size: 12px; }
.global-search-advanced .btn { height: 36px; padding: 0 12px; }
.global-search-results { max-height: min(58vh, 470px); overflow-y: auto; padding: 6px; }
.global-search-empty { padding: 30px 18px; text-align: center; color: var(--text-secondary); font-size: 13px; }
.global-search-result { width: 100%; display: grid; grid-template-columns: 38px minmax(0,1fr) auto; gap: 10px; align-items: center; padding: 10px; border: 0; border-radius: 10px; background: transparent; color: inherit; text-align: left; cursor: pointer; }
.global-search-result:hover, .global-search-result:focus { background: var(--bg-secondary); outline: none; }
.global-search-result-icon { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 9px; background: var(--nude-light); color: var(--accent-color); }
.global-search-result-icon svg { width: 17px; height: 17px; }
.global-search-result-title { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 650; }
.global-search-result-subtitle { display: block; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; color: var(--text-secondary); }
.global-search-result-type { font-size: 10px; font-weight: 700; text-transform: uppercase; color: var(--text-secondary); padding: 4px 7px; border: 1px solid var(--border-color); border-radius: 20px; }
.global-search-help { display: flex; justify-content: space-between; padding: 8px 14px; border-top: 1px solid var(--border-color); color: var(--text-secondary); font-size: 10px; }
.global-search-help kbd { padding: 1px 5px; border: 1px solid var(--border-color); border-radius: 4px; background: var(--bg-secondary); }
@media (max-width: 1200px) { .top-header { grid-template-columns: minmax(0,1fr) 420px minmax(0,1fr); column-gap: 12px; } .global-search { width: 420px; min-width: 420px; max-width: 420px; } .header-right { gap: 8px; } }
@media (max-width: 900px) { .top-header { grid-template-columns: minmax(0,1fr) 320px minmax(0,1fr); column-gap: 10px; } .page-title-area p { display:none; } .global-search { width: 320px; min-width: 320px; max-width: 320px; } .global-search-popover { width: min(680px, calc(100vw - 32px)); min-width: 0; } }
@media (max-width: 680px) { .top-header { grid-template-columns: minmax(0,1fr) 280px minmax(0,1fr); column-gap: 7px; } .page-title-area { display:none; } .global-search { width: 280px; min-width: 280px; max-width: 280px; } .global-search-advanced { grid-template-columns: 1fr 1fr; } .global-search-advanced .btn { grid-column: 2; } .global-search-result-type { display:none; } }
@media (max-width: 480px) { .top-header { grid-template-columns: auto minmax(0,1fr) auto; column-gap: 8px; } .global-search { width: 100%; min-width: 0; max-width: none; } .global-search input::placeholder { color: transparent; } .global-search-advanced { grid-template-columns: 1fr; } .global-search-advanced .btn { grid-column: 1; } }

/* Responsive hardening: notebooks, browser zoom and reduced desktop viewports. */
@media (min-width: 1025px) and (max-width: 1279px) {
  #view-pos { overflow: visible; }
  .pos-layout {
    grid-template-columns: minmax(0, 1fr) !important;
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
  }
  .pos-products-panel { width: 100%; }
  .pos-grid { max-height: 480px; }
  .pos-cart-container {
    position: static !important;
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100% !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
  }
  .pos-cart-block,
  .pos-checkout-block {
    width: auto !important;
    height: auto !important;
    min-width: 0 !important;
    min-height: 520px !important;
    max-height: none !important;
    overflow-y: auto !important;
  }
  .cart-items-container {
    height: auto !important;
    min-height: 180px !important;
    max-height: 300px !important;
  }
}

@media (min-width: 1280px) and (max-width: 1799px) {
  .pos-layout {
    grid-template-columns: minmax(520px, 1fr) 410px !important;
    gap: 16px !important;
  }
  .pos-products-panel,
  .pos-card,
  .pos-card-info,
  .pos-card-info-text { min-width: 0; }
  .pos-card-specs { flex: 0 1 auto; max-width: 150px; overflow: hidden; text-overflow: ellipsis; }
  .pos-card-stock-status { min-width: 96px; }
  .stock-meter-bg { width: 76px; }
}

@media (max-width: 760px) {
  .content-section { min-width: 0; }
  .pos-controls { gap: 10px; }
  .pos-controls .category-select-wrapper { min-width: 0 !important; width: 100%; }
  .pos-card { align-items: flex-start; flex-wrap: wrap; padding: 10px 12px 10px 15px; }
  .pos-card-info { flex: 1 1 100%; }
  .pos-card-specs { white-space: normal; line-height: 1.2; }
  .pos-card-price { min-width: 0; margin-left: 76px; text-align: left; }
  .pos-card-stock-status { min-width: 95px; margin-left: auto; }
  .pos-cart-block, .pos-checkout-block { min-width: 0; }
  .payment-options { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .option-card { min-width: 0; padding-inline: 6px; }
}

@media (max-width: 480px) {
  .pos-card-price { margin-left: 0; }
  .pos-card-stock-status { flex: 1 1 auto; }
  .payment-options { grid-template-columns: 1fr; }
  .pos-checkout-block [style*="display: flex"] { min-width: 0; }
  #cart-exchange-credit-input { min-width: 0; }
}

/* Data-heavy views stay usable instead of widening the page. */
.table-responsive,
.table-container,
.data-table-wrapper { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* POS optimized three-column workspace for notebook-class desktop widths. */
@media (min-width: 1400px) {
  #view-pos.active {
    height: calc(100dvh - 128px);
    min-height: 640px;
    overflow: hidden;
  }
  #view-pos .pos-layout {
    grid-template-columns: minmax(340px, .82fr) minmax(350px, 1fr) minmax(320px, .72fr) !important;
    grid-template-rows: minmax(0, 1fr);
    gap: 12px !important;
    height: 100% !important;
    min-height: 0 !important;
    overflow: hidden !important;
  }
  #view-pos .pos-products-panel {
    min-width: 0;
    min-height: 0;
    gap: 12px;
    overflow: hidden;
  }
  #view-pos .pos-controls {
    flex: 0 0 auto;
    gap: 10px;
    padding: 11px 12px;
  }
  #view-pos .pos-controls .search-input-box {
    flex: 1 1 54%;
    min-width: 0;
    max-width: none;
  }
  #view-pos .pos-controls .category-select-wrapper {
    flex: 1 1 42%;
    min-width: 150px !important;
  }
  #view-pos .pos-grid {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    overflow-y: auto;
  }
  #view-pos .pos-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 8px;
    min-height: 72px;
    padding: 8px 10px 8px 13px;
  }
  #view-pos .pos-card-info {
    display: grid;
    grid-template-columns: 50px minmax(0, 1fr);
    grid-template-rows: auto auto;
    gap: 3px 8px;
    min-width: 0;
  }
  #view-pos .pos-product-thumbnail {
    grid-column: 1;
    grid-row: 1 / 3;
    width: 50px;
    height: 50px;
    min-width: 50px;
  }
  #view-pos .pos-card-info-text {
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
  }
  #view-pos .pos-card-info h4 { font-size: 13px; line-height: 1.2; }
  #view-pos .pos-card-info span { font-size: 9.5px; }
  #view-pos .pos-card-specs {
    grid-column: 2;
    grid-row: 2;
    width: max-content;
    max-width: 100%;
    padding: 2px 6px;
    font-size: 9.5px;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  #view-pos .pos-card-price {
    min-width: 66px;
    font-size: 14px;
    white-space: nowrap;
  }
  #view-pos .pos-card-stock-status { min-width: 70px; }
  #view-pos .stock-meter-bg { width: 62px; }
  #view-pos .stock-meter-label { font-size: 9.5px; white-space: nowrap; }
  #view-pos .pos-cart-container { display: contents !important; }
  #view-pos .pos-cart-block {
    grid-column: 2;
    width: auto !important;
    height: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: hidden !important;
  }
  #view-pos .cart-items-container {
    flex: 1 1 auto !important;
    height: auto !important;
    min-height: 90px !important;
    max-height: none !important;
    overflow-y: auto !important;
  }
  #view-pos .pos-checkout-block {
    grid-column: 3;
    width: auto !important;
    height: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    max-height: none !important;
    padding: 10px 12px;
    overflow-y: auto !important;
  }
  #view-pos .pos-checkout-block .step-section-header { margin-bottom: 8px; padding-bottom: 6px; }
  #view-pos .pos-checkout-block .payment-method-selector { margin-bottom: 8px !important; gap: 4px; }
  #view-pos .pos-checkout-block .option-card { height: 54px; padding: 6px 4px; }
  #view-pos .pos-checkout-block .btn-checkout-elderly { padding: 12px 10px; font-size: 13px; }
  #view-pos .elderly-total-box { margin-top: 8px; padding: 10px 12px; }
  #view-pos .total-value { font-size: 32px; }
  #view-pos .total-label { font-size: 11px; }
}

/* Product image lightbox shared by Inventory and POS. */
.product-thumbnail-clickable { cursor: zoom-in; isolation: isolate; }
.product-thumbnail-clickable:focus-visible { outline: 3px solid rgba(var(--accent-color-rgb), .3); outline-offset: 2px; }
.product-thumbnail-clickable img { transition: transform .2s ease, filter .2s ease; }
.product-thumbnail-clickable:hover img { transform: scale(1.07); filter: brightness(.82); }
.product-thumbnail-zoom { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; background: rgba(36,24,21,.28); opacity: 0; transition: opacity .2s ease; pointer-events: none; }
.product-thumbnail-zoom svg { width: 18px !important; height: 18px !important; filter: drop-shadow(0 1px 3px rgba(0,0,0,.5)); }
.product-thumbnail-clickable:hover .product-thumbnail-zoom,
.product-thumbnail-clickable:focus-visible .product-thumbnail-zoom { opacity: 1; }
.product-image-viewer { position: fixed; inset: 0; z-index: 10050; display: grid; place-items: center; padding: 24px; background: rgba(24,16,14,.82); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); opacity: 0; visibility: hidden; transition: opacity .2s ease, visibility .2s ease; }
.product-image-viewer.active { opacity: 1; visibility: visible; }
.product-image-viewer-dialog { position: relative; display: flex; flex-direction: column; width: min(760px, calc(88dvh - 70px), 94vw); max-height: 92dvh; overflow: hidden; border: 1px solid rgba(255,255,255,.18); border-radius: 18px; background: var(--bg-card); box-shadow: 0 28px 80px rgba(0,0,0,.45); transform: scale(.96); transition: transform .2s ease; }
.product-image-viewer.active .product-image-viewer-dialog { transform: scale(1); }
.product-image-viewer-close { position: absolute; z-index: 2; top: 12px; right: 12px; width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.35); border-radius: 50%; color: #fff; background: rgba(30,22,20,.72); cursor: pointer; box-shadow: 0 4px 14px rgba(0,0,0,.2); }
.product-image-viewer-close:hover { background: var(--accent-color); }
.product-image-viewer-close svg { width: 20px; height: 20px; }
.product-image-viewer-stage { width: 100%; aspect-ratio: 1 / 1; min-height: 0; height: auto; display: grid; place-items: center; overflow: hidden; background: #eee8e4; }
.product-image-viewer-image { width: 100%; height: 100%; object-fit: contain; }
.product-image-viewer-error { display: flex; flex-direction: column; align-items: center; gap: 10px; color: var(--text-secondary); }
.product-image-viewer-error[hidden] { display: none; }
.product-image-viewer-error svg { width: 42px; height: 42px; }
.product-image-viewer-caption { display: flex; flex-direction: column; gap: 3px; padding: 14px 18px 16px; border-top: 1px solid var(--border-color); }
.product-image-viewer-caption strong { font-size: 16px; color: var(--text-primary); }
.product-image-viewer-caption span { font-size: 12px; color: var(--text-secondary); }
@media (max-width: 600px) {
  .product-image-viewer { padding: 10px; }
  .product-image-viewer-dialog { width: 100%; max-height: 95dvh; border-radius: 13px; }
  .product-image-viewer-stage { width: 100%; height: auto; min-height: 0; aspect-ratio: 1 / 1; }
  .product-image-viewer-caption { padding: 11px 14px 13px; }
}

/* Keep the desktop POS fixed in the viewport; scroll only inside its work areas. */
@media (min-width: 1025px) {
  html.pos-view-active,
  html.pos-view-active body {
    width: 100%;
    height: 100dvh;
    min-height: 0;
    overflow: hidden !important;
  }
  html.pos-view-active .main-content {
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
  }
  html.pos-view-active .content-body {
    height: calc(100dvh - 64px);
    min-height: 0;
    overflow: hidden;
  }
  html.pos-view-active #view-pos.active {
    height: 100% !important;
    min-height: 0 !important;
    overflow: hidden !important;
  }
  html.pos-view-active #view-pos .pos-layout {
    height: 100% !important;
    min-height: 0 !important;
  }
}

@media (min-width: 1025px) and (max-width: 1399px) {
  html.pos-view-active #view-pos .pos-layout {
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior: contain;
    padding-right: 3px;
  }
}

/* Fluid cart-item geometry: prevents price/quantity/total overlap at every width. */
.cart-item { min-width: 0; overflow: hidden; }
.cart-item-top { min-width: 0; }
.cart-item-name { min-width: 0; }
.cart-item-bottom {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  grid-template-rows: auto;
  align-items: center;
  column-gap: 8px;
  row-gap: 3px;
  min-width: 0;
}
.cart-item-price-qty {
  grid-column: 1;
  grid-row: 1;
  width: auto;
  min-width: 0;
  max-width: 100%;
}
.cart-item-controls {
  grid-column: 2;
  grid-row: 1;
  width: 94px;
  min-width: 94px;
  justify-self: end;
}
.cart-item-total {
  grid-column: 3;
  grid-row: 1;
  min-width: 0;
  max-width: 112px;
  justify-self: end;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cart-items-container { overflow-x: hidden !important; }

@media (min-width: 1400px) {
  #view-pos .cart-item { padding: 7px 9px; }
  #view-pos .cart-item-name { font-size: 12.5px; }
  #view-pos .cart-item-price { font-size: 11.5px; }
  #view-pos .cart-item-total { font-size: 13px; max-width: 105px; }
  #view-pos .cart-item-controls { width: 88px; min-width: 88px; }
  #view-pos .cart-qty-btn { width: 25px; height: 25px; }
  #view-pos .cart-qty-val { font-size: 13px; }
  #view-pos .pos-controls .custom-select { min-width: 0; padding-right: 30px !important; font-size: 12px !important; text-overflow: ellipsis; }
  #view-pos #card-options-container > div { grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); }
  #view-pos #card-options-container .custom-select { min-width: 0 !important; padding: 8px 26px 8px 9px !important; font-size: 12px !important; }
  #view-pos #cart-exchange-credit-input { min-width: 0; padding-inline: 10px !important; font-size: 11.5px !important; }
  #view-pos #btn-apply-exchange-credit { flex: 0 0 auto; padding-inline: 12px !important; }
}

@media (max-width: 420px) {
  .cart-item-bottom { grid-template-columns: 1fr; }
  .cart-item-price-qty { grid-column: 1; grid-row: 1; }
  .cart-item-total { grid-column: 1; grid-row: 2; justify-self: start; max-width: 100%; }
  .cart-item-controls { grid-column: 1; grid-row: 3; justify-self: start; }
}

/* POS final summary: item count beside the amount instead of in the cart header. */
#view-pos .elderly-total-box {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  justify-content: stretch;
  gap: 0;
  padding: 0 !important;
  overflow: hidden;
}

#view-pos .cart-total-count-panel {
  flex: 0 0 24%;
  min-width: 104px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 10px 8px;
  border-right: 1px solid rgba(16, 185, 129, 0.3);
  background: rgba(16, 185, 129, 0.07);
  box-sizing: border-box;
}

#view-pos .cart-total-count-label {
  color: var(--text-secondary);
  font-size: 9px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

#view-pos .cart-total-items {
  min-width: 0;
  height: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: #10b981;
  font-family: 'Outfit', sans-serif;
  font-size: 19px;
  font-weight: 850;
  line-height: 1;
}

#view-pos .cart-total-amount-panel {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 10px 12px;
  box-sizing: border-box;
}

@media (max-width: 420px) {
  #view-pos .cart-total-count-panel {
    flex-basis: 36%;
    min-width: 94px;
  }
  #view-pos .cart-total-count-label { font-size: 8px; }
  #view-pos .cart-total-items { font-size: 16px; }
  #view-pos .cart-total-amount-panel { padding-inline: 8px; }
}

/* Quick product registration: 30% visual column + 70% identification fields. */
.product-basic-layout {
  display: grid;
  grid-template-columns: minmax(230px, 30%) minmax(0, 70%);
  gap: 24px;
  align-items: start;
  width: 100%;
}
.product-basic-image-column {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  background: var(--bg-secondary);
}
.quick-product-image-heading { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.quick-product-image-heading strong { font-size: 14px; color: var(--text-primary); }
.quick-product-image-heading span { font-size: 11px; line-height: 1.4; color: var(--text-secondary); }
.product-basic-fields-column { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.product-identification-codes-row { display: flex !important; flex-direction: row !important; gap: 16px; align-items: stretch; width: 100%; min-width: 0; padding-bottom: 4px; }
.product-identification-codes-row > .form-group { display: grid; grid-template-rows: 32px 44px 34px; align-items: stretch; gap: 7px !important; min-width: 0; }
.product-identification-codes-row > .product-sku-field { flex: 1 1 0 !important; width: 0; }
.product-identification-codes-row > .product-ean-field { flex: 1 1 0 !important; width: 0; }
.product-identification-codes-row > .product-sku-field > div:first-child { height: 32px; margin: 0 !important; align-items: center !important; }
.product-identification-codes-row > .product-ean-field > label { display: flex !important; align-items: center; height: 32px; margin: 0 !important; }
.product-identification-codes-row > .product-sku-field > div:nth-child(2) { height: 44px; }
.product-identification-codes-row > .product-ean-field > input { height: 44px !important; }
.product-identification-codes-row #prod-sku { min-width: 0; }
.product-identification-codes-row #btn-generate-prod-sku { flex: 0 0 auto; min-width: 126px; padding-inline: 10px !important; }
.product-code-auto-help { display: block; height: 34px; margin: 0; overflow: hidden; color: var(--text-secondary); font-size: 10.5px; line-height: 1.35; }
.product-basic-fashion-section { display: flex; flex-direction: column; gap: 16px; padding-top: 18px; margin-top: 2px; border-top: 1px solid var(--border-color); }
.product-basic-description-section { display: flex; flex-direction: column; gap: 12px; padding-top: 18px; border-top: 1px solid var(--border-color); }
.product-basic-description-section textarea { min-height: 120px; }
.product-basic-section-title { display: flex; flex-direction: column; gap: 3px; }
.product-basic-section-title strong { font-size: 14px; color: var(--text-primary); }
.product-basic-section-title span { font-size: 11px; color: var(--text-secondary); }
.product-basic-image-column { position: sticky; top: 0; }
#product-modal .modal-body { overflow-y: scroll !important; scrollbar-gutter: stable; }
.product-basic-image-column .product-image-editor { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.product-basic-image-column .product-image-preview {
  width: 100%;
  max-width: 280px;
  aspect-ratio: 1 / 1;
  height: auto;
  margin-inline: auto;
  cursor: pointer;
  border-width: 2px;
  transition: border-color .2s, background .2s, transform .2s;
}
.product-basic-image-column .product-image-preview:hover,
.product-basic-image-column .product-image-preview:focus-visible,
.product-basic-image-column .product-image-preview.drag-active {
  border-color: var(--accent-color);
  background: rgba(var(--accent-color-rgb), .07);
  outline: none;
}
.product-basic-image-column .product-image-preview.drag-active { transform: scale(1.015); }
.product-basic-image-column .product-image-editor-content { min-width: 0; }
.product-basic-image-column .product-image-editor-content > div:first-child p { font-size: 10.5px; line-height: 1.4; }
.product-basic-image-column .product-image-actions { display: grid; grid-template-columns: 1fr; gap: 8px; }
.product-basic-image-column .product-image-actions:empty { display: none; }
.product-basic-image-column .product-image-actions .btn { width: 100%; justify-content: center; padding-inline: 10px; }
.product-basic-image-column .product-image-status { display: block; overflow-wrap: anywhere; line-height: 1.35; }

@media (max-width: 900px) {
  .product-basic-layout { grid-template-columns: 1fr; }
  .product-basic-image-column { position: static; display: grid; grid-template-columns: minmax(180px, 260px) minmax(0, 1fr); gap: 16px; }
  .quick-product-image-heading { grid-column: 1 / -1; margin-bottom: 0; }
  .product-basic-image-column .product-image-editor { display: contents; }
  .product-basic-image-column .product-image-preview { grid-column: 1; }
  .product-basic-image-column .product-image-editor-content { grid-column: 2; align-self: center; }
}

@media (max-width: 700px) {
  .product-identification-codes-row { flex-direction: column !important; align-items: stretch; }
  .product-identification-codes-row > .form-group { display: flex; width: 100%; min-width: 0 !important; height: auto; flex: 1 1 auto !important; }
  .product-code-auto-help { height: auto; min-height: 15px; }
}

@media (max-width: 600px) {
  .product-basic-image-column { display: block; padding: 12px; }
  .quick-product-image-heading { margin-bottom: 12px; }
  .product-basic-image-column .product-image-editor { display: flex; }
  .product-basic-image-column .product-image-preview { max-width: 240px; }
  .product-basic-image-column .product-image-editor-content { margin-top: 12px; }
  #tab-prod-basic .form-row-grid-3,
  #tab-prod-basic .form-row-grid { grid-template-columns: 1fr !important; }
}

/* --- PRODUCT SPREADSHEET IMPORT v1.96 --- */
.product-import-modal { max-width: 1040px; }
.product-import-modal .modal-header > div { min-width: 0; }
.product-import-modal .modal-header h3 { display: flex; align-items: center; gap: 8px; }
.product-import-modal .modal-header p { margin-top: 4px; color: var(--text-secondary); font-size: 12px; }
.product-import-body { display: block; }
.product-import-intro,
.product-import-file-summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 16px; margin-bottom: 14px; border: 1px solid var(--border-color); border-radius: var(--border-radius-md); background: rgba(255,255,255,.025); }
.product-import-intro > div,
.product-import-file-summary > div { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.product-import-intro span,
.product-import-file-summary span { color: var(--text-secondary); font-size: 12px; }
.product-import-dropzone { display: flex; min-height: 250px; padding: 34px 20px; border: 2px dashed rgba(180,145,120,.4); border-radius: var(--border-radius-lg); background: rgba(180,145,120,.05); align-items: center; justify-content: center; flex-direction: column; text-align: center; cursor: pointer; transition: .2s ease; }
.product-import-dropzone:hover,
.product-import-dropzone.drag-active { border-color: var(--accent-color); background: rgba(180,145,120,.11); transform: translateY(-1px); }
.product-import-dropzone > svg { width: 44px; height: 44px; margin-bottom: 12px; color: var(--accent-color); }
.product-import-dropzone h4 { margin-bottom: 5px; }
.product-import-dropzone p { margin-bottom: 16px; color: var(--text-secondary); font-size: 12px; }
.product-import-rules,
.product-import-note { display: flex; gap: 8px; margin-top: 12px; padding: 11px 13px; border-radius: var(--border-radius-md); background: rgba(99,102,241,.08); color: #b9c1ff; font-size: 11.5px; line-height: 1.45; }
.product-import-rules svg { width: 15px; height: 15px; flex: 0 0 auto; }
.product-import-counts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px; }
.product-import-counts > div { display: flex; align-items: baseline; gap: 7px; padding: 11px 13px; border: 1px solid rgba(16,185,129,.24); border-radius: var(--border-radius-md); background: rgba(16,185,129,.07); }
.product-import-counts strong { color: #34d399; font-size: 21px; }
.product-import-counts span { color: var(--text-secondary); font-size: 11px; }
.product-import-counts .has-errors { border-color: rgba(239,68,68,.25); background: rgba(239,68,68,.07); }
.product-import-counts .has-errors strong { color: #f87171; }
.product-import-table-wrap { max-height: 340px; overflow: auto; border: 1px solid var(--border-color); border-radius: var(--border-radius-md); }
.product-import-table { min-width: 850px; }
.product-import-table thead { position: sticky; top: 0; z-index: 1; background: var(--bg-card); }
.product-import-table th,
.product-import-table td { padding: 10px 12px; font-size: 11.5px; vertical-align: middle; }
.product-import-table td:nth-child(2) strong,
.product-import-table td:nth-child(2) span { display: block; }
.product-import-table td:nth-child(2) span { margin-top: 2px; color: var(--text-secondary); font-size: 10px; }
.product-import-table td:last-child { max-width: 270px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.import-row-error { background: rgba(239,68,68,.055); }
.import-row-error td:last-child { color: #fca5a5; }
.import-action-badge { display: inline-flex; padding: 4px 8px; border-radius: 999px; font-size: 10px; font-weight: 700; }
.import-action-badge.create { color: #34d399; background: rgba(16,185,129,.12); }
.import-action-badge.update { color: #93c5fd; background: rgba(59,130,246,.12); }
.product-import-stock-mode { display: flex; flex-wrap: wrap; gap: 12px 18px; align-items: center; margin-top: 13px; padding: 12px 14px; border: 1px solid var(--border-color); border-radius: var(--border-radius-md); }
.product-import-stock-mode > strong { width: 100%; font-size: 12px; }
.product-import-stock-mode label { display: inline-flex; align-items: center; gap: 7px; color: var(--text-secondary); font-size: 11.5px; cursor: pointer; }
.product-import-stock-mode label span { color: var(--accent-color); }
@media (max-width: 700px) {
  .product-import-intro, .product-import-file-summary { align-items: stretch; flex-direction: column; }
  .product-import-counts { grid-template-columns: 1fr; }
  .product-import-dropzone { min-height: 210px; }
}
/* Login audit monitoring */
.audit-login-monitor {
  margin: 16px 0;
  padding: 16px;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  background: var(--bg-secondary);
}

.audit-login-monitor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.audit-login-monitor-header h4 {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0 0 3px;
  color: var(--text-primary);
  font-size: 14px;
}

.audit-login-monitor-header h4 svg {
  width: 16px;
  height: 16px;
  color: var(--accent-color);
}

.audit-login-monitor-header > div > span {
  color: var(--text-secondary);
  font-size: 10.5px;
}

.audit-login-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  gap: 10px;
}

.audit-login-metric {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-height: 72px;
  padding: 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  background: var(--bg-primary);
}

.audit-login-metric span {
  color: var(--text-secondary);
  font-size: 10px;
  font-weight: 600;
}

.audit-login-metric strong {
  color: var(--text-primary);
  font-size: 24px;
  line-height: 1;
}

.audit-login-success strong { color: var(--success-color); }
.audit-login-denied strong { color: var(--danger-color); }

.audit-login-alert {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: var(--border-radius-md);
  font-size: 11px;
  font-weight: 600;
}

.audit-login-alert-ok {
  color: var(--success-color);
  background: rgba(16, 185, 129, 0.09);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.audit-login-alert-warning {
  color: var(--warning-color);
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.24);
}

.audit-login-alert-danger {
  color: var(--danger-color);
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.24);
}

.audit-login-recent {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.audit-login-recent-row {
  display: grid;
  grid-template-columns: minmax(150px, 1.4fr) minmax(120px, 1fr) minmax(115px, .8fr) minmax(120px, .9fr);
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border-color);
  font-size: 10.5px;
}

.audit-login-recent-row:last-child { border-bottom: 0; }
.audit-login-recent-row strong { color: var(--text-primary); }
.audit-login-recent-row span { color: var(--text-secondary); }

@media (max-width: 900px) {
  .audit-login-metrics { grid-template-columns: repeat(2, minmax(120px, 1fr)); }
  .audit-login-recent-row { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 560px) {
  .audit-login-monitor-header { align-items: stretch; flex-direction: column; }
  .audit-login-metrics { grid-template-columns: 1fr; }
  .audit-login-recent-row { grid-template-columns: 1fr; gap: 3px; }
}

/* Final responsive sizing for the configurable label generator. */
#barcode-label-modal {
  padding: clamp(8px, 2vh, 20px);
}

#barcode-label-modal .label-config-modal-card {
  width: min(97vw, 1600px) !important;
  max-width: 1600px !important;
  height: min(94dvh, 960px);
  max-height: calc(100dvh - 16px) !important;
  min-height: 0;
}

#barcode-label-modal .label-config-modal-card > .modal-header,
#barcode-label-modal .label-config-modal-card > .modal-footer-actions {
  flex: 0 0 auto;
}

#barcode-label-modal .label-config-modal-card > .modal-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden !important;
  padding: clamp(10px, 1.7vh, 18px) clamp(12px, 1.4vw, 22px) !important;
}

#barcode-label-modal .label-generator-layout {
  width: 100%;
  height: 100%;
  min-height: 0;
  grid-template-columns: minmax(520px, 1.15fr) minmax(390px, .85fr) !important;
  gap: clamp(10px, 1.2vw, 18px) !important;
}

#barcode-label-modal .label-controls-panel {
  width: 100%;
  height: 100%;
  min-height: 0;
  max-height: none !important;
  overflow-x: hidden;
  overflow-y: auto;
}

#barcode-label-modal .label-preview-panel {
  position: relative;
  top: auto;
  align-self: stretch;
  width: 100%;
  height: 100%;
  min-height: 0 !important;
  overflow: hidden;
  padding: clamp(10px, 1.3vw, 18px) !important;
  gap: clamp(7px, 1vh, 12px) !important;
}

#barcode-label-modal .label-preview-panel > h4,
#barcode-label-modal .label-preview-panel > p {
  flex: 0 0 auto;
  margin: 0 !important;
}

#barcode-label-modal .label-preview-surface {
  flex: 1 1 auto;
  width: 100%;
  height: auto;
  min-height: 0;
  overflow: hidden;
  padding: clamp(10px, 1.5vw, 24px);
}

#barcode-label-modal .label-preview-stage {
  max-width: 100%;
  max-height: 100%;
}

#barcode-label-modal .label-preview-meta {
  flex: 0 0 auto;
}

#barcode-label-modal .modal-footer-actions {
  min-height: 66px;
  padding: 10px clamp(12px, 1.4vw, 24px) !important;
  gap: 8px;
}

#barcode-label-modal .modal-footer-actions .btn {
  min-height: 42px;
  padding: 9px 14px !important;
}

@media (max-width: 1180px) {
  #barcode-label-modal .label-config-modal-card {
    width: calc(100vw - 16px) !important;
    height: calc(100dvh - 16px);
  }
  #barcode-label-modal .label-config-modal-card > .modal-body {
    overflow-y: auto !important;
  }
  #barcode-label-modal .label-generator-layout {
    height: auto;
    grid-template-columns: 1fr !important;
  }
  #barcode-label-modal .label-controls-panel {
    height: auto;
    overflow: visible;
  }
  #barcode-label-modal .label-preview-panel {
    height: clamp(420px, 68dvh, 620px);
    min-height: 420px !important;
  }
}

@media (max-width: 640px) {
  #barcode-label-modal {
    padding: 4px;
  }
  #barcode-label-modal .label-config-modal-card {
    width: calc(100vw - 8px) !important;
    height: calc(100dvh - 8px);
    max-height: calc(100dvh - 8px) !important;
  }
  #barcode-label-modal .label-config-modal-card > .modal-header {
    min-height: 56px;
    padding: 10px 12px !important;
  }
  #barcode-label-modal .label-config-modal-card > .modal-header h3 {
    font-size: 14px !important;
  }
  #barcode-label-modal .label-preview-panel {
    height: clamp(360px, 62dvh, 500px);
    min-height: 360px !important;
  }
  #barcode-label-modal .modal-footer-actions {
    max-height: 42dvh;
    overflow-y: auto;
    justify-content: stretch;
  }
  #barcode-label-modal .modal-footer-actions .btn {
    flex: 1 1 145px;
  }
}
