.blacklist-app {
  background:
    radial-gradient(circle at 68% 0%, rgba(var(--blue-rgb), 0.055), transparent 28%),
    linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.blacklist-page {
  min-height: calc(100vh - var(--app-chrome-height, 131px));
  padding: clamp(28px, 2.8vw, 38px) clamp(22px, 3vw, 54px) 84px;
}

.blacklist-shell {
  width: 100%;
  max-width: 1540px;
  margin: 0 auto;
  color: var(--text, #0f172a);
}

.blacklist-heading,
.blacklist-table-toolbar,
.filter-actions,
.toolbar-left,
.table-footer,
.table-footer-left,
.compact-tool-group,
.modal-header,
.modal-footer,
.preview-hint,
.primary-action,
.secondary-action,
.icon-action,
.edit-action,
.delete-action,
.row-actions {
  display: flex;
  align-items: center;
}

.blacklist-heading {
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.blacklist-heading h1 {
  margin: 0;
  color: var(--text-strong, #0f172a);
  font-size: 32px;
  line-height: 1.1;
  font-weight: 950;
}

.blacklist-heading p {
  max-width: 900px;
  margin: 8px 0 0;
  color: var(--muted, #64748b);
  line-height: 1.5;
  font-weight: 750;
}

.blacklist-subnav {
  width: fit-content;
  max-width: 100%;
  display: flex;
  gap: 4px;
  padding: 5px;
  margin-bottom: 18px;
  overflow-x: auto;
  border-radius: 10px;
  background: #f1f5f9;
  scrollbar-width: none;
}

.blacklist-subnav::-webkit-scrollbar {
  display: none;
}

.blacklist-subnav button {
  min-width: 100px;
  height: 34px;
  padding: 0 14px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #64748b;
  font-weight: 850;
  white-space: nowrap;
}

.blacklist-subnav button.active {
  background: #fff;
  color: #0f172a;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

.blacklist-subnav button:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 1px;
}

.blacklist-tab-panel[hidden] {
  display: none !important;
}

.blacklist-tab-panel:not([hidden]) {
  animation: blacklist-tab-in 0.2s ease both;
}

@keyframes blacklist-tab-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.blacklist-overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.65fr);
  gap: 18px;
  margin-bottom: 18px;
}

.blacklist-feature-card,
.blacklist-checklist-card,
.blacklist-data-card,
.rule-overview-card {
  border: 1px solid var(--border, #d8e1ef);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.05);
}

.blacklist-feature-card {
  min-height: 176px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  overflow: hidden;
  padding: 26px;
  background:
    radial-gradient(circle at 82% 10%, rgba(var(--blue-rgb), 0.12), transparent 30%),
    linear-gradient(120deg, #ffffff 0%, #f5f8ff 100%);
}

.feature-icon {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: #eaf1ff;
  color: var(--blue);
}

.feature-icon svg {
  width: 25px;
  height: 25px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.feature-copy h2,
.blacklist-panel-head h2,
.rule-overview-card h2 {
  margin: 0;
  color: var(--text-strong, #0f172a);
  font-size: 20px;
  line-height: 1.25;
  font-weight: 950;
}

.feature-copy p,
.blacklist-panel-head p,
.rule-overview-card p {
  margin: 7px 0 0;
  color: var(--muted, #64748b);
  line-height: 1.5;
  font-weight: 750;
}

.feature-kicker {
  display: inline-flex;
  margin-bottom: 7px;
  color: var(--blue);
  font-size: 11px;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.feature-actions,
.panel-head-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.blacklist-checklist-card {
  padding: 22px;
}

.blacklist-checklist-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-light, #e7edf6);
  color: var(--text-strong, #0f172a);
  font-weight: 950;
}

.blacklist-checklist-card header strong {
  color: var(--blue);
  font-size: 12px;
}

.blacklist-checklist-card ul {
  display: grid;
  gap: 14px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.blacklist-checklist-card li {
  display: grid;
  grid-template-columns: 9px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  color: var(--muted, #64748b);
  font-size: 13px;
  line-height: 1.4;
  font-weight: 760;
}

.blacklist-checklist-card li i {
  width: 8px;
  height: 8px;
  margin-top: 5px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.1);
}

.blacklist-checklist-card li strong {
  display: block;
  margin-bottom: 2px;
  color: var(--text-strong, #0f172a);
  font-size: 12px;
}

.blacklist-data-card {
  overflow: hidden;
}

.blacklist-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 22px;
  border-bottom: 1px solid var(--border-light, #e7edf6);
}

.blacklist-panel-head p {
  font-size: 13px;
}

.blacklist-data-table-wrap {
  overflow: auto;
  scrollbar-color: #c8cdd4 transparent;
  scrollbar-width: thin;
}

.blacklist-data-table {
  width: 100%;
  border-collapse: collapse;
}

.blacklist-data-table th,
.blacklist-data-table td {
  padding: 15px 16px;
  border-bottom: 1px solid var(--border-light, #edf1f7);
  color: var(--text-soft, #475569);
  text-align: left;
  vertical-align: middle;
  font-weight: 780;
}

.blacklist-data-table th {
  background: var(--surface-soft, #f8fafc);
  color: var(--muted, #64748b);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.blacklist-data-table tbody tr:last-child td {
  border-bottom: 0;
}

.blacklist-data-table tbody > tr:not(.hit-detail-row):hover {
  background: var(--blue-soft, #f8fbff);
}

.import-history-table {
  min-width: 900px;
}

.hit-log-table {
  min-width: 780px;
}

.risk-rule-table {
  min-width: 640px;
}

.risk-rule-table th:last-child,
.risk-rule-table td:last-child {
  width: 112px;
  text-align: center;
}

.import-file-value {
  max-width: 280px;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metric-positive {
  color: #059669;
  font-weight: 950;
}

.metric-negative {
  color: #dc2626;
  font-weight: 950;
}

.tab-empty-state {
  padding: 38px 20px;
  color: var(--muted, #64748b);
  font-weight: 800;
  text-align: center;
}

.tab-empty-state[hidden] {
  display: none !important;
}

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

.risk-kpi-grid article {
  min-height: 112px;
  display: grid;
  align-content: center;
  gap: 5px;
  padding: 18px 20px;
  border: 1px solid var(--border, #d8e1ef);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.045);
}

.risk-kpi-grid article span,
.risk-kpi-grid article small {
  color: var(--muted, #64748b);
  font-size: 12px;
  font-weight: 820;
}

.risk-kpi-grid article strong {
  color: var(--text-strong, #0f172a);
  font-size: 28px;
  line-height: 1;
  font-weight: 950;
}

.blacklist-filter-panel.hit-log-filter-panel {
  grid-template-columns: minmax(300px, 1.1fr) minmax(200px, 0.7fr) auto;
}

.scene-pill,
.tab-status-pill,
.rule-tag-list span {
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 11px;
  line-height: 1;
  font-weight: 900;
  white-space: nowrap;
}

.scene-pill {
  background: #eff6ff;
  color: var(--blue-deep);
}

.tab-status-pill.completed,
.tab-status-pill.passed {
  background: #ecfdf5;
  color: #047857;
}

.tab-status-pill.blocked {
  background: #fff1f2;
  color: #be123c;
}

.tab-status-pill.review {
  background: #fff7ed;
  color: #c2410c;
}

.user-value {
  font-size: 13px;
}

.log-time {
  white-space: nowrap;
}

.table-text-action {
  height: 30px;
  padding: 0 10px;
  border: 1px solid #bfdbfe;
  border-radius: 7px;
  background: #fff;
  color: var(--blue-ink);
  font-weight: 850;
}

.table-text-action:hover {
  background: #eff6ff;
}

.hit-detail-row td {
  padding: 0 !important;
  background: var(--surface-soft, #f8fafc);
}

.hit-detail-row div {
  display: flex;
  align-items: center;
  gap: 26px;
  padding: 14px 18px;
}

.hit-detail-row span {
  display: grid;
  gap: 3px;
  white-space: nowrap;
}

.hit-detail-row strong {
  color: var(--muted, #64748b);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.hit-detail-row p {
  flex: 1;
  margin: 0;
  color: var(--text-soft, #475569);
  line-height: 1.5;
  font-weight: 760;
}

.rule-overview-card {
  min-height: 118px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 18px;
  padding: 24px;
  background:
    radial-gradient(circle at 88% 10%, rgba(124, 58, 237, 0.1), transparent 28%),
    rgba(255, 255, 255, 0.96);
}

.rule-save-state {
  flex: 0 0 auto;
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  padding: 0 11px;
  border-radius: 999px;
  background: #ecfdf5;
  color: #047857;
  font-size: 12px;
  font-weight: 900;
}

.rule-description {
  max-width: 300px;
  display: block;
  margin-top: 5px;
  color: var(--muted, #64748b);
  font-size: 11px;
  line-height: 1.4;
  font-weight: 720;
}

.rule-tag-list {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.rule-tag-list span {
  background: var(--blue-soft);
  color: #2456ba;
}

.rule-tag-list.muted span {
  background: var(--surface-soft, #f1f5f9);
  color: var(--text-soft, #475569);
}

.rule-scope {
  min-width: 220px;
}

.rule-scope small {
  display: block;
  margin-top: 7px;
  color: var(--muted, #64748b);
  font-size: 12px;
  font-weight: 720;
  line-height: 1.45;
}

.rule-enforced-state {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  padding: 0 11px;
  border-radius: 999px;
  background: #fff1f2;
  color: #be123c;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.rule-toggle {
  width: 46px;
  height: 26px;
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}

.rule-toggle input {
  position: absolute;
  inset: 0;
  z-index: 1;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.rule-toggle i {
  width: 46px;
  height: 26px;
  display: block;
  border-radius: 999px;
  background: #cbd5e1;
  box-shadow: inset 0 0 0 1px rgba(100, 116, 139, 0.08);
  transition: background 0.16s ease, box-shadow 0.16s ease;
}

.rule-toggle i::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 5px rgba(15, 23, 42, 0.18);
  transition: transform 0.16s ease;
}

.rule-toggle input:checked + i {
  background: var(--blue);
  box-shadow: inset 0 0 0 1px var(--blue);
}

.rule-toggle input:checked + i::after {
  transform: translateX(20px);
}

.rule-toggle input:focus-visible + i {
  box-shadow: inset 0 0 0 1px var(--blue), 0 0 0 3px var(--blue-soft);
}

.table-text-action:focus-visible {
  border-color: var(--blue);
  outline: 0;
  box-shadow: 0 0 0 3px var(--blue-soft);
}

.blacklist-filter-panel,
.blacklist-table-card,
.blacklist-form-panel,
.empty-state {
  border: 1px solid var(--border, #d8e1ef);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.05);
}

.blacklist-filter-panel {
  display: grid;
  grid-template-columns: minmax(320px, 1.05fr) minmax(220px, 0.85fr) minmax(220px, 0.85fr) auto;
  gap: 16px;
  align-items: end;
  margin-bottom: 18px;
  padding: 18px 20px;
}

.blacklist-filter-panel label,
.blacklist-field {
  min-width: 0;
}

.blacklist-filter-panel span,
.field-label {
  display: block;
  margin-bottom: 8px;
  color: #0f172a;
  font-weight: 850;
}

.field-label {
  font-size: 13px;
  line-height: 1.2;
  font-weight: 950;
}

.field-help {
  color: var(--muted, #64748b);
  font-size: 12px;
  line-height: 1.45;
  font-weight: 750;
}

.blacklist-filter-panel input,
.blacklist-filter-panel select,
.blacklist-field select,
.blacklist-field textarea,
.reason-input {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--border, #d8e1ef);
  border-radius: 9px;
  background: var(--input-bg, #ffffff);
  color: var(--text, #0f172a);
  font: inherit;
  font-weight: 760;
  outline: 0;
}

.blacklist-filter-panel input,
.blacklist-filter-panel select,
.blacklist-field select {
  height: 42px;
  padding: 0 12px;
}

.blacklist-field select {
  height: 46px;
  padding-right: 38px;
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted, #64748b) 50%),
    linear-gradient(135deg, var(--muted, #64748b) 50%, transparent 50%);
  background-position:
    calc(100% - 18px) 19px,
    calc(100% - 13px) 19px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

.blacklist-field textarea,
.reason-input {
  resize: vertical;
  padding: 14px 15px;
  line-height: 1.55;
}

.blacklist-field textarea {
  min-height: 132px;
}

.reason-input {
  min-height: 86px;
}

.blacklist-filter-panel input:focus,
.blacklist-filter-panel select:focus,
.blacklist-field select:focus,
.blacklist-field textarea:focus,
.reason-input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-soft);
}

.blacklist-field textarea::placeholder,
.reason-input::placeholder,
.blacklist-filter-panel input::placeholder {
  color: var(--icon-muted, #94a3b8);
  font-weight: 700;
}

.filter-actions,
.toolbar-left {
  gap: 10px;
  flex-wrap: wrap;
}

.primary-action,
.secondary-action {
  width: auto;
  min-width: 0;
  height: 40px;
  justify-content: center;
  gap: 8px;
  padding: 0 15px;
  border-radius: 8px;
  font-weight: 850;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
}

.primary-action {
  border: 1px solid var(--blue);
  background: var(--blue);
  color: #fff;
  box-shadow: 0 10px 20px rgba(var(--blue-rgb), 0.17);
}

.secondary-action {
  border: 1px solid #bfdbfe;
  background: #fff;
  color: var(--blue-ink);
}

.secondary-action.ghost-reset {
  color: #64748b;
}

.primary-action:disabled {
  border-color: var(--border, #d8e1ef);
  background: var(--surface-muted, #f3f6fb);
  color: var(--muted, #64748b);
  cursor: not-allowed;
  opacity: 1;
  box-shadow: none;
}

.preview-hint svg,
.primary-action svg,
.secondary-action svg,
.compact-tool-group svg,
.icon-action svg,
.edit-action svg,
.delete-action svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.blacklist-table-card {
  overflow: hidden;
}

.blacklist-table-toolbar {
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid #edf1f7;
}

.compact-tool-group {
  overflow: hidden;
  border: 1px solid #cbd5e1;
  border-radius: 9px;
  background: #fff;
}

.compact-tool-group button {
  width: 46px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 0;
  border-right: 1px solid #cbd5e1;
  background: transparent;
  color: #334155;
}

.compact-tool-group button:last-child {
  border-right: 0;
}

.blacklist-table-wrap {
  overflow: auto;
  scrollbar-color: #c8cdd4 transparent;
  scrollbar-width: thin;
}

.blacklist-table-wrap::-webkit-scrollbar {
  height: 9px;
}

.blacklist-table-wrap::-webkit-scrollbar-thumb {
  background: #c7ccd4;
  border-radius: 99px;
}

.blacklist-table {
  width: 100%;
  min-width: 1180px;
  border-collapse: collapse;
}

.blacklist-table th,
.blacklist-table td {
  padding: 17px 16px;
  border-bottom: 1px solid #edf1f7;
  text-align: left;
  vertical-align: middle;
}

.blacklist-table th {
  color: #475569;
  background: #f8fafc;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.blacklist-table tr:last-child td {
  border-bottom: 0;
}

.blacklist-table tbody tr:hover {
  background: #f8fbff;
}

.blacklist-table th:last-child,
.blacklist-table td:last-child {
  position: sticky;
  right: 0;
  min-width: 132px;
  background: #fff;
  box-shadow: -10px 0 18px rgba(15, 23, 42, 0.06);
}

.blacklist-table th:last-child {
  z-index: 4;
  background: #f8fafc;
}

.blacklist-table td:last-child {
  z-index: 3;
}

.type-pill,
.source-pill {
  min-height: 27px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 850;
  line-height: 1;
  white-space: nowrap;
}

.type-pill {
  background: #eff6ff;
  color: var(--blue-deep);
}

.source-pill.manual {
  background: #ecfdf5;
  color: #047857;
}

.source-pill.import {
  background: #f8fafc;
  color: #475569;
}

.source-pill.ai {
  background: #fff7ed;
  color: #c2410c;
}

.value-text {
  color: var(--text-strong, #0f172a);
  font-size: 15px;
  font-weight: 950;
}

.match-text,
.muted-text {
  color: var(--text-soft, #475569);
  font-weight: 850;
}

.code-text {
  color: var(--text-soft, #475569);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  overflow-wrap: anywhere;
}

.row-actions {
  gap: 8px;
}

.edit-action,
.delete-action,
.icon-action {
  width: 32px;
  height: 32px;
  justify-content: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
}

.edit-action {
  color: var(--blue);
}

.edit-action:hover {
  background: var(--blue-soft);
}

.delete-action {
  color: var(--danger, #dc2626);
}

.delete-action:hover {
  background: var(--danger-soft, #fff1f2);
}

.delete-action .bi {
  display: inline-block;
  font-size: 17px;
  line-height: 1;
}

.edit-action:focus-visible,
.delete-action:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

.empty-state {
  margin: 14px 16px 0;
  padding: 18px;
  color: #64748b;
  font-weight: 850;
  text-align: center;
}

.empty-state[hidden] {
  display: none !important;
}

.table-footer {
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-top: 1px solid #edf1f7;
  background: #fbfdff;
}

.table-footer-left {
  gap: 14px;
  flex-wrap: wrap;
  color: #64748b;
  font-weight: 800;
}

.page-size {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.page-size select {
  width: 64px;
  height: 34px;
  padding: 0 8px;
  border: 1px solid var(--border, #d8e1ef);
  border-radius: 7px;
  background: #fff;
  color: #0f172a;
  font-weight: 850;
}

.pager {
  display: inline-flex;
  border: 1px solid var(--border, #d8e1ef);
  border-radius: 8px;
  overflow: hidden;
}

.pager button {
  min-width: 38px;
  height: 36px;
  border: 0;
  border-right: 1px solid var(--border, #d8e1ef);
  background: #fff;
  color: #64748b;
  font-weight: 800;
}

.pager button:last-child {
  border-right: 0;
}

.pager button.active {
  background: var(--blue);
  color: #fff;
}

.pager button:disabled {
  color: #cbd5e1;
  background: #f8fafc;
}

.blacklist-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--overlay, rgba(15, 23, 42, 0.42));
}

.blacklist-modal-backdrop[hidden] {
  display: none !important;
}

.blacklist-modal {
  width: min(100%, 900px);
  max-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border-light, #e7edf6);
  border-radius: 8px;
  background: var(--surface-raised, #ffffff);
  box-shadow: var(--shadow-floating, 0 24px 70px rgba(15, 23, 42, 0.22));
}

.modal-header {
  justify-content: space-between;
  gap: 16px;
  padding: 22px 24px;
  border-bottom: 1px solid var(--border-light, #e7edf6);
}

.modal-header h2 {
  margin: 0;
  color: var(--text-strong, #0f172a);
  font-size: 20px;
  line-height: 1.25;
  font-weight: 950;
}

.modal-header p {
  margin: 7px 0 0;
  color: var(--muted, #64748b);
  line-height: 1.5;
  font-weight: 750;
}

.blacklist-mode-switch {
  width: fit-content;
  display: flex;
  gap: 4px;
  padding: 4px;
  margin-bottom: 16px;
  border: 1px solid var(--border-light, #e7edf6);
  border-radius: 9px;
  background: var(--surface-soft, #f7faff);
}

.blacklist-mode-switch[hidden],
.blacklist-import-panel[hidden],
.import-preview[hidden],
[data-manual-preview][hidden] {
  display: none !important;
}

.blacklist-mode-switch button {
  min-width: 128px;
  height: 36px;
  padding: 0 14px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted, #64748b);
  font-weight: 850;
}

.blacklist-mode-switch button.active {
  background: var(--surface-raised, #ffffff);
  color: var(--blue);
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.09);
}

.icon-action {
  flex: 0 0 auto;
  border: 1px solid var(--border, #d8e1ef);
  background: var(--input-bg, #ffffff);
  color: var(--text, #0f172a);
}

.blacklist-form-panel {
  padding: 18px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--surface-soft, #f7faff) 82%, transparent), transparent 210px),
    var(--surface-raised, #ffffff);
}

.blacklist-import-panel {
  padding: 18px;
  border: 1px solid var(--border, #d8e1ef);
  border-radius: 13px;
  background: var(--surface-raised, #ffffff);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.05);
}

.import-heading,
.import-preview-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.import-heading h3 {
  margin: 0;
  color: var(--text-strong, #0f172a);
  font-size: 16px;
  font-weight: 950;
}

.import-heading p {
  margin: 6px 0 0;
  color: var(--muted, #64748b);
  font-size: 13px;
  line-height: 1.5;
  font-weight: 750;
}

.blacklist-upload-zone {
  min-height: 148px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
  padding: 22px;
  border: 1.5px dashed #93b4ef;
  border-radius: 11px;
  background: #f8fbff;
  color: var(--text-soft, #475569);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.blacklist-upload-zone:hover,
.blacklist-upload-zone.is-dragging {
  border-color: var(--blue);
  background: var(--blue-soft);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 12%, transparent);
}

.blacklist-upload-zone.has-file {
  border-style: solid;
  border-color: #86b7a5;
  background: #f3fbf7;
}

.blacklist-upload-zone input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.blacklist-upload-zone strong {
  color: var(--text-strong, #0f172a);
  font-size: 15px;
  font-weight: 950;
}

.blacklist-upload-zone > span:last-child {
  color: var(--muted, #64748b);
  font-size: 12px;
  line-height: 1.45;
  font-weight: 750;
}

.upload-icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #e8f0ff;
  color: var(--blue);
}

.upload-icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.import-rules {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
  color: var(--muted, #64748b);
  font-size: 12px;
  font-weight: 800;
}

.import-rules strong {
  color: var(--text-soft, #475569);
}

.import-rules span {
  padding: 5px 8px;
  border-radius: 6px;
  background: var(--surface-soft, #f7faff);
}

.import-preview {
  margin-top: 18px;
  border: 1px solid var(--border-light, #e7edf6);
  border-radius: 9px;
  overflow: hidden;
}

.import-preview-heading {
  padding: 11px 13px;
  background: var(--surface-soft, #f7faff);
  color: var(--text-soft, #475569);
  font-size: 12px;
  font-weight: 800;
}

.import-preview-heading strong {
  color: var(--text-strong, #0f172a);
  font-size: 13px;
}

.import-preview-table-wrap {
  max-height: 220px;
  overflow: auto;
}

.import-preview-table {
  width: 100%;
  min-width: 650px;
  border-collapse: collapse;
}

.import-preview-table th,
.import-preview-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-light, #e7edf6);
  color: var(--text-soft, #475569);
  font-size: 12px;
  text-align: left;
}

.import-preview-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #fbfdff;
  color: var(--muted, #64748b);
  font-weight: 900;
}

.import-status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  font-weight: 850;
  white-space: nowrap;
}

.import-status.valid {
  background: #ecfdf5;
  color: #047857;
}

.import-status.duplicate {
  background: #fff7ed;
  color: #c2410c;
}

.import-status.error {
  background: #fff1f2;
  color: #be123c;
}

.blacklist-form-grid {
  align-items: stretch;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.blacklist-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.blacklist-field-wide {
  grid-column: 1 / -1;
}

.preview-hint {
  min-height: 52px;
  flex: 1 1 auto;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--border-light, #e7edf6);
  border-radius: 8px;
  background: var(--surface-soft, #f7faff);
  color: var(--text-soft, #475569);
  line-height: 1.5;
  font-weight: 820;
}

.preview-hint svg {
  flex: 0 0 auto;
  color: var(--blue);
}

.modal-body {
  overflow: auto;
  padding: 22px 24px 24px;
}

.modal-body .preview-hint {
  margin-top: 18px;
}

.modal-footer {
  justify-content: flex-end;
  gap: 12px;
  padding: 18px 24px;
  border-top: 1px solid var(--border-light, #e7edf6);
  background: var(--surface-raised, #ffffff);
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 80;
  max-width: 340px;
  padding: 14px 16px;
  border: 1px solid var(--border-light, #e7edf6);
  border-radius: 8px;
  background: var(--surface-raised, #ffffff);
  color: var(--text, #0f172a);
  box-shadow: var(--shadow-floating, 0 24px 70px rgba(15, 23, 42, 0.22));
  font-weight: 850;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

:root[data-theme="dark"] .blacklist-subnav {
  background: #0f172a;
}

:root[data-theme="dark"] .blacklist-subnav button.active,
:root[data-theme="dark"] .blacklist-feature-card,
:root[data-theme="dark"] .blacklist-checklist-card,
:root[data-theme="dark"] .blacklist-data-card,
:root[data-theme="dark"] .risk-kpi-grid article,
:root[data-theme="dark"] .rule-overview-card {
  border-color: rgba(148, 163, 184, 0.2);
  background: #111827;
  color: #e5e7eb;
}

:root[data-theme="dark"] .blacklist-subnav button.active {
  color: #f8fafc;
}

:root[data-theme="dark"] .blacklist-feature-card {
  background:
    radial-gradient(circle at 82% 10%, rgba(59, 130, 246, 0.16), transparent 30%),
    linear-gradient(120deg, #111827 0%, #14203a 100%);
}

:root[data-theme="dark"] .rule-overview-card {
  background:
    radial-gradient(circle at 88% 10%, rgba(139, 92, 246, 0.16), transparent 28%),
    #111827;
}

:root[data-theme="dark"] .blacklist-checklist-card header,
:root[data-theme="dark"] .blacklist-panel-head {
  border-color: rgba(148, 163, 184, 0.18);
}

:root[data-theme="dark"] .blacklist-data-table th,
:root[data-theme="dark"] .hit-detail-row td {
  background: #0f172a;
}

:root[data-theme="dark"] .blacklist-data-table td {
  border-color: rgba(148, 163, 184, 0.14);
}

:root[data-theme="dark"] .table-text-action {
  border-color: rgba(96, 165, 250, 0.36);
  background: #111827;
  color: #93c5fd;
}

:root[data-theme="dark"] .rule-tag-list span {
  background: rgba(59, 130, 246, 0.16);
  color: #bfdbfe;
}

:root[data-theme="dark"] .rule-tag-list.muted span {
  background: rgba(148, 163, 184, 0.14);
  color: #cbd5e1;
}

:root[data-theme="dark"] .rule-toggle i {
  background: #475569;
}

@media (prefers-reduced-motion: reduce) {
  .blacklist-tab-panel:not([hidden]) {
    animation: none;
  }

}

@media (max-width: 1100px) {
  .blacklist-overview-grid {
    grid-template-columns: 1fr;
  }

  .risk-kpi-grid,
  .hit-log-filter-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hit-log-filter-panel .filter-actions {
    grid-column: 1 / -1;
  }

  .blacklist-filter-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .filter-actions {
    grid-column: 1 / -1;
  }
}

@media (max-width: 860px) {
  .blacklist-page {
    padding: 24px 16px 48px;
  }

  .blacklist-heading,
  .blacklist-table-toolbar,
  .table-footer,
  .blacklist-panel-head,
  .rule-overview-card {
    align-items: stretch;
    flex-direction: column;
  }

  .blacklist-feature-card {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .feature-actions,
  .panel-head-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .feature-actions .primary-action,
  .feature-actions .secondary-action,
  .panel-head-actions .primary-action,
  .panel-head-actions .secondary-action {
    width: 100%;
  }

  .hit-detail-row div {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .blacklist-filter-panel,
  .blacklist-form-grid {
    grid-template-columns: 1fr;
  }

  .filter-actions,
  .toolbar-left {
    align-items: stretch;
    flex-direction: column;
  }

  .filter-actions .primary-action,
  .filter-actions .secondary-action,
  .toolbar-left .primary-action,
  .toolbar-left .secondary-action,
  .pager {
    width: 100%;
  }

  .pager button {
    flex: 1;
  }

  .compact-tool-group {
    align-self: flex-start;
  }

  .modal-header,
  .modal-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .modal-header {
    align-items: flex-start;
    flex-direction: row;
  }

  .blacklist-mode-switch {
    width: 100%;
  }

  .blacklist-mode-switch button {
    flex: 1;
    min-width: 0;
  }

  .import-heading,
  .import-preview-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .import-heading .secondary-action {
    width: 100%;
  }
}

@media (max-width: 640px) {
  .blacklist-page {
    width: 100vw;
    padding: 22px 12px 34px;
    overflow: hidden;
  }

  .blacklist-shell {
    max-width: calc(100vw - 24px);
  }

  .blacklist-page * {
    max-width: 100%;
  }

  .blacklist-heading h1 {
    font-size: 26px;
  }

  .blacklist-heading p {
    font-size: 14px;
  }

  .blacklist-subnav {
    width: 100%;
  }

  .risk-kpi-grid,
  .hit-log-filter-panel {
    grid-template-columns: 1fr;
  }

  .risk-kpi-grid article {
    min-height: 92px;
  }

  .blacklist-feature-card,
  .blacklist-checklist-card,
  .blacklist-panel-head,
  .rule-overview-card {
    padding: 18px;
  }

  .blacklist-filter-panel,
  .blacklist-table-card,
  .blacklist-form-panel {
    border-radius: 10px;
  }

  .blacklist-modal-backdrop {
    padding: 12px;
  }

  .blacklist-modal {
    max-height: calc(100vh - 24px);
  }
}
