/* Page: #blacklist. Scope every rule with body[data-page="blacklist"] (modals included). Uses aurora.css components. */

/* ---------- hero + KPIs ---------- */
body[data-page="blacklist"] .bl-page .au-head .au-actions { align-self: center; }
body[data-page="blacklist"] .bl-kpis { grid-template-columns: repeat(5, minmax(0, 1fr)); }
body[data-page="blacklist"] .bl-kpis > .au-tile { grid-column: auto; min-height: 120px; justify-content: space-between; }
body[data-page="blacklist"] .bl-kpis .au-num { font-size: 30px; }
body[data-page="blacklist"] .bl-kpis .au-num.is-bad { color: #ff8fa0; }
body[data-page="blacklist"] .bl-kpis .au-num.is-warn { color: #f9c66c; }
body[data-page="blacklist"] .bl-kpis .au-num.is-ok { color: #6ee7b0; }

/* ---------- columns ---------- */
body[data-page="blacklist"] .bl-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; }
@media (min-width: 1180px) { body[data-page="blacklist"] .bl-grid { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); } }
body[data-page="blacklist"] .bl-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

/* ---------- collapsible section tiles ---------- */
body[data-page="blacklist"] .au-tile.bl-section { padding: 0; overflow: hidden; }
body[data-page="blacklist"] .bl-head { display: flex; align-items: center; gap: 10px; padding: 8px 12px 8px 8px; }
body[data-page="blacklist"] .bl-toggle {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; padding: 10px 10px; margin: 0;
  border: 0; border-radius: 14px; background: transparent; color: var(--text); font: inherit; text-align: start; cursor: pointer;
  transition: background .25s;
}
body[data-page="blacklist"] .bl-toggle:hover { background: rgb(255 255 255 / .035); }
body[data-page="blacklist"] .bl-toggle:focus-visible { outline: none; box-shadow: 0 0 0 3px rgb(var(--au-v-rgb) / .35); }
body[data-page="blacklist"] .bl-icon.au-ic { width: 38px; height: 38px; opacity: 1; font-size: inherit; }
body[data-page="blacklist"] .bl-icon.au-ic svg { width: 18px; height: 18px; }
body[data-page="blacklist"] .bl-title { font-size: 15px; font-weight: 900; letter-spacing: -.01em; white-space: nowrap; color: var(--text-strong); }
body[data-page="blacklist"] .bl-summary { display: flex; flex-wrap: wrap; gap: 6px; margin-inline-start: auto; justify-content: flex-end; }
body[data-page="blacklist"] .bl-chevron {
  flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
  background: rgb(255 255 255 / .05); color: var(--muted); transform: none; font-size: inherit;
  transition: transform .45s var(--au-ease-snap), background .25s, color .25s;
}
body[data-page="blacklist"] .bl-chevron svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
body[data-page="blacklist"] .bl-section.open .bl-chevron { transform: rotate(-90deg); color: var(--text-strong); background: rgb(var(--au-v-rgb) / .22); }
body[data-page="blacklist"] .bl-head-actions { display: flex; gap: 6px; flex-shrink: 0; }
body[data-page="blacklist"] .bl-body { padding: 4px 20px 20px; border-top: 1px solid var(--au-line); display: grid; gap: 14px; }
body[data-page="blacklist"] .bl-body[hidden] { display: none !important; }
body[data-page="blacklist"] .bl-hint { margin: 12px 0 0; color: var(--muted); font-size: 12.5px; line-height: 1.9; }

/* ---------- forms ---------- */
body[data-page="blacklist"] .au-field > label { display: block; margin: 0; font-size: 12.5px; font-weight: 800; color: var(--text-soft); }
body[data-page="blacklist"] .bl-form { display: grid; gap: 12px; align-items: end; margin: 0; }
body[data-page="blacklist"] .bl-form-inline { grid-template-columns: minmax(0, 1fr) auto; }
body[data-page="blacklist"] .bl-form-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
body[data-page="blacklist"] .bl-form-3 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; }
body[data-page="blacklist"] .bl-form .btn { min-height: 40px; }
body[data-page="blacklist"] .bl-form-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 0; }
body[data-page="blacklist"] .bl-check.au-switch { display: inline-flex; margin: 0; gap: 10px; font-size: 13.5px; }
body[data-page="blacklist"] .bl-check.au-switch b { font-weight: 700; color: var(--text-soft); }
body[data-page="blacklist"] .bl-check.au-switch input { width: 1px; height: 1px; min-height: 0; padding: 0; }
body[data-page="blacklist"] .bl-modes.au-seg { display: inline-flex; gap: 4px; }
body[data-page="blacklist"] .bl-modes.au-seg label { display: block; margin: 0; position: relative; }
body[data-page="blacklist"] .bl-save { padding-top: 14px; border-top: 1px solid var(--au-line); }
body[data-page="blacklist"] input[type="file"] { min-height: 40px; padding: 6px; font-size: 12.5px; cursor: pointer; }
body[data-page="blacklist"] input[type="file"]::file-selector-button {
  margin-inline-end: 8px; padding: 5px 12px; border: 0; border-radius: 9px; cursor: pointer;
  font: inherit; font-weight: 800; color: #fff; background: var(--au-grad);
}

/* search + filter row */
body[data-page="blacklist"] .bl-tools { display: flex; gap: 8px; margin: 0; align-items: center; }
body[data-page="blacklist"] .bl-tools .bl-search { flex: 1; min-width: 0; }
body[data-page="blacklist"] .bl-tools .bl-filter { width: auto; min-width: 140px; }

/* ---------- people lists ---------- */
body[data-page="blacklist"] .blacklist-users.au-list { gap: 8px; }
body[data-page="blacklist"] .bl-section .blacklist-user.au-item {
  grid-template-columns: 42px minmax(0, 1fr) auto auto; gap: 12px; padding: 10px 12px;
  border: 1px solid var(--au-line); border-radius: 14px; background: rgb(255 255 255 / .03); box-shadow: none;
}
body[data-page="blacklist"] .bl-section .blacklist-user.au-item:hover { background: rgb(255 255 255 / .055); border-color: var(--au-line-strong); }
body[data-page="blacklist"] .bl-section .blacklist-user > img,
body[data-page="blacklist"] .bl-section .blacklist-avatar-fallback {
  width: 42px; height: 42px; border-radius: 12px; object-fit: cover;
  background: linear-gradient(140deg, rgb(var(--au-v-rgb) / .32), rgb(var(--au-c-rgb) / .14)); box-shadow: 0 0 0 1px rgb(255 255 255 / .08) inset;
}
body[data-page="blacklist"] .blacklist-avatar-fallback { display: grid; place-items: center; font-size: 12px; font-weight: 900; color: #fff; }
body[data-page="blacklist"] .blacklist-user-info b { font-weight: 800; color: var(--text-strong); }
body[data-page="blacklist"] .blacklist-user-info small { margin: 2px 0; color: var(--text-soft); font-size: 12px; text-align: start; }
body[data-page="blacklist"] .blacklist-user-info code { color: var(--muted); font-size: 11.5px; background: none; padding: 0; text-align: start; }
body[data-page="blacklist"] .blacklist-platform.au-meta {
  padding: 3px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 800; white-space: nowrap;
  border: 1px solid var(--au-line-strong); background: rgb(255 255 255 / .04); color: var(--text-soft);
}
body[data-page="blacklist"] .blacklist-platform.discord { color: #a8b1ff; border-color: rgb(104 117 245 / .4); background: rgb(104 117 245 / .1); }
body[data-page="blacklist"] .blacklist-platform.telegram { color: #8fd8ff; border-color: rgb(42 171 238 / .4); background: rgb(42 171 238 / .1); }
body[data-page="blacklist"] .blacklist-actions.au-actions { display: flex; gap: 6px; flex-wrap: nowrap; }

/* ---------- rules table ---------- */
body[data-page="blacklist"] .bl-table-wrap { border: 1px solid var(--au-line); border-radius: 14px; }
body[data-page="blacklist"] .bl-table.au-table th, body[data-page="blacklist"] .bl-table.au-table td { padding: 10px 14px; }
body[data-page="blacklist"] .bl-table code { font-size: 12.5px; color: var(--text-strong); background: rgb(var(--au-v-rgb) / .12); padding: 2px 8px; border-radius: 7px; word-break: break-all; }
body[data-page="blacklist"] .bl-table tbody tr:last-child td { border-bottom: 0; }
body[data-page="blacklist"] .bl-td-actions { text-align: end; width: 1%; white-space: nowrap; }

/* ---------- link filter ---------- */
body[data-page="blacklist"] #link-filter-servers { display: grid; gap: 10px; }
body[data-page="blacklist"] .bl-server-list { max-height: 300px; overflow: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)); gap: 8px; padding: 2px; }
body[data-page="blacklist"] .bl-server {
  display: flex; align-items: center; gap: 10px; margin: 0; padding: 9px 12px; cursor: pointer;
  border: 1px solid var(--au-line); border-radius: 12px; background: rgb(255 255 255 / .03);
  transition: background .25s, border-color .25s;
}
body[data-page="blacklist"] .bl-server:hover { border-color: var(--au-line-strong); }
body[data-page="blacklist"] .bl-server:has(input:checked) { border-color: rgb(var(--au-v-rgb) / .55); background: rgb(var(--au-v-rgb) / .12); }
body[data-page="blacklist"] .bl-server input { flex: none; width: auto; margin: 0; }
body[data-page="blacklist"] .bl-server b { font-size: 13.5px; color: var(--text-strong); }
body[data-page="blacklist"] .bl-server small { font-size: 11.5px; color: var(--muted); }

/* ---------- blocked images ---------- */
body[data-page="blacklist"] .bl-section .blocked-image-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
body[data-page="blacklist"] .blocked-image {
  display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 8px; border-radius: 14px;
  border: 1px solid var(--au-line); background: rgb(255 255 255 / .03); transition: transform .4s var(--au-ease-snap), border-color .25s;
}
body[data-page="blacklist"] .blocked-image:hover { transform: translateY(-2px); border-color: var(--au-line-strong); }
body[data-page="blacklist"] .bl-section .blocked-image img, body[data-page="blacklist"] .bl-section .blocked-image-missing { height: 96px; border-radius: 10px; background: rgb(0 0 0 / .25); }
body[data-page="blacklist"] .blocked-image figcaption b { font-size: 13px; color: var(--text-strong); }
body[data-page="blacklist"] .blocked-image .btn { width: 100%; }

/* ---------- empty / pager / test ---------- */
body[data-page="blacklist"] .au-empty.bl-empty { padding: 22px 14px; border-radius: 14px; border: 1px dashed var(--au-line-strong); background: rgb(255 255 255 / .015); }
body[data-page="blacklist"] .bl-server-list > .bl-empty { grid-column: 1 / -1; }
body[data-page="blacklist"] .bl-pager { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 0; font-size: 12.5px; color: var(--muted); }
body[data-page="blacklist"] .bl-pager:empty { display: none; }
body[data-page="blacklist"] .bl-subpanel { margin: 0; padding: 0; border: 1px solid var(--au-line); border-radius: 14px; background: rgb(255 255 255 / .02); }
body[data-page="blacklist"] .bl-subpanel summary {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px; cursor: pointer; list-style: none; font-weight: 800; font-size: 14px;
}
body[data-page="blacklist"] .bl-subpanel summary::-webkit-details-marker { display: none; }
body[data-page="blacklist"] .bl-subpanel summary::after { content: '+'; margin-inline-start: auto; color: var(--muted); font-size: 18px; transition: transform .4s var(--au-ease-snap); }
body[data-page="blacklist"] .bl-subpanel[open] summary::after { transform: rotate(45deg); }
body[data-page="blacklist"] .bl-subpanel summary small { font-weight: 500; color: var(--muted); font-size: 12px; }
body[data-page="blacklist"] .bl-subpanel[open] { display: grid; gap: 10px; padding: 0 14px 14px; }
body[data-page="blacklist"] .bl-subpanel[open] summary { margin: 0 -14px; }
body[data-page="blacklist"] .bl-subpanel .bl-hint { margin: 0; }
body[data-page="blacklist"] #message-blacklist-test-out { margin: 0; padding: 10px 12px; border-radius: 12px; background: rgb(255 255 255 / .03); font-size: 13px; }

/* ---------- responsive ---------- */
@media (max-width: 1200px) {
  body[data-page="blacklist"] .bl-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  body[data-page="blacklist"] .bl-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body[data-page="blacklist"] .bl-kpis > .au-tile { grid-column: auto !important; min-height: 0; padding: 16px; }
  body[data-page="blacklist"] .bl-kpis > .au-tile:last-child { grid-column: 1 / -1 !important; }
  body[data-page="blacklist"] .bl-kpis .au-num { font-size: 24px; }
  body[data-page="blacklist"] .bl-kpis .au-sub { font-size: 11.5px; }
  body[data-page="blacklist"] .bl-head { flex-wrap: wrap; padding: 6px; }
  body[data-page="blacklist"] .bl-toggle { flex-wrap: wrap; row-gap: 8px; }
  body[data-page="blacklist"] .bl-title { flex: 1; min-width: 0; }
  body[data-page="blacklist"] .bl-chevron { order: 3; }
  body[data-page="blacklist"] .bl-summary { order: 4; width: 100%; margin: 0; padding: 0; justify-content: flex-start; padding-inline-start: 50px; }
  body[data-page="blacklist"] .bl-head-actions { width: 100%; padding: 0 10px 8px; }
  body[data-page="blacklist"] .bl-head-actions .btn { flex: 1; }
  body[data-page="blacklist"] .bl-body { padding: 4px 14px 16px; }
  body[data-page="blacklist"] .bl-form-inline, body[data-page="blacklist"] .bl-form-2, body[data-page="blacklist"] .bl-form-3 { grid-template-columns: 1fr; }
  body[data-page="blacklist"] .bl-form .btn, body[data-page="blacklist"] .bl-form-foot .btn { width: 100%; }
  body[data-page="blacklist"] .bl-modes.au-seg { width: 100%; display: grid; grid-template-columns: 1fr 1fr; }
  body[data-page="blacklist"] .bl-modes.au-seg span { display: block; text-align: center; padding: 8px 6px; }
  body[data-page="blacklist"] .bl-tools { flex-direction: column; align-items: stretch; }
  body[data-page="blacklist"] .bl-tools .bl-filter { width: 100%; }
  body[data-page="blacklist"] .bl-section .blacklist-user.au-item { grid-template-columns: 42px minmax(0, 1fr); }
  body[data-page="blacklist"] .bl-section .blacklist-user .blacklist-platform { display: none; }
  body[data-page="blacklist"] .bl-section .blacklist-user .blacklist-actions { grid-column: 1 / -1; justify-content: stretch; }
  body[data-page="blacklist"] .bl-section .blacklist-user .blacklist-actions > * { flex: 1; justify-content: center; }
  /* rules table as cards */
  body[data-page="blacklist"] .bl-table-wrap { border: 0; overflow: visible; }
  body[data-page="blacklist"] .bl-table.au-table, body[data-page="blacklist"] .bl-table tbody { display: grid; gap: 8px; }
  body[data-page="blacklist"] .bl-table thead { display: none; }
  body[data-page="blacklist"] .bl-table tr { display: grid; padding: 6px 12px; border: 1px solid var(--au-line); border-radius: 14px; background: rgb(255 255 255 / .03); }
  body[data-page="blacklist"] .bl-table.au-table td { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--au-line); text-align: end; min-width: 0; overflow-wrap: anywhere; }
  body[data-page="blacklist"] .bl-table.au-table td::before { content: attr(data-label); flex: none; color: var(--muted); font-size: 12px; font-weight: 700; }
  body[data-page="blacklist"] .bl-table.au-table td:last-child { border-bottom: 0; }
  body[data-page="blacklist"] .bl-td-actions { width: auto; }
}

/* ---------- light theme ---------- */
html[data-theme="light"] body[data-page="blacklist"] .bl-kpis .au-num.is-bad { color: #d33a55; }
html[data-theme="light"] body[data-page="blacklist"] .bl-kpis .au-num.is-warn { color: #a86400; }
html[data-theme="light"] body[data-page="blacklist"] .bl-kpis .au-num.is-ok { color: #0f9a62; }
html[data-theme="light"] body[data-page="blacklist"] .bl-toggle:hover,
html[data-theme="light"] body[data-page="blacklist"] .bl-chevron { background: rgb(30 30 80 / .04); }
html[data-theme="light"] body[data-page="blacklist"] .bl-section.open .bl-chevron { background: rgb(var(--au-v-rgb) / .14); color: #4b33c9; }
html[data-theme="light"] body[data-page="blacklist"] .bl-section .blacklist-user.au-item,
html[data-theme="light"] body[data-page="blacklist"] .bl-server,
html[data-theme="light"] body[data-page="blacklist"] .blocked-image,
html[data-theme="light"] body[data-page="blacklist"] .bl-subpanel,
html[data-theme="light"] body[data-page="blacklist"] #message-blacklist-test-out { background: rgb(30 30 80 / .025); }
html[data-theme="light"] body[data-page="blacklist"] .blacklist-platform.discord { color: #4752c4; }
html[data-theme="light"] body[data-page="blacklist"] .blacklist-platform.telegram { color: #1d7ec2; }
html[data-theme="light"] body[data-page="blacklist"] .bl-table code { color: #24186a; }
html[data-theme="light"] body[data-page="blacklist"] .blocked-image img { background: rgb(30 30 80 / .05); }
@media (max-width: 760px) {
  html[data-theme="light"] body[data-page="blacklist"] .bl-table tr { background: rgb(30 30 80 / .025); }
}

body[data-page="blacklist"] .au-field { align-content: start; }
html[data-theme="light"] body[data-page="blacklist"] .btn.danger { color: #c5243f !important; border-color: rgb(216 52 79 / .35) !important; }
html[data-theme="light"] body[data-page="blacklist"] .blacklist-avatar-fallback { color: #4b33c9; }
html[data-theme="light"] body[data-page="blacklist"] .bl-icon.au-ic svg { stroke: #4b33c9; }
