:root {
  --sidebar-width: 250px;
  --brand: #4f46e5;
  --brand-dark: #3730a3;
  --bg-soft: #f5f6fb;
  --card-border: #e7e8f2;
}

body {
  background-color: var(--bg-soft);
  font-family: "Segoe UI", Roboto, -apple-system, sans-serif;
}

.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  background: linear-gradient(180deg, #1e1b4b 0%, #312e81 100%);
  color: #e0e7ff;
  min-height: 100vh;
  position: sticky;
  top: 0;
}

.sidebar .brand {
  font-weight: 700;
  font-size: 1.15rem;
  color: #fff;
  padding: 1.25rem 1.25rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sidebar .brand .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #22c55e;
  display: inline-block;
}

.sidebar-nav {
  padding: 0.5rem 0.75rem;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: #c7d2fe;
  padding: 0.55rem 0.9rem;
  border-radius: 8px;
  text-decoration: none;
  font-size: 0.92rem;
  margin-bottom: 2px;
  transition: background 0.15s ease;
}

.sidebar-nav a:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.sidebar-nav a.active {
  background: var(--brand);
  color: #fff;
  font-weight: 600;
}

.sidebar-nav .badge-count {
  margin-left: auto;
}

.main-area {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  background: #fff;
  border-bottom: 1px solid var(--card-border);
  padding: 0.65rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar form {
  flex: 1;
  max-width: 420px;
}

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

.stat-card {
  background: #fff;
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: 1.1rem 1.25rem;
  height: 100%;
}

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

.stat-card .stat-value {
  font-size: 1.6rem;
  font-weight: 700;
  color: #1e1b4b;
  margin-top: 0.15rem;
}

.stat-card .stat-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: #fff;
}

.card-panel {
  background: #fff;
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: 1.25rem;
}

.table thead th {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #6b7280;
  border-bottom-width: 1px;
  white-space: nowrap;
}

.badge {
  font-weight: 600;
  font-size: 0.72rem;
}

.btn-brand {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.btn-brand:hover {
  background: var(--brand-dark);
  border-color: var(--brand-dark);
  color: #fff;
}

.mobile-toggle {
  display: none;
}

@media (max-width: 991.98px) {
  .sidebar {
    position: fixed;
    left: -260px;
    z-index: 1050;
    transition: left 0.2s ease;
    height: 100vh;
  }
  .sidebar.show {
    left: 0;
  }
  .mobile-toggle {
    display: inline-flex;
  }
  .topbar form {
    max-width: none;
  }
}
