/* ================================================================
   ВидеоПортал — Стили панели управления
   ================================================================ */

/* ─── Тело страницы ──────────────────────────────────────────── */
.admin-body {
    display: flex;
    min-height: 100vh;
    background: var(--bg);
}

/* ================================================================
   БОКОВАЯ ПАНЕЛЬ
   ================================================================ */
.adm-sidebar {
    width: 230px;
    min-height: 100vh;
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.adm-sidebar__brand {
    padding: 22px 20px 16px;
    border-bottom: 1px solid var(--border);
}
.adm-sidebar__brand a {
    display: block;
    font-family: var(--ff-head);
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 3px;
    line-height: 1;
}
.adm-sidebar__brand a strong { color: var(--accent); }
.adm-sidebar__brand span {
    font-size: 11px;
    color: var(--text-3);
}

.adm-sidebar__nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 14px 10px;
    flex: 1;
}
.adm-sidebar__nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 13px;
    border-radius: var(--radius-sm);
    color: var(--text-2);
    font-size: 13.5px;
    font-weight: 500;
    transition: background var(--ease), color var(--ease);
}
.adm-sidebar__nav a:hover    { background: var(--surface2); color: var(--text); }
.adm-sidebar__nav a.is-active{ background: var(--surface2); color: var(--text);
    box-shadow: inset 3px 0 0 var(--accent); }

.adm-sidebar__logout {
    display: block;
    padding: 14px 20px;
    border-top: 1px solid var(--border);
    font-size: 12.5px;
    color: var(--text-3);
    transition: color var(--ease);
}
.adm-sidebar__logout:hover { color: var(--accent); }

/* ================================================================
   ОСНОВНАЯ ОБЛАСТЬ
   ================================================================ */
.adm-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.adm-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 28px;
    border-bottom: 1px solid var(--border);
    background: rgba(24,24,31,.7);
    backdrop-filter: blur(8px);
    position: sticky;
    top: 0;
    z-index: 50;
    gap: 16px;
}
.adm-topbar h1 {
    font-family: var(--ff-head);
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -.3px;
}

/* ─── Кнопки ─────────────────────────────────────────────────── */
.adm-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    background: var(--accent);
    color: #fff;
    padding: 9px 22px;
    border-radius: 22px;
    font-size: 13.5px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: background var(--ease), transform var(--ease);
    white-space: nowrap;
}
.adm-btn:hover  { background: var(--accent-dark); }
.adm-btn:active { transform: scale(.97); }

.adm-btn--ghost {
    background: transparent;
    border: 1px solid var(--border2);
    color: var(--text-2);
}
.adm-btn--ghost:hover { background: var(--surface2); color: var(--text); border-color: var(--text-3); }

.adm-btn--full { width: 100%; padding: 12px; font-size: 15px; border-radius: var(--radius-sm); }
.adm-btn--lg   { padding: 11px 32px; font-size: 14px; border-radius: 26px; }

.adm-btn--xs {
    padding: 4px 10px;
    border-radius: var(--radius-xs);
    font-size: 11.5px;
    background: var(--surface2);
    color: var(--text-2);
    border: 1px solid var(--border);
}
.adm-btn--xs:hover { background: var(--hover); color: var(--text); }
.adm-btn--danger   { color: var(--accent) !important; border-color: rgba(230,57,70,.35) !important; }
.adm-btn--danger:hover { background: rgba(230,57,70,.12) !important; }

/* ─── Алерты ─────────────────────────────────────────────────── */
.adm-alert {
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    margin: 16px 28px 0;
}
.adm-alert--ok  {
    background: rgba(110,231,160,.08);
    border: 1px solid rgba(110,231,160,.25);
    color: #6ee7a0;
}
.adm-alert--err {
    background: rgba(230,57,70,.08);
    border: 1px solid rgba(230,57,70,.25);
    color: var(--accent);
}

/* ─── Статистика ─────────────────────────────────────────────── */
.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 14px;
    padding: 24px 28px 0;
}
.stat-tile {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: border-color var(--ease);
}
.stat-tile:hover { border-color: var(--border2); }
.stat-tile__icon { font-size: 26px; flex-shrink: 0; }
.stat-tile__num  { font-family: var(--ff-head); font-size: 24px; font-weight: 900; line-height: 1; margin-bottom: 2px; }
.stat-tile__label{ font-size: 11.5px; color: var(--text-2); }

/* ─── Быстрые действия ───────────────────────────────────────── */
.quick-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    padding: 20px 28px;
}
.qa-card {
    display: flex;
    align-items: center;
    gap: 9px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 13px 18px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-2);
    transition: all var(--ease);
    cursor: pointer;
}
.qa-card:hover {
    background: var(--surface2);
    border-color: var(--accent);
    color: var(--text);
    transform: translateY(-2px);
}
.qa-card span { font-size: 11px; }

/* ─── Карточка-секция ────────────────────────────────────────── */
.adm-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px 24px;
    margin: 0 28px 22px;
}
.adm-card h2 {
    font-family: var(--ff-head);
    font-size: 13px;
    font-weight: 700;
    color: var(--text-2);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 16px;
}
.adm-hint { font-size: 13px; color: var(--text-2); margin-bottom: 18px; line-height: 1.6; }

/* ─── Таблицы ────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
.adm-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.adm-table th {
    text-align: left;
    padding: 9px 12px;
    border-bottom: 1px solid var(--border);
    color: var(--text-3);
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .7px;
    white-space: nowrap;
}
.adm-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
.adm-table tr:last-child td { border-bottom: none; }
.adm-table tbody tr:hover td { background: rgba(255,255,255,.02); }

.thumb-sm {
    width: 82px; height: 46px;
    object-fit: cover;
    border-radius: var(--radius-xs);
    background: #0a0a10;
    display: block;
}

/* Бейджи */
.badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 3px;
    letter-spacing: .3px;
    vertical-align: middle;
}
.badge-yt    { background: #ff0000; color: #fff; }
.badge-mp4   { background: #1a2f4a; color: #70b8ff; }
.badge-short { background: rgba(230,57,70,.15); color: var(--accent); border: 1px solid rgba(230,57,70,.25); }

.td-actions  { white-space: nowrap; }
.td-comment  { max-width: 340px; word-break: break-word; color: var(--text-2); }

/* ─── Табы ───────────────────────────────────────────────────── */
.adm-tabs {
    display: flex;
    gap: 4px;
    padding: 20px 28px 0;
}
.adm-tab {
    padding: 9px 20px;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-2);
    background: var(--surface);
    border: 1px solid var(--border);
    border-bottom: none;
    transition: all var(--ease);
    cursor: pointer;
}
.adm-tab:hover    { color: var(--text); background: var(--surface2); }
.adm-tab.is-active{ color: var(--text); background: var(--surface2); border-color: var(--border2); }

/* ─── Пагинация ──────────────────────────────────────────────── */
.adm-pagination {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 20px;
}
.adm-page {
    width: 34px; height: 34px;
    display: flex; align-items: center; justify-content: center;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--text-2);
    transition: all var(--ease);
}
.adm-page:hover    { border-color: var(--accent); color: var(--text); }
.adm-page.is-active{ background: var(--accent); border-color: var(--accent); color: #fff; }

/* ─── Поля формы ─────────────────────────────────────────────── */
.adm-form { max-width: 520px; }
.adm-field {
    margin-bottom: 18px;
}
.adm-field label {
    display: block;
    font-size: 11.5px;
    font-weight: 700;
    color: var(--text-2);
    text-transform: uppercase;
    letter-spacing: .6px;
    margin-bottom: 7px;
}
.adm-field input[type="text"],
.adm-field input[type="url"],
.adm-field input[type="password"],
.adm-field input[type="number"],
.adm-field input[type="file"],
.adm-field select,
.adm-field textarea,
.adm-input {
    width: 100%;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    padding: 9px 13px;
    font-size: 13.5px;
    transition: border-color var(--ease);
}
.adm-field input:focus,
.adm-field select:focus,
.adm-field textarea:focus,
.adm-input:focus {
    outline: none;
    border-color: var(--accent);
}
.adm-field small {
    display: block;
    font-size: 11px;
    color: var(--text-3);
    margin-top: 5px;
    line-height: 1.5;
}
.adm-field--check label {
    display: flex;
    align-items: center;
    gap: 9px;
    text-transform: none;
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    cursor: pointer;
}
.adm-field--check input[type="checkbox"] {
    width: 15px; height: 15px;
    accent-color: var(--accent);
    flex-shrink: 0;
}

/* Строка-форма (категории) */
.inline-form {
    display: flex;
    gap: 10px;
    align-items: center;
    max-width: 420px;
}
.inline-form .adm-input { flex: 1; }

/* ─── Зона перетаскивания ────────────────────────────────────── */
.dropzone {
    border: 2px dashed var(--border2);
    border-radius: var(--radius);
    padding: 52px 24px;
    text-align: center;
    cursor: pointer;
    transition: border-color var(--ease), background var(--ease);
    color: var(--text-2);
    margin-bottom: 24px;
}
.dropzone:hover,
.dropzone.dz-over {
    border-color: var(--accent);
    background: var(--accent-glow);
    color: var(--text);
}
.dropzone__icon { font-size: 40px; margin-bottom: 12px; }
.dropzone__hint { font-size: 11.5px; color: var(--text-3); margin-top: 6px; }
.dz-link {
    color: var(--accent);
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* Строка загружаемого файла */
.file-row {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 18px;
    margin-bottom: 12px;
    animation: fadeIn .25s ease;
}
@keyframes fadeIn { from { opacity:0; transform:translateY(-8px); } to { opacity:1; transform:none; } }

.file-row__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}
.file-row__name { font-size: 13px; font-weight: 600; color: var(--text); }
.file-row__size { font-size: 12px; color: var(--text-3); }
.file-row__fields {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr auto;
    gap: 12px;
    align-items: end;
}
@media (max-width: 860px) {
    .file-row__fields { grid-template-columns: 1fr 1fr; }
}

/* ─── Страница входа ─────────────────────────────────────────── */
.is-login {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.login-box {
    width: 100%;
    max-width: 360px;
}
.login-brand {
    text-align: center;
    margin-bottom: 28px;
}
.login-play {
    display: block;
    width: 56px; height: 56px;
    background: var(--accent);
    border-radius: 14px;
    font-size: 24px;
    line-height: 56px;
    text-align: center;
    margin: 0 auto 14px;
    color: #fff;
    box-shadow: 0 0 28px var(--accent-glow);
}
.login-brand h1 {
    font-family: var(--ff-head);
    font-size: 24px;
    font-weight: 900;
    margin-bottom: 4px;
}
.login-brand h1 strong { color: var(--accent); }
.login-brand p { font-size: 13px; color: var(--text-3); }

.login-form {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 26px 22px;
    margin-bottom: 14px;
}
.login-hint {
    text-align: center;
    font-size: 11.5px;
    color: var(--text-3);
}

/* ─── Вспомогательные ────────────────────────────────────────── */
.text-muted { color: var(--text-3); font-size: 12px; }

@media (max-width: 860px) {
    .adm-sidebar { display: none; }
    .adm-topbar  { padding: 14px 16px; }
    .adm-card    { margin: 0 14px 16px; padding: 16px; }
    .adm-alert   { margin: 12px 14px 0; }
    .adm-tabs    { padding: 16px 14px 0; }
    .stats-row   { padding: 16px 14px 0; }
    .quick-actions { padding: 14px; }
}
