:root {
  --sidebar-width: 220px;
  --sidebar-collapsed-width: 60px;
  --topbar-height: 52px;
  --sidebar-bg: #1a1d23;
  --sidebar-text: #c9cdd4;
  --sidebar-active: #ffffff;
  --sidebar-active-bg: rgba(255,255,255,0.08);
  --sidebar-hover-bg: rgba(255,255,255,0.05);
  --brand-color: #6366f1;
}

/* ── Layout ─────────────────────────────────────── */
body {
  background: #f4f6f9;
  display: flex;
  min-height: 100vh;
  margin: 0;
}

body.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f4f6f9;
}

/* ── Sidebar ─────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 100;
  transition: width 0.2s ease;
  overflow: hidden;
}

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

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  min-height: var(--topbar-height);
}

.brand-icon {
  font-size: 1.4rem;
  color: var(--brand-color);
  flex-shrink: 0;
}

.brand-name {
  font-weight: 700;
  font-size: 1.05rem;
  color: #fff;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.sidebar.collapsed .brand-name,
.sidebar.collapsed .nav-item span,
.sidebar.collapsed .nav-section-label,
.sidebar.collapsed .sidebar-footer span {
  display: none;
}

.sidebar-nav {
  list-style: none;
  padding: 12px 8px;
  margin: 0;
  flex: 1;
  overflow-y: auto;
}

.nav-section-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.3);
  padding: 8px 10px 4px;
  white-space: nowrap;
}

.sidebar-nav .nav-item {
  border-radius: 6px;
  margin-bottom: 2px;
}

.sidebar-nav .nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 0.875rem;
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}

.sidebar-nav .nav-link i {
  font-size: 1rem;
  flex-shrink: 0;
  width: 20px;
  text-align: center;
}

.sidebar-nav .nav-item:hover .nav-link {
  background: var(--sidebar-hover-bg);
  color: #fff;
}

.sidebar-nav .nav-item.active .nav-link {
  background: var(--sidebar-active-bg);
  color: var(--sidebar-active);
  font-weight: 600;
}

.sidebar-nav .nav-item.disabled .nav-link {
  opacity: 0.4;
  cursor: default;
}

.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  font-size: 0.8rem;
}

/* ── Main wrapper ─────────────────────────────────── */
.main-wrapper {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: margin-left 0.2s ease;
}

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

/* ── Topbar ─────────────────────────────────────── */
.topbar {
  height: var(--topbar-height);
  background: #fff;
  border-bottom: 1px solid #e9ecef;
  display: flex;
  align-items: center;
  padding: 0 20px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar .breadcrumb {
  font-size: 0.82rem;
}

.sidebar-toggle {
  color: #6c757d;
  padding: 4px 8px;
  margin-right: 4px;
}

/* ── Content ─────────────────────────────────────── */
.content {
  padding: 24px;
  flex: 1;
}

/* ── Page header ─────────────────────────────────── */
.page-header h1 {
  font-size: 1.25rem;
  font-weight: 700;
  color: #1a1d23;
}

/* ── Stat cards ─────────────────────────────────── */
.stat-card {
  background: #fff;
  border-radius: 10px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  border: 1px solid #e9ecef;
}

.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.stat-value {
  font-size: 1.4rem;
  font-weight: 700;
  color: #1a1d23;
  line-height: 1.2;
}

.stat-label {
  font-size: 0.78rem;
  color: #6c757d;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}

/* ── Avatar ─────────────────────────────────────── */
.avatar-circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--brand-color);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.05em;
  flex-shrink: 0;
}

/* ── Login ─────────────────────────────────────── */
.login-wrapper {
  width: 100%;
  max-width: 380px;
  padding: 16px;
}

.login-card {
  border: 1px solid #dee2e6;
  border-radius: 12px;
}

.login-icon {
  font-size: 2rem;
  color: var(--brand-color);
}

/* ── Table ─────────────────────────────────────── */
.table th {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6c757d;
}

.card {
  border: 1px solid #e9ecef;
  border-radius: 10px;
}

/* ── Sidebar collapsed icons ─────────────────────── */
.sidebar.collapsed .sidebar-nav .nav-link {
  justify-content: center;
  padding: 10px;
}

.sidebar.collapsed .sidebar-footer {
  justify-content: center;
  padding: 12px;
}
