/* Modernized palette and Bootstrap overrides */
:root {
  --bs-primary: #2563eb;
  --bs-primary-rgb: 37,99,235;
  --bs-secondary: #6366f1;
  --bs-secondary-rgb: 99,102,241;
  --bs-success: #22c55e;
  --bs-success-rgb: 34,197,94;
  --bs-info: #06b6d4;
  --bs-info-rgb: 6,182,212;
  --bs-warning: #f59e42;
  --bs-warning-rgb: 245,158,66;
  --bs-danger: #ef4444;
  --bs-danger-rgb: 239,68,68;
  --bs-dark: #1e293b;
  --bs-dark-rgb: 30,41,59;
  --bs-light: #f8fafc;
  --bs-light-rgb: 248,250,252;
  --bs-body-bg: #f3f4f6;
  --bs-body-color: #1e293b;
  --sidebar-bg: #1e293b;
  --sidebar-active: #2563eb;
  --sidebar-hover: #334155;
  --sidebar-text: #f1f5f9;
  --sidebar-section: #64748b;
}

body {
  background: var(--bs-body-bg);
  color: var(--bs-body-color);
  font-family: 'Segoe UI', 'Roboto', 'Arial', sans-serif;
}

.sidebar {
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  min-height: 100vh;
  width: 240px;
  position: fixed;
  top: 0; left: 0;
  z-index: 1040;
  transition: left 0.2s;
}
.sidebar.collapsed {
  left: -240px;
}
.sidebar .nav-link {
  color: var(--sidebar-text);
  border-radius: 4px;
  margin-bottom: 2px;
}
.sidebar .nav-link.active, .sidebar .nav-link:focus, .sidebar .nav-link:hover {
  background: var(--sidebar-active);
  color: #fff;
}
.sidebar .nav-section {
  color: var(--sidebar-section);
  font-size: 0.9em;
  margin: 1.5rem 0 0.5rem 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

@media (max-width: 991.98px) {
  .sidebar {
    left: -240px;
  }
  .sidebar.show {
    left: 0;
  }
}

.main-content {
  margin-left: 240px;
  padding: 2rem 2rem 1rem 2rem;
  transition: margin-left 0.2s;
}
@media (max-width: 991.98px) {
  .main-content {
    margin-left: 0;
    padding: 1rem;
  }
}

.card {
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(30,41,59,0.06);
  border: none;
}
.card-header {
  font-weight: 600;
  font-size: 1.1rem;
}

.btn-primary, .btn-success, .btn-info, .btn-warning, .btn-danger {
  border-radius: 6px;
  font-weight: 500;
}

.table th, .table td {
  vertical-align: middle;
}

/* Action bar at bottom */
.action-bar {
  position: sticky;
  bottom: 0;
  background: #fff;
  border-top: 1px solid #e5e7eb;
  padding: 1rem 0.5rem;
  z-index: 1050;
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
}

/* Custom badges */
.badge-stock {
  background: var(--bs-success);
  color: #fff;
}
.badge-stock-zero {
  background: var(--bs-danger);
  color: #fff;
}
.badge-expiry {
  background: var(--bs-warning);
  color: #fff;
}

/* Modern input group */
.input-group .form-control, .input-group .form-select {
  border-radius: 6px;
}

/* Responsive tweaks */
@media (max-width: 575.98px) {
  .card-header, .btn, .form-label, .form-control, .form-select {
    font-size: 0.95rem;
  }
}
