/* =========================================
   ХАБ + ПУНКТЫ МЕНЮ (DRAWER)
   Единый стиль проекта: токены из global.css
   ========================================= */

/* ТЕМНЫЙ ФОН ДЛЯ ХАБА */
.hub-bg {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: var(--bg); z-index: -1;
}

/* КОНТЕЙНЕР ХАБА */
.hub-container {
    max-width: 900px; margin: 0 auto; padding: 20px 20px 100px; color: var(--text);
}

/* --- ПРИВЕТСТВИЕ АВТОРИЗОВАННОГО --- */
.hub-welcome {
    display: flex; align-items: center; gap: 15px; margin-bottom: 30px;
}
.hub-avatar {
    width: 60px; height: 60px; border-radius: 50%; object-fit: cover;
    border: 2px solid var(--accent); flex-shrink: 0;
}
.hub-welcome-text { flex: 1; min-width: 0; }
.hub-welcome-label {
    font-family: 'PT Sans Narrow'; font-size: 0.7rem; color: var(--accent);
    letter-spacing: 2px; text-transform: uppercase;
}
.hub-welcome-name {
    font-family: 'PT Sans'; font-weight: 900; font-size: 1rem;
    color: var(--text); text-transform: uppercase; margin: 2px 0 0;
}

/* Кнопка чата в хабе (.chat-badge-btn — маркер для JS, .hub-chat-btn — визуал) */
.chat-badge-btn.hub-chat-btn {
    flex-shrink: 0; display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    width: 56px; height: 56px; border-radius: 50%;
    background: var(--surface); border: 1px solid var(--border);
    text-decoration: none; transition: 0.2s; position: relative;
}
.chat-badge-btn.hub-chat-btn:hover { background: var(--surface-hover); }
.chat-badge-btn.hub-chat-btn .cb-icon { font-size: 1.3rem; line-height: 1; }
.chat-badge-btn.hub-chat-btn .cb-label {
    font-family: 'PT Sans Narrow'; font-size: 0.5rem; color: var(--text-muted);
    letter-spacing: 1px; text-transform: uppercase; margin-top: 2px;
}

/* nav-card с бейджем чата в drawer */
.nav-card.chat-badge-btn { position: relative; }

/* --- СЕКЦИОННЫЕ ЛАЙБЛЫ --- */
.hub-section-label {
    font-family: 'PT Sans Narrow'; font-size: 0.8rem; color: var(--accent);
    letter-spacing: 2px; text-transform: uppercase; margin: 30px 0 15px;
}
.hub-section-label.gold { color: var(--gold); }
.hub-section-label.no-mt { margin-top: 0; }

/* --- ОРГ-ДАШБОРД --- */
.hub-org-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px; margin-bottom: 30px;
}
.hub-org-card {
    background: var(--surface); border: 1px solid var(--border-light);
    border-left: 4px solid var(--accent); border-radius: 0 var(--radius-md) var(--radius-md) 0;
    padding: 18px 20px; text-decoration: none; transition: 0.2s;
}
.hub-org-card:hover { background: var(--surface-hover); }
.hub-org-card.border-blue { border-left-color: var(--blue); }
.hub-org-card.border-green { border-left-color: var(--green); }
.hub-org-card.border-gold { border-left-color: var(--gold); }
.hub-org-card-head {
    display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px;
}
.hub-org-card-title {
    font-family: 'PT Sans'; font-size: 0.9rem; color: var(--text); font-weight: bold;
}
.hub-org-card-title.block { display: block; margin-bottom: 8px; }
.hub-org-card-desc {
    font-family: 'PT Sans Narrow'; font-size: 0.7rem; color: var(--text-muted);
    margin: 0; text-transform: uppercase;
}

/* Бейдж непрочитанных заявок */
.apps-unread-badge {
    background: var(--accent); color: #fff; font-family: 'PT Sans'; font-weight: 900;
    font-size: 0.7rem; width: 22px; height: 22px; display: flex;
    align-items: center; justify-content: center; border-radius: 50%;
    box-shadow: 0 0 12px var(--accent-glow);
}
.apps-unread-badge[hidden] { display: none; }

/* Бейдж в шапке аккордеона (drawer) */
.apps-unread-badge.drawer-badge {
    position: absolute; top: 50%; right: 46px; transform: translateY(-50%);
    font-size: 0.65rem; min-width: 18px; height: 18px; padding: 0 5px;
    border-radius: 999px; z-index: 10; border: 1px solid var(--border);
}
.apps-unread-badge.drawer-badge[hidden] { display: none; }

/* --- СЕТКА СТАТИСТИКИ --- */
.hud-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 30px;
}
@media (min-width: 600px) {
    .hud-stats { grid-template-columns: repeat(3, 1fr); }
}

.stat-item {
    padding: 15px 10px;
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-md);
    text-align: center;
    backdrop-filter: blur(10px);
}
.stat-val { font-family: 'PT Sans'; font-size: 1.3rem; font-weight: 900; color: var(--text); display: block; }
.stat-val-green { color: var(--green); }
.stat-label { font-family: 'PT Sans Narrow'; font-size: 0.65rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; }

/* --- ГОТОВНОСТЬ ПРОФИЛЯ --- */
.profile-progress-card {
    background: var(--surface); border: 1px solid var(--border-light);
    border-left: 4px solid var(--accent); border-radius: 0 var(--radius-md) var(--radius-md) 0;
    padding: 18px 20px; margin-bottom: 30px;
}
.profile-progress-head {
    display: flex; justify-content: space-between; align-items: flex-start;
    gap: 12px; margin-bottom: 14px;
}
.profile-progress-text { flex: 1; min-width: 0; }
.profile-progress-title {
    font-family: 'PT Sans'; font-size: 0.9rem; color: var(--text); font-weight: bold;
    display: block; margin-bottom: 4px;
}
.profile-progress-desc {
    font-family: 'PT Sans Narrow'; font-size: 0.7rem; color: var(--text-muted);
    margin: 0; text-transform: uppercase;
}
.profile-progress-cta {
    flex-shrink: 0; font-family: 'PT Sans Narrow'; font-weight: bold; font-size: 0.75rem;
    text-transform: uppercase; letter-spacing: 1px; color: var(--accent);
    text-decoration: none; padding: 8px 14px; border: 1px solid var(--accent);
    border-radius: var(--radius-sm); transition: 0.2s; white-space: nowrap;
}
.profile-progress-cta:hover { background: var(--accent); color: #fff; }
.profile-ready {
    font-family: 'PT Sans'; font-weight: 900; font-size: 1.1rem;
    color: var(--green); flex-shrink: 0; white-space: nowrap;
}
.profile-progress-bar {
    height: 8px; background: var(--border-light);
    border-radius: var(--radius-sm); overflow: hidden;
}
.profile-progress-fill {
    height: 100%; background: linear-gradient(90deg, var(--accent), var(--gold));
    border-radius: var(--radius-sm); transition: width 0.4s ease;
}

/* --- ПОСЛЕДНЯЯ АКТИВНОСТЬ --- */
.recent-mini-list {
    background: var(--surface); border: 1px solid var(--border-light);
    border-radius: var(--radius-md); padding: 6px 16px; margin-bottom: 30px;
}
.recent-mini-item {
    display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center;
    padding: 12px 4px; border-bottom: 1px solid var(--border-light);
    text-decoration: none; transition: 0.15s;
}
.recent-mini-item:last-child { border-bottom: none; }
.recent-mini-item:hover { background: var(--surface-hover); padding-left: 12px; padding-right: 12px; }
.rm-status {
    font-family: 'PT Sans Narrow'; font-weight: bold; font-size: 0.6rem;
    text-transform: uppercase; letter-spacing: 1px;
    padding: 4px 8px; border-radius: var(--radius-sm); white-space: nowrap;
}
.rm-status.rm-sold  { color: var(--green); background: rgba(0,255,136,0.12); }
.rm-status.rm-order { color: var(--gold);  background: rgba(255,200,0,0.12); }
.rm-status.rm-nfs   { color: var(--text-muted); background: var(--border-light); }
.rm-status.rm-avail { color: var(--text); background: var(--border-light); }
.rm-title {
    font-family: 'PT Sans'; font-size: 0.85rem; color: var(--text); font-weight: bold;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0;
}
.rm-meta {
    font-family: 'PT Sans Narrow'; font-size: 0.7rem; color: var(--text-muted);
    text-transform: uppercase; white-space: nowrap;
}
@media (max-width: 600px) {
    .recent-mini-item { grid-template-columns: 1fr; gap: 4px; padding: 12px 8px; }
    .rm-title { white-space: normal; }
    .rm-meta { font-size: 0.65rem; }
    .profile-progress-cta { padding: 6px 10px; font-size: 0.7rem; }
}

/* --- РЕФЕРАЛЬНАЯ ПРОГРАММА --- */
.ref-card {
    background: var(--surface); border: 1px solid var(--border-light);
    border-left: 4px solid var(--gold); border-radius: 0 var(--radius-md) var(--radius-md) 0;
    padding: 18px 20px; margin-bottom: 12px;
}
.ref-card-head {
    display: flex; justify-content: space-between; align-items: flex-start;
    gap: 12px; margin-bottom: 14px;
}
.ref-card-head-text { flex: 1; min-width: 0; }
.ref-card-title {
    font-family: 'PT Sans'; font-size: 0.9rem; color: var(--text); font-weight: bold;
    display: block; margin-bottom: 4px;
}
.ref-card-desc {
    font-family: 'PT Sans Narrow'; font-size: 0.7rem; color: var(--text-muted);
    margin: 0; text-transform: uppercase;
}
.ref-card-count {
    font-family: 'PT Sans'; font-weight: 900; font-size: 1.4rem;
    color: var(--gold); line-height: 1; flex-shrink: 0;
}

.ref-input-row { display: flex; gap: 8px; align-items: stretch; }
.ref-link-input {
    flex: 1; min-width: 0; background: var(--bg); border: 1px solid var(--border);
    border-radius: var(--radius-sm); padding: 10px 12px; color: var(--text-muted);
    font-family: 'PT Sans Narrow'; font-size: 0.8rem; outline: none;
}
.ref-link-input:focus { border-color: var(--gold); }
.ref-copy-btn {
    flex-shrink: 0; background: var(--gold); color: var(--bg); border: none;
    border-radius: var(--radius-sm); padding: 0 18px;
    font-family: 'PT Sans'; font-weight: 900; font-size: 0.8rem;
    text-transform: uppercase; cursor: pointer; transition: 0.2s;
}
.ref-copy-btn:hover { opacity: 0.85; }

.ref-stats-row { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.ref-pill {
    font-family: 'PT Sans Narrow'; font-size: 0.7rem; color: var(--text-muted);
    text-transform: uppercase; padding: 6px 10px;
    background: var(--border-light); border-radius: var(--radius-sm);
}
.ref-pill b { color: var(--text); }
.ref-pill b.green { color: var(--green); }
.ref-pill b.red { color: var(--accent); }

/* Список рефералов */
.ref-list {
    background: var(--surface); border: 1px solid var(--border-light);
    border-radius: var(--radius-md); padding: 6px 20px; margin-bottom: 30px;
}
.ref-list-item {
    display: flex; justify-content: space-between; align-items: center;
    gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border-light);
}
.ref-list-item:last-child { border-bottom: none; }
.ref-list-info { flex: 1; min-width: 0; }
.ref-list-name { font-family: 'PT Sans'; font-size: 0.85rem; color: var(--text); }
.ref-list-date {
    font-family: 'PT Sans Narrow'; font-size: 0.65rem; color: var(--text-muted);
    text-transform: uppercase; margin-top: 2px;
}
.ref-list-status {
    font-family: 'PT Sans Narrow'; font-weight: bold; font-size: 0.65rem;
    text-transform: uppercase; letter-spacing: 1px; flex-shrink: 0;
}
.ref-list-status.approved { color: var(--green); }
.ref-list-status.rejected { color: var(--accent); }
.ref-list-status.pending { color: var(--text-muted); }

/* Пустое состояние рефералов */
.ref-empty {
    background: var(--surface); border: 1px dashed var(--border);
    border-radius: var(--radius-md); padding: 20px; margin-bottom: 30px; text-align: center;
}
.ref-empty p {
    font-family: 'PT Serif'; font-size: 0.85rem; color: var(--text-muted);
    margin: 0; line-height: 1.5;
}

/* --- ПРОМО ДЛЯ ГОСТЕЙ --- */
.hub-promo { text-align: center; padding: 0 0 20px; }
.hub-promo-logo {
    width: 120px; filter: drop-shadow(0 0 20px var(--accent-glow)); margin-bottom: 20px;
}
.hub-promo-title {
    font-family: 'PT Sans'; font-weight: 900; font-size: 1rem;
    letter-spacing: 2px; text-transform: uppercase; color: var(--text); margin-bottom: 10px;
}
.hub-promo-tagline {
    font-family: 'PT Sans Narrow'; font-size: 0.9rem; letter-spacing: 3px;
    text-transform: uppercase; color: var(--accent);
}

.hub-intro-card {
    background: var(--surface); border: 1px solid var(--border-light);
    border-left: 4px solid var(--accent); border-radius: 0 var(--radius-md) var(--radius-md) 0;
    padding: 25px 30px; margin-bottom: 30px; backdrop-filter: blur(10px);
}
.hub-intro-text {
    font-family: 'PT Serif'; font-size: 1.05rem; line-height: 1.6;
    color: var(--text-muted); margin: 0;
}

/* Локации для гостей */
.hub-loc-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px; margin-bottom: 30px;
}
.hub-loc-card {
    background: var(--surface); border: 1px solid var(--border-light);
    border-radius: var(--radius-md); padding: 18px;
}
.hub-loc-name {
    font-family: 'PT Sans'; font-size: 1rem; color: var(--text); font-weight: bold;
    display: block; margin-bottom: 6px;
}
.hub-loc-addr {
    font-family: 'PT Sans Narrow'; font-size: 0.8rem; color: var(--text-muted);
    margin: 0; line-height: 1.5;
}

/* Орг-состав для гостей */
.hub-team-grid {
    display: grid; grid-template-columns: 1fr; gap: 12px; margin-bottom: 30px;
}
@media (min-width: 600px) { .hub-team-grid { grid-template-columns: repeat(2, 1fr); } }
.hub-team-card {
    display: flex; gap: 14px; align-items: flex-start;
    background: var(--surface); border: 1px solid var(--border-light);
    border-left: 4px solid var(--accent);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    padding: 16px 18px; transition: 0.2s;
}
.hub-team-card:hover { background: var(--surface-hover); }
.hub-team-avatar-link { flex-shrink: 0; }
.hub-team-avatar {
    width: 64px; height: 64px; border-radius: 50%; object-fit: cover;
    border: 2px solid var(--accent); flex-shrink: 0;
}
.hub-team-info { flex: 1; min-width: 0; }
.hub-team-name {
    font-family: 'PT Sans'; font-size: 0.95rem; font-weight: 900; color: var(--text);
    text-transform: uppercase; text-decoration: none; display: block; line-height: 1.2;
}
.hub-team-name:hover { color: var(--accent); }
.hub-team-title {
    font-family: 'PT Sans Narrow'; font-size: 0.7rem; color: var(--accent);
    letter-spacing: 1px; text-transform: uppercase; margin-top: 4px;
    line-height: 1.4; overflow-wrap: break-word; word-break: break-word;
}
.hub-team-desc {
    font-family: 'PT Serif'; font-size: 0.85rem; color: var(--text-muted);
    margin: 8px 0 0; line-height: 1.5;
}

/* Контакты */
.hub-contact-card {
    background: var(--surface); border: 1px solid var(--border-light);
    border-radius: var(--radius-md); padding: 20px 25px; margin-bottom: 30px;
}
.hub-contact-phone {
    font-family: 'PT Sans'; font-weight: 900; font-size: 1.3rem;
    color: var(--text); text-decoration: none; display: block; margin-bottom: 5px;
}
.hub-contact-desc {
    font-family: 'PT Serif'; font-size: 0.9rem; color: var(--text-muted);
    margin: 0 0 15px;
}
.hub-contact-social { display: flex; gap: 10px; flex-wrap: wrap; }
.hub-social-btn {
    font-family: 'PT Sans Narrow'; font-weight: bold; font-size: 0.75rem;
    text-transform: uppercase; text-decoration: none; color: var(--accent);
    border: 1px solid var(--accent); padding: 6px 14px;
    border-radius: var(--radius-sm); transition: 0.2s;
}
.hub-social-btn:hover { background: var(--accent); color: #fff; }

/* CTA для гостей */
.hub-cta { text-align: center; padding: 10px 0; }
.hub-cta-text {
    font-family: 'PT Serif'; font-size: 1rem; color: var(--text-muted); margin-bottom: 25px;
}
.hub-cta-buttons { display: flex; flex-direction: column; gap: 12px; max-width: 400px; margin: 0 auto; }
.hub-cta-btn { padding: 16px; font-size: 0.9rem; }
.hub-cta-outline {
    padding: 16px; font-size: 0.9rem; background: transparent;
    border: 2px solid var(--accent); color: var(--accent); box-shadow: none;
}
.hub-cta-link {
    font-family: 'PT Sans Narrow'; font-size: 0.8rem; text-transform: uppercase;
    letter-spacing: 1px; color: var(--text-muted); text-decoration: none; padding: 10px;
}
.hub-cta-link:hover { color: var(--accent); }

/* Футер хаба */
.hub-footer {
    text-align: center; padding: 15px 0 5px; color: var(--text-muted);
    font-family: 'PT Sans Narrow'; font-size: 0.7rem;
    text-transform: uppercase; letter-spacing: 2px;
}

/* --- СЕТКА МЕНЮ (DRAWER) --- */
.menu-grid { display: flex; flex-direction: column; gap: 15px; }
.section-label { font-family: 'PT Sans Narrow'; font-size: 0.8rem; color: var(--accent); letter-spacing: 2px; margin-top: 20px; }

.nav-card {
    display: flex; align-items: center;
    background: var(--surface);
    border-left: 4px solid var(--accent);
    padding: 15px 20px; text-decoration: none; color: var(--text);
    transition: 0.2s; border-radius: 0 var(--radius-md) var(--radius-md) 0;
}
.nav-card:hover { background: var(--surface-hover); transform: translateX(5px); }
.nav-card.border-accent { border-left-color: var(--accent); }
.nav-card.border-blue { border-left-color: var(--blue); }
.nav-card.border-green { border-left-color: var(--green); }
.nav-card.border-gold { border-left-color: var(--gold); }
.nav-card.border-neon { border-left-color: var(--blue-neon); }
.nav-card.muted { color: var(--text-muted); }
.nav-card.gold-text h3 { color: var(--gold); }

/* Цветные заголовки секций */
.ms-title.gold { color: var(--gold); }
.ms-title.blue { color: var(--blue); }
.nav-card .icon { font-size: 1.8rem; margin-right: 20px; }
.nav-card .info { flex: 1; min-width: 0; }
.nav-card h3 { font-family: 'PT Sans'; font-size: 1rem; font-weight: 900; margin-bottom: 3px; }
.nav-card p { font-family: 'PT Serif'; font-size: 0.85rem; color: var(--text-muted); }

/* --- АККОРДЕОН МЕНЮ --- */
.menu-section {
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: 10px;
    backdrop-filter: blur(10px);
}
.menu-section-head {
    display: flex; align-items: center; gap: 12px;
    padding: 14px 18px; cursor: pointer; user-select: none;
    background: var(--surface-hover);
    transition: background 0.2s;
}
.menu-section-head:hover { background: var(--surface-border); }
.menu-section-head.is-relative { position: relative; }
.menu-section-head .ms-icon { font-size: 1.3rem; flex-shrink: 0; line-height: 1; }
.menu-section-head .ms-title {
    flex: 1; font-family: 'PT Sans Narrow'; font-size: 0.8rem;
    letter-spacing: 2px; text-transform: uppercase; color: var(--accent);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.menu-section-head .ms-count {
    font-family: 'PT Sans'; font-size: 0.6rem; color: var(--text-muted);
    background: var(--surface); padding: 2px 8px; border-radius: 999px;
    flex-shrink: 0;
}
.menu-section-head .ms-arrow { transition: transform 0.3s; color: var(--text-muted); font-size: 0.9rem; flex-shrink: 0; }
.menu-section.open .ms-arrow { transform: rotate(180deg); }

.menu-section-body {
    max-height: 0; overflow: hidden;
    transition: max-height 0.35s ease-out;
    padding: 0 8px;
}
.menu-section.open .menu-section-body { max-height: 2500px; padding: 8px; }
.menu-section-body .nav-card { margin-bottom: 8px; border-radius: var(--radius-md); }
.menu-section-body .nav-card:last-child { margin-bottom: 0; }

/* Кнопка доп. действия внутри карточки (для орга) */
.nav-card-with-sub { position: relative; }
.nav-sub-btn {
    flex-shrink: 0; display: flex; align-items: center; justify-content: center;
    width: 34px; height: 34px; border-radius: var(--radius-sm);
    background: var(--surface-hover); color: var(--text-muted);
    font-size: 1rem; text-decoration: none; transition: 0.2s;
    margin-left: 8px;
}
.nav-sub-btn:hover { background: var(--accent); color: #fff; }
