/* ═══════════════════════════════════════════════════════════
   GovNexa SecureLab — Shared Stylesheet
   Version: 2.4  |  Classification: CUI // NAVWAR
   ═══════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;600&family=Source+Sans+3:wght@300;400;500;600;700&display=swap');

/* ── CSS VARIABLES ──────────────────────────────────────── */
:root {
  --navy:        hsl(220,65%,12%);
  --navy-mid:    hsl(220,55%,18%);
  --navy-soft:   hsl(220,45%,24%);
  --accent:      hsl(220,60%,40%);
  --accent-lt:   hsl(220,60%,55%);
  --surface:     hsl(220,18%,97%);
  --surface-2:   hsl(220,14%,93%);
  --border:      hsl(220,18%,88%);
  --text:        hsl(220,25%,18%);
  --muted:       hsl(220,15%,52%);
  --success:     hsl(142,68%,30%);
  --success-lt:  hsl(142,55%,94%);
  --danger:      hsl(0,84%,52%);
  --danger-lt:   hsl(0,84%,95%);
  --warning:     hsl(38,92%,50%);
  --warning-lt:  hsl(38,80%,94%);
  --sidebar-w:   240px;
  --topbar-h:    56px;
  --radius:      8px;
  --radius-lg:   12px;
  --shadow-sm:   0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow:      0 4px 12px rgba(0,0,0,.08), 0 2px 4px rgba(0,0,0,.06);
  --shadow-lg:   0 12px 32px rgba(0,0,0,.12), 0 4px 8px rgba(0,0,0,.08);
  --transition:  .18s cubic-bezier(.4,0,.2,1);
}

/* ── RESET & BASE ───────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  font-family: 'Source Sans 3', sans-serif;
  background: var(--surface);
  color: var(--text);
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

button { cursor: pointer; font-family: inherit; border: none; background: none; }
input, select, textarea { font-family: inherit; font-size: inherit; }
a { color: inherit; text-decoration: none; }

/* ── CLASSIFICATION BANNERS ─────────────────────────────── */
.class-top, .class-bottom {
  background: var(--navy);
  color: hsl(220,50%,85%);
  text-align: center;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .12em;
  padding: 4px 12px;
  text-transform: uppercase;
  flex-shrink: 0;
}

/* ── APP SHELL ──────────────────────────────────────────── */
.shell {
  display: flex;
  flex: 1;
  overflow: hidden;
  min-height: 0;
}

/* ── SIDEBAR ────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--navy);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: width var(--transition);
  overflow: hidden;
  position: relative;
  z-index: 20;
}
.sidebar.collapsed { width: 60px; }

.sb-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 14px 14px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  flex-shrink: 0;
}
.sb-logo {
  width: 34px; height: 34px;
  background: hsl(220,55%,88%);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.sb-logo svg { width: 18px; height: 18px; stroke: var(--navy); }
.sb-brand-txt h1 { font-size: 13px; font-weight: 700; color: #fff; line-height: 1.2; white-space: nowrap; }
.sb-brand-txt p  { font-size: 10px; color: hsl(220,40%,65%); font-family: 'IBM Plex Mono', monospace; letter-spacing: .08em; white-space: nowrap; }

.sb-class {
  padding: 6px 14px;
  flex-shrink: 0;
}
.sb-class span {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px;
  letter-spacing: .1em;
  color: hsl(38,80%,65%);
  background: rgba(255,200,60,.08);
  border: 1px solid rgba(255,200,60,.2);
  border-radius: 4px;
  padding: 3px 7px;
  display: inline-block;
  white-space: nowrap;
}

.sb-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 8px;
  overflow-y: auto;
  overflow-x: hidden;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius);
  color: hsl(220,30%,70%);
  font-size: 13px;
  font-weight: 500;
  transition: background var(--transition), color var(--transition);
  text-align: left;
  white-space: nowrap;
  position: relative;
  width: 100%;
}
.nav-item svg { width: 16px; height: 16px; flex-shrink: 0; transition: stroke var(--transition); }
.nav-item:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav-item.active { background: rgba(255,255,255,.12); color: #fff; font-weight: 600; }
.nav-label { overflow: hidden; }
.nav-badge {
  margin-left: auto;
  background: var(--danger);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 10px;
  flex-shrink: 0;
}
.sidebar.collapsed .nav-label,
.sidebar.collapsed .nav-badge,
.sidebar.collapsed .sb-brand-txt,
.sidebar.collapsed .sb-class,
.sidebar.collapsed .sb-user-txt,
.sidebar.collapsed .collapse-label { display: none; }

.sb-bottom {
  padding: 10px 8px;
  border-top: 1px solid rgba(255,255,255,.08);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.sb-user { display: flex; align-items: center; gap: 9px; padding: 6px 4px; }
.sb-avatar {
  width: 30px; height: 30px;
  background: hsl(220,60%,40%);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 11px; font-weight: 700;
  flex-shrink: 0;
}
.sb-user-txt .name  { font-size: 12px; font-weight: 600; color: #fff; white-space: nowrap; }
.sb-user-txt .role  { font-size: 10px; color: hsl(220,30%,65%); white-space: nowrap; }

.collapse-btn {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px; border-radius: var(--radius);
  color: hsl(220,30%,60%); font-size: 12px;
  transition: background var(--transition), color var(--transition);
  width: 100%;
}
.collapse-btn:hover { background: rgba(255,255,255,.07); color: #fff; }
.collapse-btn svg { width: 14px; height: 14px; flex-shrink: 0; }

/* ── RIGHT PANEL ────────────────────────────────────────── */
.right-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

/* ── TOPBAR ─────────────────────────────────────────────── */
.topbar {
  height: var(--topbar-h);
  background: #fff;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  flex-shrink: 0;
  gap: 16px;
  z-index: 200;
  position: relative;
}
.topbar-left {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 600;
  color: var(--navy); flex-shrink: 0;
}
.topbar-stars { display: flex; gap: 2px; }
.topbar-stars svg { width: 10px; height: 10px; fill: var(--warning); stroke: none; }

.topbar-right { display: flex; align-items: center; gap: 10px; }

.search-box {
  display: flex; align-items: center; gap: 6px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px 10px;
}
.search-box svg { width: 13px; height: 13px; color: var(--muted); }
.search-box input {
  border: none; background: none; outline: none;
  font-size: 12px; color: var(--text); width: 180px;
}
.search-box input::placeholder { color: var(--muted); }

/* ── NOTIFICATION BELL ──────────────────────────────────── */
.bell-wrap { position: relative; }

.bell-btn {
  position: relative; padding: 6px;
  border-radius: var(--radius); color: var(--muted);
  transition: background var(--transition), color var(--transition);
}
.bell-btn:hover { background: var(--surface); color: var(--text); }
.bell-btn.active { background: var(--surface); color: var(--text); }
.bell-btn svg { width: 17px; height: 17px; }
.bell-dot {
  position: absolute; top: 6px; right: 6px;
  width: 7px; height: 7px;
  background: var(--danger); border-radius: 50%;
  border: 1.5px solid #fff;
  transition: opacity var(--transition);
}
.bell-dot.hidden { opacity: 0; }

/* ── NOTIFICATION DROPDOWN ──────────────────────────────── */
.notif-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 360px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 500;
  display: none;
  flex-direction: column;
  overflow: hidden;
  animation: dropIn .18s cubic-bezier(.4,0,.2,1);
}
.notif-dropdown.open { display: flex; }

@keyframes dropIn {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.notif-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px 10px;
  border-bottom: 1px solid var(--surface-2);
}
.notif-header-left { display: flex; align-items: center; gap: 8px; }
.notif-header-title { font-size: 13px; font-weight: 700; color: var(--navy); }
.notif-count-badge {
  background: var(--danger); color: #fff;
  font-size: 9px; font-weight: 700;
  padding: 1px 6px; border-radius: 10px;
}
.notif-mark-all {
  font-size: 11px; color: var(--accent); font-weight: 600;
  background: none; border: none; cursor: pointer; padding: 2px 0;
  transition: color var(--transition);
}
.notif-mark-all:hover { color: var(--navy); }

.notif-list {
  overflow-y: auto;
  max-height: 380px;
  display: flex; flex-direction: column;
}

.notif-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 11px 16px 11px 20px;
  border-bottom: 1px solid var(--surface-2);
  cursor: pointer;
  transition: background var(--transition);
  position: relative;
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: var(--surface); }
.notif-item.unread { background: hsl(220,60%,99%); }
.notif-item.unread::before {
  content: '';
  position: absolute; left: 8px; top: 50%;
  transform: translateY(-50%);
  width: 5px; height: 5px;
  background: var(--accent); border-radius: 50%;
}

.notif-icon {
  width: 30px; height: 30px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; margin-top: 1px;
}
.notif-icon svg { width: 13px; height: 13px; }
.ni-success { background: var(--success-lt); color: var(--success); }
.ni-warning { background: var(--warning-lt); color: hsl(38,70%,35%); }
.ni-danger  { background: var(--danger-lt);  color: var(--danger); }
.ni-info    { background: hsl(220,60%,95%);  color: var(--accent); }

.notif-body { flex: 1; min-width: 0; }
.notif-title { font-size: 12px; font-weight: 600; color: var(--text); line-height: 1.3; }
.notif-msg   { font-size: 11px; color: var(--muted); margin-top: 2px; line-height: 1.4; }
.notif-time  { font-size: 10px; color: var(--muted); white-space: nowrap; flex-shrink: 0; margin-top: 2px; }

.notif-footer {
  padding: 10px 16px;
  border-top: 1px solid var(--surface-2);
  text-align: center;
}
.notif-footer-link {
  font-size: 12px; color: var(--accent); font-weight: 600;
  background: none; border: none; cursor: pointer;
  transition: color var(--transition);
}
.notif-footer-link:hover { color: var(--navy); }

/* ── USER PROFILE CHIP & DROPDOWN ───────────────────────── */
.user-chip-wrap { position: relative; }

.user-chip {
  display: flex; align-items: center; gap: 8px;
  cursor: pointer;
  padding: 4px 8px 4px 4px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  transition: background var(--transition), border-color var(--transition);
}
.user-chip:hover, .user-chip.active {
  background: var(--surface);
  border-color: var(--border);
}
.user-chip-av {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--navy); display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 11px; font-weight: 700;
}
.user-chip-txt .name { font-size: 12px; font-weight: 600; }
.user-chip-txt .role { font-size: 10px; color: var(--muted); }
.user-chip-chevron {
  width: 14px; height: 14px; color: var(--muted);
  transition: transform var(--transition);
  flex-shrink: 0;
}
.user-chip.active .user-chip-chevron { transform: rotate(180deg); }

.user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 260px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 500;
  display: none;
  flex-direction: column;
  overflow: hidden;
  animation: dropIn .18s cubic-bezier(.4,0,.2,1);
}
.user-dropdown.open { display: flex; }

.user-dropdown-profile {
  padding: 16px;
  border-bottom: 1px solid var(--surface-2);
  display: flex; align-items: center; gap: 12px;
}
.user-dropdown-avatar {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--navy); display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 16px; font-weight: 700; flex-shrink: 0;
}
.user-dropdown-info { flex: 1; min-width: 0; }
.user-dropdown-name  { font-size: 14px; font-weight: 700; color: var(--navy); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-dropdown-email { font-size: 11px; color: var(--muted); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-dropdown-role  {
  margin-top: 6px;
  display: inline-flex; align-items: center; gap: 4px;
  background: hsl(220,60%,94%); color: var(--accent);
  font-size: 10px; font-weight: 600; padding: 2px 7px; border-radius: 4px;
}

.user-dropdown-menu { padding: 6px; }
.user-menu-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: var(--radius);
  font-size: 13px; font-weight: 500; color: var(--text);
  cursor: pointer; width: 100%; text-align: left;
  transition: background var(--transition), color var(--transition);
}
.user-menu-item:hover { background: var(--surface); }
.user-menu-item svg { width: 15px; height: 15px; color: var(--muted); flex-shrink: 0; }
.user-menu-item:hover svg { color: var(--accent); }
.user-menu-item.danger { color: var(--danger); }
.user-menu-item.danger svg { color: var(--danger); }
.user-menu-item.danger:hover { background: var(--danger-lt); }
.user-menu-item.danger:hover svg { color: var(--danger); }

.user-dropdown-divider { height: 1px; background: var(--surface-2); margin: 4px 6px; }

/* ── CHANGE PASSWORD MODAL ──────────────────────────────── */
#changePwdModal {
  display: none; position: fixed; inset: 0;
  background: rgba(10,18,40,.5); backdrop-filter: blur(3px);
  z-index: 900; align-items: center; justify-content: center;
}
#changePwdModal.open { display: flex; }

.pwd-modal-card {
  background: #fff; border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); padding: 28px;
  width: 420px; max-width: 95vw;
  animation: dropIn .22s cubic-bezier(.4,0,.2,1);
}
.pwd-modal-header {
  display: flex; align-items: center; gap: 10px; margin-bottom: 4px;
}
.pwd-modal-header h2 { font-size: 18px; font-weight: 700; color: var(--navy); }
.pwd-modal-header-icon {
  width: 34px; height: 34px; border-radius: 9px;
  background: hsl(220,60%,94%); color: var(--accent);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.pwd-modal-header-icon svg { width: 16px; height: 16px; }
.pwd-modal-sub { font-size: 12px; color: var(--muted); margin-bottom: 20px; }

.pwd-field { margin-bottom: 14px; }
.pwd-field label { display: block; font-size: 12px; font-weight: 600; color: var(--text); margin-bottom: 5px; }
.pwd-field-wrap { position: relative; }
.pwd-field input {
  width: 100%; padding: 9px 38px 9px 10px;
  border: 1px solid var(--border); border-radius: var(--radius);
  font-size: 13px; outline: none;
  transition: border-color var(--transition);
}
.pwd-field input:focus { border-color: var(--accent); }
.pwd-toggle {
  position: absolute; right: 8px; top: 50%;
  transform: translateY(-50%);
  color: var(--muted); padding: 2px; background: none; border: none; cursor: pointer;
  transition: color var(--transition);
}
.pwd-toggle:hover { color: var(--accent); }
.pwd-toggle svg { width: 15px; height: 15px; }

.pwd-strength { margin-top: 6px; }
.pwd-strength-bar {
  height: 3px; border-radius: 2px;
  background: var(--surface-2); overflow: hidden; margin-bottom: 4px;
}
.pwd-strength-fill {
  height: 100%; border-radius: 2px;
  transition: width .3s, background .3s;
  width: 0%;
}
.pwd-strength-txt { font-size: 10.5px; }

.pwd-modal-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 22px; }

/* ── MAIN SCROLL ────────────────────────────────────────── */
.main-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  min-height: 0;
}

/* ── PAGE HEADER ────────────────────────────────────────── */
.page-hdr {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; margin-bottom: 22px; flex-wrap: wrap;
}
.page-hdr h1 { font-size: 22px; font-weight: 700; color: var(--navy); line-height: 1.2; }
.page-hdr > div > p { font-size: 12px; color: var(--muted); margin-top: 3px; }
.page-hdr-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ── GRID LAYOUTS ───────────────────────────────────────── */
.g4 { display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; }
.g3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; }
.g2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.g21 { display: grid; grid-template-columns: 2fr 1fr; gap: 14px; }
.mt { margin-top: 14px; }
.mb { margin-bottom: 14px; }
.stk { display: flex; flex-direction: column; gap: 10px; }

/* ── CARDS ──────────────────────────────────────────────── */
.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.card-shine { position: relative; overflow: hidden; }
.card-shine::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--navy) 0%, var(--accent-lt) 100%);
}
.card-head {
  font-size: 13px; font-weight: 600; color: var(--navy);
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--surface-2);
}
.card-body { padding: 14px 16px; }

/* ── STAT CARDS ─────────────────────────────────────────── */
.stat-card {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px; gap: 12px;
}
.stat-label { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 4px; }
.stat-value { font-size: 28px; font-weight: 700; color: var(--navy); line-height: 1; }
.stat-sub { display: flex; align-items: center; gap: 4px; font-size: 11px; margin-top: 4px; }
.stat-sub svg { width: 11px; height: 11px; }
.stat-sub.up  { color: var(--success); }
.stat-sub.wn  { color: var(--warning); }
.stat-sub.dm  { color: var(--muted); }

/* stat icon */
.si { width: 38px; height: 38px; border-radius: 9px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.si svg { width: 18px; height: 18px; }
.si-g { background: var(--success-lt); color: var(--success); }
.si-b { background: hsl(220,60%,95%); color: var(--accent); }
.si-r { background: var(--danger-lt); color: var(--danger); }
.si-o { background: var(--warning-lt); color: var(--warning); }

/* ── BADGES ─────────────────────────────────────────────── */
.badge {
  font-size: 10px; font-weight: 600; padding: 2px 7px;
  border-radius: 4px; display: inline-flex; align-items: center; gap: 3px;
  white-space: nowrap;
}
.bg  { background: var(--success-lt); color: var(--success); }
.br  { background: var(--danger-lt);  color: var(--danger); }
.bw  { background: var(--warning-lt); color: hsl(38,70%,35%); }
.bm  { background: var(--surface-2);  color: var(--muted); }
.bscan { background: hsl(220,60%,94%); color: var(--accent); }
.bog { background: hsl(38,80%,93%); color: hsl(38,60%,40%); }

/* ── BUTTONS ────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  border-radius: var(--radius); font-weight: 600;
  padding: 9px 18px; font-size: 13px; cursor: pointer;
  border: none; text-decoration: none;
  transition: background var(--transition), border-color var(--transition), color var(--transition), box-shadow var(--transition);
}
.btn-sm { font-size: 12px; padding: 7px 12px; }
.btn-navy {
  background: var(--navy); color: #fff; border: 1px solid var(--navy);
}
.btn-navy:hover { background: var(--navy-mid); }
.btn-outline {
  background: #fff; color: var(--text);
  border: 1px solid var(--border);
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent); background: hsl(220,60%,97%); }
.btn-ghost { background: none; color: var(--accent); border: 1px solid transparent; }
.btn-ghost:hover { background: hsl(220,60%,97%); }
.btn-icon {
  width: 30px; height: 30px; border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); border: 1px solid var(--border);
  transition: background var(--transition), color var(--transition);
}
.btn-icon:hover { background: var(--surface); color: var(--text); }
.btn-icon svg { width: 13px; height: 13px; }

/* ── SCANNING BADGE ─────────────────────────────────────── */
.scanning-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: hsl(220,60%,94%); color: var(--accent);
  font-size: 11px; font-weight: 600; padding: 3px 9px;
  border-radius: 4px;
}
.dot-pulse {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent);
  animation: pulse 1.4s ease-in-out infinite;
  display: inline-block;
}
@keyframes pulse {
  0%,100% { opacity: 1; transform: scale(1); }
  50%      { opacity: .4; transform: scale(.7); }
}

/* ── CERT BAR ───────────────────────────────────────────── */
.cert-bar {
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
  padding: 10px 24px;
  background: #fff;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.cert-badge {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 600; color: var(--navy);
}
.cert-icon {
  width: 26px; height: 26px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
}
.cert-icon svg { width: 13px; height: 13px; }
.ci-8a { background: hsl(220,60%,94%); color: var(--accent); }
.ci-ed { background: hsl(0,70%,94%); color: var(--danger); }
.ci-fr { background: hsl(142,55%,92%); color: var(--success); }
.ci-us { background: hsl(38,80%,92%); color: var(--warning); }

/* ── PROGRESS BARS ──────────────────────────────────────── */
.progress-track {
  height: 6px; background: var(--surface-2);
  border-radius: 3px; overflow: hidden;
}
.progress-fill {
  height: 100%; background: var(--accent);
  border-radius: 3px; transition: width .4s;
}
.progress-fill.suc { background: var(--success); }

/* ── TOASTS ─────────────────────────────────────────────── */
#toastContainer {
  position: fixed; bottom: 24px; right: 24px;
  display: flex; flex-direction: column; gap: 8px;
  z-index: 1000; pointer-events: none;
}
.toast {
  background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 14px; min-width: 280px; max-width: 360px;
  pointer-events: all;
  animation: slideIn .3s cubic-bezier(.4,0,.2,1);
}
@keyframes slideIn {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}
.toast.warn   { border-left: 3px solid var(--warning); }
.toast.err    { border-left: 3px solid var(--danger); }
.toast.info   { border-left: 3px solid var(--accent); }
.toast-icon svg { width: 18px; height: 18px; flex-shrink: 0; }
.toast-body { flex: 1; }
.toast-title { font-size: 13px; font-weight: 700; color: var(--text); }
.toast-msg   { font-size: 11px; color: var(--muted); margin-top: 2px; }
.toast-time  { font-size: 10px; color: var(--muted); white-space: nowrap; flex-shrink: 0; margin-top: 1px; }

/* ── CHAT PANEL ─────────────────────────────────────────── */
/* FAB toggle button — fixed to bottom-right */
#chatToggle {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--navy);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-lg);
  z-index: 900;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
}
#chatToggle:hover {
  background: var(--navy-mid);
  transform: scale(1.06);
  box-shadow: 0 8px 24px rgba(0,0,0,.18);
}
#chatToggle svg { width: 20px; height: 20px; stroke: #fff; }

/* Floating panel — anchored to the same right edge as the FAB */
#chatPanel {
  position: fixed;
  bottom: 88px;
  right: 24px;
  width: 360px;
  max-height: 540px;
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 899;
  opacity: 0;
  transform: translateY(16px);
  pointer-events: none;
  transition: opacity .22s cubic-bezier(.4,0,.2,1),
              transform .22s cubic-bezier(.4,0,.2,1);
}
#chatPanel.open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: all;
}

.chat-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px; border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.chat-header-left { display: flex; align-items: center; gap: 9px; }
.chat-hicon {
  width: 32px; height: 32px; background: var(--navy); border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
}
.chat-hicon svg { width: 15px; height: 15px; stroke: #fff; }
.ctitle { font-size: 13px; font-weight: 700; color: var(--navy); }
.csub   { font-size: 10px; color: var(--muted); }
.chat-close { color: var(--muted); padding: 4px; border-radius: 4px; transition: background var(--transition), color var(--transition); }
.chat-close:hover { background: var(--surface); color: var(--text); }
.chat-close svg { width: 15px; height: 15px; }

#chatMessages {
  flex: 1; overflow-y: auto; padding: 14px;
  display: flex; flex-direction: column; gap: 10px;
}
.msg-ai, .msg-user {
  max-width: 88%; padding: 9px 12px;
  border-radius: 10px; font-size: 12.5px; line-height: 1.5;
}
.msg-ai   { background: var(--surface); color: var(--text); align-self: flex-start; border-bottom-left-radius: 2px; }
.msg-user { background: var(--navy); color: #fff; align-self: flex-end; border-bottom-right-radius: 2px; }

.chat-input-row {
  display: flex; gap: 8px; padding: 10px 12px;
  border-top: 1px solid var(--border); flex-shrink: 0;
}
.chat-input-row input {
  flex: 1; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 7px 10px; font-size: 12px; outline: none;
  transition: border-color var(--transition);
}
.chat-input-row input:focus { border-color: var(--accent); }
.chat-send {
  width: 34px; height: 34px; background: var(--navy); border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: background var(--transition);
}
.chat-send:hover { background: var(--navy-mid); }
.chat-send svg { width: 14px; height: 14px; stroke: #fff; }
.chat-cui-strip {
  font-size: 9.5px; color: var(--muted); text-align: center;
  padding: 5px 12px 8px;
  font-family: 'IBM Plex Mono', monospace; letter-spacing: .03em;
}

/* Responsive: full width on very narrow screens */
@media (max-width: 420px) {
  #chatPanel  { right: 12px; left: 12px; width: auto; }
  #chatToggle { right: 12px; }
}

/* ── MODAL ──────────────────────────────────────────────── */
#envModal {
  display: none; position: fixed; inset: 0;
  background: rgba(10,18,40,.5); backdrop-filter: blur(3px);
  z-index: 800; align-items: center; justify-content: center;
}
#envModal.open { display: flex; }
.modal-card {
  background: #fff; border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); padding: 28px;
  width: 520px; max-width: 95vw;
}
.modal-card h2 { font-size: 18px; font-weight: 700; color: var(--navy); }
.modal-sub { font-size: 12px; color: var(--muted); margin: 4px 0 18px; }
.form-row { margin-bottom: 14px; }
.form-row label { display: block; font-size: 12px; font-weight: 600; color: var(--text); margin-bottom: 5px; }
.form-row input[type="text"],
.form-row select {
  width: 100%; padding: 8px 10px; border: 1px solid var(--border);
  border-radius: var(--radius); font-size: 13px; outline: none;
  transition: border-color var(--transition);
}
.form-row input:focus, .form-row select:focus { border-color: var(--accent); }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }

.env-type-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.env-type-btn {
  border: 1.5px solid var(--border); border-radius: var(--radius);
  padding: 10px 6px; display: flex; flex-direction: column;
  align-items: center; gap: 6px; cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
}
.env-type-btn:hover { border-color: var(--accent); background: hsl(220,60%,97%); }
.env-type-btn.selected { border-color: var(--navy); background: hsl(220,55%,97%); }
.etb-icon { color: var(--navy); }
.etb-icon svg { width: 18px; height: 18px; }
.etb-label { font-size: 10px; font-weight: 600; color: var(--text); text-align: center; }

/* ── SCAN ROWS ──────────────────────────────────────────── */
.scan-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 0; border-bottom: 1px solid var(--surface-2);
}
.scan-row:last-child { border-bottom: none; }
.scan-left { display: flex; align-items: center; gap: 8px; }
.scan-env  { font-size: 12px; font-weight: 600; }
.scan-time { font-size: 10px; color: var(--muted); }
.scan-score { font-size: 13px; font-weight: 700; color: var(--success); }

/* ── FAMILY BARS ────────────────────────────────────────── */
.family-bar-row {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 7px;
}
.family-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px; font-weight: 600; width: 22px; color: var(--muted); flex-shrink: 0;
}
.family-bar-track {
  flex: 1; height: 8px; background: var(--surface-2);
  border-radius: 4px; overflow: hidden; display: flex;
}
.family-bar-pass { background: var(--success); height: 100%; }
.family-bar-fail { background: var(--danger); height: 100%; }
.family-bar-prog { background: var(--warning); height: 100%; }
.family-count { font-size: 10px; color: var(--muted); width: 32px; text-align: right; flex-shrink: 0; }

/* ── ENV CARDS ──────────────────────────────────────────── */
.env-card { padding: 16px; }
.env-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 12px; }
.env-left { display: flex; align-items: flex-start; gap: 12px; flex: 1; }
.env-icon {
  width: 38px; height: 38px; background: var(--navy);
  border-radius: 9px; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.env-icon svg { width: 18px; height: 18px; stroke: rgba(255,255,255,.85); }
.env-name { font-size: 14px; font-weight: 700; color: var(--navy); }
.env-desc { font-size: 12px; color: var(--muted); margin-top: 3px; }
.env-meta { display: flex; gap: 12px; font-size: 10.5px; color: var(--muted); margin-top: 5px; flex-wrap: wrap; }
.env-score { text-align: right; }
.env-score .val { font-size: 20px; font-weight: 700; color: var(--success); }
.env-score .lbl { font-size: 10px; color: var(--muted); }
.env-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.env-res { font-size: 11px; color: var(--muted); font-family: 'IBM Plex Mono', monospace; }
.env-actions { display: flex; align-items: center; gap: 6px; }

/* ── FINDING ROWS ───────────────────────────────────────── */
.finding-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--surface-2);
}
.finding-row:last-child { border-bottom: none; }
.finding-left { display: flex; align-items: flex-start; gap: 10px; flex: 1; }
.finding-ctrl {
  font-family: 'IBM Plex Mono', monospace; font-size: 11px; font-weight: 600;
  color: var(--navy); background: hsl(220,55%,96%); padding: 2px 6px;
  border-radius: 4px; flex-shrink: 0; margin-top: 1px;
}
.finding-text { font-size: 12px; font-weight: 500; }
.finding-env  { font-size: 10.5px; color: var(--muted); margin-top: 1px; }
.finding-right { flex-shrink: 0; }

/* ── POLICY CARDS ───────────────────────────────────────── */
.policy-card { padding: 16px; }
.policy-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.policy-left { display: flex; align-items: flex-start; gap: 11px; flex: 1; }
.policy-icon {
  width: 36px; height: 36px; border: 1.5px solid var(--border);
  border-radius: 8px; display: flex; align-items: center; justify-content: center;
  color: var(--navy); flex-shrink: 0;
}
.policy-icon svg { width: 17px; height: 17px; }
.policy-name { font-size: 13.5px; font-weight: 700; color: var(--navy); }
.policy-meta { font-size: 11px; color: var(--muted); margin-top: 2px; }
.policy-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.policy-stats { display: flex; gap: 14px; font-size: 11.5px; color: var(--muted); flex-wrap: wrap; }
.policy-stats strong { color: var(--text); }

/* ── COMPLIANCE STAT CARDS ──────────────────────────────── */
.compliance-stat-card { padding: 18px; }
.cl { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.cv { font-size: 32px; font-weight: 700; margin: 4px 0; }
.ci-sm { font-size: 11px; display: flex; align-items: center; gap: 4px; }
.ci-sm svg { width: 11px; height: 11px; }
.ci-sm.up { color: var(--success); }
.ci-sm.wn { color: var(--warning); }
.ci-sm.dm { color: var(--muted); }

/* ── ROADMAP TIMELINE ───────────────────────────────────── */
.tl-item { display: flex; gap: 16px; }
.tl-dot-col { display: flex; flex-direction: column; align-items: center; flex-shrink: 0; }
.tl-dot {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; z-index: 1;
}
.tl-dot svg { width: 14px; height: 14px; stroke: #fff; }
.tl-line { width: 2px; flex: 1; background: var(--border); margin: 4px 0; min-height: 20px; }
.tl-card { flex: 1; margin-bottom: 16px; }
.tl-card.current { border-left: 3px solid var(--warning); }
.ph-label {
  font-family: 'IBM Plex Mono', monospace; font-size: 11px;
  font-weight: 600; color: var(--navy);
}
.ph-weeks { font-size: 11px; color: var(--muted); }
.phase-budget {
  font-size: 11px; font-weight: 600; color: var(--success);
  background: var(--success-lt); padding: 1px 6px; border-radius: 4px;
}
.dep-tag { font-size: 10px; color: var(--muted); }
.ph-title { font-size: 15px; font-weight: 700; color: var(--navy); margin-bottom: 10px; }
.ph-items { list-style: none; display: flex; flex-direction: column; gap: 5px; padding: 0; }
.ph-items li {
  display: flex; align-items: flex-start; gap: 7px;
  font-size: 12px; color: var(--text);
}
.ph-items li svg { width: 13px; height: 13px; flex-shrink: 0; margin-top: 1px; }
.ph-items li svg.done { stroke: var(--success); }
.ph-items li svg.ip   { stroke: var(--warning); }
.ph-items li svg.up   { stroke: var(--muted); }
.accept-box {
  margin-top: 10px; padding: 9px 12px;
  background: hsl(220,55%,97%); border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 11.5px; color: var(--muted);
}
.accept-box strong { color: var(--navy); }

/* ── KNOWLEDGE BASE ─────────────────────────────────────── */
.kb-section {
  background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden; margin-bottom: 10px;
}
.kb-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; cursor: pointer;
  transition: background var(--transition);
}
.kb-header:hover { background: var(--surface); }
.kb-header.open  { background: var(--surface); border-bottom: 1px solid var(--border); }
.kb-header-left { display: flex; align-items: center; gap: 10px; }
.kb-header-icon {
  width: 30px; height: 30px; border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
}
.kb-header-icon svg { width: 14px; height: 14px; }
.kb-title { font-size: 13px; font-weight: 700; color: var(--navy); }
.kb-count { font-size: 11px; color: var(--muted); }
.kb-chevron { width: 16px; height: 16px; transition: transform var(--transition); }
.kb-chevron.open { transform: rotate(180deg); }
.kb-body { display: none; padding: 0 16px; }
.kb-body.open { display: block; }
.kb-qa { padding: 12px 0; border-bottom: 1px solid var(--surface-2); }
.kb-qa:last-child { border-bottom: none; }
.kb-q { font-size: 13px; font-weight: 600; color: var(--navy); margin-bottom: 5px; }
.kb-a { font-size: 12px; color: var(--muted); line-height: 1.6; }

/* ── RESPONSIVE ─────────────────────────────────────────── */
@media (max-width: 900px) {
  .g4 { grid-template-columns: repeat(2,1fr); }
  .g3 { grid-template-columns: repeat(2,1fr); }
  .g21, .g2 { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .notif-dropdown { width: 300px; }
}
@media (max-width: 600px) {
  .g4, .g3 { grid-template-columns: 1fr; }
  .main-scroll { padding: 14px; }
  .env-type-grid { grid-template-columns: repeat(3,1fr); }
  .notif-dropdown { right: -60px; width: 90vw; }
  .user-dropdown { width: 220px; }
}

/* ── PROFILE MODAL ──────────────────────────────────────── */
#profileModal {
  display: none; position: fixed; inset: 0;
  background: rgba(10,18,40,.5); backdrop-filter: blur(3px);
  z-index: 900; align-items: center; justify-content: center;
  padding: 16px;
}
#profileModal.open { display: flex; }

.profile-modal-card {
  background: #fff; border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 600px; max-width: 100%; max-height: 92vh;
  display: flex; flex-direction: column;
  animation: dropIn .22s cubic-bezier(.4,0,.2,1);
  overflow: hidden;
}

.profile-modal-hdr {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 20px 24px 16px; border-bottom: 1px solid var(--surface-2);
  flex-shrink: 0; gap: 12px;
}
.profile-modal-hdr-left { display: flex; align-items: center; gap: 12px; }
.profile-modal-hdr-icon {
  width: 38px; height: 38px; border-radius: 10px;
  background: hsl(220,60%,94%); color: var(--accent);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.profile-modal-hdr-icon svg { width: 18px; height: 18px; }
.profile-modal-hdr h2  { font-size: 17px; font-weight: 700; color: var(--navy); line-height: 1.2; }
.profile-modal-sub     { font-size: 11px; color: var(--muted); margin-top: 2px;
                          font-family: 'IBM Plex Mono', monospace; letter-spacing: .04em; }
.profile-modal-close {
  color: var(--muted); padding: 4px; border-radius: 6px; flex-shrink: 0;
  transition: background var(--transition), color var(--transition);
}
.profile-modal-close:hover { background: var(--surface); color: var(--text); }
.profile-modal-close svg { width: 16px; height: 16px; }

/* Photo + identity strip */
.profile-photo-row {
  display: flex; align-items: center; gap: 18px;
  padding: 18px 24px; border-bottom: 1px solid var(--surface-2);
  flex-shrink: 0; background: var(--surface);
}
.profile-photo-wrap { position: relative; flex-shrink: 0; }
.profile-photo-avatar {
  width: 72px; height: 72px; border-radius: 50%;
  background: var(--navy); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 700;
  border: 3px solid #fff; box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.profile-photo-btn {
  position: absolute; bottom: 0; right: 0;
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--navy); color: #fff;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid #fff;
  transition: background var(--transition);
}
.profile-photo-btn:hover { background: var(--accent); }
.profile-photo-btn svg { width: 11px; height: 11px; }

.profile-identity { flex: 1; min-width: 0; }
.profile-identity-name  { font-size: 18px; font-weight: 700; color: var(--navy); line-height: 1.2; }
.profile-identity-email { font-size: 12px; color: var(--muted); margin-top: 3px; }
.profile-identity-badges { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }

/* Scrollable form area */
.profile-form {
  flex: 1; overflow-y: auto; padding: 20px 24px;
  display: flex; flex-direction: column; gap: 0;
}
.profile-form-row {
  margin-bottom: 14px;
}
.profile-form-row.two-col {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
}

.profile-field { display: flex; flex-direction: column; }
.profile-field label {
  font-size: 12px; font-weight: 600; color: var(--text);
  margin-bottom: 5px; display: flex; align-items: center; gap: 6px;
}
.profile-field-readonly-tag {
  font-size: 10px; font-weight: 500; color: var(--muted);
  background: var(--surface-2); padding: 1px 5px; border-radius: 3px;
}
.profile-field input,
.profile-field textarea {
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 8px 10px; font-size: 13px; outline: none;
  transition: border-color var(--transition);
  font-family: inherit;
  resize: vertical;
}
.profile-field input:focus,
.profile-field textarea:focus { border-color: var(--accent); }
.profile-field input.readonly-field,
.profile-field textarea.readonly-field {
  background: var(--surface); color: var(--muted); cursor: default;
}

/* Footer */
.profile-modal-foot {
  display: flex; justify-content: flex-end; gap: 8px;
  padding: 14px 24px; border-top: 1px solid var(--surface-2);
  flex-shrink: 0; background: #fff;
}

@media (max-width: 600px) {
  .profile-modal-card { width: 100%; border-radius: var(--radius); }
  .profile-form-row.two-col { grid-template-columns: 1fr; }
}


/* ── Logo / Brand sidebar styles ─────────────────────────── */
.sb-brand {
  padding: 10px 8px;
  text-align: center;
  justify-content: center;
}
.sb-brand img {
  width: 80px;
  display: block;
  margin: 0 auto;
}
.sidebar.collapsed img {
  width: 32px;
}
.sidebar.collapsed .nav-item {
  align-items: center;
  justify-content: center;
}

/* ── Button base padding fix (popup / modal buttons) ─────── */
.modal-foot .btn,
.upload-foot .btn,
.fm-footer .btn,
.terminal-foot .btn,
[style*="modal"] .btn {
  padding: 8px 18px;
  font-size: 12.5px;
  cursor: pointer;
}
 