/* Modern PPE Monitoring System Styles */
:root {
  --primary: #4f46e5;
  --primary-dark: #4338ca;
  --secondary: #6b7280;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --info: #3b82f6;
  --light: #f8fafc;
  --dark: #1e293b;
  --white: #ffffff;

  --card-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --card-shadow-lg: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);

  --navbar-h: 64px;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #f8fafc;
  min-height: 100vh;
  color: #1e293b;
}

/* No navbar padding needed */

/* Main Layout Adjustments for Footer */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    display: flex;
    flex-direction: column;
}

.d-flex.flex-grow-1 {
    flex: 1;
    display: flex !important;
    min-height: 100vh; /* Full viewport height without navbar */
}


/* Scope to large screens so Bootstrap's d-none on smaller screens still works */
@media (min-width: 992px) {
  .d-none.d-lg-block {
      display: flex !important;
      height: 100%;
  }
}

/* Main content area adjustment */
.main-content {
    flex: 1;
    background: #f8f9fa;
    display: flex;
    flex-direction: column;
}

.content-wrapper {
    flex: 1;
    padding: 1.5rem;
}

/* Footer Styles */
footer {
    margin-top: auto;
    background-color: #f8f9fa !important;
    border-top: 1px solid #e9ecef !important;
    color: #6c757d !important;
    font-size: 0.875rem;
}

footer a {
    color: #6c757d !important;
    transition: color 0.2s ease;
}

footer a:hover {
    color: #495057 !important;
}

/* Credits Modal Styles */
.modal-header.bg-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
}

.text-purple {
    color: #6f42c1 !important;
}

.modal-body .bg-light {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%) !important;
}

/* Simple Topbar */
.topbar {
  position: fixed;
  top: 0;
  left: var(--sidebar-width);
  right: 0;
  height: 60px;
  background: var(--white);
  border-bottom: 1px solid #e2e8f0;
  box-shadow: var(--card-shadow);
  z-index: 1030;
  transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.topbar-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  padding: 0 1.5rem;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.topbar-toggle-btn {
  background: none;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.topbar-toggle-btn:hover {
  background: var(--light);
  color: var(--primary);
  border-color: var(--primary);
}

.topbar-toggle-btn:active {
  background: var(--primary);
  color: var(--white);
  transform: scale(0.95);
}

.topbar-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--dark);
  margin: 0;
}

.topbar-right {
  display: flex;
  align-items: center;
}

.topbar-user-btn {
  background: none;
  border: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.topbar-user-btn:hover {
  background: var(--light);
}

.topbar-user-avatar {
  width: 32px;
  height: 32px;
  background: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-weight: 600;
  font-size: 0.875rem;
}

.topbar-user-name {
  color: var(--dark);
  font-weight: 500;
  font-size: 0.875rem;
}

/* Topbar adjustments for sidebar states */
body:has(.sidebar.collapsed) .topbar,
.main-wrapper.sidebar-collapsed .topbar {
  left: var(--sidebar-collapsed-width);
}

/* Fallback for browsers that don't support :has() */
.sidebar.collapsed ~ * .topbar {
  left: var(--sidebar-collapsed-width);
}

@media (max-width: 991.98px) {
  .topbar {
    left: 0;
  }
  
  .topbar-toggle-btn {
    display: none !important;
  }
}



/* Main Content Area */
.main-content {
  background: transparent;
  min-height: calc(100vh - var(--navbar-h));
  width: 100%;
}

/* Content wrapper (scoped) */
.content-wrapper {
  background: white;
  border-radius: 12px;
  box-shadow: var(--card-shadow);
  margin: 1rem;
  padding: 1.25rem;
  color: var(--dark);
}

/* Modern Cards */
.card {
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  box-shadow: var(--card-shadow);
  background: var(--white);
  transition: all 0.2s ease;
}

.card:hover {
  box-shadow: var(--card-shadow-lg);
  transform: translateY(-1px);
}

.card-header {
  background: var(--white);
  color: var(--dark);
  border-radius: 14px 14px 0 0 !important;
  border-bottom: 1px solid #e2e8f0;
  padding: 0.9rem 1.2rem;
  font-weight: 600;
}

/* Dashboard Stats Cards */
.stat-card {
  background: var(--white);
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 1.25rem;
  text-align: center;
  transition: all 0.2s ease;
  height: 100%;
  box-shadow: var(--card-shadow);
}

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

.stat-card.success { border-left: 4px solid var(--success); }
.stat-card.info { border-left: 4px solid var(--info); }
.stat-card.warning { border-left: 4px solid var(--warning); }
.stat-card.danger { border-left: 4px solid var(--danger); }

.stat-number {
  font-size: 2.25rem;
  font-weight: 800;
  line-height: 1;
  margin: 0.25rem 0;
  color: var(--dark);
}

.stat-label {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--secondary);
}

/* Modern Tables */
.table {
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--card-shadow);
  background: white;
}

.table thead th {
  background: var(--dark);
  color: var(--white);
  border: none;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 0.025em;
  padding: 0.85rem 1rem;
}

.table tbody tr { transition: background 0.2s ease; background: white; }
.table tbody tr:hover { background: #f8fafc; }

.table tbody td {
  padding: 0.85rem 1rem;
  border-color: #e2e8f0;
  vertical-align: middle;
  color: var(--dark);
}

/* Modern Buttons */
.btn { border-radius: 10px; font-weight: 600; padding: 0.5rem 1rem; transition: all 0.2s ease; border: none; }
.btn-primary { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); box-shadow: 0 4px 12px rgba(79,70,229,0.3); color: white; }
.btn-primary:hover { transform: none; }
.btn-success { background: linear-gradient(135deg, var(--success), #059669); box-shadow: 0 4px 12px rgba(16,185,129,0.3); color: white; }
.btn-danger { background: linear-gradient(135deg, var(--danger), #dc2626); box-shadow: 0 4px 12px rgba(239,68,68,0.3); color: white; }
.btn-outline-primary { border: 2px solid var(--primary); color: var(--primary); background: transparent; }
.btn-outline-primary:hover { background: var(--primary); color: white; transform: translateY(-1px); }

/* Modern Forms */
.form-control, .form-select { border-radius: 10px; border: 2px solid #e2e8f0; padding: 0.6rem 0.85rem; font-weight: 500; transition: all 0.2s ease; background: white; color: var(--dark); }
.form-control:focus, .form-select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1); background: white; color: var(--dark); }
.form-label { font-weight: 600; color: var(--dark); margin-bottom: 0.4rem; }

/* Modern Modals */
.modal-content { border-radius: 16px; border: none; box-shadow: var(--card-shadow-lg); background: white; }
.modal-header { background: var(--white); color: var(--dark); border-radius: 16px 16px 0 0; border-bottom: 1px solid #e2e8f0; padding: 1rem 1.25rem; }
.modal-body { padding: 1.25rem; background: white; color: var(--dark); }
.modal-footer { border: none; padding: 0.75rem 1.25rem 1.25rem 1.25rem; background: white; }

/* Modern Alerts */
.alert { border-radius: 12px; border: none; padding: 0.75rem 1rem; font-weight: 500; color: var(--dark); }
.alert-success { background: #f0fdf4; color: #065f46; border-left: 4px solid var(--success); }
.alert-danger { background: #fef2f2; color: #991b1b; border-left: 4px solid var(--danger); }
.alert-info { background: #eff6ff; color: #1e3a8a; border-left: 4px solid var(--info); }

/* Modern Badges */
.badge { border-radius: 16px; padding: 0.4rem 0.75rem; font-weight: 600; font-size: 0.75rem; }

/* Page Headers */
.page-title { color: var(--dark); font-weight: 800; font-size: 1.5rem; margin-bottom: 1rem; }

/* Print Styles */
@media print {
  .no-print { display: none !important; }
  .content-wrapper { padding: 0 !important; box-shadow: none !important; background: white !important; }
  .table { font-size: 12px; }
  .card { box-shadow: none !important; }
}

/* Responsive Design */
@media (max-width: 768px) {
  .stat-card { padding: 1rem; margin-bottom: 1rem; }
  .stat-number { font-size: 2rem; }
  .content-wrapper { margin: 0.5rem; padding: 1rem; }
}

/* Loading Animation */
.loading { position: relative; overflow: hidden; }
.loading::after { content: ''; position: absolute; top: 0; left: -100%; width: 100%; height: 100%; background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent); animation: loading 1.5s infinite; }
@keyframes loading { 0% { left: -100%; } 100% { left: 100%; } }



.avatar-circle-small { width: 28px; height: 28px; border-radius: 50%; background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: white; display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 0.75rem; }

/* Custom scrollbar */
.table-responsive::-webkit-scrollbar { height: 6px; }
.table-responsive::-webkit-scrollbar-track { background: #f1f1f1; border-radius: 3px; }
.table-responsive::-webkit-scrollbar-thumb { background: #ccc; border-radius: 3px; }

/* Dropdown menus */
.dropdown-menu { border-radius: 12px; border: 1px solid #e2e8f0; box-shadow: var(--card-shadow-lg); background: white; }
.dropdown-item { color: var(--dark); border-radius: 8px; margin: 0.125rem 0.5rem; transition: all 0.2s ease; }
.dropdown-item:hover { background: var(--primary); color: white; }

.text-muted { color: #6b7280 !important; }
.bg-light { background-color: #f8fafc !important; border: 1px solid #e2e8f0; }

* { color: var(--dark); }
.text-white, .text-white * { color: white !important; } 

/* Adjusted transitions: minimal (0.1s), no transform animations */

/* override specific transitions */
.card { transition: box-shadow 0.1s ease; }
.card:hover { transform: none; }
.stat-card { transition: box-shadow 0.1s ease; }
.stat-card:hover { transform: none; }
.btn { transition: background-color 0.1s ease, box-shadow 0.1s ease; }
.btn-primary:hover { transform: none; }
.table tbody tr { transition: background-color 0.1s ease; }



/* Modern Sidebar Styles */
:root {
  --sidebar-width: 280px;
  --sidebar-collapsed-width: 70px;
  --sidebar-bg: #1e293b;
  --sidebar-text: #cbd5e1;
  --sidebar-active: linear-gradient(135deg, var(--primary), var(--primary-dark));
  --sidebar-hover: rgba(255, 255, 255, 0.08);
  --sidebar-border: #334155;
}

.sidebar {
  background: var(--sidebar-bg);
  width: var(--sidebar-width);
  height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1040;
  overflow-y: auto;
  overflow-x: hidden;
  box-shadow: 4px 0 15px rgba(0, 0, 0, 0.1);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  backdrop-filter: blur(10px);
}

.sidebar.collapsed {
  width: var(--sidebar-collapsed-width);
}

.sidebar.collapsed .sidebar-category,
.sidebar.collapsed .sidebar-user-info .user-details {
  opacity: 0;
  visibility: hidden;
}

.sidebar.collapsed .sidebar-text {
  opacity: 0;
  visibility: hidden;
  width: 0;
}

.sidebar.collapsed .sidebar-icon {
  margin-right: 0;
}

/* Mobile sidebar */
@media (max-width: 991.98px) {
  .sidebar {
    transform: translateX(-100%);
  }
  
  .sidebar.show {
    transform: translateX(0);
  }
  
  .sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1039;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
  }
  
  .sidebar-overlay.show {
    opacity: 1;
    visibility: visible;
  }
}

/* Sidebar header */
.sidebar-header {
  padding: 1.25rem 1rem;
  border-bottom: 1px solid var(--sidebar-border);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 80px;
}

.sidebar-logo {
  width: 40px;
  height: 40px;
  background: var(--sidebar-active);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.sidebar-brand {
  color: var(--white);
  font-weight: 700;
  font-size: 1.1rem;
  text-decoration: none;
  transition: opacity 0.3s ease;
  overflow: hidden;
}

.sidebar.collapsed .sidebar-brand {
  opacity: 0;
  width: 0;
}

.sidebar-collapse-btn {
  background: none;
  border: none;
  color: var(--sidebar-text);
  padding: 0.25rem;
  border-radius: 6px;
  margin-left: auto;
  transition: all 0.2s ease;
  cursor: pointer;
}

.sidebar-collapse-btn:hover {
  background: var(--sidebar-hover);
  color: var(--white);
}

.sidebar-collapse-btn:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.2);
}

.sidebar.collapsed .sidebar-collapse-btn {
  opacity: 0;
  visibility: hidden;
}

.sidebar.collapsed:hover .sidebar-collapse-btn {
  opacity: 1;
  visibility: visible;
}

.sidebar-collapse-btn i {
  transition: transform 0.2s ease;
}

.sidebar.collapsed .sidebar-collapse-btn i {
  transform: rotate(180deg);
}

/* Sidebar navigation */
.sidebar-nav {
  flex: 1;
  padding: 1rem 0;
}

.sidebar-category {
  color: #94a3b8;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 1.5rem 1rem 0.5rem 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--sidebar-border);
  transition: opacity 0.3s ease;
}

.sidebar.collapsed .sidebar-category {
  margin: 1rem 0;
  border-bottom: none;
  text-align: center;
}

.sidebar-menu {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar-menu-item {
  margin: 0.25rem 0.75rem;
}

.sidebar-menu-link {
  display: flex;
  align-items: center;
  padding: 0.75rem 1rem;
  color: var(--sidebar-text);
  text-decoration: none;
  border-radius: 12px;
  transition: all 0.2s ease;
  font-weight: 500;
  position: relative;
  overflow: hidden;
}

.sidebar-menu-link:hover {
  background: var(--sidebar-hover);
  color: var(--white);
  transform: translateX(4px);
}

.sidebar-menu-link.active {
  background: var(--sidebar-active);
  color: var(--white);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
  border-left: 4px solid rgba(255, 255, 255, 0.3);
}

.sidebar-menu-link.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 4px;
  background: rgba(255, 255, 255, 0.5);
}

.sidebar-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  margin-right: 0.75rem;
  font-size: 1.1rem;
  flex-shrink: 0;
  transition: margin-right 0.3s ease;
}

.sidebar.collapsed .sidebar-icon {
  margin-right: 0;
}

.sidebar-text {
  transition: opacity 0.3s ease, width 0.3s ease;
  white-space: nowrap;
}

/* Sidebar user info */
.sidebar-user-info {
  margin-top: auto;
  padding: 1rem;
  border-top: 1px solid var(--sidebar-border);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.sidebar-user-avatar {
  width: 36px;
  height: 36px;
  background: var(--sidebar-active);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-weight: 600;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.user-details {
  transition: opacity 0.3s ease, width 0.3s ease;
  overflow: hidden;
}

.user-name {
  color: var(--white);
  font-weight: 600;
  font-size: 0.9rem;
  margin: 0;
  line-height: 1.2;
}

.user-role {
  color: #94a3b8;
  font-size: 0.75rem;
  margin: 0;
}

/* Sidebar toggle button */
.sidebar-toggle {
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 1050;
  background: var(--white);
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  width: 40px;
  height: 40px;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: var(--card-shadow);
  transition: all 0.2s ease;
  cursor: pointer;
}

.sidebar-toggle:hover {
  background: var(--light);
  transform: scale(1.05);
  color: var(--primary);
}

.sidebar-toggle:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

@media (max-width: 991.98px) {
  .sidebar-toggle {
    display: flex;
  }
}

/* Scrollbar styling */
.sidebar::-webkit-scrollbar {
  width: 6px;
}

.sidebar::-webkit-scrollbar-track {
  background: #334155;
}

.sidebar::-webkit-scrollbar-thumb {
  background: #64748b;
  border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Main content adjustment */
.main-wrapper {
  margin-left: var(--sidebar-width);
  padding-top: 60px; /* Account for topbar height */
  transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  min-height: 100vh;
}

.main-wrapper.sidebar-collapsed {
  margin-left: var(--sidebar-collapsed-width);
}

@media (max-width: 991.98px) {
  .main-wrapper {
    margin-left: 0;
    padding-top: 60px; /* Keep topbar space on mobile */
  }
}

/* Animation improvements */
.sidebar * {
  transition: all 0.2s ease;
}

/* Collapsed sidebar hover expansion */
.sidebar.collapsed:hover {
  width: var(--sidebar-width);
}

.sidebar.collapsed:hover .sidebar-text,
.sidebar.collapsed:hover .sidebar-category,
.sidebar.collapsed:hover .sidebar-brand,
.sidebar.collapsed:hover .user-details {
  opacity: 1;
  visibility: visible;
  width: auto;
}

.sidebar.collapsed:hover .sidebar-icon {
  margin-right: 0.75rem;
}

/* Prevent hover expansion on mobile */
@media (max-width: 991.98px) {
  .sidebar.collapsed:hover {
    width: var(--sidebar-collapsed-width);
  }
  
  .sidebar.collapsed:hover .sidebar-text,
  .sidebar.collapsed:hover .sidebar-category,
  .sidebar.collapsed:hover .sidebar-brand,
  .sidebar.collapsed:hover .user-details {
    opacity: 0;
    visibility: hidden;
    width: 0;
  }
  
  .sidebar.collapsed:hover .sidebar-icon {
    margin-right: 0;
  }
}

/* Ensure proper text colors */
.sidebar, .sidebar * {
  color: var(--sidebar-text);
}

.sidebar .sidebar-menu-link.active, 
.sidebar .sidebar-menu-link.active * {
  color: white !important;
}

/* Compact header spacing */
.content-wrapper { margin-top: 0.75rem; } 

 

 

.auth-bg { background: radial-gradient(1200px 600px at 10% -10%, rgba(79,70,229,0.08), transparent), radial-gradient(1200px 600px at 110% 110%, rgba(16,185,129,0.06), transparent), #f8fafc; }
.auth-card .form-control { border-width: 2px; }
.auth-card .btn-primary { border-radius: 10px; } 



/* Ensure the layout container takes full available height */
body > .flex-grow-1 {
    min-height: calc(100vh - 60px - 80px); /* navbar height - footer height */
}

/* Make main content flex */
.main-content {
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    background: #f8f9fa !important;
}

.main-content .content-wrapper {
    flex: 1 !important;
    padding: 1.5rem !important;
} 