* { box-sizing: border-box; }

:root {
  --bg: #f3f6f3;
  --bg-accent: #e8efe9;
  --surface: #ffffff;
  --surface-muted: #f7faf7;
  --text: #122018;
  --text-muted: #6b7c70;
  --text-subtle: #5a6b60;
  --border: #e2eae3;
  --border-input: #cfd9d1;
  --primary: #0d4832;
  --primary-dark: #083526;
  --primary-mid: #1a6b4a;
  --primary-soft: #e4f2ea;
  --mint: #b8e0c8;
  --mint-strong: #7cbc95;
  --accent-link: #0d4832;
  --error: #c62828;
  --shadow: rgba(13, 72, 50, 0.10);
  --shadow-soft: rgba(13, 72, 50, 0.06);
  --radius: 20px;
  --radius-sm: 14px;
  --radius-pill: 999px;
  --sidebar-width: 248px;
  --map-bg: #dfe8e1;
  --header-text: #122018;
  --secondary-bg: #ffffff;
  --secondary-text: #0d4832;
  --tab-text: #5a6b60;
  --tab-border: transparent;
  --chart-empty: #7a8a7e;
  --media-border: #d5e0d7;
  --code-bg: transparent;
  --font: "Plus Jakarta Sans", "Segoe UI", sans-serif;
}

[data-theme="dark"] {
  --bg: #0e1511;
  --bg-accent: #15201a;
  --surface: #18241d;
  --surface-muted: #1e2c24;
  --text: #e8f2eb;
  --text-muted: #9aafa0;
  --text-subtle: #8aa094;
  --border: #2a3b31;
  --border-input: #3a4d42;
  --primary: #6fbf93;
  --primary-dark: #0d4832;
  --primary-mid: #4a9a6e;
  --primary-soft: #1a3328;
  --mint: #2d5a42;
  --mint-strong: #4a9a6e;
  --accent-link: #8fd4ae;
  --error: #ef9a9a;
  --shadow: rgba(0, 0, 0, 0.4);
  --shadow-soft: rgba(0, 0, 0, 0.28);
  --map-bg: #15201a;
  --header-text: #e8f2eb;
  --secondary-bg: #1e2c24;
  --secondary-text: #a5d6a7;
  --tab-text: #b8c9be;
  --tab-border: transparent;
  --chart-empty: #8a9a8a;
  --media-border: #3d4a3d;
  --code-bg: #1e2c24;
  --font: "Plus Jakarta Sans", "Segoe UI", sans-serif;
}

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  transition: background 0.2s ease, color 0.2s ease;
  letter-spacing: -0.01em;
}

.hidden { display: none !important; }
.view { min-height: 100vh; }

/* ——— Login: forest photo + glass panel ——— */
.login-view {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow: hidden;
  isolation: isolate;
}

.login-backdrop {
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    url("assets/login-forest.png") center / cover no-repeat;
  transform: scale(1.02);
  animation: login-bg-drift 28s ease-in-out infinite alternate;
}

.login-veil {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(8, 28, 20, 0.28) 0%, rgba(8, 22, 18, 0.18) 38%, rgba(6, 18, 14, 0.42) 100%),
    radial-gradient(ellipse 70% 55% at 50% 40%, transparent 35%, rgba(4, 16, 12, 0.35) 100%);
}

html[data-theme="dark"] .login-veil {
  background:
    linear-gradient(180deg, rgba(2, 10, 8, 0.45) 0%, rgba(4, 14, 10, 0.32) 40%, rgba(2, 8, 6, 0.58) 100%),
    radial-gradient(ellipse 70% 55% at 50% 40%, transparent 30%, rgba(0, 0, 0, 0.45) 100%);
}

@keyframes login-bg-drift {
  from { transform: scale(1.02) translate3d(0, 0, 0); }
  to { transform: scale(1.06) translate3d(-1.2%, -0.6%, 0); }
}

.login-topbar {
  position: relative;
  z-index: 3;
  display: flex;
  justify-content: flex-end;
  padding: 18px 22px 0;
}

.login-theme-btn {
  width: auto;
  margin: 0;
  padding: 9px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.38);
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  font: inherit;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.02em;
  cursor: pointer;
  backdrop-filter: blur(14px) saturate(1.3);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.login-theme-btn:hover {
  background: rgba(255, 255, 255, 0.28);
}

.login-stage {
  position: relative;
  z-index: 2;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 20px 40px;
}

.login-card {
  width: min(420px, 100%);
  margin: 0;
  padding: 34px 32px 28px;
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  background:
    linear-gradient(
      155deg,
      rgba(255, 255, 255, 0.52) 0%,
      rgba(245, 250, 247, 0.38) 48%,
      rgba(228, 242, 234, 0.34) 100%
    );
  backdrop-filter: blur(28px) saturate(1.45);
  -webkit-backdrop-filter: blur(28px) saturate(1.45);
  box-shadow:
    0 28px 70px rgba(4, 24, 16, 0.28),
    0 1px 0 rgba(255, 255, 255, 0.55) inset,
    0 -1px 0 rgba(13, 72, 50, 0.06) inset;
  animation: login-card-in 520ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

html[data-theme="dark"] .login-card {
  border-color: rgba(255, 255, 255, 0.16);
  background:
    linear-gradient(
      160deg,
      rgba(28, 40, 34, 0.72) 0%,
      rgba(16, 24, 20, 0.68) 55%,
      rgba(10, 16, 14, 0.74) 100%
    );
  box-shadow:
    0 28px 70px rgba(0, 0, 0, 0.45),
    0 1px 0 rgba(255, 255, 255, 0.12) inset;
  color: #f2f7f4;
}

@keyframes login-card-in {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.login-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 22px;
}

.login-logo {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  object-fit: cover;
  box-shadow:
    0 14px 28px rgba(13, 72, 50, 0.32),
    0 0 0 1px rgba(255, 255, 255, 0.35);
  animation: login-logo-in 700ms cubic-bezier(0.22, 1, 0.36, 1) 80ms both;
}

@keyframes login-logo-in {
  from { opacity: 0; transform: scale(0.88); }
  to { opacity: 1; transform: scale(1); }
}

.login-brand-name {
  margin: 14px 0 0;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.1;
  color: #0d4832;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.35);
}

html[data-theme="dark"] .login-brand-name {
  color: #f4faf6;
  text-shadow: none;
}

.login-brand-place {
  margin: 4px 0 0;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(13, 72, 50, 0.72);
}

html[data-theme="dark"] .login-brand-place {
  color: rgba(184, 224, 200, 0.78);
}

.login-title {
  margin: 0 0 8px;
  text-align: center;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #122018;
}

html[data-theme="dark"] .login-title {
  color: #eef5f0;
}

.login-lede {
  margin: 0 0 22px;
  text-align: center;
  font-size: 13.5px;
  line-height: 1.45;
  font-weight: 500;
  color: rgba(18, 32, 24, 0.72);
}

html[data-theme="dark"] .login-lede {
  color: rgba(197, 208, 201, 0.86);
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.login-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin: 0;
  font-size: 13px;
}

.login-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(13, 72, 50, 0.78);
}

html[data-theme="dark"] .login-label {
  color: rgba(159, 224, 188, 0.9);
}

.login-card input {
  width: 100%;
  min-height: 46px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.55);
  color: #122018;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.4) inset;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.login-card input::placeholder {
  color: rgba(18, 32, 24, 0.42);
}

.login-card input:focus {
  outline: none;
  border-color: rgba(13, 72, 50, 0.45);
  background: rgba(255, 255, 255, 0.78);
  box-shadow:
    0 0 0 3px rgba(13, 72, 50, 0.14),
    0 1px 0 rgba(255, 255, 255, 0.5) inset;
}

html[data-theme="dark"] .login-card input {
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.08);
  color: #f4f7f5;
  box-shadow: none;
}

html[data-theme="dark"] .login-card input::placeholder {
  color: rgba(197, 208, 201, 0.45);
}

html[data-theme="dark"] .login-card input:focus {
  border-color: rgba(159, 224, 188, 0.45);
  background: rgba(255, 255, 255, 0.12);
  box-shadow: 0 0 0 3px rgba(13, 72, 50, 0.35);
}

.login-card .password-field input {
  padding-right: 4.6rem;
}

.login-card .password-toggle {
  right: 8px;
  padding: 7px 11px;
  border-radius: 10px;
  border: 1px solid rgba(13, 72, 50, 0.14);
  background: rgba(255, 255, 255, 0.55);
  color: #0d4832;
  font-size: 11px;
  font-weight: 700;
}

.login-card .password-toggle:hover {
  background: rgba(228, 242, 234, 0.9);
}

html[data-theme="dark"] .login-card .password-toggle {
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.1);
  color: #d7ebe0;
}

.login-submit {
  width: 100%;
  margin: 4px 0 0;
  min-height: 48px;
  padding: 13px 16px;
  border: none;
  border-radius: 14px;
  background: linear-gradient(160deg, #0d4832 0%, #166b4a 100%);
  color: #fff;
  font: inherit;
  font-size: 15px;
  font-weight: 750;
  letter-spacing: -0.01em;
  cursor: pointer;
  box-shadow: 0 14px 28px rgba(13, 72, 50, 0.32);
  transition: transform 140ms ease, box-shadow 140ms ease, filter 140ms ease;
}

.login-submit:hover {
  filter: brightness(1.05);
  box-shadow: 0 16px 32px rgba(13, 72, 50, 0.38);
}

.login-submit:active {
  transform: translateY(1px);
}

.login-secondary {
  width: 100%;
  margin: 0;
  min-height: 44px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.28);
  color: #0d4832;
  font: inherit;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
}

html[data-theme="dark"] .login-secondary {
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
  color: #e8f5ee;
}

.login-forgot-wrap {
  margin: 14px 0 0;
  text-align: center;
}

.login-forgot {
  font-size: 13px;
  font-weight: 650;
  color: #0d4832 !important;
}

html[data-theme="dark"] .login-forgot {
  color: #9fe0bc !important;
}

.login-error {
  margin: 12px 0 0;
  text-align: center;
}

.login-info {
  margin: 12px 0 0;
  text-align: center;
  font-size: 13px;
  font-weight: 500;
  color: #0d4832;
}

html[data-theme="dark"] .login-info {
  color: #b8f0d0;
}

.login-foot {
  margin: 22px 0 0;
  padding-top: 16px;
  border-top: 1px solid rgba(13, 72, 50, 0.12);
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(18, 32, 24, 0.5);
}

html[data-theme="dark"] .login-foot {
  border-top-color: rgba(255, 255, 255, 0.1);
  color: rgba(197, 208, 201, 0.55);
}

@media (max-width: 480px) {
  .login-card {
    padding: 28px 22px 24px;
    border-radius: 22px;
  }

  .login-brand-name {
    font-size: 24px;
  }

  .login-logo {
    width: 64px;
    height: 64px;
    border-radius: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .login-backdrop,
  .login-card,
  .login-logo {
    animation: none !important;
  }
}

.password-field {
  position: relative;
  display: block;
}

.password-field input {
  padding-right: 4.5rem;
}

.password-toggle {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: auto;
  margin: 0;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;
  background: var(--secondary-bg);
  color: var(--secondary-text);
  border: 1px solid var(--border-input);
  border-radius: 6px;
}

.password-toggle:hover {
  background: var(--surface-muted);
}

input, select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-input);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
}

button {
  margin-top: 16px;
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

button.secondary {
  width: auto;
  background: var(--secondary-bg);
  color: var(--secondary-text);
  border: 1px solid var(--primary);
}

button.toolbar-btn {
  width: auto;
  margin: 0;
  padding: 8px 14px;
  font-size: 13px;
  line-height: 1.2;
  white-space: nowrap;
}

.error { color: var(--error); font-size: 14px; }

.subtitle { color: var(--text-muted); margin-top: 4px; }
label { display: block; margin: 16px 0 8px; font-size: 14px; }

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  background: var(--primary);
  color: var(--header-text);
}

header button.secondary {
  background: rgba(255, 255, 255, 0.12);
  color: var(--header-text);
  border-color: rgba(255, 255, 255, 0.45);
}

header button.secondary:hover {
  background: rgba(255, 255, 255, 0.2);
}

.header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

.header-actions button {
  margin: 0;
}

.header-actions .toolbar-divider {
  width: 1px;
  height: 24px;
  background: rgba(255, 255, 255, 0.35);
  margin: 0 4px;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.tab {
  width: auto;
  margin: 0;
  background: transparent;
  color: var(--tab-text);
  border: 1px solid var(--tab-border);
}

.tab.active {
  background: var(--primary-soft);
  border-color: var(--primary);
  color: var(--primary);
}

main { padding: 24px; }

.stats, .stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.stat-card {
  background: var(--surface);
  padding: 16px;
  border-radius: 10px;
  box-shadow: 0 2px 8px var(--shadow-soft);
  border: 1px solid var(--border);
}

.stat-card strong { font-size: 28px; display: block; }

.table-wrap {
  overflow: auto;
  background: var(--surface);
  border-radius: 10px;
  border: 1px solid var(--border);
}

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; }
th { background: var(--surface-muted); }

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  text-transform: capitalize;
  background: var(--border);
  color: var(--text);
}

.badge-critical { background: #ffcdd2; color: #b71c1c; }
.badge-high { background: #ffe0b2; color: #e65100; }
.badge-medium { background: #fff9c4; color: #f57f17; }
.badge-low { background: #e8f5e9; color: #2e7d32; }

#map {
  height: 520px;
  border-radius: 10px;
  background: var(--map-bg);
  border: 1px solid var(--border);
}

.map-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.map-title {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
}

.map-subtitle {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--text-muted);
}

.map-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

#map-density-toggle[aria-pressed="true"] {
  background: var(--primary-soft);
  border-color: var(--primary);
  color: var(--primary-dark);
  font-weight: 700;
}

.map-hotspot-banner {
  margin-bottom: 12px;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid #ffcc80;
  background: #fff3e0;
  color: #e65100;
  font-size: 13px;
  line-height: 1.45;
}

[data-theme="dark"] .map-hotspot-banner {
  background: #3a2a1a;
  border-color: #8d6e63;
  color: #ffb74d;
}

.map-hotspot-banner strong {
  display: block;
  margin-bottom: 4px;
}

.map-hotspot-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.map-hotspot-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid currentColor;
  background: transparent;
  color: inherit;
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
}

.map-hotspot-pill:hover {
  background: rgba(230, 81, 0, 0.12);
}

.map-legend-panel {
  margin-top: 12px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 13px;
}

.map-legend-panel ul {
  margin: 8px 0;
  padding-left: 0;
  list-style: none;
}

.map-legend-panel li {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0;
}

.swatch {
  display: inline-block;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  flex-shrink: 0;
}

.swatch-marker { background: #2e7d32; border: 2px solid #fff; box-shadow: 0 0 0 1px #ccc; }
.swatch-current-high { background: rgba(230, 81, 0, 0.35); border: 2px solid #e65100; }
.swatch-sev-critical { background: #b71c1c; border: 2px solid #fff; box-shadow: 0 0 0 1px #ccc; }
.swatch-sev-high { background: #e65100; border: 2px solid #fff; box-shadow: 0 0 0 1px #ccc; }
.swatch-sev-medium { background: #f9a825; border: 2px solid #fff; box-shadow: 0 0 0 1px #ccc; }
.swatch-sev-low { background: #2e7d32; border: 2px solid #fff; box-shadow: 0 0 0 1px #ccc; }
.swatch-hotspot-zone {
  background: rgba(183, 28, 28, 0.15);
  border: 2px dashed #b71c1c;
  border-radius: 50%;
}
.swatch-density {
  background: linear-gradient(90deg, #311b92, #00e676, #ffea00, #ff1744);
  border-radius: 4px;
}

.leaflet-popup .map-popup-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.leaflet-popup .map-popup-actions .secondary,
.leaflet-popup .map-popup-actions a.secondary {
  font-size: 12px;
  padding: 4px 8px;
  text-decoration: none;
}

.priority-chip {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  margin-right: 4px;
}

.priority-chip.critical { background: #ffcdd2; color: #b71c1c; }
.priority-chip.high { background: #ffe0b2; color: #e65100; }
.priority-chip.medium { background: #fff9c4; color: #f57f17; }

.map-legend { font-size: 13px; color: var(--text-muted); margin-top: 8px; }

.analytics-controls {
  display: flex;
  gap: 12px;
  align-items: end;
  margin-bottom: 16px;
}

.analytics-controls label { margin: 0; }
.analytics-controls button { width: auto; margin: 0; }
.status-select { min-width: 140px; }

.reports-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 12px;
  align-items: end;
  margin-bottom: 10px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.reports-filters label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.reports-filters select,
.reports-filters input[type="search"] {
  min-width: 140px;
  padding: 8px 10px;
  border: 1px solid var(--border-input);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-weight: 400;
}

.reports-filters .filter-search {
  flex: 1 1 220px;
}

.reports-filters .filter-search input {
  min-width: 200px;
  width: 100%;
}

.reports-filters #filter-clear {
  width: auto;
  margin: 0;
}

.filter-summary {
  margin: 0 0 12px;
  font-size: 13px;
}

.user-inactive-row td {
  opacity: 0.72;
}

#user-agency:disabled {
  opacity: 0.75;
  cursor: not-allowed;
}

.routing-rules-block {
  margin-top: 28px;
}

.routing-rules-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 12px;
}

.routing-rule-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
}

.routing-rule-summary {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.routing-rule-summary h4 {
  margin: 0 0 4px;
  font-size: 16px;
  color: var(--text);
}

.routing-rule-meta {
  margin: 0;
  line-height: 1.4;
}

.routing-rule-editor {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.routing-rule-editor label {
  margin: 0;
}

.routing-rule-editor select {
  width: 100%;
  max-width: 480px;
}

.routing-collab-fieldset {
  margin: 0;
  padding: 0;
  border: none;
}

.routing-collab-fieldset legend {
  font-weight: 700;
  font-size: 13px;
  color: var(--text);
  margin-bottom: 4px;
}

.routing-collab-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.routing-collab-chip {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-muted);
  cursor: pointer;
  font-weight: 400;
  margin: 0;
}

.routing-collab-chip input {
  margin: 0 0 4px;
  width: auto;
}

.routing-collab-short {
  font-weight: 700;
  font-size: 13px;
  color: var(--text);
  text-transform: uppercase;
}

.routing-collab-name {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.3;
}

.routing-collab-chip.is-checked {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.routing-collab-chip.is-primary {
  opacity: 0.45;
  cursor: not-allowed;
}

.routing-police-label {
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 8px;
  font-weight: 500;
}

.routing-police-label input {
  width: auto;
  margin: 0;
}

.routing-rule-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.routing-rule-actions .routing-save-btn {
  width: auto;
  margin: 0;
}

.category-badge {
  display: inline-block;
  background: var(--primary-soft);
  color: var(--primary);
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
}

.hint { font-size: 13px; color: var(--text-muted); margin-top: 12px; }
.hint a { color: var(--primary); }

.officer-header { background: transparent; }
.municipal-header { background: #1b5e20; }

.platform-owner-note {
  margin: 4px 0 0;
  font-size: 12px;
  font-weight: 400;
  opacity: 0.9;
}

.inline-form {
  display: grid;
  gap: 12px;
  max-width: 640px;
  margin-bottom: 20px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
}

.inline-form label { margin: 0; }
.inline-form input,
.inline-form textarea,
.inline-form select {
  width: 100%;
  margin-top: 4px;
}

.inline-form .setting-hint {
  margin: -6px 0 4px;
  font-size: 12px;
  line-height: 1.35;
  color: var(--text-muted);
}

.ann-publish-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 24px;
}

.ann-publish-now {
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  margin: 0;
}

.ann-publish-now input {
  width: auto;
  margin: 0;
}

.ann-expires-label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0;
  min-width: 220px;
}

.ann-expires-label input {
  width: 100%;
  margin-top: 0;
}

.ann-status {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-muted);
  color: var(--text);
}

.ann-status-live {
  border-color: #2e7d32;
  color: #1b5e20;
  background: #e8f5e9;
}

.ann-status-draft {
  color: var(--text-muted);
}

.ann-status-expired {
  border-color: #ef6c00;
  color: #e65100;
  background: #fff3e0;
}

.action-cell {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  min-width: 220px;
}

.action-cell select,
.action-cell button {
  font-size: 12px;
}

.unread-row { background: rgba(46, 125, 50, 0.08); }

.officers-toolbar {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.officers-toolbar button { width: auto; margin: 0; }

.officers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.officer-card {
  background: var(--surface);
  border-radius: 10px;
  padding: 16px;
  box-shadow: 0 2px 8px var(--shadow-soft);
  border: 1px solid var(--border);
}

.officer-card h3 { margin: 0 0 8px; color: var(--primary); }

.officer-card .portal-link {
  display: inline-block;
  margin-top: 8px;
  color: var(--accent-link);
  font-size: 14px;
}

.officer-card .meta { font-size: 13px; color: var(--text-subtle); margin: 4px 0; }
.officer-card button { width: auto; margin-top: 8px; padding: 8px 12px; font-size: 13px; }

.login-hint {
  font-size: 14px;
  color: var(--text-muted);
  margin: 0 0 16px;
  line-height: 1.45;
}

button.linkish {
  background: none;
  border: none;
  color: var(--accent-link);
  cursor: pointer;
  padding: 0;
  font: inherit;
  text-decoration: underline;
}

#forgot-form,
#reset-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

th.hidden, td.hidden { display: none; }
.desc-cell { min-width: 180px; max-width: 280px; vertical-align: top; }
.description-block { display: flex; flex-direction: column; gap: 8px; }
.description-text {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}
.media-cell { min-width: 100px; }

.media-thumb {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--media-border);
  cursor: pointer;
}

.media-link { font-size: 12px; color: var(--accent-link); }
.action-cell .status-select { margin: 0; min-width: 160px; }

code {
  background: var(--code-bg);
  padding: 1px 4px;
  border-radius: 4px;
}

.charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
}

.chart-card {
  background: var(--surface);
  border-radius: 10px;
  padding: 16px;
  box-shadow: 0 2px 8px var(--shadow-soft);
  border: 1px solid var(--border);
}

.chart-card h3 {
  margin: 0 0 12px;
  font-size: 15px;
  color: var(--primary);
}

.chart-wide { grid-column: 1 / -1; }
.chart-wrap { position: relative; height: 280px; }
.chart-wide .chart-wrap { height: 300px; }

.chart-empty {
  font-size: 13px;
  color: var(--chart-empty);
  padding: 24px 0;
  text-align: center;
}

/* ?? Municipal dashboard (additive overview) ?? */
.dash-header {
  margin-bottom: 16px;
}

.dash-title {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

.dash-subtitle {
  margin: 4px 0 0;
  font-size: 14px;
  color: var(--text-muted);
}

.dash-alert {
  margin-bottom: 16px;
  padding: 12px 16px;
  border-radius: 8px;
  border: 1px solid #ef9a9a;
  background: #ffebee;
  color: #b71c1c;
  font-size: 14px;
}

[data-theme="dark"] .dash-alert {
  background: #3a1c1c;
  border-color: #8e3a3a;
  color: #ef9a9a;
}

.dash-alert a,
.dash-alert .linkish {
  color: inherit;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  font: inherit;
}

.dash-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.dash-kpi {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 18px;
  box-shadow: 0 2px 8px var(--shadow-soft);
}

.dash-kpi-label {
  display: block;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.dash-kpi-value {
  display: block;
  font-size: 32px;
  font-weight: 700;
  line-height: 1.1;
  color: var(--text);
}

.dash-kpi-value.tone-info { color: #1565c0; }
.dash-kpi-value.tone-danger { color: #c62828; }
.dash-kpi-value.tone-warning { color: #e65100; }

[data-theme="dark"] .dash-kpi-value.tone-info { color: #64b5f6; }
[data-theme="dark"] .dash-kpi-value.tone-danger { color: #ef9a9a; }
[data-theme="dark"] .dash-kpi-value.tone-warning { color: #ffb74d; }

.dash-queues {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.dash-research {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

.dash-research-actions .dash-research-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 6px;
}

.dash-research-actions .dash-research-btns button {
  width: auto;
  margin: 0;
}

.dash-research .dash-card {
  min-height: 0;
}

.dash-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 2px 8px var(--shadow-soft);
  padding: 14px 16px 8px;
  min-height: 120px;
}

.dash-workload {
  padding-bottom: 12px;
  margin-bottom: 8px;
}

.dash-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}

.dash-card-head h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.dash-card-head .linkish {
  color: var(--primary);
  font-size: 13px;
  font-weight: 600;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
}

.dash-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.dash-list li {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px 0;
  border-top: 1px solid var(--border);
  font-size: 13px;
}

.dash-list li:first-child {
  border-top: none;
}

.dash-list .empty {
  display: block;
  padding: 18px 0;
  color: var(--text-muted);
  border: none;
  grid-column: 1 / -1;
}

.dash-token {
  color: var(--primary);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space:nowrap;
  background: none;
  border: none;
  padding: 0;
  text-align: left;
  cursor: pointer;
  font: inherit;
}

.dash-cat {
  color: var(--text-subtle);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.severity-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: #c62828;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}

[data-theme="dark"] .severity-dot {
  background: #e57373;
  color: #1b1212;
}

.dash-table-wrap {
  border: none;
  box-shadow: none;
  background: transparent;
}

.dash-table-wrap th.num,
.dash-table-wrap td.num {
  text-align: right;
}

@media (max-width: 900px) {
  .dash-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .dash-queues {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .dash-kpis {
    grid-template-columns: 1fr;
  }
  .dash-list li {
    grid-template-columns: 1fr auto;
  }
  .dash-cat {
    grid-column: 1 / -1;
  }
}

.dash-list li.is-selected {
  background: var(--primary-soft);
  margin: 0 -8px;
  padding-left: 8px;
  padding-right: 8px;
  border-radius: 8px;
}

.dash-list li.is-selected .dash-token {
  text-decoration: underline;
}

.token-link {
  color: var(--primary);
  font-weight: 600;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  text-align: left;
}

.token-link:hover {
  text-decoration: underline;
}

#reports-body tr.is-selected {
  background: var(--primary-soft);
}

#reports-body tr.is-selected .token-link {
  text-decoration: underline;
}

/* ?? Case detail drawer ?? */
.case-drawer-root {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  justify-content: flex-end;
}

.case-drawer-root.hidden {
  display: none !important;
}

.case-drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 25, 15, 0.35);
  border: none;
  cursor: pointer;
}

[data-theme="dark"] .case-drawer-backdrop {
  background: rgba(0, 0, 0, 0.55);
}

.case-drawer {
  position: relative;
  width: min(440px, 100%);
  height: 100%;
  background: var(--surface);
  border-left: 1px solid var(--border);
  box-shadow: -8px 0 24px var(--shadow);
  display: flex;
  flex-direction: column;
  z-index: 1;
  animation: case-drawer-in 160ms ease-out;
}

@keyframes case-drawer-in {
  from { transform: translateX(12px); opacity: 0.6; }
  to { transform: translateX(0); opacity: 1; }
}

.case-drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.case-drawer-kicker {
  margin: 0 0 4px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.case-drawer-token {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
  word-break: break-all;
}

.case-drawer-body {
  padding: 16px 20px 28px;
  overflow: auto;
  flex: 1;
}

.case-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.case-section {
  margin-bottom: 18px;
}

.case-section h3 {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-muted);
}

.case-meta {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 6px 10px;
  font-size: 14px;
}

.case-meta dt {
  margin: 0;
  color: var(--text-muted);
}

.case-meta dd {
  margin: 0;
  color: var(--text);
  font-weight: 500;
  word-break: break-word;
}

.case-description {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-subtle);
  white-space: pre-wrap;
}

.case-evidence {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.case-evidence .media-thumb {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.case-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.case-actions .assign-select,
.case-actions .status-select {
  min-width: 180px;
}

.case-drawer-footer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.case-nav-meta {
  margin: 0 0 10px;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.4;
}

.case-nav-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

a.btn-navigate {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border-radius: 8px;
  background: var(--primary);
  color: #fff !important;
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  border: none;
  cursor: pointer;
}

a.btn-navigate:hover {
  background: var(--primary-dark);
  color: #fff !important;
}

a.btn-navigate-secondary {
  background: var(--secondary-bg);
  color: var(--secondary-text) !important;
  border: 1px solid var(--primary);
}

a.btn-navigate-secondary:hover {
  background: var(--primary-soft);
  color: var(--primary-dark) !important;
}

a.btn-nav-secondary,
button.btn-nav-secondary {
  text-decoration: none;
}

a.nav-inline {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
}

a.nav-inline:hover {
  text-decoration: underline;
}

@media (max-width: 560px) {
  .case-drawer-root {
    align-items: flex-end;
  }
  .case-drawer {
    width: 100%;
    height: min(92vh, 100%);
    border-left: none;
    border-top: 1px solid var(--border);
    border-radius: 16px 16px 0 0;
    animation: case-sheet-in 180ms ease-out;
  }
  @keyframes case-sheet-in {
    from { transform: translateY(16px); opacity: 0.7; }
    to { transform: translateY(0); opacity: 1; }
  }
}



/* ===== EcoWatch admin UI refresh (Donezo-inspired) ===== */

#app-view {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  min-height: 100vh;
  background:
    radial-gradient(ellipse 80% 50% at 100% 0%, var(--bg-accent), transparent 55%),
    var(--bg);
}

.app-sidebar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 22px 16px 18px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
  z-index: 20;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 10px 18px;
}

.login-card .login-field {
  margin: 0;
}

.sidebar-logo {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  flex-shrink: 0;
  object-fit: cover;
  box-shadow: 0 8px 18px var(--shadow);
}

.sidebar-mark {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  flex-shrink: 0;
  background:
    radial-gradient(circle at 30% 30%, var(--mint-strong), transparent 48%),
    var(--primary);
  box-shadow: 0 8px 18px var(--shadow);
}

.sidebar-brand-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.sidebar-brand-text strong {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--primary);
}

.sidebar-brand-text span {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.sidebar-section-label {
  margin: 4px 10px 2px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.sidebar-nav.tabs {
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  gap: 4px;
  padding: 0;
  background: transparent;
  border: none;
  flex: 1;
}

.sidebar-nav .tab {
  width: 100%;
  margin: 0;
  text-align: left;
  background: transparent;
  color: var(--tab-text);
  border: none;
  border-radius: 12px;
  padding: 11px 14px;
  font-weight: 600;
  font-size: 14px;
  position: relative;
  box-shadow: none;
}

.sidebar-nav .tab:hover {
  background: var(--surface-muted);
  color: var(--text);
}

.sidebar-nav .tab.active {
  background: var(--primary-soft);
  color: var(--primary);
  border: none;
}

.sidebar-nav .tab.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 3px;
  border-radius: var(--radius-pill);
  background: var(--primary);
}

.sidebar-foot {
  margin-top: auto;
  padding: 12px 10px 4px;
  border-top: 1px solid var(--border);
}

.sidebar-foot .platform-owner-note {
  margin: 0;
  font-size: 11px;
  line-height: 1.45;
  color: var(--text-muted);
}

.app-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 100vh;
}

#app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 22px 28px 10px;
  background: transparent !important;
  color: var(--header-text);
  border: none;
}

#app-header.officer-header,
#app-header.municipal-header {
  background: transparent !important;
  color: var(--header-text);
}

.header-identity { min-width: 0; }

#header-title {
  display: block;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
}

#user-label {
  display: block;
  margin-top: 3px;
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
}

#app-header button.secondary {
  background: var(--surface);
  color: var(--secondary-text);
  border: 1.5px solid var(--border);
  box-shadow: 0 1px 2px var(--shadow-soft);
}

#app-header button.secondary:hover {
  background: var(--primary-soft);
  border-color: var(--primary);
}

.header-actions .toolbar-divider {
  background: var(--border);
}

.app-main > main {
  padding: 8px 28px 40px;
  flex: 1;
}

/* Login card polish is defined in the login-view block above */

button,
.toolbar-btn,
input,
select,
textarea {
  border-radius: 12px;
}

.toolbar-btn {
  border-radius: var(--radius-pill);
}

.stat-card,
.table-wrap,
.inline-form,
.officer-card,
.routing-rule-card {
  border-radius: var(--radius);
  box-shadow: 0 10px 28px var(--shadow-soft);
}

th {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  font-weight: 700;
}

.dash-header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  margin-bottom: 18px;
}

.dash-title {
  margin: 0;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--text);
}

.dash-subtitle {
  margin: 0;
  font-size: 15px;
  color: var(--text-muted);
  font-weight: 500;
}

.dash-alert {
  border-radius: var(--radius-sm);
  margin-bottom: 18px;
}

.dash-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.dash-kpi {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: 0 10px 28px var(--shadow-soft);
  min-height: 118px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.dash-kpi-featured {
  background: linear-gradient(160deg, var(--primary) 0%, var(--primary-mid) 100%);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 14px 32px rgba(13, 72, 50, 0.28);
}

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

.dash-kpi-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.dash-kpi-value {
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
}

.dash-kpi-value.tone-info { color: var(--primary-mid); }
.dash-kpi-value.tone-danger { color: #c62828; }
.dash-kpi-value.tone-warning { color: #c26a00; }

.dash-queues {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.dash-research {
  gap: 16px;
  margin-bottom: 18px;
}

.dash-card,
.dash-workload {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 10px 28px var(--shadow-soft);
  padding: 18px 18px 12px;
  min-height: 150px;
}

.dash-card-head h3 {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.dash-card-head .linkish {
  font-weight: 600;
}

.dash-list li {
  border-radius: 12px;
  padding: 10px 8px;
}

.dash-list li:hover,
.dash-list li.is-selected {
  background: var(--primary-soft);
}

.dash-token {
  font-weight: 700;
  color: var(--primary);
}

.dash-research-btns button {
  border-radius: var(--radius-pill);
  padding: 10px 16px;
}

.case-drawer {
  border-radius: var(--radius) 0 0 var(--radius);
  box-shadow: -12px 0 40px var(--shadow);
}

@media (max-width: 1100px) {
  .dash-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  #app-view {
    grid-template-columns: 1fr;
  }
  .app-sidebar {
    position: relative;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .sidebar-nav.tabs {
    flex-direction: row;
    flex-wrap: wrap;
  }
  .sidebar-nav .tab {
    width: auto;
  }
  .sidebar-nav .tab.active::before {
    display: none;
  }
  .dash-queues {
    grid-template-columns: 1fr;
  }
  .app-main > main {
    padding: 8px 16px 28px;
  }
  #app-header {
    padding: 16px 16px 8px;
  }
}

/* ??? Field Officer (My Day / cards / workbench) ??? */
.badge-info {
  background: #dbeafe;
  color: #1d4ed8;
}

[data-theme="dark"] .badge-info {
  background: #1e3a5f;
  color: #93c5fd;
}

.status-advance-btn {
  appearance: none;
  border: none;
  background: var(--primary);
  color: #fff;
  font: inherit;
  font-weight: 700;
  font-size: 13px;
  line-height: 1.2;
  padding: 12px 16px;
  border-radius: 12px;
  cursor: pointer;
  transition: transform 120ms ease, background 120ms ease, opacity 120ms ease;
}

.status-advance-btn:hover:not(:disabled) {
  background: var(--primary-dark);
}

.status-advance-btn:active:not(:disabled) {
  transform: scale(0.98);
}

.status-advance-btn:disabled {
  opacity: 0.65;
  cursor: wait;
}

.officer-case-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 14px;
}

.officer-chip {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  width: auto;
  flex: 0 0 auto;
}

.officer-chip.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.officer-case-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 10px;
  animation: officer-fade-in 220ms ease-out;
}

.officer-cases-empty {
  grid-column: 1 / -1;
  margin: 12px 0;
  color: var(--text-muted);
}

/* Incident card ? Figma 01 Incident card (n147cTcheig0I8t1RtFXkd) */
.officer-case-card {
  background: #ffffff;
  border: 1px solid #e2eae3;
  border-radius: 20px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 0;
  min-height: 0;
  box-shadow: 0 8px 24px rgba(13, 72, 50, 0.06);
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

[data-theme="dark"] .officer-case-card {
  background: var(--surface);
  border-color: var(--border);
  box-shadow: none;
}

.officer-case-card.is-urgent {
  border-color: #fecaca;
}

.officer-case-card.is-selected {
  border-color: #0d4832;
  box-shadow: 0 0 0 2px #e4f2ea;
}

[data-theme="dark"] .officer-case-card.is-selected {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-soft);
}

/* Defeat global `button { width:100%; margin-top:16px }` so CTAs sit side-by-side like Figma */
.officer-case-card button {
  width: auto;
  margin-top: 0;
  max-width: 100%;
}

.officer-case-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

.officer-case-token {
  appearance: none;
  border: none;
  background: transparent;
  color: #0d4832;
  font: inherit;
  font-weight: 700;
  font-size: 13px;
  line-height: 18px;
  padding: 0;
  cursor: pointer;
}

[data-theme="dark"] .officer-case-token {
  color: var(--primary);
}

.officer-case-title {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 700;
  line-height: 24px;
  color: #122018;
}

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

.officer-case-title-btn {
  appearance: none;
  border: none;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: inherit;
  font-size: inherit;
  line-height: inherit;
  padding: 0;
  text-align: left;
  cursor: pointer;
  width: auto;
  margin-top: 0;
}

.officer-case-meta {
  margin: 0;
  font-size: 13px;
  line-height: 18px;
  color: #5a6b60;
}

[data-theme="dark"] .officer-case-meta {
  color: var(--text-muted);
}

.officer-case-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 18px;
  padding-top: 0;
}

.officer-case-actions .status-advance-btn,
.officer-case-actions .btn-officer-nav,
.officer-case-actions .secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: auto;
  margin-top: 0;
  min-height: 42px;
  box-sizing: border-box;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  line-height: 18px;
  white-space: nowrap;
  text-decoration: none;
}

.officer-case-actions .status-advance-btn {
  background: #0d4832;
  color: #fff;
  border: none;
}

.officer-case-actions .status-advance-btn:hover:not(:disabled) {
  background: #0a3a28;
}

.officer-case-actions .secondary {
  background: #d7ebdf;
  color: #0d4832;
  border: none;
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  line-height: 15px;
  white-space: nowrap;
}

.chip-sev-critical,
.chip-sev-high {
  background: #fee2e2;
  color: #b91c1c;
}

.chip-sev-medium {
  background: #fef3c7;
  color: #92400e;
}

.chip-sev-low {
  background: #e4f2ea;
  color: #0d4832;
}

.chip-status {
  background: #e4f2ea;
  color: #0d4832;
}

.chip-assigned {
  background: #dbeafe;
  color: #1d4ed8;
}

[data-theme="dark"] .chip-sev-critical,
[data-theme="dark"] .chip-sev-high {
  background: #3f1d1d;
  color: #fca5a5;
}

[data-theme="dark"] .chip-sev-medium {
  background: #3f2e14;
  color: #fcd34d;
}

[data-theme="dark"] .chip-assigned {
  background: #1e3a5f;
  color: #93c5fd;
}

.btn-officer-nav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 16px;
  border-radius: 12px;
  background: #d7ebdf;
  color: #0d4832;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  line-height: 18px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  width: auto;
  margin-top: 0;
  box-sizing: border-box;
}

[data-theme="dark"] .btn-officer-nav {
  background: var(--primary-soft);
  color: var(--accent-link);
}

[data-theme="dark"] .chip-status,
[data-theme="dark"] .chip-sev-low {
  background: var(--primary-soft);
  color: var(--primary);
}

.btn-officer-nav:hover {
  filter: brightness(0.97);
}

/* Field workbench ? frosted glass modal */
.case-drawer-root.case-drawer-field {
  justify-content: center;
  align-items: center;
  padding: 28px;
}

.case-drawer-root.case-drawer-field .case-drawer-backdrop {
  background:
    radial-gradient(ellipse 80% 60% at 20% 15%, rgba(184, 224, 200, 0.35), transparent 55%),
    radial-gradient(ellipse 70% 50% at 85% 80%, rgba(13, 72, 50, 0.22), transparent 50%),
    rgba(14, 28, 20, 0.42);
  backdrop-filter: blur(10px) saturate(1.15);
  -webkit-backdrop-filter: blur(10px) saturate(1.15);
}

[data-theme="dark"] .case-drawer-root.case-drawer-field .case-drawer-backdrop {
  background:
    radial-gradient(ellipse 75% 55% at 15% 8%, rgba(226, 168, 120, 0.2), transparent 55%),
    radial-gradient(ellipse 70% 50% at 88% 85%, rgba(125, 206, 160, 0.16), transparent 50%),
    rgba(6, 8, 7, 0.72);
}

.case-drawer-root.case-drawer-field .case-drawer {
  width: min(1040px, 100%);
  max-height: min(760px, calc(100vh - 56px));
  height: auto;
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  background:
    linear-gradient(155deg, rgba(255, 255, 255, 0.72) 0%, rgba(247, 250, 247, 0.48) 48%, rgba(228, 242, 234, 0.42) 100%);
  backdrop-filter: blur(28px) saturate(1.45);
  -webkit-backdrop-filter: blur(28px) saturate(1.45);
  box-shadow:
    0 28px 80px rgba(13, 72, 50, 0.22),
    0 2px 0 rgba(255, 255, 255, 0.55) inset,
    0 -1px 0 rgba(13, 72, 50, 0.06) inset;
  overflow: hidden;
  animation: case-modal-in 200ms cubic-bezier(0.22, 1, 0.36, 1);
}

[data-theme="dark"] .case-drawer-root.case-drawer-field .case-drawer {
  border: 1px solid rgba(255, 255, 255, 0.16);
  background:
    linear-gradient(
      165deg,
      rgba(52, 62, 56, 0.94) 0%,
      rgba(30, 36, 33, 0.92) 48%,
      rgba(18, 22, 20, 0.94) 100%
    );
  box-shadow:
    0 32px 90px rgba(0, 0, 0, 0.55),
    0 1px 0 rgba(255, 255, 255, 0.14) inset,
    0 -1px 0 rgba(0, 0, 0, 0.4) inset;
  color: #f4f7f5;
}

@keyframes case-modal-in {
  from { transform: translateY(14px) scale(0.97); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

.case-drawer-root.case-drawer-field .case-drawer-head {
  padding: 24px 28px 10px;
  border-bottom: none;
  background: transparent;
  align-items: flex-start;
  gap: 16px;
}

.case-drawer-root.case-drawer-field .case-drawer-kicker {
  color: rgba(13, 72, 50, 0.72);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 11px;
  font-weight: 700;
}

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

.case-drawer-root.case-drawer-field .case-drawer-token {
  font-size: 22px;
  font-weight: 800;
  line-height: 1.25;
  max-width: 100%;
  color: var(--text);
  word-break: normal;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.35);
}

[data-theme="dark"] .case-drawer-root.case-drawer-field .case-drawer-token {
  color: #f4f7f5;
  text-shadow: none;
}

.case-drawer-root.case-drawer-field #case-drawer-pills {
  margin: 10px 0 0;
}

.case-drawer-root.case-drawer-field #case-drawer-pills .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);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.4) inset;
}

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

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

.case-drawer-root.case-drawer-field #case-drawer-pills .chip-assigned {
  background: rgba(219, 234, 254, 0.7);
  border-color: rgba(29, 78, 216, 0.15);
  color: #1d4ed8;
}

[data-theme="dark"] .case-drawer-root.case-drawer-field #case-drawer-pills .chip {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.08) inset;
  color: #e8f2eb;
}

[data-theme="dark"] .case-drawer-root.case-drawer-field #case-drawer-pills .chip-sev-critical,
[data-theme="dark"] .case-drawer-root.case-drawer-field #case-drawer-pills .chip-sev-high {
  background: rgba(255, 138, 128, 0.18);
  border-color: rgba(255, 138, 128, 0.32);
  color: #ffb4ae;
}

[data-theme="dark"] .case-drawer-root.case-drawer-field #case-drawer-pills .chip-status,
[data-theme="dark"] .case-drawer-root.case-drawer-field #case-drawer-pills .chip-sev-low {
  background: rgba(125, 206, 160, 0.16);
  border-color: rgba(125, 206, 160, 0.3);
  color: #b6f0d0;
}

[data-theme="dark"] .case-drawer-root.case-drawer-field #case-drawer-pills .chip-assigned {
  background: rgba(144, 180, 255, 0.16);
  border-color: rgba(144, 180, 255, 0.3);
  color: #b8d0ff;
}

.case-drawer-root.case-drawer-field #case-drawer-close,
.case-drawer-root.case-drawer-field .case-back-btn {
  flex-shrink: 0;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 12px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.5);
  color: #0d4832;
  border: 1px solid rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.5) inset;
  transition: background 140ms ease, transform 120ms ease;
}

.case-drawer-root.case-drawer-field #case-drawer-close:hover,
.case-drawer-root.case-drawer-field .case-back-btn:hover {
  background: rgba(255, 255, 255, 0.72);
}

[data-theme="dark"] .case-drawer-root.case-drawer-field #case-drawer-close,
[data-theme="dark"] .case-drawer-root.case-drawer-field .case-back-btn {
  background: rgba(255, 255, 255, 0.08);
  color: #f4f7f5;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.08) inset;
}

[data-theme="dark"] .case-drawer-root.case-drawer-field #case-drawer-close:hover,
[data-theme="dark"] .case-drawer-root.case-drawer-field .case-back-btn:hover {
  background: rgba(255, 255, 255, 0.14);
}

.case-drawer-root.case-drawer-field .case-drawer-body {
  padding: 0 28px 28px;
  overflow: auto;
  background: transparent;
}

.wb-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 16px;
}

.wb-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(300px, 0.85fr);
  gap: 16px;
  align-items: start;
}

.wb-col-main,
.wb-col-side {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.wb-card {
  background: rgba(255, 255, 255, 0.42);
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 18px;
  padding: 18px;
  backdrop-filter: blur(16px) saturate(1.3);
  -webkit-backdrop-filter: blur(16px) saturate(1.3);
  box-shadow:
    0 8px 28px rgba(13, 72, 50, 0.06),
    0 1px 0 rgba(255, 255, 255, 0.65) inset;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.wb-card:hover {
  border-color: rgba(255, 255, 255, 0.78);
  box-shadow:
    0 12px 32px rgba(13, 72, 50, 0.1),
    0 1px 0 rgba(255, 255, 255, 0.75) inset;
}

[data-theme="dark"] .wb-card {
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.04) 100%);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow:
    0 12px 32px rgba(0, 0, 0, 0.35),
    0 1px 0 rgba(255, 255, 255, 0.12) inset;
  color: #f4f7f5;
}

[data-theme="dark"] .wb-card:hover {
  border-color: rgba(255, 255, 255, 0.22);
  box-shadow:
    0 16px 40px rgba(0, 0, 0, 0.4),
    0 1px 0 rgba(255, 255, 255, 0.16) inset;
}

.wb-card-title {
  margin: 0 0 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #0d4832;
}

[data-theme="dark"] .wb-card-title {
  color: #9fe0bc;
}

.wb-card-body {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--text);
}

[data-theme="dark"] .wb-card-body {
  color: #eef3f0;
}

.wb-card-meta {
  margin: 12px 0 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-muted);
}

[data-theme="dark"] .wb-card-meta {
  color: #a8b5ad;
}

.wb-evidence {
  min-height: 84px;
}

.wb-evidence .media-thumb {
  width: 112px;
  height: 84px;
  object-fit: cover;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 6px 16px rgba(13, 72, 50, 0.12);
}

.wb-nav-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.wb-nav-actions .btn-officer-nav,
.wb-nav-actions .secondary,
.case-notes-actions .btn-officer-nav,
.case-notes-actions .secondary {
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 12px;
  font-weight: 700;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.case-drawer-root.case-drawer-field .wb-nav-actions .secondary,
.case-drawer-root.case-drawer-field .case-notes-actions .secondary,
.case-drawer-root.case-drawer-field .case-photo-btn {
  background: rgba(255, 255, 255, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.6);
  color: #0d4832;
  width: auto;
  margin-top: 0;
}

.case-drawer-root.case-drawer-field .wb-nav-actions .btn-officer-nav,
.case-drawer-root.case-drawer-field .case-notes-actions .btn-officer-nav {
  background: rgba(215, 235, 223, 0.75);
  border: 1px solid rgba(13, 72, 50, 0.12);
  color: #0d4832;
}

[data-theme="dark"] .case-drawer-root.case-drawer-field .wb-nav-actions .secondary,
[data-theme="dark"] .case-drawer-root.case-drawer-field .case-notes-actions .secondary,
[data-theme="dark"] .case-drawer-root.case-drawer-field .case-photo-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #f4f7f5;
}

[data-theme="dark"] .case-drawer-root.case-drawer-field .wb-nav-actions .btn-officer-nav,
[data-theme="dark"] .case-drawer-root.case-drawer-field .case-notes-actions .btn-officer-nav {
  background: rgba(125, 206, 160, 0.18);
  border: 1px solid rgba(125, 206, 160, 0.35);
  color: #b6f0d0;
}

/* Next-step: tinted glass accent */
.wb-next {
  background:
    linear-gradient(155deg, rgba(13, 72, 50, 0.88) 0%, rgba(26, 107, 74, 0.78) 100%) !important;
  border: 1px solid rgba(184, 224, 200, 0.4) !important;
  color: #fff;
  border-radius: 20px !important;
  padding: 20px 18px !important;
  backdrop-filter: blur(18px) saturate(1.4) !important;
  -webkit-backdrop-filter: blur(18px) saturate(1.4) !important;
  box-shadow:
    0 16px 40px rgba(13, 72, 50, 0.28),
    0 1px 0 rgba(255, 255, 255, 0.25) inset !important;
}

[data-theme="dark"] .wb-next {
  background:
    linear-gradient(155deg, rgba(40, 120, 82, 0.95) 0%, rgba(22, 78, 54, 0.92) 100%) !important;
  border: 1px solid rgba(158, 230, 188, 0.35) !important;
  box-shadow:
    0 18px 44px rgba(0, 0, 0, 0.4),
    0 1px 0 rgba(184, 224, 200, 0.25) inset !important;
}

.wb-next:hover {
  border-color: rgba(184, 224, 200, 0.55) !important;
}

.wb-next .case-next-kicker {
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #b8e0c8;
  opacity: 1;
}

[data-theme="dark"] .wb-next .case-next-kicker {
  color: #c8f0d8;
}

.wb-next .case-next-title {
  margin: 0 0 10px;
  font-size: 20px;
  font-weight: 800;
  line-height: 1.25;
  color: #fff;
}

.wb-next .case-next-hint {
  margin: 0 0 16px;
  font-size: 13px;
  line-height: 1.45;
  color: #e4f2ea;
  opacity: 1;
}

[data-theme="dark"] .wb-next .case-next-hint {
  color: #d7ebe0;
}

.wb-next .case-next-btn {
  width: 100%;
  min-height: 46px;
  padding: 13px 16px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.92) !important;
  color: #0d4832 !important;
  font-weight: 800;
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

[data-theme="dark"] .wb-next .case-next-btn {
  background: linear-gradient(135deg, #e8f8ee, #c8efd8) !important;
  color: #0c1611 !important;
  border-color: rgba(255, 255, 255, 0.35);
}

.wb-next .case-next-btn:hover:not(:disabled) {
  background: #fff !important;
  transform: translateY(-1px);
}

.wb-next-idle {
  background: rgba(255, 255, 255, 0.38) !important;
  border: 1px solid rgba(255, 255, 255, 0.55) !important;
  color: var(--text);
  box-shadow:
    0 8px 28px rgba(13, 72, 50, 0.06),
    0 1px 0 rgba(255, 255, 255, 0.65) inset !important;
}

[data-theme="dark"] .wb-next-idle {
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.04) 100%) !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  color: #f4f7f5;
  box-shadow:
    0 12px 32px rgba(0, 0, 0, 0.35),
    0 1px 0 rgba(255, 255, 255, 0.12) inset !important;
}

.wb-next-idle .case-next-kicker,
.wb-next-idle .case-next-title,
.wb-next-idle .case-next-hint {
  color: var(--text);
  opacity: 1;
}

[data-theme="dark"] .wb-next-idle .case-next-title {
  color: #f4f7f5;
}

[data-theme="dark"] .wb-next-idle .case-next-hint {
  color: #c5d0c9;
}

.wb-next-idle .case-next-kicker {
  color: var(--text-muted);
}

[data-theme="dark"] .wb-next-idle .case-next-kicker {
  color: #9fe0bc;
}

.case-notes-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.case-notes-actions .btn-officer-nav {
  background: rgba(215, 235, 223, 0.75);
}

.visit-checklist {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.visit-check-label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 13px;
  line-height: 1.4;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.45);
  cursor: pointer;
  transition: background 140ms ease;
}

.visit-check-label:hover {
  background: rgba(255, 255, 255, 0.55);
}

[data-theme="dark"] .visit-check-label {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #eef3f0;
}

[data-theme="dark"] .visit-check-label:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.18);
}

[data-theme="dark"] .case-drawer-root.case-drawer-field .wb-nav-actions .secondary,
[data-theme="dark"] .case-drawer-root.case-drawer-field .case-notes-actions .secondary,
[data-theme="dark"] .case-drawer-root.case-drawer-field .case-photo-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #f4f7f5;
}

[data-theme="dark"] .case-drawer-root.case-drawer-field .wb-nav-actions .btn-officer-nav,
[data-theme="dark"] .case-drawer-root.case-drawer-field .case-notes-actions .btn-officer-nav {
  background: rgba(125, 206, 160, 0.18);
  border: 1px solid rgba(125, 206, 160, 0.35);
  color: #b6f0d0;
}

.visit-check {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  flex-shrink: 0;
  margin-top: 1px;
  accent-color: var(--primary);
}

.visit-check:checked + span {
  text-decoration: line-through;
  color: var(--text-muted);
}

@media (max-width: 900px) {
  .officer-case-grid {
    grid-template-columns: 1fr;
  }
  .wb-grid {
    grid-template-columns: 1fr;
  }
  .case-drawer-root.case-drawer-field {
    padding: 12px;
    align-items: stretch;
  }
  .case-drawer-root.case-drawer-field .case-drawer {
    max-height: none;
    height: 100%;
    border-radius: 22px;
  }
  .case-drawer-root.case-drawer-field .case-drawer-head,
  .case-drawer-root.case-drawer-field .case-drawer-body {
    padding-left: 18px;
    padding-right: 18px;
  }
}

.officer-next-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.officer-next-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  animation: officer-fade-in 240ms ease-out;
}

.officer-next-row.is-urgent {
  border-color: #fecaca;
}

.officer-next-row.is-selected {
  border-color: var(--primary);
}

.officer-next-main {
  flex: 1;
  min-width: 0;
}

.officer-next-token {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-weight: 700;
  font-size: 15px;
  text-align: left;
  padding: 0;
  cursor: pointer;
}

.officer-next-meta {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--text-muted);
}

.officer-next-actions {
  flex-shrink: 0;
}

.officer-next-empty {
  padding: 18px;
  color: var(--text-muted);
  text-align: center;
}

.case-next-step {
  background: var(--primary);
  color: #fff;
  border-radius: 16px;
  padding: 18px;
  margin-bottom: 4px;
}

.case-next-step-idle {
  background: var(--surface-muted);
  color: var(--text);
  border: 1px solid var(--border);
}

.case-next-kicker {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 600;
  opacity: 0.85;
}

.case-next-title {
  margin: 0 0 8px;
  font-size: 20px;
  font-weight: 800;
}

.case-next-hint {
  margin: 0 0 14px;
  font-size: 13px;
  opacity: 0.9;
}

.case-next-btn {
  width: 100%;
  background: #fff !important;
  color: var(--primary) !important;
}

.case-next-step-idle .case-next-btn {
  background: var(--primary) !important;
  color: #fff !important;
}

.case-photo-btn,
.case-call-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border-radius: 14px;
  cursor: pointer;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
}

@keyframes officer-fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.role-field-worker .reports-filters {
  margin-bottom: 8px;
}

@media (max-width: 900px) {
  .officer-case-grid {
    grid-template-columns: 1fr;
  }
  .officer-next-row {
    flex-direction: column;
    align-items: stretch;
  }
}

/* ??? Agency Admin desk (solid forest, not field glass) ??? */
body.role-agency-admin .sidebar-desk .sidebar-brand-text strong {
  letter-spacing: 0.01em;
}

body.role-agency-admin .dash-list li.desk-queue-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 14px;
}

body.role-agency-admin .desk-queue-main {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  min-width: 0;
  flex: 1 1 220px;
}

body.role-agency-admin .desk-queue-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  flex: 0 1 auto;
}

body.role-agency-admin .desk-queue-actions .assign-select,
body.role-agency-admin .desk-queue-actions .status-advance-btn,
body.role-agency-admin .desk-queue-actions .secondary {
  width: auto;
  margin-top: 0;
  min-height: 36px;
}

body.role-agency-admin .desk-queue-actions .status-advance-btn {
  padding: 8px 14px;
  border-radius: 10px;
  background: #0d4832;
  color: #fff;
  border: none;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
}

body.role-agency-admin .desk-queue-actions .status-advance-btn:hover:not(:disabled) {
  background: #0a3a28;
}

body.role-agency-admin .case-drawer-agency .case-section-decision {
  order: -1;
  background: #e4f2ea;
  border: 1px solid #c5dccf;
  border-radius: 16px;
  padding: 16px 18px;
}

body.role-agency-admin .case-drawer-agency .case-section-decision h3 {
  color: #0d4832;
  margin-top: 0;
}

body.role-agency-admin #agency-case-chips {
  margin-bottom: 12px;
}

body.role-agency-admin #dash-ops-queues {
  display: grid;
  gap: 16px;
}

/* ??? Agency Incidents (Figma desk queue) ??? */
.agency-incidents-head {
  margin: 0 0 4px;
}

.agency-incidents-head h2 {
  margin: 0;
  font-size: 30px;
  font-weight: 800;
  line-height: 1.15;
  color: var(--text);
  letter-spacing: -0.02em;
}

.agency-incidents-sub {
  margin: 6px 0 0;
  font-size: 15px;
  font-weight: 500;
  color: #6b7c70;
}

body.role-agency-admin .agency-desk-chips {
  margin: 12px 0 16px;
  gap: 8px;
}

body.role-agency-admin .agency-desk-chips .officer-chip {
  background: #fff;
  border: 1px solid #e2eae3;
  color: #6b7c70;
  font-weight: 700;
  font-size: 12px;
  padding: 8px 14px;
}

body.role-agency-admin .agency-desk-chips .officer-chip.active {
  background: #0d4832;
  border-color: #0d4832;
  color: #fff;
}

.agency-incidents-card {
  background: #fff;
  border: 1px solid #e2eae3;
  border-radius: 20px;
  box-shadow: 0 10px 28px rgba(13, 71, 51, 0.08);
  overflow: hidden;
}

.agency-incidents-table-wrap {
  overflow-x: auto;
}

.agency-incidents-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.agency-incidents-table thead th {
  background: #e4f2ea;
  color: #0d4832;
  font-size: 11px;
  font-weight: 700;
  text-align: left;
  padding: 12px 14px;
  border: none;
  white-space: nowrap;
}

.agency-incidents-table thead th.col-agency-action {
  text-align: right;
  width: 110px;
}

.agency-incidents-table tbody td {
  padding: 14px;
  border-top: 1px solid #eef3ef;
  vertical-align: middle;
  font-size: 13px;
  color: #122018;
}

.agency-incidents-table tbody tr:first-child td {
  border-top: none;
}

.agency-incidents-table tbody tr:hover {
  background: #f7fbf8;
}

.agency-incidents-table tbody tr.is-selected {
  background: #eef7f1;
}

.agency-token-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.agency-token-link {
  appearance: none;
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  width: auto;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  color: #0d4832;
  cursor: pointer;
  text-align: left;
}

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

.agency-token-cat {
  font-size: 12px;
  font-weight: 400;
  color: #6b7c70;
}

.agency-community {
  font-weight: 500;
}

.agency-status {
  color: #6b7c70;
  font-weight: 500;
}

.agency-action-cell {
  text-align: right;
  white-space: nowrap;
}

.agency-desk-btn,
body.role-agency-admin .agency-desk-btn.status-advance-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  margin: 0;
  padding: 8px 14px;
  border: none;
  border-radius: 12px;
  background: #0d4832;
  color: #fff;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  min-height: 31px;
}

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

.agency-incidents-empty {
  text-align: center;
  color: #6b7c70;
  padding: 28px 14px !important;
}

html[data-theme="dark"] body.role-agency-admin .agency-incidents-card {
  background: var(--surface);
  border-color: var(--border);
  box-shadow: none;
}

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

html[data-theme="dark"] body.role-agency-admin .agency-desk-chips .officer-chip {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text-muted);
}

html[data-theme="dark"] body.role-agency-admin .agency-desk-chips .officer-chip.active {
  background: #0d4832;
  border-color: #0d4832;
  color: #fff;
}

html[data-theme="dark"] .agency-token-link {
  color: var(--accent-link);
}

html[data-theme="dark"] .agency-token-cat,
html[data-theme="dark"] .agency-status,
html[data-theme="dark"] .agency-incidents-sub {
  color: var(--text-muted);
}

@media (max-width: 900px) {
  .agency-incidents-head h2 {
    font-size: 24px;
  }

  .agency-incidents-table thead th:nth-child(3),
  .agency-incidents-table tbody td:nth-child(3) {
    display: none;
  }
}
