/* ============================================================
   app.css — стили главной страницы MyFiles
   Вынесены из index.html для удобства поддержки.
   Разделы «Хлебные крошки» и «Кнопка Поделиться» — в конце файла.
   ============================================================ */

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Inter', sans-serif;
    background: #f0f4ff;
    color: #1a202c;
    line-height: 1.6;
    padding: 20px;
    min-height: 100vh;
}

.container {
    max-width: 1500px;
    margin: 0 auto;
    background: white;
    border-radius: 32px;
    box-shadow: 0 20px 60px rgba(0,20,80,0.08);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* ─── Шапка ─── */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    padding: 16px 30px;
    border-bottom: 2px solid #eef2ff;
    background: white;
}

.logo {
    font-size: 26px;
    font-weight: 800;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo i {
    color: #2563eb;
    font-size: 30px;
}

.logo span {
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.header-actions a,
.header-actions button {
    padding: 8px 18px;
    border-radius: 40px;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: 0.2s;
    font-family: 'Inter', sans-serif;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    color: #475569;
}

.header-actions a:hover,
.header-actions button:hover {
    background: #eef2ff;
    color: #1e293b;
}

.header-actions .btn-primary {
    background: #2563eb;
    color: white;
}

.header-actions .btn-primary:hover {
    background: #1d4ed8;
    transform: translateY(-2px);
}

.header-actions .btn-update {
    background: #f59e0b;
    color: #1e293b;
}

.header-actions .btn-update:hover {
    background: #d97706;
    color: white;
    transform: translateY(-2px);
}

.header-actions .btn-danger {
    background: #dc2626;
    color: white;
}

.header-actions .btn-danger:hover {
    background: #b91c1c;
}

.header-actions .btn-admin-panel {
    background: #8b5cf6;
    color: white;
}

.header-actions .btn-admin-panel:hover {
    background: #7c3aed;
    transform: translateY(-2px);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #e2e8f0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.username {
    font-weight: 600;
    font-size: 14px;
    color: #0f172a;
}

/* ─── Layout ─── */
.main-layout {
    display: flex;
    flex: 1;
}

.sidebar {
    width: 260px;
    background: #f8fafc;
    padding: 20px 12px;
    border-right: 2px solid #eef2ff;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
}

.sidebar .nav-link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    border-radius: 12px;
    color: #475569;
    font-weight: 600;
    font-size: 16px;
    text-decoration: none;
    transition: 0.2s;
    cursor: pointer;
    margin-bottom: 4px;
}

.sidebar .nav-link i {
    width: 24px;
    font-size: 18px;
    text-align: center;
}

.sidebar .nav-link:hover {
    background: #eef2ff;
    color: #1e293b;
}

.sidebar .nav-link.active {
    background: #2563eb;
    color: white;
    box-shadow: 0 4px 12px rgba(37,99,235,0.25);
}

.sidebar .nav-link.top10-link i {
    color: #dc2626;
}

.sidebar .nav-link.top10-link.active {
    background: #dc2626;
    box-shadow: 0 4px 12px rgba(220,38,38,0.3);
}

.sidebar .nav-link.top10-link.active i {
    color: white;
}

/* ─── Панель статистики в сайдбаре ─── */
.stats-panel {
    background: white;
    border-radius: 16px;
    padding: 16px 14px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}

.stats-panel h4 {
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 2px solid #e5e7eb;
    padding-bottom: 10px;
}

.stats-panel table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.stats-panel td {
    padding: 7px 0;
    border-bottom: 1px solid #e5e7eb;
}

.stats-panel td:last-child {
    text-align: right;
    font-weight: 700;
    color: #0f172a;
}

.stats-panel tr:last-child td {
    border-bottom: none;
}

.stats-panel .label { color: #64748b; }
.stats-panel .value { font-size: 15px; }

/* ─── Контент ─── */
.content-area {
    flex: 1;
    padding: 25px 30px;
    min-width: 0;
}

.tab-content { display: none; }
.tab-content.active { display: block; }

.section-title {
    font-size: 26px;
    font-weight: 700;
    margin: 0 0 20px 0;
    padding-bottom: 10px;
    border-bottom: 3px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.section-title i { color: #2563eb; }

/* ─── Hero-блок приветствия ─── */
.welcome-hero {
    background: linear-gradient(135deg, #eff6ff 0%, #f5f3ff 100%);
    border-radius: 20px;
    padding: 32px 28px;
    margin-bottom: 24px;
    border: 1px solid #dbeafe;
}

.welcome-hero h1 {
    font-size: 30px;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.welcome-hero h1 i { color: #2563eb; }

.welcome-hero .hero-subtitle {
    font-size: 16px;
    color: #475569;
    margin-bottom: 22px;
    line-height: 1.6;
}

.welcome-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    margin-bottom: 6px;
}

.welcome-card {
    background: white;
    border-radius: 16px;
    padding: 22px 20px;
    border: 2px solid #e2e8f0;
    transition: 0.2s;
}

.welcome-card:hover {
    border-color: #2563eb;
    transform: translateY(-3px);
    box-shadow: 0 10px 24px rgba(37,99,235,0.12);
}

.welcome-card.guest { border-left: 5px solid #10b981; }
.welcome-card.user  { border-left: 5px solid #2563eb; }

.welcome-card .card-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    margin-bottom: 12px;
    color: white;
}

.welcome-card.guest .card-icon { background: #10b981; }
.welcome-card.user  .card-icon { background: #2563eb; }

.welcome-card h3 {
    font-size: 17px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 12px;
}

.welcome-card ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.welcome-card li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 6px 0;
    font-size: 14px;
    color: #334155;
    line-height: 1.5;
}

.welcome-card li i {
    color: #10b981;
    font-size: 14px;
    margin-top: 3px;
    flex-shrink: 0;
}

.welcome-card.user li i { color: #2563eb; }

.welcome-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 20px;
}

.welcome-actions a {
    padding: 10px 22px;
    border-radius: 40px;
    font-weight: 700;
    font-size: 14px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: 0.2s;
}

.welcome-actions .btn-login {
    background: #2563eb;
    color: white;
    box-shadow: 0 4px 14px rgba(37,99,235,0.3);
}

.welcome-actions .btn-login:hover {
    background: #1d4ed8;
    transform: translateY(-2px);
}

.welcome-actions .btn-register {
    background: #f59e0b;
    color: #1e293b;
    box-shadow: 0 4px 14px rgba(245,158,11,0.3);
}

.welcome-actions .btn-register:hover {
    background: #d97706;
    color: white;
    transform: translateY(-2px);
}

.welcome-actions .btn-submit {
    background: white;
    color: #2563eb;
    border: 2px solid #2563eb;
}

.welcome-actions .btn-submit:hover { background: #eff6ff; }

.welcome-hint {
    margin-top: 20px;
    padding: 14px 18px;
    background: #f8fafc;
    border-left: 4px solid #8b5cf6;
    border-radius: 10px;
    font-size: 14px;
    color: #475569;
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.welcome-hint i {
    color: #8b5cf6;
    font-size: 18px;
    margin-top: 2px;
}

/* ─── Топ-10 ─── */
.top10-section {
    background: white;
    border: 2px solid #fee2e2;
    border-radius: 20px;
    padding: 24px 26px;
}

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

.top10-title {
    font-size: 22px;
    font-weight: 800;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 10px;
}

.top10-title i {
    color: #dc2626;
    font-size: 24px;
}

.top10-refresh-btn {
    padding: 8px 16px;
    border-radius: 30px;
    border: none;
    background: #64748b;
    color: white;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: 0.2s;
}

.top10-refresh-btn:hover { background: #475569; }
.top10-refresh-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.top10-subtitle {
    color: #64748b;
    font-size: 14px;
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 2px dashed #fecaca;
}

.top10-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* Карточка топ-10 — теперь нативная ссылка <a>.
   text-decoration: none снимает подчёркивание. */
.top10-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    border-radius: 14px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    cursor: pointer;
    transition: 0.2s;
    text-decoration: none;
    color: inherit;
    min-width: 0;
}

.top10-item:hover {
    background: #fee2e2;
    border-color: #dc2626;
    transform: translateY(-2px);
    box-shadow: 0 8px 18px rgba(220,38,38,0.12);
}

.top10-rank {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #dc2626;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 15px;
}

.top10-item:nth-child(1) .top10-rank { background: #f59e0b; }
.top10-item:nth-child(2) .top10-rank { background: #94a3b8; }
.top10-item:nth-child(3) .top10-rank { background: #b45309; }

.top10-body {
    flex: 1;
    min-width: 0;
}

.top10-name {
    font-weight: 700;
    font-size: 14px;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.top10-meta {
    font-size: 12px;
    color: #64748b;
    margin-top: 3px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.top10-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #fef2f2;
    color: #991b1b;
    font-weight: 700;
    font-size: 12px;
    padding: 2px 10px;
    border-radius: 20px;
    flex-shrink: 0;
}

.top10-loading,
.top10-empty {
    grid-column: 1 / -1;
    text-align: center;
    color: #94a3b8;
    font-size: 14px;
    padding: 40px 0;
    font-style: italic;
}

/* ─── Плашки с предупреждениями (программы) ─── */
.programs-notice {
    background: #eff6ff;
    border-left: 5px solid #2563eb;
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 20px;
    font-size: 14px;
    line-height: 1.65;
    color: #1e3a8a;
}

.programs-notice .notice-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 15px;
    color: #1e40af;
    margin-bottom: 8px;
}

.programs-notice .notice-title i {
    color: #2563eb;
    font-size: 18px;
}

.programs-notice p { margin-bottom: 8px; }
.programs-notice p:last-child { margin-bottom: 0; }

.programs-notice a {
    color: #1d4ed8;
    font-weight: 600;
    text-decoration: underline;
}

.programs-notice.warning {
    background: #fffbeb;
    border-left-color: #f59e0b;
    color: #78350f;
}

.programs-notice.warning .notice-title { color: #92400e; }
.programs-notice.warning .notice-title i { color: #d97706; }
.programs-notice.warning a { color: #b45309; }

/* ─── Сетка папок ─── */
.folder-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-top: 10px;
}

.folder-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    padding: 22px 16px;
    cursor: pointer;
    transition: 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 8px;
}

.folder-card:hover {
    border-color: #2563eb;
    transform: translateY(-3px);
    box-shadow: 0 10px 24px rgba(37,99,235,0.15);
}

.folder-icon {
    font-size: 40px;
    color: #2563eb;
    line-height: 1;
}

.folder-card-all .folder-icon { color: #7c3aed; }
.folder-card-nofolder .folder-icon { color: #94a3b8; }
.folder-card-empty .folder-icon { color: #cbd5e1; }

.folder-name {
    font-weight: 700;
    font-size: 15px;
    color: #0f172a;
    word-break: break-word;
    line-height: 1.3;
}

.folder-count {
    font-size: 12px;
    color: #64748b;
    background: #f1f5f9;
    padding: 3px 12px;
    border-radius: 20px;
    font-weight: 600;
}

/* ─── Кнопки возврата из папки ─── */
.folder-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 18px;
    background: #f1f5f9;
    border: none;
    border-radius: 30px;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
    margin-bottom: 15px;
    transition: 0.2s;
}

.folder-back-btn:hover {
    background: #e2e8f0;
    color: #1e293b;
}

.folder-back-btn i { font-size: 12px; }

.folder-current {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: #eef2ff;
    border-radius: 30px;
    font-size: 13px;
    color: #1e40af;
    margin-bottom: 15px;
    margin-left: 8px;
    font-weight: 600;
}

.folder-current i { color: #2563eb; }

/* ─── Таблицы контента ─── */
.content-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.content-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.content-table thead th {
    background: #f1f5f9;
    color: #1e293b;
    font-weight: 700;
    font-size: 14px;
    text-align: left;
    padding: 10px 12px 8px;
    border-bottom: 2px solid #e2e8f0;
    vertical-align: top;
}

.content-table thead th .th-label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    user-select: none;
    padding: 4px 0;
    transition: color 0.15s;
}

.content-table thead th .th-label:hover { color: #2563eb; }

.content-table thead th .sort-icon {
    font-size: 11px;
    color: #94a3b8;
}

.content-table thead th .sort-icon.active { color: #2563eb; }

.content-table thead th .col-search {
    width: 100%;
    padding: 5px 8px;
    margin-top: 4px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 12px;
    font-family: 'Inter', sans-serif;
    background: white;
}

.content-table tbody td {
    padding: 12px;
    border-bottom: 1px solid #e5e7eb;
    font-size: 14px;
    color: #334155;
    vertical-align: top;
}

.content-table tbody tr:hover { background: #f8fafc; }

.content-table .col-title {
    font-weight: 600;
    color: #0f172a;
    max-width: 250px;
}

.content-table .col-desc {
    min-width: 400px;
    max-width: 700px;
}

.content-table .col-center {
    text-align: center;
    white-space: nowrap;
}

.content-table .col-num {
    text-align: right;
    font-weight: 600;
}

.content-table .col-cover {
    width: 90px;
    padding: 8px;
    text-align: center;
    vertical-align: middle;
}

.content-table .col-cover img {
    width: 70px;
    height: 100px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
    display: block;
    margin: 0 auto;
}

.content-table .no-cover {
    width: 70px;
    height: 100px;
    background: #f1f5f9;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #cbd5e1;
    font-size: 28px;
    margin: 0 auto;
}

.desc-short {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
}

.desc-full {
    display: none;
    word-break: break-word;
}

.desc-toggle {
    background: none;
    border: none;
    color: #2563eb;
    font-weight: 600;
    cursor: pointer;
    font-size: 13px;
    margin-top: 6px;
    padding: 0;
}

.btn-download-sm {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #2563eb;
    color: white;
    padding: 6px 14px;
    border-radius: 30px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: 0.2s;
    white-space: nowrap;
}

.btn-download-sm:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
}

.btn-download-sm.disabled {
    background: #94a3b8;
    cursor: not-allowed;
}

.empty-block {
    text-align: center;
    color: #94a3b8;
    padding: 40px 20px;
    font-style: italic;
    background: #f8fafc;
    border-radius: 12px;
}

/* ─── Аудио-плеер ─── */
.audio-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    min-width: 280px;
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
}

.audio-cell audio {
    width: 320px;
    height: 40px;
    outline: none;
}

.audio-cell audio::-webkit-media-controls-overflow-button,
.audio-cell audio::-webkit-media-controls-download-button,
.audio-cell audio::-internal-media-controls-download-button {
    display: none !important;
    -webkit-appearance: none !important;
}

.audio-cell audio::-webkit-media-controls-panel .audio-overflow-button,
.audio-cell audio::-webkit-media-controls-panel [aria-label="More options"],
.audio-cell audio::-webkit-media-controls-panel [aria-label="More"] {
    display: none !important;
}

.audio-controls {
    display: flex;
    gap: 8px;
    margin-top: 2px;
}

.audio-seek-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 20px;
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    color: #475569;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.15s;
    font-family: 'Inter', sans-serif;
    line-height: 1.4;
}

.audio-seek-btn:hover {
    background: #eef2ff;
    border-color: #2563eb;
    color: #1e40af;
}

.audio-seek-btn:active { transform: scale(0.96); }
.audio-seek-btn i { font-size: 11px; }

.audio-download {
    font-size: 12px;
    color: #2563eb;
    text-decoration: none;
    font-weight: 600;
}

.audio-download:hover { text-decoration: underline; }

.audio-download.disabled {
    color: #94a3b8;
    cursor: not-allowed;
}

/* ─── Пагинация ─── */
.pagination-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    padding: 12px 18px;
    background: #f8fafc;
    border-radius: 12px;
    font-size: 14px;
}

.pagination-top    { margin-bottom: 12px; }
.pagination-bottom { margin-top: 15px; }

.pagination-total strong {
    color: #0f172a;
    font-size: 16px;
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.page-size-select {
    padding: 6px 10px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    background: white;
}

.page-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid #cbd5e1;
    background: white;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.page-num {
    min-width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    background: white;
    color: #475569;
    font-weight: 600;
    cursor: pointer;
    padding: 0 8px;
    font-family: 'Inter', sans-serif;
}

.page-num.active {
    background: #2563eb;
    color: white;
    border-color: #2563eb;
}

.page-jump-input {
    width: 60px;
    padding: 6px 8px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    text-align: center;
}

.page-jump-btn {
    padding: 6px 12px;
    border-radius: 8px;
    border: none;
    background: #2563eb;
    color: white;
    font-weight: 600;
    cursor: pointer;
}

/* ─── Модальные окна ─── */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 15px;
}

.modal-overlay.active { display: flex; }

.modal-box {
    background: white;
    border-radius: 20px;
    padding: 30px;
    max-width: 720px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0,20,80,0.15);
    max-height: 90vh;
    overflow-y: auto;
}

.modal-box h3 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 12px;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-box h3 i { color: #f59e0b; }

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.modal-actions button {
    padding: 10px 24px;
    border-radius: 30px;
    border: none;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
}

.modal-actions .btn-secondary {
    background: #64748b;
    color: white;
}

.modal-actions .btn-secondary:hover { background: #475569; }

.modal-actions .btn-primary {
    background: #f59e0b;
    color: white;
}

.modal-actions .btn-primary:hover { background: #d97706; }
.modal-actions .btn-primary:disabled {
    background: #cbd5e1;
    cursor: not-allowed;
}

/* ─── Модалка обновления контента ─── */
.refresh-modal-sources {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin: 18px 0;
    max-height: 55vh;
    overflow-y: auto;
    padding-right: 4px;
}

.refresh-source-block {
    border: 2px solid #e2e8f0;
    border-radius: 14px;
    padding: 16px 18px;
    background: #f8fafc;
}

.refresh-source-header {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 700;
    color: #0f172a;
    cursor: pointer;
    user-select: none;
    padding-bottom: 12px;
    border-bottom: 1px dashed #cbd5e1;
    margin-bottom: 12px;
}

.refresh-source-header input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #f59e0b;
    cursor: pointer;
}

.refresh-source-header i {
    color: #f59e0b;
    font-size: 18px;
}

.refresh-source-sections {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-left: 28px;
}

.refresh-source-sections label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: #334155;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 8px;
    transition: background 0.15s;
}

.refresh-source-sections label:hover { background: #eef2ff; }

.refresh-source-sections input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #f59e0b;
    cursor: pointer;
}

.refresh-empty {
    color: #94a3b8;
    font-style: italic;
    font-size: 13px;
    padding: 8px 0 4px;
}

.refresh-loading {
    text-align: center;
    color: #94a3b8;
    padding: 40px 0;
    font-size: 14px;
}

.refresh-hint {
    color: #64748b;
    font-size: 13px;
    margin-bottom: 6px;
    line-height: 1.5;
}

/* ─── Тост-уведомление ─── */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    padding: 14px 20px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,20,80,0.18);
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-weight: 600;
    font-size: 14px;
    z-index: 10001;
    transform: translateX(120%);
    transition: transform 0.3s ease;
    max-width: 420px;
}

.toast.show { transform: translateX(0); }

.toast i {
    font-size: 20px;
    margin-top: 1px;
    flex-shrink: 0;
}

.toast-success { border-left: 4px solid #16a34a; }
.toast-success i { color: #16a34a; }
.toast-error { border-left: 4px solid #dc2626; }
.toast-error i { color: #dc2626; }
.toast-info { border-left: 4px solid #2563eb; }
.toast-info i { color: #2563eb; }

/* ============================================================
   ХЛЕБНЫЕ КРОШКИ
   ============================================================ */
.breadcrumbs {
    display: none;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 16px;
    padding: 8px 14px;
    background: #f8fafc;
    border-radius: 30px;
    font-size: 13px;
    color: #64748b;
    border: 1px solid #e2e8f0;
    line-height: 1.4;
    min-height: 36px;
}

.breadcrumbs--active {
    display: flex;
}

.breadcrumbs__link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border: none;
    background: transparent;
    color: #2563eb;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 20px;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
}

.breadcrumbs__link:hover {
    background: #eef2ff;
    color: #1d4ed8;
}

.breadcrumbs__link i { font-size: 12px; }

.breadcrumbs__sep {
    color: #cbd5e1;
    font-size: 14px;
    font-weight: 400;
    padding: 0 2px;
    user-select: none;
}

.breadcrumbs__current {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    color: #0f172a;
    font-weight: 600;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 320px;
}

.breadcrumbs__current i {
    color: #64748b;
    font-size: 12px;
}

/* ============================================================
   КНОПКА «ПОДЕЛИТЬСЯ» В СТРОКЕ ТАБЛИЦЫ
   ------------------------------------------------------------
   Маленькая круглая иконка 🔗 рядом с названием файла.
   При клике копирует ссылку в буфер. На 1.5 сек превращается
   в зелёную галочку (класс .share-btn--copied).
   ============================================================ */
.share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid #cbd5e1;
    background: white;
    color: #64748b;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.1s;
    margin-left: 6px;
    vertical-align: middle;
    flex-shrink: 0;
    padding: 0;
    font-family: 'Inter', sans-serif;
}

.share-btn:hover {
    background: #eef2ff;
    color: #2563eb;
    border-color: #2563eb;
    transform: scale(1.05);
}

.share-btn:active {
    transform: scale(0.95);
}

.share-btn--copied {
    background: #dcfce7;
    color: #16a34a;
    border-color: #16a34a;
}

.share-btn--copied:hover {
    background: #dcfce7;
    color: #16a34a;
    border-color: #16a34a;
    transform: none;
}

/* ============================================================
   ПОДСВЕТКА СТРОКИ, НА КОТОРУЮ ВЕДЁТ DEEP-LINK
   ------------------------------------------------------------
   Класс .row-highlight навешивается на <tr> при переходе по
   хэшу #section/file_id. Через 3 секунды снимается.
   ============================================================ */
.content-table tbody tr.row-highlight {
    animation: rowHighlight 3s ease-out 1;
}

@keyframes rowHighlight {
    0%   { background: #fef3c7; box-shadow: inset 0 0 0 2px #f59e0b; }
    60%  { background: #fef3c7; box-shadow: inset 0 0 0 2px #f59e0b; }
    100% { background: transparent; box-shadow: none; }
}

/* ─── Мобильная адаптация ─── */
@media (max-width: 900px) {
    body { padding: 8px; }

    .container { border-radius: 20px; }

    header { padding: 12px 16px; gap: 10px; }

    .logo { font-size: 20px; }

    .header-actions { width: 100%; justify-content: center; gap: 5px; }
    .header-actions a,
    .header-actions button { padding: 7px 12px; font-size: 12px; }

    .main-layout { flex-direction: column; }

    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 2px solid #eef2ff;
        padding: 12px;
    }

    .sidebar-nav {
        flex-direction: row;
        flex-wrap: nowrap;
        overflow-x: auto;
        gap: 6px;
    }

    .sidebar .nav-link {
        flex-shrink: 0;
        width: auto;
        padding: 8px 14px;
        font-size: 13px;
        margin-bottom: 0;
        white-space: nowrap;
        border-radius: 30px;
    }

    .content-area { padding: 14px 12px; }
    .section-title { font-size: 20px; }

    .folder-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }

    .content-table-wrapper { margin: 0 -12px; padding: 0 12px; }
    .content-table { font-size: 12px; }

    .audio-cell { min-width: 0; }
    .audio-cell audio { width: 220px; height: 36px; }

    .welcome-grid { grid-template-columns: 1fr; }
    .welcome-hero { padding: 22px 18px; }
    .welcome-hero h1 { font-size: 22px; }

    .top10-grid { grid-template-columns: 1fr; }
    .top10-section { padding: 20px 18px; }

    .pagination-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        padding: 10px 12px;
        font-size: 12px;
    }

    .pagination-controls {
        justify-content: center;
        gap: 6px;
        flex-wrap: wrap;
    }

    .modal-box { padding: 20px; }

    .toast { left: 20px; right: 20px; max-width: none; }

    /* Компактные крошки на мобильных */
    .breadcrumbs {
        padding: 6px 10px;
        font-size: 12px;
        margin-bottom: 12px;
        border-radius: 22px;
        gap: 2px;
    }
    .breadcrumbs__link,
    .breadcrumbs__current {
        padding: 3px 8px;
        font-size: 12px;
        max-width: 180px;
    }
    .breadcrumbs__link i,
    .breadcrumbs__current i { font-size: 11px; }
    .breadcrumbs__sep { font-size: 12px; }

    /* Компактная кнопка «Поделиться» на мобильных */
    .share-btn {
        width: 26px;
        height: 26px;
        font-size: 11px;
        margin-left: 4px;
    }
}
