/* Общий фон и область содержимого. */
body.portal-layout {
    display: block;
    box-sizing: border-box;
    min-height: 100vh;
    margin: 0;
    padding-top: 88px;
    background-color: #0b1020;
    background-image:
        linear-gradient(
            rgba(5, 8, 18, 0.25),
            rgba(5, 8, 18, 0.55)
        ),
        url("../images/portal-bg.jpg");
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
}

body.portal-menu-open {
    overflow: hidden;
}

main.portal-main {
    box-sizing: border-box;
    min-width: 0;
    max-width: none;
    margin: 0 32px 32px;
    padding: 32px;
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 24px;
    background-color: rgba(255, 255, 255, 0.96);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.25);
}

/* Графики используют доступную ширину области содержимого. */
.portal-main .charts-grid {
    width: 100%;
    margin-left: 0;
}

/* Верхнее раскрывающееся меню. */
.portal-menu-toggle,
.portal-menu-close {
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    background-color: #101626;
    color: #ffffff;
    font: inherit;
    cursor: pointer;
}

.portal-menu-toggle {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 50;
    padding: 12px 20px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
    background-color: transparent;
}

.portal-menu-close {
    position: absolute;
    top: 16px;
    right: 20px;
    padding: 2px 12px;
    font-size: 32px;
    line-height: 1.2;
}

.portal-menu-toggle:hover,
.portal-menu-close:hover {
    background-color: #25304a;
}
.portal-menu-toggle:hover {
    background-color: transparent;
    border-color: #93c5fd;
}

.portal-drawer {
    position: fixed;
    inset: 0 0 auto 0;
    box-sizing: border-box;
    width: 100%;
    max-width: none;
    height: auto;
    max-height: 85vh;
    max-height: 85dvh;
    margin: 0;
    padding: 0;
    border: none;
    border-bottom: 2px solid #6655ff;
    border-radius: 0 0 24px 24px;
    background-color: #0a0e1b;
    color: #ffffff;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
    overflow-y: auto;
}

.portal-drawer::backdrop {
    background-color: rgba(0, 0, 0, 0.55);
}

.portal-drawer .portal-sidebar {
    position: relative;
    box-sizing: border-box;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 32px;
    height: auto;
    min-height: 0;
    padding: 32px 76px 32px 32px;
    border: none;
    background: transparent;
    color: #ffffff;
    overflow: visible;
}

.portal-brand {
    color: #ffffff;
    font-size: 22px;
    font-weight: bold;
    text-decoration: none;
}

.portal-brand span {
    display: block;
    margin-top: 8px;
    color: #aebbd1;
    font-size: 13px;
    font-weight: normal;
    line-height: 1.5;
}

.portal-drawer .portal-menu {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.portal-menu a {
    padding: 14px 16px;
    border: 1px solid transparent;
    border-radius: 12px;
    color: #e5eaf3;
    text-decoration: none;
    transition:
        background-color 0.2s ease,
        border-color 0.2s ease;
}

.portal-menu a:hover {
    background-color: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.18);
}

.portal-drawer .portal-account {
    margin: 0;
    padding: 0 0 0 24px;
    border-top: none;
    border-left: 1px solid rgba(255, 255, 255, 0.15);
}

.portal-account-label {
    margin: 0 0 8px;
    color: #aebbd1;
    font-size: 13px;
}

.portal-account-name {
    margin: 0 0 10px;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.portal-account-button {
    display: inline-block;
    padding: 10px 18px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 10px;
    background-color: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    font: inherit;
    text-decoration: none;
    cursor: pointer;
}

.portal-account-button:hover {
    background-color: rgba(255, 255, 255, 0.16);
}

.portal-menu a:focus-visible,
.portal-brand:focus-visible,
.portal-account-button:focus-visible,
.portal-menu-toggle:focus-visible,
.portal-menu-close:focus-visible {
    outline: 2px solid #93c5fd;
    outline-offset: 4px;
}

/* Главная страница. */
main.portal-main.portal-home {
    padding: 24px 8px;
    background: transparent;
    border: none;
    box-shadow: none;
    color: #ffffff;
}

.home-header {
    text-align: center;
}

/* Общие свойства прозрачных элементов с градиентной рамкой. */
.home-header h1,
.home-header > p,
.home-tools > h2,
.portal-home .tool-card {
    position: relative;
    border: 4px solid transparent;
    background: transparent;
}

.home-header h1,
.home-header > p {
    border-radius: 22px;
    box-shadow: none;
}

.home-header h1 {
    margin: 0;
    padding: 20px 28px;
    color: #ffffff;
    font-size: clamp(26px, 2.8vw, 46px);
    font-weight: normal;
    line-height: 1.3;
    letter-spacing: 0.03em;
    text-wrap: balance;
}

.home-header > p {
    box-sizing: border-box;
    width: fit-content;
    max-width: 100%;
    margin: 20px auto 0;
    padding: 14px 24px;
    color: #d4deef;
    font-size: 18px;
    line-height: 1.6;
}

.home-brands {
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 32px;
    width: fit-content;
    max-width: 100%;
    margin: 36px auto 0;
    padding: 24px 36px;
    border-radius: 20px;
    background: transparent;
    box-shadow: none;
}

.home-brands img {
    display: block;
    width: clamp(140px, 19vw, 320px);
    max-width: 100%;
    height: auto;
}

.home-tools {
    margin-top: 52px;
}

.home-tools > h2 {
    display: table;
    box-sizing: border-box;
    max-width: 100%;
    margin: 0 auto 32px;
    padding: 16px 36px;
    border-radius: 26px;
    color: #ffffff;
    font-size: clamp(30px, 4vw, 60px);
    font-weight: normal;
    line-height: 1.2;
}

.portal-home .tools-list {
    grid-template-columns:
        repeat(auto-fit, minmax(min(100%, 280px), 1fr));
    gap: 28px;
    margin: 0;
}

.portal-home .tool-card {
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 250px;
    padding: 26px;
    border-radius: 28px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

.portal-home .tool-card:hover {
    transform: translateY(-4px);
    border-color: transparent;
    box-shadow:
        0 16px 36px rgba(0, 0, 0, 0.5),
        0 0 18px rgba(112, 83, 255, 0.25);
}

/* Маска оставляет градиент только по краям элемента. */
.home-header h1::before,
.home-header > p::before,
.home-tools > h2::before,
.portal-home .tool-card::before {
    content: "";
    position: absolute;
    inset: -4px;
    padding: 4px;
    border-radius: inherit;
    pointer-events: none;
    background: linear-gradient(125deg, #3535ff, #9861c9, #ff3525);
    -webkit-mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
}

.portal-home .tool-card:nth-child(even)::before {
    background: linear-gradient(125deg, #ff3525, #9861c9, #3535ff);
}

.portal-home .tool-card h3 {
    margin: 0;
    color: #ffffff;
    font-size: clamp(22px, 1.7vw, 30px);
    font-weight: normal;
    line-height: 1.3;
    overflow-wrap: anywhere;
    text-shadow: 0 0 8px rgba(110, 100, 255, 0.35);
}

.portal-home .tool-card a {
    color: #ffffff;
    text-decoration: none;
}

.portal-home .tool-card a:hover {
    text-decoration: underline;
    text-underline-offset: 5px;
}

.portal-home .tool-card a:focus-visible {
    outline: 2px solid #93c5fd;
    outline-offset: 5px;
}

.portal-home .tool-card .tool-description {
    margin: 18px 0 28px;
    color: #ffffff;
    font-size: 19px;
    line-height: 1.5;
}

.portal-home .tool-card .tool-status {
    margin: auto 0 0;
    padding: 0;
    background: none;
    color: #ffffff;
    font-size: 20px;
    line-height: 1.4;
}

.home-empty {
    padding: 24px;
    border-radius: 16px;
    background-color: rgba(12, 17, 30, 0.9);
    color: #d4deef;
    text-align: center;
}

/* Адаптация верхнего меню. */
@media (max-width: 900px) {
    .portal-drawer .portal-sidebar {
        grid-template-columns: minmax(0, 1fr);
        gap: 24px;
        padding: 28px 24px;
    }

    .portal-drawer .portal-brand {
        padding-right: 48px;
    }

    .portal-drawer .portal-menu {
        justify-content: flex-start;
    }

    .portal-drawer .portal-account {
        padding: 20px 0 0;
        border-left: none;
        border-top: 1px solid rgba(255, 255, 255, 0.15);
    }
}

@media (max-width: 760px) {
    main.portal-main {
        margin: 0 16px 16px;
        padding: 20px;
        border-radius: 16px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .portal-home .tool-card {
        transition: none;
    }

    .portal-home .tool-card:hover {
        transform: none;
    }
}
.analytics-page .report-builder {
    margin: 24px 0;
    padding: 28px;
    border: 1px solid #465277;
    border-radius: 20px;
    background: linear-gradient(135deg, #111827, #1c1830);
    color: #ffffff;
}

.report-builder h2 {
    margin: 0 0 10px;
    font-size: 26px;
}

.report-builder-description {
    margin: 0 0 28px;
    color: #cbd5e1;
    line-height: 1.5;
}

.report-form-fields {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}

.report-form-field {
    min-width: 0;
}

.report-form-field label {
    display: block;
    margin-bottom: 10px;
    font-size: 15px;
    font-weight: bold;
}

.report-form-field input,
.report-form-field select {
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    min-height: 46px;
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    background-color: #ffffff;
    color: #111827;
    font: inherit;
}

.report-form-field input:focus-visible,
.report-form-field select:focus-visible,
.report-create-button:focus-visible {
    outline: 2px solid #93c5fd;
    outline-offset: 3px;
}

.report-form-actions {
    margin-top: 24px;
}

.report-create-button {
    padding: 12px 24px;
    border: 1px solid #818cf8;
    border-radius: 10px;
    background-color: #4338ca;
    color: #ffffff;
    font: inherit;
    font-weight: bold;
    cursor: pointer;
}

.report-create-button:hover {
    background-color: #3730a3;
}

.report-form .errorlist {
    margin: 10px 0;
    padding-left: 20px;
    color: #fecaca;
    line-height: 1.5;
}

.report-field-help {
    margin: 8px 0 0;
    color: #cbd5e1;
    font-size: 13px;
}

@media (max-width: 1100px) {
    .report-form-fields {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 600px) {
    .report-form-fields {
        grid-template-columns: minmax(0, 1fr);
    }

    .analytics-page .report-builder {
        padding: 20px;
    }

    .report-create-button {
        width: 100%;
    }
}
.analytics-page #report-history {
    margin: 32px 0;
}

.report-history-grid {
    display: grid;
    grid-template-columns:
        repeat(auto-fit, minmax(min(100%, 300px), 1fr));
    gap: 16px;
}

.analytics-page .report-card {
    min-width: 0;
    margin: 0;
    padding: 20px;
    border: 1px solid #d1d5db;
    border-radius: 16px;
    background-color: #ffffff;
}

.analytics-page .report-card p {
    margin: 0 0 12px;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.analytics-page .report-card p:last-child {
    margin-bottom: 0;
}

.analytics-page .report-card a {
    color: #4338ca;
    font-weight: bold;
    text-decoration: none;
}

.analytics-page .report-card a:hover {
    text-decoration: underline;
}
.analytics-settings {
    margin: 20px 0;
    border: 1px solid #d1d5db;
    border-radius: 16px;
    background-color: #ffffff;
}

.analytics-settings > summary {
    padding: 20px 24px;
    border-radius: 16px;
    color: #1f2937;
    font-size: 21px;
    font-weight: bold;
    cursor: pointer;
}

.analytics-settings > summary:hover {
    background-color: #f3f4f6;
}

.analytics-settings > summary:focus-visible {
    outline: 2px solid #6366f1;
    outline-offset: 3px;
}

.analytics-settings[open] > summary {
    border-bottom: 1px solid #e5e7eb;
    border-radius: 16px 16px 0 0;
}

.analytics-settings-content {
    padding: 24px;
}

.analytics-settings-content > :first-child {
    margin-top: 0;
}
.analytics-settings-content form {
    margin: 16px 0 24px;
}

.analytics-settings-content form p {
    margin: 0 0 18px;
}

.analytics-settings-content form label {
    display: block;
    margin-bottom: 8px;
    font-size: 15px;
    font-weight: bold;
}

.analytics-settings-content input:not([type="hidden"]),
.analytics-settings-content select {
    box-sizing: border-box;
    width: 100%;
    max-width: 420px;
    min-height: 44px;
    padding: 10px 12px;

    border: 1px solid #cbd5e1;
    border-radius: 10px;
    background-color: #ffffff;
    color: #111827;
    font: inherit;
}

.analytics-settings-content button {
    padding: 11px 20px;
    border: 1px solid #6366f1;
    border-radius: 10px;
    background-color: #4338ca;
    color: #ffffff;
    font: inherit;
    cursor: pointer;
}

.analytics-settings-content button:hover {
    background-color: #3730a3;
}

.analytics-settings-content input:focus-visible,
.analytics-settings-content select:focus-visible,
.analytics-settings-content button:focus-visible {
    outline: 2px solid #818cf8;
    outline-offset: 3px;
}

.analytics-settings-content .errorlist {
    color: #b91c1c;
    line-height: 1.5;
}

.analytics-settings-content a {
    color: #4338ca;
}
.analytics-settings-content .cost-search-form {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) auto;
    align-items: end;
    gap: 16px;
}

.cost-search-field {
    min-width: 0;
}

.analytics-settings-content .cost-search-field input,
.analytics-settings-content .cost-search-field select {
    max-width: none;
}

.cost-search-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    min-height: 44px;
}

@media (max-width: 900px) {
    .analytics-settings-content .cost-search-form {
        grid-template-columns: minmax(0, 1fr);
    }
}
/* Фон страницы аналитики. */
main.portal-main.analytics-page {
    background: transparent;
    border: none;
    box-shadow: none;
    color: #ffffff;
}

/* Отдельные блоки вместо общей белой панели. */
.analytics-page > h1,
.analytics-page .report-builder,
.analytics-page .report-card,
.analytics-page .analytics-settings {
    position: relative;
    box-sizing: border-box;
    border: 4px solid transparent;
    background: transparent;
    color: #ffffff;
    box-shadow: none;
}

/* Общая градиентная рамка. */
.analytics-page > h1::before,
.analytics-page .report-builder::before,
.analytics-page .report-card::before,
.analytics-page .analytics-settings::before {
    content: "";
    position: absolute;
    inset: -4px;
    padding: 4px;
    border-radius: inherit;
    pointer-events: none;

    background: linear-gradient(
        125deg,
        #3535ff,
        #9861c9,
        #ff3525
    );

    -webkit-mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);

    -webkit-mask-composite: xor;
    mask-composite: exclude;
}

.analytics-page > h1 {
    margin: 0 0 28px;
    padding: 20px 28px;
    border-radius: 22px;
    text-align: center;
}

.analytics-page .report-card:nth-child(even)::before {
    background: linear-gradient(
        125deg,
        #ff3525,
        #9861c9,
        #3535ff
    );
}

/* Ссылки и текст на тёмном фоне. */
.analytics-page a {
    color: #c4b5fd;
}

.analytics-page a:hover {
    color: #ffffff;
}

.analytics-page .report-builder-description,
.analytics-page .report-field-help {
    color: #e2e8f0;
}

.analytics-page .report-card a {
    color: #ffffff;
}

/* Сворачиваемые настройки. */
.analytics-page .analytics-settings > summary {
    background: transparent;
    color: #ffffff;
}

.analytics-page .analytics-settings > summary:hover {
    background-color: rgba(255, 255, 255, 0.08);
}

.analytics-page .analytics-settings[open] > summary {
    border-bottom-color: rgba(255, 255, 255, 0.2);
}

/* Статусы с контрастными цветами. */
.analytics-page .report-status-created strong {
    color: #cbd5e1;
}

.analytics-page .report-status-queued strong,
.analytics-page .report-status-running strong {
    color: #fde68a;
}

.analytics-page .report-status-done strong {
    color: #86efac;
}

.analytics-page .report-status-failed strong {
    color: #fca5a5;
}

/* Таблицы внутри настроек. */
.analytics-page .cost-table {
    background: transparent;
    color: #ffffff;
}

.analytics-page .cost-table th,
.analytics-page .cost-table td {
    border-color: rgba(255, 255, 255, 0.25);
}

.analytics-page .cost-table th {
    background-color: rgba(10, 14, 27, 0.8);
}

.analytics-page .cost-table tbody tr:nth-child(even) {
    background-color: rgba(255, 255, 255, 0.05);
}

.analytics-page .cost-table tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.1);
}
/* Страница отдельного запроса. */
main.portal-main.report-detail-page {
    background: transparent;
    border: none;
    box-shadow: none;
    color: #ffffff;
}

.request-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 28px;
}

.request-heading h1 {
    margin: 0;
    font-size: clamp(28px, 3vw, 42px);
}

.request-status {
    margin: 0;
    padding: 12px 18px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    background-color: rgba(0, 0, 0, 0.25);
}

.request-status-created strong {
    color: #cbd5e1;
}

.request-status-queued strong,
.request-status-running strong {
    color: #fde68a;
}

.request-status-done strong {
    color: #86efac;
}

.request-status-failed strong {
    color: #fca5a5;
}

.request-panel {
    position: relative;
    margin-bottom: 24px;
    padding: 28px;
    border: 4px solid transparent;
    border-radius: 22px;
    background: transparent;
}

.request-panel::before {
    content: "";
    position: absolute;
    inset: -4px;
    padding: 4px;
    border-radius: inherit;
    pointer-events: none;

    background: linear-gradient(125deg, #3535ff, #9861c9, #ff3525);

    -webkit-mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);

    -webkit-mask-composite: xor;
    mask-composite: exclude;
}

.request-panel h2,
.request-error h2 {
    margin: 0 0 24px;
    font-size: 24px;
}

.request-parameters {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 28px;
    margin: 0;
}

.request-parameters > div {
    min-width: 0;
}

.request-parameters dt {
    margin-bottom: 10px;
    color: #cbd5e1;
    font-size: 15px;
}

.request-parameters dd {
    margin: 0;
    font-size: 18px;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.request-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 28px;
}

.request-actions form {
    margin: 0;
}

.request-button {
    display: inline-block;
    box-sizing: border-box;
    padding: 12px 22px;
    border: 1px solid #818cf8;
    border-radius: 12px;
    background-color: #4338ca;
    color: #ffffff;
    font: inherit;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
}

.request-button:hover {
    background-color: #3730a3;
}

.request-button-secondary {
    background: transparent;
}

.request-button-secondary:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.request-button:focus-visible {
    outline: 2px solid #93c5fd;
    outline-offset: 4px;
}

.request-error {
    padding: 24px;
    border: 1px solid #f87171;
    border-radius: 16px;
    background-color: rgba(69, 10, 10, 0.85);
    color: #fecaca;
    overflow-wrap: anywhere;
}

.request-error p {
    margin: 0;
    line-height: 1.6;
}

.request-refresh-note {
    margin-top: 24px;
    color: #cbd5e1;
    line-height: 1.5;
}

@media (max-width: 900px) {
    .request-parameters {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 600px) {
    .request-parameters {
        grid-template-columns: minmax(0, 1fr);
    }

    .request-panel {
        padding: 20px;
    }
}
/* Страница графиков: общий фон прозрачный. */
main.portal-main.report-charts-page {
    background: transparent;
    border: none;
    box-shadow: none;
    color: #ffffff;
}

/* Выбор магазина. */
.charts-store-form {
    display: flex;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 28px;
}

.charts-store-field {
    flex: 0 1 360px;
    min-width: 0;
}

.charts-store-field label {
    display: block;
    margin-bottom: 10px;
    color: #e2e8f0;
    font-size: 15px;
}

.charts-store-field select {
    box-sizing: border-box;
    width: 100%;
    min-height: 46px;
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    background-color: #ffffff;
    color: #111827;
    font: inherit;
}

.charts-store-field select:focus-visible {
    outline: 2px solid #93c5fd;
    outline-offset: 3px;
}

.charts-report-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 24px 56px;
    margin: 0;
}

.charts-report-meta dt {
    margin-bottom: 8px;
    color: #cbd5e1;
    font-size: 15px;
}

.charts-report-meta dd {
    margin: 0;
    font-size: 18px;
    line-height: 1.5;
}

/* Итоговые показатели. */
.report-charts-page .summary-grid {
    grid-template-columns:
        repeat(auto-fit, minmax(min(100%, 260px), 1fr));
    gap: 20px;
    margin: 28px 0;
}

.report-charts-page .summary-card {
    position: relative;
    border: 4px solid transparent;
    border-radius: 20px;
    background: transparent;
    color: #ffffff;
}

.report-charts-page .summary-card::before {
    content: "";
    position: absolute;
    inset: -4px;
    padding: 4px;
    border-radius: inherit;
    pointer-events: none;

    background: linear-gradient(125deg, #3535ff, #9861c9, #ff3525);

    -webkit-mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);

    -webkit-mask-composite: xor;
    mask-composite: exclude;
}

.report-charts-page .summary-card h2 {
    color: #e2e8f0;
    line-height: 1.5;
}

.report-charts-page .summary-card p {
    line-height: 1.5;
}

.report-charts-page .summary-value {
    font-size: clamp(22px, 2vw, 30px);
    font-weight: bold;
    font-variant-numeric: tabular-nums;
}

/* У графиков сохраняем светлую подложку и тёмный текст. */
.report-charts-page .chart-card {
    padding: 24px;
    border: 4px solid transparent;
    border-radius: 22px;

    background:
        linear-gradient(#ffffff, #ffffff) padding-box,
        linear-gradient(
            125deg,
            #3535ff,
            #9861c9,
            #ff3525
        ) border-box;

    color: #1f2937;
}
.report-charts-page .charts-grid {
    margin-bottom: 28px;
}

.report-charts-page > .chart-card {
    margin: 28px 0;
}

.report-charts-page .chart-card h2 {
    margin-bottom: 18px;
    line-height: 1.4;
}

.report-charts-page .chart-card label {
    display: inline-block;
    margin: 0 8px 12px 0;
    font-size: 14px;
    font-weight: bold;
}

.report-charts-page .chart-card select {
    box-sizing: border-box;
    max-width: 100%;
    min-height: 40px;
    margin: 0 16px 12px 0;
    padding: 8px 12px;

    border: 1px solid #cbd5e1;
    border-radius: 10px;
    background-color: #f8fafc;
    color: #111827;
    font: inherit;
}

.report-charts-page .chart-card select:focus-visible {
    outline: 2px solid #6366f1;
    outline-offset: 3px;
}

.report-charts-page .chart-card > p {
    line-height: 1.5;
}

@media (max-width: 600px) {
    .report-charts-page .chart-card {
        padding: 16px;
    }
}
.chart-viewer-toolbar {
    margin: 28px 0 20px;
}

.chart-viewer-toolbar label {
    display: block;
    margin-bottom: 12px;
    color: #ffffff;
    font-size: 20px;
    font-weight: bold;
}

.chart-viewer-toolbar select {
    box-sizing: border-box;
    width: 100%;
    min-height: 48px;
    padding: 12px 16px;

    border: 1px solid #818cf8;
    border-radius: 12px;
    background-color: #ffffff;
    color: #111827;
    font: inherit;
}

.chart-viewer-toolbar select:focus-visible {
    outline: 2px solid #93c5fd;
    outline-offset: 3px;
}

.chart-viewer-stage {
    min-width: 0;
    margin-bottom: 28px;
}

.chart-viewer-stage > .chart-card {
    width: 100%;
    box-sizing: border-box;
    margin: 0;
}

.chart-viewer-stage > .chart-card[hidden] {
    display: none !important;
}

.chart-viewer-stage .chart-container:not(#fee-chart-container) {
    height: clamp(480px, 65vh, 760px);
}
.chart-viewer-stage {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
}
.chart-viewer-group {
    min-width: 0;
}

.chart-viewer-group-heading {
    margin: 12px 0 24px;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.25);
    color: #ffffff;
    font-size: 28px;
}

.chart-viewer-group-cards {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
}

.chart-viewer-stage .chart-card {
    box-sizing: border-box;
    width: 100%;
    margin: 0;
}

.chart-viewer-group[hidden],
.chart-viewer-stage .chart-card[hidden] {
    display: none !important;
}
/* Хранилище, проверка себестоимости и вход. */
main.portal-main.portal-service-page {
    background: transparent;
    border: none;
    box-shadow: none;
    color: #ffffff;
}

.portal-service-page .request-panel {
    box-sizing: border-box;
    min-width: 0;
}

.portal-service-page h1,
.portal-service-page h2 {
    color: #ffffff;
}

.service-description {
    margin: 0 0 24px;
    color: #e2e8f0;
    line-height: 1.6;
}

.service-form {
    margin: 0;
}

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

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

.service-field {
    min-width: 0;
}

.service-field label {
    display: block;
    margin-bottom: 10px;
    color: #ffffff;
    font-size: 15px;
    font-weight: bold;
}

.service-field input:not([type="hidden"]),
.service-field select {
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    min-height: 46px;
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    background-color: #ffffff;
    color: #111827;
    font: inherit;
}

.service-field input[type="file"] {
    padding: 8px;
}

.service-field input[type="file"]::file-selector-button {
    margin-right: 12px;
    padding: 7px 12px;
    border: none;
    border-radius: 6px;
    background-color: #e0e7ff;
    color: #312e81;
    font: inherit;
    cursor: pointer;
}

.service-field input:focus-visible,
.service-field select:focus-visible,
.service-table-scroll:focus-visible {
    outline: 2px solid #93c5fd;
    outline-offset: 4px;
}

.service-help {
    margin: 8px 0 0;
    color: #cbd5e1;
    font-size: 13px;
    line-height: 1.5;
}

.service-form .errorlist {
    margin: 12px 0;
    padding-left: 20px;
    color: #fecaca;
    line-height: 1.6;
}

.service-section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 24px;
}

.service-section-heading h2,
.service-section-heading p {
    margin: 0;
}

.service-success {
    margin: 0;
    color: #86efac;
    line-height: 1.6;
}

/* Таблица прокручивается внутри блока, не растягивая страницу. */
.service-table-scroll {
    max-width: 100%;
    overflow-x: auto;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 12px;
}

.portal-service-page .service-table {
    width: 100%;
    margin: 0;
    border-collapse: separate;
    border-spacing: 0;
    background: transparent;
    color: #ffffff;
    font-variant-numeric: tabular-nums;
}

.portal-service-page .service-table th,
.portal-service-page .service-table td {
    padding: 14px 16px;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.18);
    background: transparent;
    color: inherit;
    text-align: left;
    vertical-align: top;
    line-height: 1.5;
}

.portal-service-page .service-table th {
    background-color: rgba(10, 14, 27, 0.9);
    font-size: 14px;
    font-weight: bold;
}

.portal-service-page .service-table tbody tr {
    background: transparent;
}

.portal-service-page .service-table tbody tr:nth-child(even) {
    background-color: rgba(255, 255, 255, 0.05);
}

.portal-service-page .service-table tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.portal-service-page .service-table tbody tr:last-child td {
    border-bottom: none;
}

.portal-service-page .service-table .service-number {
    text-align: right;
    white-space: nowrap;
}

.service-nowrap {
    white-space: nowrap;
}

.service-error-cell {
    min-width: 140px;
    max-width: 360px;
    overflow-wrap: anywhere;
}

.service-status {
    font-weight: bold;
}

.service-status-queued,
.service-status-running {
    color: #fde68a;
}

.service-status-done {
    color: #86efac;
}

.service-status-failed {
    color: #fca5a5;
}

/* Ограничиваем высоту длинного предпросмотра Excel. */
.service-preview-scroll {
    max-height: 65vh;
}

.service-preview-scroll thead th {
    position: sticky;
    top: 0;
    z-index: 1;
}

/* Страница входа. */
main.portal-main.portal-login-page {
    display: grid;
    place-items: center;
    min-height: calc(100dvh - 120px);
}

.portal-login-card {
    width: 100%;
    max-width: 480px;
    margin: 0;
    padding: 36px;
}

.portal-login-card h1 {
    margin: 0 0 14px;
    font-size: clamp(28px, 3vw, 36px);
    text-align: center;
}

.portal-login-card > .service-description {
    text-align: center;
}

.portal-auth-form {
    display: grid;
    gap: 22px;
}

.portal-auth-form > .errorlist {
    margin: 0;
}

.portal-auth-form > .request-button {
    width: 100%;
    margin-top: 4px;
}

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

@media (max-width: 600px) {
    .portal-service-page .request-panel {
        padding: 20px;
    }

    .service-section-heading {
        align-items: flex-start;
    }

    .portal-service-page .service-table th,
    .portal-service-page .service-table td {
        padding: 12px;
    }
}