/* ---- Brand palette (approximated from the Awetism Insights admin panel
   screenshot - refine with exact hex codes from the design team if
   pixel-perfect match matters) ---- */
:root {
  --brand-primary: #8DC63F;       /* bright lime green accent */
  --brand-primary-dark: #6FA82E;
  --brand-primary-light: #EEF7E1;
  --brand-bg: #FBF7F2;            /* soft cream page background */
  --brand-sidebar-bg: #FFFFFF;
  --brand-text: #2E2A26;          /* warm dark brown-black, not pure black */
  --brand-muted: #8A8178;
  --brand-border: #EFE7DD;
  --sidebar-width: 248px;
  --topbar-height: 64px;

  /* Rotating stat-tile colors, matching the admin panel's User
     Details/Locations/Referrals/Wallet cards */
  --stat-cyan: #29C4C6;
  --stat-yellow: #F2C94C;
  --stat-pink: #F2709C;
  --stat-blue: #7C93F4;
}

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

/* ---- App shell: sidebar + topbar layout (Uplon-inspired structure) ---- */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-width);
  background: var(--brand-sidebar-bg);
  border-right: 1px solid var(--brand-border);
  position: fixed;
  top: 0; left: 0; bottom: 0;
  overflow-y: auto;
  z-index: 1030;
  transition: transform 0.2s ease;
}

.sidebar-brand {
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  padding: 0 1.25rem;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--brand-primary-dark);
  border-bottom: 1px solid var(--brand-border);
}

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

.sidebar-nav .nav-link {
  color: var(--brand-text);
  border-radius: 10px;
  padding: 0.6rem 0.9rem;
  margin-bottom: 0.15rem;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.92rem;
}

.sidebar-nav .nav-link:hover {
  background: var(--brand-primary-light);
  color: var(--brand-primary-dark);
}

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

.sidebar-nav .nav-section-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--brand-muted);
  padding: 0.75rem 0.9rem 0.25rem;
}

.main-area {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  height: var(--topbar-height);
  background: #fff;
  border-bottom: 1px solid var(--brand-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.25rem;
  position: sticky;
  top: 0;
  z-index: 1020;
}

.topbar .btn-sidebar-toggle {
  display: none;
  border: none;
  background: transparent;
  font-size: 1.3rem;
  color: var(--brand-text);
}

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

/* ---- Cards / widgets styled in the brand's rounded, soft-shadow feel ---- */
.card {
  border: 1px solid var(--brand-border);
  border-radius: 14px;
  box-shadow: 0 2px 10px rgba(46, 42, 38, 0.04);
}
.card-header {
  background: #fff;
  border-bottom: 1px solid var(--brand-border);
  font-weight: 600;
  border-radius: 14px 14px 0 0 !important;
}

.btn-primary {
  background-color: var(--brand-primary);
  border-color: var(--brand-primary);
}
.btn-primary:hover, .btn-primary:focus {
  background-color: var(--brand-primary-dark);
  border-color: var(--brand-primary-dark);
}
.btn-outline-primary {
  color: var(--brand-primary-dark);
  border-color: var(--brand-primary);
}
.btn-outline-primary:hover {
  background-color: var(--brand-primary);
  border-color: var(--brand-primary);
}

.badge.bg-primary { background-color: var(--brand-primary) !important; }

.table thead th {
  background: var(--brand-primary-light);
  color: var(--brand-primary-dark);
  font-weight: 600;
  border-bottom: none;
}

.parent-code { font-family: monospace; color: var(--brand-muted); }

/* ---- Timeline (unchanged behaviour, restyled to match) ---- */
.timeline { list-style: none; padding-left: 0; border-left: 2px solid var(--brand-border); margin-left: 0.5rem; }
.timeline li { position: relative; padding: 0.5rem 0 0.5rem 1.25rem; }
.timeline li::before {
  content: "";
  position: absolute; left: -7px; top: 1rem;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--brand-primary);
}

/* ---- Stat tiles: flat, saturated summary cards (dashboard KPIs), each
   in a rotating color from the reference admin panel ---- */
.stat-tile {
  border: none;
  border-radius: 16px;
  padding: 1.1rem 1.25rem;
  color: #1F2320;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-height: 108px;
}
.stat-tile .stat-tile-icon {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.55);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.15rem;
}
.stat-tile .stat-tile-value { font-size: 1.9rem; font-weight: 700; line-height: 1; }
.stat-tile .stat-tile-label { font-weight: 600; opacity: 0.85; }
.stat-tile a { color: inherit; text-decoration: none; }
.stat-tile a:hover .stat-tile-value { text-decoration: underline; }

.stat-tile-cyan { background: var(--stat-cyan); }
.stat-tile-yellow { background: var(--stat-yellow); }
.stat-tile-pink { background: var(--stat-pink); }
.stat-tile-blue { background: var(--stat-blue); }

/* ---- Responsive: collapse sidebar off-canvas on small screens ---- */
@media (max-width: 991px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.show { transform: translateX(0); }
  .main-area { margin-left: 0; }
  .topbar .btn-sidebar-toggle { display: inline-block; }
}
