:root {
    --purple: #7C3C9D;
    --pink: #DF128D;
    --orange: #FFB01F;

    --bg: #f7f4fa;
    --card: #ffffff;
    --text: #28242d;
    --muted: #716a78;
    --border: #e6deea;

    --gradient:
        linear-gradient(
            135deg,
            var(--purple) 0%,
            var(--pink) 100%
        );
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    font-family:
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Arial,
        sans-serif;

    background:
        radial-gradient(
            circle at 10% 5%,
            rgba(124, 60, 157, .08) 0,
            rgba(124, 60, 157, 0) 27%
        ),
        radial-gradient(
            circle at 92% 15%,
            rgba(223, 18, 141, .07) 0,
            rgba(223, 18, 141, 0) 24%
        ),
        var(--bg);
}

.page {
    max-width: 920px;
    margin: 0 auto;
    padding: 28px 18px 50px;
}


/* -----------------------------------------------------
   ШАПКА ПРОЕКТА
----------------------------------------------------- */

.project-hero {
    position: relative;
    overflow: hidden;

    margin-bottom: 22px;
    padding: 25px 28px;

    color: white;
    background: var(--gradient);

    border-radius: 22px;

    box-shadow:
        0 10px 28px rgba(124, 60, 157, .20);
}


/* декоративные маршруты */

.project-hero::before {
    content: "";

    position: absolute;

    width: 240px;
    height: 240px;

    right: -80px;
    top: -100px;

    border: 2px dashed
        rgba(255,255,255,.26);

    border-radius: 50%;
}

.project-hero::after {
    content: "";

    position: absolute;

    width: 160px;
    height: 160px;

    left: -80px;
    bottom: -90px;

    border: 2px dashed
        rgba(255,255,255,.20);

    border-radius: 50%;
}


.project-brand {
    position: relative;
    z-index: 2;

    display: flex;
    align-items: center;
    gap: 17px;
}


/* Самолётик */

.project-mark {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 74px;
    height: 74px;
    min-width: 74px;

    border-radius: 20px;

    background: white;

    transform: none;

    box-shadow:
        0 6px 16px rgba(60, 20, 80, .16);
}

.plane-icon {
    width: 58px;
    height: 52px;
    display: block;
    transform: rotate(-5deg);
}


.project-kicker {
    margin: 0 0 3px;

    color: #ffe1f4;

    font-size: 13px;
    font-weight: 800;

    text-transform: uppercase;
    letter-spacing: .08em;
}


.project-name {
    margin: 0;

    font-size: 25px;
    font-weight: 800;
    line-height: 1.15;
}


.project-subname {
    margin: 5px 0 0;

    color: rgba(255,255,255,.90);

    font-size: 15px;
    line-height: 1.4;
}


/* -----------------------------------------------------
   КАРТОЧКА
----------------------------------------------------- */

.form-card {
    background: var(--card);

    border-radius: 20px;

    padding: 32px;

    box-shadow:
        0 10px 30px rgba(45, 27, 55, .08);
}


.form-title {
    margin: 0 0 9px;

    font-size: 30px;
    font-weight: 800;
    line-height: 1.22;

    color: #2d2530;
}


.form-description {
    margin: 0 0 28px;

    color: var(--muted);

    font-size: 16px;
    line-height: 1.55;
}


/* -----------------------------------------------------
   ПОЛЯ
----------------------------------------------------- */

.field {
    margin-top: 25px;
}


.field-label {
    display: block;

    margin-bottom: 8px;

    font-size: 16px;
    font-weight: 700;
    line-height: 1.45;
}


.required {
    color: var(--pink);
}


input[type="text"],
input[type="number"],
input[type="url"],
textarea,
select {
    width: 100%;

    padding: 13px 14px;

    border: 1px solid var(--border);
    border-radius: 10px;

    background: white;
    color: var(--text);

    font: inherit;
    font-size: 16px;

    transition:
        border-color .15s ease,
        box-shadow .15s ease,
        background .15s ease;
}


input:focus,
textarea:focus,
select:focus {
    outline: none;

    border-color: var(--purple);

    box-shadow:
        0 0 0 3px
        rgba(124, 60, 157, .12);
}


textarea {
    min-height: 150px;
    resize: vertical;
}


.help {
    margin-top: 7px;

    color: var(--muted);

    font-size: 14px;
    line-height: 1.45;
}


/* -----------------------------------------------------
   ГРУППЫ ВОПРОСОВ
----------------------------------------------------- */

.question-group-title {
    margin-top: 34px;
    margin-bottom: 9px;

    font-size: 18px;
    font-weight: 800;
    line-height: 1.45;

    color: var(--purple);
}


/* -----------------------------------------------------
   ВАРИАНТЫ
----------------------------------------------------- */

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


.option {
    display: flex;
    align-items: flex-start;
    gap: 10px;

    padding: 13px 14px;

    border: 1px solid var(--border);
    border-radius: 11px;

    background: #fdfbfe;

    cursor: pointer;

    transition:
        border-color .15s ease,
        background .15s ease;
}


.option:hover {
    border-color: #d9c3e3;
    background: #faf5fc;
}


.option input {
    margin-top: 3px;

    accent-color: var(--purple);
}


/* -----------------------------------------------------
   УСЛОВНЫЕ ПОЛЯ
----------------------------------------------------- */

.conditional {
    margin-top: 18px;

    padding: 20px;

    border-left: 5px solid var(--orange);

    border-radius: 12px;

    background:
        linear-gradient(
            90deg,
            rgba(255,176,31,.10),
            rgba(255,255,255,1)
        );
}


/* -----------------------------------------------------
   НЕСКОЛЬКО ССЫЛОК
----------------------------------------------------- */

.multiurl-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}


.add-link {
    width: auto;

    margin-top: 10px;

    padding: 9px 14px;

    border: 1px solid
        rgba(124, 60, 157, .22);

    border-radius: 9px;

    background: #fbf7fd;

    color: var(--purple);

    font-weight: 700;

    cursor: pointer;
}


.add-link:hover {
    background: #f4eaf8;
}


/* -----------------------------------------------------
   ОСНОВНАЯ КНОПКА
----------------------------------------------------- */

.submit-button {
    width: 100%;

    margin-top: 35px;

    padding: 15px 24px;

    border: 0;
    border-radius: 11px;

    background: var(--gradient);

    color: white;

    font: inherit;
    font-size: 17px;
    font-weight: 800;

    cursor: pointer;

    box-shadow:
        0 8px 18px
        rgba(124, 60, 157, .20);

    transition:
        transform .12s ease,
        box-shadow .12s ease;
}


.submit-button:hover {
    transform: translateY(-1px);

    box-shadow:
        0 10px 22px
        rgba(124, 60, 157, .26);
}


/* -----------------------------------------------------
   ОШИБКИ
----------------------------------------------------- */

.errors {
    margin: 20px 0;

    padding: 16px 18px;

    border-radius: 11px;

    background: #fff0f6;

    color: #8b205e;
}


.errors ul {
    margin: 8px 0 0;
    padding-left: 20px;
}


/* -----------------------------------------------------
   СПИСОК ФОРМ
----------------------------------------------------- */

.form-list-card {
    display: block;

    margin-top: 16px;
    padding: 22px;

    border: 1px solid var(--border);
    border-radius: 14px;

    background: white;
    color: inherit;

    text-decoration: none;

    box-shadow:
        0 4px 14px
        rgba(50, 35, 60, .04);

    transition:
        transform .15s ease,
        box-shadow .15s ease,
        border-color .15s ease;
}


.form-list-card:hover {
    transform: translateY(-2px);

    border-color: #d8bfdf;

    box-shadow:
        0 9px 24px
        rgba(50, 35, 60, .09);
}


.form-list-card h2 {
    margin: 0 0 6px;

    color: var(--purple);

    font-size: 20px;
}


.form-list-card p {
    margin: 0;

    color: var(--muted);

    line-height: 1.45;
}


/* -----------------------------------------------------
   УСПЕХ
----------------------------------------------------- */

.success-icon {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 68px;
    height: 68px;

    margin-bottom: 16px;

    border-radius: 18px;

    background:
        linear-gradient(
            135deg,
            rgba(124,60,157,.13),
            rgba(223,18,141,.13)
        );

    color: var(--purple);

    font-size: 34px;
    font-weight: 800;
}


/* -----------------------------------------------------
   MOBILE
----------------------------------------------------- */

@media (max-width: 640px) {

    .page {
        padding: 16px 12px 30px;
    }

    .project-hero {
        padding: 20px 18px;
        border-radius: 17px;
    }

    .project-brand {
        align-items: flex-start;
    }

    .project-mark {
        width: 58px;
        height: 58px;
        min-width: 58px;

        border-radius: 16px;
    }

    .plane-icon {
        width: 46px;
        height: 41px;
    }

    .project-name {
        font-size: 21px;
    }

    .project-subname {
        font-size: 14px;
    }

    .form-card {
        padding: 22px 18px;
        border-radius: 16px;
    }

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


/* =========================================================
   Родительские чаты — дополнительные компоненты
   ========================================================= */

main {
    display: block;
}

.alerts {
    margin-bottom: 18px;
}

.alert {
    padding: 14px 16px;
    border-radius: 11px;
    background: #fff0f6;
    color: #8b205e;
    border: 1px solid #f3cfe2;
    line-height: 1.45;
}


/* Карточки родительских чатов */

.card {
    background: var(--card);
    border-radius: 20px;
    padding: 32px;
    margin-bottom: 20px;
    box-shadow: 0 10px 30px rgba(45, 27, 55, .08);
}

.hero {
    max-width: 760px;
    margin-left: auto;
    margin-right: auto;
}

.card h1 {
    margin: 0 0 10px;
    font-size: 30px;
    font-weight: 800;
    line-height: 1.22;
    color: #2d2530;
}

.card h2 {
    margin: 6px 0 20px;
    font-size: 22px;
    line-height: 1.3;
}

.lead {
    margin: 0 0 24px;
    color: var(--muted);
    font-size: 16px;
    line-height: 1.55;
}


/* Метки */

.badge,
.section-kicker {
    display: inline-block;
    color: var(--purple);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .07em;
}

.badge {
    margin-bottom: 14px;
    padding: 7px 11px;
    border-radius: 999px;
    background:
        linear-gradient(
            135deg,
            rgba(124,60,157,.10),
            rgba(223,18,141,.10)
        );
}

.badge.success {
    color: #6b2c86;
}


/* Поиск МК */

.person-picker {
    position: relative;
    margin-top: 25px;
}

.person-search {
    width: 100%;
}

.person-results {
    position: absolute;
    z-index: 20;
    left: 0;
    right: 0;
    top: calc(100% + 7px);

    display: none;
    max-height: 330px;
    overflow-y: auto;

    padding: 7px;

    background: white;
    border: 1px solid var(--border);
    border-radius: 13px;

    box-shadow:
        0 14px 32px rgba(45, 27, 55, .15);
}

.person-results.open {
    display: block;
}

.person-option {
    display: block;
    width: 100%;

    padding: 12px 13px;

    border: 0;
    border-radius: 9px;

    background: transparent;
    color: var(--text);

    text-align: left;
    font: inherit;
    font-size: 15px;

    cursor: pointer;
}

.person-option:hover,
.person-option:focus {
    outline: none;
    background: #faf5fc;
    color: var(--purple);
}

.person-option[hidden] {
    display: none;
}

.person-empty {
    display: none;
    padding: 13px;
    color: var(--muted);
    font-size: 14px;
}

.person-empty.show {
    display: block;
}

.person-error {
    display: none;
    margin-top: 8px;
    color: #a12b68;
    font-size: 14px;
}

.person-error.show {
    display: block;
}


/* Кнопки */

.action-button,
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 48px;
    padding: 13px 20px;

    border: 0;
    border-radius: 11px;

    font: inherit;
    font-size: 16px;
    font-weight: 800;
    text-decoration: none;

    cursor: pointer;
}

.action-button.primary,
.button.primary {
    background: var(--gradient);
    color: white;

    box-shadow:
        0 8px 18px rgba(124, 60, 157, .20);
}

.action-button.primary:hover,
.button.primary:hover {
    transform: translateY(-1px);
    box-shadow:
        0 10px 22px rgba(124, 60, 157, .26);
}

.action-button.secondary,
.button.secondary {
    background: #f5eef8;
    color: var(--purple);
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 25px;
}

.actions .action-button {
    margin: 0;
}

.button.large {
    width: 100%;
}


/* Информационные блоки */

.info-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin: 22px 0;
}

.info-grid > div {
    padding: 16px;

    border: 1px solid var(--border);
    border-radius: 12px;

    background: #fdfbfe;
}

.info-label {
    display: block;
    margin-bottom: 5px;

    color: var(--muted);
    font-size: 13px;
}

.info-grid strong {
    font-size: 18px;
}


/* Учебная форма */

.notice {
    margin-top: 20px;
    padding: 15px 17px;

    border-left: 5px solid var(--orange);
    border-radius: 12px;

    background:
        linear-gradient(
            90deg,
            rgba(255,176,31,.10),
            rgba(255,255,255,1)
        );

    color: #655637;
    line-height: 1.5;
}

.notice.warning {
    border-left-color: var(--pink);
    background:
        linear-gradient(
            90deg,
            rgba(223,18,141,.08),
            rgba(255,255,255,1)
        );
    color: #713052;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

.control {
    width: 100%;
}

.organization .section-kicker,
.criteria-block .section-kicker {
    margin-bottom: 6px;
}

.criterion {
    padding: 22px 0;
    border-bottom: 1px solid #eee7f1;
}

.criterion:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.criterion-text {
    margin-bottom: 14px;
    font-size: 16px;
    line-height: 1.5;
    font-weight: 650;
}


/* Да / В процессе / Нет */

.choices {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
}

.choices label {
    cursor: pointer;
}

.choices input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.choices span {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 42px;
    padding: 9px 15px;

    border: 1px solid var(--border);
    border-radius: 10px;

    background: #fdfbfe;

    transition:
        border-color .15s ease,
        background .15s ease,
        color .15s ease;
}

.choices label:hover span {
    border-color: #d9c3e3;
    background: #faf5fc;
}

.choices input:checked + span {
    border-color: var(--purple);
    background:
        linear-gradient(
            135deg,
            rgba(124,60,157,.11),
            rgba(223,18,141,.08)
        );
    color: var(--purple);
    font-weight: 800;
}

.choices.compact {
    margin-top: 4px;
}

.submit-card {
    padding-top: 24px;
    padding-bottom: 24px;
}


/* Ссылки */

.text-link {
    color: var(--purple);
    font-weight: 700;
    text-decoration: none;
}

.text-link:hover {
    text-decoration: underline;
}


/* Мобильная версия */

@media (max-width: 640px) {

    .card {
        padding: 22px 18px;
        border-radius: 16px;
    }

    .card h1 {
        font-size: 24px;
    }

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

    .choices {
        display: grid;
        grid-template-columns: 1fr;
    }

    .choices span {
        width: 100%;
    }

    .actions {
        display: grid;
        grid-template-columns: 1fr;
    }

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


/* =========================================================
   ADMIN
   ========================================================= */

.admin-page {
    max-width: 1180px;
}

.admin-nav {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;

    margin: -5px 0 22px;
    padding: 9px;

    border-radius: 14px;
    background: white;

    box-shadow:
        0 6px 20px rgba(45, 27, 55, .06);
}

.admin-nav a,
.admin-nav button {
    display: inline-flex;
    align-items: center;

    min-height: 40px;
    padding: 9px 13px;

    border: 0;
    border-radius: 9px;

    background: transparent;
    color: var(--purple);

    font: inherit;
    font-size: 14px;
    font-weight: 750;
    text-decoration: none;

    cursor: pointer;
}

.admin-nav a:hover,
.admin-nav button:hover {
    background: #f7f0fa;
}

.admin-nav form {
    margin-left: auto;
}

.admin-login {
    max-width: 520px;
    margin-left: auto;
    margin-right: auto;
}

.admin-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;

    margin: 8px 0 20px;
}

.admin-heading h1 {
    margin: 0 0 5px;
    font-size: 31px;
}

.admin-heading p {
    margin: 0;
    color: var(--muted);
}

.admin-heading-actions {
    display: flex;
    gap: 8px;
}

.admin-stats {
    display: grid;
    grid-template-columns:
        repeat(5, minmax(0, 1fr));
    gap: 12px;

    margin-bottom: 20px;
}

.admin-stat {
    padding: 20px;

    border-radius: 16px;
    background: white;

    box-shadow:
        0 7px 22px rgba(45, 27, 55, .07);
}

.admin-stat span {
    display: block;
    min-height: 38px;

    color: var(--muted);
    font-size: 13px;
    line-height: 1.35;
}

.admin-stat strong {
    display: block;
    margin-top: 8px;

    color: var(--purple);
    font-size: 30px;
}

.admin-section-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;

    margin-bottom: 18px;
}

.admin-section-head h2 {
    margin: 0 0 4px;
}

.admin-small-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 42px;
    padding: 10px 15px;

    border: 0;
    border-radius: 10px;

    background: var(--gradient);
    color: white;

    font: inherit;
    font-weight: 750;
    text-decoration: none;

    cursor: pointer;
}

.admin-small-button.secondary {
    background: #f3eaf7;
    color: var(--purple);
}

.admin-table-wrap {
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th,
.admin-table td {
    padding: 13px 12px;

    border-bottom:
        1px solid #eee7f1;

    text-align: left;
    vertical-align: top;
}

.admin-table th {
    color: var(--muted);

    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.admin-table td {
    font-size: 14px;
}

.admin-table a {
    color: var(--purple);
    font-weight: 750;
    text-decoration: none;
}

.admin-items {
    display: flex;
    flex-direction: column;
}

.admin-item {
    display: flex;
    justify-content: space-between;
    gap: 18px;

    padding: 17px 0;

    border-bottom:
        1px solid #eee7f1;
}

.admin-item:last-child {
    border-bottom: 0;
}

.admin-item-main {
    display: flex;
    gap: 13px;
    min-width: 0;
}

.admin-order {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 36px;
    height: 36px;
    min-width: 36px;

    border-radius: 10px;

    background: #f4eaf8;
    color: var(--purple);

    font-size: 13px;
    font-weight: 800;
}

.admin-item-text {
    font-size: 15px;
    line-height: 1.5;
}

.admin-item-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.admin-item-actions a,
.admin-item-actions button {
    padding: 8px 10px;

    border: 0;
    border-radius: 8px;

    background: #f7f3f9;
    color: var(--purple);

    font: inherit;
    font-size: 13px;
    font-weight: 750;
    text-decoration: none;

    cursor: pointer;
}

.admin-item-actions form {
    margin: 0;
}

.admin-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;

    margin-top: 6px;

    color: var(--muted);
    font-size: 12px;
}

.status {
    display: inline-flex;
    align-items: center;

    padding: 3px 7px;
    border-radius: 999px;

    font-size: 11px;
    font-weight: 800;
}

.status.active {
    background: #ecf8f0;
    color: #24713b;
}

.status.inactive {
    background: #f1eef2;
    color: #746d78;
}

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

.admin-readonly {
    margin: 18px 0;
    padding: 13px 15px;

    border-radius: 10px;
    background: #f8f5f9;

    color: var(--muted);
}

.admin-check {
    display: flex;
    align-items: center;
    gap: 9px;

    margin-top: 24px;

    font-weight: 700;
}

.admin-check input {
    width: 18px;
    height: 18px;

    accent-color: var(--purple);
}

.admin-filters {
    display: grid;
    grid-template-columns:
        minmax(220px, 1fr)
        minmax(220px, .8fr)
        auto;
    gap: 10px;
}

.version-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.version-tabs a {
    padding: 8px 11px;

    border-radius: 9px;

    background: #f7f3f9;
    color: var(--purple);

    font-size: 13px;
    font-weight: 750;
    text-decoration: none;
}

.version-tabs a.active {
    background: var(--gradient);
    color: white;
}

.admin-entry-data {
    display: grid;
    grid-template-columns:
        repeat(4, minmax(0, 1fr));
    gap: 10px;

    margin: 16px 0 25px;
}

.admin-entry-data > div {
    padding: 14px;

    border-radius: 11px;
    background: #faf7fb;
}

.admin-entry-data span {
    display: block;

    margin-bottom: 5px;

    color: var(--muted);
    font-size: 12px;
}

.admin-entry-data strong {
    font-size: 17px;
}

.admin-entry-data a {
    color: var(--purple);
    font-weight: 750;
}

.admin-answer {
    display: grid;
    grid-template-columns:
        minmax(0, 1fr) auto;
    gap: 18px;

    padding: 15px 0;

    border-bottom:
        1px solid #eee7f1;
}

.admin-answer:last-child {
    border-bottom: 0;
}

.admin-answer-text {
    line-height: 1.5;
}

.answer-pill {
    display: inline-flex;

    min-width: 94px;
    justify-content: center;

    padding: 7px 10px;

    border-radius: 999px;

    font-size: 12px;
    font-weight: 800;
}

.answer-pill.yes {
    background: #eaf8ee;
    color: #26743e;
}

.answer-pill.progress {
    background: #fff4d9;
    color: #86621a;
}

.answer-pill.no {
    background: #fdebec;
    color: #9b343b;
}

@media (max-width: 820px) {

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

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

    .admin-filters {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {

    .admin-nav {
        display: grid;
        grid-template-columns:
            repeat(2, 1fr);
    }

    .admin-nav form {
        margin-left: 0;
    }

    .admin-nav a,
    .admin-nav button {
        width: 100%;
        justify-content: center;
    }

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

    .admin-heading-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .admin-stats {
        grid-template-columns: 1fr 1fr;
    }

    .admin-item {
        flex-direction: column;
    }

    .admin-item-actions {
        padding-left: 49px;
    }

    .admin-entry-data {
        grid-template-columns: 1fr 1fr;
    }

    .admin-answer {
        grid-template-columns: 1fr;
    }
}


/* =========================================================
   ADMIN — FIX HORIZONTAL OVERFLOW
   ========================================================= */

html,
body {
    max-width: 100%;
    overflow-x: hidden;
}

.admin-page,
.admin-page .form-card,
.admin-items,
.admin-item,
.admin-item-main {
    min-width: 0;
    max-width: 100%;
}

.admin-page {
    width: 100%;
}

.admin-page .form-card {
    width: 100%;
}

.admin-item {
    align-items: flex-start;
}

.admin-item-main {
    flex: 1 1 auto;
    width: 0;
}

.admin-item-main > div:last-child {
    min-width: 0;
    width: 100%;
}

.admin-item-text {
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: normal;
}

.admin-item-actions {
    flex: 0 0 auto;
    max-width: 260px;
    justify-content: flex-end;
}

.admin-section-head {
    min-width: 0;
}

.admin-section-head > div:first-child {
    min-width: 0;
}


/* На планшете уже не пытаемся держать
   длинный критерий и кнопки в одной строке */

@media (max-width: 900px) {

    .admin-item {
        flex-direction: column;
        gap: 12px;
    }

    .admin-item-main {
        width: 100%;
    }

    .admin-item-actions {
        width: 100%;
        max-width: none;

        padding-left: 49px;

        justify-content: flex-start;
    }

    .admin-section-head {
        flex-wrap: wrap;
    }
}


/* Телефон */

@media (max-width: 640px) {

    .admin-item-actions {
        padding-left: 0;
    }

    .admin-item-actions a,
    .admin-item-actions form,
    .admin-item-actions button {
        width: 100%;
    }

    .admin-item-actions a,
    .admin-item-actions button {
        justify-content: center;
        text-align: center;
    }

    .admin-stats {
        grid-template-columns: 1fr;
    }

    .admin-entry-data {
        grid-template-columns: 1fr;
    }
}


/* =========================================================
   RESULTS / SCORING
   ========================================================= */

.result-summary {
    margin: 26px 0;
}

.result-loading {
    padding: 18px;

    border-radius: 12px;
    background: #faf7fb;

    color: var(--muted);
}

.result-card {
    margin-top: 16px;
    padding: 22px;

    border: 1px solid var(--border);
    border-radius: 16px;

    background: #fff;

    box-shadow:
        0 5px 18px rgba(45, 27, 55, .05);
}

.result-card h2 {
    margin: 0 0 18px;

    font-size: 20px;
    line-height: 1.35;
}

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

    gap: 12px;
}

.result-metric {
    padding: 17px;

    border-radius: 13px;
    background: #faf7fb;
}

.result-label {
    margin-bottom: 7px;

    color: var(--muted);

    font-size: 13px;
    font-weight: 700;
}

.result-score {
    color: var(--purple);

    font-size: 36px;
    font-weight: 850;
    line-height: 1;
}

.result-score span {
    margin-left: 2px;

    font-size: 18px;
    font-weight: 750;
}

.coverage-number {
    font-size: 29px;
    font-weight: 850;
    line-height: 1.1;
}

.coverage-number span {
    font-size: 16px;
    font-weight: 700;
}

.result-metric.good {
    background: #edf8f0;
    color: #25713c;
}

.result-metric.bad {
    background: #fdeff0;
    color: #a0363e;
}

.result-metric.neutral {
    color: var(--muted);
}

.coverage-caption {
    margin-top: 7px;

    font-size: 12px;
    font-weight: 750;
}

.result-comment {
    margin-top: 14px;
    padding: 15px 17px;

    border-left: 4px solid var(--purple);
    border-radius: 10px;

    background: #faf6fc;

    line-height: 1.5;
}


/* SCORE COMMENTS ADMIN */

.score-comment-row {
    display: grid;
    grid-template-columns: 80px 1fr;
    gap: 15px;

    align-items: start;

    padding: 15px 0;

    border-bottom: 1px solid #eee7f1;
}

.score-number {
    display: flex;
    align-items: center;
    justify-content: center;

    min-height: 46px;

    border-radius: 11px;

    background: #f4eaf8;
    color: var(--purple);

    font-size: 17px;
    font-weight: 850;
}

.score-comment-row textarea {
    min-height: 86px;
}


/* EXCLUSION */

.submission-admin-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;

    gap: 10px;
}

.submission-admin-actions form {
    margin: 0;
}

.excluded-warning {
    width: 100%;

    padding: 13px 15px;

    border-radius: 10px;

    background: #fff3dd;
    color: #765414;

    font-weight: 700;
}

.admin-danger-button {
    min-height: 42px;

    padding: 10px 15px;

    border: 0;
    border-radius: 10px;

    background: #fdebed;
    color: #a12f39;

    font: inherit;
    font-weight: 750;

    cursor: pointer;
}

.status.excluded {
    background: #fff1d9;
    color: #7c5817;
}


@media (max-width: 640px) {

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

    .score-comment-row {
        grid-template-columns: 1fr;
    }

    .score-number {
        width: 80px;
    }
}


/* =========================================================
   PRODUCTION — РЕЕСТР ОРГАНИЗАЦИЙ
   ========================================================= */

.production-period {
    display: inline-flex;

    padding: 7px 11px;

    border-radius: 9px;

    background: #f6f0f8;
    color: var(--purple);

    font-size: 13px;
    font-weight: 750;
}


.production-progress {
    margin-top: 25px;
}

.production-progress-head {
    display: flex;
    align-items: center;
    justify-content: space-between;

    margin-bottom: 8px;

    font-size: 14px;
}

.production-progress-head span {
    color: var(--purple);
    font-weight: 800;
}

.production-progress-track {
    height: 10px;

    overflow: hidden;

    border-radius: 999px;

    background: #eee6f1;
}

.production-progress-value {
    height: 100%;

    border-radius: inherit;

    background: var(--gradient);

    transition: width .2s ease;
}


.production-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;

    margin-top: 22px;
}

.production-filters button {
    padding: 9px 13px;

    border: 1px solid var(--border);
    border-radius: 999px;

    background: white;
    color: var(--muted);

    font: inherit;
    font-size: 13px;
    font-weight: 750;

    cursor: pointer;
}

.production-filters button:hover {
    border-color: #d7bddf;
    color: var(--purple);
}

.production-filters button.active {
    border-color: transparent;

    background:
        linear-gradient(
            135deg,
            rgba(124,60,157,.13),
            rgba(223,18,141,.10)
        );

    color: var(--purple);
}


.production-list-card {
    padding: 10px 22px;
}

.production-table-wrap {
    width: 100%;
    overflow-x: auto;
}

.production-table {
    width: 100%;

    border-collapse: collapse;

    table-layout: auto;
}

.production-table th,
.production-table td {
    padding: 14px 12px;

    border-bottom:
        1px solid #eee7f1;

    text-align: left;
    vertical-align: middle;
}

.production-table tr:last-child td {
    border-bottom: 0;
}

.production-table th {
    color: var(--muted);

    font-size: 11px;
    font-weight: 800;

    text-transform: uppercase;
    letter-spacing: .05em;

    white-space: nowrap;
}

.production-table td {
    font-size: 14px;
}

.production-org-name {
    width: 48%;

    font-weight: 700;
    line-height: 1.4;
}


.production-status {
    display: inline-flex;

    padding: 5px 8px;

    border-radius: 999px;

    font-size: 11px;
    font-weight: 800;

    white-space: nowrap;
}

.production-status.ready {
    background: #eaf7ee;
    color: #26743e;
}

.production-status.progress {
    background: #fff4d9;
    color: #806018;
}

.production-status.empty {
    background: #f2eef3;
    color: #736b77;
}


.production-coverage {
    font-weight: 800;
    white-space: nowrap;
}

.production-coverage.good {
    color: #26743e;
}

.production-coverage.bad {
    color: #a0343d;
}


.production-action {
    text-align: right !important;
}

.production-action a {
    display: inline-flex;

    padding: 8px 11px;

    border-radius: 9px;

    background: #f5edf8;
    color: var(--purple);

    font-size: 12px;
    font-weight: 800;
    text-decoration: none;

    white-space: nowrap;
}

.production-action a:hover {
    background: #ede0f2;
}


.production-submit-card {
    padding-top: 23px;
}

.production-ready-message {
    margin-bottom: 5px;

    color: #287440;

    font-weight: 750;
}

.production-disabled {
    opacity: .45;
    cursor: not-allowed;
}

.production-submit-help {
    text-align: center;
}


.production-back {
    display: inline-block;

    margin-bottom: 23px;

    color: var(--purple);

    font-size: 14px;
    font-weight: 750;
    text-decoration: none;
}

.production-back:hover {
    text-decoration: underline;
}


.production-save-card {
    position: sticky;

    bottom: 10px;

    z-index: 10;

    padding: 18px 20px;

    box-shadow:
        0 10px 35px rgba(45, 27, 55, .16);
}

.production-save-actions {
    display: grid;

    grid-template-columns:
        minmax(0, 1fr)
        minmax(0, 1fr);

    gap: 10px;
}

.production-save-actions .button {
    margin: 0;
    width: 100%;
}


.production-kpi {
    display: inline-flex;

    padding: 5px 8px;

    border-radius: 999px;

    font-size: 11px;
    font-weight: 800;

    white-space: nowrap;
}

.production-kpi.good {
    background: #eaf7ee;
    color: #26743e;
}

.production-kpi.bad {
    background: #fdebed;
    color: #9d343d;
}


.production-details summary {
    color: var(--purple);

    font-size: 12px;
    font-weight: 750;

    cursor: pointer;

    white-space: nowrap;
}

.production-details div {
    min-width: 250px;

    margin-top: 9px;
    padding: 11px 13px;

    border-radius: 10px;

    background: #faf6fc;

    color: var(--text);

    line-height: 1.45;
}


@media (max-width: 760px) {

    .production-list-card {
        padding: 6px 10px;
    }

    .production-table th,
    .production-table td {
        padding: 12px 9px;
    }

    .production-org-name {
        min-width: 230px;
    }

    .production-save-actions {
        grid-template-columns: 1fr;
    }

    .production-save-card {
        bottom: 5px;
    }
}
