/* BLACK MANAGER — правила, команды, проверка, политика и админ-панель логов в светлом оформлении.
   Подключается после bm.css. Разметка страниц прежняя (ap-*, .header, .card …), меняется только вид. */

/* ══════════ ПУБЛИЧНЫЕ СТРАНИЦЫ ══════════ */
.ap-wrap { width: min(1000px, 100% - 48px); margin-inline: auto; }
.ap-main { padding: 64px 0 24px; }
.ap-pagehead { margin-bottom: 30px; }
.ap-kick { display: inline-block; padding: 5px 12px; border-radius: 999px; background: var(--blue-soft); color: var(--blue-d); font-weight: 700; font-size: .82rem; margin-bottom: 16px; }
.ap-h1 { font-size: clamp(2.2rem, 5.4vw, 3.6rem); line-height: 1.05; font-weight: 800; letter-spacing: -.03em; }
.ap-sub { color: var(--mute); font-size: 1.1rem; margin-top: 12px; }

.ap-search { position: relative; margin-bottom: 16px; }
.ap-search > i { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); color: var(--mute); }
.ap-search input { width: 100%; height: 56px; padding: 0 52px 0 50px; border: 1px solid var(--line); border-radius: 12px; background: #fff; font-size: 1.02rem; }
.ap-search input:focus { border-color: var(--blue); outline: 3px solid rgba(29, 120, 242, .18); }
.ap-search button { display: none; position: absolute; right: 10px; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; border: 0; border-radius: 8px; background: #eef2f8; color: var(--mute); cursor: pointer; }
.ap-search.has-q button { display: block; }

.ap-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 34px; }
.ap-chip { padding: 10px 16px; border-radius: 999px; border: 1px solid var(--line); background: #fff; font-weight: 600; font-size: .92rem; color: var(--ink-2); cursor: pointer; }
.ap-chip:hover { border-color: #c4d2e6; }
.ap-chip.on { background: var(--navy); border-color: var(--navy); color: #fff; }
.ap-chip small { opacity: .65; margin-left: 4px; font-size: .85em; }

.ap-group { margin-bottom: 34px; }
.ap-group-h { display: flex; align-items: center; gap: 12px; font-size: 1.3rem; font-weight: 800; letter-spacing: -.015em; margin-bottom: 14px; }
.ap-group-h > i { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; font-size: 1rem; background: var(--blue-soft); color: var(--blue); }
.ap-group-h .cnt { margin-left: auto; font-size: .85rem; font-weight: 700; padding: 4px 12px; border-radius: 999px; background: #eaf0f8; color: var(--ink-2); }
.ap-list { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.ap-rule { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto 16px; align-items: center; gap: 14px; width: 100%; padding: 16px 20px; border: 0; border-top: 1px solid var(--line); background: none; text-align: left; cursor: pointer; }
.ap-rule:first-child { border-top: 0; }
.ap-rule:hover { background: #f7faff; }
.ap-rule-n { font-family: var(--mono); font-weight: 700; font-size: .85rem; color: var(--blue-d); background: var(--blue-soft); border-radius: 6px; padding: 3px 0; text-align: center; }
.ap-rule-t { font-weight: 600; overflow-wrap: anywhere; }
.ap-rule > i { color: #a6b3c7; font-size: .8rem; }
.ap-tag { padding: 4px 12px; border-radius: 999px; font-size: .8rem; font-weight: 700; background: #eaf0f8; color: var(--ink-2); white-space: nowrap; }
.t-ban, .t-global { background: var(--red-soft); color: #b62b33; }
.t-hard { background: #2a1013; color: #ff9aa0; }
.t-mute { background: var(--amber-soft); color: #a86a05; }
.t-kick { background: #ece9fb; color: var(--violet); }
.t-warn { background: var(--blue-soft); color: var(--blue-d); }

.ap-cmds { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.ap-cmd { display: grid; grid-template-columns: minmax(0, 1fr) 18px; gap: 4px 12px; align-items: center; text-align: left; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; cursor: pointer; transition: border-color .15s; }
.ap-cmd:hover { border-color: var(--blue); }
.ap-cmd code { grid-column: 1; font-family: var(--mono); font-weight: 700; font-size: 1rem; color: var(--blue-d); overflow-wrap: anywhere; }
.ap-cmd span { grid-column: 1; color: var(--mute); font-size: .93rem; }
.ap-cmd i { grid-column: 2; grid-row: 1 / span 2; color: #a6b3c7; }
.ap-cmd.copied { border-color: var(--green); background: #f4fbf7; }
.ap-cmd.copied i { color: var(--green); }
.ap-empty { display: none; text-align: center; color: var(--mute); padding: 56px 12px; font-weight: 600; }
.ap-empty i { display: block; font-size: 2rem; margin-bottom: 12px; }

/* кнопки старой разметки */
.ap-b { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; padding: 0 22px; border-radius: 10px; border: 1px solid transparent; font-weight: 600; cursor: pointer; white-space: nowrap; }
.ap-b-main { background: var(--blue); color: #fff; }
.ap-b-main:hover { background: var(--blue-d); }
.ap-b-ghost { background: #fff; border-color: var(--line); color: var(--ink); }
.ap-b-ghost:hover { border-color: #c4d2e6; }
.ap-b-block { display: flex; width: 100%; }

/* шторка правила */
.ap-sheet-back { position: fixed; inset: 0; z-index: 200; background: rgba(16, 24, 39, .5); opacity: 0; pointer-events: none; transition: opacity .2s; }
.ap-sheet { position: fixed; left: 50%; top: 50%; z-index: 210; width: min(500px, calc(100% - 32px)); max-height: 88vh; overflow: auto; background: #fff; border-radius: 16px; padding: 28px; box-shadow: 0 30px 70px rgba(16, 24, 39, .3); transform: translate(-50%, -46%); opacity: 0; pointer-events: none; transition: transform .2s, opacity .2s; }
body.sheet-open { overflow: hidden; }
body.sheet-open .ap-sheet-back { opacity: 1; pointer-events: auto; }
body.sheet-open .ap-sheet { transform: translate(-50%, -50%); opacity: 1; pointer-events: auto; }
.ap-sheet-n { display: inline-block; font-family: var(--mono); font-weight: 700; font-size: .85rem; color: var(--blue-d); background: var(--blue-soft); border-radius: 6px; padding: 3px 10px; }
.ap-sheet-t { font-size: 1.5rem; font-weight: 800; line-height: 1.2; letter-spacing: -.02em; margin: 14px 0 20px; overflow-wrap: anywhere; }
.ap-pun { display: flex; align-items: center; gap: 16px; padding: 16px; border-radius: 12px; background: var(--bg); }
.ap-pun-ic { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; font-size: 1.1rem; flex: none; }
.ap-pun small { display: block; color: var(--mute); font-weight: 600; font-size: .82rem; }
.ap-pun b { font-size: 1.15rem; }
.ap-sheet-note { display: none; margin-top: 14px; padding: 14px 16px; border-radius: 10px; background: var(--amber-soft); border: 1px solid #f3d9a2; font-size: .95rem; overflow-wrap: anywhere; }
.ap-sheet-cat { margin-top: 14px; color: var(--mute); font-size: .9rem; font-weight: 600; }
.ap-sheet-actions { display: flex; gap: 10px; margin-top: 22px; }
.ap-sheet-actions .ap-b { flex: 1; }
@media (max-width: 720px) {
    .ap-sheet { left: 0; right: 0; top: auto; bottom: 0; width: 100%; border-radius: 18px 18px 0 0; transform: translateY(105%); padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px)); }
    body.sheet-open .ap-sheet { transform: none; }
}

/* проверка по ID */
.ap-lookup { max-width: 640px; margin: 24px auto 0; text-align: center; }
.ap-lookup h1 { font-size: clamp(2.2rem, 5.4vw, 3.4rem); font-weight: 800; letter-spacing: -.03em; line-height: 1.05; }
.ap-lookup form { display: flex; gap: 10px; margin-top: 30px; }
.ap-lookup input { flex: 1; min-width: 0; height: 56px; padding: 0 18px; border: 1px solid var(--line); border-radius: 12px; background: #fff; font-size: 1.02rem; }
.ap-lookup input:focus { border-color: var(--blue); outline: 3px solid rgba(29, 120, 242, .18); }
.ap-lookup .ap-b { min-height: 56px; }
.ap-hints { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 18px; }
.ap-hints span { font-family: var(--mono); font-size: .85rem; padding: 5px 12px; border-radius: 999px; background: #fff; border: 1px solid var(--line); color: var(--mute); }
.ap-err { display: flex; gap: 10px; align-items: center; justify-content: center; margin-top: 22px; padding: 12px 16px; border-radius: 10px; background: var(--red-soft); color: #b62b33; font-weight: 600; }
.ap-profile { display: flex; align-items: center; gap: 18px; padding: 22px; margin-bottom: 14px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.ap-profile img { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; }
.ap-profile b { display: block; font-size: 1.4rem; font-weight: 800; }
.ap-profile b a:hover { color: var(--blue); }
.ap-profile small { color: var(--mute); font-family: var(--mono); }
.ap-verdict { display: flex; align-items: center; gap: 12px; padding: 18px 22px; border-radius: var(--radius); font-weight: 800; font-size: 1.15rem; margin-bottom: 18px; }
.ap-verdict.ok { background: var(--green-soft); color: #0e7a47; }
.ap-verdict.bad { background: var(--red-soft); color: #b62b33; }
.ap-acc, .ap-doc details { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 12px; overflow: hidden; }
.ap-acc summary, .ap-doc summary { list-style: none; display: flex; align-items: center; gap: 14px; padding: 18px 20px; font-weight: 700; cursor: pointer; }
.ap-acc summary::-webkit-details-marker, .ap-doc summary::-webkit-details-marker { display: none; }
.ap-acc summary .n { margin-left: auto; font-size: .82rem; padding: 3px 11px; border-radius: 999px; background: var(--blue-soft); color: var(--blue-d); }
.ap-acc summary .chev, .ap-doc summary i { font-size: .75rem; color: var(--mute); transition: transform .2s; }
.ap-doc summary i { margin-left: auto; }
.ap-acc[open] summary .chev, .ap-doc details[open] summary i { transform: rotate(180deg); }
.ap-acc[open] summary, .ap-doc details[open] summary { border-bottom: 1px solid var(--line); background: #f8fafd; }
.ap-acc-body { padding: 18px 20px; display: grid; gap: 12px; }
.ap-acc-empty { color: var(--mute); font-weight: 600; }
.ap-sub-h { color: var(--mute); font-weight: 700; font-size: .85rem; }
.ap-ban { display: flex; gap: 14px; padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: #fbfcfe; }
.ap-ban img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; flex: none; }
.ap-ban-t { font-weight: 800; margin-bottom: 2px; }
.ap-ban-m { color: var(--ink-2); font-size: .93rem; overflow-wrap: anywhere; }
.ap-ban-m a { color: var(--blue); font-weight: 700; }
.ap-ban-d { color: var(--mute); font-size: .85rem; margin-top: 4px; }

/* политика */
.ap-doc summary b { flex: none; width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--blue-soft); color: var(--blue-d); font-size: .88rem; }
.ap-doc .body { padding: 20px 22px 22px 64px; line-height: 1.7; color: var(--ink-2); }
.ap-doc .body p + p, .ap-doc .body ul + p, .ap-doc .body p + ul { margin-top: 12px; }
.ap-doc .body ul { margin: 0; padding-left: 20px; display: grid; gap: 8px; }
.ap-doc .body b { color: var(--ink); }
.ap-doc .body a { color: var(--blue); font-weight: 600; text-decoration: underline; }
.ap-note { padding: 12px 16px; border-radius: 10px; background: var(--green-soft); color: #0e7a47; font-weight: 600; }
.ap-toast { position: fixed; left: 50%; bottom: 28px; z-index: 300; padding: 12px 20px; border-radius: 10px; background: var(--navy); color: #fff; font-weight: 600; transform: translate(-50%, 16px); opacity: 0; pointer-events: none; transition: all .2s; white-space: nowrap; }
.ap-toast.on { opacity: 1; transform: translate(-50%, 0); }
.ap-toast i { margin-right: 8px; color: #59e0a1; }
@media (max-width: 720px) {
    .ap-wrap { width: min(1000px, 100% - 32px); }
    .ap-main { padding: 40px 0 8px; }
    .ap-cmds { grid-template-columns: 1fr; }
    .ap-rule { grid-template-columns: 46px minmax(0, 1fr) 14px; }
    .ap-rule .ap-tag { display: none; }
    .ap-lookup form { flex-direction: column; }
    .ap-doc .body { padding-left: 22px; }
}

/* ══════════ АДМИН-ПАНЕЛЬ (логи, чаты, пользователи) ══════════ */
.header { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 14px max(24px, calc((100% - 1180px) / 2)); background: rgba(244, 247, 252, .94); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.header .logo { display: flex; align-items: center; gap: 12px; }
.header .logo b { font-size: 1.05rem; font-weight: 700; }
.header .logo small { display: block; color: var(--mute); font-size: .78rem; font-weight: 500; line-height: 1.2; }
.header-right { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.user-badge { display: flex; align-items: center; gap: 10px; padding: 4px 14px 4px 4px; background: #fff; border: 1px solid var(--line); border-radius: 999px; }
.user-badge .avatar { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; }
.user-badge .name { font-weight: 700; font-size: .9rem; line-height: 1.2; }
.user-badge .uid { color: var(--mute); font-size: .78rem; font-family: var(--mono); }
.btn-back { background: #fff; border-color: var(--line); color: var(--ink); min-height: 40px; padding: 0 16px; font-size: .92rem; }
.btn-back:hover { border-color: #c4d2e6; }
.btn-danger { background: var(--red-soft); color: #b62b33; min-height: 40px; padding: 0 16px; font-size: .92rem; }
.btn-danger:hover { background: #fbd6d8; }

.container { width: min(1180px, 100% - 48px); margin-inline: auto; padding: 44px 0 64px; }
.section-title { display: flex; align-items: center; gap: 14px; font-size: clamp(1.8rem, 3.4vw, 2.6rem); font-weight: 800; letter-spacing: -.03em; line-height: 1.1; margin-bottom: 8px; }
.section-title i { width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; font-size: 1.2rem; background: var(--blue-soft); color: var(--blue); flex: none; }
.page-sub { color: var(--mute); font-size: 1.05rem; margin: 0 0 30px 62px; }
.section-title + .stats, .section-title + .stats-mini, .section-title + .stats-row, .section-title + .filters { margin-top: 28px; }
.footer-text { margin-top: 48px; color: var(--mute); font-size: .9rem; text-align: center; }

/* меню админки */
.container > .grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
.container > .grid > .card { display: flex; flex-direction: column; gap: 10px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; transition: border-color .15s; }
.container > .grid > .card:hover { border-color: var(--blue); }
.card-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.icon { width: 52px; height: 52px; border-radius: 12px; display: grid; place-items: center; font-size: 1.25rem; background: var(--blue-soft); color: var(--blue); }
.icon-green { background: var(--green-soft); color: var(--green); }
.icon-purple { background: #ece9fb; color: var(--violet); }
.icon-orange { background: var(--amber-soft); color: var(--amber); }
.icon-pink { background: var(--red-soft); color: var(--red); }
.icon-blue { background: var(--blue-soft); color: var(--blue); }
.card-top .tag { font-family: var(--mono); font-size: .8rem; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: #eaf0f8; color: var(--mute); }
.container > .grid > .card h3 { font-size: 1.25rem; font-weight: 800; letter-spacing: -.01em; }
.container > .grid > .card p { color: var(--mute); }
.arrow { margin-top: auto; padding-top: 10px; color: var(--blue); font-weight: 700; }

/* цифры */
.stats, .stats-row, .stats-mini { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-bottom: 24px; }
.stat-card, .stat-box, .stat-item { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.stat-card .num, .stat-box .num, .stat-item .num { font-size: 2.4rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; color: var(--ink); }
.num.pink { color: var(--red); } .num.purple { color: var(--violet); } .num.green { color: var(--green); } .num.white { color: var(--ink); }
.stat-card .label, .stat-box .label, .stat-item .label { color: var(--mute); font-weight: 600; margin-top: 6px; }

/* фильтры и таблица логов */
.filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 14px; padding: 20px; margin-bottom: 20px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.filter-group { display: grid; gap: 6px; }
.filter-group label { font-weight: 700; font-size: .85rem; color: var(--ink-2); }
.filter-group input, .filter-group select, .search-box input, .modal-input { min-height: 44px; padding: 0 14px; border: 1px solid var(--line); border-radius: 10px; background: #fff; min-width: 190px; }
.filter-group input:focus, .filter-group select:focus, .search-box input:focus, .modal-input:focus { border-color: var(--blue); outline: 3px solid rgba(29, 120, 242, .18); }
.btn-filter, .btn-reset, .search-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 20px; border: 1px solid transparent; border-radius: 10px; font-weight: 600; cursor: pointer; }
.btn-filter, .search-btn { background: var(--blue); color: #fff; }
.btn-filter:hover, .search-btn:hover { background: var(--blue-d); }
.btn-reset { background: #fff; border-color: var(--line); color: var(--ink-2); }
.logs-box { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow-x: auto; }
.logs-box table { width: 100%; border-collapse: collapse; min-width: 860px; }
.logs-box th { text-align: left; padding: 14px 18px; background: #f8fafd; color: var(--mute); font-size: .75rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; border-bottom: 1px solid var(--line); }
.logs-box td { padding: 14px 18px; border-top: 1px solid var(--line); vertical-align: middle; }
.logs-box tbody tr:first-child td { border-top: 0; }
.logs-box tbody tr:hover { background: #f9fbff; }
.badge-id { font-family: var(--mono); font-size: .82rem; color: var(--mute); }
.user-cell { display: flex; align-items: center; gap: 10px; min-width: 0; }
.user-avatar-sm { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; flex: none; }
.user-name-sm { font-weight: 700; font-size: .92rem; max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-id-sm a { color: var(--mute); font-size: .8rem; font-family: var(--mono); }
.user-id-sm a:hover { color: var(--blue); }
.action-text { max-width: 380px; overflow-wrap: anywhere; color: var(--ink-2); }
.date-cell { color: var(--mute); font-size: .88rem; white-space: nowrap; }
.badge-1 { background: var(--blue-soft); color: var(--blue-d); }
.badge-3 { background: var(--amber-soft); color: #a86a05; }
.badge-4 { background: #ece9fb; color: var(--violet); }
.badge-5 { background: #eaf0f8; color: var(--ink-2); }
.badge-6 { background: var(--green-soft); color: #0e7a47; }
.badge-active, .badge-unlocked { background: var(--green-soft); color: #0e7a47; }
.badge-inactive, .badge-locked { background: var(--red-soft); color: #b62b33; }
.empty-logs, .empty-state { text-align: center; color: var(--mute); padding: 56px 20px; font-weight: 600; }
.empty-logs i, .empty-state > i { display: block; font-size: 2.2rem; margin-bottom: 12px; }
.empty-state { grid-column: 1 / -1; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.empty-state h3 { color: var(--ink); font-size: 1.4rem; margin-bottom: 6px; }
.pagination { display: flex; justify-content: center; gap: 6px; margin-top: 24px; }
.pagination a, .pagination span { min-width: 40px; height: 40px; padding: 0 12px; display: grid; place-items: center; border-radius: 10px; border: 1px solid var(--line); background: #fff; font-weight: 600; }
.pagination a:hover { border-color: var(--blue); color: var(--blue); }
.pagination .active { background: var(--navy); border-color: var(--navy); color: #fff; }

/* чаты (админка) */
.chats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 12px; }
.chats-grid > .chat-card { display: block; padding: 20px 22px; }
.chat-info { display: grid; gap: 12px; }
.chat-name { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 1.15rem; font-weight: 800; overflow-wrap: anywhere; }
.source-tag { font-family: var(--mono); font-size: .72rem; padding: 2px 8px; border-radius: 6px; background: #eaf0f8; color: var(--mute); font-weight: 600; }

/* активность */
.activity-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; }
.activity-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.activity-title { font-size: 1.25rem; font-weight: 800; }
.activity-title i { color: var(--blue); margin-right: 8px; }
.activity-subtitle { color: var(--mute); }
.activity-total { text-align: right; }
.activity-total span { display: block; font-size: 2.2rem; font-weight: 800; line-height: 1; color: var(--blue); }
.activity-total small { color: var(--mute); font-weight: 600; }
.activity-chart { position: relative; height: 320px; }

/* пользователь */
.search-box { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 28px; }
.search-box input { flex: 1 1 260px; }
.user-card { display: none; margin-bottom: 30px; }
.user-card.active { display: block; }
.profile-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; }
.profile-top { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.profile-avatar { width: 76px; height: 76px; border-radius: 50%; overflow: hidden; background: var(--blue-soft); color: var(--blue); display: grid; place-items: center; font-size: 1.8rem; flex: none; }
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-info { flex: 1; min-width: 200px; }
.profile-name { font-size: 1.5rem; font-weight: 800; }
.profile-id { color: var(--mute); font-family: var(--mono); font-size: .9rem; }
.profile-vip { display: inline-block; margin-top: 6px; padding: 3px 12px; border-radius: 999px; background: var(--amber-soft); color: #a86a05; font-weight: 800; font-size: .8rem; }
.profile-balance { font-size: 2.2rem; font-weight: 800; letter-spacing: -.02em; }
.profile-balance small { font-size: 1.2rem; color: var(--mute); }
.profile-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); column-gap: 40px; padding: 10px 0 6px; }
.stat-row { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.stat-row .label { color: var(--mute); font-weight: 600; }
.stat-row .value { font-weight: 800; }
.value.cyan { color: var(--blue); } .value.green { color: var(--green); } .value.pink { color: var(--red); }
.value.orange { color: var(--amber); } .value.gold { color: #b97c0a; } .value.purple { color: var(--violet); }
.profile-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 22px; }
.action-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 22px; border-radius: 10px; border: 1px solid transparent; font-weight: 600; cursor: pointer; }
.action-btn.give { background: var(--green-soft); color: #0e7a47; }
.action-btn.take { background: var(--red-soft); color: #b62b33; }
.action-btn.vip { background: var(--amber-soft); color: #a86a05; }
.action-btn:hover { filter: brightness(.96); }
.loader { display: inline-block; width: 14px; height: 14px; border: 2px solid rgba(255, 255, 255, .5); border-top-color: #fff; border-radius: 50%; animation: bm-spin .7s linear infinite; vertical-align: -2px; }
@keyframes bm-spin { to { transform: rotate(360deg); } }
.modal-overlay { display: none; position: fixed; inset: 0; z-index: 2000; background: rgba(16, 24, 39, .55); justify-content: center; align-items: center; padding: 16px; }
.modal-overlay.active { display: flex; }
.modal { width: min(440px, 100%); background: #fff; border-radius: 16px; padding: 28px; box-shadow: 0 30px 70px rgba(16, 24, 39, .3); }
.modal-title { display: flex; align-items: center; gap: 10px; font-size: 1.3rem; font-weight: 800; }
.modal-sub { color: var(--mute); margin: 6px 0 18px; }
.modal-input { width: 100%; }
.modal-buttons { display: flex; gap: 10px; margin-top: 20px; }
.modal-btn { flex: 1; min-height: 46px; border-radius: 10px; border: 1px solid transparent; font-weight: 600; cursor: pointer; }
.modal-btn.primary { background: var(--blue); color: #fff; }
.modal-btn.secondary { background: #fff; border-color: var(--line); }
.modal-vip-list { display: grid; gap: 8px; max-height: 300px; overflow-y: auto; }
.modal-vip-item { padding: 12px 16px; border: 1px solid var(--line); border-radius: 10px; font-weight: 600; cursor: pointer; }
.modal-vip-item:hover { border-color: #c4d2e6; }
.modal-vip-item.selected { background: var(--amber-soft); border-color: var(--amber); color: #a86a05; }
.modal-vip-item.remove.selected { background: var(--red-soft); border-color: var(--red); color: #b62b33; }
.toast.success { background: #0e7a47; }
@media (max-width: 720px) {
    .container { width: min(1180px, 100% - 32px); padding-top: 28px; }
    .header { padding: 12px 16px; }
    .page-sub { margin-left: 0; }
    .chats-grid { grid-template-columns: 1fr; }
    .filters .filter-group, .filters input, .filters select { width: 100%; min-width: 0; }
}

/* ══════════ КОМАНДА ══════════ */
.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 18px;
}

.team-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 26px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.team-top {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.team-ava {
    width: 62px;
    height: 62px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    font-size: 1.5rem;
    flex: none;
    background: var(--blue-soft);
    color: var(--blue-d);
}

.team-ava-ph {
    width: 62px;
    height: 62px;
    border-radius: 16px;
    object-fit: cover;
    flex: none;
    background: var(--blue-soft);
}

.team-head {
    min-width: 0;
    flex: 1;
}

/* Бейдж должности не выходит за пределы карточки */
.team-head .badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 100%;
    box-sizing: border-box;
    white-space: normal;
    overflow-wrap: break-word;
    word-break: normal;
    line-height: 1.25;
}

.team-head .badge i {
    flex-shrink: 0;
}

.team-name {
    display: inline-block;
    font-size: 1.35rem;
    font-weight: 800;
    margin: 8px 0 6px;
    overflow-wrap: anywhere;
    color: var(--ink);
}

.team-name:hover {
    color: var(--blue);
}

.team-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 16px;
    align-items: center;
    color: var(--mute);
    font-size: .88rem;
}

.team-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 700;
}

.team-status i {
    font-size: .5rem;
    color: #b5c0d1;
}

.team-status.on {
    color: #0e7a47;
}

.team-status.on i {
    color: var(--green);
}

.team-about {
    color: var(--ink-2);
    line-height: 1.6;
}

.badge.owner {
    background: var(--amber-soft);
    color: #a86a05;
}

.badge.deputy {
    background: #ece9fb;
    color: var(--violet);
}

.team-card .btn {
    align-self: flex-start;
}
