  :root {
    --bg: #ffffff;
    --bg-elev: #f4f7fc;
    --bg-card: #f9fafb;
    --border: #e5e7eb;
    --border-light: #f0f0f0;
    --text: #333333;
    --text-dim: #757575;
    --text-bright: #1a1a1a;
    --accent: #ff7e03;
    --accent-hover: #DF6C00;
    --accent-soft: rgba(255, 126, 3, 0.1);
    --red: #dc3545;
    --red-soft: rgba(220, 53, 69, 0.08);
    --green: #198754;
    --green-soft: rgba(25, 135, 84, 0.08);
    --yellow: #cc8a00;
    --yellow-soft: rgba(204, 138, 0, 0.08);
    --purple: #7c3aed;
    --purple-soft: rgba(124, 58, 237, 0.08);
    --orange: #e8590c;
    --orange-soft: rgba(232, 89, 12, 0.08);
    --code-bg: #1e293b;
    --code-text: #e2e8f0;
    --mono: 'JetBrains Mono', 'SF Mono', 'Monaco', 'Consolas', monospace;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.06);
    --radius: 10px;
  }

  [data-theme="dark"] {
    --bg: #111827;
    --bg-elev: #1f2937;
    --bg-card: #1f2937;
    --border: #374151;
    --border-light: #1f2937;
    --text: #d1d5db;
    --text-dim: #9ca3af;
    --text-bright: #f9fafb;
    --accent: #ff9633;
    --accent-hover: #ffad5c;
    --accent-soft: rgba(255, 150, 51, 0.15);
    --red: #f87171;
    --red-soft: rgba(248, 113, 113, 0.12);
    --green: #4ade80;
    --green-soft: rgba(74, 222, 128, 0.1);
    --yellow: #fbbf24;
    --yellow-soft: rgba(251, 191, 36, 0.1);
    --purple: #a78bfa;
    --purple-soft: rgba(167, 139, 250, 0.12);
    --orange: #fb923c;
    --orange-soft: rgba(251, 146, 60, 0.1);
    --code-bg: #0f172a;
    --code-text: #e2e8f0;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.2);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.3);
  }

  * { box-sizing: border-box; }

  html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: 'Poppins', sans-serif;
    font-size: 15px;
    line-height: 1.8;
    -webkit-font-smoothing: antialiased;
    transition: background 0.3s, color 0.3s;
  }

  /* ====== LAYOUT ====== */
  .app {
    display: grid;
    grid-template-columns: 280px 1fr;
    min-height: 100vh;
  }

  .sidebar {
    background: var(--bg-elev);
    border-right: 1px solid var(--border);
    padding: 24px 0;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    transition: background 0.3s, border-color 0.3s;
  }

  .sidebar-header {
    padding: 0 24px 20px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 16px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
  }

  .sidebar-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-bright);
    margin: 0 0 4px;
    letter-spacing: -0.3px;
  }

  .sidebar-subtitle {
    font-size: 12px;
    color: var(--text-dim);
    margin: 0;
  }

  /* ====== DARK MODE TOGGLE ====== */
  .theme-toggle {
    background: none;
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    padding: 6px;
    color: var(--text-dim);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 2px;
  }

  .theme-toggle:hover {
    color: var(--accent);
    border-color: var(--accent);
    background: var(--accent-soft);
  }

  .theme-toggle svg { width: 18px; height: 18px; }

  .theme-toggle .icon-sun { display: none; }
  .theme-toggle .icon-moon { display: block; }
  [data-theme="dark"] .theme-toggle .icon-sun { display: block; }
  [data-theme="dark"] .theme-toggle .icon-moon { display: none; }

  .nav-section {
    padding: 0 16px;
    margin-bottom: 20px;
  }

  .nav-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-dim);
    padding: 0 8px;
    margin-bottom: 6px;
    font-weight: 600;
  }

  .nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer;
    color: var(--text);
    font-size: 13.5px;
    transition: all 0.15s;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    font-family: 'Poppins', sans-serif;
    font-weight: 400;
  }

  .nav-item:hover {
    background: var(--accent-soft);
    color: var(--accent);
  }

  .nav-item.active {
    background: var(--accent-soft);
    color: var(--accent);
    font-weight: 500;
  }

  .nav-num {
    font-family: var(--mono);
    font-size: 11px;
    color: var(--text-dim);
    min-width: 22px;
  }

  .nav-item.active .nav-num { color: var(--accent); }

  /* ====== MAIN ====== */
  .main {
    padding: 40px 56px 80px;
    max-width: 960px;
  }

  .panel { display: none; animation: fadein 0.2s ease; }
  .panel.active { display: block; }

  @keyframes fadein {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
  }

  /* ====== HEADER ====== */
  .pb-header {
    border-bottom: 1px solid var(--border);
    padding-bottom: 24px;
    margin-bottom: 32px;
  }

  .pb-meta {
    display: flex;
    gap: 8px;
    margin-bottom: 14px;
    flex-wrap: wrap;
  }

  .pb-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.3px;
    text-transform: uppercase;
  }

  .badge-red { background: var(--red-soft); color: var(--red); }
  .badge-yellow { background: var(--yellow-soft); color: var(--yellow); }
  .badge-green { background: var(--green-soft); color: var(--green); }
  .badge-purple { background: var(--purple-soft); color: var(--purple); }
  .badge-orange { background: var(--orange-soft); color: var(--orange); }
  .badge-blue { background: var(--accent-soft); color: var(--accent); }
  .badge-neutral {
    background: var(--bg-card);
    color: var(--text-dim);
    border: 1px solid var(--border);
  }

  .pb-title {
    font-size: 32px;
    font-weight: 300;
    color: var(--text-bright);
    margin: 0 0 8px;
    letter-spacing: -0.5px;
  }

  .pb-subtitle {
    font-size: 15px;
    color: var(--text-dim);
    margin: 0;
    font-weight: 400;
  }

  /* ====== SECTIONS ====== */
  .section {
    margin-bottom: 36px;
  }

  .section-title {
    font-size: 17px;
    font-weight: 600;
    color: var(--text-bright);
    margin: 0 0 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: -0.2px;
  }

  .section-icon {
    width: 4px;
    height: 22px;
    background: var(--accent);
    border-radius: 2px;
  }

  .section-icon.red { background: var(--red); }
  .section-icon.yellow { background: var(--yellow); }
  .section-icon.green { background: var(--green); }
  .section-icon.purple { background: var(--purple); }
  .section-icon.orange { background: var(--orange); }

  .section p { margin: 0 0 12px; }

  /* ====== CARDS ====== */
  .card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 22px;
    margin-bottom: 14px;
    box-shadow: var(--shadow-sm);
    transition: background 0.3s, border-color 0.3s;
  }

  .card-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-bright);
    margin: 0 0 10px;
    display: flex;
    align-items: center;
    gap: 8px;
  }

  /* ====== CODE BLOCKS ====== */
  pre {
    background: var(--code-bg);
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 16px 18px;
    overflow-x: auto;
    margin: 8px 0;
    font-family: var(--mono);
    font-size: 12.5px;
    line-height: 1.6;
    color: var(--code-text);
    box-shadow: var(--shadow-sm);
  }

  code {
    font-family: var(--mono);
    font-size: 0.88em;
    background: var(--accent-soft);
    color: var(--accent);
    padding: 2px 6px;
    border-radius: 4px;
  }

  pre code {
    background: none;
    padding: 0;
    font-size: 12.5px;
    color: var(--code-text);
  }

  .code-label {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    padding: 3px 10px;
    border-radius: 4px;
    margin-bottom: 6px;
  }

  .lbl-spl { background: var(--accent-soft); color: var(--accent); }
  .lbl-kql { background: var(--purple-soft); color: var(--purple); }
  .lbl-bash { background: var(--green-soft); color: var(--green); }
  .lbl-ps { background: var(--yellow-soft); color: var(--yellow); }

  /* ====== LISTS ====== */
  ul, ol {
    padding-left: 22px;
    margin: 8px 0 14px;
  }

  li { margin-bottom: 6px; }

  ul.checklist {
    list-style: none;
    padding-left: 0;
  }

  ul.checklist li {
    padding-left: 28px;
    position: relative;
    margin-bottom: 10px;
  }

  ul.checklist li::before {
    content: "";
    position: absolute;
    left: 4px;
    top: 7px;
    width: 14px;
    height: 14px;
    border: 2px solid var(--accent);
    border-radius: 3px;
  }

  /* ====== TABLES ====== */
  table {
    width: 100%;
    border-collapse: collapse;
    margin: 10px 0;
    font-size: 13.5px;
  }

  th, td {
    text-align: left;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
  }

  th {
    background: var(--bg-elev);
    font-weight: 600;
    color: var(--text-bright);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }

  td code { font-size: 0.85em; }

  /* ====== PICERL TIMELINE ====== */
  .picerl {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
    margin: 16px 0 22px;
  }

  .picerl-step {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 8px;
    text-align: center;
    font-size: 11px;
    color: var(--text-dim);
    transition: all 0.2s;
  }

  .picerl-step.current {
    border-color: var(--accent);
    background: var(--accent-soft);
    color: var(--accent);
  }

  .picerl-num {
    font-family: var(--mono);
    font-size: 10px;
    opacity: 0.6;
    display: block;
    margin-bottom: 2px;
  }

  .picerl-name {
    font-weight: 600;
    font-size: 12px;
  }

  /* ====== MITRE TAGS ====== */
  .mitre-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 12px 0;
  }

  .mitre-tag {
    font-family: var(--mono);
    font-size: 11px;
    padding: 4px 10px;
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-dim);
  }

  .mitre-tag strong { color: var(--text-bright); }

  /* ====== CALLOUTS ====== */
  .callout {
    border-left: 3px solid var(--accent);
    background: var(--accent-soft);
    padding: 14px 18px;
    border-radius: 0 var(--radius) var(--radius) 0;
    margin: 16px 0;
    font-size: 13.5px;
  }

  .callout.warn {
    border-color: var(--yellow);
    background: var(--yellow-soft);
  }

  .callout.crit {
    border-color: var(--red);
    background: var(--red-soft);
  }

  .callout-title {
    font-weight: 700;
    color: var(--text-bright);
    margin-bottom: 6px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
  }

  /* ====== TWO COL ====== */
  .grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
  }

  /* ====== HOME / INDEX ====== */
  .hero {
    background: linear-gradient(135deg, var(--bg-elev) 0%, var(--bg-card) 100%);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 40px 40px 36px;
    margin-bottom: 32px;
    box-shadow: var(--shadow-md);
  }

  .hero h1 {
    font-size: 30px;
    font-weight: 300;
    margin: 0 0 8px;
    color: var(--text-bright);
    letter-spacing: -0.5px;
  }

  .hero p {
    color: var(--text-dim);
    font-size: 15px;
    margin: 0 0 18px;
  }

  .hero-stats {
    display: flex;
    gap: 32px;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
  }

  .stat-num {
    font-size: 22px;
    font-weight: 600;
    color: var(--accent);
    display: block;
    font-family: var(--mono);
  }

  .stat-label {
    font-size: 11px;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }

  .pb-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 14px;
    margin-top: 18px;
  }

  .pb-tile {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 20px;
    cursor: pointer;
    transition: all 0.15s;
    box-shadow: var(--shadow-sm);
  }

  .pb-tile:hover {
    transform: translateY(-2px);
    border-color: var(--accent);
    box-shadow: var(--shadow-md);
  }

  .pb-tile-num {
    font-family: var(--mono);
    font-size: 11px;
    color: var(--text-dim);
    margin-bottom: 4px;
  }

  .pb-tile-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-bright);
    margin-bottom: 6px;
  }

  .pb-tile-desc {
    font-size: 13px;
    color: var(--text-dim);
    margin: 0 0 10px;
    line-height: 1.5;
  }

  /* ====== RESPONSIVE ====== */
  @media (max-width: 900px) {
    .app { grid-template-columns: 1fr; }
    .sidebar {
      position: relative;
      height: auto;
      border-right: none;
      border-bottom: 1px solid var(--border);
    }
    .main { padding: 24px 20px; }
    .grid-2 { grid-template-columns: 1fr; }
    .picerl { grid-template-columns: repeat(3, 1fr); }
    .hero { padding: 28px 24px 24px; }
    .hero h1 { font-size: 24px; }
  }

  /* ====== UTILITIES ====== */
  .text-dim { color: var(--text-dim); }
  .text-bright { color: var(--text-bright); }
  .mb-0 { margin-bottom: 0; }
  .mt-0 { margin-top: 0; }
  .small { font-size: 12.5px; }

  /* Smooth transitions for theme switch */
  .sidebar, .card, .hero, .pb-tile, .callout, .picerl-step, .mitre-tag, th {
    transition: background 0.3s, border-color 0.3s, color 0.3s, box-shadow 0.3s;
  }
