  :root {
    --ink: #0b0f1a;
    --paper: #f5f1eb;
    --slate: #1a2035;
    --mid: #2e3a52;
    --amber: #883CF0;
    --amber-light: #f5c55a;
    --amber-pale: #fdf3dc;
    --teal: #684895;
    --teal-dark: #0e8f7a;
    --red: #d94f3d;
    --muted: #d6d6d6;
    --border: #3a1c63;
    --card: #23133a;
    --progress-h: 4px;
  }

  * { box-sizing: border-box; margin: 0; padding: 0; }

  html { scroll-behavior: smooth; }

  .delinea-security-training {
    background: #191127;
    color: #d8dde8;
    font-size: 15px;
    line-height: 1.7;
    overflow-x: hidden;
    position: relative;
    display: flex;
  }

  /* ─── Progress Bar ─── */
  #progress-bar {
    position: absolute; top: 0; left: 0; height: var(--progress-h);
    background: linear-gradient(90deg, #3a1c63,#d55ff9);
    width: 0%; z-index: 1; transition: width 0.3s ease;
  }

  /* ─── Sidebar Nav ─── */
  #sidebar {
    position: sticky; left: 0; top: 0; width: 230px; height: 100vh;
    background: #180f26;
    border-right: 1px solid var(--border);
    padding: 56px 0 24px;
    z-index: 1; overflow-y: auto;
    display: flex; flex-direction: column;
  }
  .sidebar-logo {
    padding: 0 24px 28px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 16px;
  }
  .sidebar-logo .brand {
    font-size: 11px;  text-transform: uppercase;
    color: var(--amber); font-weight: 600;
  }
  .sidebar-logo .title {
    font-size: 13px; color: #9ba8bc; margin-top: 4px; 
  }

  .nav-section { padding: 0 16px; margin-bottom: 8px; }
  .nav-section-label {
    font-size: 9px; text-transform: uppercase;
    color: var(--muted); padding: 8px 8px 4px;
  }
  .nav-item {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 10px; border-radius: 6px; cursor: pointer;
    transition: all 0.2s; color: #8a96ae; font-size: 13px;
    text-decoration: none; border: none; background: none; width: 100%; text-align: left;
  }
  .nav-item:hover { background: #23133a9f; color: #d8dde8; }
  .nav-item.active { background: #23133a; color: var(--amber); }
  .nav-item .nav-dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--muted); flex-shrink: 0; transition: all 0.2s;
  }
  .nav-item.active .nav-dot, .nav-item.done .nav-dot {
    background: var(--amber);
  }
  .nav-item.done { color: var(--teal); }
  .nav-item.done .nav-dot { background: var(--teal); }

  .sidebar-footer {
    margin-top: auto; padding: 16px 24px;
    border-top: 1px solid var(--border);
  }
  .progress-label { font-size: 11px; color: var(--muted); margin-bottom: 6px; }
  .progress-track {
    height: 4px; background: rgba(255,255,255,0.08); border-radius: 2px; overflow: hidden;
  }
  .progress-fill {
    height: 100%; background: linear-gradient(90deg, var(--amber), var(--teal));
    border-radius: 2px; transition: width 0.4s ease;
  }

  /* ─── Main Content ─── */
  #main {
    /* margin-left: 230px; */
    height: 100vh;
    overflow-y: auto;
    flex: 1;
  }

  .section {
    min-height: 100vh;
    padding: 80px 64px;
    border-bottom: 1px solid var(--border);
    position: relative;
    display: none;
  }
  .section.active-section { display: block; }

  .hero-tag {
    display: inline-block;
    font-size: 11px;  text-transform: uppercase;
    color: var(--amber); border: 1px solid #3a1c63;
    padding: 4px 12px; border-radius: 20px; margin-bottom: 24px;
  }
  .hero-title {
    font-size: clamp(32px, 4vw, 56px);
    font-weight: 800; line-height: 1.1;
    color: #eef0f5; margin-bottom: 16px;
  }
  .hero-title em {
    font-style: italic; color: var(--amber);
  }
  .hero-sub {
    font-size: 16px; color: #8a96ae; max-width: 520px;
    margin-bottom: 40px; line-height: 1.75;
  }

  .hero-modules {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
    max-width: 600px; margin-bottom: 48px;
  }
  .hero-module {
    background: var(--card); border: 1px solid var(--border);
    border-radius: 8px; padding: 14px 16px;
  }
  .hero-module .mod-num {
    
    font-size: 10px; color: var(--amber); margin-bottom: 4px;
  }
  .hero-module .mod-name {
    font-size: 12px; color: #9ba8bc; font-weight: 600;
  }

  .btn-primary {
    display: inline-flex; align-items: center; gap: 10px;
    background: var(--amber); color: var(--ink);
     font-weight: 700; font-size: 14px;
    padding: 14px 28px; border-radius: 8px; border: none;
    cursor: pointer; transition: all 0.2s; text-decoration: none;
  }
  .btn-primary:hover { background: #883cf0e0; transform: translateY(-1px); }

  .btn-ghost {
    display: inline-flex; align-items: center; gap: 8px;
    background: transparent; color: #8a96ae;
     font-weight: 600; font-size: 14px;
    padding: 14px 24px; border-radius: 8px;
    border: 1px solid var(--border); cursor: pointer; transition: all 0.2s;
  }
  .btn-ghost:hover { border-color: rgba(255,255,255,0.2); color: #d8dde8; }

  /* ─── Section Headers ─── */
  .section-eyebrow {
    
    font-size: 10px;  text-transform: uppercase;
    color: var(--amber); margin-bottom: 12px;
    display: flex; align-items: center; gap: 8px;
  }
  .section-eyebrow::after {
    content: ''; flex: 1; height: 1px; background: rgba(232,160,32,0.2); max-width: 60px;
  }
  .section-title {
    font-size: clamp(24px, 3vw, 36px); font-weight: 800;
    color: #eef0f5; margin-bottom: 12px; line-height: 1.2;
  }
  .section-desc {
    font-size: 15px; color: #7a879a; max-width: 600px;
    margin-bottom: 48px; line-height: 1.8;
  }

  /* ─── Role Cards ─── */
  .roles-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-bottom: 40px; }
  .role-card {
    background: var(--card); border-radius: 12px;
    border: 1px solid var(--border); overflow: hidden;
    transition: transform 0.2s, border-color 0.2s;
    cursor: pointer;
  }
  .role-card:hover { transform: translateY(-3px); }
  .role-card.owner:hover { border-color: rgba(232,160,32,0.4); }
  .role-card.admin:hover { border-color: rgba(29,184,158,0.4); }
  .role-card.auditor:hover { border-color: rgba(100,130,220,0.4); }

  .role-header {
    padding: 20px 22px 16px;
    border-bottom: 1px solid var(--border);
  }
  .role-badge {
    display: inline-block; font-size: 10px; font-weight: 700;
     text-transform: uppercase;
    padding: 3px 10px; border-radius: 20px; margin-bottom: 10px;
  }
  .owner .role-badge { background: rgba(232,160,32,0.15); color: var(--amber); }
  .admin .role-badge { background: rgba(29,184,158,0.15); color: var(--teal); }
  .auditor .role-badge { background: rgba(100,130,220,0.15); color: #7b9be0; }

  .role-name { font-size: 18px; font-weight: 700; color: #eef0f5; }
  .role-desc { font-size: 12px; color: var(--muted); margin-top: 4px; line-height: 1.6; }
  .role-body { padding: 18px 22px; }

  .perm-list { list-style: none; }
  .perm-item {
    display: flex; align-items: flex-start; gap: 10px;
    font-size: 12.5px; color: #9ba8bc; padding: 5px 0;
    border-bottom: 1px solid rgba(255,255,255,0.04);
  }
  .perm-item:last-child { border: none; }
  .perm-icon { font-size: 14px; flex-shrink: 0; margin-top: 1px; }

  .role-matrix {
    background: var(--card); border: 1px solid var(--border);
    border-radius: 12px; overflow: hidden; margin-top: 32px;
  }
  .matrix-title {
    padding: 16px 24px; font-size: 12px; font-weight: 700;
     text-transform: uppercase; color: var(--muted);
    border-bottom: 1px solid var(--border);
    
  }
  .matrix-table { width: 100%; border-collapse: collapse; }
  .matrix-table th, .matrix-table td {
    padding: 12px 20px; font-size: 12.5px; text-align: left;
  }
  .matrix-table th {
    font-weight: 600; color: var(--muted); font-size: 11px;
     background: rgba(255,255,255,0.02);
    border-bottom: 1px solid var(--border);
  }
  .matrix-table tr { border-bottom: 1px solid rgba(255,255,255,0.04); }
  .matrix-table tr:last-child { border: none; }
  .matrix-table td { color: #9ba8bc; }
  .matrix-table td:first-child { color: #d8dde8; font-weight: 600; }
  .check { color: var(--teal); }
  .cross { color: rgba(255,255,255,0.2); }
  .partial { color: var(--amber); }

  /* ─── Policy Config ─── */
  .config-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
  .config-card {
    background: var(--card); border: 1px solid var(--border);
    border-radius: 12px; padding: 24px;
  }
  .config-card-title {
    font-size: 13px; font-weight: 700; color: #eef0f5;
    margin-bottom: 20px; display: flex; align-items: center; gap: 8px;
  }
  .config-icon { font-size: 16px; }

  .setting-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,0.04);
  }
  .setting-row:last-child { border: none; padding-bottom: 0; }
  .setting-label { font-size: 12.5px; color: #8a96ae; }
  .setting-value {
    
    font-size: 12px; color: var(--amber-light);
    background: rgba(232,160,32,0.08); padding: 3px 10px; border-radius: 4px;
  }

  .range-control { margin-top: 8px; }
  .range-control label {
    display: flex; justify-content: space-between;
    font-size: 12px; color: #7a879a; margin-bottom: 6px;
  }
  .range-control label span { color: var(--amber);  }
  input[type=range] {
    width: 100%; height: 4px; border-radius: 2px; outline: none;
    background: linear-gradient(90deg, var(--amber) var(--val, 60%), rgba(255,255,255,0.1) var(--val, 60%));
    cursor: pointer;
  }
  input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none; width: 14px; height: 14px;
    background: var(--amber); border-radius: 50%;
  }

  .toggle-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 9px 0; border-bottom: 1px solid rgba(255,255,255,0.04);
  }
  .toggle-row:last-child { border: none; }
  .toggle-label { font-size: 12.5px; color: #8a96ae; }
  .toggle {
    width: 36px; height: 20px; border-radius: 10px;
    background: rgba(255,255,255,0.1); position: relative;
    cursor: pointer; transition: background 0.2s;
  }
  .toggle.on { background: var(--teal); }
  .toggle::after {
    content: ''; position: absolute; top: 3px; left: 3px;
    width: 14px; height: 14px; border-radius: 50%;
    background: white; transition: transform 0.2s;
  }
  .toggle.on::after { transform: translateX(16px); }

  /* ─── Change Approval ─── */
  .workflow-steps {
    position: relative; margin: 40px 0;
  }
  .workflow-steps::before {
    content: ''; position: absolute; left: 19px; top: 20px;
    bottom: 20px; width: 2px;
    background: linear-gradient(180deg, var(--amber), var(--teal));
  }
  .wf-step {
    display: flex; gap: 20px; margin-bottom: 8px; position: relative;
  }
  .wf-num {
    width: 40px; height: 40px; border-radius: 50%;
    background: #23133a; border: 2px solid var(--border);
    display: flex; align-items: center; justify-content: center;
     font-size: 13px;
    font-weight: 700; color: var(--amber); flex-shrink: 0;
    position: relative; z-index: 1; transition: all 0.3s;
  }
  .wf-step.done .wf-num { background: var(--teal); border-color: var(--teal); color: white; }
  .wf-step.active .wf-num { background: var(--amber); border-color: var(--amber); color: var(--ink); }

  .wf-content {
    background: var(--card); border: 1px solid var(--border);
    border-radius: 10px; padding: 16px 20px; flex: 1;
    margin-bottom: 12px; transition: border-color 0.3s;
  }
  .wf-step.active .wf-content { border-color: rgba(232,160,32,0.3); }
  .wf-step.done .wf-content { border-color: #3a1c63; }

  .wf-title { font-size: 14px; font-weight: 700; color: #eef0f5; margin-bottom: 4px; }
  .wf-desc { font-size: 12.5px; color: #7a879a; line-height: 1.7; }
  .wf-owner {
    display: inline-flex; align-items: center; gap: 5px;
    margin-top: 8px; font-size: 11px; 
    color: var(--amber); background: #1f1232;
    padding: 2px 8px; border-radius: 4px;
  }

  /* ─── Audit Framework ─── */
  .framework-tabs {
    display: flex; gap: 8px; margin-bottom: 32px;
    border-bottom: 1px solid var(--border); padding-bottom: 0;
  }
  .ftab {
    padding: 10px 20px; cursor: pointer; font-size: 13px; font-weight: 600;
    color: var(--muted); border-bottom: 2px solid transparent;
    transition: all 0.2s; margin-bottom: -1px; border-top: none;
    border-left: none; border-right: none; background: none;
  }
  .ftab.active { color: var(--amber); border-bottom-color: var(--amber); }
  .ftab:hover:not(.active) { color: #d8dde8; }

  .framework-panel { display: none; }
  .framework-panel.active { display: block; }

  .control-row {
    display: grid; grid-template-columns: 180px 1fr 160px 120px;
    gap: 16px; padding: 14px 0; border-bottom: 1px solid rgba(255,255,255,0.04);
    align-items: start;
  }
  .control-row.header {
    font-size: 10px;  text-transform: uppercase;
    color: var(--muted); font-weight: 700; padding-bottom: 10px;
    
  }
  .control-id {
     font-size: 12px;
    color: var(--amber); font-weight: 600;
  }
  .control-name { font-size: 12.5px; color: #d8dde8; font-weight: 600; }
  .control-desc { font-size: 11.5px; color: #7a879a; margin-top: 3px; }
  .control-delinea { font-size: 12px; color: #9ba8bc; }
  .status-badge {
    display: inline-block; font-size: 10px; font-weight: 700;
    padding: 3px 10px; border-radius: 20px; text-transform: uppercase; 
  }
  .status-covered { background: rgba(29,184,158,0.15); color: #fff; }
  .status-partial { background: rgba(232,160,32,0.15); color: #fff; }

  /* ─── Policy Template ─── */
  .template-builder {
    background: var(--card); border: 1px solid var(--border);
    border-radius: 16px; overflow: hidden;
  }
  .template-toolbar {
    background: #883cf050; padding: 14px 24px;
    display: flex; justify-content: space-between; align-items: center;
    border-bottom: 1px solid var(--border);
  }
  .template-toolbar .doc-title {
     font-size: 13px; color: var(--amber);
  }
  .toolbar-actions { display: flex; gap: 8px; }
  .toolbar-btn {
    background: rgba(255,255,255,0.06); border: 1px solid var(--border);
    color: #9ba8bc;  font-size: 12px;
    padding: 7px 14px; border-radius: 6px; cursor: pointer; transition: all 0.2s;
  }
  .toolbar-btn:hover { background: rgba(255,255,255,0.1); color: #d8dde8; }
  .toolbar-btn.primary { background: var(--amber); color: var(--ink); font-weight: 700; border-color: var(--amber); }
  .toolbar-btn.primary:hover { background: #883cf0e0; }

  .template-body {
    padding: 40px 48px; background: #1f1232;
    
  }
  .tpl-field-group { margin-bottom: 28px; }
  .tpl-h1 {
    font-size: 20px; font-weight: 700; color: #eef0f5;
    border-bottom: 2px solid var(--amber); padding-bottom: 8px; margin-bottom: 20px;
    
  }
  .tpl-h2 {
    font-size: 14px; font-weight: 700; color: var(--amber);
    margin-bottom: 10px; text-transform: uppercase; 
     font-size: 12px;
  }
  .tpl-input {
    width: 100%; background: transparent; border: none;
    border-bottom: 1px dashed rgba(255,255,255,0.12);
    color: #c5cdd9; 
    font-size: 13px; padding: 6px 0; outline: none; transition: border-color 0.2s;
    line-height: 1.8;
  }
  .tpl-input:focus { border-bottom-color: var(--amber); }
  .tpl-input::placeholder { color: rgba(255,255,255,0.2); }
  textarea.tpl-input { resize: vertical; min-height: 60px; }
  .tpl-static { font-size: 12.5px; color: #7a879a; line-height: 2; }
  .tpl-placeholder {
    display: inline; background: rgba(232,160,32,0.12);
    color: var(--amber); padding: 0 4px; border-radius: 3px;
    font-size: 11px;
  }

  /* ─── Knowledge Check ─── */
  .quiz-card {
    background: var(--card); border: 1px solid var(--border);
    border-radius: 12px; padding: 28px; margin-bottom: 16px;
  }
  .quiz-q { font-size: 15px; color: #eef0f5; font-weight: 600; margin-bottom: 20px; line-height: 1.6; }
  .quiz-options { display: grid; gap: 10px; }
  .quiz-opt {
    padding: 12px 18px; border-radius: 8px; cursor: pointer;
    border: 1px solid var(--border); background: rgba(255,255,255,0.02);
    font-size: 13px; color: #9ba8bc; transition: all 0.2s; text-align: left;
  }
  .quiz-opt:hover:not(.selected):not(.correct):not(.wrong) {
    border-color: rgba(255,255,255,0.15); color: #d8dde8; background: rgba(255,255,255,0.04);
  }
  .quiz-opt.selected { border-color: var(--amber); color: var(--amber); background: rgba(232,160,32,0.07); }
  .quiz-opt.correct { border-color: #77b255;
    background: #77b25520;
    color: #60c090; }
  .quiz-opt.wrong { border-color: #dc143c;
    background: #dc143c2b;
    color:#ff7a90; }
  .quiz-feedback {
    margin-top: 16px; padding: 12px 16px; border-radius: 8px; font-size: 13px;
    display: none; line-height: 1.7;
  }
  .quiz-feedback.show { display: block; }
  .quiz-feedback.correct-fb { background: #77b25520;
    border-left: 3px solid #77b255;
    color: #60c090; }
  .quiz-feedback.wrong-fb { background: #dc143c2b;
    border-left: 3px solid #dc143c;
    color: #ff7a90; }

  /* ─── Nav Buttons ─── */
  .section-nav {
    display: flex; justify-content: space-between; align-items: center;
    margin-top: 60px; padding-top: 32px; border-top: 1px solid var(--border);
  }

  /* ─── Callout ─── */
  .callout {
    border-radius: 10px; padding: 16px 20px; margin: 20px 0;
    display: flex; gap: 14px; align-items: flex-start;
  }
  .callout-warn { background: rgba(232,160,32,0.07); border-left: 3px solid var(--amber); }
  .callout-info { background: #1f1232; border-left: 3px solid var(--teal); }
  .callout-icon { font-size: 18px; flex-shrink: 0; }
  .callout-text { font-size: 13px; color: #9ba8bc; line-height: 1.7; }
  .callout-text strong { color: #d8dde8; }

  /* ─── Responsive ─── */
  @media (max-width: 900px) {
    #sidebar { display: none; }
    #main { margin-left: 0; }
    .section { padding: 40px 24px; }
    .roles-grid, .config-grid { grid-template-columns: 1fr; }
    .control-row { grid-template-columns: 1fr 1fr; }
    .hero-modules { grid-template-columns: 1fr; }
  }

  /* ─── Animations ─── */
  @keyframes fadeUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
  }
  .section.active-section > * { animation: fadeUp 0.4s ease both; }
  .section.active-section > *:nth-child(2) { animation-delay: 0.05s; }
  .section.active-section > *:nth-child(3) { animation-delay: 0.1s; }
  .section.active-section > *:nth-child(4) { animation-delay: 0.15s; }

  .completed-badge {
    display: inline-flex; align-items: center; gap: 6px;
    background: rgba(29,184,158,0.1); color: var(--teal);
    border: 1px solid rgba(29,184,158,0.2); padding: 4px 12px;
    border-radius: 20px; font-size: 11px; font-weight: 700;
     text-transform: uppercase;
  }

  .info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 24px 0; }
  .info-cell {
    background: var(--card); border: 1px solid var(--border);
    border-radius: 10px; padding: 18px 20px;
  }
  .info-cell-label { font-size: 10px; text-transform: uppercase;  color: var(--muted); margin-bottom: 6px;  }
  .info-cell-value { font-size: 22px; font-weight: 800; color: #eef0f5; }
  .info-cell-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #873cf015; border-radius: 3px; }