/* ===== Design Tokens (from provided design) ===== */
:root{
  --bg:#0b1020;            /* page chrome / background */
  --ink:#0f172a;           /* body text on light surfaces */
  --muted:#475569;         /* secondary text */
  --brand:#2447f9;         /* accent */
  --paper:#ffffff;         /* cards / panels */
  --edge:#e2e8f0;          /* borders / dividers */
  --chip:#f1f5f9;          /* subtle fills */
  --success:#16a34a;

  /* Existing app tokens */
  --sidebar-w: 280px;
  --border: var(--edge);
  --muted-bg: #f7f7f7;
  --overlay: rgba(0,0,0,.25);
  --transition: 240ms ease;
}

/* ===== Base / Reset ===== */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
html,body{ margin:0; }
body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji","Segoe UI Emoji";
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
}

/* ===== Top Bar (fixed so burger never scrolls away) ===== */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 40;
  height: 56px;
  display: flex; align-items: center; gap: 12px; padding: 0 12px;
  /* hero-ish dark header to match design */
  background: linear-gradient(180deg, #0b1020 0%, #11183a 100%);
  color: #e2e8f0;
  border-bottom: 1px solid rgba(148,163,184,.25);
  box-shadow: 0 6px 18px rgba(2,6,23,.35);
}
.topbar-title { font-weight: 800; letter-spacing: .2px; }

/* Layout grid */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  margin-top: 56px; /* push content below the fixed topbar */
}

/* ===== Left Sidebar (sticky on desktop, scrollable inside) ===== */
.sidebar {
  /* Card/Panel look from design */
  background: var(--paper);
  border-right: 1px solid var(--edge);
  box-shadow: 4px 0 24px rgba(2,6,23,.08);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;

  /* follows scrolling */
  position: sticky;
  top: 56px;
  height: calc(100vh - 56px);
  overflow-y: auto;
  scrollbar-gutter: stable both-edges;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition), border-color var(--transition);

  /* angled/triangle trailing edge (kept) */
  clip-path: polygon(0 0, 100% 0, 96% 100%, 0 100%);
  z-index: 20;
}

/* Subtle “active” feel when menu is open */
body.menu-open .sidebar {
  background: var(--paper);
  border-right-color: var(--edge);
  box-shadow: 6px 0 32px rgba(2,6,23,.16);
}

.logo {
  padding: 8px;
  background: #1f2a6b; /* design’s logo tile */
  border: 1px solid #3647a0;
  border-radius: 10px;
  width: fit-content;
  box-shadow: inset 0 0 0 1px #3647a0, 0 10px 20px rgba(0,0,0,.12);
}
.logo img { display: block; width: 48px; height: 48px; object-fit: contain; }

.menu-heading { font-size: .9rem; letter-spacing: .08em; text-transform: uppercase; margin: 8px 0 4px; color: var(--muted); }
.menu ul { list-style: none; padding: 0; margin: 0; }
.menu li + li { margin-top: 8px; }
/* ===== Sidebar menu items ===== */
.menu a{
  /* base look */
  text-decoration: none;
  color: #0f172a;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid transparent;
  transition: background .18s ease, border-color .18s ease, color .18s ease, box-shadow .18s ease;

  /* Workly-style layout */
  display: flex;           /* icon + label on one row */
  align-items: center;
  gap: 10px;
  font-weight: 600;
}

.menu a:hover{
  background: var(--chip);
  border-color: var(--edge);
}

/* icon size/tone inside links */
.menu a .bi{
  font-size: 1rem;
  opacity: .9;
}

/* active state (keeps your blue tint but with a subtle gradient) */
.menu a.active{
  background: linear-gradient(90deg, #eef2ff 0%, #ffffff 60%);
  color: #1d4ed8;
  border-color: #c7d2fe;
  box-shadow: 0 4px 12px rgba(37,99,235,.12) inset;
}


.extra { margin-top: auto; font-size: 24px; letter-spacing: 6px; color: var(--muted); }

/* Main content (hero already has padding) */
.content { padding: 0 0 24px; }

/* ===== Overlay (mobile) — keep clicks but no darkening of page ===== */
.overlay {
  position: fixed;
  inset: 56px 0 0 0;
  background: transparent !important;
  z-index: 10;
}

/* ===== Burger button ===== */
.burger {
  width: 44px; height: 36px;
  display: inline-flex; flex-direction: column; justify-content: center; gap: 5px;
  border: none;
  background: transparent;
  cursor: pointer;
  color: #e2e8f0;
}
.burger:focus-visible { outline: 2px solid #93c5fd; outline-offset: 2px; }
.burger-bar {
  display: block; height: 2px; width: 24px; margin: 0 auto;
  background: currentColor; /* adapts to topbar color */
  transition: transform var(--transition), opacity var(--transition);
}
body.menu-open .burger-bar:nth-child(1){ transform: translateY(7px) rotate(45deg); }
body.menu-open .burger-bar:nth-child(2){ opacity: 0; }
body.menu-open .burger-bar:nth-child(3){ transform: translateY(-7px) rotate(-45deg); }

/* ===== Collapsing behavior (desktop) ===== */
@media (min-width: 901px) {
  body:not(.menu-open) .sidebar { transform: translateX(calc(-1 * var(--sidebar-w))); }
  body:not(.menu-open) .app { grid-template-columns: 0 1fr; }
}

/* ===== Mobile / tablet (slide-over fixed) ===== */
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    top: 56px; left: 0; bottom: 0;
    width: min(100vw, var(--sidebar-w));
    height: auto;
    transform: translateX(-100%);
    box-shadow: 0 12px 30px rgba(2,6,23,.30);
    clip-path: none;
    border-right: 1px solid var(--edge);
  }
  body.menu-open .sidebar { transform: translateX(0); }
  body.menu-open #overlay { display: block; }
}

/* ===== Submenu (Dashboard > Learn More) ===== */
.has-submenu { margin-top: 8px; }
.submenu-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  background: transparent;
  border: none;
  padding: 6px 8px;
  cursor: pointer;
  color: #0f172a;
  border-radius: 10px;
  text-align: left;
  font: inherit;
}
.submenu-toggle:hover { background: var(--chip); border: 1px solid var(--edge); }

.caret {
  width: 0; height: 0;
  border-left: 5px solid #0000;
  border-right: 5px solid #0000;
  border-top: 6px solid currentColor;  /* ▼ */
  transition: transform 200ms ease;
}
.submenu-toggle.open .caret { transform: rotate(180deg); } /* ▲ when open */

.submenu {
  list-style: none;
  margin: 4px 0 0 0;
  padding: 0 0 0 12px;
  border-left: 2px solid var(--edge);
}
.submenu li + li { margin-top: 6px; }
.submenu a {
  display: block;
  padding: 4px 6px;
  text-decoration: none;
  color: inherit;
  border-radius: 8px;
  font-size: 0.95rem;
}
.submenu a:hover { background: #f8fafc; }

/* Make anchor targets stop below the fixed topbar (offset ~72px) */
[id] { scroll-margin-top: 72px; }

/* Allow the menu area to scroll independently if it’s long */
.sidebar .menu {
  max-height: calc(100vh - 56px - 24px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

/* ===== Reusable UI (from the design) ===== */

/* Page shell helpers (optional) */
.wrap{max-width:1100px; margin:0 auto; padding:24px}

/* Chips (for top nav / filters) */
.chip{
  background:rgba(255,255,255,.08);
  color:#e0e7ff;
  border:1px solid rgba(255,255,255,.18);
  padding:8px 12px;
  border-radius:999px;
  font-size:14px;
  text-decoration:none;
}
.chip:hover{background:rgba(255,255,255,.14)}

/* Cards */
.card{
  background:var(--paper);
  border:1px solid var(--edge);
  border-radius:16px;
  padding:28px;
  box-shadow:0 10px 30px rgba(2,6,23,.06);
}

/* Headings & text */
h2{margin:0 0 12px; font-size:28px; letter-spacing:.2px}
h3{margin:24px 0 8px; font-size:20px}
p{margin:10px 0}
.muted{color:var(--muted)}
.lead{font-size:18px}

/* Two-column helper */
.twocol{display:grid; grid-template-columns:1fr; gap:22px}
@media (min-width:900px){.twocol{grid-template-columns:1fr 1fr}}

/* Factors grid */
.factors{display:grid; grid-template-columns:repeat(1,minmax(0,1fr)); gap:10px; margin-top:14px}
@media (min-width:720px){.factors{grid-template-columns:repeat(2,minmax(0,1fr))}}
.factor{display:flex; align-items:flex-start; gap:10px; padding:10px 12px; border-radius:12px; border:1px solid var(--edge); background:var(--chip)}
.factor svg{flex:0 0 18px; margin-top:3px}
.factor a{color:inherit; text-decoration:none}
.factor a:hover{color:var(--brand); text-decoration:underline}

/* Checklist */
.checklist{display:grid; gap:8px}
.check{display:flex; gap:10px; align-items:flex-start}
.check svg{flex:0 0 18px; margin-top:2px}

/* Buttons */
.btn{
  display:inline-flex; align-items:center; gap:10px;
  padding:12px 16px; border-radius:12px;
  background:#1d4ed8; color:white; text-decoration:none; font-weight:600;
  border:1px solid #1e40af;
}
.btn:hover{filter:brightness(1.08)}

/* Table */
table{width:100%; border-collapse:separate; border-spacing:0; overflow:hidden; border-radius:12px; border:1px solid var(--edge)}
thead th{background:#f8fafc; padding:12px; text-align:left; font-weight:700; border-bottom:1px solid var(--edge)}
tbody td{padding:12px; border-top:1px solid var(--edge)}

/* Links and interactive states */
a { color: var(--brand); }
a:hover { text-decoration: underline; }

/* Utility badges / toc (optional) */
.badge{display:inline-flex; align-items:center; gap:8px; padding:6px 10px; border-radius:999px; border:1px solid var(--edge); background:var(--chip); font-size:13px}
.toc{display:flex; flex-wrap:wrap; gap:8px; margin:8px 0 0}
.toc a{font-size:14px; color:var(--brand); text-decoration:none; border:1px dashed var(--edge); padding:6px 10px; border-radius:8px}
.toc a:hover{background:#eef2ff}

/* Footer helper */
footer{padding:40px 0 64px; color:#e2e8f0}

/* ===== Optional: top “hero” wrapper if you add one above .app ===== */
header.hero{
  background:linear-gradient(180deg, #0b1020 0%, #11183a 100%);
  color:#eef2ff;
  padding:56px 0 28px;
  position:relative;
  overflow:hidden;
}
header .wrap{position:relative; z-index:2}
.brand{display:flex; align-items:center; gap:12px; margin-bottom:20px}
.brand .logo{width:42px; height:42px; display:grid; place-items:center; border-radius:10px; background:#1f2a6b; box-shadow:inset 0 0 0 1px #3647a0, 0 10px 20px rgba(0,0,0,.2)}
.brand .logo svg{width:24px; height:24px; fill:#a5b4fc}
h1.title{margin:0 0 8px; font-weight:800; font-size:clamp(28px, 3.4vw, 42px); letter-spacing:.2px}
p.subtitle{margin:0; color:#c7d2fe; max-width:62ch}
nav.top{display:flex; gap:12px; flex-wrap:wrap; margin-top:22px}
