﻿/* =====================================================
   MODERN INVENTORY MANAGEMENT SYSTEM
   Light Theme with Mint Green Accents
   ===================================================== */

/* === LIGHT THEME (DEFAULT) === */
:root,
[data-theme="light"] {
  /* Brand Colors - Modern Blue */
  --primary: #3b82f6;
  --primary-light: #60a5fa;
  --primary-glow: rgba(59, 130, 246, 0.2);
  --success: #22c55e;
  --success-glow: rgba(34, 197, 94, 0.2);
  --warning: #f59e0b;
  --warning-glow: rgba(245, 158, 11, 0.2);
  --error: #ef4444;
  --error-glow: rgba(239, 68, 68, 0.2);
  --purple: #8b5cf6;
  --purple-glow: rgba(139, 92, 246, 0.2);

  /* Background Colors - Soft Mint Green */
  --bg-body: #e8f5e9;
  --bg-body-solid: #e8f5e9;
  --bg-sidebar: #ffffff;
  --bg-card: #ffffff;
  --bg-hover: rgba(0, 0, 0, 0.04);

  /* Text Colors - Dark for Readability */
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;

  /* Border & Dividers */
  --border-color: rgba(0, 0, 0, 0.08);
  --border-glow: 0 0 10px rgba(59, 130, 246, 0.1);

  /* Shadows - Soft & Modern */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08), 0 2px 4px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.12), 0 4px 12px rgba(0, 0, 0, 0.06);
  --shadow-glow: 0 0 20px rgba(59, 130, 246, 0.1);

  /* Spacing - Relaxed */
  --spacing-xs: 0.25rem;
  --spacing-sm: 0.75rem;
  --spacing-md: 1.25rem;
  --spacing-lg: 2rem;
  --spacing-xl: 3rem;

  /* Border Radius - Softer & Rounder */
  --radius-sm: 0.625rem;
  --radius-md: 1rem;
  --radius-lg: 1.25rem;
  --radius-xl: 1.5rem;
  --radius-2xl: 2rem;

  /* Transitions */
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* === RESET & BASE === */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  scrollbar-width: thin;
  scrollbar-color: var(--bg-hover) var(--bg-body);
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-body);
  overflow-x: hidden;
  min-height: 100vh;
  position: relative;
}

/* Clean background - no particles for light theme */
body::before {
  display: none;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-body);
}

::-webkit-scrollbar-thumb {
  background: var(--bg-hover);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-secondary);
}

/* === LAYOUT === */
.app-container {
  display: flex;
  min-height: 100vh;
  background: var(--bg-body);
}

/* === SIDEBAR (Modern Dark Glassmorphism) === */
.sidebar {
  width: 280px;
  background: rgba(15, 23, 42, 0.95);
  /* Slate-900 with slight transparency */
  backdrop-filter: blur(12px);
  /* Glassmorphism effect */
  -webkit-backdrop-filter: blur(12px);
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  /* Subtle white border */
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
  left: 0;
  top: 0;
  z-index: 100;
  transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
  color: #94a3b8;
  /* Slate-400 text */
}

.sidebar.collapsed {
  width: 80px;
}

.sidebar-toggle {
  position: absolute;
  right: 1rem;
  top: 1.5rem;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  z-index: 101;
}

.sidebar-toggle:hover {
  background: var(--bg-hover);
  border-color: var(--primary);
  color: var(--primary);
  transform: scale(1.05);
}

.sidebar-toggle svg {
  transition: transform 0.3s;
}

.sidebar.collapsed .sidebar-toggle svg {
  transform: rotate(180deg);
}


/* Sidebar Header */
.sidebar-header {
  padding: 2rem 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo-title {
  color: #f8fafc;
  /* Slate-50 */
}

.logo-subtitle {
  color: #64748b;
  /* Slate-500 */
}

/* Sidebar Navigation */
.nav-menu {
  flex: 1;
  padding: 1.5rem 1rem;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.875rem 1rem;
  margin-bottom: 0.5rem;
  border-radius: 0.75rem;
  color: #94a3b8;
  /* Slate-400 */
  text-decoration: none;
  transition: all 0.3s ease;
  font-weight: 500;
  border: 1px solid transparent;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #e2e8f0;
  /* Slate-200 */
  transform: translateX(4px);
}

.nav-item.active {
  background: rgba(99, 102, 241, 0.15);
  /* Indigo-500 with opacity */
  color: #818cf8;
  /* Indigo-400 */
  border: 1px solid rgba(99, 102, 241, 0.3);
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.1);
}

.nav-item.active .nav-icon {
  color: #818cf8;
  filter: drop-shadow(0 0 8px rgba(99, 102, 241, 0.4));
}

.nav-divider {
  background: rgba(255, 255, 255, 0.1);
}

.nav-section-title {
  color: #475569;
  /* Slate-600 */
}

/* Sidebar Footer */
.sidebar-footer {
  padding: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(0, 0, 0, 0.2);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.user-avatar {
  background: rgba(99, 102, 241, 0.2);
  color: #818cf8;
  border: 1px solid rgba(99, 102, 241, 0.3);
}

.user-name {
  color: #f1f5f9;
  /* Slate-100 */
}

.user-role {
  color: #64748b;
  /* Slate-500 */
}

/* === MAIN CONTENT === */
.main-content {
  flex: 1;
  margin-left: 280px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar.collapsed~.main-content {
  margin-left: 80px;
}

/* Header */
.header {
  background: var(--bg-card);
  padding: var(--spacing-md) var(--spacing-xl);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 50;
  border-radius: var(--radius-xl);
  margin: var(--spacing-md) var(--spacing-xl) 0;
  box-shadow: var(--shadow-sm);
  gap: var(--spacing-md);
}

.header-left {
  display: flex;
  align-items: center;
  gap: var(--spacing-lg);
}

/* Stats Info */
.header-stats {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.stats-number {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}

.stats-label {
  display: flex;
  flex-direction: column;
  font-size: 0.75rem;
  color: var(--text-secondary);
  line-height: 1.3;
}

.stats-period {
  color: var(--text-muted);
  font-size: 0.65rem;
}

/* Tab Navigation */
.header-tabs {
  display: flex;
  background: var(--bg-hover);
  border-radius: var(--radius-xl);
  padding: 4px;
}

.header-tab {
  padding: 0.5rem 1.25rem;
  border: none;
  background: transparent;
  border-radius: var(--radius-lg);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
}

.header-tab:hover {
  color: var(--text-primary);
}

.header-tab.active {
  background: var(--bg-card);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}

/* Mobile Menu Toggle - Hidden on Desktop */
.mobile-menu-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border: none;
  background: var(--bg-hover);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.mobile-menu-toggle:hover {
  background: var(--primary);
  color: white;
}

/* Header Center - Page Title */
.header-center {
  flex: 1;
  text-align: center;
  display: none;
}

#page-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

#page-subtitle {
  color: var(--text-secondary);
  font-size: 0.8rem;
}

.header-right {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
}

.header-time {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 500;
  padding: 0.5rem 1rem;
  background: var(--bg-hover);
  border-radius: var(--radius-lg);
}

/* User Avatar in Header */
.header-user {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: 0.4rem 0.75rem 0.4rem 0.4rem;
  background: var(--bg-hover);
  border-radius: var(--radius-xl);
  cursor: pointer;
  transition: var(--transition);
}

.header-user:hover {
  background: var(--primary);
}

.header-user:hover .header-username {
  color: white;
}

.header-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.header-username {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-primary);
  transition: var(--transition);
}

/* Content Area */
.content-area {
  flex: 1;
  padding: 0 var(--spacing-xl) var(--spacing-xl);
}

/* === CARDS === */
/* === CARDS === */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  padding: var(--spacing-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: rgba(14, 165, 233, 0.3);
}

.card-header {
  margin-bottom: var(--spacing-md);
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: var(--spacing-sm);
}

.card-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

/* === STATS CARDS === */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-lg);
}

/* Modern Layout */
.stat-card {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  position: relative;
  overflow: hidden;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  height: 140px;
}

.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.stat-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.5rem;
  z-index: 2;
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-top: auto;
  z-index: 2;
}

.stat-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.stat-icon-wrapper {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  transition: all 0.3s ease;
}

/* Gradient Variants */
.stat-card.blue {
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  border-color: #bfdbfe;
}

.stat-card.blue .stat-icon-wrapper {
  background: #3b82f6;
  color: white;
  box-shadow: 0 4px 6px -1px rgba(59, 130, 246, 0.3);
}

.stat-card.orange {
  background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
  border-color: #fed7aa;
}

.stat-card.orange .stat-icon-wrapper {
  background: #f97316;
  color: white;
  box-shadow: 0 4px 6px -1px rgba(249, 115, 22, 0.3);
}

.stat-card.green {
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
  border-color: #bbf7d0;
}

.stat-card.green .stat-icon-wrapper {
  background: #22c55e;
  color: white;
  box-shadow: 0 4px 6px -1px rgba(34, 197, 94, 0.3);
}

.stat-card.purple {
  background: linear-gradient(135deg, #faf5ff 0%, #f3e8ff 100%);
  border-color: #e9d5ff;
}

.stat-card.purple .stat-icon-wrapper {
  background: #a855f7;
  color: white;
  box-shadow: 0 4px 6px -1px rgba(168, 85, 247, 0.3);
}

/* Remove old pseudoelements */
.stat-card::before {
  display: none;
}


/* === BUTTONS === */
.btn {
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius-lg);
  border: 1px solid transparent;
  font-weight: 500;
  font-size: 0.875rem;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-sm);
  text-decoration: none;
  font-family: inherit;
  letter-spacing: 0.01em;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: 0 4px 6px -1px rgba(14, 165, 233, 0.3);
}

.btn-primary:hover {
  background: #0284c7;
  /* Darker Sky Blue */
  box-shadow: 0 8px 12px -1px rgba(14, 165, 233, 0.4);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border-color: var(--border-color);
}

.btn-secondary:hover {
  background: var(--bg-hover);
  border-color: var(--primary);
}

.btn-success {
  background: var(--success);
  color: white;
  box-shadow: 0 4px 6px -1px rgba(16, 185, 129, 0.3);
}

.btn-success:hover {
  background: #059669;
  box-shadow: 0 8px 12px -1px rgba(16, 185, 129, 0.4);
  transform: translateY(-1px);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.1);
  color: var(--error);
  border-color: rgba(239, 68, 68, 0.2);
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: var(--error);
}

.btn-sm {
  padding: 0.4rem 0.8rem;
  font-size: 0.75rem;
  border-radius: var(--radius-md);
}


.btn-danger {
  background: rgba(239, 68, 68, 0.1);
  color: var(--error);
  border: 1px solid var(--error);
}

.btn-danger:hover {
  background: var(--error);
  color: white;
  box-shadow: 0 0 15px var(--error-glow);
}

.btn-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.btn-icon:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* === FORMS === */
.form-group {
  margin-bottom: var(--spacing-md);
}

.form-label {
  display: block;
  margin-bottom: var(--spacing-xs);
  font-weight: 500;
  color: var(--text-secondary);
  font-size: 0.85rem;
  letter-spacing: 0.01em;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--bg-body);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.9rem;
  transition: var(--transition);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

.form-input:hover,
.form-select:hover,
.form-textarea:hover {
  border-color: rgba(14, 165, 233, 0.3);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.2);
  background: rgba(14, 165, 233, 0.02);
}

/* === TABLES === */
.table-container {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
}

.table {
  width: 100%;
  border-collapse: separate;
  /* Changed for border-radius */
  border-spacing: 0;
  background: transparent;
}

.table th {
  background: var(--bg-hover);
  color: var(--text-secondary);
  padding: 1rem 1.5rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.table td {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
  font-size: 0.9rem;
  vertical-align: middle;
}

.table tbody tr {
  transition: var(--transition);
}

.table tbody tr:hover {
  background: rgba(14, 165, 233, 0.02);
  /* Subtle blue tint */
}

.table tbody tr:last-child td {
  border-bottom: none;
}

/* === QUICK ACTIONS (New) === */
.quick-actions-grid {
  display: grid;
  gap: var(--spacing-md);
}

.action-card {
  background: var(--bg-hover);
  padding: var(--spacing-lg);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid transparent;
  text-decoration: none;
}

.action-card:hover {
  background: var(--bg-card);
  border-color: var(--primary);
  transform: translateX(4px);
}

.action-content {
  display: flex;
  flex-direction: column;
}

.action-title {
  color: var(--text-primary);
  font-weight: 600;
  margin-bottom: 4px;
}

.action-desc {
  color: var(--text-secondary);
  font-size: 0.8rem;
}

.action-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(59, 130, 246, 0.1);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

/* Special Action Cards (Green/Red) */
.action-card.green {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.action-card.green:hover {
  background: rgba(16, 185, 129, 0.2);
  border-color: var(--success);
}

.action-card.green .action-title {
  color: var(--success);
}

.action-card.green .action-icon {
  background: rgba(16, 185, 129, 0.2);
  color: var(--success);
}

.action-card.red {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.action-card.red:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: var(--error);
}

.action-card.red .action-title {
  color: var(--error);
}

.action-card.red .action-icon {
  background: rgba(239, 68, 68, 0.2);
  color: var(--error);
}


/* === MODAL === */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-overlay.active {
  display: flex;
}

.modal {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  width: 90%;
  max-width: 600px;
  max-height: 90vh;
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.modal-header {
  padding: var(--spacing-lg) var(--spacing-xl);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-hover);
}

.modal-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
}

.modal-close:hover {
  color: var(--text-primary);
}

.modal-body {
  padding: var(--spacing-xl);
  max-height: calc(90vh - 100px);
  overflow-y: auto;
}

/* === ANIMATIONS === */
@keyframes contentFadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in-content {
  animation: contentFadeIn 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* === SKELETON LOADING === */
@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }

  100% {
    background-position: 200% 0;
  }
}

.skeleton {
  background: var(--bg-hover);
  background-image: linear-gradient(90deg,
      var(--bg-hover) 25%,
      rgba(255, 255, 255, 0.5) 50%,
      var(--bg-hover) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
  color: transparent !important;
}

.skeleton-text {
  height: 1em;
  width: 100%;
  margin-bottom: 0.5rem;
  border-radius: 4px;
}

.skeleton-rect {
  width: 100%;
  height: 100%;
  border-radius: var(--radius-md);
}

/* === UTILITIES === */
.grid {
  display: grid;
  gap: var(--spacing-lg);
}

.grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.flex {
  display: flex;
}

.flex-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.gap-md {
  gap: var(--spacing-md);
}

.mt-lg {
  margin-top: var(--spacing-lg);
}

.text-center {
  text-align: center;
}

/* Responsive */
@media (max-width: 1024px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .main-content {
    margin-left: 0;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .grid-2 {
    grid-template-columns: 1fr;
  }
}

/* === STOCK CARD STYLES === */
.stock-card-container {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-lg);
}

.stock-card-item-info {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--spacing-lg);
}

.info-group {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
}

.info-group label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.info-value {
  font-size: 1rem;
  color: var(--text-primary);
  font-weight: 600;
}

.stock-card-filters {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--spacing-md);
  align-items: end;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
}

.input-group label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.form-control {
  width: 100%;
  padding: var(--spacing-md);
  background: var(--bg-body);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: inherit;
  transition: var(--transition);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

/* Stock Card Timeline */
.timeline-container {
  position: relative;
  padding-left: 40px;
}

.timeline-line {
  position: absolute;
  left: 18px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border-color);
}

.timeline-item {
  position: relative;
  margin-bottom: var(--spacing-lg);
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: var(--spacing-md);
  border: 1px solid var(--border-color);
  transition: var(--transition);
}

.timeline-item:hover {
  border-color: var(--primary);
}

.timeline-dot {
  position: absolute;
  left: -29px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 3px solid var(--primary);
}

.timeline-item.in .timeline-dot {
  border-color: var(--success);
}

.timeline-item.out .timeline-dot {
  border-color: var(--error);
}

.timeline-item.transfer .timeline-dot {
  border-color: var(--warning);
}

.timeline-content {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--spacing-md);
  align-items: center;
}

.timeline-date {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.timeline-type {
  display: inline-block;
  padding: 4px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  text-align: center;
}

.timeline-type.in {
  background: rgba(16, 185, 129, 0.1);
  color: var(--success);
}

.timeline-type.out {
  background: rgba(239, 68, 68, 0.1);
  color: var(--error);
}

.timeline-type.transfer {
  background: rgba(245, 158, 11, 0.1);
  color: var(--warning);
}

.timeline-qty {
  font-weight: 600;
  color: var(--text-primary);
  text-align: center;
}

.timeline-balance {
  font-weight: 600;
  color: var(--primary);
  text-align: center;
}

.timeline-warehouse {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* === TOAST NOTIFICATION === */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  padding: 1rem 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  color: var(--text-primary);
}

.toast.error {
  border-left: 4px solid var(--error);
}

.toast.info {
  border-left: 4px solid var(--primary);
}

/* === LOADING OVERLAY === */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid var(--border-color);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.loading-overlay p {
  margin-top: var(--spacing-lg);
  color: var(--text-primary);
  font-weight: 600;
}

/* === NAV DIVIDER & SECTION TITLE === */
.nav-divider {
  height: 1px;
  background: var(--border-color);
  margin: var(--spacing-md) 0;
}

.nav-section-title {
  padding: var(--spacing-sm) var(--spacing-lg);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--spacing-xs);
}

/* === ALERTS & NOTIFICATIONS === */
.alert-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--error);
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}

.notification-item {
  padding: var(--spacing-md);
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  margin-bottom: var(--spacing-sm);
  cursor: pointer;
  transition: var(--transition);
}

.notification-item:hover {
  border-color: var(--primary);
}

.notification-item.warning {
  border-left: 4px solid var(--warning);
}

.notification-item.critical {
  border-left: 4px solid var(--error);
}

.notification-time {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* === CHARTS === */
.chart-container {
  position: relative;
  height: 300px;
  margin-top: var(--spacing-md);
}

.charts-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--spacing-lg);
  margin-bottom: var(--spacing-xl);
}

/* === FILTERS & TOOLBAR === */
.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-lg);
  flex-wrap: wrap;
  gap: var(--spacing-md);
}

.search-box {
  position: relative;
  flex: 1;
  max-width: 300px;
}

.search-box input {
  width: 100%;
  padding: var(--spacing-md);
  padding-left: 2.5rem;
  background: var(--bg-body);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  transition: var(--transition);
}

.search-box input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.search-icon {
  position: absolute;
  left: var(--spacing-md);
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-secondary);
}

.filter-group {
  display: flex;
  gap: var(--spacing-sm);
  align-items: center;
}

/* === BADGES === */
.badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
}

.badge.success {
  background: rgba(16, 185, 129, 0.1);
  color: var(--success);
}

.badge.warning {
  background: rgba(245, 158, 11, 0.1);
  color: var(--warning);
}

.badge.danger {
  background: rgba(239, 68, 68, 0.1);
  color: var(--error);
}

.badge.info {
  background: rgba(59, 130, 246, 0.1);
  color: var(--primary);
}

/* === ACTION BUTTONS IN TABLE === */
.table .action-buttons {
  display: flex;
  gap: var(--spacing-xs);
}

.table .btn-sm {
  padding: 4px 8px;
  font-size: 0.75rem;
}

/* === SUMMARY SECTION === */
.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--spacing-lg);
  margin-bottom: var(--spacing-xl);
}

.summary-item {
  background: var(--bg-card);
  padding: var(--spacing-lg);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.summary-label {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: var(--spacing-xs);
}

.summary-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
}

/* === EMPTY STATE === */
.empty-state {
  text-align: center;
  padding: var(--spacing-xl);
  color: var(--text-secondary);
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: var(--spacing-md);
  opacity: 0.5;
}

.empty-state-text {
  font-size: 1rem;
  margin-bottom: var(--spacing-md);
}

/* === PROGRESS BAR === */
.progress-bar {
  height: 8px;
  background: var(--bg-hover);
  border-radius: 4px;
  overflow: hidden;
  margin-top: var(--spacing-sm);
}

.progress-fill {
  height: 100%;
  background: var(--primary);
  transition: width 0.3s ease;
}

.progress-fill.success {
  background: var(--success);
}

.progress-fill.warning {
  background: var(--warning);
}

.progress-fill.danger {
  background: var(--error);
}

/* === LIGHT THEME SUPPORT === */
[data-theme="light"] {
  --bg-body: #f8fafc;
  --bg-sidebar: #ffffff;
  --bg-card: #ffffff;
  --bg-hover: #f1f5f9;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --border-color: #e2e8f0;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
}

/* === NOTIFICATION SYSTEM FIXES === */

/* Notification Bell */
.notification-bell {
  position: relative;
}

.notification-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background: var(--error);
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg-body);
}

/* Notification Dropdown */
.notification-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  width: 360px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  z-index: 1000;
  margin-top: var(--spacing-sm);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: var(--transition);
}

.notification-dropdown.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.notification-header {
  padding: var(--spacing-md) var(--spacing-lg);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.notification-header h4 {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
}

.notification-list {
  max-height: 400px;
  overflow-y: auto;
}

.notification-empty {
  padding: var(--spacing-xl);
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* Notification Item in Dropdown */
.notification-item {
  display: flex;
  gap: var(--spacing-md);
  padding: var(--spacing-md);
  border-bottom: 1px solid var(--border-color);
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  background: var(--bg-card);
  /* Overrides */
  border-radius: 0;
  margin-bottom: 0;
  border-top: none;
  border-left: none;
  border-right: none;
}

.notification-item:last-child {
  border-bottom: none;
}

.notification-item:hover {
  background: var(--bg-hover);
}

.notification-item.unread {
  background: rgba(59, 130, 246, 0.05);
}

.notification-item.unread:hover {
  background: rgba(59, 130, 246, 0.1);
}

.notification-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.notification-icon.warning {
  background: rgba(245, 158, 11, 0.1);
  color: var(--warning);
}

.notification-icon.info {
  background: rgba(59, 130, 246, 0.1);
  color: var(--primary);
}

.notification-icon.success {
  background: rgba(16, 185, 129, 0.1);
  color: var(--success);
}

.notification-content {
  flex: 1;
  min-width: 0;
}

.notification-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.notification-message {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 4px;
  line-height: 1.4;
}

.notification-time {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.notification-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
  position: absolute;
  top: var(--spacing-md);
  right: var(--spacing-md);
}

.btn-text {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
}

.btn-text:hover {
  text-decoration: underline;
}

/* =====================================================
   RESPONSIVE DESIGN - MOBILE & TABLET OPTIMIZED
   ===================================================== */

/* === TABLET (768px - 1024px) === */
@media (max-width: 1024px) {

  /* Stats grid - 2 columns on tablet */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-md);
  }

  /* Page title smaller */
  #page-title {
    font-size: 1.5rem;
  }

  #page-subtitle {
    font-size: 0.85rem;
  }

  /* Content padding reduced */
  .content-area {
    padding: 0 var(--spacing-lg) var(--spacing-lg);
  }

  /* Charts grid */
  .charts-grid {
    grid-template-columns: 1fr;
    gap: var(--spacing-md);
  }

  /* Stock card filters */
  .stock-card-filters {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* === MOBILE (<= 768px) - COMPREHENSIVE === */
@media (max-width: 768px) {

  /* === BASE TYPOGRAPHY FOR MOBILE === */
  html {
    font-size: 15px;
  }

  body {
    line-height: 1.7;
  }

  /* Card titles more readable */
  .card-title {
    font-size: 1.1rem;
    font-weight: 600;
  }

  /* Table text more readable */
  .table td,
  .data-table td {
    font-size: 0.9rem;
    line-height: 1.5;
  }

  /* Badge text readable */
  .badge {
    font-size: 0.75rem;
    padding: 0.35rem 0.6rem;
  }

  /* Show hamburger menu on mobile */
  .mobile-menu-toggle {
    display: flex;
    margin-right: 0.5rem;
  }

  .header-left {
    gap: var(--spacing-sm);
    flex-wrap: nowrap;
  }

  /* Hide theme text on really small screens if needed, otherwise keep it */
  .mobile-hide-text {
    display: none;
  }

  /* === SIDEBAR MOBILE BEHAVIOR === */
  .sidebar {
    transform: translateX(-100%);
    z-index: 300;
    width: 280px;
    box-shadow: none;
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    border-radius: 0;
  }

  /* Hide collapsed state effect on mobile */
  .sidebar.collapsed {
    transform: translateX(-100%);
  }

  /* Show sidebar when mobile-visible class is added */
  .sidebar.mobile-visible {
    transform: translateX(0) !important;
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.3);
  }

  /* Sidebar Overlay - for closing sidebar by clicking outside */
  .sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 299;
    backdrop-filter: blur(2px);
    transition: opacity 0.3s;
    opacity: 0;
  }

  .sidebar-overlay.active {
    display: block;
    opacity: 1;
  }

  /* === MAIN CONTENT === */
  .main-content {
    margin-left: 0 !important;
    width: 100%;
  }

  /* === TOGGLE BUTTON === */
  .sidebar-toggle {
    position: absolute;
    right: -12px;
    top: 32px;
    width: 24px;
    height: 24px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    box-shadow: var(--shadow-sm);
    z-index: 10;
    transition: all 0.2s;
  }

  /* Desktop hover only */
  @media (min-width: 769px) {
    .sidebar-toggle:hover {
      background: var(--primary);
      color: white;
      border-color: var(--primary);
    }
  }

  /* === COLLAPSED STATE (Desktop) === */
  .sidebar.collapsed {
    width: 80px;
  }

  .sidebar.collapsed .logo-text-wrapper,
  .sidebar.collapsed .logo-subtitle,
  .sidebar.collapsed .nav-text,
  .sidebar.collapsed .user-details {
    opacity: 0;
    pointer-events: none;
    display: none;
    /* Hide to prevent layout issues */
  }

  .sidebar.collapsed .logo {
    justify-content: center;
  }

  .sidebar.collapsed .logo-icon-wrapper {
    width: 40px;
    height: 40px;
  }

  .sidebar.collapsed .sidebar-header {
    padding: 1.5rem 1rem;
    justify-content: center;
  }

  .sidebar.collapsed .nav-item {
    justify-content: center;
    padding: 0.75rem;
  }

  .sidebar.collapsed .sidebar-footer {
    padding: 1rem;
    justify-content: center;
  }

  .sidebar.collapsed .user-info {
    justify-content: center;
  }

  .sidebar.collapsed .sidebar-toggle svg {
    transform: rotate(180deg);
  }

  /* Adjust Main Content when sidebar is collapsed */
  body:has(.sidebar.collapsed) .main-content {
    margin-left: 80px;
  }

  /* Fallback for browsers not supporting :has */
  .sidebar.collapsed+.main-content {
    margin-left: 80px;
    width: calc(100% - 80px);
    /* Explicit sizing */
  }

  /* Backdrop when sidebar is open (Mobile) */
  .sidebar.mobile-visible::after {
    content: '';
    position: fixed;
    top: 0;
    left: 280px;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: -1;
  }

  /* === CONTENT AREA === */
  .content-area {
    padding: var(--spacing-md);
  }

  /* === STATS GRID === */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-sm);
  }

  .stat-card {
    height: auto;
    min-height: 90px;
    padding: var(--spacing-md);
  }

  .stat-label {
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .stat-value {
    font-size: 1.5rem;
    margin-top: 0.25rem;
    font-weight: 700;
  }

  .stat-icon-wrapper {
    width: 36px;
    height: 36px;
    font-size: 1.25rem;
  }

  .search-box {
    max-width: 100%;
    width: 100%;
  }

  .search-box input {
    font-size: 0.9rem;
    padding: var(--spacing-sm) var(--spacing-md);
  }

  /* === BUTTONS - TOUCH FRIENDLY === */
  .btn {
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    min-height: 40px;
    justify-content: center;
  }

  .btn-icon {
    width: 40px;
    height: 40px;
    font-size: 1.1rem;
  }

  .btn-group {
    display: flex;
    gap: var(--spacing-xs);
  }

  .btn-sm {
    min-height: 36px;
    padding: 0.4rem 0.6rem;
  }

  /* === MOBILE FONT SCALING (STRICT) === */
  @media screen and (max-width: 768px) {
    html {
      font-size: 13px !important;
      /* Force smaller root font size */
    }

    body {
      font-size: 0.9rem !important;
      /* Scale body text */
    }

    h1 {
      font-size: 1.3rem !important;
    }

    h2 {
      font-size: 1.15rem !important;
    }

    h3 {
      font-size: 1rem !important;
    }

    .btn,
    .form-control,
    .form-select {
      font-size: 0.85rem !important;
    }

    /* Force Table Font Reduction */
    .table td,
    .table th,
    .data-table td,
    .data-table th {
      font-size: 0.75rem !important;
      padding: 0.4rem 0.5rem !important;
    }

    /* Sidebar Links */
    .nav-text {
      font-size: 0.85rem !important;
    }
  }

  /* Table Horizontal Scrolling */
  .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    margin-bottom: var(--spacing-md);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
  }

  .table,
  .data-table {
    white-space: nowrap;
    /* Prevent wrapping in cells */
    width: 100%;
    min-width: 600px;
    /* Force scroll for small screens */
    font-size: 0.85rem;
    /* Smaller table text */
  }

  .table th,
  .table td,
  .data-table th,
  .data-table td {
    padding: 0.5rem 0.75rem;
    /* Tighter padding */
    display: table-cell;
    /* Revert block display */
    border: none;
    border-bottom: 1px solid var(--border-color);
  }

  /* Revert Header Hiding */
  .table thead,
  .data-table thead {
    display: table-header-group;
    background: var(--bg-hover);
  }

  .table tr,
  .data-table tr {
    display: table-row;
    margin-bottom: 0;
    box-shadow: none;
    border: none;
    background: transparent;
  }

  /* Hide specific less-important columns on mobile if needed */
  .hide-on-mobile {
    display: none;
  }

  /* Ensure badges and buttons fit */
  .badge {
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
  }

  .btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
  }

  .data-table th,
  .data-table td {
    padding: var(--spacing-sm) var(--spacing-md);
    white-space: nowrap;
  }

  .data-table th {
    font-size: 0.7rem;
    position: sticky;
    top: 0;
    background: var(--bg-hover);
    z-index: 10;
  }

  /* Action buttons in tables */
  .data-table .btn-group {
    flex-wrap: nowrap;
  }

  /* === FORMS === */
  .form-grid {
    grid-template-columns: 1fr !important;
    gap: var(--spacing-md);
  }

  .form-group {
    margin-bottom: var(--spacing-md);
  }

  .form-control,
  .form-input,
  .form-select,
  .form-textarea {
    font-size: 16px;
    padding: var(--spacing-md);
    min-height: 44px;
  }

  .form-label {
    font-size: 0.875rem;
    margin-bottom: var(--spacing-sm);
  }

  /* Form actions */
  .form-actions {
    display: flex;
    flex-direction: column-reverse;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-lg);
  }

  .form-actions .btn {
    width: 100%;
  }

  /* === MODAL === */
  .modal-overlay {
    padding: 0;
  }

  .modal {
    width: 100%;
    max-width: 100%;
    height: 100%;
    max-height: 100%;
    margin: 0;
    border-radius: 0;
    display: flex;
    flex-direction: column;
  }

  .modal-header {
    padding: var(--spacing-md);
    flex-shrink: 0;
  }

  .modal-title {
    font-size: 1.1rem;
  }

  .modal-body {
    flex: 1;
    overflow-y: auto;
    padding: var(--spacing-md);
    max-height: none;
  }

  .modal-close {
    width: 36px;
    height: 36px;
    font-size: 1.5rem;
  }

  /* === CHARTS === */
  .charts-grid {
    grid-template-columns: 1fr !important;
    gap: var(--spacing-md);
  }

  .chart-container {
    height: 250px;
  }

  /* === STOCK CARD === */
  .stock-card-item-info {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-md);
  }

  .stock-card-filters {
    grid-template-columns: 1fr;
    gap: var(--spacing-sm);
  }

  .timeline-content {
    grid-template-columns: 1fr;
    gap: var(--spacing-xs);
    text-align: left;
  }

  .timeline-type,
  .timeline-qty,
  .timeline-balance {
    text-align: left;
  }

  /* === NOTIFICATIONS === */
  .notification-panel {
    position: fixed !important;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    max-width: 100%;
    border-radius: 0;
  }

  .notification-item {
    padding: var(--spacing-sm);
  }

  /* === TOAST === */
  .toast {
    bottom: 1rem;
    right: 1rem;
    left: 1rem;
    max-width: none;
    font-size: 0.875rem;
  }

  /* === BADGES === */
  .badge {
    font-size: 0.7rem;
    padding: 3px 6px;
  }

  /* === GRID LAYOUTS === */
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr !important;
  }

  /* === TOOLBAR === */
  .toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: var(--spacing-sm);
  }

  .filter-group {
    flex-wrap: wrap;
    width: 100%;
  }

  /* === TEXT OVERFLOW === */
  .text-truncate {
    max-width: 200px;
  }
}

/* === SMALL MOBILE (<= 480px) === */
@media (max-width: 480px) {

  /* Even smaller adjustments */
  body {
    font-size: 13px;
  }

  .sidebar {
    width: 260px;
  }

  .sidebar:not(.collapsed)::after {
    left: 260px;
  }

  .sidebar-toggle {
    left: 0.75rem;
    top: 0.75rem;
    width: 40px;
    height: 40px;
  }

  .header {
    padding: var(--spacing-sm) var(--spacing-sm);
  }

  #page-title {
    font-size: 1.15rem;
  }

  #page-subtitle {
    font-size: 0.75rem;
  }

  .content-area {
    padding: var(--spacing-sm);
  }

  .card {
    padding: var(--spacing-sm);
  }

  .stat-value {
    font-size: 1.5rem;
  }

  .stat-icon-wrapper {
    width: 36px;
    height: 36px;
    font-size: 1.1rem;
  }

  .btn {
    font-size: 0.8rem;
    padding: 0.65rem 0.85rem;
  }

  .data-table {
    font-size: 0.75rem;
  }

  .form-control {
    font-size: 16px;
  }
}

/* === LANDSCAPE MOBILE === */
@media (max-height: 500px) and (orientation: landscape) {
  .header {
    position: relative;
    padding: var(--spacing-sm) var(--spacing-md);
  }

  .stat-card {
    min-height: 90px;
  }

  .modal {
    max-height: 100vh;
  }
}

/* === PRINT STYLES === */
@media print {

  .sidebar,
  .header-right,
  .btn,
  .modal-overlay,
  .toast,
  .sidebar-toggle,
  .notification-panel {
    display: none !important;
  }

  .main-content {
    margin-left: 0 !important;
  }

  .sidebar~.main-content {
    margin-left: 0 !important;
  }

  .card {
    break-inside: avoid;
    box-shadow: none;
    border: 1px solid #ddd;
    page-break-inside: avoid;
  }

  .data-table {
    font-size: 10pt;
  }

  body {
    background: white !important;
  }

  /* === MOBILE SIDEBAR & OVERLAY === */


  .sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 99;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
  }

  .sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
  }

  @media (max-width: 768px) {


    .header-left>div {
      display: none !important;
      /* Hidden per user request */
    }

    .header-left {
      /* Adjust layout since items are hidden */
      width: 0;
      padding: 0;
    }

    .sidebar {
      transform: translateX(-100%);
      box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
      width: 260px !important;
    }

    .sidebar.mobile-visible {
      transform: translateX(0);
    }

    .sidebar.collapsed {
      width: 260px !important;
    }

    #page-title {
      font-size: 1.25rem;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    #page-subtitle {
      font-size: 0.75rem;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .header-right {
      gap: var(--spacing-sm);
    }

    .header-time {
      font-size: 0.75rem;
    }

    /* Content area mobile padding adjustment */
    .content-area {
      padding: 0 var(--spacing-md) var(--spacing-md);
    }

    /* === COMPREHENSIVE RESPONSIVE FIXES === */

    /* 1. Dashboard Grids */
    .stats-grid {
      grid-template-columns: 1fr;
      /* Stack stats on mobile */
      gap: var(--spacing-md);
    }

    .charts-grid,
    .grid-3,
    .grid-2 {
      grid-template-columns: 1fr !important;
      /* Stack all grids */
    }

    /* 2. Card Adjustments */
    .card {
      margin-bottom: var(--spacing-md);
      padding: var(--spacing-md);
      /* Reduce padding */
    }

    .card-header {
      flex-direction: column;
      align-items: flex-start;
      gap: var(--spacing-sm);
    }

    /* 3. Tables - Card View on Mobile */
    .table-container {
      border: none;
      background: transparent;
      overflow: visible;
    }

    .table thead {
      display: none;
      /* Hide headers on mobile */
    }

    .table tbody tr {
      display: block;
      background: var(--bg-card);
      margin-bottom: var(--spacing-md);
      border: 1px solid var(--border-color);
      border-radius: var(--radius-md);
      padding: var(--spacing-md);
    }

    .table tbody td {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 8px 0;
      border-bottom: 1px solid var(--border-color);
      text-align: right;
    }

    .table tbody td:last-child {
      border-bottom: none;
    }

    .table tbody td::before {
      content: attr(data-label);
      /* Show label */
      font-weight: 600;
      color: var(--text-secondary);
      text-align: left;
      margin-right: 1rem;
    }

    /* 4. Forms */
    .form-group {
      margin-bottom: var(--spacing-md);
    }

    .row,
    .input-group {
      flex-direction: column;
    }

    /* 5. Toolbar & Filters */
    .toolbar {
      flex-direction: column;
      align-items: stretch;
    }

    .search-box {
      max-width: 100%;
      margin-bottom: var(--spacing-sm);
    }

    .filter-group {
      flex-wrap: wrap;
    }

    /* 6. Typography */
    html {
      font-size: 13px;
      /* Slightly smaller base font */
    }

    h1 {
      font-size: 1.5rem;
    }

    h2 {
      font-size: 1.25rem;
    }

    h3 {
      font-size: 1.1rem;
    }
  }
}