:root {
  --bg-base: #070912;
  --bg-sidebar: #080b16;
  --bg-surface: #0c1020;
  --bg-elevated: #12182b;
  --border: #1a2340;
  --border-bright: #344269;
  --accent: #7da8ff;
  --accent-dim: #5f82d4;
  --accent-soft: #b9c8ff;
  --text-primary: #f4f6ff;
  --text-secondary: #99a4be;
  --text-muted: #69748e;
  --critical: #ec626c;
  --high: #ff9b61;
  --medium: #e9c25d;
  --low: #49c98a;
  --sb-expanded: 232px;
  --sb-collapsed: 64px;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-base);
  color: var(--text-primary);
  font-family: 'Inter', system-ui, -apple-system, "Segoe UI", sans-serif;
  line-height: 1.5;
}

/* ---------- Sidebar ---------- */

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  width: var(--sb-expanded);
  flex-shrink: 0;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 12px;
  transition: width 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 50;
}

.sidebar.collapsed {
  width: var(--sb-collapsed);
}

.sb-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 4px 6px 6px;
  margin-bottom: 14px;
  min-height: 44px;
}

.sb-logo {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #000;
  border: 1px solid var(--border-bright);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #fff;
}

.sb-title {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  white-space: nowrap;
}

.sb-title .t1 {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.sb-title .t2 {
  font-size: 11.5px;
  color: var(--text-secondary);
  margin-top: 1px;
}

/* Collapse toggle — floating circle on the sidebar edge */
.sb-toggle {
  position: absolute;
  top: 26px;
  right: -11px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--bg-elevated);
  border: 1px solid var(--border-bright);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: color 0.15s, border-color 0.15s, transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 60;
}

.sb-toggle:hover {
  color: var(--text-primary);
  border-color: #3d3d3d;
}

.sidebar.collapsed .sb-toggle {
  transform: rotate(180deg);
}

.sb-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
}

.sb-nav::-webkit-scrollbar { display: none; }

.sb-section {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0 10px;
  margin: 16px 0 6px;
  white-space: nowrap;
  overflow: hidden;
  transition: opacity 0.18s;
}

.sidebar.collapsed .sb-section {
  opacity: 0;
  margin: 8px 0 0;
  height: 1px;
  background: var(--border);
  padding: 0;
  margin-left: 10px;
  margin-right: 10px;
}

.sb-item {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 36px;
  padding: 0 10px;
  border-radius: 8px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  transition: background 0.14s, color 0.14s;
  flex-shrink: 0;
  cursor: pointer;
  background: transparent;
  border: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
}

.sb-item:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
}

.sb-item.active {
  color: var(--text-primary);
  background: var(--bg-elevated);
}

.sb-item .sb-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
}

.sb-item .sb-label {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: opacity 0.18s;
}

.sb-item .sb-kbd {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 400;
  transition: opacity 0.18s;
}

.sidebar.collapsed .sb-label,
.sidebar.collapsed .sb-kbd {
  opacity: 0;
  width: 0;
  flex: none;
}

.sidebar.collapsed .sb-item {
  justify-content: center;
  padding: 0;
  gap: 0;
}

.sidebar.collapsed .sb-head {
  justify-content: center;
  padding: 6px 0;
}

.sidebar.collapsed .sb-title {
  display: none;
}

/* Search block pinned at the bottom */
.sb-search {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 10px;
  border-radius: 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 13px;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  transition: border-color 0.15s, color 0.15s;
  flex-shrink: 0;
  margin-top: 10px;
}

.sb-search:hover {
  border-color: var(--border-bright);
  color: var(--text-secondary);
}

.sb-search .sb-kbd {
  margin-left: auto;
  font-size: 11px;
  border: 1px solid var(--border-bright);
  border-radius: 4px;
  padding: 0 5px;
  line-height: 16px;
}

.sidebar.collapsed .sb-search {
  justify-content: center;
  padding: 0;
  gap: 0;
  border-color: transparent;
  background: transparent;
}

.sidebar.collapsed .sb-search .sb-kbd,
.sidebar.collapsed .sb-search .sb-label {
  display: none;
}

.sb-footer {
  margin-top: 6px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

/* ---------- Tags — rectangular, small radius only ---------- */
.tag {
  border-radius: 4px;
  display: inline-block;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.tag-critical { background: rgba(198,95,87,0.12);  color: var(--critical); border: 1px solid rgba(198,95,87,0.3); }
.tag-high     { background: rgba(189,132,73,0.12); color: var(--high);     border: 1px solid rgba(189,132,73,0.3); }
.tag-medium   { background: rgba(177,160,79,0.12); color: var(--medium);   border: 1px solid rgba(177,160,79,0.3); }
.tag-low      { background: rgba(91,153,112,0.12); color: var(--low);      border: 1px solid rgba(91,153,112,0.3); }
.tag-product  { background: rgba(79,212,126,0.12); color: #8ea9cf;         border: 1px solid rgba(79,212,126,0.3); }
.tag-change   { background: rgba(139,130,179,0.12); color: #8b82b3;        border: 1px solid rgba(139,130,179,0.3); }

.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
}

.card-elevated {
  background: var(--bg-elevated);
  border: 1px solid var(--border-bright);
  border-radius: 10px;
  padding: 16px;
}

/* ---------- Hero — borderless, sits on the page like Dashfolio (v1) ---------- */
.hero {
  position: relative;
  padding: 40px 8px 8px;
}

.hero-kicker {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.hero h1 {
  margin: 0 0 18px;
  font-size: 42px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.12;
  color: var(--text-primary);
}

.hero h1 .accent {
  color: var(--text-muted);
}

.hero-sub {
  max-width: 640px;
  font-size: 15px;
  line-height: 1.65;
  color: var(--text-secondary);
  margin: 0 0 32px;
}

.hero-features {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 28px;
}

@media (max-width: 900px) {
  .hero-features { grid-template-columns: repeat(2, 1fr); }
  .hero { padding: 24px 0 8px; }
  .hero h1 { font-size: 30px; }
}

.hero-feature {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-surface);
  padding: 16px;
  transition: border-color 0.15s;
}

.hero-feature:hover {
  border-color: var(--border-bright);
}

.hero-feature .hf-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.hero-feature .hf-desc {
  font-size: 12px;
  line-height: 1.55;
  color: var(--text-secondary);
}

.hero-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.btn-ghost {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border-bright);
  border-radius: 8px;
  padding: 8px 16px;
  cursor: pointer;
  font-weight: 500;
  font-size: 13.5px;
  text-decoration: none;
  display: inline-block;
  transition: background 0.15s, border-color 0.15s;
}
.btn-ghost:hover {
  background: #242424;
  border-color: #3a3a3a;
}

a.btn-primary,
button.btn-primary {
  background: #e9e9e9;
  color: #111;
  border: none;
  border-radius: 8px;
  padding: 9px 18px;
  cursor: pointer;
  font-weight: 600;
  font-size: 13.5px;
  text-decoration: none;
  display: inline-block;
  transition: background 0.15s;
}
a.btn-primary:hover,
button.btn-primary:hover {
  background: #fff;
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--low);
  display: inline-block;
  animation: pulse 2.4s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(91,153,112,0.45); }
  50%      { opacity: 0.65; box-shadow: 0 0 0 5px rgba(91,153,112,0); }
}

input[type="text"], input[type="search"] {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  padding: 8px 12px;
  outline: none;
  transition: border-color 0.15s;
}
input:focus {
  border-color: var(--border-bright);
}

/* ============================================================
   Learn / article body — remaps 365Consultants HTML classes
   to the Forge palette (steel blue replaces orange)
   ============================================================ */

.learn-body h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 2.25rem 0 0.6rem;
  letter-spacing: -0.02em;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
}

.learn-body h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 1.6rem 0 0.5rem;
}

.learn-body h4 {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent-soft);
  margin: 1.1rem 0 0.35rem;
}

.learn-body p {
  color: var(--text-secondary);
  font-size: 0.94rem;
  line-height: 1.8;
  margin-bottom: 0.9rem;
}

.learn-body strong {
  color: var(--text-primary);
}

.learn-body a {
  color: var(--accent);
  text-decoration: none;
}

.learn-body a:hover {
  text-decoration: underline;
}

.learn-body ul,
.learn-body ol {
  padding-left: 1.4rem;
  margin-bottom: 1rem;
}

.learn-body li {
  color: var(--text-secondary);
  font-size: 0.92rem;
  line-height: 1.7;
  margin-bottom: 0.35rem;
}

.learn-body li strong {
  color: var(--text-primary);
}

/* Inline code */
.learn-body code {
  font-family: inherit;
  font-size: 0.82em;
  color: var(--accent-soft);
  background: rgba(79,212,126, 0.12);
  border: 1px solid rgba(79,212,126, 0.2);
  border-radius: 3px;
  padding: 1px 5px;
}

/* Code blocks */
.learn-body pre {
  background: var(--bg-sidebar);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1rem 1.1rem;
  margin: 0.8rem 0 1.25rem;
  overflow-x: auto;
}

.learn-body pre code {
  background: none;
  border: none;
  padding: 0;
  color: var(--text-secondary);
  font-size: 0.8rem;
  line-height: 1.7;
}

/* Syntax highlight spans (from 365Consultants PowerShell blocks) */
.learn-body .ps-comment { color: #6a9153; }
.learn-body .ps-cmdlet  { color: var(--accent-soft); }
.learn-body .ps-param   { color: #9cdcfe; }
.learn-body .ps-string  { color: #ce9178; }
.learn-body .ps-var     { color: #4fc1ff; }

/* Callouts */
.learn-body .callout {
  background: rgba(79,212,126, 0.06);
  border: 1px solid rgba(79,212,126, 0.22);
  border-left: 3px solid var(--accent);
  border-radius: 6px;
  padding: 0.9rem 1.1rem;
  margin: 1.25rem 0;
}

.learn-body .callout p {
  color: var(--accent-soft);
  margin: 0;
  font-size: 0.89rem;
}

.learn-body .callout strong {
  color: #d4e3f5;
}

.learn-body .warn-callout {
  background: rgba(177, 160, 79, 0.06);
  border: 1px solid rgba(177, 160, 79, 0.22);
  border-left: 3px solid var(--medium);
  border-radius: 6px;
  padding: 0.9rem 1.1rem;
  margin: 1.25rem 0;
}

.learn-body .warn-callout p {
  color: #ead98a;
  margin: 0;
  font-size: 0.89rem;
}

.learn-body .warn-callout strong {
  color: #f5edb2;
}

.learn-body .info-callout {
  background: rgba(79,212,126, 0.06);
  border: 1px solid rgba(79,212,126, 0.18);
  border-left: 3px solid var(--accent-dim);
  border-radius: 6px;
  padding: 0.9rem 1.1rem;
  margin: 1.25rem 0;
}

.learn-body .info-callout p {
  color: var(--accent-soft);
  margin: 0;
  font-size: 0.89rem;
}

.learn-body .info-callout strong {
  color: #d4e3f5;
}

/* Tags */
.learn-body .tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 1.75rem 0;
}

.learn-body .tag {
  padding: 2px 9px;
  border-radius: 4px;
  font-size: 0.77rem;
  background: rgba(79,212,126, 0.1);
  border: 1px solid rgba(79,212,126, 0.22);
  color: var(--accent-soft);
}

/* Step labels */
.learn-body .step-label {
  display: inline-block;
  background: var(--accent-dim);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 4px;
  margin-bottom: 0.5rem;
}

/* Keyboard shortcut / kbd */
.learn-body kbd {
  background: var(--bg-elevated);
  border: 1px solid var(--border-bright);
  border-radius: 3px;
  padding: 1px 5px;
  font-family: inherit;
  font-size: 0.8em;
  color: var(--text-secondary);
}

/* TOC */
.learn-body .toc {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 1.2rem 1.4rem;
  margin-bottom: 2rem;
}

.learn-body .toc h4 {
  color: var(--text-secondary);
  font-size: 0.82rem;
  margin-bottom: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.learn-body .toc ol {
  margin: 0;
  padding-left: 1.2rem;
}

.learn-body .toc li {
  font-size: 0.85rem;
  margin-bottom: 0.3rem;
}

.learn-body .toc a {
  color: var(--accent);
}

/* Checklist */
.learn-body .checklist {
  list-style: none;
  padding: 0;
}

.learn-body .checklist li {
  position: relative;
  padding-left: 1.8rem;
}

.learn-body .checklist li::before {
  content: "☐";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-size: 0.95rem;
}

/* Comparison table */
.learn-body .compare-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.25rem 0;
  font-size: 0.875rem;
}

.learn-body .compare-table th {
  background: var(--bg-elevated);
  color: var(--text-primary);
  padding: 0.65rem 0.9rem;
  text-align: left;
  font-weight: 600;
}

.learn-body .compare-table td {
  padding: 0.55rem 0.9rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
  vertical-align: top;
}

.learn-body .compare-table tr:last-child td {
  border-bottom: 0;
}

.learn-body .compare-table td:first-child {
  color: var(--text-primary);
  font-weight: 500;
}

/* Flow boxes (HMA auth flow diagram) */
.learn-body .flow-box {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1.1rem 1.3rem;
  margin: 1.1rem 0;
}

.learn-body .flow-box p {
  color: var(--text-secondary);
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.85;
}

.learn-body .flow-step {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  margin-bottom: 0.45rem;
}

.learn-body .flow-num {
  flex-shrink: 0;
  width: 21px;
  height: 21px;
  background: var(--accent-dim);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: #fff;
  margin-top: 2px;
}

.learn-body .flow-text {
  color: var(--text-secondary);
  font-size: 0.875rem;
  line-height: 1.7;
}

.learn-body .flow-text strong {
  color: var(--text-primary);
}

.learn-body .flow-arrow {
  text-align: center;
  color: var(--border-bright);
  font-size: 1rem;
  margin: 0.1rem 0;
}

/* Learn card hover */
.learn-card:hover {
  border-color: var(--border-bright) !important;
  background: var(--bg-elevated) !important;
}
