/* style.css - Minimalist Packaging Manager Design System */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

/* Color Variables & Themes */
:root {
  --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  
  /* Light Theme */
  --bg-app: #f8fafc;
  --bg-sidebar: #ffffff;
  --bg-card: #ffffff;
  --bg-input: #f1f5f9;
  
  --border-color: #e2e8f0;
  --border-focus: #4f46e5;
  
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  
  --primary: #4f46e5; /* Indigo */
  --primary-hover: #4338ca;
  --primary-light: #e0e7ff;
  
  --success: #10b981;
  --success-light: #d1fae5;
  
  --warning: #f59e0b;
  --warning-light: #fef3c7;
  
  --danger: #ef4444;
  --danger-light: #fee2e2;
  
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.05), 0 2px 4px -2px rgb(0 0 0 / 0.05);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.05), 0 4px 6px -4px rgb(0 0 0 / 0.05);
  
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
}

[data-theme="dark"] {
  /* Dark Theme */
  --bg-app: #0b0f19;
  --bg-sidebar: #111827;
  --bg-card: #1f2937;
  --bg-input: #374151;
  
  --border-color: #374151;
  --border-focus: #6366f1;
  
  --text-primary: #f9fafb;
  --text-secondary: #d1d5db;
  --text-muted: #6b7280;
  
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-light: rgba(99, 102, 241, 0.15);
  
  --success: #34d399;
  --success-light: rgba(52, 211, 153, 0.15);
  
  --warning: #fbbf24;
  --warning-light: rgba(251, 191, 36, 0.15);
  
  --danger: #f87171;
  --danger-light: rgba(248, 113, 113, 0.15);
  
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.5);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.3), 0 2px 4px -2px rgb(0 0 0 / 0.3);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.4), 0 4px 6px -4px rgb(0 0 0 / 0.4);
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-app);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  overflow-x: hidden;
  transition: background-color var(--transition-normal), color var(--transition-normal);
}

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

/* Sidebar Navigation */
.sidebar {
  width: 260px;
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  padding: 24px;
  flex-shrink: 0;
  transition: background-color var(--transition-normal), border-color var(--transition-normal);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 40px;
}

.brand-icon {
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
  color: #fff;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px var(--primary-light);
}

.brand-name {
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.025em;
  background: linear-gradient(135deg, var(--text-primary), var(--text-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.nav-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
  list-style: none;
  flex-grow: 1;
}

.nav-item a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  transition: all var(--transition-fast);
  cursor: pointer;
}

.nav-item a:hover {
  background-color: var(--bg-input);
  color: var(--text-primary);
}

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

.nav-item svg {
  width: 20px;
  height: 20px;
  stroke-width: 2;
}

.sidebar-footer {
  margin-top: auto;
  border-top: 1px solid var(--border-color);
  padding-top: 20px;
}

/* Theme Toggle Button */
.theme-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background-color: var(--bg-input);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.theme-toggle:hover {
  border-color: var(--border-color);
  color: var(--text-primary);
}

.theme-toggle svg {
  width: 18px;
  height: 18px;
}

/* Main Content Area */
.main-content {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow-y: auto;
  padding: 32px 40px;
}

/* Header Section */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
  gap: 20px;
}

.header-title h1 {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.header-title p {
  font-size: 0.95rem;
  color: var(--text-muted);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Controls, Inputs & Buttons */
.search-box {
  position: relative;
  width: 280px;
}

.search-box input {
  width: 100%;
  padding: 10px 16px 10px 42px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background-color: var(--bg-card);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  outline: none;
  transition: all var(--transition-fast);
}

.search-box input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.search-box svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--text-muted);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  outline: none;
}

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

.btn-primary:hover {
  background-color: var(--primary-hover);
  box-shadow: 0 4px 12px var(--primary-light);
}

.btn-secondary {
  background-color: var(--bg-card);
  border-color: var(--border-color);
  color: var(--text-secondary);
}

.btn-secondary:hover {
  background-color: var(--bg-input);
  color: var(--text-primary);
}

/* Dashboard Statistics Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
  margin-bottom: 32px;
}

.stat-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--primary);
}

.stat-card.blue::before { background: var(--primary); }
.stat-card.green::before { background: var(--success); }
.stat-card.yellow::before { background: var(--warning); }
.stat-card.red::before { background: var(--danger); }

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.stat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.stat-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-icon-wrapper {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-icon-wrapper.blue { background-color: var(--primary-light); color: var(--primary); }
.stat-icon-wrapper.yellow { background-color: var(--warning-light); color: var(--warning); }
.stat-icon-wrapper.green { background-color: var(--success-light); color: var(--success); }
.stat-icon-wrapper.red { background-color: var(--danger-light); color: var(--danger); }

.stat-icon-wrapper svg {
  width: 18px;
  height: 18px;
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}

.stat-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.charts-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin-bottom: 32px;
}

@media (max-width: 1024px) {
  .charts-grid {
    grid-template-columns: 1fr;
  }
  .charts-grid .card:first-child {
    grid-column: span 1 !important;
  }
}

.card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-normal);
}

.card-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chart-container {
  height: 240px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Catalog Filter Bar */
.filter-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 24px;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.select-filter {
  padding: 10px 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background-color: var(--bg-card);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  outline: none;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.select-filter:focus {
  border-color: var(--border-focus);
}

/* Packaging Grid & Table */
.table-container {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
}

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

.data-table th {
  padding: 16px 24px;
  background-color: var(--bg-app);
  border-bottom: 1px solid var(--border-color);
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
}

.data-table td {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.95rem;
  color: var(--text-primary);
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

.data-table tbody tr:hover td {
  background-color: var(--bg-app);
}

/* Badge Styles */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: capitalize;
}

.badge.success { background-color: var(--success-light); color: var(--success); }
.badge.warning { background-color: var(--warning-light); color: var(--warning); }
.badge.danger { background-color: var(--danger-light); color: var(--danger); }
.badge.info { background-color: var(--primary-light); color: var(--primary); }

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: currentColor;
}

/* Tab Views */
.tab-content {
  display: none;
  animation: fadeIn var(--transition-normal) forwards;
}

.tab-content.active {
  display: block;
}

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

/* Modal Dialog */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 500px;
  max-width: 90%;
  box-shadow: var(--shadow-lg);
  transform: scale(0.95);
  transition: all var(--transition-normal);
}

.modal-overlay.active .modal {
  transform: scale(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.15rem;
  font-weight: 700;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-sm);
  display: flex;
  transition: all var(--transition-fast);
}

.modal-close:hover {
  background-color: var(--bg-input);
  color: var(--text-primary);
}

.modal-close svg {
  width: 20px;
  height: 20px;
}

.modal-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: 70vh;
  overflow-y: auto;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-input, .form-select, .form-textarea {
  padding: 10px 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background-color: var(--bg-card);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  outline: none;
  transition: all var(--transition-fast);
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.form-textarea {
  resize: vertical;
  min-height: 80px;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* Printers Grid */
.printers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}

.printer-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-normal);
}

.printer-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.printer-name {
  font-size: 1.1rem;
  font-weight: 700;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.printer-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  background-color: var(--bg-app);
  padding: 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.printer-stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

.printer-stat-value {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.printer-meta {
  font-size: 0.85rem;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.printer-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: auto;
  border-top: 1px solid var(--border-color);
  padding-top: 16px;
}

/* SVG Chart Aesthetics */
.chart-axis line, .chart-axis path {
  stroke: var(--border-color);
}
.chart-axis text {
  fill: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 10px;
}
.chart-bar {
  rx: 4;
  transition: fill var(--transition-fast), height var(--transition-normal), y var(--transition-normal);
}
.chart-gridline {
  stroke: var(--border-color);
  stroke-dasharray: 4;
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 16px;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.pagination-controls {
  display: flex;
  gap: 8px;
}

.pagination-btn {
  padding: 6px 12px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.pagination-btn:hover {
  background-color: var(--bg-input);
  color: var(--text-primary);
}

.pagination-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Toast Container */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 1100;
}

.toast {
  background-color: var(--bg-card);
  border-left: 4px solid var(--primary);
  border-top: 1px solid var(--border-color);
  border-right: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 16px 20px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-size: 0.9rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 12px;
  animation: slideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

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

/* Cabinet & Shelf Layouts for Locations Tab */
.area-btn {
  padding: 10px 20px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  font-family: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.area-btn:hover {
  background-color: var(--bg-input);
  color: var(--text-primary);
}

.area-btn.active {
  background-color: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

.cabinet-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-sm);
}

.cabinet-card:hover {
  border-color: var(--border-focus);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.cabinet-card.active {
  border-color: var(--primary);
  background-color: var(--primary-light);
}

.cabinet-card-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-primary);
}

.cabinet-card-count {
  font-size: 0.8rem;
  color: var(--text-muted);
}

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

.shelf-cell {
  background-color: var(--bg-card);
  border: 1.5px dashed var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.shelf-cell:hover {
  border-style: solid;
  border-color: var(--border-focus);
  background-color: var(--primary-light);
}

.shelf-cell.active {
  border-style: solid;
  border-color: var(--primary);
  background-color: var(--primary);
}

.shelf-cell.active .shelf-cell-code {
  color: #ffffff;
}

.shelf-cell.active .shelf-cell-count {
  color: rgba(255, 255, 255, 0.8);
}

.shelf-cell-code {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text-primary);
}

.shelf-cell-count {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Custom Styles for Warehouse Layout */
.btn-confirm {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  background-color: transparent;
  border: 1px solid var(--primary);
  color: var(--primary);
  transition: all var(--transition-fast);
  white-space: nowrap;
}

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

.btn-confirm.success {
  background-color: var(--success-light);
  border-color: var(--success);
  color: var(--success);
}

.badge.badge-muted {
  background-color: var(--bg-card);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
}

.badge.text-normal {
  text-transform: none !important;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
.spinner {
  animation: spin 1s linear infinite;
}

/* ==========================================================================
   Authentication & Gatekeeper Styles
   ========================================================================== */
.auth-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  background: radial-gradient(circle at 80% 20%, rgba(99, 102, 241, 0.15), transparent 45%),
              radial-gradient(circle at 15% 85%, rgba(16, 185, 129, 0.08), transparent 45%),
              var(--bg-app);
  z-index: 9999;
  overflow-y: auto;
  padding: 20px;
  transition: background-color var(--transition-normal);
}

.auth-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 440px;
  max-width: 100%;
  padding: 40px;
  box-shadow: var(--shadow-lg), 0 20px 25px -5px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  animation: authFadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes authFadeIn {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

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

.auth-logo {
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
  color: #ffffff;
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px auto;
  box-shadow: 0 4px 14px var(--primary-light);
}

.auth-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.auth-header p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.auth-form.hidden {
  display: none !important;
}

/* Password Toggle Suffix */
.input-wrapper {
  position: relative;
  width: 100%;
  display: flex;
}

.input-wrapper input {
  width: 100%;
  padding-right: 44px; /* Space for the toggle button */
}

.password-toggle-btn {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: color var(--transition-fast);
}

.password-toggle-btn:hover {
  color: var(--text-secondary);
}

.auth-submit-btn {
  width: 100%;
  padding: 12px;
  justify-content: center;
  font-size: 0.95rem;
  margin-top: 6px;
}

.auth-switch {
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 12px;
}

.auth-switch a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  margin-left: 4px;
  transition: color var(--transition-fast);
}

.auth-switch a:hover {
  text-decoration: underline;
  color: var(--primary-hover);
}

.auth-theme-toggle-wrapper {
  position: absolute;
  top: 24px;
  right: 24px;
}

.auth-theme-toggle-wrapper .theme-toggle {
  width: auto;
  gap: 8px;
}

/* User Profile in Sidebar */
.user-profile-section {
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 12px;
  animation: fadeIn var(--transition-normal) forwards;
}

.user-profile-section.hidden {
  display: none !important;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
  flex-shrink: 0;
  box-shadow: inset 0 0 0 1px rgba(99, 102, 241, 0.1);
}

.logout-btn.hidden {
  display: none !important;
}

.logout-btn:hover {
  background-color: var(--danger-light) !important;
  color: var(--danger) !important;
}

/* General hidden class */
.hidden {
  display: none !important;
}

/* ==========================================================================
   Employee Management Styles
   ========================================================================== */
.employee-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
  align-items: start;
  margin-top: 24px;
}

@media (max-width: 1024px) {
  .employee-grid {
    grid-template-columns: 1fr;
  }
}

/* Department Badges */
.badge.dept-kho {
  background-color: rgba(239, 68, 68, 0.08);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.15);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
}

.badge.dept-rd {
  background-color: rgba(34, 197, 94, 0.08);
  color: #22c55e;
  border: 1px solid rgba(34, 197, 94, 0.15);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
}

.badge.dept-ktv {
  background-color: rgba(245, 158, 11, 0.08);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.15);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
}

/* Table styling updates for employees */
.employee-table th {
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-color);
  padding: 14px 16px;
  font-size: 0.85rem;
}

.employee-table td {
  padding: 14px 16px;
  vertical-align: middle;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.9rem;
}

/* Action buttons in tables */
.btn-action-sm {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background-color: var(--bg-card);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  padding: 0;
}

.btn-action-sm:hover {
  background-color: var(--bg-app);
  color: var(--primary);
  border-color: var(--primary-light);
}

.btn-action-sm.btn-delete:hover {
  background-color: var(--danger-light);
  color: var(--danger);
  border-color: var(--danger-light);
}

.btn-action-sm.btn-approve:hover {
  background-color: var(--success-light);
  color: var(--success);
  border-color: var(--success-light);
}

/* Header updates to match screenshot */
.header-dept-select {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color var(--transition-fast);
  height: 38px;
}

.header-dept-select:focus {
  border-color: var(--primary);
  outline: none;
}

.btn-sync-custom {
  background-color: transparent !important;
  border: 1px solid #10b981 !important;
  color: #10b981 !important;
  font-weight: 500;
  transition: all var(--transition-fast);
  height: 38px;
}

.btn-sync-custom:hover {
  background-color: rgba(16, 185, 129, 0.08) !important;
}

.header-profile-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  height: 38px;
}

.header-profile-btn:hover {
  border-color: var(--primary);
  background-color: var(--bg-app);
}

/* Sidebar full-width Add Product button */
.nav-btn-add {
  margin: 12px 16px;
  padding: 10px 16px;
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
  color: #ffffff !important;
  border-radius: var(--radius-md);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 10px rgba(99, 102, 241, 0.25);
  transition: all var(--transition-fast);
  cursor: pointer;
}

.nav-btn-add:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(99, 102, 241, 0.35);
  filter: brightness(1.1);
}

/* ==========================================================================
   Disposal Management and Print Styles
   ========================================================================== */
.disp-row-expired {
  color: var(--danger);
  font-weight: 600;
  font-size: 0.85rem;
}

.badge.badge-contact-pending {
  background-color: rgba(245, 158, 11, 0.08);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.15);
}

.badge.badge-contact-sent {
  background-color: rgba(16, 185, 129, 0.08);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.15);
}

/* Printer list grouping container */
.printer-group-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: var(--shadow-sm);
  transition: border-color var(--transition-fast);
}

.printer-group-card:hover {
  border-color: var(--border-focus);
}

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

.printer-group-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-primary);
}

.printer-group-count {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--danger);
}

.printer-group-actions {
  display: flex;
  gap: 8px;
}

/* Print Overrides */
@media print {
  /* Hide every UI element on screen */
  body {
    background-color: #ffffff !important;
    color: #000000 !important;
    font-family: "Times New Roman", Times, serif !important;
    font-size: 12pt !important;
  }
  
  .app-container,
  .modal-overlay,
  .toast-container,
  aside,
  header,
  nav,
  button,
  .btn,
  .area-btn {
    display: none !important;
  }

  /* Show the print area */
  #disposal-print-area {
    display: block !important;
    visibility: visible !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  /* Standard document styling for print layout */
  .print-document {
    padding: 20px;
    background-color: #ffffff;
  }

  .print-header {
    text-align: center;
    margin-bottom: 30px;
  }

  .print-title {
    font-size: 18pt;
    font-weight: bold;
    text-transform: uppercase;
    margin-top: 10px;
    margin-bottom: 5px;
  }

  .print-subtitle {
    font-size: 10pt;
    font-style: italic;
    margin-bottom: 20px;
  }

  .print-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 30px;
  }

  .print-table th, .print-table td {
    border: 1px solid #000000;
    padding: 8px;
    font-size: 10pt;
    text-align: left;
  }

  .print-table th {
    background-color: #f2f2f2 !important;
    font-weight: bold;
    text-align: center;
  }

  .print-table td.center {
    text-align: center;
  }

  .print-signatures {
    width: 100%;
    margin-top: 40px;
    border: none;
  }

  .print-signatures td {
    border: none !important;
    width: 33%;
    text-align: center;
    font-size: 11pt;
    padding-bottom: 80px;
  }
}

/* Missing Colors Tab Custom Styles */
.stat-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 0.95rem;
}

.stat-badge-error {
  background-color: var(--danger-light);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.badge.badge-cpc1 {
  background-color: var(--primary-light);
  color: var(--primary);
}

.badge.badge-bfo {
  background-color: var(--success-light);
  color: var(--success);
}


