:root {
  --bg: #0e0f0d;
  --surface: #161714;
  --surface2: #1e1f1c;
  --surface3: #252620;
  --border: rgba(255,255,255,0.07);
  --border2: rgba(255,255,255,0.12);
  --text: #f0ede6;
  --text2: #9a9890;
  --text3: #5a5855;
  --accent: #c8b560;
  --accent2: #8fad5a;
  --red: #c45c4a;
  --amber: #c4954a;
  --green: #5a9a6e;
  --blue: #4a7fc4;
  --radius: 12px;
  --radius-sm: 8px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
}

/* ── AUTH SCREENS ── */
.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.auth-left {
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 3rem;
  position: relative;
  overflow: hidden;
}
.auth-left::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 20% 80%, rgba(200,181,96,0.08) 0%, transparent 60%),
              radial-gradient(ellipse at 80% 20%, rgba(143,173,90,0.06) 0%, transparent 50%);
  pointer-events: none;
}
.auth-logo { display: flex; align-items: center; gap: 10px; z-index: 1; }
.auth-logo-mark {
  width: 40px; height: 46px;
  background: none;
  border-radius: 0;
  display: flex; align-items: center; justify-content: center;
}
.auth-logo-name {
  font-family: 'Instrument Serif', serif;
  font-size: 22px;
  color: var(--text);
  letter-spacing: -0.02em;
}
.auth-hero { z-index: 1; }
.auth-hero h2 {
  font-family: 'Instrument Serif', serif;
  font-size: 42px;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--text);
  margin-bottom: 1rem;
}
.auth-hero h2 em { color: var(--accent); font-style: italic; }
.auth-hero p { color: var(--text2); font-size: 15px; line-height: 1.7; max-width: 360px; }
.auth-features { display: flex; flex-direction: column; gap: 12px; z-index: 1; }
.auth-feature { display: flex; align-items: center; gap: 10px; color: var(--text2); font-size: 13px; }
.auth-feature-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); flex-shrink: 0; }

.auth-right {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  background: var(--bg);
}
.auth-form-box { width: 100%; max-width: 380px; }
.auth-form-box h3 {
  font-family: 'Instrument Serif', serif;
  font-size: 28px;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
  color: var(--text);
}
.auth-form-box p { color: var(--text2); font-size: 13px; margin-bottom: 2rem; }
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-size: 12px; color: var(--text2); margin-bottom: 6px; letter-spacing: 0.05em; text-transform: uppercase; }
.form-group input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  color: var(--text);
  font-size: 14px;
  font-family: 'DM Sans', sans-serif;
  outline: none;
  transition: border-color 0.15s;
}
.form-group input:focus { border-color: var(--accent); }
.form-group input::placeholder { color: var(--text3); }
.auth-btn {
  width: 100%;
  padding: 12px;
  background: var(--accent);
  color: #1a1800;
  border: none;
  border-radius: var(--radius-sm);
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
  margin-top: 0.5rem;
}
.auth-btn:hover { opacity: 0.9; }
.auth-btn:active { transform: scale(0.99); }
.auth-switch { text-align: center; margin-top: 1.5rem; color: var(--text2); font-size: 13px; }
.auth-switch a { color: var(--accent); cursor: pointer; text-decoration: none; }
.auth-switch a:hover { text-decoration: underline; }
.auth-error { background: rgba(196,92,74,0.15); border: 1px solid rgba(196,92,74,0.3); color: #e89080; border-radius: var(--radius-sm); padding: 10px 14px; font-size: 13px; margin-bottom: 1rem; display: none; }
.auth-divider {
  display: flex; align-items: center; gap: 12px; margin: 1.25rem 0;
  color: var(--text3); font-size: 12px;
}
.auth-divider::before, .auth-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border2);
}
.google-btn {
  width: 100%; padding: 11px 16px;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  background: var(--surface); border: 1px solid var(--border2);
  border-radius: var(--radius-sm); color: var(--text);
  font-family: 'DM Sans', sans-serif; font-size: 14px; font-weight: 500;
  cursor: pointer; transition: all 0.15s;
}
.google-btn:hover { background: var(--surface2); border-color: var(--text3); }

/* ── TOPBAR ── */
.topbar {
  height: 56px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 2rem;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 100;
}
.topbar-logo { display: flex; align-items: center; gap: 8px; text-decoration: none; }
.topbar-logo-mark {
  width: 28px; height: 32px;
  background: none;
  border-radius: 0;
  display: flex; align-items: center; justify-content: center;
}
.topbar-logo-name {
  font-family: 'Instrument Serif', serif;
  font-size: 18px;
  letter-spacing: -0.02em;
  color: var(--text);
}
.topbar-divider { width: 1px; height: 20px; background: var(--border2); }
.topbar-nav { display: flex; gap: 4px; flex: 1; align-items: center; }
.topbar-nav-btn {
  padding: 5px 14px;
  border-radius: 6px;
  background: none;
  border: none;
  color: var(--text2);
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}
.topbar-nav-btn:hover { background: var(--surface2); color: var(--text); }
.topbar-nav-btn.active { background: var(--surface2); color: var(--text); }
.topbar-right { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.topbar-user { display: flex; align-items: center; gap: 8px; }
.user-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: #059669;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
  font-weight: 500;
  color: #ffffff;
}
.user-name { font-size: 13px; color: var(--text2); }

/* ── MAIN CONTENT ── */
.main { flex: 1; padding: 2rem; max-width: 1100px; margin: 0 auto; width: 100%; }

/* ── PAGE HEADER ── */
.page-header { margin-bottom: 2rem; }
.page-header h1 {
  font-family: 'Instrument Serif', serif;
  font-size: 32px;
  letter-spacing: -0.03em;
  color: var(--text);
  margin-bottom: 4px;
}
.page-header p { color: var(--text2); font-size: 14px; }

/* ── DASHBOARD ── */
.dash-top-row { display: flex; gap: 1rem; margin-bottom: 2rem; align-items: stretch; }
.dash-top-row .readiness-card { margin-bottom: 0; }
.dash-grades {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1rem 1.25rem;
  min-width: 180px; display: flex; flex-direction: column; gap: 6px;
}
.dash-grade-title { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text3); margin-bottom: 2px; }
.dash-grade-item { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.dash-grade-icon { font-size: 14px; }
.dash-grade-label { flex: 1; color: var(--text2); }
.dash-grade-score { font-weight: 500; font-size: 12px; }

/* ── GDACS BANNER ── */
.gdacs-banner {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; margin-bottom: 1.5rem;
}
.gdacs-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px; border-bottom: 1px solid var(--border);
  background: var(--surface2);
}
.gdacs-title { font-size: 12px; font-weight: 500; color: var(--text); letter-spacing: 0.02em; }
.gdacs-source { font-size: 11px; color: var(--accent); text-decoration: none; }
.gdacs-source:hover { text-decoration: underline; }
.gdacs-list { display: flex; flex-direction: column; }
.gdacs-item {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 16px; border-bottom: 1px solid var(--border);
  text-decoration: none; transition: background 0.12s;
}
.gdacs-item:last-child { border-bottom: none; }
.gdacs-item:hover { background: var(--surface2); }
.gdacs-dot { font-size: 8px; flex-shrink: 0; }
.gdacs-icon { font-size: 14px; flex-shrink: 0; }
.gdacs-item-type { font-size: 11px; font-weight: 500; min-width: 100px; flex-shrink: 0; }
.gdacs-item-title { font-size: 12px; color: var(--text2); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gdacs-item-date { font-size: 11px; color: var(--text3); flex-shrink: 0; }

.dash-alert {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-radius: var(--radius-sm);
  margin-bottom: 6px; text-decoration: none; transition: all 0.15s;
}
.dash-alert:hover { filter: brightness(1.1); }
.dash-alert-critical { background: rgba(196,92,74,0.1); border: 1px solid rgba(196,92,74,0.25); }
.dash-alert-warning  { background: rgba(196,149,74,0.1); border: 1px solid rgba(196,149,74,0.25); }
.dash-alert-info     { background: rgba(74,127,196,0.1); border: 1px solid rgba(74,127,196,0.25); }
.dash-alert-icon { font-size: 16px; flex-shrink: 0; }
.dash-alert-text { flex: 1; font-size: 13px; color: var(--text); }
.dash-alert-critical .dash-alert-text { color: #e89080; }
.dash-alert-warning .dash-alert-text  { color: #e0ad70; }
.dash-alert-info .dash-alert-text     { color: #80b0e0; }
.dash-alert-arrow { color: var(--text3); font-size: 14px; }

@media (max-width: 900px) {
  .dash-top-row { flex-direction: column; }
}

.metrics-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 2rem; }
.metric-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  transition: border-color 0.2s;
}
.metric-card:hover { border-color: var(--border2); }
.metric-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text3); margin-bottom: 8px; }
.metric-value { font-size: 28px; font-weight: 300; color: var(--text); line-height: 1; }
.metric-value.danger { color: var(--red); }
.metric-value.warning { color: var(--amber); }
.metric-value.success { color: var(--green); }
.metric-sub { font-size: 12px; color: var(--text3); margin-top: 6px; }

/* readiness ring */
.readiness-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 2rem;
}
.ring-wrap { position: relative; width: 80px; height: 80px; flex-shrink: 0; }
.ring-wrap svg { transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: var(--surface3); stroke-width: 7; }
.ring-fill { fill: none; stroke-width: 7; stroke-linecap: round; transition: stroke-dashoffset 0.6s ease; }
.ring-text { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 16px; font-weight: 500; }
.readiness-info h3 { font-family: 'Instrument Serif', serif; font-size: 20px; letter-spacing: -0.02em; margin-bottom: 4px; }
.readiness-info p { color: var(--text2); font-size: 13px; }

/* two col layout */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 2rem; }
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
}
.panel-title { font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text3); margin-bottom: 1rem; }
.mini-item { display: flex; align-items: center; gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--border); }
.mini-item:last-child { border-bottom: none; }
.mini-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.mini-name { flex: 1; font-size: 13px; }
.mini-badge { font-size: 11px; padding: 2px 7px; border-radius: 4px; }
.b-danger { background: rgba(196,92,74,0.15); color: #e89080; }
.b-warn { background: rgba(196,149,74,0.15); color: #e0ad70; }
.b-ok { background: rgba(90,154,110,0.15); color: #80cc9a; }
.b-none { background: var(--surface2); color: var(--text3); }

.cat-bar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.cat-bar-label { font-size: 12px; color: var(--text2); width: 90px; flex-shrink: 0; }
.cat-bar-track { flex: 1; height: 4px; background: var(--surface3); border-radius: 2px; overflow: hidden; }
.cat-bar-fill { height: 100%; border-radius: 2px; transition: width 0.5s ease; }
.cat-bar-val { font-size: 12px; color: var(--text3); min-width: 24px; text-align: right; }

/* ── INVENTORY ── */
.inv-toolbar { display: flex; gap: 10px; margin-bottom: 1.25rem; flex-wrap: wrap; align-items: center; }
.search-wrap { position: relative; flex: 1; min-width: 200px; }
.search-wrap input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 14px 9px 36px;
  color: var(--text);
  font-size: 13px;
  font-family: 'DM Sans', sans-serif;
  outline: none;
  transition: border-color 0.15s;
}
.search-wrap input:focus { border-color: var(--border2); }
.search-wrap::before {
  content: '⌕';
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text3);
  font-size: 16px;
  pointer-events: none;
}
.inv-select {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  color: var(--text2);
  font-size: 13px;
  font-family: 'DM Sans', sans-serif;
  outline: none;
  cursor: pointer;
}
.add-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 9px 16px;
  background: var(--accent);
  color: #1a1800;
  border: none;
  border-radius: var(--radius-sm);
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.15s;
  white-space: nowrap;
}
.add-btn:hover { opacity: 0.88; }

.inv-table {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.inv-thead {
  display: grid;
  grid-template-columns: 2fr 1fr 80px 80px 130px 80px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text3);
}
.inv-row {
  display: grid;
  grid-template-columns: 2fr 1fr 80px 80px 130px 80px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  align-items: center;
  transition: background 0.1s;
}
.inv-row:last-child { border-bottom: none; }
.inv-row:hover { background: var(--surface2); }
.inv-name-cell { display: flex; align-items: center; gap: 10px; }
.inv-cat-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.inv-name { font-size: 13px; color: var(--text); }
.inv-notes { font-size: 11px; color: var(--text3); margin-top: 1px; }
.inv-cat { font-size: 12px; color: var(--text2); }
.inv-qty { font-size: 13px; }
.inv-exp { font-size: 12px; }
.inv-actions { display: flex; gap: 4px; justify-content: flex-end; }
.action-btn {
  width: 28px; height: 28px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: none;
  color: var(--text3);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  transition: all 0.15s;
}
.action-btn:hover { border-color: var(--border2); color: var(--text); background: var(--surface2); }
.action-btn.del:hover { border-color: var(--red); color: var(--red); }
.empty-state { padding: 3rem; text-align: center; color: var(--text3); font-size: 14px; }

/* expiry badges */
.exp-badge { font-size: 11px; padding: 2px 8px; border-radius: 4px; white-space: nowrap; }
.exp-expired { background: rgba(196,92,74,0.15); color: #e89080; }
.exp-soon { background: rgba(196,149,74,0.15); color: #e0ad70; }
.exp-ok { background: rgba(90,154,110,0.15); color: #80cc9a; }
.exp-none { background: var(--surface3); color: var(--text3); }

/* ── MODAL ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal-overlay.open { display: flex; }
.modal-box {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  padding: 2rem;
  width: 100%;
  max-width: 460px;
  animation: modalIn 0.2s ease;
}
@keyframes modalIn { from { opacity: 0; transform: translateY(12px) scale(0.98); } to { opacity: 1; transform: none; } }
.modal-box h3 { font-family: 'Instrument Serif', serif; font-size: 22px; letter-spacing: -0.02em; margin-bottom: 1.5rem; }
.modal-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.modal-form-group { margin-bottom: 14px; }
.modal-form-group label { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text3); margin-bottom: 6px; }
.modal-form-group input, .modal-form-group select {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  color: var(--text);
  font-size: 13px;
  font-family: 'DM Sans', sans-serif;
  outline: none;
  transition: border-color 0.15s;
}
.modal-form-group input:focus, .modal-form-group select:focus { border-color: var(--accent); }
.modal-form-group select option { background: var(--surface2); }
.modal-footer { display: flex; gap: 8px; justify-content: flex-end; margin-top: 1.5rem; }
.modal-cancel {
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border2);
  background: none;
  color: var(--text2);
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
}
.modal-cancel:hover { border-color: var(--border2); color: var(--text); }
.modal-save {
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  border: none;
  background: var(--accent);
  color: #1a1800;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.15s;
}
.modal-save:hover { opacity: 0.88; }

/* ── SUGGESTIONS ── */
.sug-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.sug-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  transition: border-color 0.2s;
  position: relative;
}
.sug-card:hover { border-color: var(--border2); }
.sug-card.high { border-top: 2px solid var(--red); }
.sug-card.medium { border-top: 2px solid var(--amber); }
.sug-card.low { border-top: 2px solid var(--green); }
.sug-priority { font-size: 10px; text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 8px; }
.sug-priority.high { color: #e89080; }
.sug-priority.medium { color: #e0ad70; }
.sug-priority.low { color: #80cc9a; }
.sug-name { font-size: 14px; font-weight: 500; margin-bottom: 4px; }
.sug-reason { font-size: 12px; color: var(--text2); line-height: 1.5; margin-bottom: 10px; }
.sug-footer { display: flex; align-items: center; justify-content: space-between; }
.sug-cat { font-size: 11px; color: var(--text3); }
.sug-add {
  padding: 4px 12px;
  border-radius: 6px;
  border: 1px solid var(--border2);
  background: none;
  color: var(--text2);
  font-size: 12px;
  font-family: 'DM Sans', sans-serif;
  cursor: pointer;
  transition: all 0.15s;
}
.sug-add:hover { border-color: var(--accent); color: var(--accent); }
.ai-loading { display: flex; align-items: center; gap: 12px; color: var(--text2); padding: 2rem 0; font-size: 14px; }
.spinner { width: 18px; height: 18px; border: 2px solid var(--border2); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.reload-btn {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border2);
  background: none;
  color: var(--text2);
  font-size: 13px;
  font-family: 'DM Sans', sans-serif;
  cursor: pointer;
  transition: all 0.15s;
  margin-bottom: 1.5rem;
}
.reload-btn:hover { border-color: var(--accent); color: var(--accent); }

/* section header */
.sec-header { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 1rem; }
.sec-title { font-family: 'Instrument Serif', serif; font-size: 18px; letter-spacing: -0.02em; color: var(--text); }
.sec-count { font-size: 12px; color: var(--text3); }

/* fade in */
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.fadein { animation: fadeUp 0.25s ease forwards; }

/* ── LIGHT MODE ── */
[data-theme="light"] {
  --bg: #f4f2ec;
  --surface: #ffffff;
  --surface2: #eceae3;
  --surface3: #e0ddd5;
  --border: rgba(0,0,0,0.09);
  --border2: rgba(0,0,0,0.15);
  --text: #1c1a17;
  --text2: #5a5855;
  --text3: #9a9890;
}

/* ── NAV DROPDOWN (Threat Profile) ── */
.nav-dd-wrap { position: relative; }
.nav-dd-btn::after { content: ' ▾'; font-size: 9px; opacity: 0.6; }
.nav-dd-menu {
  display: none; position: absolute; top: calc(100% + 6px); left: 0;
  background: var(--surface); border: 1px solid var(--border2);
  border-radius: var(--radius); min-width: 180px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.22); z-index: 300; overflow: hidden;
}
.nav-dd-wrap.open .nav-dd-menu { display: block; }
.nav-dd-item {
  display: block; width: 100%; padding: 10px 16px;
  background: none; border: none; color: var(--text2);
  font-size: 13px; font-family: 'DM Sans', sans-serif;
  text-align: left; cursor: pointer; transition: all 0.12s; white-space: nowrap;
  text-decoration: none;
}
.nav-dd-item:hover { background: var(--surface2); color: var(--text); }
.nav-dd-divider { height: 1px; background: var(--border); }

/* ── AI WARNING ── */
.ai-warning {
  display: none;
  background: rgba(196,92,74,0.15);
  border: 1px solid rgba(196,92,74,0.4);
  color: #e89080;
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  text-align: center;
  margin-bottom: 1.25rem;
  animation: warningPulse 1.2s ease-in-out infinite;
}
.ai-warning.visible { display: block; }
@keyframes warningPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ── GRADES ── */
.grades-row {
  display: grid; grid-template-columns: repeat(5, 1fr);
  gap: 14px; margin-bottom: 2rem;
}
.grade-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.25rem 1.5rem;
}
.grade-card-header {
  display: flex; align-items: center; gap: 8px; margin-bottom: 12px;
}
.grade-icon { font-size: 18px; }
.grade-title {
  font-family: 'Instrument Serif', serif; font-size: 16px;
  letter-spacing: -0.01em; color: var(--text);
}
.grade-ring-row { display: flex; align-items: center; gap: 14px; margin-bottom: 10px; }
.grade-score { font-size: 32px; font-weight: 300; line-height: 1; }
.grade-of { font-size: 14px; color: var(--text3); }
.grade-bar-wrap { flex: 1; }
.grade-bar-track {
  height: 8px; background: var(--surface3); border-radius: 4px;
  overflow: hidden; margin-bottom: 6px;
}
.grade-bar-fill { height: 100%; border-radius: 4px; transition: width 0.5s ease; }
.grade-label { font-size: 12px; font-weight: 500; }
.grade-summary { font-size: 12px; color: var(--text2); line-height: 1.6; }

@media (max-width: 900px) {
  .grades-row { grid-template-columns: 1fr; }
}

/* ── RISK EVALUATION ── */
.riskeval-date {
  font-size: 12px; color: var(--text3); margin-bottom: 1rem;
  padding: 8px 14px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  display: inline-block;
}
.riskeval-overview {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.5rem 1.75rem;
  margin-bottom: 2rem;
}
.riskeval-overall-label {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text3); margin-bottom: 10px;
}
.riskeval-overall-row { display: flex; align-items: center; gap: 12px; margin-bottom: 1rem; }
.riskeval-overall-badge {
  font-size: 13px; font-weight: 500; padding: 5px 14px;
  border-radius: 6px; text-transform: capitalize;
}
.riskeval-summary-text { font-size: 14px; color: var(--text2); line-height: 1.7; }
.risk-group-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px; margin-bottom: 2rem;
}
.risk-group-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.25rem 1.5rem;
  display: flex; flex-direction: column; gap: 10px;
  border-left: 3px solid var(--border2); transition: border-color 0.2s;
}
.risk-group-card.rg-high   { border-left-color: var(--red); }
.risk-group-card.rg-medium { border-left-color: var(--amber); }
.risk-group-card.rg-low    { border-left-color: var(--green); }
.risk-group-header { display: flex; align-items: center; gap: 10px; }
.risk-group-icon { font-size: 20px; flex-shrink: 0; line-height: 1; }
.risk-group-name { font-size: 14px; font-weight: 500; color: var(--text); flex: 1; }
.risk-group-threats { display: flex; flex-wrap: wrap; gap: 6px; }
.threat-chip {
  font-size: 11px; padding: 2px 8px; border-radius: 4px;
  background: var(--surface2); color: var(--text2); border: 1px solid var(--border);
}
.risk-group-summary { font-size: 12px; color: var(--text2); line-height: 1.6; }
.risk-group-actions { border-top: 1px solid var(--border); padding-top: 10px; }
.risk-group-actions-title {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text3); margin-bottom: 6px;
}
.risk-action-item { font-size: 12px; color: var(--text2); padding: 3px 0; line-height: 1.5; }
.risk-action-item::before { content: '→ '; color: var(--accent); }
.top-priorities-section { margin-top: 0.5rem; }
.priority-list { display: flex; flex-direction: column; gap: 8px; margin-top: 1rem; }
.priority-item { display: flex; align-items: flex-start; gap: 12px; }
.priority-num {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--accent); color: #1a1800;
  font-size: 11px; font-weight: 600; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.priority-text { font-size: 13px; color: var(--text2); line-height: 1.6; padding-top: 3px; }

/* ── USER DROPDOWN ── */
.user-menu-wrap { position: relative; }
.topbar-user { cursor: pointer; user-select: none; }
.user-chevron { font-size: 10px; color: var(--text3); margin-left: 2px; transition: transform 0.15s; }
.user-menu-wrap.open .user-chevron { transform: rotate(180deg); }
.user-dropdown {
  display: none; position: absolute; top: calc(100% + 10px); right: 0;
  background: var(--surface); border: 1px solid var(--border2);
  border-radius: var(--radius); min-width: 160px;
  box-shadow: 0 8px 28px rgba(0,0,0,0.25); z-index: 300;
  overflow: hidden;
}
.user-menu-wrap.open .user-dropdown { display: block; }
.user-dd-item {
  display: flex; align-items: center; gap: 9px;
  width: 100%; padding: 10px 14px;
  background: none; border: none; color: var(--text2);
  font-size: 13px; font-family: 'DM Sans', sans-serif;
  text-align: left; cursor: pointer; transition: all 0.12s;
  text-decoration: none;
}
.user-dd-item:hover { background: var(--surface2); color: var(--text); }
.user-dd-item.danger { color: var(--red); }
.user-dd-item.danger:hover { background: rgba(196,92,74,0.1); }
.user-dd-divider { height: 1px; background: var(--border); }

/* ── SETTINGS ── */
.settings-stack { display: flex; flex-direction: column; gap: 1.25rem; max-width: 540px; }
.settings-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.5rem;
}
.settings-card.danger-zone { border-color: rgba(196,92,74,0.35); }
.settings-card-title {
  font-family: 'Instrument Serif', serif; font-size: 16px;
  letter-spacing: -0.01em; margin-bottom: 1.25rem;
  padding-bottom: 0.75rem; border-bottom: 1px solid var(--border);
}
.settings-card .form-group { margin-bottom: 1rem; }
.settings-msg { font-size: 12px; min-height: 14px; margin-bottom: 0.75rem; display: none; }
.settings-msg.ok  { color: var(--green); display: block; }
.settings-msg.err { color: var(--red);   display: block; }
.settings-btn {
  padding: 9px 18px; border-radius: var(--radius-sm); border: none;
  background: var(--accent); color: #1a1800;
  font-family: 'DM Sans', sans-serif; font-size: 13px; font-weight: 500;
  cursor: pointer; transition: opacity 0.15s;
}
.settings-btn:hover { opacity: 0.88; }
.settings-btn.danger { background: var(--red); color: #fff; }
.settings-card p { font-size: 13px; color: var(--text2); line-height: 1.6; }
.theme-toggle { display: flex; gap: 10px; }
.theme-opt {
  flex: 1; max-width: 140px; padding: 10px 14px;
  border-radius: var(--radius-sm); border: 1px solid var(--border2);
  background: none; color: var(--text2);
  font-family: 'DM Sans', sans-serif; font-size: 13px;
  cursor: pointer; transition: all 0.15s; text-align: center;
}
.theme-opt:hover { border-color: var(--accent); color: var(--text); }
.theme-opt.active { background: var(--surface2); border-color: var(--accent); color: var(--text); }

/* ── ROLE BADGE ── */
.role-badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 500; padding: 4px 10px;
  border-radius: 6px; text-transform: capitalize;
}
.role-badge.admin {
  background: rgba(200,181,96,0.15); color: var(--accent);
  border: 1px solid rgba(200,181,96,0.3);
}
.role-badge.user {
  background: var(--surface2); color: var(--text2);
  border: 1px solid var(--border2);
}
.role-badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ── THREATS ── */
.threat-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 1.5rem; flex-wrap: wrap; }
.threat-filter-row { display: flex; gap: 6px; flex: 1; flex-wrap: wrap; }
.threat-filter-btn {
  padding: 5px 12px; border-radius: 6px; border: 1px solid var(--border);
  background: none; color: var(--text2); font-size: 12px;
  font-family: 'DM Sans', sans-serif; cursor: pointer;
  transition: all 0.15s; white-space: nowrap;
}
.threat-filter-btn:hover { border-color: var(--border2); color: var(--text); }
.threat-filter-btn.active { background: var(--surface2); color: var(--text); border-color: var(--border2); }
.threat-section { margin-bottom: 2rem; }
.threat-section-header {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 1rem; padding-bottom: 8px; border-bottom: 1px solid var(--border);
}
.threat-cat-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.threat-cat-name { font-size: 13px; font-weight: 500; color: var(--text); }
.threat-cat-count { font-size: 11px; color: var(--text3); margin-left: auto; }
.threat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.threat-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1rem 1.25rem;
  transition: border-color 0.2s; display: flex; flex-direction: column; gap: 6px;
}
.threat-card:hover { border-color: var(--border2); }
.threat-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.threat-card-name { font-size: 13px; font-weight: 500; color: var(--text); line-height: 1.4; }
.risk-badge {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em;
  padding: 2px 7px; border-radius: 4px; flex-shrink: 0; font-weight: 500;
}
.risk-badge.high  { background: rgba(196,92,74,0.15);  color: #e89080; }
.risk-badge.medium{ background: rgba(196,149,74,0.15); color: #e0ad70; }
.risk-badge.low   { background: rgba(90,154,110,0.15); color: #80cc9a; }
.threat-card-notes { font-size: 12px; color: var(--text3); line-height: 1.4; }
.threat-card-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 4px; }
.threat-card-cat { font-size: 11px; color: var(--text3); }
.threat-card-actions { display: flex; gap: 4px; }

/* Library modal */
.lib-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.7); z-index: 200;
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(4px); opacity: 0; pointer-events: none; transition: opacity 0.2s;
}
.lib-overlay.open { opacity: 1; pointer-events: all; }
.lib-box {
  background: var(--surface); border: 1px solid var(--border2);
  border-radius: var(--radius); width: 90%; max-width: 640px;
  max-height: 82vh; display: flex; flex-direction: column; overflow: hidden;
}
.lib-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.lib-header h3 { font-family: 'Instrument Serif', serif; font-size: 20px; letter-spacing: -0.02em; }
.lib-close { background: none; border: none; color: var(--text3); font-size: 18px; cursor: pointer; padding: 4px; transition: color 0.15s; }
.lib-close:hover { color: var(--text); }
.lib-body { overflow-y: auto; padding: 1.5rem; flex: 1; }
.lib-cat-section { margin-bottom: 1.5rem; }
.lib-cat-header {
  display: flex; align-items: center; gap: 8px; margin-bottom: 8px;
  font-size: 11px; font-weight: 500; text-transform: uppercase;
  letter-spacing: 0.07em; color: var(--text2);
}
.lib-threat-list { display: flex; flex-direction: column; gap: 2px; }
.lib-threat-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 10px; border-radius: var(--radius-sm); transition: background 0.15s;
}
.lib-threat-row:hover { background: var(--surface2); }
.lib-threat-name { font-size: 13px; color: var(--text); }
.lib-add-btn {
  padding: 3px 10px; border-radius: 5px; border: 1px solid var(--border2);
  background: none; color: var(--accent); font-size: 12px;
  font-family: 'DM Sans', sans-serif; cursor: pointer; transition: all 0.15s; flex-shrink: 0;
}
.lib-add-btn:hover { background: rgba(200,181,96,0.1); }
.lib-add-btn.added { color: var(--green); border-color: transparent; cursor: default; pointer-events: none; }

/* Risk toggle in threat modal */
.risk-toggle { display: flex; gap: 6px; }
.risk-toggle-btn {
  flex: 1; padding: 7px; border-radius: var(--radius-sm);
  border: 1px solid var(--border2); background: none;
  font-family: 'DM Sans', sans-serif; font-size: 12px; color: var(--text2);
  cursor: pointer; transition: all 0.15s; text-transform: capitalize;
}
.risk-toggle-btn.active.high   { background: rgba(196,92,74,0.2);  border-color: var(--red);   color: #e89080; }
.risk-toggle-btn.active.medium { background: rgba(196,149,74,0.2); border-color: var(--amber); color: #e0ad70; }
.risk-toggle-btn.active.low    { background: rgba(90,154,110,0.2); border-color: var(--green); color: #80cc9a; }
.modal-form-group textarea {
  width: 100%; background: var(--surface2); border: 1px solid var(--border2);
  border-radius: var(--radius-sm); padding: 9px 12px; color: var(--text);
  font-size: 13px; font-family: 'DM Sans', sans-serif; outline: none;
  resize: vertical; min-height: 72px; transition: border-color 0.15s;
}
.modal-form-group textarea:focus { border-color: var(--accent); }
.modal-form-group textarea::placeholder { color: var(--text3); }

/* ── ADMIN USER TABLE ── */
.admin-thead {
  display: grid;
  grid-template-columns: 2.5fr 90px 90px 120px 120px 130px 120px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 11px; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--text3);
}
.admin-row {
  display: grid;
  grid-template-columns: 2.5fr 90px 90px 120px 120px 130px 120px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  align-items: center;
  transition: background 0.1s;
}
.admin-row:last-child { border-bottom: none; }
.admin-row:hover { background: var(--surface2); }

.status-badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 500; padding: 3px 9px;
  border-radius: 5px;
}
.status-badge::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.status-badge.active    { background: rgba(90,154,110,0.15); color: #80cc9a; }
.status-badge.suspended { background: rgba(196,92,74,0.15);  color: #e89080; }

.admin-dd-item { color: var(--accent) !important; }
.admin-dd-item:hover { background: rgba(200,181,96,0.08) !important; }

/* ── EMERGENCY PLAN ── */
.plan-section {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.5rem;
  margin-bottom: 1.25rem;
}
.plan-section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 0.5rem;
}
.plan-section-title {
  font-family: 'Instrument Serif', serif; font-size: 18px;
  letter-spacing: -0.02em; color: var(--text);
  padding-bottom: 0.75rem; border-bottom: 1px solid var(--border);
  margin-bottom: 0.25rem;
}
.plan-section-header .plan-section-title { border-bottom: none; padding-bottom: 0; margin-bottom: 0; }
.contact-list { display: flex; flex-direction: column; gap: 2px; }
.contact-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 0; border-bottom: 1px solid var(--border);
  gap: 12px;
}
.contact-row:last-child { border-bottom: none; }
.contact-name { font-size: 14px; font-weight: 500; color: var(--text); display: flex; align-items: center; }
.contact-meta { font-size: 12px; color: var(--text3); margin-top: 2px; display: flex; gap: 6px; flex-wrap: wrap; }

/* ── SIMULATION ── */
.sim-gaps-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px;
}
.sim-gap-card {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 16px; border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.sim-gap-card.critical { border-color: rgba(196,92,74,0.3); background: rgba(196,92,74,0.06); }
.sim-gap-card.warning  { border-color: rgba(196,149,74,0.3); background: rgba(196,149,74,0.06); }
.sim-gap-card.good     { border-color: rgba(90,154,110,0.3); background: rgba(90,154,110,0.06); }
.sim-gap-icon { font-size: 20px; flex-shrink: 0; line-height: 1; margin-top: 2px; }
.sim-gap-title { font-size: 14px; font-weight: 500; color: var(--text); margin-bottom: 2px; }
.sim-gap-desc { font-size: 12px; color: var(--text2); line-height: 1.5; }

@media print {
  .topbar, .add-btn, .reload-btn, .action-btn, .inv-actions, .modal-overlay, .settings-msg { display: none !important; }
  .main { max-width: 100%; padding: 0; }
  .plan-section { break-inside: avoid; border: 1px solid #ccc; }
}

/* ── FAMILY PAGE ── */
.family-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 12px;
}
.family-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.25rem 1.5rem;
  display: flex; flex-direction: column; gap: 10px;
  transition: border-color 0.2s;
}
.family-card:hover { border-color: var(--border2); }
.family-card-top {
  display: flex; align-items: flex-start; gap: 12px;
}
.family-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--accent); color: #1a1800;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 500; flex-shrink: 0;
}
.family-card-info { flex: 1; min-width: 0; }
.family-card-name { font-size: 15px; font-weight: 500; color: var(--text); }
.family-card-meta { font-size: 12px; color: var(--text3); margin-top: 2px; }
.family-card-skills { display: flex; flex-wrap: wrap; gap: 5px; }
.family-card-notes { font-size: 12px; color: var(--text3); line-height: 1.5; }
.family-card-resources {
  display: flex; gap: 16px; padding-top: 8px;
  border-top: 1px solid var(--border);
  font-size: 12px; color: var(--text2);
}

/* Skill picker (modal) */
.skills-picker {
  display: flex; flex-wrap: wrap; gap: 6px;
}
.skill-chip-toggle {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 10px; border-radius: 6px;
  border: 1px solid var(--border2); background: none;
  font-size: 12px; color: var(--text2); cursor: pointer;
  transition: all 0.15s; user-select: none;
}
.skill-chip-toggle:hover { border-color: var(--accent); color: var(--text); }
.skill-chip-toggle.selected {
  background: rgba(200,181,96,0.15); border-color: var(--accent);
  color: var(--accent); font-weight: 500;
}

/* Skill coverage grid */
.skills-coverage-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 6px;
}
.skill-cov-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); font-size: 12px;
  transition: background 0.15s;
}
.skill-cov-item.skill-covered {
  background: rgba(90,154,110,0.06); border-color: rgba(90,154,110,0.2);
}
.skill-cov-item.skill-gap {
  background: rgba(196,92,74,0.06); border-color: rgba(196,92,74,0.2);
}
.skill-cov-icon { font-size: 15px; flex-shrink: 0; }
.skill-cov-label { flex: 1; color: var(--text); }
.skill-cov-who { font-size: 11px; color: var(--text3); white-space: nowrap; }
.skill-gap .skill-cov-who { color: var(--red); font-weight: 500; }

/* ── MILESTONES ── */
.ms-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.5rem; margin-bottom: 1.25rem;
}
.ms-card-header { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 14px; }
.ms-icon { font-size: 28px; line-height: 1; flex-shrink: 0; }
.ms-info { flex: 1; min-width: 0; }
.ms-name { font-family: 'Instrument Serif', serif; font-size: 20px; letter-spacing: -0.02em; color: var(--text); }
.ms-desc { font-size: 12px; color: var(--text3); margin-top: 4px; line-height: 1.5; }
.ms-progress-ring { text-align: right; flex-shrink: 0; }
.ms-pct { font-size: 28px; font-weight: 300; line-height: 1; }
.ms-count { font-size: 11px; color: var(--text3); margin-top: 2px; }
.ms-bar-wrap { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.ms-bar-track { flex: 1; height: 6px; background: var(--surface3); border-radius: 3px; overflow: hidden; }
.ms-bar-fill { height: 100%; border-radius: 3px; transition: width 0.4s ease; }
.ms-bar-label { font-size: 11px; font-weight: 500; white-space: nowrap; }
.ms-reqs { display: flex; flex-direction: column; gap: 2px; }
.ms-req {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); transition: all 0.15s;
}
.ms-req.done { border-color: rgba(90,154,110,0.2); background: rgba(90,154,110,0.04); }
.ms-check {
  width: 22px; height: 22px; border-radius: 5px; flex-shrink: 0;
  border: 2px solid var(--border2); background: none;
  color: transparent; font-size: 13px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s; margin-top: 1px;
}
.ms-check:hover { border-color: var(--accent); }
.ms-check.checked { background: var(--green); border-color: var(--green); color: #fff; }
.ms-check.auto { cursor: default; opacity: 0.8; }
.ms-req-info { flex: 1; min-width: 0; }
.ms-req-name { font-size: 13px; color: var(--text); font-weight: 500; }
.ms-req.done .ms-req-name { text-decoration: line-through; color: var(--text2); }
.ms-req-desc { font-size: 11px; color: var(--text3); margin-top: 2px; line-height: 1.5; }
.ms-req-type { font-size: 14px; flex-shrink: 0; opacity: 0.5; margin-top: 2px; }
.ms-chevron {
  font-size: 14px; color: var(--text3); transition: transform 0.2s;
  flex-shrink: 0; margin-left: 4px; margin-top: 6px;
}
.ms-chevron.open { transform: rotate(180deg); }
.ms-toggle:hover .ms-chevron { color: var(--text); }
.ms-filter-row {
  display: flex; gap: 16px; padding-bottom: 10px;
  margin-bottom: 4px; border-bottom: 1px solid var(--border);
}
.ms-filter-stat { font-size: 12px; color: var(--text3); }
.ms-groups { display: flex; flex-direction: column; gap: 6px; }
.ms-group {
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  overflow: hidden;
}
.ms-group-header {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; background: var(--surface2);
  cursor: pointer; transition: background 0.15s; user-select: none;
}
.ms-group-header:hover { background: var(--surface3); }
.ms-group-chevron {
  font-size: 11px; color: var(--text3); transition: transform 0.2s;
  flex-shrink: 0; width: 12px;
}
.ms-group-chevron.open { transform: rotate(90deg); }
.ms-group-name {
  font-size: 13px; font-weight: 500; color: var(--text); flex: 1;
}
.ms-group-progress { font-size: 11px; flex-shrink: 0; }
.ms-group-bar {
  width: 60px; height: 4px; background: var(--surface3);
  border-radius: 2px; overflow: hidden; flex-shrink: 0;
}
.ms-group .ms-reqs { padding: 4px 0; }
.ms-group .ms-req { border: none; border-bottom: 1px solid var(--border); border-radius: 0; margin: 0; padding-left: 36px; }
.ms-group .ms-req:last-child { border-bottom: none; }

/* ── COMMUNITY ── */
.comm-score-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.5rem; margin-bottom: 1.5rem;
}
.comm-score-header { display: flex; align-items: center; gap: 2rem; margin-bottom: 1rem; flex-wrap: wrap; }
.comm-score-num { font-size: 42px; font-weight: 300; line-height: 1; }
.comm-score-bar-wrap { flex: 1; min-width: 200px; }
.comm-score-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px; margin-top: 0.75rem;
}
.comm-score-item { padding: 8px 0; }

.comm-checkin-bar {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 20px; margin-bottom: 1.5rem;
  gap: 16px; flex-wrap: wrap;
}
.comm-checkin-status { flex: 1; font-size: 14px; }
.comm-checkin-actions { display: flex; gap: 8px; }
.comm-checkin-btn {
  padding: 8px 16px; border-radius: var(--radius-sm); border: 1px solid var(--border2);
  background: none; font-family: 'DM Sans', sans-serif; font-size: 12px; font-weight: 500;
  cursor: pointer; transition: all 0.15s;
}
.comm-checkin-btn.safe { color: var(--green); border-color: rgba(90,154,110,0.3); }
.comm-checkin-btn.safe:hover { background: rgba(90,154,110,0.1); }
.comm-checkin-btn.help { color: var(--red); border-color: rgba(196,92,74,0.3); }
.comm-checkin-btn.help:hover { background: rgba(196,92,74,0.1); }
.comm-checkin-btn.checking { color: var(--amber); border-color: rgba(196,149,74,0.3); }
.comm-checkin-btn.checking:hover { background: rgba(196,149,74,0.1); }

.comm-circle-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px;
}

/* ── ADMIN CATEGORIES TABLE ── */
.catadmin-thead {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 100px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 11px; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--text3);
}
.catadmin-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 100px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  align-items: center;
  transition: background 0.1s;
}
.catadmin-row:last-child { border-bottom: none; }
.catadmin-row:hover { background: var(--surface2); }

/* ── ADMIN THREAT LIBRARY ── */
.tl-group {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); margin-bottom: 1rem; overflow: hidden;
}
.tl-group-header {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; border-bottom: 1px solid var(--border);
  background: var(--surface2);
}
.tl-group-name  { font-size: 14px; font-weight: 500; color: var(--text); }
.tl-group-count { font-size: 12px; color: var(--text3); }
.tl-item-list   { padding: 4px 0; }
.tl-item-row {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 16px; border-bottom: 1px solid var(--border);
  transition: background 0.1s;
}
.tl-item-row:last-child { border-bottom: none; }
.tl-item-row:hover { background: var(--surface2); }
.tl-item-name   { flex: 1; font-size: 13px; color: var(--text); }
.tl-empty       { padding: 12px 16px; font-size: 13px; color: var(--text3); }

/* responsive */
@media (max-width: 900px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-left { display: none; }
  .metrics-row { grid-template-columns: repeat(2, 1fr) !important; }
  .two-col { grid-template-columns: 1fr; }
  .inv-thead, .inv-row { grid-template-columns: 1fr auto auto; }
  .inv-thead .h-cat, .inv-thead .h-qty, .inv-thead .h-unit, .inv-row .col-cat, .inv-row .col-qty, .inv-row .col-unit { display: none; }
}

/* ── Blog ──────────────────────────────────────────────────── */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}
.blog-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}
.blog-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}
.blog-card-img {
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.blog-card-body {
  padding: 20px 24px 24px;
}
.blog-card-tag {
  display: inline-block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  background: rgba(200,181,96,0.1);
  padding: 3px 10px;
  border-radius: 4px;
  margin-bottom: 8px;
  font-weight: 600;
}
.blog-card-body h3 {
  font-family: 'Instrument Serif', serif;
  font-size: 20px;
  color: var(--text);
  margin: 0 0 8px;
  line-height: 1.3;
}
.blog-card-body p {
  font-size: 13px;
  color: var(--text2);
  line-height: 1.6;
  margin: 0 0 12px;
}
.blog-card-meta {
  font-size: 11px;
  color: var(--text3);
}
.blog-back {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 14px;
  cursor: pointer;
  padding: 8px 0;
  margin-bottom: 1rem;
  display: inline-block;
  font-family: inherit;
}
.blog-back:hover { text-decoration: underline; }
.blog-article {
  max-width: 720px;
  margin: 0 auto;
}
.blog-article-header {
  text-align: center;
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}
.blog-article-header h1 {
  font-family: 'Instrument Serif', serif;
  font-size: 32px;
  color: var(--text);
  margin: 12px 0 0;
  line-height: 1.3;
}
.blog-article-body {
  font-size: 15px;
  color: var(--text2);
  line-height: 1.8;
}
.blog-article-body h3 {
  font-family: 'Instrument Serif', serif;
  font-size: 22px;
  color: var(--text);
  margin: 2rem 0 0.75rem;
}
.blog-article-body h4 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin: 1.5rem 0 0.5rem;
}
.blog-article-body p {
  margin: 0 0 1rem;
}
.blog-article-body ul {
  margin: 0 0 1rem;
  padding-left: 1.5rem;
}
.blog-article-body li {
  margin-bottom: 0.4rem;
  line-height: 1.7;
}
.blog-article-body strong {
  color: var(--text);
}
.blog-article-body em {
  font-style: italic;
  color: var(--accent);
}
@media (max-width: 700px) {
  .blog-grid { grid-template-columns: 1fr; }
  .blog-article-header h1 { font-size: 24px; }
}

/* ── ReadyNow AI Chat ─────────────────────────────────────── */
.rn-container {
  display: flex;
  gap: 0;
  height: calc(100vh - 120px);
  margin: -1.5rem;
  background: var(--bg);
}
.rn-sidebar {
  width: 260px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 20px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  flex-shrink: 0;
}
.rn-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.rn-brand-icon { font-size: 28px; }
.rn-brand-name {
  font-family: 'Instrument Serif', serif;
  font-size: 20px;
  color: var(--text);
}
.rn-brand-sub {
  font-size: 11px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.rn-topics-title {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text3);
  margin-bottom: 10px;
}
.rn-topic-btn {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  color: var(--text2);
  font-size: 13px;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  margin-bottom: 2px;
  transition: background 0.15s;
}
.rn-topic-btn:hover {
  background: var(--surface2);
  color: var(--text);
}
.rn-remaining {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--text3);
  text-align: center;
}
.rn-chat {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.rn-messages {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.rn-welcome {
  text-align: center;
  padding: 40px 20px;
  max-width: 600px;
  margin: auto;
}
.rn-welcome h2 {
  font-family: 'Instrument Serif', serif;
  font-size: 28px;
  color: var(--text);
  margin: 0 0 8px;
}
.rn-welcome > p {
  font-size: 14px;
  color: var(--text2);
  line-height: 1.7;
  margin: 0 0 32px;
}
.rn-welcome-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  text-align: left;
}
.rn-welcome-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text2);
  line-height: 1.5;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  transition: border-color 0.2s, background 0.2s;
}
.rn-welcome-card:hover {
  border-color: var(--accent);
  background: var(--surface2);
}
.rn-welcome-card-icon { font-size: 20px; flex-shrink: 0; }
.rn-msg {
  display: flex;
  gap: 12px;
  max-width: 780px;
  animation: fadeIn 0.3s;
}
.rn-msg-user {
  flex-direction: row-reverse;
  align-self: flex-end;
}
.rn-msg-assistant { align-self: flex-start; }
.rn-msg-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--surface2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}
.rn-msg-content {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 14px;
  color: var(--text2);
  line-height: 1.7;
}
.rn-msg-user .rn-msg-content {
  background: var(--accent);
  color: #1a1800;
  border-color: var(--accent);
}
.rn-msg-content h3 { font-size: 16px; color: var(--text); margin: 16px 0 6px; }
.rn-msg-content h4 { font-size: 14px; color: var(--text); margin: 12px 0 4px; }
.rn-msg-content ul { padding-left: 1.2rem; margin: 6px 0; }
.rn-msg-content li { margin-bottom: 3px; }
.rn-msg-content strong { color: var(--text); }
.rn-msg-user .rn-msg-content strong { color: #1a1800; }
.rn-typing {
  display: flex;
  gap: 4px;
  padding: 4px 0;
}
.rn-typing span {
  width: 8px;
  height: 8px;
  background: var(--text3);
  border-radius: 50%;
  animation: typingBounce 1.4s infinite;
}
.rn-typing span:nth-child(2) { animation-delay: 0.2s; }
.rn-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-6px); opacity: 1; }
}
.rn-input-area {
  padding: 16px 24px 20px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}
.rn-input-wrap {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: 12px;
  padding: 8px 12px;
}
.rn-input-wrap textarea {
  flex: 1;
  background: none;
  border: none;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  resize: none;
  outline: none;
  line-height: 1.5;
  max-height: 120px;
}
.rn-send {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--accent);
  border: none;
  color: #1a1800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: opacity 0.2s;
}
.rn-send:hover { opacity: 0.85; }
.rn-send:disabled { opacity: 0.4; cursor: not-allowed; }
.rn-disclaimer {
  font-size: 11px;
  color: var(--text3);
  text-align: center;
  margin-top: 8px;
}
@media (max-width: 768px) {
  .rn-sidebar { display: none; }
  .rn-container { margin: -1rem; height: calc(100vh - 100px); }
  .rn-welcome-grid { grid-template-columns: 1fr; }
}

/* ── ReadyNow Floating Widget ─────────────────────────────── */
.rn-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
  z-index: 9999;
  transition: transform 0.2s, box-shadow 0.2s;
}
.rn-fab-close {
  font-size: 22px;
  color: var(--text2);
}
.rn-fab:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 24px rgba(0,0,0,0.5);
}
.rn-fab-icon { font-size: 24px; line-height: 1; }
.rn-fab-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 14px;
  height: 14px;
  background: var(--red, #ef4444);
  border-radius: 50%;
  border: 2px solid var(--bg);
}
.rn-widget {
  position: fixed;
  bottom: 92px;
  right: 24px;
  width: 400px;
  height: 520px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 12px 48px rgba(0,0,0,0.5);
  z-index: 9998;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
}
.rn-widget.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
.rn-widget-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.rn-widget-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.rn-widget-title {
  font-family: 'Instrument Serif', serif;
  font-size: 16px;
  color: var(--text);
  line-height: 1.2;
}
.rn-widget-subtitle {
  font-size: 10px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.rn-widget-btn {
  background: none;
  border: none;
  color: var(--text3);
  font-size: 20px;
  cursor: pointer;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: background 0.15s;
  font-family: inherit;
}
.rn-widget-btn:hover { background: var(--surface2); color: var(--text); }
.rn-widget-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.rn-w-msg {
  display: flex;
  gap: 8px;
  max-width: 92%;
  animation: fadeIn 0.3s;
}
.rn-w-msg-user {
  flex-direction: row-reverse;
  align-self: flex-end;
}
.rn-w-msg-assistant { align-self: flex-start; }
.rn-w-msg-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--surface2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
  margin-top: 2px;
}
.rn-w-msg-bubble {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 13px;
  color: var(--text2);
  line-height: 1.6;
}
.rn-w-msg-user .rn-w-msg-bubble {
  background: var(--accent);
  color: #1a1800;
  border-color: var(--accent);
}
.rn-w-msg-bubble h3 { font-size: 14px; color: var(--text); margin: 10px 0 4px; }
.rn-w-msg-bubble h4 { font-size: 13px; color: var(--text); margin: 8px 0 3px; }
.rn-w-msg-bubble ul { padding-left: 1.1rem; margin: 4px 0; }
.rn-w-msg-bubble li { margin-bottom: 2px; font-size: 12px; }
.rn-w-msg-bubble strong { color: var(--text); }
.rn-w-msg-user .rn-w-msg-bubble strong { color: #1a1800; }
.rn-w-msg-bubble p { margin: 0 0 6px; }
.rn-w-msg-bubble p:last-child { margin: 0; }
.rn-widget-input-area {
  padding: 12px 16px 14px;
  border-top: 1px solid var(--border);
  background: var(--surface);
  flex-shrink: 0;
}
.rn-widget-input-wrap {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: 10px;
  padding: 6px 10px;
}
.rn-widget-input-wrap textarea {
  flex: 1;
  background: none;
  border: none;
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  resize: none;
  outline: none;
  line-height: 1.4;
  max-height: 80px;
}
.rn-widget-send {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  background: var(--accent);
  border: none;
  color: #1a1800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: opacity 0.2s;
}
.rn-widget-send:hover { opacity: 0.85; }
.rn-widget-send:disabled { opacity: 0.4; cursor: not-allowed; }
@media (max-width: 480px) {
  .rn-widget {
    bottom: 0;
    right: 0;
    width: 100%;
    height: 100%;
    border-radius: 0;
    border: none;
  }
  .rn-fab { bottom: 16px; right: 16px; }
}
