* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    background:
        radial-gradient(circle at top left, rgba(255, 208, 0, 0.06), transparent 24%),
        linear-gradient(180deg, #050505 0%, #0c0c0c 100%);
    color: #ffffff;
}

.login-page {
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(255, 208, 0, 0.08), transparent 28%),
        radial-gradient(circle at bottom right, rgba(255, 208, 0, 0.05), transparent 22%),
        linear-gradient(180deg, #050505 0%, #0a0a0a 100%);
}

.login-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 20px;
}

.login-card {
    width: 100%;
    max-width: 460px;
    background: linear-gradient(180deg, rgba(20, 20, 20, 0.96) 0%, rgba(12, 12, 12, 0.98) 100%);
    border: 1px solid rgba(255, 208, 0, 0.16);
    border-radius: 24px;
    padding: 34px 32px 30px;
    box-shadow:
        0 24px 70px rgba(0, 0, 0, 0.55),
        0 0 0 1px rgba(255, 208, 0, 0.04) inset;
    position: relative;
    overflow: hidden;
}

.login-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 32px;
    right: 32px;
    height: 3px;
    border-radius: 999px;
    background: linear-gradient(90deg, #ffd000 0%, #ffdf4d 45%, #ffd000 100%);
}

.login-brand,
.login-header {
    margin-bottom: 24px;
}

.login-logo {
    display: block;
    max-width: 220px;
    width: 100%;
    height: auto;
    margin-bottom: 12px;
}

.login-subtitle,
.login-header p,
.page-subtitle,
.section-head span,
.stat-note,
.work-card__meta,
.gallery-card__info span {
    color: rgba(255, 255, 255, 0.62);
}

.login-header h1,
.page-title,
.section-head h2 {
    margin: 0;
}

.alert-error,
.alert-success,
.alert-warning,
.empty-state {
    margin-bottom: 18px;
    padding: 14px 16px;
    border-radius: 14px;
    font-size: 14px;
}

.alert-error {
    background: rgba(180, 30, 30, 0.18);
    border: 1px solid rgba(255, 90, 90, 0.28);
    color: #ffd4d4;
}

.alert-success {
    background: rgba(25, 120, 45, 0.18);
    border: 1px solid rgba(90, 220, 130, 0.24);
    color: #d4ffe0;
}

.alert-warning {
    background: rgba(140, 92, 0, 0.18);
    border: 1px solid rgba(255, 208, 0, 0.24);
    color: #fff0bf;
}

.empty-state {
    background: rgba(255, 255, 255, 0.03);
    border: 1px dashed rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.72);
}

.login-form,
.form {
    display: grid;
    gap: 16px;
}

.login-form {
    grid-template-columns: 1fr;
}

.form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form textarea,
.form button {
    grid-column: 1 / -1;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.form-group label {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.78);
    font-weight: 600;
}

.form-group input,
.form-group select,
.form-group textarea,
input,
select,
textarea {
    width: 100%;
    min-height: 52px;
    padding: 0 16px;
    background: rgba(22, 22, 22, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    color: #ffffff;
    font-size: 15px;
    outline: none;
    transition: 0.2s ease;
}

.form-group textarea,
textarea {
    min-height: 120px;
    padding: 14px 16px;
    resize: vertical;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus,
input:focus,
select:focus,
textarea:focus {
    border-color: rgba(255, 208, 0, 0.65);
    box-shadow: 0 0 0 4px rgba(255, 208, 0, 0.08);
    background: rgba(28, 28, 28, 1);
}

button,
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 54px;
    width: 100%;
    border: none;
    border-radius: 14px;
    background: linear-gradient(180deg, #ffd000 0%, #efbf00 100%);
    color: #111111;
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
    box-shadow: 0 10px 24px rgba(255, 208, 0, 0.16);
}

button:hover,
.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 28px rgba(255, 208, 0, 0.22);
}

a {
    color: #ffd000;
    text-decoration: none;
}

.container {
    max-width: 1260px;
    margin: 0 auto;
    padding: 28px 20px 40px;
}

header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 28px;
    padding-bottom: 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.header-left,
.header-right,
.work-card__top,
.champion-item,
.filters-wrap {
    display: flex;
    align-items: center;
}

.header-left,
.header-right {
    gap: 16px;
}

.header-right {
    flex-wrap: wrap;
    justify-content: flex-end;
}

.page-title {
    font-size: 30px;
    margin-top: 4px;
}

.logo {
    max-height: 58px;
    width: auto;
    display: block;
}

.user-badge,
.logout-link,
.filters a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0 16px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.07);
    background: #171717;
    color: #ffffff;
}

.panel-card,
.champions-card,
.stat-card,
.work-card,
.gallery-card {
    background: linear-gradient(180deg, rgba(18, 18, 18, 0.96) 0%, rgba(12, 12, 12, 1) 100%);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 22px;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.24);
}

.panel-card,
.champions-card {
    padding: 22px;
    margin-bottom: 22px;
}

.section-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    margin-bottom: 18px;
}

.stats-grid,
.champions-grid,
.gallery-grid {
    display: grid;
    gap: 16px;
}

.stats-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-bottom: 22px;
}

.stat-card {
    padding: 20px;
}

.stat-label,
.champions-title {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.72);
    margin-bottom: 8px;
}

.stat-value {
    font-size: 34px;
    font-weight: 800;
    margin-bottom: 6px;
}

.champions-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.champion-item {
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.03);
    margin-bottom: 10px;
}

.champion-item--stack {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.filters-wrap {
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.filters a.active {
    background: linear-gradient(180deg, #ffd000 0%, #efbf00 100%);
    color: #111111;
    border-color: transparent;
    font-weight: 700;
}

.brigade-filter {
    min-width: 220px;
}

.works-list {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}

.work-card {
    padding: 18px;
}

.work-card__top {
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
}

.work-card__title {
    font-size: 20px;
    font-weight: 800;
    margin-bottom: 8px;
}

.work-card__meta {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    font-size: 14px;
}

.work-card__m2 {
    min-width: 118px;
    text-align: right;
    font-size: 24px;
    font-weight: 800;
    color: #ffd000;
}

.work-card__notes {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.6;
}

.work-card__photos,
.gallery-grid {
    margin-top: 14px;
}

.work-card__photos {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.photo-thumb,
.gallery-card {
    overflow: hidden;
}

.photo-thumb {
    width: 100px;
    height: 100px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.photo-thumb img,
.gallery-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

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

.gallery-card {
    color: #ffffff;
}

.gallery-card img {
    height: 220px;
}

.gallery-card__info {
    padding: 14px;
}

.gallery-card__info strong {
    display: block;
    margin-bottom: 6px;
}

@media (max-width: 900px) {
    .stats-grid,
    .champions-grid,
    .form {
        grid-template-columns: 1fr;
    }

    .work-card__top,
    header,
    .header-left,
    .header-right,
    .filters-wrap,
    .section-head {
        flex-direction: column;
        align-items: flex-start;
    }

    .work-card__m2 {
        text-align: left;
        min-width: auto;
    }
}

@media (max-width: 768px) {
    .login-card,
    .panel-card,
    .champions-card,
    .stat-card,
    .work-card {
        padding: 18px;
        border-radius: 18px;
    }

    .container {
        padding: 18px 14px 30px;
    }

    .page-title {
        font-size: 24px;
    }

    .stat-value {
        font-size: 28px;
    }
}

/* Общий контейнер */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 420px;
}

/* Поле даты */
input[type="date"] {
    appearance: none;
    -webkit-appearance: none;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.15);
    background: rgba(255,255,255,0.05);
    color: #fff;
    font-size: 14px;
    outline: none;
    transition: all 0.25s ease;
    backdrop-filter: blur(6px);
}

input[type="date"]:hover {
    border-color: rgba(255, 204, 0, 0.5);
}

input[type="date"]:focus {
    border-color: #ffcc00;
    box-shadow: 0 0 0 2px rgba(255, 204, 0, 0.2);
}

/* Иконка календаря */
input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
    cursor: pointer;
    opacity: 0.7;
}

/* Блок загрузки */
.file-upload {
    position: relative;
}

/* Скрываем стандартный input */
input[type="file"] {
    display: none;
}

/* Кастомная кнопка */
.file-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px;
    border-radius: 12px;
    border: 2px dashed rgba(255,255,255,0.2);
    background: rgba(255,255,255,0.03);
    color: #ccc;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.file-label:hover {
    border-color: #ffcc00;
    background: rgba(255, 204, 0, 0.05);
    color: #fff;
}

/* Иконка */
.file-label svg {
    width: 20px;
    height: 20px;
    fill: #ffcc00;
}

/* Когда выбраны файлы */
.file-label.active {
    border-color: #00ff99;
    color: #00ff99;
}

/* Превью изображений */
.preview {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.preview img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.1);
}

body.compact-ui.compact-ui--small {
    zoom: 0.92;
}
body.compact-ui {
    font-size: 14px;
}

body.compact-ui .container {
    max-width: 1180px;
    padding: 18px;
}

body.compact-ui header {
    padding: 14px 18px;
    margin-bottom: 18px;
}

body.compact-ui .logo {
    max-height: 54px;
}

body.compact-ui .page-subtitle {
    font-size: 12px;
}

body.compact-ui .page-title {
    font-size: 28px;
    line-height: 1.15;
    margin: 4px 0 0;
}

body.compact-ui .header-right {
    gap: 10px;
}

body.compact-ui .user-badge,
body.compact-ui .logout-link,
body.compact-ui .top-nav a {
    font-size: 13px;
    padding: 8px 12px;
}

body.compact-ui .stats-grid {
    gap: 14px;
    margin-bottom: 18px;
}

body.compact-ui .stat-card,
body.compact-ui .champions-card,
body.compact-ui .panel-card {
    padding: 18px;
    border-radius: 20px;
    margin-bottom: 18px;
}

body.compact-ui .stat-label,
body.compact-ui .stat-note,
body.compact-ui .section-head span,
body.compact-ui .work-card__meta,
body.compact-ui .gallery-card__info span,
body.compact-ui .champions-title {
    font-size: 12px;
}

body.compact-ui .stat-value {
    font-size: 28px;
}

body.compact-ui .section-head {
    margin-bottom: 14px;
    gap: 10px;
}

body.compact-ui .section-head h2 {
    font-size: 18px;
    margin: 0;
}

body.compact-ui .form {
    gap: 12px;
}

body.compact-ui .form input[type="text"],
body.compact-ui .form input[type="number"],
body.compact-ui .form input[type="date"],
body.compact-ui .form select,
body.compact-ui .form textarea,
body.compact-ui .brigade-filter select {
    min-height: 46px;
    padding: 11px 14px;
    font-size: 14px;
    border-radius: 14px;
}

body.compact-ui .form textarea {
    min-height: 100px;
}

body.compact-ui .form button,
body.compact-ui .btn-secondary,
body.compact-ui .btn-danger {
    min-height: 46px;
    padding: 11px 18px;
    font-size: 14px;
    border-radius: 14px;
}

body.compact-ui .filters-wrap {
    gap: 12px;
}

body.compact-ui .filters {
    gap: 8px;
}

body.compact-ui .filters a {
    padding: 8px 12px;
    font-size: 13px;
    border-radius: 12px;
}

body.compact-ui .champions-grid {
    gap: 14px;
}

body.compact-ui .champion-item {
    padding: 10px 12px;
    border-radius: 14px;
    font-size: 13px;
}

body.compact-ui .works-list {
    gap: 12px;
}

body.compact-ui .work-card {
    padding: 14px;
    border-radius: 18px;
}

body.compact-ui .work-card__title {
    font-size: 17px;
}

body.compact-ui .work-card__m2 {
    font-size: 20px;
    padding-left: 12px;
}

body.compact-ui .work-card__notes {
    font-size: 13px;
    margin-top: 10px;
}

body.compact-ui .work-card__photos {
    gap: 8px;
    margin-top: 12px;
}

body.compact-ui .photo-thumb {
    width: 78px;
    height: 78px;
    border-radius: 12px;
}

body.compact-ui .gallery-grid {
    gap: 12px;
}

body.compact-ui .gallery-card {
    border-radius: 18px;
}

body.compact-ui .gallery-card img {
    height: 170px;
}

body.compact-ui .gallery-card__info {
    padding: 10px 12px;
}

body.compact-ui .empty-state,
body.compact-ui .alert-success,
body.compact-ui .alert-warning {
    padding: 12px 14px;
    font-size: 13px;
    border-radius: 14px;
}

.top-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.top-nav a,
.btn-secondary,
.btn-danger,
.upload-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    border-radius: 14px;
    font-weight: 700;
}

.top-nav a {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

.top-nav a.active,
.top-nav a:hover {
    background: rgba(255, 208, 0, 0.12);
    border-color: rgba(255, 208, 0, 0.32);
    color: #ffd000;
}

.form-group--full,
.filter-grid,
.filters-wrap--stack {
    width: 100%;
    max-width: none;
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.form-group--end {
    align-self: end;
}

.upload-label {
    min-height: 52px;
    padding: 14px 16px;
    border: 1px dashed rgba(255, 208, 0, 0.35);
    background: rgba(255, 208, 0, 0.06);
    color: #ffd000;
    cursor: pointer;
}

.upload-label:hover {
    background: rgba(255, 208, 0, 0.1);
}

.form-help {
    color: rgba(255, 255, 255, 0.62);
    font-size: 12px;
}

.btn-secondary,
.btn-danger {
    min-width: 160px;
    text-decoration: none;
    border: none;
    cursor: pointer;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.btn-danger {
    background: rgba(180, 30, 30, 0.22);
    color: #ffd9d9;
    border: 1px solid rgba(255, 120, 120, 0.24);
}

.action-row,
.work-card__actions,
.gallery-card__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
}

.edit-photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
}

.edit-photo-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
}

.edit-photo-card img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 12px;
}

.gallery-card__edit {
    display: inline-flex;
    margin-top: 6px;
    color: #ffd000;
    font-weight: 700;
}

@media (max-width: 900px) {
    body.compact-ui .container {
        max-width: 100%;
        padding: 12px;
    }

    body.compact-ui .page-title {
        font-size: 24px;
    }

    body.compact-ui .stat-value {
        font-size: 24px;
    }

    body.compact-ui .work-card__top {
        gap: 10px;
    }

    body.compact-ui .work-card__m2 {
        font-size: 18px;
        padding-left: 0;
    }

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


.upload-box {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.upload-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    min-width: 190px;
    min-height: 42px;
    padding: 10px 16px;
    border-radius: 12px;
    border: 1px dashed rgba(255, 208, 0, 0.45);
    background: rgba(255, 208, 0, 0.06);
    color: #ffe27a;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.2s ease;
}

.upload-label:hover {
    background: rgba(255, 208, 0, 0.12);
    border-color: rgba(255, 208, 0, 0.75);
    color: #fff2b8;
}

.upload-status {
    min-height: 20px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
}

.upload-status.is-success {
    color: #9cffc2;
}

.upload-status.is-error {
    color: #ffb3b3;
}

.upload-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.upload-preview__item {
    width: 84px;
    height: 84px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
}

.upload-preview__item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.edit-photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 14px;
}

.edit-photo-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 10px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.edit-photo-card img {
    width: 100%;
    height: 140px;
    object-fit: cover;
    border-radius: 12px;
}

.edit-photo-card span {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.edit-photo-card input[type="checkbox"] {
    width: 16px;
    min-height: 16px;
    height: 16px;
    padding: 0;
}

.action-row {
    grid-column: 1 / -1;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.action-row button {
    width: auto;
    min-width: 170px;
    min-height: 42px;
    padding: 10px 16px;
    font-size: 14px;
    border-radius: 12px;
}

.btn-danger {
    background: linear-gradient(180deg, #6b1e1e 0%, #551515 100%);
    color: #fff;
    box-shadow: 0 10px 24px rgba(107, 30, 30, 0.22);
}

.btn-danger:hover {
    box-shadow: 0 14px 28px rgba(107, 30, 30, 0.28);
}

@media (max-width: 768px) {
    .action-row {
        flex-direction: column;
        align-items: stretch;
    }

    .action-row button {
        width: 100%;
    }
}


.inline-delete-form {
    margin: 0;
}

.btn-small {
    min-height: 40px !important;
    width: auto !important;
    padding: 0 14px !important;
    font-size: 13px !important;
    border-radius: 12px !important;
    box-shadow: none !important;
}

.work-card__actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.work-card__actions .btn-small {
    flex: 0 0 auto;
}
