/* ── Theme variables ──────────────────────────────────────────────────────── */
:root {
  --bg:           #f8fafc;
  --bg-card:      #ffffff;
  --bg-sidebar:   #ffffff;
  --bg-header:    #ffffff;
  --border:       #e2e8f0;
  --text:         #1e293b;
  --text-muted:   #64748b;
  --text-header:  #0f172a;
  --accent:       #6366f1;
  --accent-hover: #4f46e5;
  --accent-light: #eef2ff;
  --success:      #10b981;
  --warning:      #f59e0b;
  --danger:       #ef4444;
  --promoted:     #8b5cf6;
  --shadow:       0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.05);
  --shadow-md:    0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.05);
  --radius:       8px;
  --radius-sm:    5px;
}

body.dark {
  --bg:           #0f172a;
  --bg-card:      #1e293b;
  --bg-sidebar:   #1e293b;
  --bg-header:    #1e293b;
  --border:       #334155;
  --text:         #e2e8f0;
  --text-muted:   #94a3b8;
  --text-header:  #f1f5f9;
  --accent-light: #312e81;
  --shadow:       0 1px 3px rgba(0,0,0,.4);
  --shadow-md:    0 4px 6px rgba(0,0,0,.3);
}

/* ── Reset ────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
       background: var(--bg); color: var(--text); font-size: 14px;
       transition: background .2s, color .2s; }

/* ── Layout ───────────────────────────────────────────────────────────────── */
.layout { display: flex; height: 100vh; overflow: hidden; }

.sidebar {
  width: 260px; min-width: 260px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  overflow-y: auto;
}

.main { flex: 1; display: flex; flex-direction: column; overflow: hidden; }

/* ── Header ───────────────────────────────────────────────────────────────── */
.header {
  background: var(--bg-header);
  border-bottom: 1px solid var(--border);
  padding: 0 20px;
  height: 56px;
  display: flex; align-items: center; justify-content: space-between;
  flex-shrink: 0;
  box-shadow: var(--shadow);
  gap: 16px;
}
.header-brand { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.header-logo  { font-size: 18px; font-weight: 700; color: var(--accent); letter-spacing: -.5px; }
.header-sub   { font-size: 12px; color: var(--text-muted); }
.header-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

/* ── Main nav ─────────────────────────────────────────────────────────────── */
.main-nav { display: flex; gap: 2px; flex: 1; justify-content: center; }

.nav-item { position: relative; }

.nav-btn {
  padding: 6px 16px; border: none; border-radius: var(--radius-sm);
  background: transparent; color: var(--text-muted); font-size: 13px;
  font-weight: 500; cursor: pointer; transition: background .15s, color .15s;
  white-space: nowrap;
}
.nav-btn:hover  { background: var(--accent-light); color: var(--accent); }
.nav-btn.active { background: var(--accent); color: #fff; }

.nav-dropdown {
  display: none; position: absolute; top: calc(100% + 6px); left: 50%;
  transform: translateX(-50%);
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-md);
  min-width: 180px; z-index: 50; overflow: hidden;
}
.nav-item.open .nav-dropdown { display: block; }


.nav-dd-item {
  padding: 9px 16px; font-size: 13px; color: var(--text);
  cursor: pointer; transition: background .12s;
  display: flex; align-items: center; justify-content: space-between;
}
.nav-dd-item:hover        { background: var(--accent-light); color: var(--accent); }
.nav-dd-soon              { color: var(--text-muted); cursor: default; }
.nav-dd-soon:hover        { background: transparent; color: var(--text-muted); }
.soon-badge               { font-size: 10px; background: var(--border);
                             color: var(--text-muted); border-radius: 99px; padding: 1px 6px; }

/* ── Panels ───────────────────────────────────────────────────────────────── */
.tab-panel        { display: none; }
.tab-panel.active { display: block; }

/* ── User chip ────────────────────────────────────────────────────────────── */
.user-chip {
  position: relative;
  display: flex; align-items: center; gap: 7px;
  padding: 5px 12px; border-radius: 99px;
  border: 1px solid var(--border); background: var(--bg);
  font-size: 12px; font-weight: 500;
  color: var(--text); transition: border-color .15s; cursor: default;
}
.user-chip:hover { border-color: var(--accent); }

.user-chip-dropdown.open { display: block; }

.user-chip-dropdown {
  display: none; position: absolute; top: calc(100% + 6px); right: 0;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-md);
  min-width: 200px; z-index: 50; overflow: hidden;
}
.ucd-item {
  padding: 10px 16px; font-size: 13px; color: var(--text);
  cursor: pointer; transition: background .12s; white-space: nowrap;
  display: flex; align-items: center; justify-content: space-between;
}
.ucd-item:hover { background: var(--accent-light); color: var(--accent); }
.ucd-soon { color: var(--text-muted); cursor: default; }
.ucd-soon:hover { background: transparent; color: var(--text-muted); }
.ucd-separator { height: 1px; background: var(--border); margin: 4px 0; }
.ucd-section-label {
  padding: 6px 16px 3px; font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .5px; color: var(--text-muted);
}
.user-chip-role {
  font-size: 11px; font-weight: 700; padding: 1px 7px;
  border-radius: 99px; letter-spacing: .3px;
}
.role-chip-admin    { background: #fee2e2; color: #991b1b; }
.role-chip-developer{ background: #ede9fe; color: #6d28d9; }
.role-chip-analyst  { background: #dcfce7; color: #166534; }
body.dark .role-chip-admin    { background: #450a0a; color: #fca5a5; }
body.dark .role-chip-developer{ background: #312e81; color: #c4b5fd; }
body.dark .role-chip-analyst  { background: #14532d; color: #86efac; }

/* ── Icon / Help button ───────────────────────────────────────────────────── */
.icon-btn {
  width: 32px; height: 32px; border-radius: 50%;
  border: 1px solid var(--border); background: transparent;
  cursor: pointer; font-size: 14px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); transition: background .15s;
}
.icon-btn:hover { background: var(--accent-light); color: var(--accent); }

/* ── Sidebar brand ────────────────────────────────────────────────────────── */
.sidebar-brand { padding: 16px; border-bottom: 1px solid var(--border); }
.sidebar-brand h2 { font-size: 13px; font-weight: 600; color: var(--text-header); }
.sidebar-brand p  { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* ── Search ───────────────────────────────────────────────────────────────── */
.search-wrap { padding: 12px 16px; border-bottom: 1px solid var(--border); }
.search-input {
  width: 100%; padding: 7px 10px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg); color: var(--text); font-size: 13px; outline: none;
}
.search-input:focus { border-color: var(--accent); }

/* ── Filters ──────────────────────────────────────────────────────────────── */
.filters { padding: 12px 16px; border-bottom: 1px solid var(--border); }
.filter-label { font-size: 11px; font-weight: 600; color: var(--text-muted);
                text-transform: uppercase; letter-spacing: .5px; margin-bottom: 8px; }
.filter-select {
  width: 100%; padding: 6px 8px; margin-bottom: 8px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg); color: var(--text); font-size: 12px; outline: none;
}

/* ── ABB list (sidebar) ───────────────────────────────────────────────────── */
.abb-section { padding: 12px 16px; flex: 1; }
.abb-section-label { font-size: 11px; font-weight: 600; color: var(--text-muted);
                     text-transform: uppercase; letter-spacing: .5px; margin-bottom: 8px; }
.abb-item {
  padding: 7px 10px; border-radius: var(--radius-sm);
  cursor: pointer; font-size: 12px; color: var(--text);
  display: flex; align-items: center; gap: 6px; transition: background .15s;
}
.abb-item:hover  { background: var(--accent-light); }
.abb-item.active { background: var(--accent-light); color: var(--accent); font-weight: 600; }
.abb-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); flex-shrink: 0; }
.abb-dot.cs { background: var(--success); }

/* ── Content area ─────────────────────────────────────────────────────────── */
.content { flex: 1; overflow-y: auto; padding: 24px; }

/* ── Topbar ───────────────────────────────────────────────────────────────── */
.topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.topbar h1 { font-size: 20px; font-weight: 700; color: var(--text-header); }
.topbar-right { display: flex; gap: 10px; align-items: center; }
.stat-chip { font-size: 12px; color: var(--text-muted); background: var(--bg-card);
             border: 1px solid var(--border); border-radius: 99px; padding: 3px 10px; }

/* ── Stats row ────────────────────────────────────────────────────────────── */
.stats { display: flex; gap: 16px; margin-bottom: 24px; }
.stat-card {
  flex: 1; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow);
}
.stat-value { font-size: 28px; font-weight: 700; color: var(--text-header); }
.stat-label { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* ── SBB grid ─────────────────────────────────────────────────────────────── */
.sbb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }

.sbb-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow);
  cursor: pointer; transition: box-shadow .15s, border-color .15s; position: relative;
}
.sbb-card:hover { box-shadow: var(--shadow-md); border-color: var(--accent); }

.sbb-card-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 8px; }
.sbb-name    { font-size: 14px; font-weight: 600; color: var(--text-header); }
.sbb-version { font-size: 11px; color: var(--text-muted); }
.sbb-desc    { font-size: 12px; color: var(--text-muted); line-height: 1.5; margin-bottom: 12px;
               display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sbb-meta    { display: flex; gap: 6px; flex-wrap: wrap; }

/* ── ABB checkbox list ────────────────────────────────────────────────────── */
.abb-checkbox-list {
  max-height: 200px; overflow-y: auto;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 8px;
}
.abb-cb-group-label {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .5px; color: var(--text-muted);
  padding: 6px 4px 3px; margin-top: 4px;
}
.abb-cb-group-label:first-child { margin-top: 0; }
.abb-cb-row {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 4px; border-radius: var(--radius-sm);
  cursor: pointer; font-size: 12px; transition: background .1s;
}
.abb-cb-row:hover  { background: var(--accent-light); }
.abb-cb-row input  { accent-color: var(--accent); flex-shrink: 0; }
.abb-cb-name       { flex: 1; color: var(--text); }
.abb-cb-kind       { font-size: 11px; color: var(--text-muted); }

/* ── App card meta rows ───────────────────────────────────────────────────── */
.app-card-meta   { margin: 10px 0 4px; display: flex; flex-direction: column; gap: 3px; }
.app-meta-row    { display: flex; gap: 6px; align-items: baseline; font-size: 12px; }
.app-meta-key    { color: var(--text-muted); min-width: 52px; font-size: 11px; }
.app-meta-val    { color: var(--text); font-weight: 500; }

/* ── ABB catalog ──────────────────────────────────────────────────────────── */
.abb-catalog-grid    { }
.abb-catalog-section { margin-bottom: 28px; }
.abb-catalog-label   { font-size: 13px; font-weight: 700; color: var(--text-header);
                       text-transform: uppercase; letter-spacing: .5px;
                       padding-bottom: 10px; border-bottom: 2px solid var(--accent);
                       margin-bottom: 14px; }
.abb-catalog-row     { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }

.abb-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow);
  cursor: pointer; transition: box-shadow .15s, border-color .15s;
}
.abb-card:hover { box-shadow: var(--shadow-md); border-color: var(--accent); }
.abb-card-header { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.abb-kind-dot    { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex-shrink: 0; }
.abb-card-name   { font-size: 13px; font-weight: 600; color: var(--text-header); }
.abb-card-kind   { margin-bottom: 8px; }
.abb-card-desc   { font-size: 12px; color: var(--text-muted); line-height: 1.4; margin-bottom: 10px;
                   display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.abb-card-footer { display: flex; justify-content: space-between; align-items: center; }
.abb-module      { font-size: 10px; color: var(--text-muted); font-family: monospace; }
.abb-sbb-count   { font-size: 11px; color: var(--accent); font-weight: 600; }

/* ── Badges ───────────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center;
  padding: 2px 8px; border-radius: 99px; font-size: 11px; font-weight: 500;
}
.badge-kind       { background: #ede9fe; color: #6d28d9; }
.badge-domain     { background: #e0f2fe; color: #0369a1; }
.badge-abb        { background: #f0fdf4; color: #166534; }
.badge-inspect    { background: #f0fdf4; color: #166534; }
.badge-noinspect  { background: #fef2f2; color: #991b1b; }
.status-badge-draft     { background: #f1f5f9; color: #64748b; border-radius: 99px; padding: 2px 8px; font-size: 11px; }
.status-badge-published { background: #dcfce7; color: #166534; border-radius: 99px; padding: 2px 8px; font-size: 11px; }
.status-badge-promoted  { background: #ede9fe; color: #6d28d9; border-radius: 99px; padding: 2px 8px; font-size: 11px; }

/* App status badges */
.app-badge-poc        { background: #eff6ff; color: #1d4ed8; border-radius: 99px; padding: 2px 7px; font-size: 10px; font-weight: 700; }
.app-badge-active     { background: #fefce8; color: #854d0e; border-radius: 99px; padding: 2px 7px; font-size: 10px; font-weight: 700; }
.app-badge-production { background: #dcfce7; color: #166534; border-radius: 99px; padding: 2px 7px; font-size: 10px; font-weight: 700; }
.app-badge-archived   { background: #f1f5f9; color: #64748b; border-radius: 99px; padding: 2px 7px; font-size: 10px; font-weight: 700; }

body.dark .badge-kind      { background: #312e81; color: #c4b5fd; }
body.dark .badge-domain    { background: #0c4a6e; color: #7dd3fc; }
body.dark .badge-abb       { background: #14532d; color: #86efac; }
body.dark .badge-inspect   { background: #14532d; color: #86efac; }
body.dark .badge-noinspect { background: #450a0a; color: #fca5a5; }
body.dark .app-badge-poc        { background: #1e3a5f; color: #93c5fd; }
body.dark .app-badge-active     { background: #422006; color: #fde68a; }
body.dark .app-badge-production { background: #14532d; color: #86efac; }
body.dark .app-badge-archived   { background: #1e293b; color: #94a3b8; }

/* ── Status dots ──────────────────────────────────────────────────────────── */
.status-dot { position: absolute; top: 14px; right: 14px; width: 9px; height: 9px; border-radius: 50%; }
.status-draft     { background: var(--text-muted); }
.status-published { background: var(--success); }
.status-promoted  { background: var(--promoted); }
.app-status-dot { position: absolute; top: 14px; right: 14px; width: 9px; height: 9px; border-radius: 50%; }
.app-status-poc        { background: #3b82f6; }
.app-status-active     { background: var(--warning); }
.app-status-production { background: var(--success); }
.app-status-archived   { background: var(--text-muted); }

/* ── User grid ────────────────────────────────────────────────────────────── */
.user-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }

.user-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px;
  display: flex; align-items: center; gap: 14px;
  cursor: pointer; transition: box-shadow .15s, border-color .15s;
}
.user-card:hover { box-shadow: var(--shadow-md); border-color: var(--accent); }

.user-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 700; flex-shrink: 0;
}
.user-info   { flex: 1; min-width: 0; }
.user-name   { font-size: 14px; font-weight: 600; color: var(--text-header); }
.user-email  { font-size: 12px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-phone  { font-size: 11px; color: var(--text-muted); }

.user-role-badge {
  padding: 3px 10px; border-radius: 99px; font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .3px; flex-shrink: 0;
}
.role-admin     { background: #fee2e2; color: #991b1b; }
.role-pm        { background: #fef3c7; color: #92400e; }
.role-lead      { background: #ede9fe; color: #5b21b6; }
.role-developer { background: #dbeafe; color: #1e40af; }
.role-analyst   { background: #dcfce7; color: #166534; }
.role-guest     { background: #f1f5f9; color: #64748b; }
body.dark .role-admin     { background: #450a0a; color: #fca5a5; }
body.dark .role-pm        { background: #422006; color: #fde68a; }
body.dark .role-lead      { background: #312e81; color: #c4b5fd; }
body.dark .role-developer { background: #1e3a5f; color: #93c5fd; }
body.dark .role-analyst   { background: #14532d; color: #86efac; }
body.dark .role-guest     { background: #1e293b; color: #94a3b8; }

/* ── Audit log ────────────────────────────────────────────────────────────── */
.audit-row { display: flex; gap: 10px; align-items: center; padding: 5px 0;
             border-bottom: 1px solid var(--border); font-size: 12px; }
.audit-row:last-child { border-bottom: none; }
.audit-action  { font-weight: 600; border-radius: 99px; padding: 2px 8px; font-size: 11px; }
.audit-published { background: #dcfce7; color: #166534; }
.audit-promoted  { background: #ede9fe; color: #6d28d9; }
.audit-deleted   { background: #fee2e2; color: #991b1b; }
.audit-registered{ background: #e0f2fe; color: #0369a1; }
.audit-updated   { background: #fefce8; color: #854d0e; }
.audit-actor { color: var(--text-muted); flex: 1; }
.audit-time  { color: var(--text-muted); font-size: 11px; white-space: nowrap; }
body.dark .audit-published  { background: #14532d; color: #86efac; }
body.dark .audit-promoted   { background: #312e81; color: #c4b5fd; }
body.dark .audit-deleted    { background: #450a0a; color: #fca5a5; }
body.dark .audit-registered { background: #0c4a6e; color: #7dd3fc; }
body.dark .audit-updated    { background: #422006; color: #fde68a; }

/* ── Empty state ──────────────────────────────────────────────────────────── */
.empty { text-align: center; padding: 60px 0; color: var(--text-muted); }
.empty-icon { font-size: 40px; margin-bottom: 12px; }
.empty p { font-size: 14px; }

/* ── Buttons ──────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: var(--radius-sm); font-size: 13px;
  font-weight: 500; cursor: pointer; border: none; transition: background .15s;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-ghost   { background: transparent; color: var(--text-muted); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--accent-light); color: var(--accent); }
.btn-danger  { background: var(--danger); color: #fff; }
.btn-sm      { padding: 5px 12px; font-size: 12px; }
.btn:disabled { cursor: not-allowed; }
.btn-primary:disabled { background: var(--border); color: var(--text-muted); opacity: 1; }

/* ── Theme toggle ─────────────────────────────────────────────────────────── */
.theme-toggle {
  width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid var(--border); background: transparent;
  cursor: pointer; font-size: 16px; display: flex; align-items: center; justify-content: center;
  color: var(--text); transition: background .15s;
}
.theme-toggle:hover { background: var(--accent-light); }

/* ── Modal ────────────────────────────────────────────────────────────────── */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(15,23,42,.4); z-index: 100;
  align-items: center; justify-content: center;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); width: 580px; max-width: 95vw;
  max-height: 90vh; overflow-y: auto; padding: 28px;
  box-shadow: 0 20px 40px rgba(0,0,0,.15);
}
.modal-title { font-size: 17px; font-weight: 700; margin-bottom: 20px; color: var(--text-header); }

/* ── Form ─────────────────────────────────────────────────────────────────── */
.form-group  { margin-bottom: 16px; }
.form-label  { display: block; font-size: 12px; font-weight: 600; margin-bottom: 5px; color: var(--text-muted); }
.form-input, .form-select, .form-textarea {
  width: 100%; padding: 8px 10px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg); color: var(--text); font-size: 13px; outline: none; font-family: inherit;
}
.form-input:focus, .form-select:focus, .form-textarea:focus { border-color: var(--accent); }
.form-textarea { min-height: 80px; resize: vertical; }
.form-hint { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.form-row  { display: flex; gap: 12px; }
.form-row .form-group { flex: 1; }
.form-check { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; }
.form-check input { width: 15px; height: 15px; accent-color: var(--accent); }
.form-check label { font-size: 13px; color: var(--text); cursor: pointer; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 24px;
                padding-top: 16px; border-top: 1px solid var(--border); }

/* ── Detail panel ─────────────────────────────────────────────────────────── */
.detail-section { margin-bottom: 16px; }
.detail-section h3 { font-size: 12px; font-weight: 600; color: var(--text-muted);
                     text-transform: uppercase; letter-spacing: .5px; margin-bottom: 8px; }
.detail-row { display: flex; justify-content: space-between;
              padding: 6px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.detail-row:last-child { border-bottom: none; }
.detail-key   { color: var(--text-muted); }
.detail-value { color: var(--text); font-weight: 500; text-align: right; max-width: 65%; word-break: break-all; }
.detail-value a { color: var(--accent); }
.detail-desc  { font-size: 13px; color: var(--text); line-height: 1.6;
                background: var(--bg); border-radius: var(--radius-sm);
                padding: 10px; margin-bottom: 16px; }
.detail-actions { display: flex; gap: 8px; margin-top: 20px; }

/* ── Help modal ───────────────────────────────────────────────────────────── */
.help-body { font-size: 13px; color: var(--text); line-height: 1.6; }
.help-section { margin-bottom: 20px; }
.help-section h3 { font-size: 12px; font-weight: 700; text-transform: uppercase;
                   letter-spacing: .5px; color: var(--text-muted); margin-bottom: 10px; }
.help-section p { color: var(--text); }
.help-row { display: flex; align-items: center; gap: 10px; padding: 5px 0; }
.help-chip {
  padding: 2px 10px; border-radius: 99px; font-size: 11px; font-weight: 600;
  background: var(--accent-light); color: var(--accent); white-space: nowrap;
}
.help-chip.chip-admin    { background: #fee2e2; color: #991b1b; }
.help-chip.chip-dev      { background: #ede9fe; color: #6d28d9; }
.help-chip.chip-analyst  { background: #dcfce7; color: #166534; }
body.dark .help-chip             { background: #312e81; color: #c4b5fd; }
body.dark .help-chip.chip-admin  { background: #450a0a; color: #fca5a5; }
body.dark .help-chip.chip-dev    { background: #312e81; color: #c4b5fd; }
body.dark .help-chip.chip-analyst{ background: #14532d; color: #86efac; }

/* ── Phase roadmap sidebar ────────────────────────────────────────────────── */
.phase-section { padding: 12px 16px; border-top: 1px solid var(--border); }
.phase-item    { padding: 10px 0; border-bottom: 1px solid var(--border); }
.phase-item:last-child { border-bottom: none; }
.phase-badge {
  display: inline-block; padding: 2px 7px; border-radius: 99px;
  font-size: 10px; font-weight: 700; letter-spacing: .4px;
  text-transform: uppercase; margin-bottom: 4px;
}
.phase-badge.live    { background: #dcfce7; color: #166534; }
.phase-badge.wip     { background: #fef9c3; color: #854d0e; }
.phase-badge.planned { background: #f1f5f9; color: #64748b; }
body.dark .phase-badge.live    { background: #14532d; color: #86efac; }
body.dark .phase-badge.wip     { background: #422006; color: #fde68a; }
body.dark .phase-badge.planned { background: #1e293b; color: #94a3b8; }
.phase-name { font-size: 12px; font-weight: 600; color: var(--text); margin-bottom: 2px; }
.phase-desc { font-size: 11px; color: var(--text-muted); line-height: 1.4; }

/* ── Toast ────────────────────────────────────────────────────────────────── */
.toast {
  position: fixed; bottom: 24px; right: 24px; z-index: 200;
  padding: 12px 20px; border-radius: var(--radius);
  font-size: 13px; font-weight: 500; color: #fff;
  box-shadow: var(--shadow-md); opacity: 0; transition: opacity .3s; pointer-events: none;
}
.toast.show    { opacity: 1; }
.toast.success { background: var(--success); }
.toast.error   { background: var(--danger); }

/* ── Review queue ─────────────────────────────────────────────────────────── */
.review-row {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; margin-bottom: 14px;
  box-shadow: var(--shadow);
}
.review-row-header { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 8px; }
.review-row-name   { font-size: 16px; font-weight: 700; color: var(--text-header); flex: 1; }
.review-row-meta   { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.review-row-desc   { font-size: 13px; color: var(--text-muted); line-height: 1.5; margin-bottom: 12px; }
.review-row-grid   {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px;
  padding: 12px; background: var(--bg); border-radius: var(--radius-sm); margin-bottom: 12px;
  font-size: 12px;
}
.review-detail-item { display: flex; gap: 6px; align-items: baseline; }
.review-detail-key  { color: var(--text-muted); min-width: 80px; flex-shrink: 0; }
.review-detail-val  { color: var(--text); font-weight: 500; word-break: break-all; }
.review-detail-val a { color: var(--accent); }
.review-manager-note {
  font-size: 12px; color: #92400e; background: #fffbeb;
  border: 1px solid #fde68a; border-radius: var(--radius-sm);
  padding: 7px 12px; margin-bottom: 12px;
}
body.dark .review-manager-note { background: #422006; border-color: #d97706; color: #fde68a; }
.review-row-actions { display: flex; gap: 10px; padding-top: 12px; border-top: 1px solid var(--border); }
.review-nav-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px;
  background: var(--danger); color: #fff;
  border-radius: 99px; font-size: 10px; font-weight: 700;
}

/* ── Extra status dots / badges ───────────────────────────────────────────── */
.status-pending_review { background: var(--warning); }
.status-rejected       { background: var(--danger); }
.status-badge-pending_review { background: #fefce8; color: #854d0e; border-radius: 99px; padding: 2px 8px; font-size: 11px; }
.status-badge-rejected       { background: #fee2e2; color: #991b1b; border-radius: 99px; padding: 2px 8px; font-size: 11px; }
body.dark .status-badge-pending_review { background: #422006; color: #fde68a; }
body.dark .status-badge-rejected       { background: #450a0a; color: #fca5a5; }

/* ── Extra audit action colours ───────────────────────────────────────────── */
.audit-submitted { background: #fefce8; color: #854d0e; }
.audit-approved  { background: #dcfce7; color: #166534; }
.audit-rejected  { background: #fee2e2; color: #991b1b; }
body.dark .audit-submitted { background: #422006; color: #fde68a; }
body.dark .audit-approved  { background: #14532d; color: #86efac; }
body.dark .audit-rejected  { background: #450a0a; color: #fca5a5; }

/* ── Login modal ───────────────────────────────────────────────────────────── */
.login-card {
  width: 100%; max-width: 380px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px 36px;
  box-shadow: 0 8px 32px rgba(0,0,0,.12);
}
.login-brand { text-align: center; margin-bottom: 28px; }
.login-brand h2 { font-size: 20px; font-weight: 700; color: var(--accent); margin: 0 0 4px; }
.login-brand p  { font-size: 13px; color: var(--text-muted); margin: 0; }
.login-error {
  font-size: 13px; color: var(--danger);
  background: #fee2e2; border-radius: var(--radius-sm);
  padding: 8px 12px; margin-bottom: 14px;
}
body.dark .login-error { background: #450a0a; }
.ucd-logout { color: var(--danger); }

/* ── Review Queue split panel ──────────────────────────────────────────────── */
.review-split { display: flex; gap: 16px; height: calc(100vh - 140px); }
.review-split-list { width: 300px; min-width: 260px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
.review-split-detail { flex: 1; overflow-y: auto; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
.review-detail-empty { color: var(--text-muted); text-align: center; margin-top: 60px; font-size: 14px; }

.review-list-row {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px 14px; cursor: pointer; transition: border-color .15s;
}
.review-list-row:hover { border-color: var(--accent); }
.review-list-row.active { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--bg-card)); }
.rlr-name { font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.rlr-meta { margin-bottom: 4px; }
.rlr-date { font-size: 11px; color: var(--text-muted); }

/* ── Admin Dashboard ───────────────────────────────────────────────────────── */
.period-selector { display: flex; gap: 2px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 2px; }
.period-btn { padding: 4px 12px; border: none; background: transparent; border-radius: var(--radius-sm); cursor: pointer; font-size: 12px; font-weight: 500; color: var(--text-muted); transition: background .15s, color .15s; }
.period-btn.active { background: var(--accent); color: #fff; }
.period-btn:hover:not(.active) { background: var(--accent-light); color: var(--accent); }

.dash-charts { display: grid; grid-template-columns: 1fr 420px; gap: 16px; margin-bottom: 16px; }
.dash-chart-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.dash-chart-title { font-size: 11px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 14px; }

.dash-bottom { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.dash-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); max-height: 340px; overflow-y: auto; }
.dash-card-title { font-size: 11px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 14px; }

.dash-contrib-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; font-size: 13px; border-bottom: 1px solid var(--border); }
.dash-contrib-row:last-child { border-bottom: none; }
.dash-contrib-rank { font-size: 11px; color: var(--text-muted); min-width: 22px; }
.dash-contrib-name { min-width: 0; flex: 1; color: var(--text); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-contrib-bar-wrap { width: 80px; height: 7px; background: var(--bg); border-radius: 99px; overflow: hidden; flex-shrink: 0; }
.dash-contrib-bar { height: 100%; background: var(--accent); border-radius: 99px; transition: width .4s ease; }
.dash-contrib-count { font-size: 12px; color: var(--text-muted); min-width: 24px; text-align: right; flex-shrink: 0; }

.dash-donut-wrap { display: flex; align-items: center; gap: 24px; }
.dash-legend { display: flex; flex-direction: column; gap: 9px; }
.dash-legend-item { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.dash-legend-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.dash-legend-label { flex: 1; color: var(--text); text-transform: capitalize; }
.dash-legend-count { color: var(--text-muted); white-space: nowrap; font-size: 11px; }

.dash-recent-list { font-size: 12px; }
.dash-recent-list .audit-row { font-size: 11px; }

/* Right detail panel */
.rdp-header { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.rdp-name   { font-size: 18px; font-weight: 700; }
.rdp-desc   { color: var(--text-muted); font-size: 13px; margin-bottom: 14px; line-height: 1.5; }
.rdp-abbs   { margin-bottom: 12px; display: flex; flex-wrap: wrap; gap: 4px; }
.rdp-sbbs   { margin: 12px 0; display: flex; flex-wrap: wrap; gap: 4px; }
.rdp-grid   { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 20px; margin-bottom: 20px; }
.rdp-actions {
  display: flex; gap: 10px; padding-top: 20px;
  border-top: 1px solid var(--border); margin-top: auto;
}

/* ── Enterprise Continuum ─────────────────────────────────────────────────── */
.ec-togaf-badge { font-size: 10px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; }

.ec-direction-banner {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 11px 20px; margin-bottom: 16px;
}
.ec-direction-side  { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--text-muted); }
.ec-direction-arrow { font-size: 20px; color: var(--accent); opacity: .7; }
.ec-direction-center { font-size: 13px; font-weight: 700; color: var(--text-header); }

.ec-col-headers {
  display: grid; grid-template-columns: 170px 1fr 56px 1fr;
  gap: 0 0; margin-bottom: 8px; padding: 0 0 0 0;
}
.ec-col-header-label {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .5px; color: var(--text-muted); padding: 0 12px 0 16px;
}

.ec-matrix { display: flex; flex-direction: column; gap: 10px; }

.ec-row {
  display: grid; grid-template-columns: 170px 1fr 56px 1fr;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; min-height: 110px;
  box-shadow: var(--shadow);
}

.ec-tier-badge {
  padding: 14px 12px; border-right: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 5px; background: var(--bg);
}
.ec-tier-dot  { width: 10px; height: 10px; border-radius: 50%; margin-bottom: 2px; }
.ec-tier-name { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; }
.ec-tier-desc { font-size: 10px; color: var(--text-muted); line-height: 1.45; }

.ec-abb-col, .ec-sbb-col {
  padding: 10px 12px; display: flex; flex-wrap: wrap; gap: 8px; align-content: flex-start;
}
.ec-abb-card {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 8px 10px;
  cursor: pointer; transition: border-color .15s; min-width: 120px;
}
.ec-abb-card:hover  { border-color: var(--accent); }
.ec-abb-name   { font-size: 12px; font-weight: 600; color: var(--text-header); margin-bottom: 2px; }
.ec-abb-kind   { font-size: 10px; color: var(--text-muted); }
.ec-abb-module { font-size: 9px; color: var(--text-muted); font-family: monospace; margin-top: 2px; }

.ec-sbb-card {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 8px 10px;
  cursor: pointer; transition: border-color .15s; min-width: 120px;
}
.ec-sbb-card:hover           { border-color: var(--accent); }
.ec-sbb-card.ec-sbb-promoted { border-left: 3px solid var(--promoted); }
.ec-sbb-card.ec-sbb-published{ border-left: 3px solid var(--success); }
.ec-sbb-name { font-size: 12px; font-weight: 600; color: var(--text-header); margin-bottom: 4px; }
.ec-sbb-meta { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }

.ec-app-card {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 8px 10px;
  cursor: pointer; transition: border-color .15s;
  display: flex; align-items: center; gap: 7px; min-width: 120px;
}
.ec-app-card:hover { border-color: var(--accent); }
.ec-app-dot  { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.ec-app-name { font-size: 12px; font-weight: 600; color: var(--text-header); flex: 1; }

.ec-sep {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  border-left: 1px solid var(--border); border-right: 1px solid var(--border);
  gap: 4px; background: var(--bg);
}
.ec-sep-arrow { font-size: 18px; opacity: .75; }
.ec-sep-label {
  font-size: 8px; color: var(--text-muted); text-transform: uppercase;
  letter-spacing: .4px; writing-mode: vertical-rl;
}

.ec-empty-col {
  padding: 12px; color: var(--text-muted); font-size: 12px;
  display: flex; flex-direction: column; gap: 6px; align-items: flex-start;
}
.ec-empty-hint { font-style: italic; }
