/* ==========================================================================
   CPC1 HN Packaging Storage & Design Archive CSS
   Aesthetic: Premium Glassmorphism & High-Tech Dashboard
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  /* Common variables */
  --transition-speed: 0.3s;
  --transition-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
  --border-radius-sm: 8px;
  --border-radius-md: 14px;
  --border-radius-lg: 24px;
  
  /* Light Theme (Default) */
  --bg-primary: #f0f4f9;
  --bg-sidebar: rgba(255, 255, 255, 0.7);
  --bg-card: rgba(255, 255, 255, 0.65);
  --bg-input: rgba(255, 255, 255, 0.9);
  --border-color: rgba(226, 232, 240, 0.8);
  --border-glass: rgba(255, 255, 255, 0.5);
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --accent-color: #3b82f6;
  --accent-glow: rgba(59, 130, 246, 0.2);
  --success-color: #10b981;
  --success-bg: rgba(16, 185, 129, 0.1);
  --warning-color: #f59e0b;
  --warning-bg: rgba(245, 158, 11, 0.1);
  --danger-color: #ef4444;
  --danger-bg: rgba(239, 68, 68, 0.1);
  
  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.03);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.06), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --shadow-inset: inset 0 2px 4px 0 rgba(0, 0, 0, 0.06);
  --backdrop-blur: blur(16px);
}

[data-theme="dark"] {
  /* Dark Theme */
  --bg-primary: #090d16;
  --bg-sidebar: rgba(15, 23, 42, 0.7);
  --bg-card: rgba(20, 31, 58, 0.5);
  --bg-input: rgba(15, 23, 42, 0.6);
  --border-color: rgba(51, 65, 85, 0.5);
  --border-glass: rgba(255, 255, 255, 0.05);
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent-color: #60a5fa;
  --accent-glow: rgba(96, 165, 250, 0.25);
  --success-color: #34d399;
  --success-bg: rgba(52, 211, 153, 0.15);
  --warning-color: #fbbf24;
  --warning-bg: rgba(251, 191, 36, 0.15);
  --danger-color: #f87171;
  --danger-bg: rgba(248, 113, 113, 0.15);
  
  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -2px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 10px 10px -5px rgba(0, 0, 0, 0.3);
  --shadow-inset: inset 0 2px 4px 0 rgba(0, 0, 0, 0.5);
}

/* ==========================================================================
   Base Elements
   ========================================================================== */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  overflow-x: hidden;
  height: 100vh;
  display: flex;
  transition: background-color var(--transition-speed) ease, color var(--transition-speed) ease;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--text-muted);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-secondary);
}

/* ==========================================================================
   App Layout
   ========================================================================== */

.app-container {
  display: flex;
  width: 100vw;
  height: 100vh;
  position: relative;
}

/* Sidebar Styling */
.sidebar {
  width: 260px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  backdrop-filter: var(--backdrop-blur);
  display: flex;
  flex-direction: column;
  padding: 24px;
  z-index: 10;
  transition: background var(--transition-speed), border var(--transition-speed);
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 40px;
}

.brand-logo {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #2563eb, #3b82f6);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 16px rgba(59, 130, 246, 0.3);
}

.brand-logo svg {
  width: 22px;
  height: 22px;
  fill: #fff;
}

.brand-name {
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, var(--text-primary), var(--accent-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.nav-menu {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-grow: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  border-radius: var(--border-radius-sm);
  cursor: pointer;
  transition: all var(--transition-speed) var(--transition-bounce);
  position: relative;
}

.nav-item svg {
  width: 20px;
  height: 20px;
  transition: transform var(--transition-speed) ease;
}

.nav-item:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.15);
  transform: translateX(4px);
}

.nav-item.active {
  color: #fff;
  background: var(--accent-color);
  box-shadow: 0 8px 16px var(--accent-glow);
}

.nav-item.active svg {
  transform: scale(1.1);
}

.sidebar-footer {
  margin-top: auto;
  border-top: 1px solid var(--border-color);
  padding-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.theme-toggle-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px;
  border-radius: var(--border-radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-weight: 500;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all var(--transition-speed);
}

.theme-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: var(--accent-color);
}

.theme-toggle-btn svg {
  width: 18px;
  height: 18px;
}

/* Main Content Styling */
.main-content {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow-y: auto;
  padding: 24px 32px;
  position: relative;
}

/* Top Navigation Header */
.top-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  gap: 20px;
}

.page-title h1 {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.page-title p {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.search-container {
  position: relative;
  width: 320px;
}

.search-input {
  width: 100%;
  padding: 10px 16px 10px 42px;
  border-radius: var(--border-radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: 0.9rem;
  outline: none;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-speed);
}

.search-input:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  width: 18px;
  height: 18px;
  pointer-events: none;
}

/* Tab Content Visibility */
.tab-content {
  display: none;
  animation: fadeIn 0.4s ease;
  flex-grow: 1;
}

.tab-content.active {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   Dashboard View
   ========================================================================== */

/* Stat Cards Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  backdrop-filter: var(--backdrop-blur);
  padding: 24px;
  border-radius: var(--border-radius-md);
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
  transition: all var(--transition-speed) var(--transition-bounce);
}

.stat-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent-color);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--accent-color);
}

.stat-card.success::before { background: var(--success-color); }
.stat-card.warning::before { background: var(--warning-color); }
.stat-card.danger::before { background: var(--danger-color); }

.stat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.stat-title {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
}

.stat-icon {
  width: 24px;
  height: 24px;
  color: var(--accent-color);
}

.stat-card.success .stat-icon { color: var(--success-color); }
.stat-card.warning .stat-icon { color: var(--warning-color); }
.stat-card.danger .stat-icon { color: var(--danger-color); }

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -1px;
  margin-bottom: 4px;
}

.stat-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Charts Grid */
.charts-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
}

@media (max-width: 1024px) {
  .charts-grid {
    grid-template-columns: 1fr;
  }
}

.chart-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  backdrop-filter: var(--backdrop-blur);
  padding: 24px;
  border-radius: var(--border-radius-md);
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
}

.chart-title-section {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.chart-title-section h3 {
  font-size: 1.1rem;
  font-weight: 600;
}

.chart-canvas {
  height: 280px;
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding-top: 20px;
}

/* Custom SVG Charts Elements */
.svg-chart {
  width: 100%;
  height: 100%;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 16px;
  justify-content: center;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.legend-color {
  width: 12px;
  height: 12px;
  border-radius: 3px;
}

/* ==========================================================================
   Visual Shelf Map (Storage Visualizer)
   ========================================================================== */

.shelf-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 24px;
}

@media (max-width: 968px) {
  .shelf-layout {
    grid-template-columns: 1fr;
  }
}

.shelf-main-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  backdrop-filter: var(--backdrop-blur);
  padding: 24px;
  border-radius: var(--border-radius-md);
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.shelf-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.shelf-tabs {
  display: flex;
  background: var(--border-color);
  padding: 4px;
  border-radius: var(--border-radius-sm);
  gap: 4px;
}

.shelf-tab-btn {
  padding: 6px 16px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-speed);
}

.shelf-tab-btn.active {
  background: var(--bg-primary);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}

.shelf-legend {
  display: flex;
  gap: 16px;
  font-size: 0.8rem;
}

.shelf-grid-container {
  overflow-x: auto;
  padding: 10px 0;
}

/* Simulated Storage Rack UI */
.shelf-rack {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 12px;
  min-width: 600px;
  background: rgba(0, 0, 0, 0.05);
  padding: 20px;
  border-radius: var(--border-radius-md);
  border: 4px solid var(--text-muted);
  box-shadow: var(--shadow-inset);
  position: relative;
}

.shelf-cell {
  background: rgba(255, 255, 255, 0.8);
  border: 1.5px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  aspect-ratio: 1.2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: all var(--transition-speed) var(--transition-bounce);
  padding: 6px;
}

[data-theme="dark"] .shelf-cell {
  background: rgba(15, 23, 42, 0.8);
}

.shelf-cell:hover {
  transform: scale(1.08);
  z-index: 2;
  border-color: var(--accent-color);
  box-shadow: 0 0 15px var(--accent-glow);
}

.shelf-cell.active {
  border-color: var(--accent-color);
  background: var(--accent-glow);
  box-shadow: 0 0 15px var(--accent-glow), var(--shadow-inset);
  transform: scale(1.05);
}

.shelf-cell-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
}

.shelf-cell-count {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 500;
  margin-top: 2px;
}

/* Color codes representing packaging counts (Density) */
.density-empty { border-bottom: 4px solid var(--text-muted); }
.density-low { border-bottom: 4px solid #60a5fa; }      /* Light blue */
.density-medium { border-bottom: 4px solid #3b82f6; }   /* Blue */
.density-high { border-bottom: 4px solid #10b981; }     /* Green */
.density-max { border-bottom: 4px solid #8b5cf6; }      /* Purple */

/* Unique color themes for each shelf slot (0 to 9) */
.shelf-cell-0 { background: rgba(239, 68, 68, 0.08) !important; border-color: rgba(239, 68, 68, 0.25) !important; }
.shelf-cell-0:hover { background: rgba(239, 68, 68, 0.15) !important; border-color: rgba(239, 68, 68, 0.6) !important; box-shadow: 0 0 10px rgba(239, 68, 68, 0.2) !important; }
.shelf-cell-0.active { background: rgba(239, 68, 68, 0.2) !important; border-color: rgba(239, 68, 68, 0.9) !important; box-shadow: 0 0 15px rgba(239, 68, 68, 0.35), var(--shadow-inset) !important; }

.shelf-cell-1 { background: rgba(249, 115, 22, 0.08) !important; border-color: rgba(249, 115, 22, 0.25) !important; }
.shelf-cell-1:hover { background: rgba(249, 115, 22, 0.15) !important; border-color: rgba(249, 115, 22, 0.6) !important; box-shadow: 0 0 10px rgba(249, 115, 22, 0.2) !important; }
.shelf-cell-1.active { background: rgba(249, 115, 22, 0.2) !important; border-color: rgba(249, 115, 22, 0.9) !important; box-shadow: 0 0 15px rgba(249, 115, 22, 0.35), var(--shadow-inset) !important; }

.shelf-cell-2 { background: rgba(245, 158, 11, 0.08) !important; border-color: rgba(245, 158, 11, 0.25) !important; }
.shelf-cell-2:hover { background: rgba(245, 158, 11, 0.15) !important; border-color: rgba(245, 158, 11, 0.6) !important; box-shadow: 0 0 10px rgba(245, 158, 11, 0.2) !important; }
.shelf-cell-2.active { background: rgba(245, 158, 11, 0.2) !important; border-color: rgba(245, 158, 11, 0.9) !important; box-shadow: 0 0 15px rgba(245, 158, 11, 0.35), var(--shadow-inset) !important; }

.shelf-cell-3 { background: rgba(16, 185, 129, 0.08) !important; border-color: rgba(16, 185, 129, 0.25) !important; }
.shelf-cell-3:hover { background: rgba(16, 185, 129, 0.15) !important; border-color: rgba(16, 185, 129, 0.6) !important; box-shadow: 0 0 10px rgba(16, 185, 129, 0.2) !important; }
.shelf-cell-3.active { background: rgba(16, 185, 129, 0.2) !important; border-color: rgba(16, 185, 129, 0.9) !important; box-shadow: 0 0 15px rgba(16, 185, 129, 0.35), var(--shadow-inset) !important; }

.shelf-cell-4 { background: rgba(20, 184, 166, 0.08) !important; border-color: rgba(20, 184, 166, 0.25) !important; }
.shelf-cell-4:hover { background: rgba(20, 184, 166, 0.15) !important; border-color: rgba(20, 184, 166, 0.6) !important; box-shadow: 0 0 10px rgba(20, 184, 166, 0.2) !important; }
.shelf-cell-4.active { background: rgba(20, 184, 166, 0.2) !important; border-color: rgba(20, 184, 166, 0.9) !important; box-shadow: 0 0 15px rgba(20, 184, 166, 0.35), var(--shadow-inset) !important; }

.shelf-cell-5 { background: rgba(59, 130, 246, 0.08) !important; border-color: rgba(59, 130, 246, 0.25) !important; }
.shelf-cell-5:hover { background: rgba(59, 130, 246, 0.15) !important; border-color: rgba(59, 130, 246, 0.6) !important; box-shadow: 0 0 10px rgba(59, 130, 246, 0.2) !important; }
.shelf-cell-5.active { background: rgba(59, 130, 246, 0.2) !important; border-color: rgba(59, 130, 246, 0.9) !important; box-shadow: 0 0 15px rgba(59, 130, 246, 0.35), var(--shadow-inset) !important; }

.shelf-cell-6 { background: rgba(99, 102, 241, 0.08) !important; border-color: rgba(99, 102, 241, 0.25) !important; }
.shelf-cell-6:hover { background: rgba(99, 102, 241, 0.15) !important; border-color: rgba(99, 102, 241, 0.6) !important; box-shadow: 0 0 10px rgba(99, 102, 241, 0.2) !important; }
.shelf-cell-6.active { background: rgba(99, 102, 241, 0.2) !important; border-color: rgba(99, 102, 241, 0.9) !important; box-shadow: 0 0 15px rgba(99, 102, 241, 0.35), var(--shadow-inset) !important; }

.shelf-cell-7 { background: rgba(139, 92, 246, 0.08) !important; border-color: rgba(139, 92, 246, 0.25) !important; }
.shelf-cell-7:hover { background: rgba(139, 92, 246, 0.15) !important; border-color: rgba(139, 92, 246, 0.6) !important; box-shadow: 0 0 10px rgba(139, 92, 246, 0.2) !important; }
.shelf-cell-7.active { background: rgba(139, 92, 246, 0.2) !important; border-color: rgba(139, 92, 246, 0.9) !important; box-shadow: 0 0 15px rgba(139, 92, 246, 0.35), var(--shadow-inset) !important; }

.shelf-cell-8 { background: rgba(236, 72, 153, 0.08) !important; border-color: rgba(236, 72, 153, 0.25) !important; }
.shelf-cell-8:hover { background: rgba(236, 72, 153, 0.15) !important; border-color: rgba(236, 72, 153, 0.6) !important; box-shadow: 0 0 10px rgba(236, 72, 153, 0.2) !important; }
.shelf-cell-8.active { background: rgba(236, 72, 153, 0.2) !important; border-color: rgba(236, 72, 153, 0.9) !important; box-shadow: 0 0 15px rgba(236, 72, 153, 0.35), var(--shadow-inset) !important; }

.shelf-cell-9 { background: rgba(244, 63, 94, 0.08) !important; border-color: rgba(244, 63, 94, 0.25) !important; }
.shelf-cell-9:hover { background: rgba(244, 63, 94, 0.15) !important; border-color: rgba(244, 63, 94, 0.6) !important; box-shadow: 0 0 10px rgba(244, 63, 94, 0.2) !important; }
.shelf-cell-9.active { background: rgba(244, 63, 94, 0.2) !important; border-color: rgba(244, 63, 94, 0.9) !important; box-shadow: 0 0 15px rgba(244, 63, 94, 0.35), var(--shadow-inset) !important; }

/* Shelf details side panel */
.shelf-side-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  backdrop-filter: var(--backdrop-blur);
  border-radius: var(--border-radius-md);
  box-shadow: var(--shadow-md);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  height: 100%;
  max-height: calc(100vh - 180px);
}

.panel-header {
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 12px;
}

.panel-header h3 {
  font-size: 1.1rem;
  font-weight: 600;
}

.panel-header p {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.shelf-item-list {
  list-style: none;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex-grow: 1;
}

.shelf-item-card {
  padding: 12px;
  border-radius: var(--border-radius-sm);
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all var(--transition-speed);
}

.shelf-item-card:hover {
  border-color: var(--accent-color);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.shelf-item-title {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.shelf-item-meta {
  display: flex;
  justify-content: space-between;
  color: var(--text-muted);
  font-size: 0.75rem;
}

/* ==========================================================================
   Catalog Datagrid View
   ========================================================================== */

.catalog-actions-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.filters-wrapper {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.select-filter {
  padding: 8px 12px;
  border-radius: var(--border-radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: 0.85rem;
  outline: none;
  cursor: pointer;
  transition: all var(--transition-speed);
}

.select-filter:focus {
  border-color: var(--accent-color);
}

.btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--border-radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all var(--transition-speed) var(--transition-bounce);
}

.btn-primary {
  background: var(--accent-color);
  color: #fff;
  box-shadow: 0 4px 10px var(--accent-glow);
}

.btn-primary:hover {
  opacity: 0.9;
  transform: translateY(-2px);
  box-shadow: 0 6px 14px var(--accent-glow);
}

.btn-secondary {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

/* Table Card Container */
.table-container-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  backdrop-filter: var(--backdrop-blur);
  border-radius: var(--border-radius-md);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.table-responsive {
  max-height: calc(100vh - 280px);
  overflow-y: auto;
  position: relative;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.85rem;
}

.data-table th {
  position: sticky;
  top: 0;
  background: var(--bg-sidebar);
  color: var(--text-primary);
  font-weight: 600;
  padding: 14px 16px;
  border-bottom: 2px solid var(--border-color);
  z-index: 1;
}

.data-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-secondary);
  vertical-align: middle;
}

.data-table tr:hover td {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

[data-theme="dark"] .data-table tr:hover td {
  background: rgba(255, 255, 255, 0.03);
}

/* Table cell specific elements */
.product-name-cell {
  font-weight: 600;
  color: var(--text-primary);
  max-width: 250px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.location-badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 6px;
  background: var(--border-color);
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.75rem;
}

/* Status Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.badge-success {
  background-color: var(--success-bg);
  color: var(--success-color);
}

.badge-warning {
  background-color: var(--warning-bg);
  color: var(--warning-color);
}

.badge-danger {
  background-color: var(--danger-bg);
  color: var(--danger-color);
}

.action-buttons {
  display: flex;
  gap: 8px;
}

.icon-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: 1px solid var(--border-color);
  background: transparent;
  color: var(--text-secondary);
  transition: all var(--transition-speed);
}

.icon-btn:hover {
  background: var(--bg-primary);
  color: var(--text-primary);
  border-color: var(--text-secondary);
}

.icon-btn.edit:hover {
  color: var(--accent-color);
  border-color: var(--accent-color);
}

.icon-btn.delete:hover {
  color: var(--danger-color);
  border-color: var(--danger-color);
}

.icon-btn svg {
  width: 14px;
  height: 14px;
}

/* Table Pagination Footer */
.table-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.pagination-controls {
  display: flex;
  gap: 8px;
}

.pagination-btn {
  padding: 6px 12px;
  border-radius: var(--border-radius-sm);
  border: 1px solid var(--border-color);
  background: transparent;
  color: var(--text-primary);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all var(--transition-speed);
}

.pagination-btn:hover:not(:disabled) {
  background: var(--border-color);
}

.pagination-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ==========================================================================
   Modals & Forms
   ========================================================================== */

.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(8px);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease;
}

.modal-backdrop.show {
  display: flex;
}

.modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  backdrop-filter: var(--backdrop-blur);
  width: 100%;
  max-width: 580px;
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: scaleUp 0.3s var(--transition-bounce);
}

@keyframes scaleUp {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  font-size: 1.25rem;
  font-weight: 700;
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  transition: all var(--transition-speed);
}

.modal-close:hover {
  background: var(--bg-primary);
  color: var(--text-primary);
}

.modal-close svg {
  width: 18px;
  height: 18px;
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  max-height: calc(100vh - 200px);
}

/* Form layouts */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.form-group.full-width {
  grid-column: span 2;
}

.form-group label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-input {
  padding: 10px 14px;
  border-radius: var(--border-radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: 0.9rem;
  outline: none;
  transition: all var(--transition-speed);
}

.form-input:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* Toast Notifications */

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 1000;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-left: 4px solid var(--accent-color);
  padding: 12px 20px;
  border-radius: var(--border-radius-sm);
  box-shadow: var(--shadow-md);
  backdrop-filter: var(--backdrop-blur);
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.85rem;
  font-weight: 500;
  animation: slideIn 0.3s var(--transition-bounce);
}

.toast.success { border-left-color: var(--success-color); }
.toast.warning { border-left-color: var(--warning-color); }
.toast.danger { border-left-color: var(--danger-color); }

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

/* Quick Loading spinner */
.loader {
  border: 3px solid var(--border-color);
  border-top: 3px solid var(--accent-color);
  border-radius: 50%;
  width: 24px;
  height: 24px;
  animation: spin 0.8s linear infinite;
}

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

/* Row indicators for different packaging sheets */
.row-tuyp-tem td:first-child {
  border-left: 3px solid #ec4899 !important;
}

/* ==========================================================================
   Dedicated Login Screen Styling
   ========================================================================== */

.login-screen-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: radial-gradient(circle at 10% 20%, rgb(4, 28, 68) 0%, rgb(10, 48, 110) 90%);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  overflow-y: auto;
  padding: 20px;
  box-sizing: border-box;
}

.login-card {
  width: 100%;
  max-width: 440px;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 16px;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  padding: 32px;
  box-sizing: border-box;
  color: #ffffff;
}

.login-logo {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.login-logo svg {
  width: 40px;
  height: 40px;
  fill: #3b82f6;
}

.login-logo-text {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: 1px;
  background: linear-gradient(to right, #3b82f6, #60a5fa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.login-header {
  text-align: center;
  margin-bottom: 28px;
}

.login-header h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 8px;
}

.login-header p {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.6);
  line-height: 1.4;
  margin: 0;
}

.login-tab-btn {
  flex: 1;
  padding: 12px;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.5);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.3s ease;
  border-bottom: 2px solid transparent;
}

.login-tab-btn:hover {
  color: #ffffff;
}

.login-tab-btn.active {
  color: #3b82f6;
  border-bottom-color: #3b82f6;
}

.login-form-group {
  margin-bottom: 20px;
  text-align: left;
}

.login-form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 8px;
  color: rgba(255, 255, 255, 0.8);
}

.login-input {
  width: 100%;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: #ffffff;
  font-size: 0.95rem;
  box-sizing: border-box;
  transition: all 0.3s ease;
}

.login-input:focus {
  outline: none;
  border-color: #3b82f6;
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
}

.login-submit-btn {
  width: 100%;
  padding: 12px;
  background: #3b82f6;
  border: none;
  border-radius: 8px;
  color: #ffffff;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 12px;
}

.login-submit-btn:hover {
  background: #2563eb;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.login-hint {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 12px;
  line-height: 1.4;
  display: block;
}