﻿/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   NRI AutoPilot â€” Sidebar + Dashboard Layout
   â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */

/* â”€â”€ App Shell â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.ap-shell {
  display: flex;
  min-height: 100vh;
}

/* â”€â”€ Sidebar â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.ap-sidebar {
  width: var(--ap-sidebar-w);
  height: 100vh;
  height: 100dvh;
  background: linear-gradient(180deg, #ffffff 0%, #f1f8f4 100%);
  border-right: 1px solid rgba(22, 101, 52, .14);
  box-shadow: 10px 0 30px rgba(15, 23, 42, .04);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  z-index: 200;
  transition: transform .3s cubic-bezier(0.4,0,0.2,1);
  overflow: hidden;
  overflow-x: hidden;
  scrollbar-width: thin;
}

/* â”€â”€ Sidebar Brand â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.sb-brand {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: 1.5rem 1.25rem 1rem;
  border-bottom: 1px solid rgba(22, 101, 52, .12);
  text-decoration: none;
  flex-shrink: 0;
}
.sb-brand-icon {
  width: 40px; height: 40px;
  border-radius: 12px;
  background: var(--ap-grad-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: #fff;
  flex-shrink: 0;
  box-shadow: var(--ap-shadow-glow);
}
.sb-brand-text { flex: 1; overflow: hidden; }
.sb-brand-name { font-size: .95rem; font-weight: 800; color: var(--ap-text); line-height: 1; font-family: 'Poppins', sans-serif; }
.sb-brand-sub  { font-size: .65rem; color: var(--ap-text-dim); font-weight: 500; letter-spacing: .5px; }

/* â”€â”€ Sidebar User Card â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.sb-user {
  margin: 1rem;
  padding: .9rem 1rem;
  background: rgba(255,255,255,.72);
  border: 1px solid rgba(22, 101, 52, .12);
  border-radius: var(--ap-radius);
  display: flex;
  align-items: center;
  gap: .75rem;
  flex-shrink: 0;
}
.sb-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--ap-grad-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: .9rem;
  color: #fff;
  flex-shrink: 0;
}
.sb-user-info { flex: 1; min-width: 0; }
.sb-user-name { font-size: .82rem; font-weight: 700; color: var(--ap-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-user-role { font-size: .65rem; color: var(--ap-text-dim); }
.sb-user-dot  { width: 8px; height: 8px; border-radius: 50%; background: var(--ap-success); flex-shrink: 0; box-shadow: 0 0 6px var(--ap-success); }

/* â”€â”€ Sidebar Navigation â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.sb-nav {
  flex: 1 1 auto;
  min-height: 0;
  padding: .5rem 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(0,0,0,0.18) transparent;
}
.sb-nav::-webkit-scrollbar { width: 5px; }
.sb-nav::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.18);
  border-radius: 999px;
}
.sb-nav::-webkit-scrollbar-track { background: transparent; }
.sb-section { padding: .6rem 1.25rem .25rem; font-size: .6rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1.2px; color: var(--ap-text-dim); }

.sb-link {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .7rem 1.25rem;
  color: var(--ap-text-muted);
  text-decoration: none;
  font-size: .855rem;
  font-weight: 500;
  transition: var(--ap-trans);
  border-left: 3px solid transparent;
  margin: 1px 0;
  position: relative;
}
.sb-link:hover {
  color: var(--ap-text);
  background: rgba(34,197,94,0.08);
  border-left-color: var(--ap-primary-light);
}
.sb-link.active {
  color: var(--ap-primary-light);
  background: rgba(34,197,94,0.10);
  border-left-color: var(--ap-primary);
  font-weight: 600;
}
.sb-link.active .sb-icon { color: var(--ap-primary-light); }
.sb-icon { font-size: .95rem; width: 20px; text-align: center; flex-shrink: 0; color: var(--ap-text-dim); transition: var(--ap-trans); }
.sb-link:hover .sb-icon { color: var(--ap-primary-light); }

/* Badge on nav items */
.sb-badge {
  margin-left: auto;
  background: var(--ap-primary);
  color: #fff;
  border-radius: var(--ap-radius-pill);
  font-size: .6rem;
  font-weight: 700;
  padding: 1px 7px;
  min-width: 18px;
  text-align: center;
}

/* ── Sidebar Accordion Groups ──────────────────────────────────────────── */
.sb-group { margin: 1px 0; }

.sb-group-toggle {
  display: flex;
  align-items: center;
  gap: .75rem;
  width: 100%;
  padding: .65rem 1.25rem;
  background: none;
  border: none;
  border-left: 3px solid transparent;
  color: var(--ap-text-muted);
  font-size: .855rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: var(--ap-trans);
  position: relative;
}
.sb-group-toggle:hover {
  color: var(--ap-text);
  background: rgba(34,197,94,0.06);
  border-left-color: rgba(34,197,94,0.35);
}
.sb-group.is-open > .sb-group-toggle {
  color: var(--ap-primary-light);
  background: rgba(34,197,94,0.09);
  border-left-color: var(--ap-primary);
}
.sb-group-icon {
  font-size: .9rem;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
  color: var(--ap-text-dim);
  transition: var(--ap-trans);
}
.sb-group-toggle:hover .sb-group-icon,
.sb-group.is-open > .sb-group-toggle .sb-group-icon { color: var(--ap-primary-light); }

.sb-group-label {
  flex: 1;
  display: flex;
  align-items: center;
  gap: .35rem;
}
.sb-group-badge {
  background: var(--ap-primary);
  color: #fff;
  border-radius: var(--ap-radius-pill);
  font-size: .55rem;
  font-weight: 700;
  padding: 1px 6px;
  min-width: 16px;
  text-align: center;
}
.sb-group-arrow {
  font-size: .6rem;
  flex-shrink: 0;
  color: var(--ap-text-dim);
  transition: transform .22s ease;
  margin-left: auto;
}
.sb-group.is-open > .sb-group-toggle .sb-group-arrow { transform: rotate(180deg); }

/* Animated body */
.sb-group-body {
  overflow: hidden;
  max-height: 0;
  transition: max-height .25s ease;
  padding-left: .5rem;
}
.sb-group.is-open > .sb-group-body { max-height: 800px; }

.sb-group-body .sb-link {
  font-size: .82rem;
  padding-left: 2.75rem;
  border-left-width: 2px;
}
.sb-group-body .sb-link:hover { background: rgba(34,197,94,0.05); }
.sb-group-body .sb-link.active { background: rgba(34,197,94,0.09); }

/* â”€â”€ Sidebar Footer â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.sb-footer {
  padding: 1rem;
  border-top: 1px solid rgba(22, 101, 52, .12);
  flex-shrink: 0;
}
.sb-footer-link {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .7rem .9rem;
  color: var(--ap-text-dim);
  text-decoration: none;
  font-size: .82rem;
  border-radius: var(--ap-radius);
  transition: var(--ap-trans);
}
.sb-footer-link:hover { background: rgba(220,38,38,0.08); color: #DC2626; }

/* â”€â”€ Main Content Area â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.ap-main {
  flex: 1;
  margin-left: var(--ap-sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* â”€â”€ Top Bar â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.ap-topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: 64px;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--ap-border);
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  gap: 1rem;
}
.ap-topbar-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--ap-text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  padding: .4rem;
  border-radius: var(--ap-radius-sm);
  transition: var(--ap-trans);
}
.ap-topbar-toggle:hover { color: var(--ap-text); background: var(--ap-bg-glass); }
.ap-topbar-title { font-size: .95rem; font-weight: 700; color: var(--ap-text); flex: 1; }
.ap-topbar-actions { display: flex; align-items: center; gap: .75rem; }

/* Notification bell */
.tb-notif {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--ap-bg-glass);
  border: 1px solid var(--ap-border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ap-text-muted);
  cursor: pointer;
  transition: var(--ap-trans);
  position: relative;
  text-decoration: none;
}
.tb-notif:hover { border-color: var(--ap-primary); color: var(--ap-primary-light); }
.tb-notif-dot {
  position: absolute;
  top: 4px; right: 4px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--ap-danger);
  border: 2px solid var(--ap-bg);
}
.tb-notif-count {
  position: absolute;
  top: -6px;
  right: -8px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: var(--ap-radius-pill);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--ap-danger);
  color: #fff;
  border: 2px solid var(--ap-bg);
  font-size: .58rem;
  font-weight: 800;
  line-height: 1;
}

/* â”€â”€ Page Content â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.ap-content {
  flex: 1;
  padding: 1.75rem 1.5rem;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
}

/* â”€â”€ Page Header â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.ap-page-header {
  margin-bottom: 1.75rem;
}
.ap-page-header h1 {
  font-size: 1.6rem;
  font-weight: 800;
  margin-bottom: .25rem;
}
.ap-page-header p { color: var(--ap-text-muted); font-size: .9rem; }
.ap-breadcrumb {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: .75rem;
  color: var(--ap-text-dim);
  margin-bottom: .5rem;
}
.ap-breadcrumb a { color: var(--ap-text-dim); text-decoration: none; }
.ap-breadcrumb a:hover { color: var(--ap-primary-light); }
.ap-breadcrumb .sep { color: var(--ap-border); }

/* â”€â”€ Sidebar Overlay (mobile) â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.sb-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  z-index: 199;
}

/* â”€â”€ Mobile Responsive â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
@media (max-width: 1024px) {
  .ap-sidebar {
    transform: translateX(-100%);
  }
  .ap-sidebar.open {
    transform: translateX(0);
  }
  .sb-overlay.open { display: block; }
  .ap-main { margin-left: 0; }
  .ap-topbar-toggle { display: flex; align-items: center; }
  .ap-content { padding: 1.25rem 1rem; }
}

@media (max-width: 480px) {
  .ap-content { padding: 1rem .75rem; }
  .ap-topbar { padding: 0 1rem; }
}

/* Guided Dashboard Tour */
.ap-tour-launch {
  border: 1px solid rgba(34,197,94,.28);
  background: rgba(34,197,94,.08);
  color: var(--ap-primary-light);
}

.ap-tour-launch:hover,
.ap-tour-launch:focus-visible {
  border-color: var(--ap-primary);
  color: var(--ap-primary);
  outline: none;
}

.ap-tour-overlay {
  position: fixed;
  inset: 0;
  z-index: 5000;
  pointer-events: none;
}

.ap-tour-scrim {
  position: absolute;
  inset: 0;
  background: transparent;
  transition: background .2s ease, backdrop-filter .2s ease;
}

.ap-tour-overlay.ap-tour-no-target .ap-tour-scrim {
  background: rgba(15,23,42,.46);
  backdrop-filter: blur(2px);
}

.ap-tour-spotlight {
  position: fixed;
  border: 2px solid rgba(34,197,94,.95);
  border-radius: 14px;
  background: rgba(255,255,255,.01);
  box-shadow: 0 0 0 9999px rgba(15,23,42,.54), 0 18px 54px rgba(22,163,74,.28), inset 0 0 0 1px rgba(255,255,255,.65);
  transition: top .24s ease, left .24s ease, width .24s ease, height .24s ease, border-radius .24s ease;
  pointer-events: none;
}

.ap-tour-popover {
  position: fixed;
  width: min(400px, calc(100vw - 24px));
  max-height: min(72vh, 560px);
  overflow: auto;
  z-index: 5001;
  pointer-events: auto;
  border: 1px solid rgba(22,101,52,.18);
  border-radius: 12px;
  background: rgba(255,255,255,.98);
  color: var(--ap-text);
  box-shadow: 0 24px 70px rgba(15,23,42,.22);
  scrollbar-width: thin;
  overscroll-behavior: contain;
  transition: top .22s ease, left .22s ease, transform .22s ease;
}

.ap-tour-popover[data-placement="center"] {
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%);
}

.ap-tour-popover[data-placement="top"],
.ap-tour-popover[data-placement="bottom"],
.ap-tour-popover[data-placement="left"],
.ap-tour-popover[data-placement="right"] {
  transform: none;
}

.ap-tour-head {
  display: flex;
  gap: .9rem;
  align-items: flex-start;
  padding: 1rem 1rem .8rem;
  border-bottom: 1px solid rgba(22,101,52,.1);
}

.ap-tour-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #fff;
  background: linear-gradient(135deg, #16a34a, #84cc16);
  box-shadow: 0 12px 24px rgba(22,163,74,.22);
}

.ap-tour-kicker {
  color: var(--ap-text-dim);
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.ap-tour-title {
  margin-top: .15rem;
  font-size: 1rem;
  font-weight: 850;
  line-height: 1.25;
}

.ap-tour-close {
  margin-left: auto;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  color: var(--ap-text-muted);
  background: transparent;
  cursor: pointer;
}

.ap-tour-close:hover,
.ap-tour-close:focus-visible {
  background: rgba(15,23,42,.06);
  color: var(--ap-text);
  outline: none;
}

.ap-tour-body {
  padding: .95rem 1rem;
}

.ap-tour-body p {
  margin: 0;
  color: var(--ap-text-muted);
  font-size: .84rem;
  line-height: 1.58;
}

.ap-tour-detail {
  margin-top: .75rem;
  padding: .78rem;
  border: 1px solid rgba(22,163,74,.16);
  border-radius: 10px;
  background: rgba(22,163,74,.06);
  color: var(--ap-text-muted);
  font-size: .78rem;
  line-height: 1.55;
}

.ap-tour-chapters {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-top: .85rem;
}

.ap-tour-chip {
  border: 1px solid rgba(22,101,52,.14);
  border-radius: 999px;
  padding: .35rem .6rem;
  background: #fff;
  color: var(--ap-text-muted);
  font-size: .72rem;
  font-weight: 750;
  cursor: pointer;
}

.ap-tour-chip:hover,
.ap-tour-chip.active {
  border-color: rgba(34,197,94,.42);
  background: rgba(34,197,94,.09);
  color: var(--ap-primary-light);
}

.ap-tour-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .8rem 1rem 1rem;
  border-top: 1px solid rgba(22,101,52,.1);
}

.ap-tour-progress {
  min-width: 86px;
  color: var(--ap-text-dim);
  font-size: .74rem;
  font-weight: 800;
}

.ap-tour-actions {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.ap-tour-target {
  position: relative;
  z-index: 5002 !important;
  filter: none !important;
  opacity: 1 !important;
}

body.ap-tour-active {
  overflow-x: hidden;
}

@media (max-width: 560px) {
  .ap-tour-spotlight {
    border-radius: 11px;
    box-shadow: 0 0 0 9999px rgba(15,23,42,.50), 0 12px 32px rgba(22,163,74,.24), inset 0 0 0 1px rgba(255,255,255,.7);
  }

  .ap-tour-popover {
    width: calc(100vw - 18px);
    max-height: min(48vh, 390px);
    border-radius: 12px;
  }

  .ap-tour-head,
  .ap-tour-body,
  .ap-tour-foot {
    padding-left: .82rem;
    padding-right: .82rem;
  }

  .ap-tour-head {
    gap: .7rem;
    padding-top: .82rem;
    padding-bottom: .68rem;
  }

  .ap-tour-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
  }

  .ap-tour-title {
    font-size: .94rem;
  }

  .ap-tour-body p {
    font-size: .8rem;
    line-height: 1.52;
  }

  .ap-tour-detail {
    margin-top: .65rem;
    padding: .68rem;
    font-size: .74rem;
    line-height: 1.45;
  }

  .ap-tour-chapters {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: .1rem;
  }

  .ap-tour-chip {
    flex: 0 0 auto;
    padding: .32rem .55rem;
    font-size: .69rem;
  }

  .ap-tour-foot {
    align-items: stretch;
    flex-direction: column;
    gap: .55rem;
  }

  .ap-tour-actions {
    justify-content: stretch;
    gap: .4rem;
  }

  .ap-tour-actions .ap-btn {
    flex: 1;
    justify-content: center;
    min-height: 36px;
    padding-left: .55rem;
    padding-right: .55rem;
  }
}
