* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #f8f9fb;
  --bg-card: #ffffff;
  --bg-sidebar: #f0f1f5;
  --bg-hover: #e8eaef;
  --border: #d8dbe3;
  --text: #1a1d2b;
  --text-dim: #5c6078;
  --text-muted: #8b8fa3;
  --accent: #4f46e5;
  --accent-dim: #6366f1;
  --critical: #dc2626;
  --critical-bg: rgba(220,38,38,.08);
  --high: #ea580c;
  --high-bg: rgba(234,88,12,.08);
  --medium: #ca8a04;
  --medium-bg: rgba(202,138,4,.08);
  --low: #2563eb;
  --low-bg: rgba(37,99,235,.08);
  --positive: #16a34a;
  --positive-bg: rgba(22,163,74,.08);
  --radius: 8px;
  --radius-lg: 12px;
  --top-bar-height: 56px;
}

html, body { height: 100%; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: var(--bg); color: var(--text); }

.screen { display: none; height: 100%; flex-direction: column; }
.screen.active { display: flex; }

/* ============================================
   TOP BAR
   ============================================ */
.top-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; border-bottom: 1px solid var(--border);
  background: #fff; flex-shrink: 0; height: var(--top-bar-height);
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
}
.top-bar-left { display: flex; align-items: center; gap: 32px; }
.top-bar-right { display: flex; align-items: center; gap: 16px; }
.top-bar-logo { display: flex; align-items: center; text-decoration: none; }
.logo-img { height: 24px; width: auto; }

/* Top bar horizontal nav */
.top-bar-nav { display: flex; gap: 0; height: var(--top-bar-height); }
.top-nav-btn {
  padding: 0 16px; background: none; border: none; border-bottom: 2px solid transparent;
  color: var(--text-dim); font-size: 13px; font-weight: 600; cursor: pointer;
  transition: all .15s; text-transform: uppercase; letter-spacing: .3px;
  height: 100%; display: flex; align-items: center;
}
.top-nav-btn:hover { color: var(--text); background: var(--bg-hover); }
.top-nav-btn.active { color: var(--accent); border-bottom-color: var(--accent); }

/* Top bar icon button */
.top-bar-icon-btn {
  width: 36px; height: 36px; border-radius: var(--radius); border: 1px solid var(--border);
  background: none; cursor: pointer; color: var(--text-dim); display: flex;
  align-items: center; justify-content: center; transition: all .15s;
}
.top-bar-icon-btn:hover { background: var(--bg-hover); color: var(--text); }

/* User info */
.user-info { display: flex; align-items: center; gap: 10px; }
.user-avatar {
  width: 32px; height: 32px; border-radius: 50%; background: var(--accent);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700;
}
.logout-btn {
  background: none; border: 1px solid var(--border); color: var(--text-dim);
  padding: 6px 12px; border-radius: var(--radius); cursor: pointer;
  font-size: 12px; font-weight: 500; transition: all .15s;
}
.logout-btn:hover { background: var(--bg-hover); color: var(--text); }

/* Body offset when top bar visible */
body.has-top-bar { padding-top: var(--top-bar-height); }

/* ============================================
   AUTH SCREEN (Login / Register)
   ============================================ */
.auth-main {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; padding: 24px;
}
.auth-card {
  width: 100%; max-width: 420px; text-align: center;
}
.auth-logo { margin-bottom: 24px; }
.logo-img-hero { height: 36px; width: auto; }
.auth-title { font-size: 28px; font-weight: 700; margin-bottom: 4px; }
.auth-title em { font-style: italic; }
.auth-subtitle { color: var(--text-dim); margin-bottom: 32px; font-size: 15px; }

.auth-form { text-align: left; }
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block; font-size: 13px; font-weight: 600; color: var(--text-dim);
  margin-bottom: 6px;
}
.form-group input {
  width: 100%; padding: 10px 14px; background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--text); font-size: 14px; outline: none;
  transition: border-color .15s;
}
.form-group input:focus { border-color: var(--accent); }
.form-group input::placeholder { color: var(--text-muted); }

.form-error {
  color: var(--critical); font-size: 13px; min-height: 20px; margin-bottom: 8px;
}

.auth-switch {
  text-align: center; margin-top: 20px; font-size: 13px; color: var(--text-dim);
}
.auth-switch a { color: var(--accent); text-decoration: none; font-weight: 600; }
.auth-switch a:hover { text-decoration: underline; }

/* ============================================
   BUTTONS
   ============================================ */
.btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 10px 20px;
  border-radius: var(--radius); font-size: 14px; font-weight: 600;
  cursor: pointer; border: none; transition: all .15s;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dim); }
.btn-full { width: 100%; justify-content: center; }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-outline {
  background: none; border: 1px solid var(--border); color: var(--text-dim);
}
.btn-outline:hover { background: var(--bg-hover); color: var(--text); }
.btn-danger { background: var(--critical-bg); color: var(--critical); border: 1px solid transparent; }
.btn-danger:hover { background: var(--critical); color: #fff; }
.btn-ghost {
  background: none; border: none; color: var(--text-dim); padding: 4px 8px;
}
.btn-ghost:hover { color: var(--text); background: var(--bg-hover); }

.back-btn {
  display: flex; align-items: center; gap: 4px;
  background: none; border: 1px solid var(--border); color: var(--text-dim);
  padding: 6px 12px; border-radius: var(--radius); cursor: pointer; font-size: 13px;
  transition: all .15s;
}
.back-btn:hover { background: var(--bg-hover); color: var(--text); }

/* ============================================
   ACCOUNT PICKER
   ============================================ */
.picker-main {
  padding: 48px 24px; max-width: 960px; margin: 0 auto; width: 100%;
  overflow-y: auto; flex: 1;
}
.picker-header { margin-bottom: 32px; }
.picker-header h1 { font-size: 24px; font-weight: 700; margin-bottom: 4px; }

.picker-cards { display: flex; flex-direction: column; gap: 10px; }

.picker-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 20px 24px; cursor: pointer; transition: all .15s;
  display: flex; justify-content: space-between; align-items: center;
}
.picker-card:hover { border-color: var(--accent); background: var(--bg-hover); }
.picker-card-info { flex: 1; }
.picker-card-name { font-weight: 600; font-size: 16px; margin-bottom: 2px; }
.picker-card-id { color: var(--text-muted); font-size: 13px; font-family: monospace; }
.picker-card-meta { color: var(--text-dim); font-size: 13px; margin-top: 4px; }
.picker-card-action { color: var(--accent); font-size: 13px; font-weight: 600; }
.picker-card-action svg { vertical-align: middle; }

.children-section {}
.children-header { display: flex; align-items: center; gap: 16px; margin-bottom: 24px; }
.children-header h2 { font-size: 18px; font-weight: 600; }

.child-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 16px 20px; transition: all .15s;
  display: flex; justify-content: space-between; align-items: center;
}
.child-card:hover { border-color: var(--accent); }
.child-card-info { flex: 1; }
.child-card-name { font-weight: 600; font-size: 15px; margin-bottom: 2px; }
.child-card-id { color: var(--text-muted); font-size: 12px; font-family: monospace; }
.child-card-actions { display: flex; gap: 8px; }

/* ============================================
   AUDIT LIST
   ============================================ */
.list-main { padding: 48px 24px; max-width: 960px; margin: 0 auto; width: 100%; overflow-y: auto; flex: 1; }
.list-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 32px; }
.list-header h1 { font-size: 24px; font-weight: 700; }

.audit-cards-list { display: flex; flex-direction: column; gap: 12px; }

.audit-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 20px 24px; cursor: pointer; transition: all .15s;
  display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: start;
}
.audit-card:hover { border-color: var(--accent); background: var(--bg-hover); }
.card-name { font-weight: 600; font-size: 17px; margin-bottom: 2px; }
.card-id { color: var(--text-muted); font-size: 13px; font-family: monospace; }
.card-date { color: var(--text-dim); font-size: 13px; margin-top: 4px; }
.card-findings { margin-top: 10px; }
.card-findings-total { font-size: 13px; font-weight: 600; color: var(--text-dim); margin-bottom: 6px; display: block; }
.card-findings-pills { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.pill { font-size: 11px; font-weight: 600; padding: 3px 10px; border-radius: 20px; }
.pill-critical { background: var(--critical-bg); color: var(--critical); }
.pill-high { background: var(--high-bg); color: var(--high); }
.pill-medium { background: var(--medium-bg); color: var(--medium); }
.pill-low { background: var(--low-bg); color: var(--low); }
.pill-positive { background: var(--positive-bg); color: var(--positive); }

.card-right { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.health-badge {
  display: inline-block; padding: 4px 12px; border-radius: 20px;
  font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px;
}
.health-needs-attention { background: var(--high-bg); color: var(--high); }
.health-good { background: var(--positive-bg); color: var(--positive); }
.health-critical { background: var(--critical-bg); color: var(--critical); }

/* Status badges */
.status-badge {
  display: inline-block; padding: 4px 12px; border-radius: 20px;
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px;
}
.status-pending { background: var(--bg-sidebar); color: var(--text-muted); }
.status-running { background: rgba(79,70,229,.1); color: var(--accent); }
.status-complete { background: var(--positive-bg); color: var(--positive); }
.status-failed { background: var(--critical-bg); color: var(--critical); }

/* ============================================
   AUDIT PROGRESS
   ============================================ */
.progress-main {
  display: flex; align-items: center; justify-content: center;
  min-height: 100%; padding: 24px;
}
.progress-container { width: 100%; max-width: 640px; text-align: center; }
.progress-header { margin-bottom: 48px; }
.progress-header h1 { font-size: 24px; font-weight: 700; margin-bottom: 4px; }

/* Pulse animation */
.progress-animation {
  position: relative; width: 120px; height: 120px; margin: 0 auto 40px;
}
.pulse-ring {
  position: absolute; inset: 0; border: 2px solid var(--accent);
  border-radius: 50%; animation: pulse-ring 2s ease-out infinite;
  opacity: 0;
}
.pulse-ring.delay-1 { animation-delay: .5s; }
.pulse-ring.delay-2 { animation-delay: 1s; }
.pulse-dot {
  position: absolute; top: 50%; left: 50%; width: 16px; height: 16px;
  margin: -8px 0 0 -8px; background: var(--accent); border-radius: 50%;
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-ring {
  0% { transform: scale(.5); opacity: 0; }
  30% { opacity: .4; }
  100% { transform: scale(1.3); opacity: 0; }
}
@keyframes pulse-dot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.2); opacity: .7; }
}

.progress-bar-container { display: flex; align-items: center; gap: 12px; margin-bottom: 32px; }
.progress-bar {
  flex: 1; height: 6px; background: var(--bg-sidebar); border-radius: 3px; overflow: hidden;
}
.progress-bar-fill {
  height: 100%; background: var(--accent); border-radius: 3px;
  transition: width .3s ease;
}
.progress-percent { font-size: 14px; font-weight: 700; color: var(--accent); font-family: monospace; min-width: 40px; }

.progress-log {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 16px; text-align: left; max-height: 300px; overflow-y: auto;
  font-family: 'SF Mono', Menlo, Monaco, monospace; font-size: 12px;
  line-height: 1.8; color: var(--text-dim);
}
.progress-log-entry { padding: 2px 0; border-bottom: 1px solid rgba(0,0,0,.03); }
.progress-log-entry:last-child { border-bottom: none; }
.progress-log-time { color: var(--text-muted); margin-right: 8px; }

/* ============================================
   DETAIL LAYOUT
   ============================================ */
.detail-layout { display: flex; flex: 1; overflow: hidden; height: 100%; }

/* Sidebar */
.sidebar {
  width: 320px; min-width: 320px; border-right: 1px solid var(--border);
  background: var(--bg-sidebar); display: flex; flex-direction: column; overflow: hidden;
}
.sidebar-inner { display: flex; flex-direction: column; height: 100%; overflow: hidden; }

.sidebar-account-info {
  padding: 16px 16px 12px; border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.sidebar-account-name { font-weight: 600; font-size: 15px; display: block; margin-bottom: 2px; }
.sidebar-account-id { color: var(--text-muted); font-size: 12px; font-family: monospace; }

/* Findings sidebar */
.findings-sidebar, .domains-sidebar { flex: 1; overflow-y: auto; display: flex; flex-direction: column; }

.sidebar-search { padding: 12px; flex-shrink: 0; }
.sidebar-search input {
  width: 100%; padding: 8px 12px; background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--text); font-size: 13px; outline: none;
}
.sidebar-search input:focus { border-color: var(--accent); }
.sidebar-search input::placeholder { color: var(--text-muted); }

.sidebar-filters { display: flex; gap: 4px; padding: 0 12px 8px; flex-wrap: wrap; flex-shrink: 0; }
.filter-btn {
  padding: 4px 10px; border-radius: 20px; border: 1px solid var(--border);
  background: none; color: var(--text-dim); font-size: 11px; cursor: pointer;
  font-weight: 500; transition: all .15s;
}
.filter-btn:hover { background: var(--bg-hover); }
.filter-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.filter-btn.sev-critical.active { background: var(--critical); border-color: var(--critical); }
.filter-btn.sev-high.active { background: var(--high); border-color: var(--high); }
.filter-btn.sev-medium.active { background: var(--medium); border-color: var(--medium); color: #000; }
.filter-btn.sev-low.active { background: var(--low); border-color: var(--low); }
.filter-btn.sev-positive.active { background: var(--positive); border-color: var(--positive); color: #000; }

#findings-list-sidebar, #domains-list-sidebar { flex: 1; overflow-y: auto; padding: 0 8px 12px; }

.finding-item {
  padding: 10px 12px; border-radius: var(--radius); cursor: pointer;
  margin-bottom: 2px; transition: all .1s; border: 1px solid transparent;
}
.finding-item:hover { background: var(--bg-hover); }
.finding-item.active { background: var(--bg-hover); border-color: var(--accent); }
.finding-item-code { font-size: 11px; font-weight: 700; font-family: monospace; margin-bottom: 2px; }
.finding-item-title { font-size: 13px; line-height: 1.4; color: var(--text); margin-bottom: 6px; }
.finding-item-tags { display: flex; gap: 4px; flex-wrap: wrap; }
.tag {
  display: inline-block; padding: 2px 8px; border-radius: 4px;
  font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .3px;
}
.tag-severity-critical { background: var(--critical-bg); color: var(--critical); }
.tag-severity-high { background: var(--high-bg); color: var(--high); }
.tag-severity-medium { background: var(--medium-bg); color: var(--medium); }
.tag-severity-low { background: var(--low-bg); color: var(--low); }
.tag-severity-positive { background: var(--positive-bg); color: var(--positive); }
.tag-domain { background: rgba(79,70,229,.1); color: #4338ca; }

/* Finding ignored style */
.finding-item.ignored { opacity: .5; }
.finding-item.ignored .finding-item-title { text-decoration: line-through; }

/* Domain items */
.domain-item {
  padding: 12px; border-radius: var(--radius); cursor: pointer;
  margin-bottom: 2px; transition: all .1s; border: 1px solid transparent;
}
.domain-item:hover { background: var(--bg-hover); }
.domain-item.active { background: var(--bg-hover); border-color: var(--accent); }
.domain-item-name { font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.domain-item-health { font-size: 11px; font-weight: 600; text-transform: uppercase; }
.domain-health-strong { color: var(--positive); }
.domain-health-adequate { color: var(--low); }
.domain-health-weak { color: var(--high); }
.domain-health-mediocre { color: var(--medium); }
.domain-health-red { color: var(--critical); }

/* Content area */
.content-area { flex: 1; overflow-y: auto; }
.content-inner { padding: 32px 40px; max-width: 900px; }

/* ============================================
   RENDERED MARKDOWN
   ============================================ */
.md-content h1 { font-size: 24px; font-weight: 700; margin: 0 0 16px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.md-content h2 { font-size: 20px; font-weight: 700; margin: 32px 0 12px; color: var(--text); }
.md-content h3 { font-size: 16px; font-weight: 600; margin: 24px 0 8px; color: var(--text); }
.md-content h4 { font-size: 14px; font-weight: 600; margin: 16px 0 6px; color: var(--text-dim); }
.md-content p { font-size: 14px; line-height: 1.7; color: var(--text); margin: 0 0 12px; }
.md-content strong { color: var(--text); }
.md-content ul, .md-content ol { padding-left: 24px; margin: 0 0 12px; }
.md-content li { font-size: 14px; line-height: 1.7; margin-bottom: 4px; }
.md-content code { background: rgba(79,70,229,.08); color: #4338ca; padding: 2px 6px; border-radius: 4px; font-size: 13px; }
.md-content pre { background: var(--bg-card); border: 1px solid var(--border); padding: 16px; border-radius: var(--radius); overflow-x: auto; margin: 0 0 16px; }
.md-content pre code { background: none; padding: 0; }
.md-content blockquote { border-left: 3px solid var(--accent); padding: 8px 16px; margin: 0 0 12px; background: rgba(99,102,241,.05); border-radius: 0 var(--radius) var(--radius) 0; }
.md-content hr { border: none; border-top: 1px solid var(--border); margin: 24px 0; }
.md-content a { color: var(--accent); text-decoration: none; }
.md-content a:hover { text-decoration: underline; }

/* Tables */
.md-content table { width: 100%; border-collapse: collapse; margin: 0 0 16px; font-size: 13px; }
.md-content th { background: var(--bg-sidebar); padding: 10px 12px; text-align: left; font-weight: 600; border-bottom: 2px solid var(--border); font-size: 12px; text-transform: uppercase; letter-spacing: .3px; color: var(--text-dim); }
.md-content td { padding: 8px 12px; border-bottom: 1px solid var(--border); }
.md-content tr:hover td { background: var(--bg-hover); }

/* ============================================
   OVERVIEW CARDS
   ============================================ */
.overview-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-bottom: 24px; }
.stat-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; display: flex; flex-direction: column; gap: 4px;
}
.stat-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .5px; font-weight: 600; }
.stat-value { font-size: 18px; font-weight: 700; font-family: monospace; }

/* Severity summary bar */
.severity-bar { display: flex; gap: 8px; margin-bottom: 24px; flex-wrap: wrap; }
.sev-count {
  display: flex; align-items: center; gap: 6px; padding: 8px 14px;
  border-radius: var(--radius); font-size: 13px; font-weight: 600; cursor: pointer;
  transition: all .15s;
}
.sev-count:hover { opacity: .85; transform: translateY(-1px); }
.sev-count .num { font-size: 20px; font-family: monospace; }
.sev-critical-card { background: var(--critical-bg); color: var(--critical); }
.sev-high-card { background: var(--high-bg); color: var(--high); }
.sev-medium-card { background: var(--medium-bg); color: var(--medium); }
.sev-low-card { background: var(--low-bg); color: var(--low); }
.sev-positive-card { background: var(--positive-bg); color: var(--positive); }

/* Domain health grid */
.domain-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 10px; margin-bottom: 24px; }
.domain-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 16px; cursor: pointer; transition: all .15s;
  display: flex; justify-content: space-between; align-items: center;
}
.domain-card:hover { border-color: var(--accent); background: var(--bg-hover); }
.domain-card-name { font-size: 14px; font-weight: 600; }
.domain-card-findings { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.domain-card-health { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .3px; }

/* Finding detail header */
.finding-header { margin-bottom: 24px; }
.finding-header-code { font-size: 12px; font-weight: 700; font-family: monospace; color: var(--text-muted); margin-bottom: 4px; }
.finding-header-badges { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }

/* Ignore button on findings */
.finding-ignore-btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px;
  border-radius: var(--radius); font-size: 12px; font-weight: 600;
  cursor: pointer; border: 1px solid var(--border); background: none;
  color: var(--text-dim); transition: all .15s; margin-top: 12px;
}
.finding-ignore-btn:hover { background: var(--bg-hover); color: var(--text); }
.finding-ignore-btn.ignored { background: var(--medium-bg); color: var(--medium); border-color: var(--medium); }

/* ============================================
   HIDDEN RECOMMENDATIONS ACCORDION
   ============================================ */
.hidden-recommendations { margin-top: 32px; }
.hidden-recs-toggle {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; padding: 12px 16px; background: var(--bg-sidebar); border: 1px solid var(--border);
  border-radius: var(--radius); cursor: pointer; font-size: 14px; font-weight: 600;
  color: var(--text-dim); transition: all .15s;
}
.hidden-recs-toggle:hover { background: var(--bg-hover); }
.hidden-recs-toggle .count { font-size: 12px; color: var(--text-muted); }
.hidden-recs-toggle .chevron { transition: transform .2s; }
.hidden-recs-toggle.open .chevron { transform: rotate(180deg); }
.hidden-recs-content {
  display: none; padding: 12px 0; border-bottom: 1px solid var(--border);
}
.hidden-recs-content.open { display: block; }
.hidden-rec-item {
  padding: 10px 16px; border-radius: var(--radius); margin-bottom: 4px;
  display: flex; justify-content: space-between; align-items: center;
  background: var(--bg-card); border: 1px solid var(--border); opacity: .7;
}
.hidden-rec-item:hover { opacity: 1; }
.hidden-rec-info { flex: 1; }
.hidden-rec-code { font-size: 11px; font-weight: 700; font-family: monospace; color: var(--text-muted); }
.hidden-rec-title { font-size: 13px; color: var(--text-dim); margin-top: 2px; }

/* ============================================
   ACTIONS LIST
   ============================================ */
.action-group { margin-bottom: 32px; }
.action-group-header {
  display: flex; align-items: center; gap: 10px; margin-bottom: 14px;
  padding-bottom: 8px; border-bottom: 2px solid var(--border);
}
.action-group-title { font-size: 16px; font-weight: 700; text-transform: uppercase; letter-spacing: .3px; }
.action-group-count { font-size: 12px; color: var(--text-muted); font-weight: 500; }
.action-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 20px; margin-bottom: 8px; cursor: pointer; transition: all .15s;
  border-left: 4px solid transparent;
}
.action-card:hover { border-color: var(--accent); background: var(--bg-hover); }
.action-card-critical { border-left-color: var(--critical); }
.action-card-high { border-left-color: var(--high); }
.action-card-medium { border-left-color: var(--medium); }
.action-card-low { border-left-color: var(--low); }
.action-card-positive { border-left-color: var(--positive); }
.action-card-header { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.action-card-code { font-size: 12px; font-weight: 700; font-family: monospace; }
.action-card-title { font-size: 13px; font-weight: 600; color: var(--text); }
.action-card-meta { display: flex; gap: 6px; margin-bottom: 10px; flex-wrap: wrap; }
.action-card-body { font-size: 13px; line-height: 1.7; color: var(--text-dim); }
.action-card-body ol, .action-card-body ul { padding-left: 20px; margin: 4px 0; }
.action-card-body li { margin-bottom: 2px; }
.action-card-body strong { color: var(--text); }

/* ============================================
   NOTES SIDEBAR (Right)
   ============================================ */
.notes-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.2); z-index: 200;
  opacity: 0; transition: opacity .2s;
}
.notes-overlay.visible { opacity: 1; }

.notes-sidebar {
  position: fixed; top: 0; right: 0; bottom: 0; width: 400px;
  background: var(--bg-card); border-left: 1px solid var(--border);
  z-index: 201; transform: translateX(100%); transition: transform .25s ease;
  display: flex; flex-direction: column;
}
.notes-sidebar.visible { transform: translateX(0); }

.notes-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.notes-header h2 { font-size: 16px; font-weight: 700; }
.notes-close-btn {
  width: 32px; height: 32px; border-radius: var(--radius); border: none;
  background: none; cursor: pointer; color: var(--text-dim);
  display: flex; align-items: center; justify-content: center;
}
.notes-close-btn:hover { background: var(--bg-hover); }

.notes-tabs {
  display: flex; border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.notes-tab {
  flex: 1; padding: 10px 16px; background: none; border: none;
  border-bottom: 2px solid transparent; font-size: 13px; font-weight: 600;
  color: var(--text-dim); cursor: pointer; transition: all .15s;
  position: relative;
}
.notes-tab:hover { color: var(--text); }
.notes-tab.active { color: var(--accent); border-bottom-color: var(--accent); }

.notes-conflict-badge {
  width: 8px; height: 8px; border-radius: 50%; background: var(--high);
  display: inline-block; margin-left: 6px; vertical-align: middle;
}

.notes-content { flex: 1; overflow-y: auto; display: flex; flex-direction: column; }
.notes-list { flex: 1; padding: 12px 20px; overflow-y: auto; }

.note-card {
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 16px; margin-bottom: 10px;
}
.note-card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 8px; }
.note-card-title { font-size: 14px; font-weight: 600; }
.note-card-actions { display: flex; gap: 4px; }
.note-card-body { font-size: 13px; line-height: 1.6; color: var(--text-dim); }
.note-card-date { font-size: 11px; color: var(--text-muted); margin-top: 8px; }

.note-form {
  padding: 16px 20px; border-top: 1px solid var(--border);
  flex-shrink: 0; display: flex; flex-direction: column; gap: 8px;
}
.note-form input, .note-form textarea {
  width: 100%; padding: 8px 12px; background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--text); font-size: 13px;
  outline: none; font-family: inherit; resize: vertical;
}
.note-form input:focus, .note-form textarea:focus { border-color: var(--accent); }

/* ============================================
   SCROLLBAR
   ============================================ */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* Loading */
.loading { display: flex; align-items: center; justify-content: center; padding: 64px; color: var(--text-dim); }

/* Empty state */
.empty-state { text-align: center; padding: 64px 24px; color: var(--text-dim); }
.empty-state h3 { font-size: 18px; margin-bottom: 8px; color: var(--text); }
.empty-state p { font-size: 14px; margin-bottom: 20px; }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
  .sidebar { width: 260px; min-width: 260px; }
  .notes-sidebar { width: 340px; }
}

@media (max-width: 768px) {
  .top-bar-nav { display: none; }
  .sidebar { display: none; }
  .notes-sidebar { width: 100%; }
  .content-inner { padding: 20px 16px; }
  .list-main, .picker-main { padding: 24px 16px; }
  .audit-card { grid-template-columns: 1fr; }
  .card-right { align-items: flex-start; flex-direction: row; gap: 8px; }
  .overview-grid { grid-template-columns: repeat(2, 1fr); }
  .domain-grid { grid-template-columns: 1fr; }
}

.subtitle { color: var(--text-dim); font-size: 15px; }
