:root {
  --sidebar-bg: #0f1b2d;
  --sidebar-fg: #9fb0c8;
  --sidebar-active: #1f3b5f;
  --topbar-h: 60px;
}

body {
  background: #f4f6fa;
}

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

/* ---------- Sidebar ---------- */
.sidebar {
  width: 240px;
  min-width: 240px;
  background: var(--sidebar-bg);
  color: var(--sidebar-fg);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 1040;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, #2f81f7, #1558b0);
  color: #fff;
  font-weight: 700;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-text strong {
  display: block;
  color: #fff;
  letter-spacing: 0.08em;
  font-size: 15px;
  line-height: 1.1;
}

.brand-text span {
  font-size: 11px;
  letter-spacing: 0.3em;
  opacity: 0.7;
}

.sidebar-nav {
  padding: 12px 10px;
  flex: 1;
}

.sidebar-nav .nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--sidebar-fg);
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 2px;
}

.sidebar-nav .nav-link i {
  font-size: 16px;
  width: 20px;
  text-align: center;
}

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

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

.nav-section {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(159, 176, 200, 0.6);
  padding: 16px 12px 6px;
}

/* ---------- Main ---------- */
.app-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: var(--topbar-h);
  background: #fff;
  border-bottom: 1px solid #e6e9ef;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 1030;
}

.topbar-title {
  font-size: 18px;
  font-weight: 600;
  margin: 0;
  color: #1d2733;
}

.main-content {
  padding: 24px;
  flex: 1;
}

.btn-icon {
  font-size: 18px;
  line-height: 1;
}

/* ---------- Avatar & user menu ---------- */
.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2f81f7, #1558b0);
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.avatar-sm {
  width: 28px;
  height: 28px;
  font-size: 12px;
}

.user-menu {
  display: flex;
  align-items: center;
  gap: 8px;
  border-radius: 50px;
}

/* ---------- Cards ---------- */
.card {
  border: 1px solid #e6e9ef;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}

.card-header {
  background: #fafbfd;
  border-bottom: 1px solid #eef1f5;
}

/* ---------- Stat cards ---------- */
.stat-icon {
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.bg-primary-soft { background: #e8f1fe; }
.bg-success-soft { background: #e6f6ec; }
.bg-info-soft    { background: #e6f4fb; }
.bg-warning-soft { background: #fdf3e3; }

.stat-value {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.1;
  color: #1d2733;
}

.stat-label {
  font-size: 12px;
  color: #6b7787;
}

/* ---------- Chart ---------- */
.chart-bars {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  height: 150px;
  padding: 0 6px;
}

.chart-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.chart-columns {
  display: flex;
  align-items: flex-end;
  gap: 5px;
  height: 130px;
}

.chart-bar {
  width: 16px;
  border-radius: 4px 4px 0 0;
  min-height: 3px;
}

.bar-count {
  background: #2f81f7;
}

.bar-revenue {
  background: #2fb06c;
}

.chart-label {
  font-size: 11px;
  color: #6b7787;
}

.chart-legend {
  display: flex;
  gap: 16px;
  font-size: 12px;
  color: #55606e;
}

/* ---------- Activity list ---------- */
.activity-list .list-group-item {
  border-left: 0;
  border-right: 0;
}

.activity-list .list-group-item:first-child {
  border-top: 0;
}

/* ---------- Auth pages ---------- */
.auth-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  background: linear-gradient(135deg, #0e1b33 0%, #12507f 100%);
}

.auth-wrap {
  width: 100%;
  max-width: 420px;
}

.auth-card {
  border: 0;
  border-radius: 14px;
  padding: 1.25rem;
}

.auth-brand {
  text-align: center;
  margin-bottom: 1rem;
}

.brand-mark-lg {
  width: 56px;
  height: 56px;
  margin: 0 auto 12px;
  border-radius: 14px;
  background: linear-gradient(135deg, #2f81f7, #1558b0);
  color: #fff;
  font-size: 30px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-brand h2 {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #1d2733;
  margin-bottom: 4px;
}

.auth-brand h2 span {
  color: #2f81f7;
}

.auth-brand p {
  font-size: 13px;
  color: #6b7787;
  margin: 0;
}

/* ---------- Mobile ---------- */
@media (max-width: 991.98px) {
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
  }
  .sidebar.open {
    transform: translateX(0);
  }
}
