/*
 * LiberClub — static/css/style.css
 * Основные стили находятся в templates/base.html (встроенный <style>).
 * Этот файл существует, чтобы Service Worker мог его закешировать без 404.
 */

/* Боярский — декоративный шрифт для русскоязычных обложек книг.
   unicode-range ограничивает его кириллицей: латиница/цифры в названии
   автоматически попадают на следующий шрифт в стеке (Playfair Display). */
@font-face {
    font-family: 'Boyarsky';
    src: url('/static/fonts/Boyarsky.ttf') format('truetype');
    unicode-range: U+0400-04FF;
    font-display: swap;
}

/* ─── Фон страницы (используется Android PWA splash screen) ── */
html, body {
    background-color: var(--bg);
    min-height: 100vh;
    margin: 0;
    padding: 0;
}

/* ─── Дашборд супервизора ─────────────────────────────────── */
.admin-dashboard {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 20px;
}

.dashboard-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 32px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--accent);
}

.dashboard-header .header-icon {
    font-size: 48px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-ink) 100%);
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(10, 76, 74, 0.2);
    flex-shrink: 0;
}

.dashboard-header h2 {
    font-family: 'Playfair Display', serif;
    font-size: 32px;
    color: var(--accent-dark);
    margin: 0 0 4px 0;
}

.dashboard-subtitle {
    color: var(--muted);
    font-size: 14px;
    margin: 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background: linear-gradient(135deg, var(--card) 0%, var(--bg) 100%);
    border-radius: 24px;
    padding: 24px 16px;
    text-align: center;
    transition: transform 0.2s;
    cursor: default;
    position: relative;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    border-radius: 24px 24px 0 0;
    background: linear-gradient(90deg, var(--accent), var(--accent-ink));
}

/* Тень на hover — через opacity отдельного слоя, а не анимацию box-shadow
   (transform/opacity дешевле для GPU, см. DESIGN.md, раздел Motion) */
.stat-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 24px;
    box-shadow: 0 12px 24px rgba(10, 76, 74, 0.12);
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
}

.stat-card:hover {
    transform: translateY(-4px);
}
.stat-card:hover::after {
    opacity: 1;
}

.stat-icon {
    font-size: 36px;
    margin-bottom: 12px;
}

.stat-value {
    font-size: 36px;
    font-weight: 700;
    color: var(--accent-dark);
    font-family: 'Playfair Display', serif;
}

.stat-label {
    font-size: 14px;
    color: var(--muted);
    margin-top: 8px;
}

.admin-actions {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.admin-btn {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
    color: var(--accent-ink);
    padding: 14px 28px;
    border-radius: 48px;
    text-decoration: none;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.admin-btn .btn-icon {
    font-size: 20px;
}

.admin-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(10, 76, 74, 0.2);
    color: var(--accent-ink);
}

@media (max-width: 768px) {
    .dashboard-header {
        flex-direction: column;
        text-align: center;
    }

    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
        gap: 12px;
    }

    .stat-card {
        padding: 16px 12px;
    }

    .stat-value {
        font-size: 28px;
    }

    .admin-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .admin-btn {
        justify-content: center;
    }
}

/* ─── Дефолтные обложки книг ─────────────────────────────── */
.default-cover {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    padding: 16px;
    text-align: center;
    aspect-ratio: 2/3;
    width: 100%;
    overflow: hidden;
    font-family: 'Boyarsky', 'Playfair Display', serif;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s;
}

.default-cover:hover {
    transform: translateY(-4px);
}

.default-cover .cover-title {
    font-size: 18px;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.default-cover .cover-author {
    font-size: 12px;
    opacity: 0.8;
}

/* Кликабельный автор книги — карточки, обложка-заглушка, модалка книги.
   Переход на /search?q=<автор> (см. goToAuthorSearch в base.html). */
.author-link {
    color: inherit;
    text-decoration: none;
    cursor: pointer;
}

.author-link:hover,
.author-link:focus-visible {
    text-decoration: underline;
}

.default-cover .cover-icon {
    font-size: 28px;
    margin-top: 8px;
}

/* Цветовые схемы */
.default-cover-1  { background: linear-gradient(135deg, #F5E6D3, #E8D5C4); color: #5D4037; }
.default-cover-2  { background: linear-gradient(135deg, #1A237E, #283593); color: #E8EAF6; }
.default-cover-3  { background: linear-gradient(135deg, #4A148C, #6A1B9A); color: #F3E5F5; }
.default-cover-4  { background: linear-gradient(135deg, #1B5E20, #2E7D32); color: #E8F5E9; }
.default-cover-5  { background: linear-gradient(135deg, #BF360C, #D84315); color: #FBE9E7; }
.default-cover-6  { background: linear-gradient(135deg, #0D47A1, #1565C0); color: #E3F2FD; }
.default-cover-7  { background: linear-gradient(135deg, #4E342E, #5D4037); color: #EFEBE9; }
.default-cover-8  { background: linear-gradient(135deg, #263238, #37474F); color: #ECEFF1; }
.default-cover-9  { background: linear-gradient(135deg, #880E4F, #AD1457); color: #FCE4EC; }
.default-cover-10 { background: linear-gradient(135deg, #1A237E, #0D47A1); color: #E8EAF6; }

/* Дополнительные утилитарные классы */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.text-center { text-align: center; }
.mt-0  { margin-top: 0; }
.mb-0  { margin-bottom: 0; }
.mt-8  { margin-top: 8px; }
.mb-8  { margin-bottom: 8px; }
.mt-16 { margin-top: 16px; }
.mb-16 { margin-bottom: 16px; }

/* ─── Страница импорта книг ──────────────────────────────── */
.import-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.import-section {
    background: var(--card);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.import-section h3 {
    font-family: 'Playfair Display', serif;
    font-size: 22px;
    color: var(--accent-dark);
    margin-bottom: 16px;
}

.import-section textarea,
.import-section input[type="file"] {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    margin-bottom: 16px;
    background: var(--bg);
    box-sizing: border-box;
}

.import-section textarea {
    min-height: 150px;
    resize: vertical;
}

.import-section button {
    background: var(--accent);
    border: none;
    border-radius: 40px;
    padding: 10px 24px;
    color: var(--accent-ink);
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
}

.import-section button:hover {
    background: var(--accent-hover);
}

.import-section button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.import-result {
    margin-top: 16px;
    padding: 12px 16px;
    border-radius: 12px;
    background: rgba(129, 216, 208, 0.1);
    color: var(--accent-dark);
    font-size: 14px;
}

.instructions {
    background: var(--bg);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 24px;
}

.instructions h4 {
    font-family: 'Playfair Display', serif;
    font-size: 18px;
    color: var(--accent-dark);
    margin-bottom: 12px;
}

.instructions p,
.instructions li {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text);
}

.instructions ol {
    padding-left: 20px;
    margin-bottom: 12px;
}

.instructions pre {
    background: var(--card);
    padding: 12px;
    border-radius: 12px;
    border: 1px solid var(--border);
    font-size: 12px;
    overflow-x: auto;
    margin: 8px 0 12px;
}

.instructions code {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 1px 5px;
    font-size: 12px;
    color: var(--accent-dark);
}

/* ─── Чат клуба ──────────────────────────────────────────── */
.club-chat {
    margin-top: 24px;
    background: var(--card);
    border-radius: 16px;
    padding: 20px;
}

.chat-messages {
    max-height: 400px;
    overflow-y: auto;
    margin-bottom: 16px;
}

.chat-message {
    padding: 12px;
    border-bottom: 1px solid var(--border);
}

.chat-message strong {
    color: var(--accent-dark);
}

.chat-message .time {
    font-size: 11px;
    color: var(--muted);
    margin-left: 8px;
}

.reply-btn {
    background: none;
    border: none;
    color: var(--accent);
    cursor: pointer;
    font-size: 12px;
    margin-top: 4px;
}

.chat-input {
    display: flex;
    gap: 8px;
}

.chat-input input {
    flex-grow: 1;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 24px;
    font-family: 'Inter', sans-serif;
}

/* ─── Предложка книг ─────────────────────────────────────── */
.proposals-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.proposals-header h3 {
    margin: 0;
    font-size: 18px;
    color: var(--accent-dark);
}

.proposals-count {
    background: var(--accent);
    color: var(--accent-ink);
    border-radius: 20px;
    padding: 2px 10px;
    font-size: 14px;
    font-weight: 600;
}

.proposals-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 400px;
    overflow-y: auto;
}

/* Широкий экран: две колонки вместо растянутых на всю ширину строк —
   .proposal-card уже компактная горизонтальная карточка, не требует
   полной ширины контентной колонки (см. DESIGN.md, п.4). Завязано на
   ширину окна, а не на hover/pointer — тач-планшет в альбомной
   ориентации той же ширины выигрывает от той же плотности. */
@media (min-width: 1024px) {
    .proposals-list {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: start;
        max-height: none;
        overflow-y: visible;
    }
}

.proposals-list::-webkit-scrollbar { width: 4px; }
.proposals-list::-webkit-scrollbar-track { background: transparent; }
.proposals-list::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 4px; }

.proposals-empty {
    color: var(--muted-2);
    font-size: 14px;
    text-align: center;
    padding: 20px 0;
}

.proposal-card {
    display: flex;
    gap: 12px;
    padding: 12px;
    border-radius: 12px;
    background: var(--bg);
    align-items: center;
    transition: transform 0.2s;
}

.proposal-card:hover {
    transform: translateX(4px);
}

.proposal-cover img {
    width: 50px;
    height: 70px;
    object-fit: cover;
    border-radius: 8px;
    display: block;
}

.proposal-info {
    flex-grow: 1;
    min-width: 0;
}

.proposal-title {
    font-weight: 600;
    color: var(--accent-dark);
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.proposal-author {
    font-size: 13px;
    color: var(--muted);
    margin-top: 2px;
}

.proposal-meta {
    font-size: 11px;
    color: var(--accent);
    margin-top: 4px;
}

.delete-proposal-btn {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.2s;
    flex-shrink: 0;
    padding: 4px;
}

.delete-proposal-btn:hover {
    opacity: 1;
}

/* ─── Кнопка «Отменить предложение» ──────────────────────── */
.cancel-proposal-btn {
    background: none;
    border: 1px solid rgba(192, 57, 43, 0.35);
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 12px;
    font-family: 'Inter', sans-serif;
    color: var(--danger);
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s, border-color 0.2s;
    white-space: nowrap;
}

.cancel-proposal-btn:hover:not(:disabled) {
    background: rgba(192, 57, 43, 0.07);
    border-color: var(--danger);
}

.cancel-proposal-btn:disabled {
    opacity: 0.55;
    cursor: default;
}

/* ─── Подсветка предложений от adminов/owner ─────────────── */
.admin-proposal {
    background: rgba(129, 216, 208, 0.15);
    border-left: 4px solid var(--accent);
}

.admin-star {
    margin-right: 6px;
    font-size: 14px;
    vertical-align: middle;
}

.proposal-info p {
    margin: 4px 0 0;
    font-size: 13px;
    color: var(--muted);
}

/* ─── Кнопка «Предложить в клуб» — единый стиль ──────────── */
button.propose-book-btn,
.propose-book-btn {
    background: var(--accent) !important;
    border: none !important;
    border-radius: 40px !important;
    padding: 10px 20px !important;
    color: var(--accent-ink) !important;
    font-weight: 600 !important;
    font-size: 14px !important;
    font-family: 'Inter', sans-serif !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05) !important;
    text-align: center !important;
    white-space: nowrap !important;
}

button.propose-book-btn:hover,
.propose-book-btn:hover {
    background: var(--accent-hover) !important;
    transform: translateY(-2px) !important;
}

button.propose-book-btn:active,
.propose-book-btn:active {
    transform: translateY(0) !important;
}

button.propose-book-btn:disabled,
.propose-book-btn:disabled {
    opacity: 0.55 !important;
    cursor: default !important;
    transform: none !important;
}

/* ─── Выпадающее меню «Предложить» — единый стиль ────────── */
.propose-dropdown-content {
    position: absolute;
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    min-width: 200px;
    z-index: 1000;  /* выше backdrop (999) */
    overflow: hidden;
    margin-top: 4px;
    bottom: calc(100% + 6px);
    left: 0;
    right: 0;
}

.propose-dropdown-content a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    text-decoration: none;
    color: var(--text);
    font-size: 14px;
    transition: background 0.2s;
}

.propose-dropdown-content a:hover {
    background: var(--bg);
}

.propose-dropdown-content .club-header {
    background: var(--bg);
    font-weight: 600;
    padding: 8px 16px;
    color: #0A4C4A;
    font-size: 13px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
}

.propose-dropdown-content .admin-actions {
    display: flex;
    gap: 8px;
    padding: 8px 16px;
    border-top: 1px solid var(--border);
}

.propose-dropdown-content .admin-actions a {
    flex: 1;
    justify-content: center;
    padding: 8px;
    border-radius: 40px;
    background: var(--bg);
    font-size: 13px;
}

.propose-dropdown-content .admin-actions a:hover {
    background: var(--surface-2);
}

/* ─── Блок голосования (API-driven) ─────────────────────── */
.polls-header {
    margin-bottom: 16px;
}

.polls-header h3 {
    margin: 0;
    font-size: 18px;
    color: var(--accent-dark);
}

.polls-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.api-poll-card {
    display: flex;
    gap: 16px;
    padding: 16px;
    border-radius: 12px;
    background: var(--bg);
}

.api-poll-card .poll-cover img {
    width: 60px;
    height: 85px;
    object-fit: cover;
    border-radius: 8px;
}

.api-poll-card .poll-info {
    flex-grow: 1;
}

.api-poll-card .poll-title {
    font-weight: 600;
    color: var(--accent-dark);
}

.api-poll-card .poll-author {
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 8px;
}

.vote-up-btn,
.vote-down-btn {
    background: none;
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 6px 16px;
    margin-right: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Inter', sans-serif;
}

.vote-up-btn:hover,
.vote-down-btn:hover {
    background: var(--accent);
    border-color: var(--accent);
}

/* ─── Notifications bell ─────────────────────────────────── */
.notifications-area {
    position: relative;
    display: inline-block;
}

.notifications-btn {
    background: none;
    border: none;
    border-bottom: none;
    text-decoration: none;
    font-size: 24px;
    cursor: pointer;
    position: relative;
    padding: 8px;
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: background 0.2s;
}

.notifications-btn:hover {
    background: rgba(129, 216, 208, 0.13);
}

.notif-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: var(--danger-surface);
    color: white;
    font-size: 10px;
    font-weight: bold;
    border-radius: 10px;
    padding: 2px 6px;
    min-width: 18px;
    text-align: center;
    font-family: 'Inter', sans-serif;
    line-height: 1.4;
}

/* ─── Мобильная версия выпадающего меню «Предложить» ─────── */
@media (max-width: 768px) {
    .propose-dropdown-content {
        position: fixed !important;
        top: auto !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        border-radius: 20px 20px 0 0 !important;
        max-height: 60vh;
        overflow-y: auto;
        margin: 0 !important;
        padding-bottom: 20px;
        z-index: 1001;  /* самый высокий — выше backdrop */
    }

    .propose-dropdown-content a,
    .propose-dropdown-content .admin-actions {
        padding: 14px 20px;
        font-size: 16px;
    }

    .propose-dropdown-content .admin-actions {
        flex-direction: column;
        gap: 10px;
    }

    .propose-dropdown-content .admin-actions a {
        text-align: center;
        justify-content: center;
    }

    /* Затемнение фона при открытом меню */
    .dropdown-backdrop {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.5);
        z-index: 999;  /* ниже дропдауна (1001), выше остального */
    }
}

/* ─── Рост библиотеки (дашборд) ──────────────────────────── */
.library-growth {
    background: var(--card);
    border-radius: 24px;
    padding: 24px;
    margin-bottom: 32px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.05);
}

.growth-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
}

.growth-header h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Playfair Display', serif;
    color: var(--accent-dark);
    margin: 0;
    font-size: 20px;
}

.growth-stats {
    display: flex;
    gap: 16px;
    align-items: baseline;
    flex-wrap: wrap;
}

.stat-total {
    font-size: 28px;
    font-weight: 700;
    color: var(--accent-dark);
    font-family: 'Playfair Display', serif;
}

.stat-change {
    font-size: 13px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 12px;
}

.stat-change.positive {
    color: #2ECC71;
    background: rgba(46,204,113,0.1);
}

.stat-change.negative {
    color: var(--danger-hover);
    background: rgba(231,76,60,0.1);
}

.growth-chart {
    height: 110px;
    margin: 16px 0;
    position: relative;
}

.recent-books {
    border-top: 1px solid var(--border);
    padding-top: 16px;
    margin-top: 8px;
}

.recent-books h4 {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--muted);
    margin: 0 0 10px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.recent-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.recent-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--bg);
    font-size: 14px;
}

.recent-list li:last-child {
    border-bottom: none;
}

.book-title-admin {
    font-weight: 600;
    color: var(--accent-dark);
    flex: 1 1 auto;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.book-author-admin {
    color: var(--muted);
    flex-shrink: 0;
    font-size: 13px;
}

.book-date-admin {
    margin-left: auto;
    color: var(--muted-2);
    font-size: 12px;
    flex-shrink: 0;
    white-space: nowrap;
}

/* ─── Шкала использования хранилища БД (дашборд супервизора) ──── */
.storage-bar {
    height: 10px;
    border-radius: 6px;
    background: var(--bg);
    overflow: hidden;
    margin: 4px 0 16px;
}
.storage-bar-fill {
    height: 100%;
    border-radius: 6px;
    background: #2ECC71;
    transition: width 0.4s ease;
}
.storage-bar-fill.storage-bar-warn { background: #F39C12; }
.storage-bar-fill.storage-bar-danger { background: var(--danger-hover); }
.storage-hint {
    font-size: 13px;
    color: var(--muted);
    line-height: 1.5;
    margin: 4px 0 16px;
}
.storage-hint code {
    background: var(--bg);
    padding: 1px 5px;
    border-radius: 4px;
    font-size: 12px;
}

/* ─── Адаптивные таблицы админки: таблица на десктопе, карточки
   на мобильном (ниже 700px) — паттерн взят из admin_book_of_day.html,
   вынесен сюда, чтобы не дублировать в каждом шаблоне со своей таблицей
   (admin_users/admin_clubs/admin_reports/admin_book_of_day). ──────── */
.admin-table-wrap {
    overflow-x: auto;
}
.admin-cards {
    display: none;
    flex-direction: column;
    gap: 12px;
}
@media (max-width: 700px) {
    .admin-table-wrap { display: none; }
    .admin-cards { display: flex; }
}
.admin-card {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 14px;
}
.admin-card-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
}
.admin-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* ─── Таблицы администрирования (устаревшее — не используется
   текущими шаблонами admin_*.html, они на .section-card + инлайн-стилях;
   оставлено на случай, если где-то ещё подключается) ──────── */
.admin-users,
.admin-clubs {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 20px;
}

.admin-users h2,
.admin-clubs h2 {
    font-family: 'Playfair Display', serif;
    color: var(--accent-dark);
    margin-bottom: 24px;
}

.admin-users table,
.admin-clubs table {
    width: 100%;
    border-collapse: collapse;
    background: var(--card);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,0.05);
}

.admin-users th,
.admin-clubs th {
    background: var(--bg);
    text-align: left;
    padding: 14px 16px;
    color: var(--accent-dark);
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    border-bottom: 2px solid var(--border);
}

.admin-users td,
.admin-clubs td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
    color: var(--text);
}

.admin-users tr:last-child td,
.admin-clubs tr:last-child td {
    border-bottom: none;
}

.admin-users tr:hover td,
.admin-clubs tr:hover td {
    background: var(--surface-2);
}

.btn-small {
    display: inline-block;
    background: var(--accent);
    color: var(--accent-ink);
    padding: 4px 12px;
    border-radius: 20px;
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
    margin-right: 4px;
    transition: background 0.15s;
}

.btn-small:hover {
    background: var(--accent-hover);
    color: var(--accent-ink);
}

.btn-small.danger {
    background: var(--danger-surface);
    color: var(--card);
}

.btn-small.danger:hover {
    background: var(--danger-surface-hover);
    color: var(--card);
}

@media (max-width: 768px) {
    .library-growth {
        padding: 16px;
    }

    .growth-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .growth-chart {
        height: 80px;
    }

    .admin-users,
    .admin-clubs {
        padding: 16px 12px;
    }

    .admin-users table,
    .admin-clubs table {
        font-size: 13px;
    }

    .admin-users th,
    .admin-clubs th,
    .admin-users td,
    .admin-clubs td {
        padding: 10px 10px;
    }
}

/* ─── Вкладки страницы клуба ─────────────────────────────── */
.club-tabs-wrap {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--r-card, 16px);
    overflow: hidden;
    margin-bottom: 2px;
}

.club-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--border);
    overflow-x: auto;
    padding: 0 20px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.club-tabs::-webkit-scrollbar { display: none; }

.club-tab {
    background: none;
    border: none;
    border-bottom: none;
    padding: 14px 16px;
    font-size: 14px;
    font-weight: 500;
    color: var(--muted);
    cursor: pointer;
    position: relative;
    white-space: nowrap;
    transition: color 0.2s;
    font-family: 'Inter', sans-serif;
    flex-shrink: 0;
    line-height: 1.4;
    min-height: unset;
}
.club-tab:hover { color: #0A4C4A; }
.club-tab.active { color: #0A4C4A; font-weight: 600; }
.club-tab.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--accent);
    border-radius: 4px 4px 0 0;
}

.tab-badge {
    display: inline-block;
    background: var(--accent);
    color: #0A4C4A;
    border-radius: 20px;
    padding: 1px 7px;
    font-size: 11px;
    font-weight: 600;
    margin-left: 4px;
    vertical-align: middle;
    line-height: 1.6;
}
.tab-badge:empty { display: none; }

.tab-pane { margin-bottom: 0; }

@media (max-width: 768px) {
    .club-tabs { padding: 0 10px; }
    .club-tab {
        padding: 12px 10px;
        font-size: 13px;
        min-height: unset !important;
    }
}

/* ─── Баннер «1 клуб на пользователя» ───────────────────── */
.club-limit-banner {
    display: flex;
    align-items: center;
    gap: 20px;
    background: var(--bg);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 24px;
    border-left: 4px solid var(--accent);
}

.banner-icon {
    font-size: 48px;
    flex-shrink: 0;
}

.banner-content h3 {
    margin: 0 0 8px 0;
    color: var(--accent-dark);
    font-family: 'Playfair Display', serif;
    font-size: 18px;
}

.banner-content p {
    margin: 0 0 12px 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.5;
}

.btn-go-to-club {
    display: inline-block;
    background: var(--accent);
    color: var(--accent-ink);
    padding: 8px 20px;
    border-radius: 40px;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    transition: background 0.2s, transform 0.2s;
}

.btn-go-to-club:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    color: var(--accent-ink);
}

@media (max-width: 480px) {
    .club-limit-banner {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .banner-icon {
        font-size: 36px;
    }
}

