/* ─────────────────────────────────────────────────────────
   MYKOBO Investor Portal — portal.css
   ───────────────────────────────────────────────────────── */

/* ─── Base layout ────────────────────────────────────────── */
* { box-sizing: border-box; }

.portal-wrap {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ─── Mobile topbar ──────────────────────────────────────── */
.mobile-topbar {
  display: none;
  align-items: center;
  justify-content: space-between;
  background: #0a0e27;
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  position: sticky;
  top: 0;
  z-index: 200;
  flex-shrink: 0;
}
.mobile-topbar img { height: 24px; width: auto; }
.hamburger-btn {
  background: none;
  border: none;
  color: rgba(255,255,255,0.7);
  cursor: pointer;
  padding: 6px;
  font-size: 1.1rem;
  line-height: 1;
  display: flex;
  align-items: center;
}

/* ─── Main portal body (sidebar + content) ───────────────── */
.portal-layout {
  display: flex;
  flex: 1;
  position: relative;
}

/* ─── Sidebar ────────────────────────────────────────────── */
.portal-sidebar {
  width: 220px;
  flex-shrink: 0;
  background: #0a0e27;
  border-right: 1px solid rgba(255,255,255,0.08);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 200;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.1) transparent;
}

.sidebar-logo {
  padding: 1.25rem 1.25rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.sidebar-logo img { height: 26px; width: auto; }
.logo-dark-hide  { display: none; }
.logo-light-hide { display: block; }
body.light-mode .logo-dark-hide  { display: block !important; }
body.light-mode .logo-light-hide { display: none !important; }
.sidebar-close-btn {
  display: none;
  background: none;
  border: none;
  color: rgba(255,255,255,0.5);
  cursor: pointer;
  font-size: 1rem;
  padding: 4px;
}

.sidebar-label {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(255,255,255,0.35) !important;
  padding: 1rem 1.25rem 0.3rem;
  flex-shrink: 0;
}

.sidebar-nav { padding: 0 0.5rem; }

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0.4rem 0.75rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: rgba(255,255,255,0.55) !important;
  text-decoration: none;
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
  line-height: 1.4;
}
.sidebar-item:hover {
  background: rgba(139,92,246,0.15);
  color: rgba(255,255,255,0.9) !important;
}
.sidebar-item.active {
  background: rgba(139,92,246,0.2);
  color: #fff !important;
  font-weight: 600;
}
.sidebar-icon {
  width: 14px;
  text-align: center;
  color: rgba(255,255,255,0.4);
  flex-shrink: 0;
  font-size: 0.8rem;
}
.sidebar-item:hover .sidebar-icon,
.sidebar-item.active .sidebar-icon { color: rgba(255,255,255,0.8); }

.sidebar-memo-item { font-size: 0.78rem; padding: 0.3rem 0.75rem; }
.sidebar-num {
  font-family: monospace;
  font-size: 0.68rem;
  color: rgba(255,255,255,0.3);
  width: 20px;
  flex-shrink: 0;
}
.sidebar-memo-item.active .sidebar-num { color: rgba(255,255,255,0.7); }

.sidebar-footer {
  margin-top: auto;
  padding: 0.875rem 1.25rem;
  border-top: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
  background: #0a0e27;
}
.sidebar-user-name {
  font-size: 0.8125rem;
  font-weight: 600;
  color: rgba(255,255,255,0.7);
  display: block;
  margin-bottom: 1px;
}
.sidebar-user-email {
  font-size: 0.72rem;
  color: rgba(255,255,255,0.35);
  display: block;
  margin-bottom: 0.6rem;
  word-break: break-all;
}
.sidebar-footer-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.sidebar-theme-btn {
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 5px;
  padding: 3px 9px;
  font-size: 0.72rem;
  color: rgba(255,255,255,0.5);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: background 0.15s;
}
.sidebar-theme-btn:hover { background: rgba(255,255,255,0.12); color: rgba(255,255,255,0.8); }
.sidebar-signout-btn {
  background: none;
  border: none;
  font-size: 0.72rem;
  color: rgba(255,255,255,0.35);
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}

/* ─── Main content ───────────────────────────────────────── */
.portal-main {
  margin-left: 220px;
  flex: 1;
  padding: 2rem 1.75rem;
  min-height: 100vh;
  min-width: 0;
}

/* ─── Page header ────────────────────────────────────────── */
.portal-page-header { margin-bottom: 1.5rem; }
.portal-eyebrow {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--purple-light);
  margin-bottom: 0.25rem;
}
.portal-page-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.3px;
  margin-bottom: 0.2rem;
}
.portal-page-subtitle { font-size: 0.875rem; color: var(--text-secondary); }

/* ─── Two-column document layout ─────────────────────────── */
.doc-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 1.5rem;
  align-items: start;
}
.doc-content-col { min-width: 0; }
.doc-sidebar-col { position: sticky; top: 1.5rem; }

/* ─── Q&A panel ──────────────────────────────────────────── */
.qa-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  overflow: hidden;
}
.qa-panel-header {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--text-muted);
}
.qa-panel-body { padding: 1rem; }
.qa-download-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 0.6rem;
  background: linear-gradient(135deg,#8b5cf6,#3b82f6);
  color: #fff;
  font-size: 0.8125rem;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  margin-bottom: 1rem;
  transition: opacity 0.2s;
}
.qa-download-btn:hover { opacity: 0.88; color: #fff; }

/* ─── Portal cards ───────────────────────────────────────── */
.portal-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 1.25rem;
}
.portal-card-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}
.portal-stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  background: linear-gradient(135deg,#8b5cf6,#3b82f6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.1;
}

/* ─── Document list ──────────────────────────────────────── */
.doc-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  margin-bottom: 0.5rem;
  text-decoration: none;
  transition: border-color 0.2s, background 0.2s;
}
.doc-list-item:hover {
  border-color: var(--border-accent);
  background: rgba(139,92,246,0.06);
}
.doc-list-title { font-size: 0.875rem; font-weight: 600; color: var(--text-primary); }
.doc-list-meta  { font-size: 0.78rem; color: var(--text-secondary); margin-top: 2px; }
.doc-type-badge {
  font-size: 9px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.06em; padding: 2px 8px; border-radius: 100px; white-space: nowrap;
}
.doc-type-memo   { background:rgba(139,92,246,0.15); color:#a78bfa; }
.doc-type-teaser { background:rgba(59,130,246,0.15);  color:#93c5fd; }
.doc-type-update { background:rgba(16,185,129,0.15);  color:#6ee7b7; }

/* ─── Comments ───────────────────────────────────────────── */
.comment-thread { margin-bottom: 0.875rem; }
.comment-bubble {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 0.75rem 1rem;
}
.comment-bubble.admin-reply {
  background: rgba(139,92,246,0.07);
  border-color: var(--border-accent);
  margin-left: 1.5rem;
  margin-top: 0.5rem;
}
.comment-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 0.4rem;
  flex-wrap: wrap;
}
.comment-author { font-size: 0.8rem; font-weight: 600; color: var(--text-primary); }
.comment-role-badge {
  font-size: 9px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.06em; padding: 2px 7px; border-radius: 100px;
  background: rgba(139,92,246,0.2); color: var(--purple-soft);
}
.comment-time { font-size: 0.72rem; color: var(--text-muted); margin-left: auto; }
.comment-body { font-size: 0.8375rem; color: var(--text-secondary); line-height: 1.65; }
.comment-resolved { opacity: 0.55; }

/* ─── Auth pages ─────────────────────────────────────────── */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  position: relative;
  z-index: 1;
}
.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 2.5rem 2rem;
  backdrop-filter: blur(20px);
}
.auth-logo { display: flex; justify-content: center; margin-bottom: 1.75rem; }
.auth-logo img { height: 32px; width: auto; }
.auth-title { font-size: 1.4rem; font-weight: 700; color: var(--text-primary); margin-bottom: 0.35rem; text-align: center; }
.auth-subtitle { font-size: 0.875rem; color: var(--text-secondary); text-align: center; margin-bottom: 2rem; }
.auth-badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--purple-soft); border: 1px solid var(--border-accent);
  border-radius: 100px; padding: 4px 12px; margin-bottom: 1rem;
}
.form-label-portal {
  font-size: 0.78rem; font-weight: 600; color: var(--text-secondary);
  text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 6px;
}
.form-control-portal {
  background: rgba(255,255,255,0.06); border: 1px solid var(--border-subtle);
  border-radius: 10px; color: var(--text-primary); padding: 0.7rem 1rem;
  font-size: 0.9375rem; width: 100%; transition: border-color 0.2s, background 0.2s;
}
.form-control-portal:focus {
  outline: none; border-color: var(--purple-primary);
  background: rgba(139,92,246,0.08); box-shadow: 0 0 0 3px rgba(139,92,246,0.15);
}
.form-control-portal::placeholder { color: rgba(255,255,255,0.25); }
.btn-portal-primary {
  background: linear-gradient(135deg,#8b5cf6,#3b82f6); border: none; color: #fff;
  font-weight: 600; font-size: 0.9375rem; padding: 0.75rem 1.5rem; border-radius: 10px;
  width: 100%; cursor: pointer; transition: opacity 0.2s, transform 0.2s;
  box-shadow: 0 4px 20px rgba(139,92,246,0.35);
}
.btn-portal-primary:hover { opacity: 0.9; transform: translateY(-1px); }
.alert-portal {
  background: rgba(239,68,68,0.12); border: 1px solid rgba(239,68,68,0.25);
  color: #fca5a5; border-radius: 10px; padding: 0.75rem 1rem;
  font-size: 0.875rem; margin-bottom: 1.25rem;
}

/* ─── Status pills ───────────────────────────────────────── */
.status-pill {
  display: inline-block; font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.05em; padding: 3px 9px; border-radius: 100px;
}
.status-active  { background:rgba(16,185,129,0.15); color:#6ee7b7; }
.status-revoked { background:rgba(239,68,68,0.1);   color:#fca5a5; }
.status-pending { background:rgba(245,158,11,0.1);  color:#fcd34d; }

/* ─── Admin ──────────────────────────────────────────────── */
.audit-row {
  display: grid; grid-template-columns: 160px 120px 1fr 110px;
  gap: 0; padding: 0.55rem 0; border-bottom: 1px solid var(--border-subtle);
  font-size: 0.78rem; align-items: center;
}
.audit-row:last-child { border-bottom: none; }
.audit-action {
  font-family: monospace; font-size: 0.7rem; padding: 2px 7px;
  border-radius: 5px; background: rgba(255,255,255,0.06); color: var(--text-secondary);
}
.audit-action.ok    { background:rgba(16,185,129,0.1);  color:#6ee7b7; }
.audit-action.fail  { background:rgba(239,68,68,0.1);   color:#fca5a5; }
.audit-action.admin { background:rgba(245,158,11,0.1);  color:#fcd34d; }

/* ─── Error page ─────────────────────────────────────────── */
.error-wrap {
  min-height: 100vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center;
  padding: 2rem; position: relative; z-index: 1;
}
.error-code {
  font-size: 6rem; font-weight: 800; line-height: 1; margin-bottom: 1rem;
  background: linear-gradient(135deg,#8b5cf6,#3b82f6);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.error-message { font-size: 1.1rem; color: var(--text-secondary); margin-bottom: 2rem; }

/* ─── 2FA ────────────────────────────────────────────────── */
.qr-wrap { background:#fff; border-radius: 12px; padding: 1rem; display: inline-block; }
.totp-instructions { font-size: 0.875rem; color: var(--text-secondary); line-height: 1.7; }

/* ─── Light mode — full overhaul ─────────────────────────── */
body.light-mode {
  --text-primary:   #0f172a;
  --text-secondary: #334155;
  --text-muted:     #64748b;
  --bg-card:        #ffffff;
  --border-subtle:  #e2e8f0;
  --border-accent:  #a78bfa;
  --purple-light:   #7c3aed;
  --purple-soft:    #6d28d9;
}

/* ── Sidebar light ── */
body.light-mode .portal-sidebar { background: #f8fafc !important; border-right-color: #e2e8f0 !important; }
body.light-mode .sidebar-logo   { border-bottom-color: #e2e8f0 !important; }
body.light-mode .sidebar-label  { color: #94a3b8 !important; }
body.light-mode .sidebar-item   { color: #475569 !important; }
body.light-mode .sidebar-item:hover  { background: rgba(124,58,237,0.08) !important; color: #3b0764 !important; }
body.light-mode .sidebar-item.active { background: rgba(124,58,237,0.12) !important; color: #6d28d9 !important; }
body.light-mode .sidebar-icon   { color: #94a3b8 !important; }
body.light-mode .sidebar-item:hover .sidebar-icon,
body.light-mode .sidebar-item.active .sidebar-icon { color: #6d28d9 !important; }
body.light-mode .sidebar-num    { color: #94a3b8 !important; }
body.light-mode .sidebar-memo-item.active .sidebar-num { color: #6d28d9 !important; }
body.light-mode .sidebar-footer { background: #f8fafc !important; border-top-color: #e2e8f0 !important; }
body.light-mode .sidebar-user-name  { color: #0f172a !important; }
body.light-mode .sidebar-user-email { color: #64748b !important; }
body.light-mode .sidebar-theme-btn  { background: #e2e8f0 !important; border-color: #cbd5e1 !important; color: #475569 !important; }
body.light-mode .sidebar-theme-btn:hover { background: #cbd5e1 !important; color: #0f172a !important; }
body.light-mode .sidebar-signout-btn { color: #94a3b8 !important; }
body.light-mode .sidebar-close-btn  { color: #64748b !important; }
body.light-mode .mobile-topbar { background: #f8fafc !important; border-bottom-color: #e2e8f0 !important; }
body.light-mode .hamburger-btn { color: #475569 !important; }

/* ── Main content ── */
body.light-mode .portal-eyebrow    { color: #7c3aed !important; }
body.light-mode .portal-page-title { color: #0f172a !important; }
body.light-mode .portal-page-subtitle { color: #475569 !important; }

/* ── Cards ── */
body.light-mode .portal-card,
body.light-mode .qa-panel {
  background: #ffffff !important;
  border-color: #e2e8f0 !important;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
body.light-mode .doc-list-item { background: #ffffff !important; border-color: #e2e8f0 !important; box-shadow: 0 1px 3px rgba(0,0,0,0.06); }
body.light-mode .doc-list-item:hover { background: #f5f3ff !important; border-color: #a78bfa !important; box-shadow: none; }
body.light-mode .portal-card-title { color: #64748b !important; }
body.light-mode .doc-list-title    { color: #0f172a !important; }
body.light-mode .doc-list-meta     { color: #64748b !important; }

/* ── Badges ── */
body.light-mode .doc-type-badge   { color: #fff !important; }
body.light-mode .doc-type-teaser  { background: #2563eb !important; }
body.light-mode .doc-type-memo    { background: #7c3aed !important; }
body.light-mode .doc-type-update,
body.light-mode .status-active    { background: #059669 !important; color: #fff !important; }
body.light-mode .status-revoked   { background: #dc2626 !important; color: #fff !important; }
body.light-mode .status-pending   { background: #d97706 !important; color: #fff !important; }

/* ── Comments ── */
body.light-mode .comment-bubble { background: #f8fafc !important; border-color: #e2e8f0 !important; }
body.light-mode .comment-bubble.admin-reply { background: #f5f3ff !important; border-color: #c4b5fd !important; }
body.light-mode .comment-author  { color: #0f172a !important; }
body.light-mode .comment-body    { color: #334155 !important; }
body.light-mode .comment-time    { color: #94a3b8 !important; }
body.light-mode .qa-panel-header { color: #64748b !important; border-bottom-color: #e2e8f0 !important; }

/* ── Forms ── */
body.light-mode .form-control-portal { background: #ffffff !important; border-color: #cbd5e1 !important; color: #0f172a !important; }
body.light-mode .form-control-portal:focus { border-color: #7c3aed !important; box-shadow: 0 0 0 3px rgba(124,58,237,0.12) !important; }
body.light-mode .form-control-portal::placeholder { color: #94a3b8 !important; }
body.light-mode .form-label-portal { color: #475569 !important; }

/* ── Memo dm-* ── */
body.light-mode .dm-h2 { color: #0f172a !important; }
body.light-mode .dm-h3 { color: #334155 !important; }
body.light-mode .dm-p  { color: #334155 !important; }
body.light-mode .dm-p strong { color: #0f172a !important; }
body.light-mode .dm-card { background: #ffffff !important; border-color: #e2e8f0 !important; box-shadow: 0 1px 3px rgba(0,0,0,0.06); }
body.light-mode .dm-card-label { color: #64748b !important; }
body.light-mode .dm-card-value { color: #0f172a !important; }
body.light-mode .dm-card-note  { color: #475569 !important; }
body.light-mode .dm-stat { background: #f8fafc !important; border-color: #e2e8f0 !important; }
body.light-mode .dm-stat-lbl { color: #64748b !important; }

/* ── Tables ── */
body.light-mode .dm-table thead tr { background: #f1f5f9 !important; }
body.light-mode .dm-table th { color: #64748b !important; border-bottom-color: #e2e8f0 !important; }
body.light-mode .dm-table td { color: #334155 !important; border-bottom-color: #f1f5f9 !important; }
body.light-mode .dm-table td:first-child { color: #0f172a !important; }
body.light-mode .dm-total td { background: #f1f5f9 !important; color: #0f172a !important; border-top-color: #e2e8f0 !important; }

/* ── Alerts ── */
body.light-mode .dm-alert-purple { background: #f5f3ff !important; border-left-color: #7c3aed !important; color: #4c1d95 !important; }
body.light-mode .dm-alert-purple strong { color: #3b0764 !important; }
body.light-mode .dm-alert-gold   { background: #fffbeb !important; border-left-color: #d97706 !important; color: #78350f !important; }
body.light-mode .dm-alert-gold strong { color: #451a03 !important; }
body.light-mode .dm-alert-green  { background: #f0fdf4 !important; border-left-color: #16a34a !important; color: #14532d !important; }
body.light-mode .dm-alert-green strong { color: #052e16 !important; }
body.light-mode .dm-alert-red    { background: #fef2f2 !important; border-left-color: #dc2626 !important; color: #7f1d1d !important; }
body.light-mode .dm-alert-red strong { color: #450a0a !important; }

/* ── Timeline ── */
body.light-mode .dm-timeline::before { background: #e2e8f0 !important; }
body.light-mode .dm-tl-year  { color: #7c3aed !important; }
body.light-mode .dm-tl-year.gold  { color: #d97706 !important; }
body.light-mode .dm-tl-year.muted { color: #94a3b8 !important; }
body.light-mode .dm-tl-title { color: #0f172a !important; }
body.light-mode .dm-tl-desc  { color: #475569 !important; }
body.light-mode .dm-tl-step::before         { background: #7c3aed !important; border-color: #7c3aed !important; }
body.light-mode .dm-tl-step.current::before { background: #d97706 !important; border-color: #d97706 !important; }
body.light-mode .dm-tl-step.future::before  { background: #f1f5f9 !important; border-color: #94a3b8 !important; }

/* ── Valuation / fund pools ── */
body.light-mode .dm-val-approach,
body.light-mode .dm-fund-pool { background: #ffffff !important; border-color: #e2e8f0 !important; box-shadow: 0 1px 3px rgba(0,0,0,0.06); }
body.light-mode .dm-val-name  { color: #0f172a !important; }
body.light-mode .dm-val-note  { color: #475569 !important; }
body.light-mode .dm-fund-name { color: #0f172a !important; }
body.light-mode .dm-fund-note { color: #475569 !important; }
body.light-mode .dm-verdict   { background: #f5f3ff !important; border-color: #c4b5fd !important; }
body.light-mode .dm-verdict-num  { color: #6d28d9 !important; -webkit-text-fill-color: #6d28d9 !important; }
body.light-mode .dm-verdict-lbl  { color: #334155 !important; }
body.light-mode .dm-verdict-note { color: #64748b !important; }

/* ── Tags ── */
body.light-mode .dm-tag-purple { background: #ede9fe !important; color: #6d28d9 !important; border-color: #c4b5fd !important; }
body.light-mode .dm-tag-gold   { background: #fef9c3 !important; color: #854d0e !important; border-color: #fde68a !important; }
body.light-mode .dm-tag-green  { background: #dcfce7 !important; color: #166534 !important; border-color: #bbf7d0 !important; }
body.light-mode .dm-tag-red    { background: #fee2e2 !important; color: #991b1b !important; border-color: #fecaca !important; }

/* ── Proof items ── */
body.light-mode .dm-proof-item { border-bottom-color: #f1f5f9 !important; color: #334155 !important; }
body.light-mode .dm-proof-item strong { color: #0f172a !important; }
body.light-mode .dm-proof-item::before { color: #7c3aed !important; }

/* ── Risk rows ── */
body.light-mode .dm-risk-name { color: #0f172a !important; }
body.light-mode .dm-risk-desc { color: #334155 !important; }
body.light-mode .dm-risk-mit  { color: #64748b !important; }

/* ── Misc ── */
body.light-mode .btn-ghost { background: #f1f5f9 !important; border-color: #e2e8f0 !important; color: #475569 !important; }
body.light-mode .sidebar-backdrop { background: rgba(15,23,42,0.4) !important; }

/* ─── Overlay backdrop ───────────────────────────────────── */
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 199;
}
.sidebar-backdrop.open { display: block; }

/* ─── Responsive ─────────────────────────────────────────── */
@media (max-width: 900px) {
  /* Show mobile topbar */
  .mobile-topbar { display: flex; }

  /* Sidebar slides in as overlay */
  .portal-sidebar {
    top: 0;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    z-index: 200;
    width: 270px;
    box-shadow: 4px 0 32px rgba(0,0,0,0.5);
  }
  .portal-sidebar.open { transform: translateX(0); }
  .sidebar-close-btn   { display: flex !important; }

  /* Main full width, no left margin */
  .portal-main { margin-left: 0; padding: 1.25rem; }

  /* Stack doc layout */
  .doc-layout { grid-template-columns: 1fr; }
  .doc-sidebar-col { position: static; }

  /* Tighten audit table */
  .audit-row { grid-template-columns: 1fr 1fr; }
}

/* ─── Print ──────────────────────────────────────────────── */
@media print {
  .mobile-topbar, .portal-sidebar, .no-print,
  .sidebar-backdrop, .doc-sidebar-col { display: none !important; }
  .portal-main  { margin-left: 0 !important; padding: 0 !important; width: 100% !important; }
  .doc-layout   { grid-template-columns: 1fr !important; }
  body { background: #fff !important; color: #111 !important; }
  @page { margin: 15mm; }
}

