/* ============================================================
   Геймификация Буккросинга — полный CSS v2
   XP-бар, квесты, профили, лайки, вишлист, питомец,
   уведомления, каталог читателей, расширенная админка,
   мобильный бургер, top-bar spinner, support, bottom nav,
   автодополнение поиска
   ============================================================ */

/* ============================================================
   1. XP-бар в топнавигации
   ============================================================ */
.xp-bar {
    display: flex; align-items: center; gap: 8px;
    padding: 4px 12px; border-radius: 999px;
    background: var(--gray-100);
    font-size: 0.82rem; font-weight: 700;
}
.xp-level { color: var(--accent); white-space: nowrap; }
.xp-progress { width: 80px; height: 6px; background: var(--gray-200); border-radius: 3px; overflow: hidden; }
.xp-fill { height: 100%; background: var(--gradient-accent); transition: width 0.5s ease; }
.xp-text { color: var(--text-secondary); font-weight: 600; }
.xp-streak { color: #ef4444; font-weight: 800; }
@media (max-width: 768px) { .xp-progress { width: 50px; } .xp-text { display: none; } }

/* ============================================================
   2. Цитата дня
   ============================================================ */
.quote-of-day {
    display: flex; align-items: flex-start; gap: 16px;
    background: var(--card-bg); border-left: 4px solid var(--accent);
    padding: 20px 24px; border-radius: var(--radius-xl);
    margin-bottom: 24px; box-shadow: var(--shadow-md);
}
.quote-icon { font-size: 2rem; line-height: 1; }
.quote-body p { font-style: italic; color: var(--text-primary); margin-bottom: 6px; font-size: 1.02rem; }
.quote-body span { color: var(--text-secondary); font-size: 0.9rem; }

/* ============================================================
   3. Пилки действий
   ============================================================ */
.hero-actions {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 14px; margin-bottom: 32px;
}
.action-pill {
    display: flex; align-items: center; gap: 14px; text-align: left;
    background: var(--card-bg); border: 1px solid var(--border-light);
    padding: 16px 20px; border-radius: var(--radius-xl); cursor: pointer;
    transition: all var(--transition-normal); font: inherit; color: inherit;
    box-shadow: var(--shadow-sm);
}
.action-pill:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--accent); }
.action-pill-icon { font-size: 1.8rem; }
.action-pill strong { color: var(--text-primary); font-size: 0.98rem; }
.action-pill small { color: var(--text-secondary); font-size: 0.82rem; }
.action-lucky { background: linear-gradient(135deg, rgba(232,168,56,.12), rgba(232,168,56,.05)); border-color: var(--accent); }

/* ============================================================
   4. Квесты
   ============================================================ */
.quest-item {
    display: flex; align-items: center; gap: 14px; padding: 14px 0;
    border-bottom: 1px solid var(--border-light);
}
.quest-item.done { opacity: 0.7; }
.quest-icon { font-size: 1.6rem; width: 40px; text-align: center; }
.quest-body { flex: 1; }
.quest-body strong { display: block; margin-bottom: 6px; }
.quest-progress { display: flex; align-items: center; gap: 10px; font-size: 0.8rem; color: var(--text-secondary); }
.quest-bar { flex: 1; height: 6px; background: var(--gray-200); border-radius: 3px; overflow: hidden; }
.quest-fill { height: 100%; background: var(--gradient-success); transition: width 0.4s; }
.quest-check { color: var(--success); font-size: 1.5rem; }

/* ============================================================
   5. Профиль
   ============================================================ */
.profile-head { display: flex; gap: 20px; align-items: center; margin-bottom: 16px; }
.profile-avatar {
    width: 72px; height: 72px; border-radius: 50%;
    background: var(--gradient-primary); display: flex; align-items: center; justify-content: center;
    font-size: 2.4rem; box-shadow: var(--shadow-md);
}
.profile-avatar-mini {
    width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0;
    background: var(--gray-100); display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem; cursor: pointer;
}
.profile-info h3 { margin-bottom: 2px; }
.profile-class { color: var(--text-secondary); font-size: 0.88rem; }
.profile-level { color: var(--accent); font-weight: 700; margin-top: 6px; font-size: 0.9rem; }
.profile-xp { color: var(--text-secondary); font-size: 0.85rem; }
.profile-stats {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px;
    padding: 16px 0; border-top: 1px solid var(--border-light); margin-top: 16px;
}
.pstat { text-align: center; }
.pstat-num { font-size: 1.5rem; font-weight: 800; color: var(--primary); }
.pstat-lbl { font-size: 0.75rem; color: var(--text-secondary); }
.profile-social {
    display: flex; gap: 10px; margin-top: 6px;
    font-size: 0.85rem; color: var(--text-secondary); font-weight: 600;
}
.profile-social span { background: var(--gray-100); padding: 3px 10px; border-radius: 12px; }

/* ============================================================
   6. Пикер аватарок
   ============================================================ */
.avatar-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 8px; }
.avatar-btn {
    aspect-ratio: 1; font-size: 1.6rem; background: var(--gray-50);
    border: 2px solid transparent; border-radius: 12px; cursor: pointer;
    transition: all var(--transition-fast);
}
.avatar-btn:hover { border-color: var(--accent); transform: scale(1.1); background: rgba(232,168,56,.1); }

/* ============================================================
   7. Лайки и комментарии к отзывам
   ============================================================ */
.review-actions { display: flex; gap: 10px; margin-top: 8px; }
.review-action {
    background: transparent; border: 1px solid var(--border-light);
    padding: 5px 12px; border-radius: 999px; cursor: pointer;
    color: var(--text-secondary); font-size: 0.85rem; font-weight: 600;
    transition: all var(--transition-fast);
    display: inline-flex; align-items: center; gap: 6px;
}
.review-action:hover { border-color: var(--accent); color: var(--accent); }
.review-action.active { background: rgba(239,68,68,.1); color: #ef4444; border-color: #ef4444; }
.review-action.active i { color: #ef4444; }

.comment-item { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border-light); }
.comment-item:last-child { border-bottom: none; }
.comment-item strong { font-size: 0.9rem; }
.comment-item p { font-size: 0.9rem; margin: 4px 0; }

/* ============================================================
   8. Вишлист
   ============================================================ */
.wishlist-item {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 0; border-bottom: 1px solid var(--border-light);
}

/* ============================================================
   9. Лента
   ============================================================ */
.feed-item {
    display: flex; gap: 12px; padding: 12px 0;
    border-bottom: 1px solid var(--border-light);
    cursor: pointer; transition: background var(--transition-fast);
}
.feed-item:hover { background: var(--gray-50); border-radius: 8px; padding-left: 8px; }
.feed-item strong { font-size: 0.92rem; }
.feed-item p { font-size: 0.9rem; margin: 3px 0; color: var(--text-secondary); }
.feed-item small { color: var(--text-secondary); font-size: 0.78rem; }

/* ============================================================
   10. Питомец
   ============================================================ */
.pet-stage {
    display: flex; gap: 20px; align-items: center;
    background: linear-gradient(135deg, rgba(232,168,56,.10), rgba(232,168,56,.03));
    padding: 20px; border-radius: var(--radius-xl);
    border: 1px solid rgba(232,168,56,.3);
}
.pet-icon { font-size: 4rem; line-height: 1; animation: petBob 3s ease-in-out infinite; }
@keyframes petBob {
    0%, 100% { transform: translateY(0) rotate(-3deg); }
    50% { transform: translateY(-6px) rotate(3deg); }
}
.pet-info h3 { margin: 0 0 4px; }
.pet-progress { margin: 16px 0; }
.pet-bar { height: 10px; background: var(--gray-200); border-radius: 5px; overflow: hidden; margin-bottom: 6px; }
.pet-fill { height: 100%; background: var(--gradient-accent); transition: width 0.6s ease; }
.pet-progress-text { font-size: 0.85rem; color: var(--text-secondary); }
.pet-stats { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; margin-top: 8px; }
.pet-stat { text-align: center; padding: 12px 8px; background: var(--gray-50); border-radius: 12px; }
.pet-stat-num { font-size: 1.4rem; font-weight: 800; color: var(--primary); }
.pet-stat-lbl { font-size: 0.72rem; color: var(--text-secondary); margin-top: 2px; }

/* ============================================================
   11. Уведомления (колокольчик)
   ============================================================ */
.notif-bell {
    position: relative;
    background: transparent;
    border: none;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 1.15rem;
    transition: all var(--transition-fast);
}
.notif-bell:hover { background: var(--gray-100); color: var(--primary); }
.notif-bell.has-unread { color: var(--accent); }

.notif-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: #ef4444;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 800;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.5);
    pointer-events: none;
}

@keyframes bellPulse {
    0%, 100% { transform: rotate(0); }
    20% { transform: rotate(-12deg) scale(1.1); }
    40% { transform: rotate(12deg) scale(1.1); }
    60% { transform: rotate(-8deg) scale(1.05); }
    80% { transform: rotate(8deg) scale(1.05); }
}
.notif-bell.pulse { animation: bellPulse 0.9s ease; }

.notif-panel {
    position: fixed;
    top: 76px;
    right: 20px;
    width: 380px;
    max-width: calc(100vw - 24px);
    max-height: 70vh;
    background: var(--card-bg-solid);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-2xl);
    border: 1px solid var(--border-light);
    z-index: 5000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: notifPanelIn 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes notifPanelIn {
    from { opacity: 0; transform: translateY(-8px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.notif-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-light);
    background: var(--gray-50);
}
.notif-panel-header strong { font-weight: 800; color: var(--text-primary); }
.notif-panel-actions { display: flex; gap: 4px; }
.notif-panel-btn {
    background: transparent;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 1rem;
    transition: all var(--transition-fast);
}
.notif-panel-btn:hover { background: var(--gray-200); color: var(--primary); }

.notif-panel-body {
    overflow-y: auto;
    max-height: 60vh;
}

.notif-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.8;
}

.notif-item {
    display: flex;
    gap: 12px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-light);
    cursor: pointer;
    transition: background var(--transition-fast);
    position: relative;
}
.notif-item:hover { background: var(--gray-50); }
.notif-item.unread { background: rgba(232, 168, 56, 0.06); }
.notif-item.unread:hover { background: rgba(232, 168, 56, 0.1); }
.notif-item:last-child { border-bottom: none; }

.notif-item-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}
.notif-item.unread .notif-item-icon { background: rgba(232, 168, 56, 0.15); }

.notif-item-body { flex: 1; min-width: 0; }
.notif-item-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 3px;
    line-height: 1.35;
    word-break: break-word;
}
.notif-item-text {
    font-size: 0.83rem;
    color: var(--text-secondary);
    line-height: 1.45;
    margin-bottom: 4px;
    word-break: break-word;
}
.notif-item-time { font-size: 0.75rem; color: var(--gray-400); }

.notif-item-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    flex-shrink: 0;
    align-self: center;
    box-shadow: 0 0 0 3px rgba(232, 168, 56, 0.2);
}

.notif-item-del {
    position: absolute;
    top: 8px;
    right: 8px;
    background: transparent;
    border: none;
    color: var(--gray-400);
    cursor: pointer;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    opacity: 0;
    transition: all var(--transition-fast);
}
.notif-item:hover .notif-item-del { opacity: 1; }
.notif-item-del:hover { background: rgba(239, 68, 68, 0.1); color: #ef4444; }

@media (max-width: 640px) {
    .notif-panel {
        top: 68px;
        right: 12px;
        left: 12px;
        width: auto;
    }
}

/* ============================================================
   12. Каталог читателей
   ============================================================ */
.readers-count {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 14px;
    font-weight: 600;
}

.readers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
}

.readers-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}
.readers-empty-icon { font-size: 3.5rem; margin-bottom: 12px; }
.readers-empty p { max-width: 380px; margin: 0 auto; line-height: 1.6; }

.reader-card {
    background: var(--card-bg);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xl);
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: transform var(--transition-normal), box-shadow var(--transition-normal), border-color var(--transition-normal);
    position: relative;
    overflow: hidden;
}
.reader-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity var(--transition-normal);
}
.reader-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--accent);
}
.reader-card:hover::before { opacity: 1; }
.reader-card.is-followed {
    border-color: var(--success);
    background: linear-gradient(180deg, rgba(45, 143, 111, 0.04), transparent 40%);
}
.reader-card.is-followed::before {
    background: var(--gradient-success);
    opacity: 1;
}

.reader-card-head {
    display: flex;
    gap: 14px;
    align-items: center;
    cursor: pointer;
}

.reader-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    flex-shrink: 0;
    box-shadow: var(--shadow-md);
}

.reader-info { min-width: 0; flex: 1; }
.reader-name {
    font-weight: 800;
    font-size: 1rem;
    color: var(--text-primary);
    line-height: 1.2;
    margin-bottom: 2px;
    word-break: break-word;
}
.reader-class {
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin-bottom: 2px;
}
.reader-level {
    font-size: 0.8rem;
    color: var(--accent);
    font-weight: 700;
}

.reader-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 0.78rem;
    font-weight: 600;
}
.reader-meta span {
    background: var(--gray-100);
    padding: 4px 9px;
    border-radius: 20px;
    color: var(--text-secondary);
}

.reader-bio {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.reader-followed-at {
    font-size: 0.75rem;
    color: var(--gray-400);
    font-style: italic;
}

.reader-actions { margin-top: auto; }

@media (max-width: 640px) {
    .readers-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   13. Расширенная админка
   ============================================================ */
.admin-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    background: var(--gray-100);
    border-radius: var(--radius-lg);
    padding: 5px;
    margin-bottom: 24px;
}
.admin-tab {
    flex: 1;
    min-width: 110px;
    padding: 10px 14px;
    background: none;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
    white-space: nowrap;
}
.admin-tab:hover { background: var(--gray-200); color: var(--text-primary); }
.admin-tab.active {
    background: var(--gradient-primary);
    color: #fff;
    box-shadow: var(--shadow-md);
}

.admin-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 16px;
    align-items: center;
}
.admin-toolbar .search-input-wrap { min-width: 200px; }

.admin-users-table { display: flex; flex-direction: column; gap: 6px; }
.admin-user-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: var(--card-bg);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    transition: all var(--transition-fast);
    flex-wrap: wrap;
}
.admin-user-row:hover { border-color: var(--accent); box-shadow: var(--shadow-sm); }
.admin-user-avatar {
    width: 42px; height: 42px; border-radius: 50%;
    background: var(--gray-100);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.4rem; flex-shrink: 0;
}
.admin-user-info { flex: 1; min-width: 0; }
.admin-user-name {
    font-weight: 700; font-size: 0.95rem;
    color: var(--text-primary);
    display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
    margin-bottom: 4px;
}
.admin-user-meta {
    display: flex; flex-wrap: wrap; gap: 10px;
    font-size: 0.8rem; color: var(--text-secondary);
}
.admin-user-actions { display: flex; gap: 4px; flex-wrap: wrap; }
.admin-user-actions .btn { min-width: 34px; padding: 6px 8px; }

.admin-badge-inline {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.4;
}
.admin-badge-inline.admin { background: var(--gradient-accent); color: var(--primary-dark); }
.admin-badge-inline.banned { background: rgba(220, 38, 38, 0.15); color: #dc2626; }
.admin-badge-inline.muted { background: rgba(217, 119, 6, 0.15); color: #d97706; }
.admin-badge-inline.warn { background: rgba(245, 158, 11, 0.15); color: #b45309; }

.admin-search-bar { margin-bottom: 12px; }
.admin-search-bar input {
    width: 100%; padding: 12px 14px;
    border: 2px solid var(--border-light);
    border-radius: var(--radius-lg);
    background: var(--card-bg-solid);
    color: var(--text-primary);
}
.admin-books-list { display: flex; flex-direction: column; gap: 6px; }
.admin-book-row {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 14px; background: var(--card-bg);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    flex-wrap: wrap;
}
.admin-book-cover {
    width: 38px; height: 50px; border-radius: 6px;
    background: var(--gradient-primary);
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-weight: 800; font-size: 1.2rem;
    flex-shrink: 0;
}

.admin-levels-help {
    background: var(--gray-50);
    padding: 12px 16px;
    border-radius: var(--radius-lg);
    margin-bottom: 16px;
    border-left: 3px solid var(--accent);
}
.admin-levels-help p { color: var(--text-secondary); font-size: 0.9rem; margin: 0; }
.admin-levels-table { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.admin-level-row {
    display: grid;
    grid-template-columns: 44px 60px 1fr 110px 30px 40px;
    gap: 8px;
    align-items: center;
    padding: 8px 10px;
    background: var(--card-bg);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
}
.admin-level-num { font-weight: 700; color: var(--text-secondary); font-size: 0.85rem; }
.admin-level-icon, .admin-level-name, .admin-level-min {
    padding: 6px 10px; border: 1px solid var(--border-light);
    border-radius: var(--radius-md); background: var(--card-bg-solid);
    color: var(--text-primary); font-size: 0.9rem;
}
.admin-level-icon { text-align: center; font-size: 1.1rem; }
.admin-level-min-hint { color: var(--text-secondary); font-size: 0.8rem; font-weight: 600; }
.admin-levels-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.admin-moder-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.admin-moder-row {
    background: var(--card-bg);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 14px 16px;
    margin-bottom: 10px;
}
.admin-moder-head {
    display: flex; align-items: center; gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}
.admin-moder-text {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
    padding: 8px 0;
    border-top: 1px solid var(--border-light);
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 10px;
    word-break: break-word;
}
.admin-moder-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.admin-broadcast { max-width: 640px; }

.admin-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}
.admin-stat-block {
    background: var(--card-bg);
    padding: 16px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    text-align: center;
}
.admin-stat-num { font-size: 1.8rem; font-weight: 800; color: var(--primary); line-height: 1; margin-bottom: 4px; }
.admin-stat-lbl { font-size: 0.78rem; color: var(--text-secondary); }

.admin-chart {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 140px;
    padding: 12px;
    padding-bottom: 28px;
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    overflow-x: auto;
}
.admin-chart-bar {
    flex: 0 0 22px;
    height: 100%;
    position: relative;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}
.admin-chart-fill {
    width: 100%;
    background: var(--gradient-primary);
    border-radius: 3px 3px 0 0;
    min-height: 4px;
    transition: height 0.4s ease;
}
.admin-chart-label {
    position: absolute;
    bottom: -18px;
    font-size: 0.65rem;
    color: var(--text-secondary);
    transform: rotate(-45deg);
    transform-origin: left top;
    white-space: nowrap;
}

.admin-row-simple {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--card-bg);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    margin-bottom: 6px;
}
.admin-rank {
    width: 26px; height: 26px; border-radius: 50%;
    background: var(--gradient-primary); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 0.8rem; flex-shrink: 0;
}

.admin-row {
    display: flex; justify-content: space-between; align-items: center;
    gap: 12px; padding: 12px 14px;
    background: var(--card-bg);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    margin-bottom: 6px;
    flex-wrap: wrap;
}

@media (max-width: 768px) {
    .admin-level-row {
        grid-template-columns: 40px 50px 1fr 90px 26px 34px;
        font-size: 0.85rem;
    }
    .admin-user-actions { width: 100%; justify-content: flex-start; }
    .admin-report-columns { grid-template-columns: 1fr !important; }
    .admin-tab { min-width: 90px; font-size: 0.8rem; padding: 8px 10px; }
}

/* ============================================================
   14. Top-bar spinner
   ============================================================ */
.top-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    z-index: 99999;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
}
.top-bar.active { opacity: 1; }
.top-bar.done { opacity: 0; }
.top-bar-fill {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, var(--accent), #f0c060, var(--accent));
    background-size: 200% 100%;
    animation: topBarFill 1.2s ease-out forwards, topBarShine 1.5s linear infinite;
    box-shadow: 0 0 10px rgba(232, 168, 56, 0.6);
}
@keyframes topBarFill {
    0%   { width: 0; }
    20%  { width: 30%; }
    50%  { width: 60%; }
    80%  { width: 85%; }
    100% { width: 95%; }
}
@keyframes topBarShine {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
.top-bar.done .top-bar-fill {
    animation: topBarDone 0.3s ease-out forwards;
}
@keyframes topBarDone {
    0%   { width: 95%; }
    100% { width: 100%; }
}

/* ============================================================
   15. Мобильный бургер
   ============================================================ */
.burger-btn {
    display: none;
    background: transparent;
    border: none;
    width: 42px;
    height: 42px;
    border-radius: var(--radius-lg);
    cursor: pointer;
    color: var(--text-primary);
    font-size: 1.2rem;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}
.burger-btn:hover { background: var(--gray-100); color: var(--primary); }

.mobile-drawer {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 4500;
    animation: drawerBg 0.2s ease;
}
@keyframes drawerBg {
    from { opacity: 0; }
    to   { opacity: 1; }
}
.mobile-drawer-panel {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(340px, 88vw);
    background: var(--card-bg-solid);
    border-left: 1px solid var(--border-light);
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    animation: drawerSlide 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
}
@keyframes drawerSlide {
    from { transform: translateX(100%); }
    to   { transform: translateX(0); }
}
.mobile-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-light);
    background: var(--gray-50);
    position: sticky;
    top: 0;
    z-index: 2;
}
.mobile-drawer-header strong {
    font-size: 1.05rem;
    color: var(--text-primary);
    font-weight: 800;
}
.mobile-drawer-close {
    background: transparent;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}
.mobile-drawer-close:hover {
    background: rgba(220, 38, 38, 0.1);
    color: var(--danger);
    transform: rotate(90deg);
}
.mobile-drawer-body {
    padding: 12px;
    flex: 1;
}
.mobile-drawer-section {
    margin-bottom: 16px;
}
.mobile-drawer-section-title {
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-secondary);
    padding: 8px 12px 6px;
    opacity: 0.75;
}
.mobile-drawer-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 13px 14px;
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    font-size: 0.96rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
    text-decoration: none;
}
.mobile-drawer-item i {
    width: 22px;
    text-align: center;
    color: var(--primary);
    font-size: 1.05rem;
}
.mobile-drawer-item:hover {
    background: var(--gray-100);
    color: var(--primary);
}
.mobile-drawer-item.active {
    background: var(--gradient-primary);
    color: #fff;
    box-shadow: var(--shadow-md);
}
.mobile-drawer-item.active i { color: #fff; }
.mobile-drawer-item.danger { color: var(--danger); }
.mobile-drawer-item.danger i { color: var(--danger); }
.mobile-drawer-item.danger:hover { background: rgba(220, 38, 38, 0.1); }
.mobile-drawer-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    background: var(--gray-50);
    border-radius: var(--radius-lg);
    margin: 8px;
}
.mobile-drawer-user-avatar {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    flex-shrink: 0;
}
.mobile-drawer-user-info { min-width: 0; flex: 1; }
.mobile-drawer-user-name {
    font-weight: 800;
    font-size: 0.98rem;
    color: var(--text-primary);
    margin-bottom: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.mobile-drawer-user-meta {
    font-size: 0.78rem;
    color: var(--text-secondary);
}

@media (max-width: 900px) {
    .burger-btn { display: inline-flex; }
    .top-nav-inner > .top-nav-link,
    .top-nav-inner > .top-nav-brand,
    .top-nav-inner > .top-nav-user {
        display: none;
    }
    .top-nav-inner {
        justify-content: space-between;
        flex-wrap: nowrap;
    }
}

/* ============================================================
   16. Support (обращения и админка заявок)
   ============================================================ */
.support-fab {
    position: fixed;
    bottom: 90px;
    right: 24px;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--gradient-primary);
    color: #fff;
    border: none;
    cursor: pointer;
    box-shadow: var(--shadow-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    z-index: 800;
    transition: all var(--transition-normal);
}
.support-fab:hover {
    transform: scale(1.08) rotate(10deg);
    box-shadow: var(--shadow-2xl);
}

.support-filter-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}
.support-filter-btn {
    padding: 8px 16px;
    border-radius: var(--radius-lg);
    background: var(--card-bg-solid);
    border: 2px solid var(--border-light);
    color: var(--text-secondary);
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-fast);
}
.support-filter-btn:hover {
    border-color: var(--accent);
    color: var(--primary);
    transform: translateY(-2px);
}
.support-filter-btn.active {
    background: var(--gradient-primary);
    color: #fff;
    border-color: transparent;
    box-shadow: var(--shadow-md);
}

.support-card {
    background: var(--card-bg);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xl);
    padding: 18px 20px;
    margin-bottom: 12px;
    border-left: 4px solid var(--primary);
    transition: all var(--transition-fast);
}
.support-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}
.support-card.support-new { border-left-color: #ef4444; background: rgba(239, 68, 68, 0.03); }
.support-card.support-progress { border-left-color: var(--warning); }
.support-card.support-resolved { border-left-color: var(--success); opacity: 0.85; }
.support-card.support-rejected { border-left-color: var(--gray-400); opacity: 0.65; }

.support-card-head {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}
.support-card-type {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--primary);
    background: var(--gray-100);
    padding: 4px 12px;
    border-radius: 12px;
}
.support-card-status {
    font-size: 0.8rem;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 12px;
    margin-left: auto;
    white-space: nowrap;
}
.support-card-status.status-new { background: rgba(239, 68, 68, 0.15); color: #dc2626; }
.support-card-status.status-progress { background: rgba(217, 119, 6, 0.15); color: #d97706; }
.support-card-status.status-resolved { background: rgba(45, 143, 111, 0.15); color: #2d8f6f; }
.support-card-status.status-rejected { background: var(--gray-100); color: var(--gray-500); }

.support-card-subject {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 8px;
    line-height: 1.3;
}
.support-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 10px;
}
.support-card-meta a {
    color: var(--accent);
    font-weight: 700;
    text-decoration: none;
}
.support-card-meta a:hover { text-decoration: underline; }
.support-card-meta code {
    background: var(--gray-100);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85em;
    color: var(--primary);
    font-weight: 700;
}

.support-card-message {
    background: var(--gray-50);
    padding: 12px 14px;
    border-radius: var(--radius-md);
    font-size: 0.92rem;
    color: var(--text-primary);
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
    margin-bottom: 10px;
    border-left: 3px solid var(--border-medium);
}

.support-card-note {
    background: rgba(232, 168, 56, 0.08);
    border-left: 3px solid var(--accent);
    padding: 10px 14px;
    border-radius: var(--radius-md);
    font-size: 0.88rem;
    color: var(--text-primary);
    margin-bottom: 10px;
    line-height: 1.5;
}

.support-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

@media (max-width: 640px) {
    .support-fab {
        bottom: 80px;
        right: 16px;
        width: 46px;
        height: 46px;
        font-size: 1.15rem;
    }
    .support-card { padding: 14px 16px; }
    .support-card-actions { width: 100%; }
    .support-card-actions .btn { flex: 1; min-width: 0; padding: 7px 10px; font-size: 0.8rem; }
}

/* ============================================================
   17. Empty state
   ============================================================ */
.empty-state {
    text-align: center;
    padding: 60px 24px;
    color: var(--text-secondary);
    max-width: 480px;
    margin: 0 auto;
}
.empty-state-icon {
    font-size: 4rem;
    line-height: 1;
    margin-bottom: 20px;
    opacity: 0.7;
    animation: emptyFloat 3.5s ease-in-out infinite;
    display: inline-block;
}
@keyframes emptyFloat {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-8px); }
}
.empty-state h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}
.empty-state p {
    font-size: 0.95rem;
    line-height: 1.55;
    margin-bottom: 20px;
    color: var(--text-secondary);
}

/* ============================================================
   18. Тёмная тема — обложки приглушить
   ============================================================ */
[data-theme="dark"] .book-cover-css {
    filter: brightness(0.82) saturate(0.85);
}

/* ============================================================
   19. Свайп-закрытие модалок
   ============================================================ */
@media (max-width: 640px) {
    .modal-content {
        position: relative;
        transition: transform 0.15s ease-out;
    }
    .modal-content.dragging {
        transition: none;
    }
    .modal-content::after {
        content: '';
        position: absolute;
        top: 10px;
        left: 50%;
        transform: translateX(-50%);
        width: 40px;
        height: 4px;
        background: var(--gray-300);
        border-radius: 2px;
        opacity: 0.6;
    }
}

/* ============================================================
   20. Кнопка-спиннер
   ============================================================ */
.btn.loading {
    color: transparent !important;
    pointer-events: none;
}
.btn.loading::after {
    content: '';
    position: absolute;
    top: 50%; left: 50%;
    width: 18px; height: 18px;
    margin: -9px 0 0 -9px;
    border: 2.5px solid rgba(255, 255, 255, 0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: btnSpin 0.7s linear infinite;
    z-index: 2;
}
.btn.loading::before { display: none; }
.btn.loading i { opacity: 0; }
@keyframes btnSpin { to { transform: rotate(360deg); } }

/* ============================================================
   21. Кнопка "поделиться"
   ============================================================ */
.share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--gray-100);
    color: var(--text-secondary);
    border: 1.5px solid var(--border-light);
    border-radius: var(--radius-lg);
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all var(--transition-fast);
    margin-left: auto;
    flex-shrink: 0;
}
.share-btn:hover {
    background: var(--accent);
    color: var(--primary-dark);
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}
.share-btn.copied {
    background: var(--success);
    color: #fff;
    border-color: var(--success);
}

.book-title-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}
.book-title-row h2 {
    margin-bottom: 0;
    flex: 1;
    min-width: 0;
}

/* ============================================================
   22. НИЖНЯЯ НАВИГАЦИЯ (BOTTOM NAV)
   ============================================================ */
.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: var(--card-bg-solid);
    border-top: 1px solid var(--border-light);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
    z-index: 850;
    padding-bottom: env(safe-area-inset-bottom, 0);
}
[data-theme="dark"] .bottom-nav {
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.4);
}

.bottom-nav-inner {
    display: flex;
    height: 64px;
    max-width: 600px;
    margin: 0 auto;
}

.bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 0.65rem;
    font-weight: 700;
    padding: 8px 4px;
    transition: color var(--transition-fast);
    position: relative;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}

.bottom-nav-item i {
    font-size: 1.25rem;
    line-height: 1;
    transition: transform var(--transition-fast);
}

.bottom-nav-item.active {
    color: var(--primary);
}
.bottom-nav-item.active i {
    transform: translateY(-2px) scale(1.1);
}

.bottom-nav-item:active i {
    transform: scale(0.92);
}

.bottom-nav-item .bn-badge {
    position: absolute;
    top: 4px;
    right: calc(50% - 18px);
    min-width: 16px;
    height: 16px;
    padding: 0 5px;
    background: #ef4444;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 800;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.5);
    pointer-events: none;
}

@media (max-width: 900px) {
    .bottom-nav { display: block; }
    body { padding-bottom: 76px; }

    .theme-toggle {
        bottom: 84px !important;
    }

    .support-fab {
        bottom: 154px !important;
        right: 16px !important;
    }

    .notification-container {
        top: 12px;
        bottom: auto;
    }
}

/* ============================================================
   23. АВТОДОПОЛНЕНИЕ ПОИСКА
   ============================================================ */
.search-input-wrap {
    position: relative;
}

.search-suggest {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: var(--card-bg-solid);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    max-height: 380px;
    overflow-y: auto;
    z-index: 500;
    animation: suggestIn 0.15s ease;
}

@keyframes suggestIn {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

.search-suggest-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    cursor: pointer;
    border-bottom: 1px solid var(--border-light);
    transition: background var(--transition-fast);
    text-align: left;
    background: transparent;
    border-left: none;
    border-right: none;
    border-top: none;
    width: 100%;
    font: inherit;
    color: inherit;
}
.search-suggest-item:last-child {
    border-bottom: none;
}
.search-suggest-item:hover,
.search-suggest-item.active {
    background: var(--gray-100);
}
[data-theme="dark"] .search-suggest-item:hover,
[data-theme="dark"] .search-suggest-item.active {
    background: rgba(255, 255, 255, 0.08);
}

.search-suggest-cover {
    width: 36px;
    height: 48px;
    border-radius: 6px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: #fff;
    font-weight: 800;
    background: var(--gradient-primary);
    overflow: hidden;
}
.search-suggest-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.search-suggest-body {
    flex: 1;
    min-width: 0;
}
.search-suggest-title {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.25;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.search-suggest-title mark {
    background: rgba(232, 168, 56, 0.35);
    color: inherit;
    border-radius: 3px;
    padding: 0 2px;
}
.search-suggest-meta {
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.search-suggest-status {
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 700;
    flex-shrink: 0;
}
.search-suggest-status.available {
    background: rgba(45, 143, 111, 0.15);
    color: #2d8f6f;
}
.search-suggest-status.taken {
    background: rgba(217, 119, 6, 0.15);
    color: #d97706;
}

.search-suggest-hint {
    padding: 10px 14px;
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-style: italic;
    border-bottom: 1px solid var(--border-light);
}

.search-suggest-hint:last-child { border-bottom: none; }

@media (max-width: 640px) {
    .search-suggest {
        max-height: 60vh;
    }
}