/* ============================================================
   BlackFox24 Dashboard — кастомные стили поверх WiseOwl dark
   ============================================================ */

/* ── Логин-экран ─────────────────────────────────────────── */
.bf-login-screen {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(ellipse at 50% -20%, rgba(0,212,255,.06) 0%, transparent 60%), #0a0e17;
}
.bf-login-card {
    width: 380px;
    max-width: calc(100vw - 32px);
    background: #141a28;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 14px;
    padding: 36px 32px;
    box-shadow: 0 20px 60px rgba(0,0,0,.5);
}
.bf-login-logo { text-align: center; margin-bottom: 12px; }
.bf-login-title {
    text-align: center;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: 22px;
    color: #e2e8f0;
    margin-bottom: 2px;
}
.bf-login-sub {
    text-align: center;
    color: #64748b;
    font-size: 13px;
    margin-bottom: 24px;
}
.bf-login-error {
    background: rgba(239,68,68,.12);
    border: 1px solid rgba(239,68,68,.3);
    color: #f87171;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 13px;
    margin-bottom: 16px;
}

/* ── Бренд в шапке ───────────────────────────────────────── */
.bf-brand-text {
    color: #e2e8f0;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: 16px;
    letter-spacing: .02em;
}

/* ── Общие помощники ─────────────────────────────────────── */
.bf-muted { color: #64748b; font-size: 13px; }
.bf-inline-count { font-size: 12px; color: #22c55e; font-weight: 400; }

/* ── Карточки серверов ───────────────────────────────────── */
.bf-server-card {
    background: #141a28;
    border: 1px solid rgba(255,255,255,.07);
    border-radius: 12px;
    padding: 18px 18px 16px;
    transition: border-color .2s ease, transform .2s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}
.bf-server-card:hover { border-color: rgba(0,212,255,.35); transform: translateY(-2px); }
.bf-server-card.status-green { border-left: 3px solid #22c55e; }
.bf-server-card.status-yellow { border-left: 3px solid #eab308; }
.bf-server-card.status-red { border-left: 3px solid #ef4444; }

.bf-srv-top {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}
.bf-srv-flag {
    font-size: 22px;
    line-height: 1;
}
.bf-srv-name {
    font-weight: 600;
    color: #e2e8f0;
    font-size: 14px;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.bf-srv-type {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #64748b;
    background: rgba(255,255,255,.05);
    padding: 2px 8px;
    border-radius: 20px;
}
.bf-srv-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    flex-shrink: 0;
}
.bf-srv-dot.online { background: #22c55e; box-shadow: 0 0 8px rgba(34,197,94,.5); }
.bf-srv-dot.offline { background: #ef4444; box-shadow: 0 0 8px rgba(239,68,68,.5); }

.bf-srv-metrics { display: flex; flex-direction: column; gap: 8px; }
.bf-srv-metric { display: flex; align-items: center; gap: 8px; font-size: 11px; color: #94a3b8; }
.bf-srv-metric .bf-m-label { width: 36px; flex-shrink: 0; text-transform: uppercase; letter-spacing: .04em; font-size: 10px; }
.bf-srv-metric .bf-m-val { width: 40px; text-align: right; font-variant-numeric: tabular-nums; flex-shrink: 0; color: #e2e8f0; }
.bf-progress {
    flex: 1;
    height: 5px;
    background: rgba(255,255,255,.07);
    border-radius: 3px;
    overflow: hidden;
}
.bf-progress-fill { height: 100%; border-radius: 3px; transition: width .5s ease; }
.bf-progress-fill.green { background: #22c55e; }
.bf-progress-fill.yellow { background: #eab308; }
.bf-progress-fill.red { background: #ef4444; }
.bf-progress-fill.cyan { background: #00d4ff; }

.bf-srv-extras {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 14px;
    margin-top: 12px;
    font-size: 11px;
    color: #64748b;
    border-top: 1px solid rgba(255,255,255,.05);
    padding-top: 10px;
}
.bf-srv-extras span { white-space: nowrap; }
.bf-srv-extras i { margin-right: 4px; color: #475569; }

/* ── Онлайн VPN ──────────────────────────────────────────── */
.online-clients { display: flex; flex-wrap: wrap; gap: 8px; }
.client-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(34,197,94,.08);
    border: 1px solid rgba(34,197,94,.25);
    color: #4ade80;
    font-size: 12.5px;
    padding: 5px 12px;
    border-radius: 20px;
}
.client-dot { width: 7px; height: 7px; border-radius: 50%; background: #22c55e; }
.bf-empty {
    color: #64748b;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
}

/* ── Кнопки-статусы сервисов ────────────────────────────── */
.bf-svc-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #141a28;
    border: 1px solid rgba(255,255,255,.07);
    border-radius: 12px;
    padding: 14px 16px;
    color: #e2e8f0;
    text-decoration: none !important;
    transition: border-color .2s ease, transform .2s ease;
    height: 100%;
}
.bf-svc-btn:hover { border-color: rgba(0,212,255,.35); transform: translateY(-2px); color: #e2e8f0; }
.bf-svc-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    flex-shrink: 0;
    background: rgba(255,255,255,.05);
    color: #94a3b8;
}
.bf-svc-body { flex: 1; min-width: 0; }
.bf-svc-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bf-svc-status { font-size: 11.5px; color: #64748b; margin-top: 2px; }
.bf-svc-status.ok { color: #22c55e; }
.bf-svc-status.bad { color: #ef4444; }
.bf-svc-arrow { color: #475569; font-size: 13px; flex-shrink: 0; }

/* ── Тикеты ──────────────────────────────────────────────── */
.tickets-list { display: flex; flex-direction: column; gap: 8px; }
.ticket-card {
    display: flex;
    align-items: center;
    gap: 14px;
    background: rgba(255,255,255,.02);
    border: 1px solid rgba(255,255,255,.06);
    border-radius: 10px;
    padding: 12px 16px;
    cursor: pointer;
    transition: border-color .2s ease;
}
.ticket-card:hover { border-color: rgba(0,212,255,.3); }
.ticket-id {
    font-size: 13px;
    font-weight: 600;
    color: #00d4ff;
    min-width: 60px;
}
.ticket-info { flex: 1; }
.ticket-subject { font-size: 13.5px; color: #e2e8f0; margin-bottom: 2px; }
.ticket-meta { font-size: 11.5px; color: #64748b; }
.ticket-status {
    font-size: 11px;
    padding: 3px 10px;
    border-radius: 20px;
    background: rgba(255,255,255,.05);
    color: #94a3b8;
    white-space: nowrap;
}
.ticket-status.open { background: rgba(234,179,8,.12); color: #eab308; }

/* ── Панели 3XUI ─────────────────────────────────────────── */
.bf-panel-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: #141a28;
    border: 1px solid rgba(255,255,255,.07);
    border-radius: 12px;
    padding: 18px;
    color: #e2e8f0;
    text-decoration: none !important;
    transition: border-color .2s ease, transform .2s ease;
    height: 100%;
}
.bf-panel-card:hover { border-color: rgba(0,212,255,.35); transform: translateY(-2px); color: #e2e8f0; }
.bf-panel-head { display: flex; align-items: center; gap: 10px; }
.bf-panel-flag { font-size: 22px; }
.bf-panel-name { font-weight: 600; font-size: 14px; flex: 1; }
.bf-panel-url { font-size: 11.5px; color: #64748b; word-break: break-all; }

/* ── Ссылки «Панели управления» ──────────────────────────── */
.link-card {
    display: flex;
    align-items: center;
    gap: 14px;
    background: #141a28;
    border: 1px solid rgba(255,255,255,.07);
    border-radius: 12px;
    padding: 16px 18px;
    color: #e2e8f0;
    text-decoration: none !important;
    transition: border-color .2s ease, transform .2s ease;
}
.link-card:hover { border-color: rgba(0,212,255,.35); transform: translateX(3px); color: #e2e8f0; }
.link-card i { font-size: 18px; color: #00d4ff; width: 24px; text-align: center; }
.link-card .link-name { font-size: 14px; font-weight: 500; }
.link-card .link-desc { font-size: 11px; color: #64748b; display: block; margin-top: 2px; }
.link-card .link-arrow { margin-left: auto; color: #475569; font-size: 12px; }

/* ── AI страница ─────────────────────────────────────────── */
.ai-grid { display: flex; flex-direction: column; gap: 16px; }
.ai-card {
    background: #141a28;
    border: 1px solid rgba(255,255,255,.07);
    border-radius: 12px;
    padding: 18px;
}
.ai-card-header {
    font-size: 14px;
    font-weight: 600;
    color: #e2e8f0;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.ai-card-header i { color: #00d4ff; }
.ai-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    font-size: 13px;
    border-bottom: 1px solid rgba(255,255,255,.04);
}
.ai-stat:last-child { border-bottom: none; }
.ai-label { color: #94a3b8; }
.ai-value { color: #e2e8f0; font-weight: 600; }

/* ── Каскад ──────────────────────────────────────────────── */
.cascade-header { margin-bottom: 14px; }
.cascade-header h2 { font-size: 17px; font-weight: 600; color: #e2e8f0; margin: 0 0 8px; }
.cascade-meta { display: flex; gap: 10px; flex-wrap: wrap; }
.cascade-badge {
    font-size: 11.5px;
    background: rgba(255,255,255,.05);
    border: 1px solid rgba(255,255,255,.08);
    color: #94a3b8;
    padding: 3px 10px;
    border-radius: 20px;
}
.cascade-badge-info { color: #00d4ff; }
.cascade-table-wrap {
    background: #141a28;
    border: 1px solid rgba(255,255,255,.07);
    border-radius: 12px;
    padding: 14px;
    overflow-x: auto;
}
.cascade-table-wrap table { width: 100%; border-collapse: collapse; }
.cascade-table-wrap th {
    text-align: left;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #64748b;
    padding: 8px 10px;
    border-bottom: 1px solid rgba(255,255,255,.08);
}
.cascade-table-wrap td {
    font-size: 13px;
    color: #cbd5e1;
    padding: 8px 10px;
    border-bottom: 1px solid rgba(255,255,255,.04);
}
.csc-email { color: #e2e8f0; font-weight: 500; }
.csc-p-badge {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 20px;
    background: rgba(255,255,255,.06);
    color: #94a3b8;
}
.csc-xf { background: rgba(0,212,255,.1); color: #00d4ff; }
.csc-fn02 { background: rgba(34,197,94,.1); color: #22c55e; }
.csc-uk { background: rgba(139,92,246,.12); color: #a78bfa; }
.cascade-refresh { margin-top: 14px; text-align: right; }

/* ── About ───────────────────────────────────────────────── */
.about-card {
    background: #141a28;
    border: 1px solid rgba(255,255,255,.07);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
}
.about-card h3 { font-size: 15px; font-weight: 600; color: #e2e8f0; margin: 0 0 10px; }
.about-card p { font-size: 13px; color: #94a3b8; line-height: 1.6; margin: 0; }
.about-badge {
    font-size: 11px;
    padding: 3px 10px;
    border-radius: 20px;
    background: rgba(255,255,255,.05);
    color: #94a3b8;
    display: inline-block;
    margin-right: 6px;
    margin-bottom: 6px;
}
.about-badge-green { background: rgba(34,197,94,.1); color: #22c55e; }
.about-badge-purple { background: rgba(139,92,246,.12); color: #a78bfa; }
.about-badge-cyan { background: rgba(0,212,255,.1); color: #00d4ff; }

/* ── Документация ────────────────────────────────────────── */
.doc-nav { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.doc-nav-item {
    font-size: 12px;
    padding: 6px 14px;
    border-radius: 20px;
    background: rgba(0,212,255,.08);
    color: #00d4ff;
    border: 1px solid rgba(0,212,255,.25);
    text-decoration: none;
    display: inline-block;
}
.doc-nav-item:hover { background: rgba(0,212,255,.15); color: #33dfff; }
.doc-section {
    background: #141a28;
    border: 1px solid rgba(255,255,255,.07);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
}
.doc-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.doc-head h3 { font-size: 16px; font-weight: 600; color: #e2e8f0; margin: 0; }
.doc-badge {
    font-size: 11px;
    padding: 3px 10px;
    border-radius: 20px;
    background: rgba(255,255,255,.05);
    color: #94a3b8;
    display: inline-block;
}
.doc-badge-green { background: rgba(34,197,94,.1); color: #22c55e; }
.doc-badge-cyan { background: rgba(0,212,255,.1); color: #00d4ff; }
.doc-block { margin-bottom: 16px; }
.doc-block:last-child { margin-bottom: 0; }
.doc-block h4 {
    font-size: 13px;
    font-weight: 600;
    color: #00d4ff;
    text-transform: uppercase;
    letter-spacing: .4px;
    margin: 0 0 8px;
}
.doc-block p { font-size: 13px; color: #94a3b8; line-height: 1.7; margin: 0 0 8px; }
.doc-list { margin: 0 0 0 18px; padding: 0; }
.doc-list li { font-size: 13px; color: #94a3b8; line-height: 1.7; margin-bottom: 5px; }
.doc-list code, .doc-block p code, .doc-table code {
    background: rgba(0,0,0,.35);
    color: #7dd3fc;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 12px;
}
.doc-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.doc-table td {
    padding: 7px 10px;
    border-bottom: 1px solid rgba(255,255,255,.06);
    color: #94a3b8;
    vertical-align: top;
}
.doc-table td:first-child { color: #cbd5e1; white-space: nowrap; font-weight: 500; width: 180px; }

/* ── Beszel iframe ───────────────────────────────────────── */
.bf-beszel-frame {
    width: 100%;
    height: calc(100vh - 180px);
    min-height: 500px;
    border: none;
    border-radius: 12px;
    background: #0a0e17;
}

/* ── Jellyfin diagnostic iframe ─────────────────────────── */
.bf-jfdiag-frame {
    width: 100%;
    height: calc(100vh - 180px);
    min-height: 500px;
    border: none;
    border-radius: 12px;
    background: #0a0e17;
}

/* ── Ошибки / загрузка ───────────────────────────────────── */
.error-msg {
    background: rgba(239,68,68,.1);
    border: 1px solid rgba(239,68,68,.25);
    color: #f87171;
    border-radius: 10px;
    padding: 14px 16px;
    font-size: 13px;
}
.bf-loading { color: #64748b; font-size: 13px; padding: 20px 0; text-align: center; }

/* ── Кнопки (базовые поверх WiseOwl) ─────────────────────── */
.bf-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(0,212,255,.1);
    border: 1px solid rgba(0,212,255,.3);
    color: #00d4ff;
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background .2s ease;
}
.bf-btn:hover { background: rgba(0,212,255,.18); color: #00d4ff; }

/* ── Переключение страниц (SPA) ──────────────────────────── */
.page { display: none; }
.page.active { display: block; }

/* ── Каскад: сводные карточки серверов (график загруженности) ── */
.cascade-servers {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}
.cascade-server-card {
    background: #141a28;
    border: 1px solid rgba(255,255,255,.07);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
}
.csc-icon {
    font-size: 24px;
    color: #00d4ff;
    margin-bottom: 6px;
}
.csc-name {
    font-size: 14px;
    color: #e2e8f0;
    font-weight: 600;
    margin-bottom: 8px;
}
.csc-count {
    font-size: 28px;
    font-weight: 700;
    color: #00d4ff;
}
.csc-bar {
    height: 5px;
    background: rgba(255,255,255,.07);
    border-radius: 3px;
    margin: 10px 0 6px;
    overflow: hidden;
}
.csc-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #00d4ff, #22c55e);
    border-radius: 3px;
    transition: width 0.5s ease;
}
.csc-pct {
    font-size: 12px;
    color: #64748b;
}

/* ── Музыка: поиск + Топ-30 ─────────────────────────────── */
.music-search-row { display: flex; gap: 10px; margin-bottom: 14px; }
.music-search-row .form-control { flex: 1; }
.music-results { max-height: 480px; overflow-y: auto; }
.music-search-note { font-size: .85rem; color: #8fa3b8; margin-bottom: 10px; }
.music-track {
    display: flex; align-items: center; gap: 12px;
    padding: 9px 12px; border-radius: 8px;
    background: rgba(255,255,255,.03); border: 1px solid rgba(255,255,255,.06);
    margin-bottom: 6px; transition: background .15s;
}
.music-track:hover { background: rgba(0,212,255,.06); }
.music-track-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.music-track-title { font-weight: 500; color: #e8f1f8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.music-track-artist { font-size: .82rem; color: #8fa3b8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.music-status { font-size: .8rem; color: #8fa3b8; max-width: 220px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bf-btn-sm { padding: 4px 12px; font-size: .8rem; white-space: nowrap; }
.top30-list { max-height: 560px; overflow-y: auto; padding: 10px; }
.top30-item { padding: 7px 10px; }
.top30-num { width: 26px; text-align: center; font-weight: 700; color: #00d4ff; flex-shrink: 0; }
.top30-art { width: 38px; height: 38px; border-radius: 6px; object-fit: cover; flex-shrink: 0; }

/* ── Музыка: предпрослушивание ──────────────────────────── */
.music-player { flex-basis: 100%; width: 100%; margin-top: 6px; }
.music-player audio { width: 100%; height: 36px; }
.music-player iframe { border-radius: 6px; }
.music-preview-note { font-size: .8rem; color: #8fa3b8; padding: 6px 0; }

/* ── Киоск-режим (APK для Наташи): только Музыка ────────── */
body.kiosk-mode .site-sidebar { display: none !important; }
body.kiosk-mode .content-wrapper { margin-left: 0 !important; }
body.kiosk-mode .main-wrapper { margin-left: 0 !important; }
body.kiosk-mode .page-title { margin-top: 12px; }
body.kiosk-mode .main-wrapper.kiosk-main { padding: 0 14px 40px; }

/* ── Мобильная версия: логотип-текст прячем, остаётся иконка ── */
@media (max-width: 960px) {
    .navbar-header .navbar-brand .bf-brand-text { display: none; }
}
