:root {
  --navy: #291a3e;
  --amber: #883CF0;
  --amber2: #873cf0b2;
  --amber-dim: #873cf079;
  --teal: #883CF0;
  --teal-dim: #873cf079;
  --rose: #883CF0;
  --rose-dim: #873cf079;
  --green: #883CF0;
  --green-dim: #873cf079;
  --violet: #883CF0;
  --violet-dim: #873cf079;
  --sky: #883CF0;
  --sky-dim: #873cf079;
  --paper: #23133a;
  --paper2: #1f1232;
  --paper3: #2a1647;
  --ink: #f8f8f8;
  --ink2: #fcfbf6;
  --ink3: #d6d4d1;
  --ink4: #f6f4ef;
  --sidebar-w: 300px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

.service-account-reference {
  background: #191127;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.6;
  display: flex;
  min-height: 100vh;
  position: relative;
}

/* ─── SIDEBAR ─────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: #180f26;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0; left: 0; bottom: 0;
  overflow-y: auto;
  z-index: 1;
  scrollbar-width: thin;
  scrollbar-color: transparent;
}

.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: #873cf015; border-radius: 2px; }

.sidebar-brand {
  padding: 28px 24px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.brand-tag {
  font-size: 9px;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.brand-tag::before {
  content: '';
  width: 18px; height: 1px;
  background: var(--amber);
}

.brand-name {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
}

.brand-sub {
  font-size: 11px;
  color: rgba(255,255,255,0.35);
  margin-top: 4px;
}

/* SEARCH */
.sidebar-search {
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.search-wrap {
  position: relative;
}

.search-input {
  width: 100%;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.8);
  font-size: 12px;
  padding: 8px 12px 8px 32px;
  border-radius: 6px;
  outline: none;
  transition: all 0.2s;
}

.search-input::placeholder { color: rgba(255,255,255,0.25); }
.search-input:focus { border-color: var(--amber); background: rgba(255,255,255,0.07); }

.search-icon {
  position: absolute;
  left: 10px; top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  color: rgba(255, 255, 255, 0.838);
  pointer-events: none;
}

/* NAV ITEMS */
.nav-section-label {
  padding: 16px 20px 8px;
  font-size: 9px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.696);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 20px;
  cursor: pointer;
  transition: all 0.15s;
  border-left: 2px solid transparent;
  position: relative;
}

.nav-item:hover { background: #23133a9f; }

.nav-item.active {
  background: #23133a;
  border-left-color: var(--amber);
}

.nav-icon {
  width: 28px; height: 28px;
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
  background: rgba(255,255,255,0.05);
  transition: all 0.15s;
}

.nav-item.active .nav-icon { background: var(--amber-dim); }

.nav-label {
  font-size: 12px;
  font-weight: 500;
  color: rgba(255,255,255,0.55);
  flex: 1;
  line-height: 1.3;
  transition: color 0.15s;
}

.nav-item.active .nav-label { color: rgba(255,255,255,0.9); }
.nav-item:hover .nav-label { color: rgba(255,255,255,0.75); }

.nav-badge {
  font-size: 9px;
  padding: 1px 5px;
  border-radius: 3px;
  font-weight: 500;
}

.nav-item.hidden-item { display: none; }

/* SIDEBAR FOOTER */
.sidebar-footer {
  margin-top: auto;
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,0.06);
}

.progress-wrap { margin-bottom: 10px; }

.prog-label {
  display: flex; justify-content: space-between;
  font-size: 10px;
  color: rgba(255,255,255,0.3); margin-bottom: 6px;
}

.prog-label span { color: var(--amber); }

.prog-bar-bg {
  height: 3px; background: rgba(255,255,255,0.08);
  border-radius: 2px; overflow: hidden;
}

.prog-bar {
  height: 100%; background: linear-gradient(90deg, var(--amber), var(--teal));
  border-radius: 2px; width: 0%;
  transition: width 0.4s ease;
}

/* ─── MAIN CONTENT ─────────────────────────── */
.main {
  /* margin-left: var(--sidebar-w); */
  flex: 1;
  height: 100vh;
  overflow-y: auto;
}

/* TOP BAR */
.topbar {
  background: var(--paper);
  border-bottom: 1px solid var(--paper3);
  padding: 0 48px;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 1;
}

.topbar-breadcrumb {
  display: flex; align-items: center; gap: 8px;
  font-size: 11px; color: var(--ink4);
}

.topbar-breadcrumb .current { color: var(--ink2); font-weight: 500; }

.topbar-right {
  display: flex; align-items: center; gap: 16px;
}

.filter-chips {
  display: flex; gap: 6px;
}

.chip {
  font-size: 10px;
  padding: 4px 10px;
  border-radius: 20px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s;
  font-weight: 500;
}

.chip.all { background: var(--navy); color: #fff; }
.chip:not(.all) { background: var(--paper2); color: var(--ink3); border-color: var(--paper3); }
.chip:hover { border-color: var(--amber); color: var(--ink); }
.chip.active { background: var(--navy); color: #fff; border-color: var(--navy); }

/* ─── CONTENT AREA ─────────────────────────── */
.content {
  padding: 48px 48px 80px;
}

/* HERO */
.hero {
  margin-bottom: 52px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 32px;
  align-items: end;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--paper3);
}

.hero-eyebrow {
  font-size: 11px;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 12px;
  display: flex; align-items: center; gap: 8px;
}

.hero-eyebrow::before {
  content: ''; width: 24px; height: 2px; background: var(--amber);
}

.hero h1 {
  font-size: clamp(32px, 4vw, 48px);
  font-weight: 900;
  color: var(--ink);
  line-height: 1.1;
  margin-bottom: 16px;
}

.hero h1 em {
  color: #fff;
  font-style: normal;
  display: block;
}

.hero-desc {
  font-size: 15px;
  color: var(--ink3);
  max-width: 560px;
  line-height: 1.75;
}

.hero-stats {
  display: flex; flex-direction: column; gap: 12px; align-items: flex-end;
}

.stat-pill {
  background: var(--navy);
  color: rgba(255,255,255,0.7);
  padding: 10px 18px;
  border-radius: 8px;
  text-align: right;
  min-width: 140px;
}

.stat-num {
  font-size: 28px;
  font-weight: 700;
  color: var(--amber);
  line-height: 1;
  margin-bottom: 2px;
}

.stat-lbl {
  font-size: 9px;
  text-transform: uppercase;
  opacity: 0.5;
}

/* ─── SECTION TITLE ─────────────────────────── */
.section-title {
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 24px;
}

.section-title h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--ink);
}

.section-title-line {
  flex: 1; height: 1px; background: var(--paper3);
}

.section-count {
  font-size: 10px;
  color: var(--ink4);
}

/* ─── ACCOUNT CARDS ─────────────────────────── */
.accounts-grid {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 48px;
}

.account-card {
  background: #23133a;
  border: 1px solid var(--paper3);
  border-radius: 10px;
  overflow: hidden;
  transition: box-shadow 0.2s, border-color 0.2s;
  cursor: pointer;
}

.account-card:hover { border-color: var(--paper3); box-shadow: 0 4px 20px rgba(0,0,0,0.08); }
.account-card.expanded { border-color: var(--ac-color, var(--amber)); box-shadow: 0 6px 30px rgba(0,0,0,0.1); }

.card-row {
  display: grid;
  grid-template-columns: 52px 1fr auto auto auto;
  align-items: center;
  gap: 0;
  padding: 0;
  min-height: 72px;
}

.card-accent-bar {
  width: 52px;
  align-self: stretch;
  background: var(--ac-color, var(--amber));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.card-main {
  padding: 14px 20px;
  min-width: 0;
}

.card-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 2px;
  line-height: 1.2;
}

.card-subtitle {
  font-size: 10px;
  color: var(--ink4);
  text-transform: uppercase;
}

.card-meta {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 100px;
  border-left: 1px solid var(--paper2);
}

.meta-label {
  font-size: 9px;
  text-transform: uppercase;
  color: var(--ink4);
}

.priv-badge {
  font-size: 10px;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: 4px;
  white-space: nowrap;
}

.priv-critical { background: rgba(244,63,94,0.1); color: #c41a3a; border: 1px solid rgba(244,63,94,0.2); }
.priv-high { background: rgba(245,158,11,0.12); color: #92470c; border: 1px solid rgba(245,158,11,0.25); }
.priv-medium { background: rgba(14,165,160,0.1); color: #065f5b; border: 1px solid rgba(14,165,160,0.2); }
.priv-low { background: rgba(16,185,129,0.1); color: #065f46; border: 1px solid rgba(16,185,129,0.2); }

.rot-badge {
  font-size: 10px;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: 4px;
  white-space: nowrap;
}

.rot-complex { background: rgba(244,63,94,0.08); color: #b91c4d; border: 1px solid rgba(244,63,94,0.15); }
.rot-moderate { background: rgba(245,158,11,0.1); color: #854d0e; border: 1px solid rgba(245,158,11,0.2); }
.rot-simple { background: rgba(16,185,129,0.08); color: #065f46; border: 1px solid rgba(16,185,129,0.15); }
.rot-auto { background: rgba(139,92,246,0.1); color: #5b21b6; border: 1px solid rgba(139,92,246,0.2); }
.rot-na { background: var(--paper2); color: var(--ink4); border: 1px solid var(--paper3); }

.card-chevron {
  padding: 14px 20px;
  display: flex; align-items: center;
  border-left: 1px solid var(--paper2);
  color: var(--ink4);
  font-size: 11px;
  transition: transform 0.25s;
  width: 52px;
  justify-content: center;
}

.account-card.expanded .card-chevron { transform: rotate(180deg); color: var(--ac-color, var(--amber)); }

/* ─── EXPANDED DETAIL ─────────────────────────── */
.card-detail {
  display: none;
  border-top: 1px solid var(--paper2);
  background: var(--paper);
}

.account-card.expanded .card-detail { display: block; animation: slideDown 0.25s ease; }

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.detail-tabs {
  display: flex;
  border-bottom: 1px solid var(--paper3);
  background: #1f123255;
  padding: 0 24px;
}

.detail-tab {
  font-size: 11px;
  text-transform: uppercase;
  font-weight: 500;
  padding: 12px 16px;
  cursor: pointer;
  color: var(--ink4);
  border-bottom: 2px solid transparent;
  transition: all 0.15s;
  margin-bottom: -1px;
}

.detail-tab:hover { color: var(--ink2); }
.detail-tab.active { color: var(--ink); border-bottom-color: var(--ac-color, var(--amber)); }

.tab-panel { display: none; padding: 24px; }
.tab-panel.active { display: block; animation: fadeIn 0.2s ease; }

@keyframes fadeIn {
  from { opacity: 0; } to { opacity: 1; }
}

/* DETAIL GRID */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

.detail-block {
  background: #2a1647;
  border: 1px solid var(--paper3);
  border-radius: 8px;
  padding: 18px;
}

.detail-block.full { grid-column: 1 / -1; }

.dblock-title {
  font-size: 10px;
  text-transform: uppercase;
  color: var(--ink4);
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--paper2);
  display: flex; align-items: center; gap: 6px;
}

.dblock-body {
  font-size: 13px;
  color: var(--ink2);
  line-height: 1.75;
}

/* SPEC TABLE */
.spec-table { width: 100%; border-collapse: collapse; }
.spec-table tr { border-bottom: 1px solid var(--paper2); }
.spec-table tr:last-child { border-bottom: none; }
.spec-table td { padding: 7px 0; font-size: 12px; vertical-align: top; }
.spec-table td:first-child {
  font-size: 10px;
  color: var(--ink4);
  width: 40%;
  padding-right: 12px;
  text-transform: uppercase;
  padding-top: 9px;
}

/* DELINEA SECTION */
.delinea-block {
  background: var(--navy);
  border-radius: 8px;
  padding: 20px 22px;
  margin-top: 4px;
}

.delinea-header {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 14px;
}

.delinea-logo-mark {
  width: 28px; height: 28px;
  background: var(--amber);
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

.delinea-title {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
}

.delinea-title span {
  font-size: 10px;
  color: var(--amber);
  font-weight: 400;
  text-transform: uppercase;
  margin-left: 8px;
}

.delinea-body {
  font-size: 13px;
  color: rgba(255,255,255,0.65);
  line-height: 1.75;
  margin-bottom: 14px;
}

.delinea-features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.d-feature {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid #3a1c63;
  border-radius: 6px;
  padding: 12px;
}

.d-feature-icon { font-size: 16px; margin-bottom: 6px; }

.d-feature-name {
  font-size: 10px;
  color: var(--amber);
  font-weight: 500;
  margin-bottom: 4px;
}

.d-feature-desc {
  font-size: 11px;
  color: rgba(240, 238, 238, 0.45);
  line-height: 1.5;
}

/* CODE SNIPPET */
.code-block {
  background: var(--navy);
  border-radius: 6px;
  padding: 14px 16px;
  font-size: 11px;
  color: rgba(255,255,255,0.7);
  line-height: 1.8;
  overflow-x: auto;
  margin-top: 10px;
  border-left: 3px solid var(--amber);
}

.code-block .cm { color: rgba(255,255,255,0.3); }
.code-block .ck { color: var(--amber2); }
.code-block .cv { color: var(--teal); }
.code-block .cs { color: #d1dee0; }

/* RISK INDICATORS */
.risk-row {
  display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px;
}

.risk-tag {
  font-size: 10px;
  padding: 3px 8px;
  border-radius: 4px;
  display: flex; align-items: center; gap: 4px;
  font-weight: 500;
}

.risk-warn { background: rgba(245,158,11,0.1); color: #92400e; border: 1px solid rgba(245,158,11,0.2); }
.risk-danger { background: rgba(244,63,94,0.1); color: #9f1239; border: 1px solid rgba(244,63,94,0.2); }
.risk-ok { background: rgba(16,185,129,0.1); color: #065f46; border: 1px solid rgba(16,185,129,0.2); }
.risk-info { background: #23133a; color: #dfe8ed; border: 1px solid #3a1c63; }

/* ─── DELINEA OVERVIEW SECTION ─────────────────────────── */
.overview-strip {
  background: var(--navy);
  border-radius: 12px;
  padding: 36px 40px;
  margin-bottom: 48px;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 32px;
  position: relative;
  overflow: hidden;
}

.overview-strip::before {
  content: '';
  position: absolute;
  top: -60px; right: -60px;
  width: 220px; height: 220px;
  background: radial-gradient(circle, rgba(245, 11, 245, 0.12) 0%, transparent 70%);
  pointer-events: none;
}

.overview-col-title {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 10px;
  display: flex; align-items: center; gap: 8px;
}

.overview-col-title span { font-size: 18px; }

.overview-col-body {
  font-size: 12px;
  color: rgba(255,255,255,0.5);
  line-height: 1.7;
}

.overview-col-body strong { color: rgba(255,255,255,0.8); }

/* ─── LEGEND ─────────────────────────── */
.legend-strip {
  background: #23133a;
  border: 1px solid var(--paper3);
  border-radius: 8px;
  padding: 16px 20px;
  margin-bottom: 28px;
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.legend-label {
  font-size: 10px;
  color: var(--ink4);
  text-transform: uppercase;
  white-space: nowrap;
}

.legend-items {
  display: flex; gap: 8px; flex-wrap: wrap; flex: 1;
}

.legend-item {
  display: flex; align-items: center; gap: 5px;
  font-size: 10px; color: var(--ink3);
}

.legend-dot {
  width: 10px; height: 10px; border-radius: 2px;
}

/* ─── NO RESULTS ─────────────────────────── */
.no-results {
  display: none;
  text-align: center;
  padding: 48px 24px;
  background: #23133a;
  border: 1px dashed var(--paper3);
  border-radius: 10px;
}

.no-results-icon { font-size: 36px; margin-bottom: 12px; }
.no-results-text { font-size: 12px; color: var(--ink4); }

/* ─── TOOLTIP ─────────────────────────── */
.tooltip-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--paper2);
  border: 1px solid var(--paper3);
  font-size: 9px;
  color: var(--ink4);
  cursor: help;
  position: relative;
  flex-shrink: 0;
}

/* ─── RESPONSIVE ─────────────────────────── */
@media (max-width: 1100px) {
  :root { --sidebar-w: 260px; }
  .content { padding: 36px 32px 60px; }
  .delinea-features { grid-template-columns: 1fr 1fr; }
  .overview-strip { grid-template-columns: 1fr; }
}

@media (max-width: 800px) {
  .sidebar { display: none; }
  .main { margin-left: 0; }
  .content { padding: 24px 20px 60px; }
  .detail-grid { grid-template-columns: 1fr; }
  .card-row { grid-template-columns: 44px 1fr auto; }
  .card-meta:nth-child(4) { display: none; }
  .delinea-features { grid-template-columns: 1fr; }
  .hero { grid-template-columns: 1fr; }
  .hero-stats { flex-direction: row; align-items: center; }
}


  ::-webkit-scrollbar { width: 6px; height: 6px; }
  ::-webkit-scrollbar-track { background: #873cf015; }
  ::-webkit-scrollbar-thumb { background: #873cf015; border-radius: 3px; }