:root {
    --admin-surface: #ffffff;
    --admin-muted: #667085;
    --admin-border: #d9dee7;
    --admin-soft: #f6f8fb;
    --admin-focus: #206bc4;
}

.admin-sidebar {
    box-shadow: 1px 0 0 rgba(255, 255, 255, 0.08);
}

.admin-brand {
    color: #3d3d3d;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0;
    padding: 18px 12px 4px;
}

.admin-nav-section {
    color: #3d3d3d;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0;
    padding: 18px 12px 6px;
    text-transform: uppercase;
}

.navbar-dark .navbar-nav .nav-link.active {
    background: rgba(255, 255, 255, 0.12);
    border-radius: 7px;
    color: #ad7979;
    font-weight: 700;
}

.page-header {
    background: rgba(246, 248, 251, 0.92);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--admin-border);
    position: sticky;
    top: 0;
    z-index: 3;
}

.page-title {
    letter-spacing: 0;
}

.admin-page-actions {
    align-items: center;
    display: flex;
    gap: 8px;
    padding-bottom: 10px;
}

.page-body {
    padding-bottom: 96px;
}

.contests-background, .contact-background, .par-background, .adjudicators-background, .sponsors-background, .gallery-background {
    background-color: rgb(250, 250, 250);
    border-radius: 5px;
    padding: 25px;
}

details[class*="_spoiler"] {
    background: var(--admin-surface);
    border: 1px solid var(--admin-border);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(16, 24, 40, 0.04);
    overflow: hidden;
}

details[class*="_spoiler"] > summary {
    align-items: center;
    cursor: pointer;
    display: flex;
    font-weight: 700;
    gap: 12px;
    justify-content: flex-start;
    list-style: none;
    min-height: 52px;
    padding: 14px 18px;
    user-select: none;
}

details[class*="_spoiler"] > summary::-webkit-details-marker {
    display: none;
}

details[class*="_spoiler"] > summary::after {
    color: var(--admin-muted);
    content: "Открыть";
    font-size: 12px;
    font-weight: 600;
    margin-left: auto;
}

details[class*="_spoiler"][open] > summary {
    border-bottom: 1px solid var(--admin-border);
}

details[class*="_spoiler"][open] > summary::after {
    content: "Свернуть";
}

details[class*="_spoiler"] > div {
    border-radius: 0;
    margin: 0 !important;
}

.admin-summary-meta {
    color: var(--admin-muted);
    flex: 1;
    font-size: 13px;
    font-weight: 500;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-archive-toggle {
    background: #fff;
    border: 1px solid var(--admin-border);
    border-radius: 8px;
    margin-bottom: 18px;
    padding: 12px 14px;
}

.admin-archive-badge {
    background: #fff3cd;
    border: 1px solid #fedf89;
    border-radius: 999px;
    color: #93370d;
    font-size: 12px;
    font-weight: 700;
    padding: 3px 9px;
}

.adjudicator_spoiler.is-archived {
    border-color: #fedf89;
    opacity: 0.78;
}

.adjudicator_spoiler.is-archived > summary {
    background: #fffbeb;
}

.admin-list-tools {
    align-items: center;
    background: var(--admin-soft);
    border: 1px solid var(--admin-border);
    border-radius: 8px;
    display: flex;
    gap: 12px;
    margin: 16px 0;
    padding: 12px;
}

.admin-list-tools input {
    max-width: 420px;
}

.admin-list-tools .btn {
    white-space: nowrap;
}

.admin-list-count {
    color: var(--admin-muted);
    font-size: 13px;
    margin-left: auto;
    white-space: nowrap;
}

.admin-action-bar {
    align-items: center;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid var(--admin-border);
    border-radius: 8px;
    bottom: 24px;
    box-shadow: 0 18px 48px rgba(16, 24, 40, 0.18);
    display: flex;
    gap: 14px;
    padding: 12px 14px;
    position: fixed;
    right: 24px;
    z-index: 60;
}

.admin-save-status {
    align-items: center;
    color: var(--admin-muted);
    display: inline-flex;
    font-size: 13px;
    gap: 8px;
    min-width: 120px;
}

.admin-save-status::before {
    background: #98a2b3;
    border-radius: 50%;
    content: "";
    display: inline-block;
    height: 8px;
    width: 8px;
}

.admin-save-status[data-state="dirty"] {
    color: #b54708;
}

.admin-save-status[data-state="dirty"]::before {
    background: #f79009;
}

.admin-save-status[data-state="saving"] {
    color: var(--admin-focus);
}

.admin-save-status[data-state="saving"]::before {
    background: var(--admin-focus);
}

.admin-save-status[data-state="saved"] {
    color: #027a48;
}

.admin-save-status[data-state="saved"]::before {
    background: #12b76a;
}

.admin-save-status[data-state="error"] {
    color: #b42318;
}

.admin-save-status[data-state="error"]::before {
    background: #f04438;
}

.admin-source-save {
    display: none !important;
}

.admin-empty-search {
    background: #fff8e6;
    border: 1px solid #fedf89;
    border-radius: 8px;
    color: #93370d;
    display: none;
    margin: 12px 0;
    padding: 12px 14px;
}

.admin-review-tools {
    margin-top: 0;
}

.new_review, .pub_review {
    border: 1px solid var(--admin-border);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(16, 24, 40, 0.04);
}

.new_review .card-header, .pub_review .card-header {
    background: var(--admin-soft);
    border-bottom: 1px solid var(--admin-border);
}

.new_review .card-body input[type="button"], .pub_review .card-body input[type="button"] {
    margin-right: 6px;
    margin-top: 6px;
}

.tab_new_content:empty::after, .tab_pub_content:empty::after {
    background: var(--admin-soft);
    border: 1px dashed var(--admin-border);
    border-radius: 8px;
    color: var(--admin-muted);
    content: "Пока пусто";
    display: block;
    padding: 18px;
    text-align: center;
}

.form-label.justify-wide {
    display: flex;
    justify-content: space-between;
}

.par_data[placeholder]:empty:before {
    content: attr(placeholder);
    color: #a09faf; 
}

.galery_description[placeholder]:empty:before {
    content: attr(placeholder);
    color: #a09faf; 
}

.text-gray {
    --tblr-text-opacity: 1;
    color: rgb(190, 191, 191) !important;
}

.text-darkgray {
    --tblr-text-opacity: 1;
    color: rgb(134, 134, 134) !important;
}

.auth-container {
    display: grid;
    margin: 15% 35% 10% 35%;
    background: white;
    border-radius: 20px;
    padding: 30px;
}

.abs {
    max-width: 500px;
}

.alerts_wrapper {
    display: grid;
    gap: 8px;
    max-height: calc(100vh - 160px);
    overflow: auto;
    position: fixed;
    right: 24px;
    top: 24px;
    width: 300px;
    z-index: 40;
}

.alerts_wrapper .alert {
    margin-bottom: 0;
}

.loaded-img {
    width: 250px;
}

.adj-img {
    width: 250px;
    height: 250px;
    object-fit: cover;
    border-radius: 150px;
}

.loaded-imgs {
    display: grid;
    grid-template-columns: repeat(auto-fill, 100px);
    position: relative;
}

.img-card {
    position: relative;
}

.loaded-imgs img {
    height: 100%;
}

.img-card:hover {
    opacity:0.8;
    user-select: none;
    cursor: pointer;
    & .delete-btn {
        opacity:1; 
    }
}

.delete-btn {
    width: 20px;
    position: absolute;
    height: 20px;
    right: 3px;
    top: 3px;
    cursor: pointer;

}

.del-svg {
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50px;
}

/* The Modal (background) */
#image-viewer {
    display: none;
    position: fixed;
    z-index: 1;
    padding-top: 100px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgb(0,0,0);
    background-color: rgba(0,0,0,0.9);
}
.modal-content {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 700px;
}
.modal-content { 
    animation-name: zoom;
    animation-duration: 0.6s;
}

.contest_link_block {
    background: #fff;
    border: 1px dashed var(--admin-border);
    border-radius: 8px;
    display: grid;
    gap: 10px;
    grid-template-columns: 90px minmax(140px, 1fr) minmax(180px, 1.2fr) minmax(180px, 1.2fr) auto;
    margin: 12px 0;
    padding: 14px;
}

.contest_link_block input {
    margin-bottom: 0 !important;
}

.contest_link_block input[type="button"] {
    align-self: center;
    white-space: nowrap;
}

.contest_links {
    background: rgba(255, 255, 255, 0.62);
    border: 1px solid var(--admin-border);
    border-radius: 8px;
    padding: 16px;
}

.links_header {
    align-items: center;
    display: flex;
    gap: 8px;
}

.links_header::after {
    background: var(--admin-border);
    content: "";
    flex: 1;
    height: 1px;
}

.wrong-password {
  justify-self: center;
  color: red;
  margin: 5px;
  font-weight: 500;
}

@keyframes zoom {
    from {transform:scale(0)} 
    to {transform:scale(1)}
}
#image-viewer .close {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
}
#image-viewer .close:hover,
#image-viewer .close:focus {
    color: #bbb;
    text-decoration: none;
    cursor: pointer;
}

@media only screen and (max-width: 700px){
    .modal-content {
        width: 100%;
    }

    .admin-action-bar {
        bottom: 12px;
        left: 12px;
        right: 12px;
    }

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

    .admin-page-actions {
        align-items: stretch;
        flex-direction: column;
        margin-top: 12px;
        width: 100%;
    }

    .admin-list-tools input {
        max-width: none;
    }

    .admin-list-count {
        margin-left: 0;
    }

    .alerts_wrapper {
        left: 12px;
        right: 12px;
        top: 12px;
        width: auto;
    }

    .contest_link_block {
        grid-template-columns: 1fr;
    }

    .admin-summary-meta {
        display: none !important;
    }
}
