/* ============ Админ-панель ============ */
.rail-item.admin-rail { background: #4b2b6b; color: #fff; font-size: 22px; }
.rail-item.admin-rail:hover { background: #7c3aed; border-radius: 35%; }

.admin-overlay {
  position: fixed; inset: 0; z-index: 950; background: rgba(0,0,0,.72);
  display: flex; align-items: stretch; justify-content: center; padding: 24px;
  backdrop-filter: blur(3px);
}
.admin-wrap {
  display: flex; width: 100%; max-width: 1280px; background: var(--chat, #313338);
  border-radius: 14px; overflow: hidden; position: relative;
  box-shadow: 0 24px 80px rgba(0,0,0,.6); border: 1px solid #000;
}
.admin-nav {
  flex: 0 0 230px; background: var(--sidebar, #2b2d31); padding: 18px 12px; display: flex; flex-direction: column; gap: 4px;
}
.admin-brand { font-weight: 800; color: var(--text-bright, #f2f3f5); font-size: 15px; padding: 6px 10px 14px; }
.admin-tab {
  text-align: left; padding: 9px 12px; border-radius: 6px; color: var(--muted, #949ba4);
  font-size: 15px; font-weight: 500;
}
.admin-tab:hover { background: var(--hover, #35373c); color: var(--text-bright, #fff); }
.admin-tab.sel { background: #7c3aed; color: #fff; }
.admin-nav-foot { margin-top: auto; font-size: 11px; color: var(--muted2, #80848e); padding: 10px; line-height: 1.5; }

.admin-main { flex: 1; padding: 26px 30px; overflow-y: auto; display: flex; flex-direction: column; min-width: 0; }
.admin-close {
  position: absolute; top: 14px; right: 16px; width: 34px; height: 34px; border-radius: 50%;
  background: #2b2d31; color: #fff; font-size: 15px; z-index: 3;
}
.admin-close:hover { background: var(--red, #f23f43); }
.admin-h1 { color: var(--text-bright, #fff); font-size: 21px; font-weight: 800; margin-bottom: 4px; }
.admin-h2 { color: var(--text-bright, #fff); font-size: 16px; font-weight: 700; margin: 22px 0 6px; }
.admin-sub { color: var(--muted, #949ba4); font-size: 14px; margin-bottom: 16px; }
.admin-sub code { background: #1e1f22; padding: 1px 6px; border-radius: 4px; font-size: 12px; }
.admin-loading, .nc-empty-big { color: var(--muted, #949ba4); text-align: center; padding: 40px 16px; font-size: 14px; }
.admin-error { color: #ff8083; background: rgba(242,63,67,.1); border-radius: 8px; padding: 14px; }
.admin-input {
  width: 100%; background: #1e1f22; border: 1px solid #1e1f22; border-radius: 6px;
  padding: 10px 12px; color: var(--text-bright, #fff); font-size: 14px; outline: none; margin-bottom: 12px;
}
.admin-input:focus { border-color: #7c3aed; }
textarea.admin-input { resize: vertical; }
.admin-label { display: block; font-size: 11px; font-weight: 800; color: var(--muted, #949ba4); text-transform: uppercase; letter-spacing: .5px; margin: 12px 0 6px; }

/* обзор */
.nc-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.nc-stat { background: var(--sidebar, #2b2d31); border-radius: 10px; padding: 16px; text-align: center; }
.nc-stat-ic { font-size: 22px; }
.nc-stat-n { font-size: 26px; font-weight: 800; color: var(--text-bright, #fff); margin-top: 4px; }
.nc-stat-l { font-size: 12px; color: var(--muted, #949ba4); }
.nc-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.nc-chip { background: rgba(124,58,237,.18); border: 1px solid #7c3aed; color: #d6bcfa; padding: 5px 12px; border-radius: 20px; font-size: 13px; font-weight: 600; }

/* двухпанельный вид */
.nc-split { display: grid; grid-template-columns: 330px 1fr; gap: 16px; flex: 1; min-height: 0; }
.nc-list { background: var(--sidebar, #2b2d31); border-radius: 10px; padding: 8px; overflow-y: auto; }
.nc-detail { background: var(--sidebar, #2b2d31); border-radius: 10px; padding: 20px; overflow-y: auto; }

.nc-row { width: 100%; display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 8px; text-align: left; }
.nc-row:hover { background: var(--hover, #35373c); }
.nc-row.sel { background: #7c3aed; }
.nc-row-info { flex: 1; min-width: 0; }
.nc-row-name { display: block; font-weight: 600; color: var(--text-bright, #fff); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nc-row-sub { display: block; font-size: 12px; color: var(--muted, #949ba4); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nc-row.sel .nc-row-sub { color: rgba(255,255,255,.75); }
.nc-dot { width: 10px; height: 10px; border-radius: 50%; flex: 0 0 auto; }
.nc-dot.on { background: var(--green, #23a559); }
.nc-dot.off { background: #80848e; }

.nc-ava {
  border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; flex: 0 0 auto; overflow: hidden; position: relative; font-size: 13px;
}
.nc-ava img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }

.nc-badge { font-size: 9px; font-weight: 800; padding: 2px 5px; border-radius: 4px; vertical-align: middle; margin-left: 4px; }
.nc-badge.admin { background: #7c3aed; color: #fff; }
.nc-badge.bot { background: var(--brand, #5865f2); color: #fff; }

.nc-head { display: flex; gap: 16px; align-items: center; margin-bottom: 14px; }
.nc-head-name { font-size: 19px; font-weight: 800; color: var(--text-bright, #fff); }
.nc-head-sub { font-size: 13px; color: var(--muted, #949ba4); }
.nc-head-sub.mono { font-family: Consolas, monospace; font-size: 11px; }
.nc-meta { display: flex; flex-wrap: wrap; gap: 16px; font-size: 13px; color: var(--muted, #949ba4); padding: 10px 0; border-top: 1px solid #3f4147; border-bottom: 1px solid #3f4147; }
.nc-meta b { color: var(--text-bright, #fff); }
.nc-bio { margin-top: 12px; font-size: 14px; color: var(--text, #dbdee1); background: #1e1f22; padding: 10px 12px; border-radius: 8px; }

.nc-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 4px; }
.nc-btn { background: #4e5058; color: #fff; font-weight: 600; font-size: 13px; padding: 9px 14px; border-radius: 6px; }
.nc-btn:hover { background: #5d5f67; }
.nc-btn.primary { background: #7c3aed; }
.nc-btn.primary:hover { background: #8b5cf6; }
.nc-btn.danger { background: rgba(242,63,67,.16); color: #ff8083; }
.nc-btn.danger:hover { background: var(--red, #f23f43); color: #fff; }
.nc-btn.wide { width: 100%; margin-top: 18px; }
.nc-mini { font-size: 11px; font-weight: 700; padding: 5px 9px; border-radius: 5px; background: #4e5058; color: #fff; flex: 0 0 auto; }
.nc-mini:hover { background: #5d5f67; }
.nc-mini.danger { background: rgba(242,63,67,.16); color: #ff8083; }
.nc-mini.danger:hover { background: var(--red, #f23f43); color: #fff; }

.nc-h3 { font-size: 12px; font-weight: 800; color: var(--muted, #949ba4); text-transform: uppercase; letter-spacing: .5px; margin: 20px 0 8px; }
.nc-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.nc-tag { background: #1e1f22; border: 1px solid #3f4147; border-radius: 6px; padding: 4px 10px; font-size: 13px; color: var(--text, #dbdee1); }
.nc-empty { color: var(--muted2, #80848e); font-size: 13px; font-style: italic; }

.nc-dms { display: flex; flex-direction: column; gap: 4px; }
.nc-dm { width: 100%; display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 7px; background: #1e1f22; text-align: left; }
button.nc-dm:hover { background: var(--hover, #35373c); }
.nc-open { font-size: 12px; color: #7c3aed; font-weight: 700; flex: 0 0 auto; }
.nc-ch-ic { width: 30px; text-align: center; font-size: 15px; color: var(--muted, #949ba4); flex: 0 0 auto; }

.nc-colors { display: flex; flex-wrap: wrap; gap: 8px; }
.nc-color { width: 30px; height: 30px; border-radius: 50%; border: 3px solid transparent; }
.nc-color.sel { border-color: #fff; box-shadow: 0 0 0 2px #7c3aed; }

/* лог сообщений */
.nc-log { background: #1e1f22; border-radius: 8px; padding: 10px; max-height: 60vh; overflow-y: auto; display: flex; flex-direction: column; }
.nc-log-day { text-align: center; font-size: 11px; font-weight: 700; color: var(--muted, #949ba4); margin: 10px 0 6px; }
.nc-log-msg { display: flex; gap: 10px; padding: 5px 6px; border-radius: 6px; position: relative; }
.nc-log-msg:hover { background: rgba(255,255,255,.04); }
.nc-log-body { flex: 1; min-width: 0; }
.nc-log-head { display: flex; align-items: baseline; gap: 7px; flex-wrap: wrap; font-size: 13px; }
.nc-log-handle, .nc-log-time { font-size: 11px; color: var(--muted, #949ba4); }
.nc-log-text { font-size: 14px; color: var(--text, #dbdee1); white-space: pre-wrap; word-break: break-word; line-height: 1.35; }
.nc-att { display: inline-block; font-size: 12px; color: #00a8fc; margin-top: 3px; }
.nc-log-del { opacity: 0; font-size: 13px; padding: 3px 6px; border-radius: 4px; flex: 0 0 auto; align-self: flex-start; }
.nc-log-msg:hover .nc-log-del { opacity: 1; }
.nc-log-del:hover { background: var(--red, #f23f43); }

/* модалка */
.admin-modal-overlay {
  position: fixed; inset: 0; z-index: 980; background: rgba(0,0,0,.7);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.admin-modal {
  background: var(--card, #313338); border-radius: 12px; padding: 24px; width: 460px; max-width: 100%;
  max-height: 88vh; overflow-y: auto; position: relative; box-shadow: 0 16px 50px rgba(0,0,0,.6);
}
.admin-modal.wide { width: 780px; }
.admin-modal h2 { color: var(--text-bright, #fff); font-size: 19px; text-align: center; margin-bottom: 4px; }
.admin-modal-x { position: absolute; top: 12px; right: 14px; color: var(--muted, #949ba4); font-size: 15px; width: 28px; height: 28px; border-radius: 50%; }
.admin-modal-x:hover { background: var(--red, #f23f43); color: #fff; }

@media (max-width: 900px) {
  .admin-overlay { padding: 0; }
  .admin-wrap { border-radius: 0; }
  .admin-nav { flex: 0 0 60px; padding: 12px 6px; }
  .admin-brand, .admin-nav-foot { display: none; }
  .admin-tab { font-size: 0; text-align: center; padding: 12px 0; }
  .nc-split { grid-template-columns: 1fr; }
}

/* Matrix-статус */
.nc-chip.warn { background: rgba(240,178,50,.15); border-color: var(--yellow, #f0b232); color: #f0b232; }

/* --- фикс отображения списков (перебиваем глобальный style.css) --- */
.admin-wrap { min-height: 560px; max-height: calc(100vh - 48px); }
.nc-split { min-height: 420px; }
.nc-list, .nc-detail { max-height: calc(100vh - 260px); min-height: 380px; }

.nc-list .nc-row,
button.nc-row {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  position: static !important;
  width: 100% !important;
  height: auto !important;
  min-height: 50px !important;
  margin: 0 0 2px !important;
  background: none;
  border: 0;
  cursor: pointer;
  font: inherit;
  color: inherit;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 8px;
  text-align: left;
  box-sizing: border-box;
}
.nc-list .nc-row:hover { background: var(--hover, #35373c); }
.nc-list .nc-row.sel { background: #7c3aed; }
.nc-row > * { visibility: visible !important; opacity: 1 !important; }
.nc-ava { display: inline-flex !important; }
.nc-row-info { display: block !important; flex: 1; min-width: 0; }
.nc-row-name, .nc-row-sub { display: block !important; }
