/* Sidebar heading */
.sidebar-title {
  margin: 2px 0 12px;
  color: var(--blue);
  font-size: 17px;
  font-weight: 700;
}

/* Quick actions */
.quick-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}

.action-card {
  min-height: 72px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05);
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  color: inherit;
}


.action-card:hover {
  background: rgba(0, 113, 187, 0.03);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
  transform: translateY(-2px);
}

.action-card span {
  font-size: 20px;
}

.action-card b {
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
}

/* Panels */
.panel {
  padding: 13px 0;
  border-top: 1px solid var(--line);
}

.panel h3 {
  margin: 0 0 10px;
  color: var(--text);
  font-size: 13px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.panel-edit {
  padding: 12px;
  border: 1px solid #fed7aa;
  border-radius: 12px;
  background: #fff7ed;
}

.panel-edit h3 {
  color: #9a3412;
}

.sidebar-edit-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  width: 100%;
  padding: 0 12px;
  border-radius: 10px;
  background: var(--orange);
  color: #ffffff;
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
}

.sidebar-edit-link:hover {
  background: var(--orange2);
}

/* Search */
.input-group {
  display: flex;
  gap: 8px;
}

.input-group input {
  flex: 1;
  min-width: 0;
  height: 40px;
  padding: 0 12px;
  border: 1px solid #cfd9e8;
  border-radius: 10px;
  outline: none;
  font-size: 13px;
}

.input-group input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(43, 92, 171, 0.12);
}

.input-group button {
  height: 40px;
  padding: 0 14px;
  border: 0;
  border-radius: 10px;
  background: var(--blue);
  color: #ffffff;
  font-weight: 600;
  cursor: pointer;
}

.input-group button:hover {
  background: var(--blue2);
}

.hint {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.search-results {
  display: none;
  max-height: 260px;
  margin-top: 10px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.result-item {
  padding: 10px 12px;
  border-bottom: 1px solid #edf2f7;
  background: #ffffff;
  cursor: pointer;
}

.result-item:last-child {
  border-bottom: 0;
}

.result-item:hover {
  background: #f4f8ff;
}

.result-item strong {
  display: block;
  font-size: 13px;
}

.result-item small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.result-empty {
  padding: 10px 12px;
  color: var(--muted);
  font-size: 13px;
}

/* Layer list */
.layer-list {
  display: grid;
  gap: 10px;
}

.layer-group-container {
  display: grid;
  gap: 8px;
  padding: 8px;
  border: 1px solid #d8e6f4;
  border-radius: 12px;
  background: linear-gradient(180deg, #f8fbff 0%, #eef6ff 100%);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.05);
}

.layer-group-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 42px;
  margin: 0;
  padding: 8px 9px 8px 12px;
  border: 1px solid rgba(0, 113, 187, 0.22);
  border-left: 4px solid var(--blue);
  border-radius: 10px;
  background: #ffffff;
  color: #0f172a;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-align: left;
  text-transform: uppercase;
  cursor: pointer;
  user-select: none;
  transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.layer-group-title:hover {
  border-color: rgba(0, 113, 187, 0.46);
  background: #edf8ff;
  box-shadow: 0 8px 18px rgba(0, 113, 187, 0.12);
  transform: translateY(-1px);
}

.layer-group-title:focus-visible {
  outline: 3px solid rgba(0, 113, 187, 0.22);
  outline-offset: 2px;
}

.layer-group-title-main {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  gap: 8px;
}

.layer-group-title-text {
  min-width: 0;
  overflow-wrap: anywhere;
  line-height: 1.25;
}

.layer-group-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: #e0f2fe;
  color: #0369a1;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}

.layer-group-chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  margin-left: 8px;
  border-radius: 9px;
  background: #eaf4ff;
  color: var(--blue);
  font-size: 15px;
  box-shadow: inset 0 0 0 1px rgba(0, 113, 187, 0.16);
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.layer-group-chevron i {
  display: none;
}

.layer-group-chevron::before {
  content: "";
  width: 9px;
  height: 9px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translate(-1px, -1px);
  transition: transform 0.18s ease;
}

.layer-group-container.is-collapsed .layer-group-chevron::before {
  transform: rotate(-45deg) translate(-1px, 1px);
}

.layer-group-title:hover .layer-group-chevron {
  background: var(--blue);
  color: #ffffff;
}

.layer-group-container.is-collapsed .layer-group-chevron {
  color: #475569;
}

.layer-group-content {
  display: grid;
  gap: 7px;
}

.layer-group-content[hidden] {
  display: none;
}

.layer-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 6px 2px 1px;
  color: #2b5cab;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.03em;
  line-height: 1.25;
  text-transform: uppercase;
}

.layer-section-title::before {
  content: "";
  flex: 0 0 14px;
  height: 2px;
  border-radius: 999px;
  background: var(--blue);
  opacity: 0.75;
}

.layer-section-title:first-child {
  margin-top: 1px;
}

.layer-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 40px;
  padding: 9px 11px;
  border: 1px solid #d9e2ef;
  border-radius: 10px;
  background: #ffffff;
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.3;
  transition: background 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.layer-item:hover {
  border-color: #b8cee8;
  background: #f8fbff;
}

.layer-item.is-active {
  border-color: #9cc4e7;
  background: #f2f8ff;
  box-shadow: inset 3px 0 0 var(--blue);
}

.layer-item-empty {
  justify-content: flex-start;
  color: var(--muted);
  font-size: 12px;
  font-style: italic;
  cursor: default;
}

.layer-item input {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  accent-color: var(--blue);
}

/* Nút bật/tắt tất cả cho panel dữ liệu nhạy cảm */
.layer-bulk-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.layer-bulk-actions .filter-action-btn {
  flex: 1;
}

/* Chú giải inline: 1 dòng [marker] [tên loại hình] ... [checkbox] */
.layer-item-main {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  flex: 1;
}

.layer-legend-inline {
  flex: 0 0 auto;
  width: 26px;
  height: 22px;
  object-fit: contain;
  background: #ffffff;
  border-radius: 4px;
  padding: 1px;
}

/* Tooltip hover điểm dữ liệu nhạy cảm trên bản đồ */
.leaflet-tooltip.sensitive-hover-tip {
  font-weight: 700;
  font-size: 12px;
  color: #0f172a;
  background: #ffffff;
  border: 1px solid #c7d2e0;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.18);
}

/* Popup thông tin lớp dữ liệu nhạy cảm (WMS GetFeatureInfo) */
.sensitive-info-popup .leaflet-popup-content {
  margin: 10px 12px;
  max-height: 340px;
  overflow-y: auto;
}

.sensitive-popup-block + .sensitive-popup-block {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #e2e8f0;
}

.sensitive-popup-block h4 {
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 700;
  color: #1d4ed8;
}

.sensitive-popup-block table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.sensitive-popup-block th,
.sensitive-popup-block td {
  text-align: left;
  vertical-align: top;
  padding: 2px 6px 2px 0;
  word-break: break-word;
}

.sensitive-popup-block th {
  color: #64748b;
  font-weight: 600;
  white-space: nowrap;
}

.admin-boundary-filter-title {
  margin: 8px 0 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.admin-boundary-filter {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.admin-boundary-filter .compact-select {
  width: 100%;
}

.admin-boundary-filter .filter-action-btn {
  width: 100%;
}

/* Risk filter */
.checkbox-group {
  display: grid;
  gap: 8px;
}

.checkbox-group label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  cursor: pointer;
}

.checkbox-group input {
  width: 17px;
  height: 17px;
}

.risk-red {
  color: #d92d20;
  font-weight: 700;
}

.risk-orange {
  color: #f97316;
  font-weight: 700;
}

.risk-yellow {
  color: #a16207;
  font-weight: 700;
}

.risk-green {
  color: #15803d;
  font-weight: 700;
}

.risk-unknown {
  color: #64748b;
  font-weight: 700;
}

/* Tool buttons */
.btn-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.btn-grid button {
  height: 38px;
  border: 1px solid #cfd9e8;
  border-radius: 10px;
  background: #f8fafc;
  color: var(--text);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
}

.btn-grid button.active,
.btn-grid button:hover {
  border-color: var(--blue);
  background: #eaf1ff;
  color: var(--blue);
}

/* Locked state */
.locked-box {
  padding: 16px;
  border: none;
  border-radius: 16px;
  background: linear-gradient(135deg, #f7faff 0%, #edf4ff 100%);
  box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.5), 0 4px 12px rgba(15, 23, 42, 0.04);
  color: #52627a;
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
}

.locked-box b {
  display: block;
  margin-bottom: 6px;
  color: var(--blue);
  font-size: 14px;
}

.locked-box span {
  display: block;
  margin-bottom: 14px;
}

.locked-box a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 16px;
  border-radius: 10px;
  background: var(--green);
  color: #ffffff;
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  transition: background 0.2s;
  box-shadow: 0 4px 10px rgba(15, 118, 110, 0.2);
}

.locked-box a:hover {
  background: var(--green2);
  box-shadow: 0 6px 14px rgba(15, 118, 110, 0.3);
}

.locked-note {
  margin-top: 8px;
  padding: 8px 10px;
  border: 1px solid #fed7aa;
  border-radius: 10px;
  background: #fff7ed;
  color: #9a3412;
  font-size: 12px;
  line-height: 1.45;
}

/* Data status */
.info-card {
  margin-top: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f9fbff;
  box-shadow: var(--shadow);
  font-size: 13px;
  line-height: 1.5;
}

.info-card b {
  display: block;
  margin-bottom: 4px;
  color: var(--blue);
}
.risk-group-grid label {
  align-items: flex-start;
  line-height: 1.35;
}

/* Sidebar responsive refinements */
@media (min-width: 901px) and (max-width: 1280px) {
  .quick-actions {
    gap: 8px;
  }

  .action-card {
    min-height: 66px;
    padding: 8px;
  }

  .action-card span {
    font-size: 18px;
  }

  .action-card b,
  .layer-item,
  .checkbox-group label {
    font-size: 13px;
  }
}

@media (max-width: 900px) {
  .sidebar-inner {
    padding: 14px 12px 18px;
  }

  .sidebar-title {
    display: none;
  }

  .quick-actions {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
  }

  .action-card {
    min-height: 64px;
    padding: 8px 4px;
    border-radius: 10px;
  }

  .action-card span {
    font-size: 18px;
  }

  .action-card b {
    font-size: 11px;
    line-height: 1.2;
  }

  .panel {
    padding: 12px 0;
  }

  .input-group {
    gap: 6px;
  }

  .input-group input {
    height: 42px;
    font-size: 14px;
  }

  .input-group button {
    height: 42px;
    padding: 0 12px;
  }

  .layer-item,
  .checkbox-group label {
    min-height: 40px;
    font-size: 14px;
  }

  .btn-grid {
    grid-template-columns: 1fr;
  }

  .search-results {
    max-height: 220px;
  }
}

@media (max-width: 520px) {
  .quick-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .action-card {
    min-height: 58px;
  }

  .risk-group-grid {
    gap: 6px;
  }
}


/* Advanced risk taxonomy filters */
.filter-select {
  width: 100%;
  min-height: 180px;
  padding: 8px;
  border: 1px solid #cfd9e8;
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  font-size: 12px;
  outline: none;
}

.filter-select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(43, 92, 171, 0.12);
}

.compact-filter {
  max-height: 220px;
  overflow: auto;
  padding-right: 4px;
}

.risk-group-grid label {
  line-height: 1.35;
}



.activity-source-select {
  display: none;
}

.filter-check-all {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  margin-bottom: 8px;
  border: 1px solid #cfd9e8;
  border-radius: 10px;
  background: #f8fbff;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
}

.filter-check-all input,
.activity-check-item input {
  width: 15px;
  height: 15px;
  margin: 0;
  flex: 0 0 auto;
  accent-color: var(--blue);
}

.activity-checklist {
  width: 100%;
  max-height: 220px;
  overflow: auto;
  padding: 6px;
  border: 1px solid #cfd9e8;
  border-radius: 10px;
  background: #fff;
}

.activity-check-group {
  padding: 8px 6px 4px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.25;
}

.activity-check-item {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: start;
  gap: 6px;
  padding: 4px 6px;
  border-radius: 8px;
  color: var(--text);
  font-size: 12px;
  line-height: 1.3;
  cursor: pointer;
}

.activity-check-item:hover {
  background: #eef5ff;
}

.activity-check-item span {
  min-width: 0;
}

/* ===============================
   Mode switcher - Phân hệ nghiệp vụ
   =============================== */

.mode-switcher,
.business-mode-box,
#modeSwitcher {
  display: grid;
  gap: 8px;
}

.mode-btn,
.mode-switch-btn,
.business-mode-btn,
[data-mode-btn] {
  width: 100%;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0 14px;
  border: 1px solid #cfd9e8;
  border-radius: 10px;
  background: #ffffff;
  color: #20314f;
  font-family: 'Roboto', sans-serif;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: 0;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.mode-btn:hover,
.mode-switch-btn:hover,
.business-mode-btn:hover,
[data-mode-btn]:hover {
  border-color: #2b5cab;
  background: #f3f7ff;
  color: #2b5cab;
}

.mode-btn.active,
.mode-switch-btn.active,
.business-mode-btn.active,
[data-mode-btn].active {
  border-color: #2b5cab;
  background: #eaf1ff;
  color: #1f4a8f;
  box-shadow: inset 3px 0 0 #2b5cab;
  font-weight: 800;
}

/* Tránh viền đen mặc định khi focus/click */
.mode-btn:focus,
.mode-switch-btn:focus,
.business-mode-btn:focus,
[data-mode-btn]:focus {
  outline: none;
}

.mode-btn:focus-visible,
.mode-switch-btn:focus-visible,
.business-mode-btn:focus-visible,
[data-mode-btn]:focus-visible {
  outline: 3px solid rgba(43, 92, 171, 0.18);
  outline-offset: 2px;
}

/* Mô tả dưới nhóm phân hệ */
.mode-desc,
.business-mode-desc {
  margin: 8px 0 0;
  color: #6a7890;
  font-family: 'Roboto', sans-serif;
  font-size: 12.5px;
  font-weight: 400;
  line-height: 1.45;
}

/* Card quản trị theo phân hệ */
.mode-admin-card,
.business-admin-card {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid #cddaf2;
  border-radius: 12px;
  background: #f3f7ff;
}

.mode-admin-card h3,
.business-admin-card h3 {
  margin: 0 0 10px;
  color: #2b5cab;
  font-family: 'Roboto', sans-serif;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.mode-admin-card p,
.business-admin-card p {
  margin: 8px 0 0;
  color: #6a7890;
  font-family: 'Roboto', sans-serif;
  font-size: 12.5px;
  font-weight: 400;
  line-height: 1.45;
}

.mode-admin-card a,
.business-admin-card a {
  width: 100%;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border-radius: 10px;
  background: #2b5cab;
  color: #ffffff;
  font-family: 'Roboto', sans-serif;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
  text-decoration: none;
}

.mode-admin-card a:hover,
.business-admin-card a:hover {
  background: #1f4a8f;
}
/* Unified location search tools */
.location-tools {
  margin-top: 8px;
  display: flex;
  gap: 8px;
}

.location-tools button {
  width: 100%;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid #cfd9e8;
  border-radius: 10px;
  background: #ffffff;
  color: var(--blue);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.location-tools button:hover {
  border-color: var(--blue);
  background: #f4f8ff;
}

/* Statistics panel */
.statistics-box {
  padding: 12px;
  border: 1px solid #bfdbfe;
  border-radius: 14px;
  background: #f8fbff;
}

.stats-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.stats-head h3 {
  margin-bottom: 4px;
  color: var(--blue);
}

.stats-head .hint {
  margin-top: 0;
}

#btnStatsRefresh {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border: 1px solid #c7d8f4;
  border-radius: 10px;
  background: #ffffff;
  color: var(--blue);
  font-weight: 900;
  cursor: pointer;
}

#btnStatsRefresh:hover {
  border-color: var(--blue);
  background: #eaf1ff;
}

.stats-filters {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-bottom: 10px;
}

.compact-select {
  min-height: 38px;
  height: 38px;
  padding: 0 10px;
  font-size: 12px;
}

.statistics-content {
  display: grid;
  gap: 10px;
}

.stats-scope-note,
.stats-note,
.stats-empty {
  padding: 8px 10px;
  border-radius: 10px;
  background: #ffffff;
  border: 1px solid #e3ebf7;
  color: #52627a;
  font-size: 12px;
  line-height: 1.45;
}

.stats-card-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.stats-card {
  min-height: 68px;
  padding: 10px;
  border: 1px solid #e1eaf6;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 8px 18px rgba(34, 62, 113, 0.07);
}

.stats-card span {
  display: block;
  color: #64748b;
  font-size: 11px;
  line-height: 1.25;
}

.stats-card b {
  display: block;
  margin-top: 5px;
  color: var(--blue);
  font-size: 21px;
  line-height: 1;
}

.stats-card.danger b {
  color: #b42318;
}

.stats-block,
.stats-details {
  padding: 10px;
  border: 1px solid #e1eaf6;
  border-radius: 12px;
  background: #ffffff;
}

.stats-block h4 {
  margin: 0 0 8px;
  color: #20314f;
  font-size: 13px;
}

.stats-risk-row,
.stats-mini-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 28px;
  padding: 5px 0;
  border-top: 1px dashed #e5edf7;
  font-size: 12px;
}

/* Administrative feature info */
.admin-feature-box {
  padding: 12px;
  border: 1px solid #c7d8f4;
  border-radius: 14px;
  background: #f8fbff;
}

.admin-feature-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.admin-feature-head h3 {
  margin-bottom: 4px;
  color: var(--blue);
}

.admin-feature-head .hint {
  margin-top: 0;
}

#btnAdminFeatureInfoClose {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border: 1px solid #c7d8f4;
  border-radius: 10px;
  background: #ffffff;
  color: var(--blue);
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
}

#btnAdminFeatureInfoClose:hover {
  border-color: var(--blue);
  background: #eaf1ff;
}

.admin-feature-table-wrap {
  max-height: 360px;
  overflow: auto;
  border: 1px solid #e3ebf7;
  border-radius: 12px;
  background: #ffffff;
}

.admin-feature-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.admin-feature-table th,
.admin-feature-table td {
  padding: 9px 10px;
  border-bottom: 1px solid #edf2f7;
  color: var(--text);
  font-size: 12px;
  line-height: 1.35;
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
}

.admin-feature-table tr:last-child th,
.admin-feature-table tr:last-child td {
  border-bottom: 0;
}

.admin-feature-table th {
  width: 36%;
  background: #f4f8ff;
  color: #52627a;
  font-weight: 800;
}

.admin-feature-empty {
  color: var(--muted);
  text-align: center;
}

.stats-risk-row:first-of-type,
.stats-mini-row:first-child {
  border-top: 0;
}

.stats-risk-row b,
.stats-mini-row b {
  font-size: 13px;
  color: #20314f;
}

.stats-risk-red span { color: #d92d20; font-weight: 700; }
.stats-risk-orange span { color: #f97316; font-weight: 700; }
.stats-risk-yellow span { color: #a16207; font-weight: 700; }
.stats-risk-green span { color: #15803d; font-weight: 700; }
.stats-risk-unknown span { color: #64748b; font-weight: 700; }

.stats-details summary {
  color: #20314f;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.stats-details[open] summary {
  margin-bottom: 6px;
}

@media (max-width: 900px) {
  .statistics-box {
    padding: 12px;
  }

  .stats-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .stats-card-grid {
    grid-template-columns: 1fr;
  }
}

/* Inventory search inside statistics */
.stats-inventory-block {
  padding: 10px;
  border: 1px solid #dbeafe;
  border-radius: 12px;
  background: #ffffff;
}

.stats-inventory-block h4 {
  margin: 0 0 8px;
  color: #20314f;
  font-size: 13px;
}

.stats-inventory-tools {
  display: grid;
  gap: 8px;
  margin-bottom: 8px;
}

.stats-inventory-tools input {
  width: 100%;
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #f8fafc;
  color: #1f2937;
  font-size: 12px;
  outline: none;
}

.stats-inventory-tools input:focus {
  border-color: var(--blue);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.stats-inventory-empty,
.stats-inventory-total,
.stats-inventory-station-total,
.stats-inventory-more {
  padding: 7px 9px;
  border-radius: 9px;
  background: #f8fafc;
  color: #52627a;
  font-size: 12px;
  line-height: 1.4;
}

.stats-inventory-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin-bottom: 8px;
}

.stats-inventory-summary div {
  padding: 8px;
  border: 1px solid #e1eaf6;
  border-radius: 10px;
  background: #f8fbff;
}

.stats-inventory-summary b {
  display: block;
  color: var(--blue);
  font-size: 18px;
  line-height: 1;
}

.stats-inventory-summary span {
  display: block;
  margin-top: 4px;
  color: #64748b;
  font-size: 11px;
}

.stats-inventory-list {
  display: grid;
  gap: 8px;
  margin-top: 8px;
  max-height: 360px;
  overflow: auto;
  padding-right: 2px;
}

.stats-inventory-station {
  display: grid;
  gap: 7px;
  padding: 9px;
  border: 1px solid #e1eaf6;
  border-radius: 12px;
  background: #ffffff;
}

.stats-inventory-station-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.stats-inventory-station-head b {
  display: block;
  color: #20314f;
  font-size: 12px;
}

.stats-inventory-station-head span {
  display: block;
  margin-top: 2px;
  color: #64748b;
  font-size: 11px;
  line-height: 1.35;
}

.stats-inventory-station-head button {
  flex: 0 0 auto;
  min-height: 28px;
  padding: 0 8px;
  border: 1px solid #bfdbfe;
  border-radius: 9px;
  background: #eff6ff;
  color: var(--blue);
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.stats-inventory-station-head button:hover {
  background: #dbeafe;
}

.stats-inventory-items {
  display: grid;
  gap: 5px;
}

.stats-inventory-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: baseline;
  padding-top: 5px;
  border-top: 1px dashed #e5edf7;
  font-size: 12px;
}

.stats-inventory-item span {
  min-width: 0;
  color: #1f2937;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stats-inventory-item em {
  color: #475569;
  font-style: normal;
  white-space: nowrap;
}

@media (max-width: 520px) {
  .stats-inventory-summary {
    grid-template-columns: 1fr;
  }

  .stats-inventory-station-head {
    display: grid;
  }

  .stats-inventory-station-head button {
    width: 100%;
  }
}


/* ===== Roboto sidebar final override ===== */
#sidebar,
#sidebar *,
.sidebar-inner,
.sidebar-inner *,
.layer-item,
.layer-item *,
.filter-row,
.filter-row * {
  font-family: 'Roboto', sans-serif !important;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Activity group checkbox filter - v2 */
#activityFilter.activity-source-select {
  display: none !important;
}
.activity-filter-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 8px;
}
.filter-action-btn {
  min-height: 34px;
  border: 1px solid #2b5cab;
  border-radius: 10px;
  background: #2b5cab;
  color: #fff;
  font-family: 'Roboto', sans-serif;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}
.filter-action-btn-muted {
  border-color: #cfd9e8;
  background: #fff;
  color: #20314f;
}
.activity-checklist:not([data-ready="1"]) {
  min-height: 80px;
}
.activity-check-item {
  display: grid !important;
  grid-template-columns: 18px minmax(0, 1fr) !important;
  align-items: flex-start !important;
}
.activity-check-item input[type="checkbox"] {
  display: block !important;
  appearance: auto !important;
  -webkit-appearance: checkbox !important;
}
body.dark .filter-action-btn-muted,
html.dark .filter-action-btn-muted,
[data-theme="dark"] .filter-action-btn-muted {
  background: #111827;
  color: #e5e7eb;
  border-color: #334155;
}
body.dark .activity-checklist,
html.dark .activity-checklist,
[data-theme="dark"] .activity-checklist {
  background: #0f172a;
  border-color: #334155;
}
body.dark .activity-check-item:hover,
html.dark .activity-check-item:hover,
[data-theme="dark"] .activity-check-item:hover {
  background: #1e293b;
}
