/* Админка: простая вёрстка для десктопа */
body.admin-body {
    margin: 0;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    background: #f4f6f8;
    color: #1a1a1a;
}

.admin-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 0.75rem 1.25rem;
    background: #111827;
    color: #fff;
}

.admin-brand {
    color: #fff;
    font-weight: 700;
    text-decoration: none;
}

.admin-header-menu {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex: 1 1 auto;
}

.admin-nav a {
    color: #e5e7eb;
    text-decoration: none;
    margin-right: 1rem;
}

.admin-user {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
}

.admin-logout {
    display: inline;
    margin: 0;
}

.admin-logout button {
    background: #374151;
    color: #fff;
    border: 0;
    padding: 0.35rem 0.65rem;
    border-radius: 4px;
    cursor: pointer;
}

.admin-header-button {
    display: inline-block;
    background: #374151;
    color: #fff;
    border: 0;
    padding: 0.35rem 0.65rem;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
}

.admin-menu-toggle,
.admin-menu-button {
    display: none;
}

.admin-main {
    max-width: 1100px;
    margin: 1.25rem auto;
    padding: 0 1rem 2rem;
}

.admin-card {
    background: #fff;
    border-radius: 8px;
    padding: 1.25rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
    margin-bottom: 1rem;
}

.admin-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0.75rem 0;
}

.admin-actions a,
.admin-actions button {
    text-decoration: none;
    border-radius: 4px;
    padding: 0.45rem 0.75rem;
    border: 1px solid #d1d5db;
    background: #fff;
    cursor: pointer;
    font-size: 0.9rem;
}

.admin-actions .primary {
    background: #2563eb;
    border-color: #2563eb;
    color: #fff;
}

.admin-actions .danger {
    background: #b91c1c;
    border-color: #b91c1c;
    color: #fff;
}

button.primary {
    background: #2563eb;
    border: 1px solid #2563eb;
    color: #fff;
    border-radius: 4px;
    padding: 0.45rem 0.85rem;
    cursor: pointer;
}

button.danger {
    background: #b91c1c;
    border: 1px solid #b91c1c;
    color: #fff;
    border-radius: 4px;
    padding: 0.45rem 0.85rem;
    cursor: pointer;
}

.admin-button {
    display: inline-block;
    box-sizing: border-box;
    text-decoration: none;
    border-radius: 4px;
    padding: 0.45rem 0.85rem;
    border: 1px solid #d1d5db;
    background: #fff;
    color: #1a1a1a;
    cursor: pointer;
    font: inherit;
    font-size: 0.9rem;
}

table.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
}

table.admin-table th,
table.admin-table td {
    border-bottom: 1px solid #e5e7eb;
    padding: 0.55rem 0.35rem;
    text-align: left;
    vertical-align: top;
}

table.admin-table th {
    font-weight: 600;
    color: #374151;
}

.admin-muted {
    color: #6b7280;
    font-size: 0.88rem;
}

.admin-screen-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.admin-screen-group-title {
    margin: 1.25rem 0 0.65rem;
    color: #374151;
    font-size: 1rem;
}

.admin-screen-card {
    position: relative;
    min-height: 240px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 8px 20px rgba(17, 24, 39, 0.06);
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.admin-screen-card:hover {
    transform: translateY(-2px);
    border-color: #bfdbfe;
    box-shadow: 0 14px 28px rgba(17, 24, 39, 0.1);
}

.admin-screen-card-main {
    position: absolute;
    inset: 0;
    z-index: 1;
    text-decoration: none;
}

.admin-screen-card-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    min-height: 208px;
    padding: 1rem;
    pointer-events: none;
}

.admin-screen-card-kicker {
    color: #6b7280;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.admin-screen-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    margin: 0.25rem 0 0.6rem;
}

.admin-screen-card h2 {
    margin: 0;
    font-size: 1.25rem;
    line-height: 1.2;
}

.admin-screen-open-player {
    position: relative;
    z-index: 3;
    flex: 0 0 auto;
    padding: 0.3rem 0.55rem;
    border: 1px solid #d1d5db;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.86);
    color: #111827;
    font-size: 0.8rem;
    line-height: 1.2;
    text-decoration: none;
    pointer-events: auto;
}

.admin-screen-open-player:hover {
    border-color: #2563eb;
    color: #2563eb;
}

.admin-screen-queues {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    margin-top: auto;
}

.admin-screen-queue-block {
    padding-top: 0.65rem;
    border-top: 1px solid #eef2f7;
}

.admin-screen-queue-block-event {
    padding: 0.65rem;
    border: 1px solid #bfdbfe;
    border-radius: 10px;
    background: #eff6ff;
}

.admin-screen-queue-title {
    margin-bottom: 0.45rem;
    color: #374151;
    font-size: 0.82rem;
    font-weight: 700;
}

.admin-screen-thumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
}

.admin-screen-thumb-wrap {
    position: relative;
    display: block;
    z-index: 3;
    width: 4.8rem;
    height: 3.25rem;
    overflow: hidden;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #e5e7eb;
    pointer-events: auto;
}

.admin-screen-thumb {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.admin-screen-video-mark {
    position: absolute;
    right: 0.25rem;
    bottom: 0.2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 999px;
    background: rgba(17, 24, 39, 0.72);
    color: #fff;
    font-size: 0.65rem;
}

.admin-screen-no-slides {
    color: #6b7280;
    font-size: 0.9rem;
}

.admin-screen-add-slide {
    position: relative;
    z-index: 3;
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 4.8rem;
    height: 3.25rem;
    border: 1px solid rgba(37, 99, 235, 0.35);
    border-radius: 8px;
    background: rgba(37, 99, 235, 0.2);
    color: #2563eb;
    font-size: 2rem;
    line-height: 1;
    text-decoration: none;
    pointer-events: auto;
}

.admin-screen-add-slide:hover {
    background: rgba(37, 99, 235, 0.78);
    color: #fff;
}

.admin-tabs {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
    margin: 0.75rem 0 1rem;
}

.admin-tabs a {
    padding: 0.4rem 0.75rem;
    border-radius: 999px;
    text-decoration: none;
    border: 1px solid #d1d5db;
    color: #111827;
    background: #fff;
}

.admin-tabs a.active {
    background: #111827;
    color: #fff;
    border-color: #111827;
}

label.admin-field {
    display: block;
    margin: 0.65rem 0 0.25rem;
    font-weight: 600;
    font-size: 0.88rem;
}

input.admin-input,
select.admin-input,
textarea.admin-input {
    width: 100%;
    max-width: 520px;
    box-sizing: border-box;
    padding: 0.45rem 0.55rem;
    border: 1px solid #d1d5db;
    border-radius: 4px;
}

textarea.admin-input {
    min-height: 80px;
}

.admin-form-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
}

.admin-errors {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
    padding: 0.75rem;
    border-radius: 6px;
    margin-bottom: 1rem;
}

.admin-sortable tbody tr .slide-drag-handle {
    cursor: grab;
}

.admin-sortable tbody tr .slide-drag-handle:active {
    cursor: grabbing;
}

.admin-sort-mode-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin: 0.75rem 0 0;
    padding: 0.5rem 0.65rem;
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 6px;
}

.admin-sort-mode-label {
    font-size: 0.9rem;
    cursor: pointer;
}

.admin-bulk-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin: 0.75rem 0 0;
    padding: 0.5rem 0.65rem;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
}

.admin-bulk-label {
    font-size: 0.88rem;
    color: #374151;
    margin-right: 0.25rem;
}

.admin-bulk-bar button {
    text-decoration: none;
    border-radius: 4px;
    padding: 0.4rem 0.7rem;
    border: 1px solid #d1d5db;
    background: #fff;
    cursor: pointer;
    font-size: 0.88rem;
}

.admin-bulk-bar button.danger {
    background: #b91c1c;
    border-color: #b91c1c;
    color: #fff;
}

.admin-th-check,
.admin-td-check {
    width: 2rem;
    text-align: center;
    vertical-align: middle;
}

.admin-slide-preview {
    width: 5.5rem;
    padding: 0.35rem !important;
    vertical-align: middle;
}

.admin-slide-thumb {
    display: block;
    width: 5rem;
    height: 3.5rem;
    object-fit: cover;
    border-radius: 4px;
    background: #e5e7eb;
    border: 1px solid #e5e7eb;
}

video.admin-slide-thumb {
    object-fit: cover;
}

.admin-slide-thumb-link {
    position: relative;
    display: inline-block;
    line-height: 0;
}

.admin-slide-thumb-zoom {
    position: absolute;
    left: calc(100% + 0.5rem);
    top: 50%;
    transform: translateY(-50%);
    width: 20rem;
    height: 14rem;
    border-radius: 8px;
    border: 1px solid #d1d5db;
    background: #0b1220;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.12s ease;
    z-index: 10;
}

.admin-slide-thumb-zoom-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.admin-slide-thumb-link:hover .admin-slide-thumb-zoom,
.admin-slide-thumb-link:focus-visible .admin-slide-thumb-zoom,
.admin-slide-thumb-link:focus-within .admin-slide-thumb-zoom {
    opacity: 1;
}

.admin-slide-edit-preview {
    margin: 0.75rem 0 1rem;
}

.admin-slide-edit-preview h2 {
    margin: 0 0 0.65rem;
    font-size: 1.1rem;
}

.admin-slide-edit-frame {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 760px;
    min-height: 260px;
    background: #111827;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
}

.admin-slide-edit-media {
    display: block;
    width: 100%;
    max-height: 520px;
    object-fit: contain;
}

.admin-modal {
    width: min(92vw, 520px);
    padding: 0;
    border: 0;
    border-radius: 10px;
    box-shadow: 0 20px 60px rgba(17, 24, 39, 0.35);
}

.admin-modal::backdrop {
    background: rgba(17, 24, 39, 0.55);
}

.admin-modal-card {
    padding: 1.25rem;
}

.admin-modal-card h2 {
    margin: 0 0 0.75rem;
    font-size: 1.15rem;
}

.admin-screen-sort-modal {
    width: min(94vw, 840px);
}

.admin-sort-screens-list {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    max-height: 62vh;
    overflow: auto;
    padding-right: 0.25rem;
}

.admin-sort-screen-row {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) 110px;
    gap: 0.65rem;
    align-items: end;
    padding: 0.65rem;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #f9fafb;
}

.admin-sort-screen-name {
    align-self: center;
    font-weight: 600;
}

.admin-sort-screen-row label span {
    display: block;
    margin-bottom: 0.25rem;
    color: #6b7280;
    font-size: 0.8rem;
}

.admin-sort-screen-row .admin-input {
    max-width: none;
}

.admin-sort-order-input {
    text-align: right;
}

@media (max-width: 720px) {
    .admin-header {
        position: relative;
        flex-wrap: wrap;
        gap: 0.75rem;
    }

    .admin-brand {
        flex: 1 1 auto;
    }

    .admin-menu-button {
        display: inline-flex;
        width: 2.25rem;
        height: 2.25rem;
        align-items: center;
        justify-content: center;
        flex-direction: column;
        gap: 0.25rem;
        border: 1px solid #4b5563;
        border-radius: 6px;
        background: #374151;
        cursor: pointer;
    }

    .admin-menu-button span {
        display: block;
        width: 1.1rem;
        height: 2px;
        border-radius: 999px;
        background: #fff;
    }

    .admin-header-menu {
        display: none;
        flex: 1 0 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
        padding-top: 0.75rem;
        border-top: 1px solid #374151;
    }

    .admin-menu-toggle:checked ~ .admin-header-menu {
        display: flex;
    }

    .admin-nav {
        display: flex;
        flex-direction: column;
        gap: 0.4rem;
    }

    .admin-nav a {
        margin-right: 0;
        padding: 0.35rem 0;
    }

    .admin-user {
        margin-left: 0;
        flex-wrap: wrap;
        align-items: center;
        justify-content: flex-start;
    }

    .admin-sort-screen-row {
        grid-template-columns: 1fr;
    }
}
