:root {
  --sidebar-width: 240px;
  --sidebar-bg: #1e293b;
  --sidebar-text: #94a3b8;
  --sidebar-active: #ffffff;
  --sidebar-hover-bg: #334155;
  --topbar-height: 56px;
}

body {
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background-color: #f1f5f9;
  margin: 0;
}

.login-body {
  background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
}

.login-card {
  border-radius: 12px;
  margin: 1rem;
}

/* --- Sidebar desktop --- */
.sidebar {
  width: var(--sidebar-width);
  min-height: 100vh;
  background-color: var(--sidebar-bg);
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1050;
  transition: transform 0.25s ease;
}

.sidebar-brand {
  color: #fff;
  font-size: 1.1rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid #334155;
}

.sidebar .nav-link {
  color: var(--sidebar-text);
  border-radius: 8px;
  padding: 0.6rem 0.75rem;
  font-size: 0.9rem;
  transition: all 0.15s;
}

.sidebar .nav-link:hover {
  color: var(--sidebar-active);
  background-color: var(--sidebar-hover-bg);
}

.sidebar .nav-link.active {
  color: var(--sidebar-active);
  background-color: var(--sidebar-hover-bg);
  font-weight: 600;
}

.main-content {
  margin-left: var(--sidebar-width);
}

.top-bar {
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  min-height: var(--topbar-height);
}

.content-area {
  min-height: calc(100vh - var(--topbar-height));
}

.stat-card {
  border-radius: 10px;
  transition: transform 0.15s;
}

.stat-card:hover {
  transform: translateY(-2px);
}

.table th {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #64748b;
}

.table td {
  font-size: 0.85rem;
}

/* Hamburger button - hidden on desktop */
.sidebar-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: #1e293b;
  padding: 0;
  line-height: 1;
}

/* Overlay behind sidebar on mobile */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 1040;
}

.sidebar-overlay.show {
  display: block;
}

/* --- Mobile (< 768px) --- */
@media (max-width: 767.98px) {
  .sidebar {
    transform: translateX(-100%);
    width: 260px;
  }

  .sidebar.show {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
  }

  .sidebar-toggle {
    display: inline-block;
  }

  .top-bar {
    position: sticky;
    top: 0;
    z-index: 1030;
  }

  .content-area {
    padding: 1rem !important;
  }

  .stat-card .card-body {
    padding: 0.75rem;
  }

  .stat-card .stat-icon {
    padding: 0.6rem !important;
  }

  .stat-card .fs-4 {
    font-size: 1.15rem !important;
  }

  .table-responsive {
    font-size: 0.82rem;
  }

  .btn-sm {
    font-size: 0.8rem;
    padding: 0.3rem 0.6rem;
  }
}

/* --- Small phones (< 400px) --- */
@media (max-width: 399.98px) {
  .login-card .card-body {
    padding: 1.5rem !important;
  }

  .content-area {
    padding: 0.75rem !important;
  }
}
