:root {
  --rp-sidebar-width: 260px;
  --rp-bottom-nav-height: 64px;
  --rp-primary: #2f6f4f;
  --rp-primary-dark: #234f39;
  --rp-bg: #f5f7f6;
}

body {
  background-color: var(--rp-bg);
}

/* ---------- Guest layout (login/setup) ---------- */
.guest-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, var(--rp-primary) 0%, var(--rp-primary-dark) 100%);
}

.guest-main {
  width: 100%;
  padding: 1.5rem;
}

.guest-card {
  background: #fff;
  border-radius: 1rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  padding: 2rem;
  max-width: 420px;
  margin: 0 auto;
}

.guest-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 0.6rem;
  background: var(--rp-primary);
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
}

/* ---------- App shell (authenticated) ---------- */
.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--rp-sidebar-width);
  flex-shrink: 0;
  background: #fff;
  border-right: 1px solid rgba(0, 0, 0, 0.08);
  padding: 1.25rem 0.75rem;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: inherit;
  padding: 0 0.5rem 1.25rem;
  font-weight: 600;
}

.sidebar-nav .nav-link {
  color: #495057;
  border-radius: 0.5rem;
  padding: 0.55rem 0.75rem;
  margin-bottom: 0.15rem;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.92rem;
}

.sidebar-nav .nav-link i {
  width: 1.2rem;
  text-align: center;
  color: #6c757d;
}

.sidebar-nav .nav-link.active,
.sidebar-nav .nav-link:hover {
  background: rgba(47, 111, 79, 0.1);
  color: var(--rp-primary-dark);
}

.sidebar-nav .nav-link.active i {
  color: var(--rp-primary);
}

.sidebar-footer {
  margin-top: auto;
  padding: 0.75rem 0.5rem 0;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.app-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  background: #fff;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  padding: 0.75rem 1rem;
  position: sticky;
  top: 0;
  z-index: 1020;
}

.topbar-brand {
  font-weight: 600;
  text-decoration: none;
  color: inherit;
}

.app-header {
  padding: 1rem 1.5rem;
  background: #fff;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.app-main {
  flex: 1;
  padding: 1.25rem;
  padding-bottom: calc(var(--rp-bottom-nav-height) + 1.25rem);
}

@media (min-width: 992px) {
  .app-main {
    padding: 1.5rem 2rem;
    padding-bottom: 2rem;
  }
}

/* ---------- Bottom mobile nav ---------- */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--rp-bottom-nav-height);
  background: #fff;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  display: flex;
  z-index: 1030;
}

.bottom-nav-link {
  flex: 1;
  border: none;
  background: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  font-size: 0.7rem;
  color: #6c757d;
  text-decoration: none;
}

.bottom-nav-link i {
  font-size: 1.15rem;
}

.bottom-nav-link.active {
  color: var(--rp-primary);
}

.more-menu-list li + li {
  margin-top: 0.25rem;
}

.more-menu-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.5rem;
  border-radius: 0.5rem;
  text-decoration: none;
  color: #333;
}

.more-menu-link.active,
.more-menu-link:hover {
  background: rgba(47, 111, 79, 0.1);
  color: var(--rp-primary-dark);
}

/* ---------- Shared page bits ---------- */
.card {
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.kpi-card .kpi-value {
  font-size: 1.4rem;
  font-weight: 700;
}

.kpi-card .kpi-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #6c757d;
}

.progress {
  height: 0.55rem;
}

.chart-card canvas {
  max-height: 280px;
}

.demo-badge {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.table-sticky-header th {
  position: sticky;
  top: 0;
  background: #fff;
}
