/* «Авторизация» (authbot.js) — in the admin's own look: panels like the other sections,
   bf-summary cards, the standard fields and buttons. Scoped under #authbot-root. */
#authbot-root .ab-status { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 4px 0 10px; }
#authbot-root .ab-pill { display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
#authbot-root .ab-pill.on { background: rgba(52, 211, 153, .14); color: var(--green); }
#authbot-root .ab-pill.off { background: rgba(255, 255, 255, .06); color: var(--muted); }
#authbot-root .ab-err { color: var(--red); font-size: 12.5px; }
#authbot-root .ab-note { margin: 8px 0; }

#authbot-root .ab-panel { background: var(--panel); border: 1px solid var(--glass-bd, var(--stroke)); border-radius: 12px; padding: 16px; margin: 14px 0 0; min-width: 0; }
#authbot-root .ab-panel h2 { font-size: 20px; margin: 0 0 12px; }
#authbot-root .ab-panel h3 { font-size: 16px; margin: 16px 0 8px; padding-top: 12px; border-top: 1px solid var(--stroke); }
#authbot-root .ab-h2row { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 12px; }
#authbot-root .ab-h2row h2 { margin: 0; }

#authbot-root .ab-link { padding: 10px 0; border-top: 1px solid var(--stroke); }
#authbot-root .ab-link:first-of-type { border-top: 0; padding-top: 0; }
#authbot-root .ab-link-k { font-size: 12px; font-weight: 600; color: #94a3b8; margin-bottom: 6px; }
#authbot-root .ab-link-v { display: flex; gap: 8px; align-items: center; min-width: 0; }
#authbot-root .ab-link-v code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; background: #0f172a; border: 1px solid #334155; border-radius: 8px; padding: 9px 12px; font-size: 13px; }
#authbot-root .ab-link .muted.sm { margin-top: 6px; }

#authbot-root .ab-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-bottom: 10px; }
#authbot-root .ab-form label { display: flex; flex-direction: column; gap: 6px; font-size: 12px; font-weight: 600; color: #94a3b8; min-width: 0; }
#authbot-root .ab-form input, #authbot-root .ab-form select { background: #0f172a; border: 1px solid #334155; color: var(--text, #e5e7eb); border-radius: 8px; height: 40px; padding: 0 12px; font: inherit; font-size: 14.5px; font-weight: 400; width: 100%; box-sizing: border-box; }
#authbot-root .ab-form1 { grid-template-columns: minmax(0, 1fr); }
#authbot-root [data-ab-invite] > p.muted { margin: 0 0 12px; }
#authbot-root [data-ab-invite] .muted.sm + .muted.sm { margin-top: 4px; }
#authbot-root .ab-check { display: flex; align-items: center; gap: 8px; font-size: 14px; margin: 8px 0; cursor: pointer; }
#authbot-root .ab-check input { width: 16px; height: 16px; flex: none; }
#authbot-root .ab-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; }

#authbot-root .ab-nowrap { white-space: nowrap; }
#authbot-root .ab-wrap { min-width: 180px; word-break: break-word; }
#authbot-root .ab-log tr.lv-error td:last-child { color: var(--red); }
#authbot-root .ab-log tr.lv-warn td:last-child { color: var(--amber, #f59e0b); }
#authbot-root .ab-log tr.lv-success td:last-child { color: var(--green); }
#authbot-root details.ab-more { margin-top: 12px; }
#authbot-root details.ab-more summary { cursor: pointer; color: var(--muted); font-size: 13.5px; }
#authbot-root details.ab-more[open] summary { margin-bottom: 10px; }

@media (max-width: 600px) {
  #authbot-root .ab-panel { padding: 12px; }
  #authbot-root .ab-link-v { flex-wrap: wrap; }
  #authbot-root .ab-link-v code { flex-basis: 100%; }
  #authbot-root th, #authbot-root td { padding: 8px 6px; font-size: 13px; }
}

#authbot-root .ab-manual { border-top: 1px solid var(--stroke); padding: 12px 0 4px; display: flex; flex-direction: column; gap: 8px; }
#authbot-root .ab-manual-h { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
#authbot-root .ab-manual-h .btn { margin-left: auto; }
#authbot-root .ab-form-row { grid-template-columns: minmax(0, 1fr) auto; align-items: end; margin-bottom: 0; }
#authbot-root .ab-go .btn { height: 40px; }
#authbot-root .ab-res { font-size: 13.5px; border-radius: 8px; padding: 8px 12px; background: #0f172a; border: 1px solid #334155; overflow-wrap: anywhere; }
#authbot-root .ab-res.ok { border-color: rgba(52, 211, 153, .4); color: var(--green); }
#authbot-root .ab-res.err { border-color: rgba(248, 113, 113, .4); color: var(--red); }
#authbot-root .ab-check-sm { margin: 0; font-size: 13px; }
#authbot-root .ab-link-v .btn { flex: none; text-decoration: none; }
@media (max-width: 640px) {
  #authbot-root .ab-form-row { grid-template-columns: 1fr; }
  #authbot-root .ab-go .btn { width: 100%; }
  #authbot-root .ab-manual-h .btn { margin-left: 0; }
  #authbot-root .ab-link-v { flex-wrap: wrap; }
}

/* «Журнал аудита сервера» */
#authbot-root [data-ab-audit] > p.muted { margin: -4px 0 12px; }
#authbot-root .ab-au-form { margin-bottom: 0; }
#authbot-root .ab-au-user { display: flex; gap: 6px; }
#authbot-root .ab-au-user input { flex: 1; min-width: 0; }
#authbot-root .ab-au-user .btn { flex: none; height: 40px; }
#authbot-root .ab-au-acts { margin: 10px 0 12px; }
#authbot-root .ab-au-acts .ab-check { margin: 0; }
#authbot-root .ab-au-count { margin-bottom: 6px; }
#authbot-root .ab-au td { vertical-align: top; }
#authbot-root .ab-au tr.hit td { background: rgba(248, 113, 113, .07); }
#authbot-root .ab-au tr.hit td:first-child { box-shadow: inset 3px 0 0 var(--red); }
#authbot-root .ab-danger { color: var(--red); }
#authbot-root .ab-who { display: inline-flex; align-items: center; gap: 6px; max-width: 260px; }
#authbot-root .ab-who img, #authbot-root .ab-who i { width: 20px; height: 20px; border-radius: 50%; flex: none; background: #334155; }
#authbot-root .ab-who-nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
#authbot-root button.ab-who-nm { background: none; border: 0; padding: 0; color: inherit; font: inherit; cursor: pointer; text-align: left; }
#authbot-root button.ab-who-nm:hover { text-decoration: underline; }
#authbot-root .ab-tag { flex: none; font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 999px; background: rgba(255, 255, 255, .06); color: var(--muted); }
#authbot-root .ab-tag.ours { background: rgba(245, 158, 11, .15); color: var(--amber, #f59e0b); }
#authbot-root .ab-tag.self { background: rgba(99, 102, 241, .16); color: #a5b4fc; }
#authbot-root .ab-chgs { min-width: 220px; }
#authbot-root .ab-chg { display: block; font-size: 13px; overflow-wrap: anywhere; }
#authbot-root .ab-chg + .ab-chg { margin-top: 3px; }
#authbot-root .ab-chg.add { color: var(--green); }
#authbot-root .ab-chg.rem { color: var(--red); }
#authbot-root .ab-chg.why { color: var(--muted); font-style: italic; }
#authbot-root .ab-au-more { display: flex; justify-content: center; margin-top: 12px; }
#authbot-root .ab-au td.ab-au-tgt { min-width: 140px; max-width: 260px; overflow-wrap: anywhere; }
#authbot-root .ab-au td.ab-au-tgt .ab-who { max-width: 100%; }
/* Phones: each entry is a card — time, then who → action → target, then the details. */
@media (max-width: 640px) {
  #authbot-root .ab-au { min-width: 0; }
  #authbot-root .ab-au thead { display: none; }
  #authbot-root .ab-au, #authbot-root .ab-au tbody, #authbot-root .ab-au tr { display: block; width: 100%; }
  #authbot-root .ab-au tr { padding: 10px 12px; border-bottom: 1px solid var(--stroke); }
  #authbot-root .ab-au td { display: block; border: 0; padding: 2px 0 !important; white-space: normal; min-width: 0; max-width: none; background: none !important; box-shadow: none !important; }
  #authbot-root .ab-au td:first-child { font-size: 12px; }
  #authbot-root .ab-au td:nth-child(3), #authbot-root .ab-au td:nth-child(4) { display: inline-block; vertical-align: middle; margin-right: 8px; }
  #authbot-root .ab-au tr.hit { background: rgba(248, 113, 113, .07); box-shadow: inset 3px 0 0 var(--red); }
  #authbot-root .ab-au .ab-chgs { min-width: 0; margin-top: 2px; }
  #authbot-root .ab-who { max-width: 100%; }
}
