/* bluRisk GRC Platform - Main Stylesheet */
:root {
  --bg:         #f4f7fb;
  --bg-card:    #ffffff;
  --bg-hover:   #eef4ff;
  --border:     #d7e2f1;
  --border-light: #b7c8df;
  --accent:     #1565d8;
  --accent-dim: #0d4abf;
  --accent-glow:#1565d820;
  --text:       #0f172a;
  --text-dim:   #334155;
  --text-muted: #64748b;
  --sidebar-w:  240px;
  --topbar-h:   76px;
  --radius:     8px;
  --radius-lg:  12px;
  --shadow:     0 8px 24px rgba(15,23,42,.08);
  --transition: 180ms ease;
  --font:       'Sora', sans-serif;
  --font-mono:  'JetBrains Mono', monospace;
  --green:  #22c55e; --green-dim: #16a34a;
  --amber:  #f59e0b; --amber-dim: #d97706;
  --red:    #ef4444; --red-dim:   #dc2626;
  --purple: #a855f7; --purple-dim:#7c3aed;
}


:root[data-theme="dark"],
body[data-theme="dark"] {
  --bg:         #0b0f1a;
  --bg-card:    #111827;
  --bg-hover:   #1a2235;
  --border:     #1e2d45;
  --border-light: #243350;
  --accent:     #4a8ef0;
  --accent-dim: #2f74db;
  --accent-glow:#4a8ef020;
  --text:       #e2e8f0;
  --text-dim:   #94a3b8;
  --text-muted: #64748b;
  --shadow:     0 8px 24px rgba(15,23,42,.08);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; }
body { font-family: var(--font); background: var(--bg); color: var(--text); min-height: 100vh; line-height: 1.6; }

/* ── App Shell ─────────────────────────────── */
.app-shell { display: flex; min-height: 100vh; }

/* ── Sidebar ───────────────────────────────── */
.sidebar {
  border-top: 3px solid var(--accent);
  width: var(--sidebar-w);
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; bottom: 0;
  overflow-y: auto; overflow-x: hidden;
  transition: width var(--transition);
  z-index: 100;
}
.sidebar.collapsed { width: 60px; }
.sidebar.collapsed .nav-text,
.sidebar.collapsed .user-info,
.sidebar.collapsed .nav-section-label,
.sidebar.collapsed .logo-icon img { height: 22px; width: auto; }

.sidebar-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 14px; border-bottom: 1px solid var(--border);
  height: var(--topbar-h);
  min-height: var(--topbar-h);
}
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.logo-icon { display: flex; align-items: center; line-height: 1; }
.logo-icon img { height: 28px; width: auto; object-fit: contain; }
.logo-text { display: none; }
.sidebar-toggle { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 18px; padding: 4px 6px; border-radius: 4px; }
.sidebar-toggle:hover { color: var(--text); background: var(--bg-hover); }

.nav-user {
  display: flex; align-items: center; gap: 10px;
  padding: 14px; border-bottom: 1px solid var(--border);
}
.user-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(135deg, #1565d8, #4da3ff);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; flex-shrink: 0;
}
.user-name { font-weight: 600; font-size: 13px; }
.user-role { font-size: 11px; color: var(--text-muted); text-transform: capitalize; }

.nav-section-label {
  font-size: 10px; font-weight: 600; letter-spacing: 1.2px;
  text-transform: uppercase; color: var(--text-muted);
  padding: 14px 14px 4px;
}
.nav-list { list-style: none; padding: 0 8px; }
.nav-link {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: var(--radius); color: var(--text-dim);
  text-decoration: none; font-size: 13.5px; font-weight: 400;
  transition: all var(--transition); white-space: nowrap;
}
.nav-link:hover { background: var(--bg-hover); color: var(--text); }
.nav-link.active { background: var(--accent-glow); color: var(--accent); font-weight: 600; }
.nav-icon { font-size: 15px; flex-shrink: 0; width: 20px; text-align: center; }
.nav-logout:hover { color: var(--red); }

/* ── Main Content ──────────────────────────── */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1; min-width: 0;
  display: flex; flex-direction: column;
  transition: margin-left var(--transition);
}
.main-content.sidebar-collapsed { margin-left: 60px; }

/* ── Topbar ────────────────────────────────── */
.topbar {
  min-height: var(--topbar-h); background: var(--bg-card);
  border-top: 3px solid var(--accent);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 24px; position: sticky; top: 0; z-index: 50;
}
.topbar-left { display: flex; flex-direction: column; gap: 4px; justify-content: center; min-height: calc(var(--topbar-h) - 20px); }
.page-title { font-size: 16px; font-weight: 700; letter-spacing: -0.3px; }
.breadcrumb { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--text-muted); }
.breadcrumb a { color: var(--accent); text-decoration: none; }
.breadcrumb span { color: var(--border-light); }
.bc-current { color: var(--text-dim); }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }

/* Notifications */
.notif-btn { position: relative; cursor: pointer; padding: 6px; border-radius: 6px; color: var(--text-muted); }
.notif-btn:hover { background: var(--bg-hover); color: var(--text); }
.notif-count {
  position: absolute; top: 0; right: 0;
  background: var(--red); color: #fff; font-size: 10px; font-weight: 700;
  width: 16px; height: 16px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
}
.notif-panel {
  position: absolute; top: calc(var(--topbar-h) + 4px); right: 20px;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg);
  width: 320px; z-index: 200; box-shadow: var(--shadow);
}
.notif-panel-header { padding: 12px 16px; border-bottom: 1px solid var(--border); font-weight: 600; display: flex; justify-content: space-between; }
.mark-all-read { font-size: 11px; color: var(--accent); text-decoration: none; font-weight: 400; }
.notif-item { padding: 12px 16px; border-bottom: 1px solid var(--border); }
.notif-item:last-child { border-bottom: none; }
.notif-title { font-weight: 600; font-size: 13px; }
.notif-msg { font-size: 12px; color: var(--text-dim); margin-top: 2px; }
.notif-time { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

/* ── Page Content ──────────────────────────── */
.page-content { padding: 24px; flex: 1; }
.flash-container { padding: 0 24px; }

/* ── Flash Messages ────────────────────────── */
.flash {
  padding: 12px 16px; border-radius: var(--radius); margin-bottom: 16px;
  display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 500;
}
.flash-success { background: #16a34a20; border: 1px solid #16a34a40; color: #4ade80; }
.flash-error   { background: #dc262620; border: 1px solid #dc262640; color: #f87171; }
.flash-warning { background: #d9770620; border: 1px solid #d9770640; color: #fbbf24; }
.flash-info    { background: #1d4ed820; border: 1px solid #1d4ed840; color: #60a5fa; }

/* ── Cards ─────────────────────────────────── */
.card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 20px;
}
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.card-title { font-weight: 700; font-size: 15px; }
.card-subtitle { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* ── Stat Cards ────────────────────────────── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 18px; position: relative; overflow: hidden;
}
.stat-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--stat-color, var(--accent));
}
.stat-label { font-size: 11px; font-weight: 600; letter-spacing: 0.8px; text-transform: uppercase; color: var(--text-muted); }
.stat-value { font-size: 32px; font-weight: 700; font-family: var(--font-mono); margin: 8px 0 4px; color: var(--text); }
.stat-sub { font-size: 12px; color: var(--text-muted); }
.stat-icon { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); font-size: 28px; opacity: 0.12; }
.stat-card-link { display: block; cursor: pointer; transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease; }
.stat-card-link:hover { transform: translateY(-3px); box-shadow: 0 6px 20px rgba(0,0,0,.12); border-color: var(--stat-color, var(--accent)); }
.stat-card-link:hover .stat-value { color: var(--stat-color, var(--accent)); }
.stat-card-link .stat-arrow { position: absolute; bottom: 10px; right: 14px; font-size: 11px; color: var(--stat-color, var(--accent)); opacity: 0; transition: opacity 180ms ease; }
.stat-card-link:hover .stat-arrow { opacity: 0.8; }
html.dark .stat-card-link:hover { box-shadow: 0 6px 24px rgba(0,0,0,.4); }

/* ── Tables ────────────────────────────────── */
.table-wrap { overflow-x: auto; border-radius: var(--radius-lg); border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; }
thead { background: var(--bg-hover); }
th { padding: 12px 16px; text-align: left; font-size: 11px; font-weight: 600; letter-spacing: 0.8px; text-transform: uppercase; color: var(--text-muted); border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 12px 16px; font-size: 13px; border-bottom: 1px solid var(--border); color: var(--text-dim); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--bg-hover); color: var(--text); }
.actions-col { white-space: nowrap; }

/* ── Badges ────────────────────────────────── */
.risk-badge, .status-badge {
  display: inline-flex; align-items: center;
  padding: 3px 10px; border-radius: 100px; font-size: 11px; font-weight: 600; white-space: nowrap;
}
.overdue-tag { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 100px; font-size: 10px; font-weight: 700; background: #fee2e2; color: #dc2626; margin-left: 6px; }
.due-soon-tag { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 100px; font-size: 10px; font-weight: 700; background: #fef3c7; color: #d97706; margin-left: 6px; }

/* ── Buttons ───────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: var(--radius); font-size: 13px; font-weight: 600;
  cursor: pointer; text-decoration: none; border: 1px solid transparent;
  transition: all var(--transition); font-family: var(--font);
}
.btn-primary { background: var(--accent); color: #fff; border-color: var(--accent); box-shadow: 0 2px 8px #1565d830; }
.btn-primary:hover { background: var(--accent-dim); }
.btn-secondary { background: transparent; color: var(--text-dim); border-color: var(--border); }
.btn-secondary:hover { background: var(--bg-hover); color: var(--text); border-color: var(--border-light); }
.btn-danger { background: transparent; color: var(--red); border-color: #dc262640; }
.btn-danger:hover { background: #dc262620; }
.btn-success { background: var(--green); color: #fff; border-color: var(--green); }
.btn-success:hover { background: var(--green-dim); }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-icon { padding: 6px; border-radius: 6px; }

/* ── Forms ─────────────────────────────────── */
.form-grid { display: grid; gap: 20px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label { font-size: 12px; font-weight: 600; color: var(--text-dim); letter-spacing: 0.3px; }
.form-label .req { color: var(--red); margin-left: 3px; }
.form-control {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--text); font-family: var(--font);
  font-size: 13px; padding: 9px 12px; transition: border-color var(--transition);
  width: 100%;
}
.form-control:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.form-control::placeholder { color: var(--text-muted); }
textarea.form-control { resize: vertical; min-height: 90px; }
select.form-control { cursor: pointer; }
.form-hint { font-size: 11px; color: var(--text-muted); }
.form-actions { display: flex; gap: 10px; align-items: center; padding-top: 8px; }

/* ── Score Display ─────────────────────────── */
.score-display {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 50%;
  font-weight: 700; font-size: 16px; font-family: var(--font-mono);
}

/* ── Section Toolbar ───────────────────────── */
.section-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px; gap: 12px; flex-wrap: wrap;
}
.search-box {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 7px 12px; min-width: 220px;
}
.search-box input { background: none; border: none; color: var(--text); font-size: 13px; font-family: var(--font); outline: none; width: 100%; }
.search-box input::placeholder { color: var(--text-muted); }
.filter-bar { display: flex; gap: 8px; flex-wrap: wrap; }
.filter-select { background: var(--bg); border: 1px solid var(--border); color: var(--text-dim); border-radius: var(--radius); padding: 7px 10px; font-size: 12px; cursor: pointer; }

/* ── Pagination ────────────────────────────── */
.pagination { display: flex; gap: 6px; align-items: center; margin-top: 16px; justify-content: center; }
.pg-btn {
  padding: 6px 12px; border-radius: var(--radius); border: 1px solid var(--border);
  color: var(--text-dim); text-decoration: none; font-size: 13px;
  background: var(--bg-card); transition: all var(--transition);
}
.pg-btn:hover { background: var(--bg-hover); color: var(--text); }
.pg-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ── Detail View ───────────────────────────── */
.detail-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; }
.detail-section { margin-bottom: 20px; }
.detail-section-title { font-size: 12px; font-weight: 600; letter-spacing: 0.8px; text-transform: uppercase; color: var(--text-muted); margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.detail-row { display: flex; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.detail-row:last-child { border-bottom: none; }
.detail-label { color: var(--text-muted); width: 160px; flex-shrink: 0; font-weight: 500; }
.detail-value { color: var(--text); flex: 1; }

/* ── Heatmap ───────────────────────────────── */
.heatmap-grid { display: grid; grid-template-columns: auto repeat(5, 1fr); gap: 4px; max-width: 400px; }
.heatmap-cell {
  width: 50px; height: 50px; border-radius: 6px; display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: #fff; cursor: default;
}
.heatmap-label { display: flex; align-items: center; justify-content: flex-end; padding-right: 8px; font-size: 11px; color: var(--text-muted); white-space: nowrap; }
.heatmap-axis { display: flex; align-items: center; justify-content: center; font-size: 10px; color: var(--text-muted); }

/* ── Charts ────────────────────────────────── */
.chart-bar-wrap { display: flex; flex-direction: column; gap: 8px; }
.chart-bar-row { display: flex; align-items: center; gap: 10px; font-size: 12px; }
.chart-bar-label { width: 120px; color: var(--text-muted); text-align: right; flex-shrink: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chart-bar-track { flex: 1; height: 20px; background: var(--bg); border-radius: 100px; overflow: hidden; }
.chart-bar-fill { height: 100%; border-radius: 100px; transition: width 600ms ease; }
.chart-bar-val { width: 30px; color: var(--text-dim); font-family: var(--font-mono); font-size: 12px; }

/* ── Tabs ──────────────────────────────────── */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
.tab-btn {
  padding: 10px 18px; background: none; border: none; color: var(--text-muted);
  font-family: var(--font); font-size: 13px; font-weight: 500; cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px; transition: all var(--transition);
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── Modal ─────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.7); z-index: 300;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity var(--transition);
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); width: 100%; max-width: 600px;
  max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow);
  transform: translateY(20px); transition: transform var(--transition);
}
.modal-overlay.open .modal { transform: translateY(0); }
.modal-header { padding: 20px 24px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.modal-title { font-weight: 700; font-size: 16px; }
.modal-close { background: none; border: none; color: var(--text-muted); font-size: 20px; cursor: pointer; padding: 2px 6px; border-radius: 4px; }
.modal-close:hover { background: var(--bg-hover); color: var(--text); }
.modal-body { padding: 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }

/* ── Empty State ───────────────────────────── */
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.empty-icon { font-size: 48px; margin-bottom: 16px; opacity: 0.5; }
.empty-title { font-size: 16px; font-weight: 600; color: var(--text-dim); margin-bottom: 8px; }
.empty-text { font-size: 13px; }

/* ── Login Page ────────────────────────────── */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(180deg, #f8fbff 0%, #eef4fb 100%);
  background-image: radial-gradient(ellipse at 28% 28%, #1565d818 0%, transparent 55%),
                    radial-gradient(ellipse at 72% 72%, #4da3ff12 0%, transparent 55%);
}
:root[data-theme="dark"] .login-wrap,
body[data-theme="dark"] .login-wrap {
  background: #06090f;
  background-image: radial-gradient(ellipse at 28% 28%, #1565d828 0%, transparent 55%),
                    radial-gradient(ellipse at 72% 72%, #4da3ff14 0%, transparent 55%);
}
.login-card {
  background: var(--bg-card); border: 1px solid #1565d840;
  border-top: 3px solid var(--accent);
  border-radius: var(--radius-lg); padding: 40px; width: 100%; max-width: 400px;
  box-shadow: 0 8px 40px rgba(21,101,216,0.15), 0 4px 24px rgba(0,0,0,0.5);
}
.login-logo { text-align: center; margin-bottom: 32px; }
.login-logo .logo-icon { display: flex; justify-content: center; margin-bottom: 4px; }
.login-logo .logo-icon img { height: 52px; width: auto; object-fit: contain; }
.login-logo h1 { font-size: 20px; font-weight: 700; margin-top: 8px; }
.login-logo p { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* ── Text Utilities ────────────────────────── */
.text-muted { color: var(--text-muted) !important; }
.text-dim { color: var(--text-dim) !important; }
.text-accent { color: var(--accent) !important; }
.text-green { color: var(--green) !important; }
.text-red { color: var(--red) !important; }
.text-amber { color: var(--amber) !important; }
.text-sm { font-size: 12px; }
.text-xs { font-size: 11px; }
.text-mono { font-family: var(--font-mono); }
.fw-700 { font-weight: 700; }
.mt-4 { margin-top: 4px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.flex-1 { flex: 1; }
.w-100 { width: 100%; }

/* ── Responsive ────────────────────────────── */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.mobile-open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
}

/* ── Scrollbar ─────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-light); }

/* ── Progress Bar ──────────────────────────── */
.progress-bar { height: 6px; background: var(--bg); border-radius: 100px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 100px; }
.progress-green { background: var(--green); }
.progress-amber { background: var(--amber); }
.progress-red { background: var(--red); }
.progress-accent { background: var(--accent); }

/* ── Info Alert ────────────────────────────── */
.alert { padding: 12px 16px; border-radius: var(--radius); font-size: 13px; margin-bottom: 16px; }
.alert-info { background: #1d4ed820; border: 1px solid #1d4ed840; color: #60a5fa; }
.alert-warning { background: #d9770620; border: 1px solid #d9770640; color: #fbbf24; }
.alert-danger { background: #dc262620; border: 1px solid #dc262640; color: #f87171; }
.alert-success { background: #16a34a20; border: 1px solid #16a34a40; color: #4ade80; }

/* ── Two-col grid ──────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; }
@media (max-width: 960px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

/* ── Action Links ──────────────────────────── */
a { color: var(--accent); }
a.plain-link { color: var(--text-dim); text-decoration: none; }
a.plain-link:hover { color: var(--text); }
.action-link { color: var(--accent); text-decoration: none; font-size: 12px; font-weight: 500; }
.action-link:hover { color: var(--text); }
.action-link.danger { color: var(--red); }

/* ── Sub-nav (module tabs) ─────────────────── */
.module-nav { display: flex; gap: 4px; margin-bottom: 24px; flex-wrap: wrap; }
.module-nav a {
  padding: 7px 14px; border-radius: var(--radius); font-size: 12.5px; font-weight: 500;
  color: var(--text-muted); text-decoration: none; transition: all var(--transition);
  border: 1px solid transparent;
}
.module-nav a:hover { background: var(--bg-hover); color: var(--text); }
.module-nav a.active { background: var(--accent-glow); color: var(--accent); border-color: var(--accent-dim); }

/* ── Divider ───────────────────────────────── */
.divider { border: none; border-top: 1px solid var(--border); margin: 20px 0; }

/* ── Rich text output ──────────────────────── */
.rich-text { font-size: 13px; line-height: 1.8; color: var(--text-dim); white-space: pre-wrap; }


.theme-toggle { min-width: 118px; justify-content: center; }
.theme-toggle-icon { font-size: 13px; line-height: 1; }
.login-theme-row { display:flex; justify-content:flex-end; margin-bottom: 10px; }


.page-scope-pill{display:inline-flex;align-items:center;gap:6px;margin-top:6px;padding:4px 10px;border-radius:999px;background:var(--panel);border:1px solid var(--border);font-size:11px;color:var(--text-muted);font-weight:600}
.org-filter-form{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.org-filter-label{font-size:11px;color:var(--text-muted);font-weight:600}
.pdf-export-btn{white-space:nowrap}
.pdf-exporting .topbar,.pdf-exporting .sidebar,.pdf-exporting .module-nav,.pdf-exporting .topbar-actions,.pdf-exporting .notif-panel,.pdf-exporting .flash-container,.pdf-exporting .org-filter-form{display:none!important}
.pdf-exporting .main-content{margin-left:0!important}
.pdf-exporting .page-content{padding:0!important}
@media print{
  body{-webkit-print-color-adjust:exact;print-color-adjust:exact;background:#fff!important}
  .sidebar,.topbar,.module-nav,.flash-container,.notif-panel,.topbar-actions,.org-filter-form{display:none!important}
  .main-content{margin-left:0!important}
  .page-content{padding:0!important}
}

.action-link + .action-link{margin-left:10px}
.export-report-wrap{max-width:1480px;margin:0 auto;padding:24px;background:var(--bg)}
.export-report-header{display:flex;justify-content:space-between;align-items:flex-start;gap:16px;margin-bottom:18px;flex-wrap:wrap}
.export-report-title{font-size:24px;font-weight:700;letter-spacing:-.4px}
.export-report-meta{display:flex;gap:10px;flex-wrap:wrap;margin-top:8px}
.export-chip{display:inline-flex;align-items:center;padding:6px 10px;border-radius:999px;background:var(--bg-card);border:1px solid var(--border);font-size:11px;color:var(--text-dim)}
.export-report-card{background:var(--bg-card);border:1px solid var(--border);border-radius:12px;box-shadow:var(--shadow);overflow:hidden}
.export-report-toolbar{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:16px 18px;border-bottom:1px solid var(--border);background:linear-gradient(180deg,var(--bg-card),var(--bg-hover))}
.export-report-toolbar .btn{white-space:nowrap}
.export-report-table{width:100%;border-collapse:collapse}
.export-report-table th,.export-report-table td{padding:10px 12px;border-bottom:1px solid var(--border);vertical-align:top;text-align:left;font-size:12px}
.export-report-table th{background:var(--bg-hover);font-size:11px;text-transform:uppercase;letter-spacing:.04em;color:var(--text-muted)}
.export-report-table tr:nth-child(even) td{background:#f7faff}
body[data-theme="dark"] .export-report-table tr:nth-child(even) td{background:#162033}
.export-report-table tr:last-child td{border-bottom:none}
.export-empty{padding:28px;text-align:center;color:var(--text-muted)}
.export-kpi-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:12px;margin:0 0 16px}
.export-kpi{background:var(--bg-card);border:1px solid var(--border);border-left:4px solid var(--accent);border-radius:12px;padding:14px 16px;box-shadow:var(--shadow)}
.export-kpi-label{font-size:11px;color:var(--text-muted);text-transform:uppercase;letter-spacing:.04em}
.export-kpi-value{font-size:24px;font-weight:700;letter-spacing:-.03em;margin-top:4px}
.export-kpi-sub{font-size:11px;color:var(--text-dim);margin-top:4px}
.pdf-export-surface{background:var(--bg)}
.pdf-only-note{font-size:11px;color:var(--text-muted)}
@media print{.export-report-wrap{padding:0;background:#fff}.export-report-card,.export-kpi{box-shadow:none}.export-report-toolbar,.export-page-actions{display:none!important}}
