/* KMediHub PRC — Neon Dark (fancy fluorescent) */

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #03050c;
  --card: rgba(10, 16, 32, 0.88);
  --card-soft: rgba(14, 22, 44, 0.75);
  --text: #e8f7ff;
  --muted: #7eb8d4;
  --border: rgba(0, 245, 255, 0.22);
  --primary: #00f5ff;
  --primary-hover: #7fffff;
  --accent: #ff2d95;
  --rate-low: #39ff14;
  --rate-mid: #ffe600;
  --rate-high: #ff3366;
  --shadow: 0 0 0 1px rgba(0, 245, 255, 0.06), 0 12px 40px rgba(0, 0, 0, 0.55), 0 0 48px rgba(0, 245, 255, 0.05);
  --neon-cyan: #00f5ff;
  --neon-magenta: #ff00e5;
  --neon-lime: #b8ff00;
  --neon-amber: #ffcc00;
  --neon-violet: #bf5fff;
}

[data-theme="dark"] body {
  background:
    radial-gradient(ellipse 90% 55% at 0% -5%, rgba(0, 245, 255, 0.14), transparent 55%),
    radial-gradient(ellipse 70% 45% at 100% 0%, rgba(255, 0, 229, 0.11), transparent 50%),
    radial-gradient(ellipse 55% 40% at 50% 110%, rgba(184, 255, 0, 0.07), transparent 55%),
    linear-gradient(180deg, #050810 0%, #03050c 40%, #020308 100%);
}

[data-theme="dark"] body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.45;
  background-image:
    linear-gradient(rgba(0, 245, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 245, 255, 0.04) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 30%, #000 20%, transparent 75%);
}

[data-theme="dark"] .app {
  position: relative;
  z-index: 1;
}

/* Species — fluorescent accents */
[data-theme="dark"] body[data-species="mouse"] {
  --species-strong: #ff2d95;
  --species: rgba(255, 45, 149, 0.35);
  --species-soft: rgba(255, 45, 149, 0.08);
  --species-page: rgba(255, 45, 149, 0.04);
  --primary: #ff2d95;
  --primary-hover: #ff6eb8;
}

[data-theme="dark"] body[data-species="rat"] {
  --species-strong: #7b8cff;
  --species: rgba(123, 140, 255, 0.35);
  --species-soft: rgba(123, 140, 255, 0.08);
  --species-page: rgba(123, 140, 255, 0.04);
  --primary: #7b8cff;
  --primary-hover: #a8b4ff;
}

[data-theme="dark"] body[data-species="rabbit"] {
  --species-strong: #39ff14;
  --species: rgba(57, 255, 20, 0.3);
  --species-soft: rgba(57, 255, 20, 0.08);
  --species-page: rgba(57, 255, 20, 0.04);
  --primary: #39ff14;
  --primary-hover: #7fff5c;
}

[data-theme="dark"] body[data-species="dog"] {
  --species-strong: #ffb020;
  --species: rgba(255, 176, 32, 0.35);
  --species-soft: rgba(255, 176, 32, 0.08);
  --species-page: rgba(255, 176, 32, 0.04);
  --primary: #ffb020;
  --primary-hover: #ffc85c;
}

[data-theme="dark"] body[data-species="monkey"] {
  --species-strong: #bf5fff;
  --species: rgba(191, 95, 255, 0.35);
  --species-soft: rgba(191, 95, 255, 0.08);
  --species-page: rgba(191, 95, 255, 0.04);
  --primary: #bf5fff;
  --primary-hover: #d494ff;
}

[data-theme="dark"] body[data-species="pig"] {
  --species-strong: #ff4d6d;
  --species: rgba(255, 77, 109, 0.35);
  --species-soft: rgba(255, 77, 109, 0.08);
  --species-page: rgba(255, 77, 109, 0.04);
  --primary: #ff4d6d;
  --primary-hover: #ff8aa0;
}

/* Topbar & chrome */
[data-theme="dark"] .topbar {
  background: linear-gradient(135deg, rgba(12, 20, 40, 0.92), rgba(6, 10, 22, 0.88));
  border-color: rgba(0, 245, 255, 0.28);
  box-shadow:
    0 0 0 1px rgba(0, 245, 255, 0.1),
    0 16px 48px rgba(0, 0, 0, 0.5),
    0 0 60px rgba(0, 245, 255, 0.06);
}

[data-theme="dark"] .brand-kicker {
  color: var(--neon-cyan);
  text-shadow: 0 0 12px rgba(0, 245, 255, 0.65);
}

[data-theme="dark"] .brand h1 {
  text-shadow: 0 0 24px rgba(0, 245, 255, 0.15);
}

[data-theme="dark"] .app-switcher {
  background: rgba(0, 245, 255, 0.06);
  border-color: rgba(0, 245, 255, 0.2);
}

[data-theme="dark"] .app-switch-btn {
  color: var(--muted);
}

[data-theme="dark"] .app-switch-btn:hover {
  color: var(--neon-cyan);
}

[data-theme="dark"] .app-switch-btn.active {
  background: linear-gradient(135deg, var(--species-strong), var(--neon-cyan));
  color: #030508;
  box-shadow: 0 0 20px color-mix(in srgb, var(--species-strong) 55%, transparent);
}

[data-theme="dark"] .visit-pill,
[data-theme="dark"] .sync-pill {
  background: rgba(0, 245, 255, 0.06);
  border-color: rgba(0, 245, 255, 0.22);
  color: var(--text);
}

[data-theme="dark"] .visit-pill strong,
[data-theme="dark"] .sync-pill strong {
  color: var(--neon-cyan);
  text-shadow: 0 0 10px rgba(0, 245, 255, 0.5);
}

[data-theme="dark"] .visit-pill.today {
  border-color: rgba(255, 0, 229, 0.35);
  box-shadow: 0 0 16px rgba(255, 0, 229, 0.12);
}

/* Cards */
[data-theme="dark"] .card,
[data-theme="dark"] .card-inset {
  background: linear-gradient(145deg, rgba(14, 22, 42, 0.94), rgba(8, 12, 26, 0.9));
  border-color: color-mix(in srgb, var(--species-strong) 35%, rgba(0, 245, 255, 0.2));
  box-shadow:
    0 0 0 1px rgba(0, 245, 255, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 12px 36px rgba(0, 0, 0, 0.45),
    0 0 32px color-mix(in srgb, var(--species-strong) 12%, transparent);
}

[data-theme="dark"] .summary.card,
[data-theme="dark"] .rooms.card,
[data-theme="dark"] .memos.card,
[data-theme="dark"] .history-card {
  background:
    linear-gradient(160deg, rgba(16, 24, 48, 0.95), rgba(8, 12, 24, 0.92)),
    radial-gradient(ellipse at top left, color-mix(in srgb, var(--species-strong) 12%, transparent), transparent 60%);
}

[data-theme="dark"] .species-title {
  color: var(--species-strong);
  text-shadow: 0 0 20px color-mix(in srgb, var(--species-strong) 50%, transparent);
}

/* KPI */
[data-theme="dark"] .kpi {
  background: rgba(0, 245, 255, 0.04);
  border: 1px solid rgba(0, 245, 255, 0.15);
}

[data-theme="dark"] .kpi-value {
  color: var(--species-strong);
  text-shadow: 0 0 16px color-mix(in srgb, var(--species-strong) 70%, transparent);
}

[data-theme="dark"] .kpi-value.accent,
[data-theme="dark"] .kpi-value.rate {
  color: var(--neon-lime);
  text-shadow: 0 0 18px rgba(184, 255, 0, 0.55);
}

[data-theme="dark"] .kpi-rate-fill {
  background: linear-gradient(90deg, var(--neon-magenta), var(--neon-cyan), var(--neon-lime));
  box-shadow: 0 0 20px rgba(0, 245, 255, 0.4);
}

/* Tabs */
[data-theme="dark"] .species-tab,
[data-theme="dark"] .view-tab,
[data-theme="dark"] .team-tab {
  background: rgba(0, 245, 255, 0.04);
  border-color: rgba(0, 245, 255, 0.18);
  color: var(--muted);
}

[data-theme="dark"] .species-tab.active,
[data-theme="dark"] .view-tab.active,
[data-theme="dark"] .team-tab.active {
  background: linear-gradient(135deg, color-mix(in srgb, var(--species-strong) 80%, #000), var(--species-strong));
  border-color: var(--species-strong);
  color: #030508;
  box-shadow: 0 0 22px color-mix(in srgb, var(--species-strong) 45%, transparent);
  font-weight: 700;
}

/* Buttons */
[data-theme="dark"] .btn-primary {
  background: linear-gradient(135deg, var(--species-strong) 0%, var(--neon-cyan) 120%);
  color: #030508;
  font-weight: 700;
  border-color: transparent;
  box-shadow: 0 0 24px color-mix(in srgb, var(--species-strong) 40%, transparent);
}

[data-theme="dark"] .btn-primary:hover {
  filter: brightness(1.12);
  box-shadow: 0 0 32px color-mix(in srgb, var(--species-strong) 55%, transparent);
}

[data-theme="dark"] .btn-ghost {
  background: rgba(0, 245, 255, 0.05);
  border-color: rgba(0, 245, 255, 0.25);
  color: var(--text);
}

[data-theme="dark"] .btn-ghost:hover {
  border-color: var(--neon-cyan);
  color: var(--neon-cyan);
  box-shadow: 0 0 16px rgba(0, 245, 255, 0.2);
}

[data-theme="dark"] .theme-toggle {
  border-color: rgba(0, 245, 255, 0.45);
  background: linear-gradient(135deg, rgba(0, 245, 255, 0.12), rgba(255, 0, 229, 0.1));
  color: var(--neon-cyan);
  box-shadow: 0 0 20px rgba(0, 245, 255, 0.25), inset 0 0 12px rgba(0, 245, 255, 0.08);
}

[data-theme="dark"] .theme-toggle[aria-pressed="true"] {
  border-color: var(--neon-magenta);
  color: var(--neon-magenta);
  box-shadow: 0 0 28px rgba(255, 0, 229, 0.35);
}

[data-theme="dark"] .theme-toggle-icon {
  filter: drop-shadow(0 0 6px currentColor);
}

/* Inputs */
[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea {
  background: rgba(4, 8, 18, 0.9);
  border-color: rgba(0, 245, 255, 0.22);
  color: var(--text);
}

[data-theme="dark"] input:focus,
[data-theme="dark"] select:focus,
[data-theme="dark"] textarea:focus {
  border-color: var(--neon-cyan);
  box-shadow: 0 0 0 2px rgba(0, 245, 255, 0.15), 0 0 20px rgba(0, 245, 255, 0.2);
  outline: none;
}

/* Tables & rooms */
[data-theme="dark"] .history-sheet th {
  background: rgba(0, 245, 255, 0.08);
  color: var(--neon-cyan);
  border-color: rgba(0, 245, 255, 0.2);
}

[data-theme="dark"] .history-sheet td {
  border-color: rgba(0, 245, 255, 0.1);
}

[data-theme="dark"] .room-block,
[data-theme="dark"] .pi-row {
  background: rgba(8, 14, 28, 0.85);
  border-color: rgba(0, 245, 255, 0.14);
}

[data-theme="dark"] .room-block:hover {
  border-color: color-mix(in srgb, var(--species-strong) 50%, transparent);
  box-shadow: 0 0 24px color-mix(in srgb, var(--species-strong) 15%, transparent);
}

/* Banners */
[data-theme="dark"] .site-banner {
  background: linear-gradient(135deg, rgba(0, 245, 255, 0.08), rgba(255, 0, 229, 0.06));
  border-color: rgba(0, 245, 255, 0.25);
  color: var(--text);
}

[data-theme="dark"] .site-banner strong {
  color: var(--neon-cyan);
}

/* Charts rail */
[data-theme="dark"] .charts-rail .chart-card {
  background: rgba(8, 14, 28, 0.9);
  border-color: rgba(0, 245, 255, 0.18);
}

[data-theme="dark"] .chart-card h3 {
  color: var(--species-strong);
  text-shadow: 0 0 12px color-mix(in srgb, var(--species-strong) 40%, transparent);
}

/* Behavior / GX / Stacker pages */
[data-theme="dark"] .behavior-kicker {
  color: var(--neon-magenta);
  text-shadow: 0 0 10px rgba(255, 0, 229, 0.5);
}

[data-theme="dark"] .behavior-engine-pill {
  border-color: rgba(184, 255, 0, 0.4);
  color: var(--neon-lime);
  background: rgba(184, 255, 0, 0.08);
  box-shadow: 0 0 16px rgba(184, 255, 0, 0.15);
}

[data-theme="dark"] .stacker-canvas-wrap,
[data-theme="dark"] .stacker-page .stacker-viewer-wrap {
  background: #060a14;
  border-color: rgba(0, 245, 255, 0.2);
}

[data-theme="dark"] .gx-toast {
  background: linear-gradient(135deg, #0a1020, #121830);
  border: 1px solid rgba(0, 245, 255, 0.35);
  box-shadow: 0 0 30px rgba(0, 245, 255, 0.2);
}

[data-theme="dark"] .memo-register-popup {
  background: rgba(2, 6, 16, 0.72);
}

[data-theme="dark"] .memo-register-popup-card {
  background: linear-gradient(160deg, #0c1224 0%, #101830 100%);
  border-color: rgba(0, 245, 255, 0.28);
  box-shadow: 0 0 48px rgba(0, 245, 255, 0.12);
}

[data-theme="dark"] .memo-register-latest.is-ok {
  background: rgba(184, 255, 0, 0.1);
  color: var(--neon-lime);
}

[data-theme="dark"] .memo-register-preview {
  background: rgba(0, 245, 255, 0.06);
  border: 1px solid rgba(0, 245, 255, 0.12);
}

[data-theme="dark"] .memo-item.memo-item--fresh {
  outline-color: rgba(184, 255, 0, 0.5);
}

[data-theme="dark"] .memo-new-banner {
  background: rgba(0, 245, 255, 0.08);
  border-color: rgba(0, 245, 255, 0.28);
  color: var(--neon-cyan);
}

[data-theme="dark"] .memo-ticker-bar {
  background: linear-gradient(90deg, #061018 0%, #0a2840 35%, #0c3d52 65%, #061018 100%);
  border-bottom-color: rgba(0, 245, 255, 0.35);
  box-shadow: 0 0 24px rgba(0, 245, 255, 0.18);
}

[data-theme="dark"] .memo-ticker-pulse {
  background: var(--neon-lime);
  color: #041018;
}

[data-theme="dark"] .memo-ticker-new,
[data-theme="dark"] .memo-ticker-more {
  color: var(--neon-lime);
}

[data-theme="dark"] .memo-ticker-species {
  color: var(--neon-cyan);
}

[data-theme="dark"] .memo-ticker-source.is-main {
  background: rgba(255, 224, 138, 0.2);
  color: var(--neon-lime);
}

[data-theme="dark"] .memo-ticker-source.is-mirror {
  background: rgba(0, 245, 255, 0.18);
  color: var(--neon-cyan);
}

[data-theme="dark"] .memo-ticker-btn {
  border-color: rgba(0, 245, 255, 0.4);
  background: rgba(0, 245, 255, 0.1);
}

[data-theme="dark"] .memo-new-badge {
  background: rgba(0, 245, 255, 0.85);
  color: #041018;
}

[data-theme="dark"] .memo-item.memo-item--new {
  border-left-color: var(--neon-cyan);
  background: rgba(0, 245, 255, 0.05);
}

[data-theme="dark"] .modal,
[data-theme="dark"] dialog.modal {
  background: #0c1224;
  border: 1px solid rgba(0, 245, 255, 0.3);
  color: var(--text);
  box-shadow: 0 0 60px rgba(0, 245, 255, 0.15);
}

[data-theme="dark"] .site-footer {
  color: var(--muted);
  border-top-color: rgba(0, 245, 255, 0.12);
}

[data-theme="dark"] .scroll-top {
  background: linear-gradient(135deg, var(--neon-cyan), var(--neon-magenta));
  color: #030508;
  box-shadow: 0 0 24px rgba(0, 245, 255, 0.4);
}

[data-theme="dark"] a {
  color: var(--neon-cyan);
}

[data-theme="dark"] a:hover {
  color: var(--neon-lime);
  text-shadow: 0 0 8px rgba(184, 255, 0, 0.4);
}

[data-theme="dark"] .iot-demo-badge {
  background: rgba(255, 204, 0, 0.12);
  border-color: rgba(255, 204, 0, 0.4);
  color: var(--neon-amber);
}

[data-theme="dark"] .hint,
[data-theme="dark"] .subtitle {
  color: var(--muted);
}

/* ── Tabs (species / view / team) ── */
[data-theme="dark"] .species-tab {
  --tab-strong: var(--neon-cyan);
  background: color-mix(in srgb, var(--tab-strong) 14%, rgba(8, 14, 28, 0.92));
  border-color: color-mix(in srgb, var(--tab-strong) 42%, rgba(0, 245, 255, 0.18));
  color: var(--tab-strong);
  box-shadow: 0 0 14px color-mix(in srgb, var(--tab-strong) 10%, transparent);
}

[data-theme="dark"] .species-tab:hover {
  box-shadow: 0 0 20px color-mix(in srgb, var(--tab-strong) 22%, transparent);
}

[data-theme="dark"] .species-tab[data-species="mouse"] { --tab-strong: #ff2d95; }
[data-theme="dark"] .species-tab[data-species="rat"] { --tab-strong: #7b8cff; }
[data-theme="dark"] .species-tab[data-species="rabbit"] { --tab-strong: #39ff14; }
[data-theme="dark"] .species-tab[data-species="dog"] { --tab-strong: #ffb020; }
[data-theme="dark"] .species-tab[data-species="monkey"] { --tab-strong: #bf5fff; }
[data-theme="dark"] .species-tab[data-species="pig"] { --tab-strong: #ff4d6d; }

[data-theme="dark"] .species-tab.view-tab { --tab-strong: #00f5ff; }
[data-theme="dark"] .species-tab.view-tab[data-view="rx"] { --tab-strong: #7b8cff; }
[data-theme="dark"] .species-tab.view-tab[data-view="purchase"] { --tab-strong: #ffb020; }
[data-theme="dark"] .species-tab.view-tab[data-view="microbe"] { --tab-strong: #39ff14; }
[data-theme="dark"] .species-tab.view-tab[data-view="iacuc"] { --tab-strong: #ff00e5; }
[data-theme="dark"] .species-tab.behavior-link-tab { --tab-strong: #00f5ff; }

[data-theme="dark"] .species-tab.active {
  background: linear-gradient(135deg, color-mix(in srgb, var(--tab-strong) 85%, #000), var(--tab-strong));
  border-color: var(--tab-strong);
  color: #030508;
  text-shadow: none;
}

[data-theme="dark"] .species-tab.selected {
  box-shadow: inset 0 0 0 1px var(--tab-strong), 0 0 16px color-mix(in srgb, var(--tab-strong) 25%, transparent);
}

[data-theme="dark"] .species-tab .animal-icon {
  background: rgba(0, 0, 0, 0.35);
}

[data-theme="dark"] .species-tab.active .animal-icon {
  background: rgba(0, 0, 0, 0.28);
}

[data-theme="dark"] .species-tab-divider {
  background: rgba(0, 245, 255, 0.2);
}

[data-theme="dark"] .team-tab {
  background: rgba(8, 14, 28, 0.85);
  border-color: rgba(0, 245, 255, 0.2);
  color: var(--muted);
}

[data-theme="dark"] .team-tab:hover {
  border-color: var(--neon-cyan);
  color: var(--neon-cyan);
}

[data-theme="dark"] .team-tab.active {
  background: linear-gradient(135deg, var(--species-strong), var(--neon-cyan));
  border-color: transparent;
  color: #030508;
  box-shadow: 0 0 18px color-mix(in srgb, var(--species-strong) 40%, transparent);
}

/* ── Charts ── */
[data-theme="dark"] .charts-rail-title {
  color: var(--neon-cyan);
  text-shadow: 0 0 10px rgba(0, 245, 255, 0.35);
}

[data-theme="dark"] .util-chart-card {
  background: linear-gradient(160deg, rgba(10, 16, 32, 0.95), rgba(6, 10, 22, 0.9));
  border-color: color-mix(in srgb, var(--chart-color) 40%, rgba(0, 245, 255, 0.2));
  box-shadow: 0 0 24px color-mix(in srgb, var(--chart-color) 12%, transparent);
}

[data-theme="dark"] .util-chart-card[data-species="mouse"] { --chart-color: #ff2d95; }
[data-theme="dark"] .util-chart-card[data-species="rat"] { --chart-color: #7b8cff; }
[data-theme="dark"] .util-chart-card[data-species="rabbit"] { --chart-color: #39ff14; }
[data-theme="dark"] .util-chart-card[data-species="dog"] { --chart-color: #ffb020; }
[data-theme="dark"] .util-chart-card[data-species="pig"] { --chart-color: #ff4d6d; }

[data-theme="dark"] .util-chart-title {
  color: var(--chart-color);
  text-shadow: 0 0 12px color-mix(in srgb, var(--chart-color) 50%, transparent);
}

[data-theme="dark"] .util-chart-range,
[data-theme="dark"] .util-chart-empty {
  color: var(--muted);
}

[data-theme="dark"] .iacuc-chart-card {
  background: linear-gradient(160deg, rgba(10, 20, 36, 0.95), rgba(6, 12, 24, 0.92));
  border-color: rgba(0, 245, 255, 0.28);
  box-shadow: 0 0 28px rgba(0, 245, 255, 0.08);
}

[data-theme="dark"] .iacuc-chart-title {
  color: var(--neon-cyan);
  text-shadow: 0 0 12px rgba(0, 245, 255, 0.45);
}

[data-theme="dark"] .facility-spec-cost-chart-shell {
  background: rgba(8, 14, 28, 0.9);
  border-top-color: rgba(255, 204, 0, 0.25);
}

[data-theme="dark"] .facility-spec-cost-chart-title {
  color: var(--neon-amber);
  text-shadow: 0 0 12px rgba(255, 204, 0, 0.35);
}

[data-theme="dark"] .facility-spec-cost-chart-desc,
[data-theme="dark"] .facility-spec-cost-chart-empty,
[data-theme="dark"] .facility-spec-cost-chart-note,
[data-theme="dark"] .facility-spec-cost-hint {
  color: var(--muted);
}

[data-theme="dark"] .facility-spec-cost-chart-desc strong {
  color: var(--neon-amber);
}

[data-theme="dark"] .facility-spec-cost-chart-wrap {
  background: linear-gradient(180deg, rgba(10, 16, 32, 0.95), rgba(6, 10, 22, 0.92));
  border-color: rgba(255, 204, 0, 0.28);
}

[data-theme="dark"] #mobileChartsPanel,
[data-theme="dark"] #mobileChartsPanel summary {
  background: rgba(8, 14, 28, 0.9);
  border-color: rgba(0, 245, 255, 0.2);
  color: var(--text);
}

/* ── Toolbar & layout ── */
[data-theme="dark"] .toolbar-group-label {
  color: var(--neon-cyan);
}

[data-theme="dark"] .species-title {
  background: color-mix(in srgb, var(--species-strong) 18%, rgba(8, 14, 28, 0.9));
  border: 1px solid color-mix(in srgb, var(--species-strong) 35%, transparent);
}

[data-theme="dark"] .sector-btn {
  background: rgba(8, 14, 28, 0.88);
  border-color: rgba(0, 245, 255, 0.18);
  color: var(--text);
}

[data-theme="dark"] .sector-btn:hover {
  border-color: var(--neon-cyan);
  background: rgba(0, 245, 255, 0.08);
}

[data-theme="dark"] .sector-btn.active {
  background: linear-gradient(135deg, var(--species-strong), var(--neon-cyan));
  border-color: transparent;
  color: #030508;
  box-shadow: 0 0 20px color-mix(in srgb, var(--species-strong) 35%, transparent);
}

[data-theme="dark"] .sector-rooms-head {
  color: var(--species-strong);
  border-bottom-color: rgba(0, 245, 255, 0.15);
}

[data-theme="dark"] .room-block {
  background: rgba(8, 14, 28, 0.82);
}

[data-theme="dark"] .room-table th {
  background: rgba(0, 245, 255, 0.08);
  color: var(--neon-cyan);
}

[data-theme="dark"] .room-table td {
  border-bottom-color: rgba(0, 245, 255, 0.1);
}

[data-theme="dark"] .rate-badge.low {
  background: rgba(57, 255, 20, 0.12);
  color: var(--neon-lime);
}

[data-theme="dark"] .rate-badge.mid {
  background: rgba(255, 230, 0, 0.12);
  color: var(--neon-amber);
}

[data-theme="dark"] .rate-badge.high {
  background: rgba(255, 51, 102, 0.12);
  color: #ff3366;
}

[data-theme="dark"] .pi-collapse {
  background: rgba(6, 10, 22, 0.75);
  border-top-color: rgba(0, 245, 255, 0.12);
}

[data-theme="dark"] .pi-row {
  background: rgba(8, 14, 28, 0.88);
}

/* ── History & memos ── */
[data-theme="dark"] .history-sheet-wrap {
  background: rgba(8, 14, 28, 0.9);
  border-color: rgba(0, 245, 255, 0.18);
}

[data-theme="dark"] .history-sheet th {
  background: rgba(0, 245, 255, 0.1);
}

[data-theme="dark"] .history-sheet tbody tr:hover td {
  background: rgba(0, 245, 255, 0.04);
}

[data-theme="dark"] .history-input-row {
  background: rgba(0, 245, 255, 0.05);
}

[data-theme="dark"] .history-input-row input {
  background: rgba(4, 8, 18, 0.95);
}

[data-theme="dark"] .memo-form {
  background: rgba(8, 14, 28, 0.75);
  border-color: rgba(0, 245, 255, 0.15);
}

[data-theme="dark"] .memo-item {
  background: rgba(8, 14, 28, 0.85);
  border-color: rgba(0, 245, 255, 0.14);
}

[data-theme="dark"] .memo-file-link {
  background: rgba(0, 245, 255, 0.06);
  border-color: rgba(0, 245, 255, 0.2);
  color: var(--neon-cyan);
}

[data-theme="dark"] .memo-count {
  color: var(--neon-magenta);
}

/* ── IoT ── */
[data-theme="dark"] .iot-demo-note {
  background: rgba(255, 204, 0, 0.08);
  border-color: rgba(255, 204, 0, 0.28);
  color: var(--neon-amber);
}

[data-theme="dark"] .iot-species-tab {
  background: rgba(8, 14, 28, 0.88);
  border-color: rgba(0, 245, 255, 0.2);
  color: var(--muted);
}

[data-theme="dark"] .iot-species-tab:hover {
  border-color: var(--neon-cyan);
  color: var(--neon-cyan);
}

[data-theme="dark"] .iot-species-tab.active {
  background: linear-gradient(135deg, #00f5ff, #39ff14);
  color: #030508;
  box-shadow: 0 0 22px rgba(0, 245, 255, 0.3);
}

[data-theme="dark"] .iot-species-tab:not(.active) .count {
  background: rgba(0, 245, 255, 0.12);
  color: var(--neon-cyan);
}

[data-theme="dark"] .iot-room-card {
  background: linear-gradient(180deg, rgba(12, 20, 40, 0.95), rgba(8, 14, 28, 0.9));
  border-color: rgba(0, 245, 255, 0.2);
}

[data-theme="dark"] .iot-room-head h3 {
  color: var(--neon-cyan);
}

[data-theme="dark"] .iot-metric-label,
[data-theme="dark"] .iot-metric-range,
[data-theme="dark"] .iot-updated {
  color: var(--muted);
}

[data-theme="dark"] .iot-metric-value {
  color: var(--text);
}

[data-theme="dark"] .iot-spark polyline {
  stroke: var(--neon-cyan);
  filter: drop-shadow(0 0 4px rgba(0, 245, 255, 0.5));
}

[data-theme="dark"] .iot-metric:last-child .iot-spark polyline {
  stroke: var(--neon-lime);
  filter: drop-shadow(0 0 4px rgba(184, 255, 0, 0.5));
}

[data-theme="dark"] .iot-status-ok {
  background: rgba(57, 255, 20, 0.12);
  color: var(--neon-lime);
}

[data-theme="dark"] .iot-status-caution {
  background: rgba(255, 204, 0, 0.12);
  color: var(--neon-amber);
}

[data-theme="dark"] .iot-status-warn {
  background: rgba(255, 51, 102, 0.12);
  color: #ff3366;
}

/* ── IACUC ── */
[data-theme="dark"] .iacuc-report-table th {
  background: rgba(0, 245, 255, 0.1);
  color: var(--neon-cyan);
}

[data-theme="dark"] .iacuc-report-table td {
  border-color: rgba(0, 245, 255, 0.1);
}

[data-theme="dark"] .iacuc-paste-box,
[data-theme="dark"] .iacuc-timeline-item {
  background: rgba(8, 14, 28, 0.85);
  border-color: rgba(0, 245, 255, 0.15);
}

[data-theme="dark"] .iacuc-timeline-item::before {
  background: var(--neon-magenta);
  box-shadow: 0 0 10px rgba(255, 0, 229, 0.5);
}

[data-theme="dark"] .iacuc-weekly-summary {
  background: rgba(0, 245, 255, 0.06);
  border-color: rgba(0, 245, 255, 0.2);
}

[data-theme="dark"] .iacuc-search-wrap {
  background: rgba(8, 14, 28, 0.9);
  border-color: rgba(0, 245, 255, 0.2);
}

[data-theme="dark"] .iacuc-search-wrap:focus-within {
  border-color: var(--neon-cyan);
  box-shadow: 0 0 16px rgba(0, 245, 255, 0.2);
}

/* ── Behavior / GX / Stacker sub-pages ── */
[data-theme="dark"] .behavior-hero h2 {
  color: var(--text);
}

[data-theme="dark"] .behavior-step {
  background: rgba(8, 14, 28, 0.85);
  border-color: rgba(0, 245, 255, 0.15);
}

[data-theme="dark"] .behavior-step.active,
[data-theme="dark"] .behavior-step.done {
  border-color: var(--neon-lime);
  background: rgba(184, 255, 0, 0.08);
  color: var(--neon-lime);
}

[data-theme="dark"] .behavior-example-tab {
  background: rgba(8, 14, 28, 0.88);
  border-color: rgba(0, 245, 255, 0.18);
  color: var(--muted);
}

[data-theme="dark"] .behavior-example-tab.active {
  background: linear-gradient(135deg, var(--neon-cyan), var(--neon-magenta));
  color: #030508;
  border-color: transparent;
}

[data-theme="dark"] .behavior-example-num {
  background: rgba(0, 0, 0, 0.35);
}

[data-theme="dark"] .behavior-example-tab.active .behavior-example-num {
  background: rgba(0, 0, 0, 0.25);
  color: #030508;
}

[data-theme="dark"] .behavior-example-viewer,
[data-theme="dark"] .behavior-card,
[data-theme="dark"] .gx-card,
[data-theme="dark"] .stacker-card {
  background: rgba(8, 14, 28, 0.9);
  border-color: rgba(0, 245, 255, 0.18);
}

[data-theme="dark"] .room-search-wrap,
[data-theme="dark"] .room-search-wrap:focus-within {
  background: rgba(8, 14, 28, 0.9);
  border-color: rgba(0, 245, 255, 0.22);
}

[data-theme="dark"] .room-search-wrap:focus-within {
  box-shadow: 0 0 16px rgba(0, 245, 255, 0.15);
}

[data-theme="dark"] ::placeholder {
  color: rgba(126, 184, 212, 0.55);
}

[data-theme="dark"] ::selection {
  background: rgba(0, 245, 255, 0.28);
  color: var(--text);
}

/* ── Facility spec / purchase ── */
[data-theme="dark"] .facility-spec-eyebrow {
  color: var(--neon-cyan);
}

[data-theme="dark"] .facility-spec-title {
  color: var(--text);
}

[data-theme="dark"] .facility-spec-subtitle {
  color: var(--muted);
}

[data-theme="dark"] .facility-spec-legend-chip[data-species="mouse"] {
  background: rgba(255, 45, 149, 0.15);
  color: #ff2d95;
  border-color: rgba(255, 45, 149, 0.35);
}

[data-theme="dark"] .facility-spec-legend-chip[data-species="rat"] {
  background: rgba(123, 140, 255, 0.15);
  color: #7b8cff;
  border-color: rgba(123, 140, 255, 0.35);
}

[data-theme="dark"] .facility-spec-legend-chip[data-species="rabbit"] {
  background: rgba(57, 255, 20, 0.12);
  color: #39ff14;
  border-color: rgba(57, 255, 20, 0.3);
}

[data-theme="dark"] .facility-spec-legend-chip[data-species="dog"] {
  background: rgba(255, 176, 32, 0.12);
  color: #ffb020;
  border-color: rgba(255, 176, 32, 0.3);
}

[data-theme="dark"] .facility-spec-legend-chip[data-species="pig"] {
  background: rgba(255, 77, 109, 0.12);
  color: #ff4d6d;
  border-color: rgba(255, 77, 109, 0.3);
}

[data-theme="dark"] .facility-spec-legend-chip[data-species="monkey"] {
  background: rgba(191, 95, 255, 0.12);
  color: #bf5fff;
  border-color: rgba(191, 95, 255, 0.3);
}

[data-theme="dark"] .facility-spec-table-shell {
  background: rgba(8, 14, 28, 0.75);
}

[data-theme="dark"] .facility-spec-wrap {
  background: rgba(8, 14, 28, 0.92);
  border-color: rgba(0, 245, 255, 0.2);
  box-shadow: inset 0 1px 0 rgba(0, 245, 255, 0.06);
}

[data-theme="dark"] .facility-spec-sheet thead th,
[data-theme="dark"] .facility-spec-sheet .facility-spec-group-head th,
[data-theme="dark"] .facility-spec-sheet .facility-spec-subhead th {
  background: rgba(0, 245, 255, 0.08);
  color: var(--neon-cyan);
  border-color: rgba(0, 245, 255, 0.15);
}

[data-theme="dark"] .facility-spec-sheet .facility-spec-col-group--dim {
  background: rgba(123, 140, 255, 0.1);
  border-color: rgba(123, 140, 255, 0.25);
}

[data-theme="dark"] .facility-spec-sheet .facility-spec-col-group--stats {
  background: rgba(57, 255, 20, 0.08);
}

[data-theme="dark"] .facility-spec-sheet tbody td,
[data-theme="dark"] .facility-spec-sheet tbody th {
  border-bottom-color: rgba(0, 245, 255, 0.1);
  color: var(--text);
}

[data-theme="dark"] .facility-spec-sheet tbody tr:hover td,
[data-theme="dark"] .facility-spec-sheet tbody tr:hover th.facility-spec-type {
  background-color: rgba(0, 245, 255, 0.06);
}

[data-theme="dark"] .facility-spec-sheet th.facility-spec-type[data-species="mouse"] { --tab-strong: #ff2d95; color: #ff2d95; }
[data-theme="dark"] .facility-spec-sheet th.facility-spec-type[data-species="rat"] { --tab-strong: #7b8cff; color: #7b8cff; }
[data-theme="dark"] .facility-spec-sheet th.facility-spec-type[data-species="rabbit"] { --tab-strong: #39ff14; color: #39ff14; }
[data-theme="dark"] .facility-spec-sheet th.facility-spec-type[data-species="dog"] { --tab-strong: #ffb020; color: #ffb020; }
[data-theme="dark"] .facility-spec-sheet th.facility-spec-type[data-species="pig"] { --tab-strong: #ff4d6d; color: #ff4d6d; }
[data-theme="dark"] .facility-spec-sheet th.facility-spec-type[data-species="monkey"] { --tab-strong: #bf5fff; color: #bf5fff; }

/* ── SOP ── */
[data-theme="dark"] .sop-filter-block {
  background: rgba(8, 14, 28, 0.88);
  border-color: rgba(0, 245, 255, 0.2);
}

[data-theme="dark"] .sop-filter-label {
  color: var(--neon-cyan);
}

[data-theme="dark"] .sop-filter-note {
  color: var(--muted);
}

[data-theme="dark"] .sop-category-tab {
  background: rgba(8, 14, 28, 0.88);
  border-color: rgba(0, 245, 255, 0.2);
  color: var(--muted);
}

[data-theme="dark"] .sop-category-tab:hover {
  border-color: var(--neon-cyan);
  color: var(--neon-cyan);
}

[data-theme="dark"] .sop-category-tab.active {
  background: linear-gradient(135deg, var(--neon-cyan), var(--neon-violet));
  color: #030508;
  border-color: transparent;
  box-shadow: 0 0 20px rgba(0, 245, 255, 0.25);
}

[data-theme="dark"] .sop-search-wrap {
  background: rgba(8, 14, 28, 0.9);
  border-color: rgba(0, 245, 255, 0.2);
}

[data-theme="dark"] .sop-row,
[data-theme="dark"] .sop-doc-card {
  background: rgba(8, 14, 28, 0.85);
  border-color: rgba(0, 245, 255, 0.14);
}

[data-theme="dark"] .kpi-rate-card {
  background: rgba(8, 14, 28, 0.85);
  border-color: color-mix(in srgb, var(--species-strong) 35%, rgba(0, 245, 255, 0.2));
}

[data-theme="dark"] .kpi-label {
  color: var(--muted);
}

/* ── Mirror site ── */
[data-theme="dark"] .mirror-banner,
[data-theme="dark"] .history-mirror-note,
[data-theme="dark"] .behavior-mirror-note {
  background: linear-gradient(135deg, rgba(0, 245, 255, 0.1), rgba(255, 0, 229, 0.08));
  border-color: rgba(0, 245, 255, 0.35);
  color: var(--text);
  box-shadow: 0 0 24px rgba(0, 245, 255, 0.1);
}

[data-theme="dark"] .mirror-banner strong,
[data-theme="dark"] .history-mirror-note strong {
  color: var(--neon-cyan);
}

[data-theme="dark"] .mirror-mode .room-readonly input,
[data-theme="dark"] .mirror-mode .room-readonly select,
[data-theme="dark"] .mirror-mode .pi-readonly input,
[data-theme="dark"] .mirror-mode .pi-readonly select {
  background: rgba(4, 8, 18, 0.9);
  border-color: rgba(0, 245, 255, 0.2);
  color: var(--text);
}

[data-theme="dark"] .sync-pill.sync-err {
  background: rgba(255, 204, 0, 0.1);
  border-color: rgba(255, 204, 0, 0.35);
  color: var(--neon-amber);
}

[data-theme="dark"] .sync-pill.sync-ok {
  background: rgba(57, 255, 20, 0.1);
  border-color: rgba(57, 255, 20, 0.3);
  color: var(--neon-lime);
}

/* IACUC lab_use calendar mirror */
[data-theme="dark"] .lab-use-iacuc-mirror .subject_calendar {
  color: var(--neon-cyan);
  text-shadow: 0 0 10px rgba(0, 245, 255, 0.35);
}

[data-theme="dark"] .lab-use-iacuc-mirror .reserve_guide {
  background: rgba(8, 14, 28, 0.88);
  border-color: rgba(0, 245, 255, 0.2);
}

[data-theme="dark"] .lab-use-iacuc-mirror .iacuc-cal-nav {
  background: rgba(8, 14, 28, 0.9);
  border-color: rgba(0, 245, 255, 0.22);
  color: var(--text);
}

[data-theme="dark"] .lab-use-iacuc-mirror .iacuc-cal-nav:hover {
  border-color: var(--neon-magenta);
  background: rgba(255, 0, 229, 0.08);
}

[data-theme="dark"] .lab-use-iacuc-mirror .tbl_calendar {
  border-color: rgba(0, 245, 255, 0.2);
}

[data-theme="dark"] .lab-use-iacuc-mirror .tbl_calendar th {
  background: rgba(0, 245, 255, 0.1);
  border-color: rgba(0, 245, 255, 0.18);
  color: var(--neon-cyan);
}

[data-theme="dark"] .lab-use-iacuc-mirror .tbl_calendar td {
  border-color: rgba(0, 245, 255, 0.12);
  background: rgba(8, 14, 28, 0.75);
  color: var(--text);
}

[data-theme="dark"] .lab-use-iacuc-mirror .tbl_calendar td.no_date {
  background: rgba(4, 8, 18, 0.6);
  color: var(--muted);
}

[data-theme="dark"] .lab-use-iacuc-mirror .tbl_calendar th.date_red {
  color: #ff3366;
}

[data-theme="dark"] .lab-use-iacuc-mirror .tbl_calendar th.date_sat {
  color: #7b8cff;
}

[data-theme="dark"] .lab-use-iacuc-mirror .list_reserve li {
  border-color: rgba(0, 245, 255, 0.14);
}

[data-theme="dark"] .lab-use-iacuc-mirror .detail_reserve {
  background: rgba(10, 16, 32, 0.96);
  border-color: rgba(0, 245, 255, 0.25);
  color: var(--text);
  box-shadow: 0 0 20px rgba(0, 245, 255, 0.12);
}

[data-theme="dark"] .lab-use-iacuc-mirror .lab1 p,
[data-theme="dark"] .lab-use-iacuc-mirror p.lab1 { background: rgba(255, 45, 149, 0.2); color: #ff2d95; }
[data-theme="dark"] .lab-use-iacuc-mirror .lab2 p,
[data-theme="dark"] .lab-use-iacuc-mirror p.lab2 { background: rgba(123, 140, 255, 0.2); color: #7b8cff; }
[data-theme="dark"] .lab-use-iacuc-mirror .lab3 p,
[data-theme="dark"] .lab-use-iacuc-mirror p.lab3 { background: rgba(57, 255, 20, 0.15); color: #39ff14; }
[data-theme="dark"] .lab-use-iacuc-mirror .lab4 p,
[data-theme="dark"] .lab-use-iacuc-mirror p.lab4 { background: rgba(255, 176, 32, 0.15); color: #ffb020; }
[data-theme="dark"] .lab-use-iacuc-mirror .lab5 p,
[data-theme="dark"] .lab-use-iacuc-mirror p.lab5 { background: rgba(191, 95, 255, 0.15); color: #bf5fff; }
[data-theme="dark"] .lab-use-iacuc-mirror .lab6 p,
[data-theme="dark"] .lab-use-iacuc-mirror p.lab6 { background: rgba(0, 245, 255, 0.12); color: #00f5ff; }
[data-theme="dark"] .lab-use-iacuc-mirror .lab7 p,
[data-theme="dark"] .lab-use-iacuc-mirror p.lab7 { background: rgba(255, 0, 229, 0.12); color: #ff00e5; }
[data-theme="dark"] .lab-use-iacuc-mirror .lab8 p,
[data-theme="dark"] .lab-use-iacuc-mirror p.lab8 { background: rgba(184, 255, 0, 0.12); color: #b8ff00; }
[data-theme="dark"] .lab-use-iacuc-mirror .lab9 p,
[data-theme="dark"] .lab-use-iacuc-mirror p.lab9 { background: rgba(255, 204, 0, 0.12); color: #ffcc00; }
[data-theme="dark"] .lab-use-iacuc-mirror .lab10 p,
[data-theme="dark"] .lab-use-iacuc-mirror p.lab10 { background: rgba(255, 77, 109, 0.15); color: #ff4d6d; }
[data-theme="dark"] .lab-use-iacuc-mirror .lab11 p,
[data-theme="dark"] .lab-use-iacuc-mirror p.lab11 { background: rgba(0, 245, 255, 0.1); color: #7fffff; }
[data-theme="dark"] .lab-use-iacuc-mirror .lab12 p,
[data-theme="dark"] .lab-use-iacuc-mirror p.lab12 { background: rgba(191, 95, 255, 0.12); color: #d494ff; }
[data-theme="dark"] .lab-use-iacuc-mirror .lab13 p,
[data-theme="dark"] .lab-use-iacuc-mirror p.lab13 { background: rgba(57, 255, 20, 0.1); color: #7fff5c; }

/* Fancy motion */
@keyframes kmedi-neon-pulse {
  0%, 100% { opacity: 1; filter: brightness(1); }
  50% { opacity: 0.92; filter: brightness(1.15); }
}

@keyframes kmedi-border-glow {
  0%, 100% { box-shadow: 0 0 0 1px rgba(0, 245, 255, 0.06), 0 12px 36px rgba(0, 0, 0, 0.45), 0 0 24px color-mix(in srgb, var(--species-strong) 10%, transparent); }
  50% { box-shadow: 0 0 0 1px rgba(0, 245, 255, 0.14), 0 12px 36px rgba(0, 0, 0, 0.45), 0 0 40px color-mix(in srgb, var(--species-strong) 22%, transparent); }
}

@keyframes kmedi-toggle-shimmer {
  0% { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}

[data-theme="dark"] .brand-kicker,
[data-theme="dark"] .kpi-value {
  animation: kmedi-neon-pulse 3.2s ease-in-out infinite;
}

[data-theme="dark"] .card {
  animation: kmedi-border-glow 4.5s ease-in-out infinite;
}

[data-theme="dark"] .theme-toggle[aria-pressed="true"] {
  background: linear-gradient(90deg, rgba(255, 0, 229, 0.2), rgba(0, 245, 255, 0.2), rgba(184, 255, 0, 0.15), rgba(255, 0, 229, 0.2));
  background-size: 200% 100%;
  animation: kmedi-toggle-shimmer 3s linear infinite;
}

[data-theme="dark"] .species-tab.active,
[data-theme="dark"] .view-tab.active {
  animation: kmedi-neon-pulse 2.8s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
  [data-theme="dark"] .brand-kicker,
  [data-theme="dark"] .kpi-value,
  [data-theme="dark"] .card,
  [data-theme="dark"] .theme-toggle[aria-pressed="true"],
  [data-theme="dark"] .species-tab.active,
  [data-theme="dark"] .view-tab.active {
    animation: none;
  }
}
