/* Общая тема оформления: публичная страница скачивания + админка */

:root {
    --bg: #eef1f6;
    --surface: #ffffff;
    --border: #e2e6ee;
    --text: #1d2433;
    --muted: #6b7590;
    --brand: #2f6bff;
    --brand-dark: #1f4fd0;
    --radius: 14px;
    --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 12px 32px rgba(16, 24, 40, .08);
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    min-height: 100vh;
}

a { color: var(--brand); }
a:hover { color: var(--brand-dark); }

.card,
.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.page-title {
    font-weight: 650;
    letter-spacing: -.01em;
}

.muted { color: var(--muted); }

/* --- Навигация админки --- */
.app-nav {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: .65rem 0;
    margin-bottom: 1.75rem;
}
.app-nav .brand {
    font-weight: 650;
    color: var(--text);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: .5rem;
}
.app-nav .brand .dot {
    width: 10px; height: 10px; border-radius: 50%;
    background: var(--brand);
    display: inline-block;
}
.app-nav .nav-link-btn {
    color: var(--muted);
    text-decoration: none;
    padding: .35rem .7rem;
    border-radius: 8px;
    font-size: .925rem;
    white-space: nowrap;
}
.app-nav .nav-link-btn:hover { background: #f2f5fa; color: var(--text); }
.app-nav .nav-link-btn.active { background: #eaf0ff; color: var(--brand-dark); font-weight: 600; }

/* --- Формы и кнопки --- */
.btn-primary {
    --bs-btn-bg: var(--brand);
    --bs-btn-border-color: var(--brand);
    --bs-btn-hover-bg: var(--brand-dark);
    --bs-btn-hover-border-color: var(--brand-dark);
    --bs-btn-active-bg: var(--brand-dark);
    --bs-btn-active-border-color: var(--brand-dark);
}
.form-control:focus, .form-select:focus {
    border-color: #a9c1ff;
    box-shadow: 0 0 0 .2rem rgba(47, 107, 255, .15);
}
.form-label { font-weight: 500; }

/* --- Вход --- */
.auth-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.auth-card {
    width: 100%;
    max-width: 400px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 32px 28px;
}

/* --- Публичная страница скачивания --- */
.download-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.download-card {
    width: 100%;
    max-width: 460px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: var(--shadow);
    padding: 36px 32px;
    text-align: center;
}
.file-icon {
    font-size: 48px;
    line-height: 1;
    margin-bottom: 14px;
}
.file-name {
    font-size: 1.15rem;
    font-weight: 600;
    word-break: break-word;
    margin-bottom: .35rem;
}
.file-meta {
    color: var(--muted);
    font-size: .9rem;
    margin-bottom: 1.5rem;
}
.btn-download {
    --bs-btn-padding-y: .7rem;
    --bs-btn-font-size: 1.05rem;
    font-weight: 600;
}
.download-note {
    margin-top: 1.15rem;
    font-size: .82rem;
    color: var(--muted);
}
.status-icon {
    font-size: 44px;
    line-height: 1;
    margin-bottom: 12px;
}

/* --- Таблица файлов --- */
.files-table { --bs-table-bg: transparent; }
.files-table thead th {
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--muted);
    font-weight: 600;
    border-bottom-width: 1px;
    white-space: nowrap;
}
.files-table td { vertical-align: middle; }
.files-table .fname {
    font-weight: 550;
    word-break: break-word;
    max-width: 260px;
}
.link-cell { display: flex; align-items: center; gap: .4rem; }
.link-cell input {
    font-size: .85rem;
    background: #f6f8fc;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: .3rem .55rem;
    width: 100%;
    min-width: 240px;
    color: var(--muted);
}
.progress-mini {
    height: 6px;
    background: #edf0f6;
    border-radius: 99px;
    overflow: hidden;
    margin-top: 4px;
}
.progress-mini span { display: block; height: 100%; background: var(--brand); }
.progress-mini.full span { background: #dc3545; }
.actions-cell { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; }
.actions-cell input[type=number] { width: 74px; }

.empty-state {
    text-align: center;
    padding: 48px 20px;
    color: var(--muted);
}
.empty-state .icon { font-size: 40px; margin-bottom: 10px; }

@media (max-width: 767px) {
    .app-nav .nav-link-btn { padding: .3rem .5rem; font-size: .85rem; }
}
