:root {
  --kp-sidebar-width: 250px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* ---------- Auth ---------- */
.auth-card {
  width: 100%;
  max-width: 440px;
  border-radius: 1rem;
}

/* ---------- Dashboard layout ---------- */
.dashboard-body {
  background: #f4f6fb;
  min-height: 100vh;
}

.dashboard-sidebar {
  width: var(--kp-sidebar-width);
  min-height: 100vh;
  position: sticky;
  top: 0;
  flex-shrink: 0;
  transition: margin-left 0.2s ease-in-out;
}

.dashboard-content {
  min-width: 0;
}

.sidebar-link {
  color: rgba(255, 255, 255, 0.75);
  border-radius: 0.5rem;
  margin-bottom: 0.15rem;
  padding: 0.6rem 0.85rem;
  font-size: 0.95rem;
}

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

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

.dashboard-topbar {
  position: sticky;
  top: 0;
  z-index: 1020;
}

/* ---------- Stat cards ---------- */
.stat-card .stat-icon {
  width: 52px;
  height: 52px;
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.featured-card {
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.featured-card:hover {
  transform: translateY(-3px);
}

/* ---------- Post content ---------- */
.post-content {
  font-size: 1.05rem;
  line-height: 1.7;
}
.post-content img {
  max-width: 100%;
  height: auto;
  border-radius: 0.5rem;
}
.post-content pre {
  background: #1e1e2e;
  color: #f8f8f2;
  padding: 1rem;
  border-radius: 0.5rem;
  overflow-x: auto;
}

/* ---------- Responsive sidebar ---------- */
@media (max-width: 991.98px) {
  .dashboard-sidebar {
    position: fixed;
    z-index: 1040;
    margin-left: calc(var(--kp-sidebar-width) * -1);
    height: 100%;
  }
  .dashboard-sidebar.show {
    margin-left: 0;
  }
}

/* ---------- Category navigation tree ---------- */
.category-tree {
  padding-left: 0;
}
.category-tree .category-tree {
  /* nested levels rely on inline padding-left for precise +20px steps */
  padding-left: 0;
}
.category-tree-row {
  border-radius: .375rem;
  padding-top: .3rem;
  padding-bottom: .3rem;
  padding-right: .5rem;
  transition: background-color .12s ease-in-out;
}
.category-tree-row:hover {
  background-color: var(--bs-light, #f1f3f5);
}
.category-tree-row.active {
  background-color: var(--bs-primary-bg-subtle, #cfe2ff);
}
.category-tree-link {
  color: var(--bs-body-color, #212529);
  font-size: .925rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.category-tree-row.active .category-tree-link {
  color: var(--bs-primary, #0d6efd);
  font-weight: 600;
}
.category-tree-toggle {
  width: 1rem;
  line-height: 1;
  color: var(--bs-secondary, #6c757d);
  border: 0;
}
.category-tree-toggle:focus {
  box-shadow: none;
}
.category-tree-toggle-spacer {
  display: inline-block;
  width: 1rem;
}
/* Chevron rotates when the branch is expanded */
.category-tree-toggle .chevron {
  transition: transform .15s ease-in-out;
}
.category-tree-toggle[aria-expanded="true"] .chevron {
  transform: rotate(90deg);
}
