:root {
  --primary: #0d6efd;
  --sidebar-width: 260px;
  --sidebar-bg: #1e2a3b;
  --sidebar-text: #a8b5c8;
  --sidebar-active: #0d6efd;
  --topbar-height: 60px;
}

/* Sidebar layout */
.layout-with-sidebar {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 1000;
  transition: transform 0.3s ease;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar .sidebar-brand {
  padding: 1.25rem 1rem;
  display: flex;
  align-items: center;
  color: white;
  font-weight: 700;
  font-size: 1.05rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  text-decoration: none;
  flex-shrink: 0;
}

.sidebar .sidebar-nav {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 0.75rem 0.25rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.sidebar .sidebar-nav::-webkit-scrollbar {
  width: 5px;
}
.sidebar .sidebar-nav::-webkit-scrollbar-track {
  background: transparent;
}
.sidebar .sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

.sidebar .nav-link {
  color: var(--sidebar-text);
  padding: 0.65rem 0.95rem;
  border-radius: 8px;
  margin: 3px 8px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s ease-in-out;
  text-decoration: none;
}

.sidebar .nav-link i {
  font-size: 1.1rem;
  flex-shrink: 0;
  opacity: 0.85;
  transition: transform 0.2s ease;
}

.sidebar .nav-link:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  transform: translateX(3px);
}

.sidebar .nav-link:hover i {
  opacity: 1;
}

/* Active / Selected state - High contrast, vibrant SaaS color */
.sidebar .nav-link.active {
  background: linear-gradient(90deg, #0d6efd 0%, #0b5ed7 100%) !important;
  color: #ffffff !important;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(13, 110, 253, 0.35);
}

.sidebar .nav-link.active i {
  color: #ffffff !important;
  opacity: 1;
}

/* Platform Admin Sidebar (Dark + Crimson / Red Accent) */
.sidebar.sidebar-platform,
.sidebar-platform {
  background: #111111 !important;
}

.sidebar-platform .nav-link.active {
  background: linear-gradient(90deg, #dc3545 0%, #b02a37 100%) !important;
  color: #ffffff !important;
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(220, 53, 69, 0.45) !important;
}

.sidebar-platform .nav-link.active i {
  color: #ffffff !important;
  opacity: 1;
}

.sidebar .nav-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(168, 181, 200, 0.6);
  padding: 1rem 1rem 0.25rem;
  font-weight: 600;
}

/* Sidebar Footer (User profile at bottom of left menu) */
.sidebar-footer {
  flex-shrink: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.75rem 0.85rem;
  background: rgba(0, 0, 0, 0.35);
  margin-top: auto;
}

.sidebar-user-card {
  padding: 6px 8px;
  border-radius: 8px;
  transition: background 0.2s;
  cursor: pointer;
  color: #ffffff;
}

.sidebar-user-card:hover,
.sidebar-user-card:focus {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.sidebar-user-card::after {
  display: none !important;
}

.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-height: 100vh;
  background: #f8f9fa;
}

.topbar {
  height: var(--topbar-height);
  background: white;
  border-bottom: 1px solid #e9ecef;
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  position: sticky;
  top: 0;
  z-index: 999;
}

.page-content {
  padding: 1.5rem;
}

/* KPI Cards */
.kpi-card {
  border: none;
  border-radius: 12px;
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
}

.kpi-card .kpi-value {
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1;
}

.kpi-card .kpi-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.8;
  margin-top: 0.25rem;
}

.kpi-card .kpi-icon {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 4rem;
  opacity: 0.15;
}

/* Check-in interface */
.checkin-container {
  max-width: 800px;
  margin: 0 auto;
}

.scan-result {
  border-radius: 16px;
  padding: 2rem;
  transition: all 0.3s;
}

.scan-result.success { background: #d1fae5; border: 3px solid #10b981; }
.scan-result.error   { background: #fee2e2; border: 3px solid #ef4444; }
.scan-result.warning { background: #fef3c7; border: 3px solid #f59e0b; }

/* Status badges */
.badge { font-weight: 500; }

/* Tables & Dropdown overflow handling */
.table th { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; color: #6c757d; }

.card .table-responsive {
  min-height: 260px;
}

.table-responsive .dropdown-menu {
  z-index: 1060 !important;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15) !important;
}

@media (min-width: 769px) {
  .table-responsive {
    overflow-y: visible !important;
  }
}

/* Forms */
.form-label { font-weight: 500; font-size: 0.875rem; }

/* Progress wizard */
.wizard-steps {
  display: flex;
  justify-content: center;
  margin-bottom: 2rem;
  gap: 0;
}

.wizard-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  position: relative;
}

.wizard-step::before {
  content: '';
  position: absolute;
  top: 20px;
  left: -50%;
  right: 50%;
  height: 2px;
  background: #dee2e6;
  z-index: 0;
}

.wizard-step:first-child::before { display: none; }

.wizard-step.completed::before,
.wizard-step.active::before { background: var(--primary); }

.step-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #dee2e6;
  color: #6c757d;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.9rem;
  z-index: 1;
  position: relative;
}

.wizard-step.active .step-circle   { background: var(--primary); color: white; }
.wizard-step.completed .step-circle { background: #198754; color: white; }

.step-label {
  font-size: 0.75rem;
  margin-top: 0.5rem;
  color: #6c757d;
  text-align: center;
}

.wizard-step.active .step-label { color: var(--primary); font-weight: 600; }

/* Responsive */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.show {
    transform: translateX(0);
  }
  .main-content {
    margin-left: 0;
  }
}

/* Live command center */
.live-kpi {
  font-size: 3rem;
  font-weight: 800;
  text-align: center;
}

.live-label {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  text-align: center;
  opacity: 0.7;
}

/* Toast notifications */
.toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 9999;
}

/* Button styling: comfortable gap between icon and text, centered alignment */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
}

.btn i {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  line-height: 1;
}
