﻿/**
 * Researcher — Research Analyst glass theme (preview)
 * Scoped to body.role-researcher. Calm analytic slate/sage — privacy-first.
 *
 * Theme attribute lives on <html data-theme="...">
 * Backup: _backup_pre_researcher_glass/ — say "revert" or "keep changes".
 */

/* ——— Light canvas ——— */
body.role-researcher {
  background:
    radial-gradient(ellipse 90% 70% at 8% -10%, rgba(180, 200, 210, 0.45), transparent 52%),
    radial-gradient(ellipse 70% 55% at 100% 0%, rgba(30, 58, 76, 0.14), transparent 48%),
    radial-gradient(ellipse 60% 40% at 50% 100%, rgba(220, 230, 236, 0.75), transparent 55%),
    linear-gradient(180deg, #eef1f4 0%, #f2f4f6 40%, #e8edf1 100%);
  background-attachment: fixed;
}

/* â€”â€”â€” Dark canvas (Clasy-inspired: charcoal + soft color blooms) â€”â€”â€” */
html[data-theme="dark"] body.role-researcher {
  --glass-ink: #f4f7f5;
  --glass-ink-soft: #c5d0c9;
  --glass-ink-mute: #9aaba2;
  --glass-label: #9fe0bc;
  --glass-rim: rgba(255, 255, 255, 0.14);
  --glass-rim-strong: rgba(255, 255, 255, 0.22);
  --glass-panel: linear-gradient(
    165deg,
    rgba(48, 58, 52, 0.92) 0%,
    rgba(28, 34, 31, 0.88) 45%,
    rgba(22, 26, 24, 0.9) 100%
  );
  --glass-panel-soft: linear-gradient(
    165deg,
    rgba(255, 255, 255, 0.1) 0%,
    rgba(255, 255, 255, 0.04) 100%
  );
  --glass-warm: #8ab0bc;
  --glass-mint: #7dcea0;
  color: var(--glass-ink);
  background:
    radial-gradient(ellipse 70% 55% at 12% 0%, rgba(90, 140, 155, 0.16), transparent 55%),
    radial-gradient(ellipse 65% 50% at 92% 8%, rgba(125, 206, 160, 0.14), transparent 50%),
    radial-gradient(ellipse 55% 45% at 50% 100%, rgba(80, 120, 100, 0.12), transparent 55%),
    linear-gradient(180deg, #0c0e0d 0%, #101312 42%, #0e1210 100%);
  background-attachment: fixed;
}

/* â€”â€”â€” Shell / sidebar â€”â€”â€” */
body.role-researcher .app-shell,
body.role-researcher .app-main,
body.role-researcher .app-main > main,
body.role-researcher #app-header {
  background: transparent !important;
}

body.role-researcher .app-sidebar,
body.role-researcher .sidebar-research {
  background: rgba(255, 255, 255, 0.42);
  border-right: 1px solid rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(22px) saturate(1.4);
  -webkit-backdrop-filter: blur(22px) saturate(1.4);
  box-shadow:
    4px 0 32px rgba(30, 58, 76, 0.07),
    1px 0 0 rgba(255, 255, 255, 0.4) inset;
}

html[data-theme="dark"] body.role-researcher .app-sidebar,
html[data-theme="dark"] body.role-researcher .sidebar-research {
  background: linear-gradient(180deg, rgba(32, 38, 35, 0.92), rgba(18, 22, 20, 0.94));
  border-right: 1px solid var(--glass-rim);
  box-shadow: 8px 0 40px rgba(0, 0, 0, 0.45);
}

body.role-researcher .sidebar-brand {
  background: transparent;
  border-bottom: 1px solid rgba(255, 255, 255, 0.35);
}

html[data-theme="dark"] body.role-researcher .sidebar-brand {
  border-bottom-color: var(--glass-rim);
}

html[data-theme="dark"] body.role-researcher .sidebar-brand-text strong,
html[data-theme="dark"] body.role-researcher .sidebar-brand-text {
  color: var(--glass-ink);
}

html[data-theme="dark"] body.role-researcher .sidebar-brand-text span,
html[data-theme="dark"] body.role-researcher .sidebar-section-label,
html[data-theme="dark"] body.role-researcher .sidebar-foot .platform-owner-note {
  color: var(--glass-ink-mute) !important;
}

body.role-researcher .sidebar-nav .tab {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 14px;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease;
}

body.role-researcher .sidebar-nav .tab:hover {
  background: rgba(255, 255, 255, 0.45);
  border-color: rgba(255, 255, 255, 0.5);
  color: var(--text);
}

body.role-researcher .sidebar-nav .tab.active {
  background: rgba(216, 235, 227, 0.85);
  border-color: rgba(61, 90, 108, 0.2);
  color: #0a2e20;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.55) inset;
}

body.role-researcher .sidebar-nav .tab.active::before {
  background: #1e3a4c;
  border-radius: 999px;
}

html[data-theme="dark"] body.role-researcher .sidebar-nav .tab {
  color: var(--glass-ink-soft);
}

html[data-theme="dark"] body.role-researcher .sidebar-nav .tab:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: var(--glass-rim);
  color: var(--glass-ink);
}

html[data-theme="dark"] body.role-researcher .sidebar-nav .tab.active {
  background: linear-gradient(135deg, rgba(90, 140, 155, 0.95), rgba(61, 110, 125, 0.9));
  border-color: rgba(90, 140, 155, 0.5);
  color: #14110e;
  box-shadow: 0 8px 22px rgba(61, 110, 125, 0.22);
}

html[data-theme="dark"] body.role-researcher .sidebar-nav .tab.active::before {
  display: none;
}

body.role-researcher .sidebar-foot {
  border-top: 1px solid rgba(255, 255, 255, 0.35);
}

html[data-theme="dark"] body.role-researcher .sidebar-foot {
  border-top-color: var(--glass-rim);
}

/* Header buttons */
body.role-researcher #app-header button.secondary,
body.role-researcher #app-header .toolbar-btn {
  background: rgba(255, 255, 255, 0.48);
  border: 1px solid rgba(255, 255, 255, 0.62);
  color: #0a2e20;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.5) inset;
  border-radius: 14px;
}

html[data-theme="dark"] body.role-researcher #app-header button.secondary,
html[data-theme="dark"] body.role-researcher #app-header .toolbar-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--glass-rim-strong);
  color: var(--glass-ink);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.08) inset;
}

html[data-theme="dark"] body.role-researcher #app-header button.secondary:hover,
html[data-theme="dark"] body.role-researcher #app-header .toolbar-btn:hover {
  background: rgba(255, 255, 255, 0.14);
}

html[data-theme="dark"] body.role-researcher .dash-title,
html[data-theme="dark"] body.role-researcher .map-title,
html[data-theme="dark"] body.role-researcher #app-header h1,
html[data-theme="dark"] body.role-researcher .header-user {
  color: var(--glass-ink) !important;
}

html[data-theme="dark"] body.role-researcher .dash-subtitle,
html[data-theme="dark"] body.role-researcher .map-subtitle,
html[data-theme="dark"] body.role-researcher .meta,
html[data-theme="dark"] body.role-researcher #filter-summary {
  color: var(--glass-ink-mute) !important;
}

/* â€”â€”â€” Shared glass surfaces (light) â€”â€”â€” */
body.role-researcher .dash-kpi,
body.role-researcher .dash-card,
body.role-researcher .dash-workload,
body.role-researcher .stat-card,
body.role-researcher .officer-case-card,
body.role-researcher .officer-next-row,
body.role-researcher .table-wrap,
body.role-researcher .reports-filters,
body.role-researcher .map-toolbar,
body.role-researcher .map-legend,
body.role-researcher #map-legend,
body.role-researcher .map-legend-panel,
body.role-researcher .notif-card,
body.role-researcher .notification-item,
body.role-researcher .inline-form,
body.role-researcher .dash-alert:not(.hidden) {
  background: rgba(255, 255, 255, 0.44);
  border: 1px solid rgba(255, 255, 255, 0.58);
  backdrop-filter: blur(18px) saturate(1.35);
  -webkit-backdrop-filter: blur(18px) saturate(1.35);
  box-shadow:
    0 10px 32px rgba(30, 58, 76, 0.09),
    0 1px 0 rgba(255, 255, 255, 0.65) inset;
}

/* Dark glass panels â€” lifted charcoal with rim light + top sheen */
html[data-theme="dark"] body.role-researcher .dash-kpi,
html[data-theme="dark"] body.role-researcher .dash-card,
html[data-theme="dark"] body.role-researcher .dash-workload,
html[data-theme="dark"] body.role-researcher .stat-card,
html[data-theme="dark"] body.role-researcher .officer-case-card,
html[data-theme="dark"] body.role-researcher .officer-next-row,
html[data-theme="dark"] body.role-researcher .table-wrap,
html[data-theme="dark"] body.role-researcher .reports-filters,
html[data-theme="dark"] body.role-researcher .map-toolbar,
html[data-theme="dark"] body.role-researcher .map-legend,
html[data-theme="dark"] body.role-researcher #map-legend,
html[data-theme="dark"] body.role-researcher .map-legend-panel,
html[data-theme="dark"] body.role-researcher .notif-card,
html[data-theme="dark"] body.role-researcher .notification-item,
html[data-theme="dark"] body.role-researcher .inline-form,
html[data-theme="dark"] body.role-researcher .dash-alert:not(.hidden),
html[data-theme="dark"] body.role-researcher #tab-notifications li,
html[data-theme="dark"] body.role-researcher .notification-row {
  background: var(--glass-panel);
  border: 1px solid var(--glass-rim);
  color: var(--glass-ink);
  backdrop-filter: blur(20px) saturate(1.25);
  -webkit-backdrop-filter: blur(20px) saturate(1.25);
  box-shadow:
    0 14px 40px rgba(0, 0, 0, 0.45),
    0 1px 0 rgba(255, 255, 255, 0.12) inset,
    0 -1px 0 rgba(0, 0, 0, 0.35) inset;
}

html[data-theme="dark"] body.role-researcher .dash-kpi:hover,
html[data-theme="dark"] body.role-researcher .officer-case-card:hover,
html[data-theme="dark"] body.role-researcher .officer-next-row:hover {
  border-color: var(--glass-rim-strong);
  box-shadow:
    0 18px 48px rgba(0, 0, 0, 0.5),
    0 1px 0 rgba(255, 255, 255, 0.16) inset;
}

/* â€”â€”â€” My Day â€”â€”â€” */
body.role-researcher .dash-kpi {
  border-radius: 22px;
  padding: 20px 22px;
  min-height: 120px;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

body.role-researcher .dash-kpi:hover {
  transform: translateY(-2px);
}

html[data-theme="dark"] body.role-researcher .dash-kpi-label {
  color: var(--glass-ink-mute) !important;
}

html[data-theme="dark"] body.role-researcher .dash-kpi-value {
  color: var(--glass-ink) !important;
}

html[data-theme="dark"] body.role-researcher .dash-kpi-value.tone-info {
  color: var(--glass-mint) !important;
}

html[data-theme="dark"] body.role-researcher .dash-kpi-value.tone-danger {
  color: #ff8a80 !important;
}

html[data-theme="dark"] body.role-researcher .dash-kpi-value.tone-warning {
  color: #ffcc80 !important;
}

body.role-researcher .dash-kpi-featured {
  background: linear-gradient(160deg, #0d4832 0%, #166b4a 100%) !important;
  border: 1px solid transparent !important;
  color: #fff !important;
  box-shadow:
    0 16px 40px rgba(13, 72, 50, 0.28),
    0 1px 0 rgba(255, 255, 255, 0.22) inset !important;
}

body.role-researcher .dash-kpi-featured .dash-kpi-label,
body.role-researcher .dash-kpi-featured .dash-kpi-value,
body.role-researcher .dash-kpi-featured .dash-kpi-value.tone-info,
body.role-researcher .dash-kpi-featured .dash-kpi-value.tone-danger,
body.role-researcher .dash-kpi-featured .dash-kpi-value.tone-warning {
  color: #fff !important;
}

html[data-theme="dark"] body.role-researcher .dash-kpi-featured {
  background: linear-gradient(160deg, #0d4832 0%, #166b4a 100%) !important;
  border: 1px solid rgba(184, 224, 200, 0.28) !important;
  color: #fff !important;
  box-shadow:
    0 18px 44px rgba(13, 72, 50, 0.45),
    0 1px 0 rgba(255, 255, 255, 0.18) inset !important;
}

html[data-theme="dark"] body.role-researcher .dash-kpi-featured .dash-kpi-label,
html[data-theme="dark"] body.role-researcher .dash-kpi-featured .dash-kpi-value,
html[data-theme="dark"] body.role-researcher .dash-kpi-featured .dash-kpi-value.tone-info,
html[data-theme="dark"] body.role-researcher .dash-kpi-featured .dash-kpi-value.tone-danger,
html[data-theme="dark"] body.role-researcher .dash-kpi-featured .dash-kpi-value.tone-warning {
  color: #fff !important;
}

body.role-researcher .dash-card {
  border-radius: 22px;
  padding: 18px 20px 14px;
}

html[data-theme="dark"] body.role-researcher .dash-card-head h3,
html[data-theme="dark"] body.role-researcher .dash-card-head .linkish {
  color: var(--glass-ink) !important;
}

html[data-theme="dark"] body.role-researcher .dash-list li {
  color: var(--glass-ink-soft);
  border-color: rgba(255, 255, 255, 0.08);
}

body.role-researcher .dash-alert:not(.hidden) {
  border-radius: 18px;
  padding: 14px 16px;
}

html[data-theme="dark"] body.role-researcher .dash-alert:not(.hidden) {
  background: linear-gradient(135deg, rgba(226, 168, 120, 0.18), rgba(125, 206, 160, 0.1));
  border-color: rgba(226, 168, 120, 0.35);
  color: var(--glass-ink);
}

/* â€”â€”â€” Next up â€”â€”â€” */
body.role-researcher .officer-next-row {
  border-radius: 16px;
  padding: 12px 14px;
}

html[data-theme="dark"] body.role-researcher .officer-next-token {
  color: var(--glass-mint) !important;
}

html[data-theme="dark"] body.role-researcher .officer-next-meta {
  color: var(--glass-ink-mute) !important;
}

html[data-theme="dark"] body.role-researcher .officer-next-row.is-urgent {
  background: linear-gradient(165deg, rgba(90, 40, 40, 0.75), rgba(40, 24, 24, 0.85));
  border-color: rgba(255, 138, 128, 0.35);
}

html[data-theme="dark"] body.role-researcher .officer-next-row .status-advance-btn {
  background: linear-gradient(135deg, #7dcea0, #4ea87a);
  color: #0c1611;
  border: none;
}

html[data-theme="dark"] body.role-researcher .officer-next-row .btn-officer-nav,
html[data-theme="dark"] body.role-researcher .officer-next-row .secondary {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--glass-rim-strong);
  color: var(--glass-ink);
  width: auto;
  margin-top: 0;
}

/* â€”â€”â€” My Cases â€”â€”â€” */
body.role-researcher .officer-case-card {
  border-radius: 22px;
  min-height: 0;
}

html[data-theme="dark"] body.role-researcher .officer-case-token {
  color: var(--glass-mint) !important;
}

html[data-theme="dark"] body.role-researcher .officer-case-title,
html[data-theme="dark"] body.role-researcher .officer-case-title-btn {
  color: var(--glass-ink) !important;
}

html[data-theme="dark"] body.role-researcher .officer-case-meta {
  color: var(--glass-ink-mute) !important;
}

html[data-theme="dark"] body.role-researcher .officer-case-card.is-urgent {
  border-color: rgba(255, 138, 128, 0.4);
  background: linear-gradient(165deg, rgba(72, 36, 36, 0.85), rgba(28, 22, 22, 0.9));
}

html[data-theme="dark"] body.role-researcher .officer-case-card.is-selected {
  border-color: rgba(125, 206, 160, 0.55);
  box-shadow: 0 0 0 2px rgba(125, 206, 160, 0.25), 0 14px 40px rgba(0, 0, 0, 0.45);
}

body.role-researcher .officer-chip {
  background: rgba(255, 255, 255, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

html[data-theme="dark"] body.role-researcher .officer-chip {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--glass-rim);
  color: var(--glass-ink-soft);
  box-shadow: none;
}

body.role-researcher .officer-chip.active,
html[data-theme="dark"] body.role-researcher .officer-chip.active {
  background: linear-gradient(135deg, rgba(125, 206, 160, 0.95), rgba(78, 168, 122, 0.9));
  border-color: rgba(125, 206, 160, 0.5);
  color: #0c1611;
  box-shadow: 0 8px 20px rgba(125, 206, 160, 0.2);
}

html[data-theme="dark"] body.role-researcher .stat-card,
html[data-theme="dark"] body.role-researcher .stat-card strong {
  color: var(--glass-ink);
}

html[data-theme="dark"] body.role-researcher .chip-sev-high,
html[data-theme="dark"] body.role-researcher .chip-sev-critical {
  background: rgba(255, 138, 128, 0.18) !important;
  color: #ffb4ae !important;
  border: 1px solid rgba(255, 138, 128, 0.28);
}

html[data-theme="dark"] body.role-researcher .chip-status,
html[data-theme="dark"] body.role-researcher .chip-sev-low {
  background: rgba(125, 206, 160, 0.16) !important;
  color: #b6f0d0 !important;
  border: 1px solid rgba(125, 206, 160, 0.28);
}

html[data-theme="dark"] body.role-researcher .chip-sev-medium {
  background: rgba(255, 204, 128, 0.16) !important;
  color: #ffe0a8 !important;
  border: 1px solid rgba(255, 204, 128, 0.28);
}

html[data-theme="dark"] body.role-researcher .chip-assigned {
  background: rgba(144, 180, 255, 0.16) !important;
  color: #b8d0ff !important;
  border: 1px solid rgba(144, 180, 255, 0.28);
}

body.role-researcher .reports-filters {
  border-radius: 18px;
  padding: 14px 16px;
  margin-bottom: 14px;
}

body.role-researcher .reports-filters input,
body.role-researcher .reports-filters select {
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.65);
}

html[data-theme="dark"] body.role-researcher .reports-filters input,
html[data-theme="dark"] body.role-researcher .reports-filters select {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--glass-rim);
  color: var(--glass-ink);
}

html[data-theme="dark"] body.role-researcher .officer-case-actions .status-advance-btn {
  background: linear-gradient(135deg, #7dcea0, #4ea87a);
  color: #0c1611;
  border: none;
  box-shadow: 0 8px 20px rgba(125, 206, 160, 0.22);
}

html[data-theme="dark"] body.role-researcher .officer-case-actions .btn-officer-nav,
html[data-theme="dark"] body.role-researcher .officer-case-actions .secondary {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--glass-rim-strong);
  color: var(--glass-ink);
}

/* â€”â€”â€” Field Map â€”â€”â€” */
body.role-researcher .map-toolbar,
body.role-researcher .map-legend,
body.role-researcher #map-legend,
body.role-researcher .map-legend-panel {
  border-radius: 16px;
  padding: 12px 16px;
}

body.role-researcher #map {
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.55);
}

html[data-theme="dark"] body.role-researcher #map {
  border: 1px solid var(--glass-rim);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
}

html[data-theme="dark"] body.role-researcher .map-legend-panel strong,
html[data-theme="dark"] body.role-researcher .map-legend,
html[data-theme="dark"] body.role-researcher #map-legend {
  color: var(--glass-ink-soft);
}

html[data-theme="dark"] body.role-researcher .map-toolbar .toolbar-btn,
html[data-theme="dark"] body.role-researcher .map-toolbar button.secondary {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--glass-rim-strong);
  color: var(--glass-ink);
  width: auto;
  margin-top: 0;
  border-radius: 12px;
}

/* â€”â€”â€” Notifications â€”â€”â€” */
body.role-researcher #tab-notifications li,
body.role-researcher .notification-row {
  border-radius: 14px;
  margin-bottom: 8px;
  padding: 12px 14px;
}

html[data-theme="dark"] body.role-researcher .table-wrap th {
  color: var(--glass-ink-mute);
  background: rgba(255, 255, 255, 0.04);
}

html[data-theme="dark"] body.role-researcher .table-wrap td {
  color: var(--glass-ink-soft);
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

html[data-theme="dark"] body.role-researcher .leaflet-popup-content-wrapper {
  background: linear-gradient(165deg, rgba(40, 48, 44, 0.96), rgba(22, 26, 24, 0.96));
  border: 1px solid var(--glass-rim);
  color: var(--glass-ink);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
}

html[data-theme="dark"] body.role-researcher .leaflet-popup-content-wrapper .meta {
  color: var(--glass-ink-mute) !important;
}


/* â€”â€”â€” Agency desk surfaces (Incidents + My Day + tabs) â€”â€”â€” */
body.role-researcher .agency-incidents-card,
body.role-researcher #dash-ops-queues .dash-card,
body.role-researcher .dash-kpi:not(.dash-kpi-featured),
body.role-researcher .dash-workload,
body.role-researcher #tab-performance .table-wrap,
body.role-researcher #tab-analytics .chart-card,
body.role-researcher #tab-analytics .stat-card,
body.role-researcher #tab-users .table-wrap,
body.role-researcher #tab-users .inline-form,
body.role-researcher #tab-notifications .table-wrap {
  background: rgba(255, 255, 255, 0.52) !important;
  border: 1px solid rgba(255, 255, 255, 0.62) !important;
  backdrop-filter: blur(18px) saturate(1.35);
  -webkit-backdrop-filter: blur(18px) saturate(1.35);
  box-shadow:
    0 10px 28px rgba(13, 72, 50, 0.07),
    0 1px 0 rgba(255, 255, 255, 0.55) inset;
}

body.role-researcher .agency-incidents-card {
  border-radius: 20px;
  overflow: hidden;
}

body.role-researcher .agency-incidents-table thead th {
  background: rgba(228, 242, 234, 0.72) !important;
}

body.role-researcher .agency-desk-chips .officer-chip {
  background: rgba(255, 255, 255, 0.55);
  border-color: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px);
}

body.role-researcher .agency-desk-chips .officer-chip.active {
  background: #1e3a4c;
  border-color: #0a2e20;
  color: #fff;
}

body.role-researcher .case-drawer-root.case-drawer-agency .case-drawer,
body.role-researcher .case-drawer-root.case-drawer-agency #case-drawer {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(24px) saturate(1.4);
  -webkit-backdrop-filter: blur(24px) saturate(1.4);
  box-shadow: 0 24px 64px rgba(13, 72, 50, 0.18);
}

body.role-researcher .case-drawer-root.case-drawer-agency .wb-card {
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(12px);
}

html[data-theme="dark"] body.role-researcher .agency-incidents-card,
html[data-theme="dark"] body.role-researcher #dash-ops-queues .dash-card,
html[data-theme="dark"] body.role-researcher .dash-kpi:not(.dash-kpi-featured),
html[data-theme="dark"] body.role-researcher .dash-workload,
html[data-theme="dark"] body.role-researcher #tab-performance .table-wrap,
html[data-theme="dark"] body.role-researcher #tab-analytics .chart-card,
html[data-theme="dark"] body.role-researcher #tab-analytics .stat-card,
html[data-theme="dark"] body.role-researcher #tab-users .table-wrap,
html[data-theme="dark"] body.role-researcher #tab-users .inline-form,
html[data-theme="dark"] body.role-researcher #tab-notifications .table-wrap {
  background: var(--glass-panel) !important;
  border-color: var(--glass-rim) !important;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}

html[data-theme="dark"] body.role-researcher .agency-incidents-table thead th {
  background: rgba(111, 191, 147, 0.14) !important;
  color: var(--glass-label) !important;
}

html[data-theme="dark"] body.role-researcher .case-drawer-root.case-drawer-agency .case-drawer,
html[data-theme="dark"] body.role-researcher .case-drawer-root.case-drawer-agency #case-drawer {
  background: var(--glass-panel);
  border-color: var(--glass-rim);
}

html[data-theme="dark"] body.role-researcher .agency-incidents-sub,
html[data-theme="dark"] body.role-researcher .agency-token-cat,
html[data-theme="dark"] body.role-researcher .agency-status {
  color: var(--glass-ink-mute) !important;
}

html[data-theme="dark"] body.role-researcher .agency-token-link,
html[data-theme="dark"] body.role-researcher .agency-incidents-head h2 {
  color: var(--glass-ink) !important;
}

/* Agency workbench action controls inside glass modal */
body.role-researcher .agency-wb-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  margin-top: 12px;
}

body.role-researcher .agency-wb-actions .assign-select,
body.role-researcher .agency-wb-actions .status-select,
body.role-researcher .agency-wb-actions .status-advance-btn,
body.role-researcher .agency-wb-actions .secondary,
body.role-researcher .agency-wb-actions .badge,
body.role-researcher .agency-wb-actions .meta,
body.role-researcher .agency-wb-actions a {
  width: auto;
  max-width: 100%;
  margin-top: 0;
}

body.role-researcher .agency-wb-actions .assign-select,
body.role-researcher .agency-wb-actions .status-select {
  width: 100%;
}

/* â€”â€”â€” Case decision desk panel (Figma) â€”â€”â€” */
.chip-unassigned {
  background: #fff4e5;
  color: #c26a00;
}

body.role-researcher .case-drawer-root.case-drawer-agency .case-drawer-kicker {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #1e3a4c !important;
}

body.role-researcher .case-drawer-root.case-drawer-agency .wb-card-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #0a2e20;
}

body.role-researcher .case-drawer-root.case-drawer-agency .wb-card {
  border-radius: 18px;
  padding: 16px;
  gap: 10px;
}

body.role-researcher .case-drawer-root.case-drawer-agency .wb-grid {
  gap: 20px;
}

body.role-researcher .case-drawer-root.case-drawer-agency .wb-col-side {
  width: min(340px, 100%);
  gap: 14px;
}

body.role-researcher .case-drawer-root.case-drawer-agency .case-drawer-body {
  background: #f7fbf8;
}

.agency-desk-panel {
  display: flex;
  flex-direction: column;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 12px 28px rgba(13, 71, 51, 0.22);
  background: #1e3a4c;
}

.agency-desk-panel-head {
  padding: 18px 18px 16px;
  background: linear-gradient(90deg, #1e3a4c 0%, #3d5a6c 100%);
  color: #fff;
}

.agency-desk-kicker {
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.75);
}

.agency-desk-title {
  margin: 0 0 8px;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.25;
  color: #fff;
}

.agency-desk-hint {
  margin: 0;
  font-size: 13px;
  line-height: 1.4;
  color: #e4f2ea;
}

.agency-desk-panel-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 16px 18px;
  background: #fff;
}

.agency-desk-field-label {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  color: #5a6b60;
}

.agency-desk-field-hint {
  margin: 0;
  font-size: 12px;
  font-weight: 500;
  color: #5a6b60;
}

.agency-desk-officer-name {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: #122018;
}

.agency-desk-select,
body.role-researcher .agency-desk-select.assign-select {
  width: 100%;
  margin: 0;
  min-height: 44px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid #e2eae3;
  background: #f3f6f3;
  color: #122018;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
}

.agency-desk-primary,
body.role-researcher .agency-desk-primary.status-advance-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin: 0;
  min-height: 44px;
  padding: 13px 16px;
  border: none;
  border-radius: 12px;
  background: #1e3a4c;
  color: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.agency-desk-primary:hover:not(:disabled),
body.role-researcher .agency-desk-primary.status-advance-btn:hover:not(:disabled) {
  background: #0a3a28;
}

.agency-desk-primary:disabled {
  opacity: 0.65;
  cursor: wait;
}

.agency-desk-secondary {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  padding-top: 4px;
}

.agency-desk-link {
  appearance: none;
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  width: auto;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  color: #5a6b60;
  cursor: pointer;
  text-align: left;
}

.agency-desk-link:hover {
  text-decoration: underline;
}

.agency-desk-link-danger {
  color: #b91c1c;
}

.agency-desk-link-muted {
  font-size: 12px;
  font-weight: 600;
  color: #5a6b60;
}

body.role-researcher .case-drawer-root.case-drawer-agency .agency-assign-name {
  font-size: 15px;
  font-weight: 600;
}

html[data-theme="dark"] .agency-desk-panel-body {
  background: rgba(255, 255, 255, 0.06);
}

html[data-theme="dark"] .agency-desk-select,
html[data-theme="dark"] body.role-researcher .agency-desk-select.assign-select {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.14);
  color: var(--text);
}

html[data-theme="dark"] .agency-desk-officer-name {
  color: var(--text);
}

/* ——— Research brand / nav ——— */
body.role-researcher .sidebar-brand-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

body.role-researcher .sidebar-brand-kicker {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #3d5a6c;
  line-height: 1.2;
}

body.role-researcher .sidebar-brand-kicker:not(.is-research) {
  display: none;
}

body.role-researcher #sidebar-brand-title {
  font-size: 18px;
  font-weight: 800;
  color: #1e3a4c;
  line-height: 1.2;
}

body.role-researcher #sidebar-brand-sub {
  font-size: 12px;
  font-weight: 500;
  color: #6b7785;
}

html[data-theme="dark"] body.role-researcher .sidebar-brand-kicker {
  color: #8ab0bc;
}

html[data-theme="dark"] body.role-researcher #sidebar-brand-title {
  color: var(--glass-ink);
}

html[data-theme="dark"] body.role-researcher #sidebar-brand-sub {
  color: var(--glass-ink-mute);
}

body.role-researcher .sidebar-nav .sidebar-section-label {
  margin: 4px 10px 6px;
  letter-spacing: 0.12em;
}

body.role-researcher .dash-research-btns button {
  width: auto;
  border-radius: 12px;
}

body.role-researcher .research-privacy-note {
  margin: 0 0 14px;
  padding: 12px 16px;
  border-radius: 14px;
  background: rgba(232, 238, 242, 0.85);
  border: 1px solid rgba(184, 200, 212, 0.9);
  color: #3d5a6c;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
}

html[data-theme="dark"] body.role-researcher .research-privacy-note {
  background: rgba(61, 90, 108, 0.28);
  border-color: var(--glass-rim);
  color: var(--glass-ink-soft);
}

body.role-researcher #app-header.research-header h1 {
  letter-spacing: -0.02em;
}

/* ═══════════════════════════════════════════════════════════
   Research Analyst — case detail (centered analytic modal)
   Privacy-first · forest #0D4832 · slate #1e3a4c
   ═══════════════════════════════════════════════════════════ */

.case-drawer-root.case-drawer-research {
  justify-content: center;
  align-items: center;
  padding: 28px;
}

.case-drawer-root.case-drawer-research .case-drawer-backdrop {
  background:
    radial-gradient(ellipse 80% 55% at 18% 12%, rgba(180, 200, 210, 0.4), transparent 55%),
    radial-gradient(ellipse 70% 50% at 88% 82%, rgba(13, 72, 50, 0.2), transparent 50%),
    rgba(14, 24, 28, 0.46);
  backdrop-filter: blur(12px) saturate(1.12);
  -webkit-backdrop-filter: blur(12px) saturate(1.12);
}

html[data-theme="dark"] .case-drawer-root.case-drawer-research .case-drawer-backdrop {
  background:
    radial-gradient(ellipse 75% 55% at 14% 8%, rgba(90, 140, 155, 0.22), transparent 55%),
    radial-gradient(ellipse 70% 50% at 90% 85%, rgba(13, 72, 50, 0.28), transparent 50%),
    rgba(4, 8, 8, 0.72);
}

.case-drawer-root.case-drawer-research .case-drawer,
.case-drawer-root.case-drawer-research #case-drawer {
  width: min(680px, 100%);
  max-height: min(820px, calc(100vh - 48px));
  height: auto;
  border-radius: 26px;
  border: 1px solid rgba(255, 255, 255, 0.62);
  background:
    linear-gradient(
      160deg,
      rgba(255, 255, 255, 0.88) 0%,
      rgba(246, 249, 251, 0.78) 42%,
      rgba(232, 242, 234, 0.72) 100%
    );
  backdrop-filter: blur(28px) saturate(1.4);
  -webkit-backdrop-filter: blur(28px) saturate(1.4);
  box-shadow:
    0 28px 72px rgba(13, 72, 50, 0.2),
    0 2px 0 rgba(255, 255, 255, 0.6) inset,
    0 -1px 0 rgba(13, 72, 50, 0.05) inset;
  overflow: hidden;
  animation: case-modal-in 200ms cubic-bezier(0.22, 1, 0.36, 1);
}

html[data-theme="dark"] .case-drawer-root.case-drawer-research .case-drawer,
html[data-theme="dark"] .case-drawer-root.case-drawer-research #case-drawer {
  border: 1px solid rgba(255, 255, 255, 0.14);
  background:
    linear-gradient(
      165deg,
      rgba(48, 58, 56, 0.95) 0%,
      rgba(28, 34, 32, 0.93) 50%,
      rgba(18, 22, 21, 0.95) 100%
    );
  box-shadow:
    0 32px 88px rgba(0, 0, 0, 0.55),
    0 1px 0 rgba(255, 255, 255, 0.12) inset;
  color: #f4f7f5;
}

.case-drawer-root.case-drawer-research .case-drawer-head {
  padding: 22px 26px 12px;
  border-bottom: none;
  background: transparent;
  align-items: flex-start;
  gap: 16px;
}

.case-drawer-root.case-drawer-research .case-drawer-kicker {
  margin: 0 0 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #0d4832 !important;
}

html[data-theme="dark"] .case-drawer-root.case-drawer-research .case-drawer-kicker {
  color: #9fe0bc !important;
}

.case-drawer-root.case-drawer-research .case-drawer-token {
  margin: 0;
  font-size: 24px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: #122018;
  word-break: normal;
}

html[data-theme="dark"] .case-drawer-root.case-drawer-research .case-drawer-token {
  color: #f4f7f5;
}

.case-drawer-root.case-drawer-research #case-drawer-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 0;
}

.case-drawer-root.case-drawer-research #case-drawer-pills .chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 650;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(226, 234, 227, 0.95);
  color: #3d5a48;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.5) inset;
}

.case-drawer-root.case-drawer-research #case-drawer-pills .chip-sev-high,
.case-drawer-root.case-drawer-research #case-drawer-pills .chip-sev-critical {
  background: rgba(254, 226, 226, 0.85);
  border-color: rgba(185, 28, 28, 0.16);
  color: #b91c1c;
}

.case-drawer-root.case-drawer-research #case-drawer-pills .chip-status {
  background: rgba(228, 242, 234, 0.9);
  border-color: rgba(13, 72, 50, 0.12);
  color: #0d4832;
}

.case-drawer-root.case-drawer-research #case-drawer-pills .chip-research-readonly {
  background: rgba(30, 58, 76, 0.1);
  border-color: rgba(30, 58, 76, 0.18);
  color: #1e3a4c;
}

html[data-theme="dark"] .case-drawer-root.case-drawer-research #case-drawer-pills .chip {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.14);
  color: var(--glass-ink-soft, #c5d0c9);
  box-shadow: none;
}

html[data-theme="dark"] .case-drawer-root.case-drawer-research #case-drawer-pills .chip-status {
  background: rgba(13, 72, 50, 0.45);
  border-color: rgba(159, 224, 188, 0.28);
  color: #b8f0d0;
}

html[data-theme="dark"] .case-drawer-root.case-drawer-research #case-drawer-pills .chip-research-readonly {
  background: rgba(90, 140, 155, 0.22);
  border-color: rgba(138, 176, 188, 0.35);
  color: #c5dde6;
}

.case-drawer-root.case-drawer-research #case-drawer-close,
.case-drawer-root.case-drawer-research .case-back-btn {
  width: auto;
  margin: 0;
  min-height: 40px;
  padding: 10px 16px;
  border-radius: 12px;
  border: 1px solid rgba(13, 72, 50, 0.14);
  background: rgba(255, 255, 255, 0.65);
  color: #0d4832;
  font-weight: 650;
  font-size: 13px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.5) inset;
}

.case-drawer-root.case-drawer-research #case-drawer-close:hover,
.case-drawer-root.case-drawer-research .case-back-btn:hover {
  background: rgba(228, 242, 234, 0.9);
  border-color: rgba(13, 72, 50, 0.22);
}

html[data-theme="dark"] .case-drawer-root.case-drawer-research #case-drawer-close,
html[data-theme="dark"] .case-drawer-root.case-drawer-research .case-back-btn {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.16);
  color: #e8f5ee;
  box-shadow: none;
}

.case-drawer-root.case-drawer-research .case-drawer-body {
  padding: 8px 26px 26px;
  background: transparent;
  overflow: auto;
}

/* ——— Inner layout ——— */
.rx-case {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.rx-case-privacy {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 14px 16px;
  border-radius: 16px;
  background:
    linear-gradient(120deg, rgba(13, 72, 50, 0.08) 0%, rgba(30, 58, 76, 0.08) 100%);
  border: 1px solid rgba(13, 72, 50, 0.12);
}

.rx-case-privacy-mark {
  flex-shrink: 0;
  width: 10px;
  height: 10px;
  margin-top: 5px;
  border-radius: 50%;
  background: linear-gradient(160deg, #0d4832 0%, #1a6b4a 100%);
  box-shadow: 0 0 0 4px rgba(13, 72, 50, 0.12);
}

.rx-case-privacy-title {
  margin: 0 0 4px;
  font-size: 13px;
  font-weight: 700;
  color: #0d4832;
  letter-spacing: -0.01em;
}

.rx-case-privacy-text {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  font-weight: 500;
  color: #4a5f56;
}

html[data-theme="dark"] .rx-case-privacy {
  background: rgba(13, 72, 50, 0.28);
  border-color: rgba(159, 224, 188, 0.2);
}

html[data-theme="dark"] .rx-case-privacy-title {
  color: #b8f0d0;
}

html[data-theme="dark"] .rx-case-privacy-text {
  color: var(--glass-ink-soft, #c5d0c9);
}

.rx-case-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.rx-fact {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 14px 13px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(226, 234, 227, 0.95);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.55) inset;
  min-height: 72px;
}

.rx-fact-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #6b7c70;
}

.rx-fact-value {
  font-size: 14px;
  font-weight: 650;
  line-height: 1.35;
  color: #122018;
  word-break: break-word;
}

html[data-theme="dark"] .rx-fact {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: none;
}

html[data-theme="dark"] .rx-fact-label {
  color: var(--glass-label, #9fe0bc);
}

html[data-theme="dark"] .rx-fact-value {
  color: var(--glass-ink, #f4f7f5);
}

.rx-case-block {
  padding: 18px 18px 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid rgba(226, 234, 227, 0.95);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.5) inset;
}

.rx-case-block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.rx-case-block-title {
  margin: 0;
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #0d4832;
}

.rx-case-narrative {
  margin: 0;
  font-size: 15px;
  line-height: 1.6;
  font-weight: 500;
  color: #2a3830;
  white-space: pre-wrap;
}

.rx-case-geo {
  background:
    linear-gradient(145deg, rgba(232, 242, 234, 0.75) 0%, rgba(255, 255, 255, 0.7) 100%);
}

.rx-case-geo-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #1e3a4c;
  background: rgba(30, 58, 76, 0.1);
  border: 1px solid rgba(30, 58, 76, 0.14);
}

.rx-case-geo-place {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: #122018;
}

.rx-case-geo-note {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  font-weight: 500;
  color: #5a6b60;
}

html[data-theme="dark"] .rx-case-block {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: none;
}

html[data-theme="dark"] .rx-case-block-title {
  color: #9fe0bc;
}

html[data-theme="dark"] .rx-case-narrative {
  color: var(--glass-ink-soft, #c5d0c9);
}

html[data-theme="dark"] .rx-case-geo {
  background: rgba(13, 72, 50, 0.22);
}

html[data-theme="dark"] .rx-case-geo-badge {
  background: rgba(90, 140, 155, 0.22);
  border-color: rgba(138, 176, 188, 0.3);
  color: #c5dde6;
}

html[data-theme="dark"] .rx-case-geo-place {
  color: var(--glass-ink, #f4f7f5);
}

html[data-theme="dark"] .rx-case-geo-note {
  color: var(--glass-ink-mute, #9aaba2);
}

.rx-case-foot {
  display: flex;
  justify-content: flex-start;
  padding-top: 2px;
}

.rx-case-back {
  appearance: none;
  width: auto;
  margin: 0;
  min-height: 44px;
  padding: 12px 18px;
  border-radius: 12px;
  border: none;
  background: linear-gradient(160deg, #0d4832 0%, #166b4a 100%);
  color: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(13, 72, 50, 0.28);
}

.rx-case-back:hover {
  background: linear-gradient(160deg, #0a3a28 0%, #0d4832 100%);
}

@media (max-width: 720px) {
  .case-drawer-root.case-drawer-research {
    padding: 12px;
    align-items: stretch;
  }

  .case-drawer-root.case-drawer-research .case-drawer,
  .case-drawer-root.case-drawer-research #case-drawer {
    max-height: none;
    height: 100%;
    border-radius: 20px;
  }

  .case-drawer-root.case-drawer-research .case-drawer-head,
  .case-drawer-root.case-drawer-research .case-drawer-body {
    padding-left: 18px;
    padding-right: 18px;
  }

  .rx-case-facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 420px) {
  .rx-case-facts {
    grid-template-columns: 1fr;
  }
}

