.ai-report {
    background: transparent;
    color: var(--text, #111827);
}

.ai-report__title {
    margin: 0 0 8px;
    font-size: 26px;
    line-height: 1.2;
    color: var(--text, #111827);
}

.ai-report__summary,
.ai-report__summary-line {
    color: var(--muted, #64748b);
    line-height: 1.5;
}

.ai-report table {
    font-size: 14px;
}

.ai-report__kpis {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin: 16px 0;
}

.ai-report__kpi {
    background: #f9fafb;
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 16px;
    padding: 14px;
}

.ai-report__kpi-label {
    color: var(--muted, #64748b);
    font-size: 12px;
    margin-bottom: 6px;
}

.ai-report__kpi-value {
    font-size: 20px;
    font-weight: 800;
    color: var(--text, #111827);
}

.ai-report__chart {
    background: #ffffff;
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 18px;
    padding: 16px;
    margin: 16px 0;
}

.ai-report__chart h3 {
    margin: 0 0 14px;
    font-size: 18px;
}

.ai-report__bar-row {
    display: grid;
    grid-template-columns: 220px 1fr 130px;
    gap: 10px;
    align-items: center;
    margin-bottom: 10px;
}

.ai-report__bar-label {
    font-size: 13px;
    color: #374151;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ai-report__bar-track {
    height: 14px;
    background: #eef2ff;
    border-radius: 999px;
    overflow: hidden;
}

.ai-report__bar-fill {
    height: 100%;
    background: var(--primary, #4f46e5);
    border-radius: 999px;
}

.ai-report__bar-value {
    font-size: 13px;
    color: #374151;
    text-align: right;
    white-space: nowrap;
}

.ai-report__table-wrap {
    overflow-x: auto;
    margin-top: 16px;
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 16px;
    background: #fff;
}

.ai-report__table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
}

.ai-report__table th,
.ai-report__table td {
    padding: 11px 12px;
    border-bottom: 1px solid var(--border, #e5e7eb);
    text-align: left;
    vertical-align: top;
    font-size: 13px;
}

.ai-report__table th {
    background: #f9fafb;
    font-weight: 800;
    color: #374151;
}

.ai-report__table tr:last-child td {
    border-bottom: 0;
}

.ai-report__details {
    margin-top: 16px;
    background: #f9fafb;
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 16px;
    padding: 12px 14px;
}

.ai-report__details summary {
    cursor: pointer;
    font-weight: 800;
    color: #374151;
}

.ai-report__details .ai-report__body {
    margin-top: 12px;
}

.ai-report__dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-top: 16px;
}

.ai-report__block--compact {
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 18px;
    padding: 14px;
    background: rgba(15, 23, 42, 0.55);
    min-width: 0;
}

.ai-report__block--compact h3 {
    margin: 0 0 8px;
    font-size: 15px;
    line-height: 1.25;
}

.ai-report__insight--compact {
    font-size: 13px;
    line-height: 1.35;
    margin-bottom: 10px;
    color: #dbeafe;
}

.ai-report__mini-chart {
    display: grid;
    gap: 8px;
    margin-top: 10px;
}

.ai-report__mini-bar-top {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    font-size: 12px;
    line-height: 1.2;
    margin-bottom: 4px;
}

.ai-report__mini-bar-top span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #cbd5e1;
}

.ai-report__mini-bar-top b {
    white-space: nowrap;
    color: #f8fafc;
    font-weight: 600;
}

.ai-report__block--compact .ai-report__details {
    margin-top: 10px;
    font-size: 12px;
}

.ai-report__block--compact .ai-report__details summary {
    cursor: pointer;
    color: #93c5fd;
}

.ai-report__block--compact .ai-report__table-wrap {
    max-height: 220px;
    overflow: auto;
}

.ai-report--dashboard .ai-report__block--compact,
.ai-report--dashboard .ai-report__card,
.ai-report--dashboard .ai-report__kpi {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    color: #0f172a;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.ai-report--dashboard .ai-report__block--compact h3,
.ai-report--dashboard .ai-report__card-title,
.ai-report--dashboard .ai-report__kpi-value,
.ai-report--dashboard .ai-report__mini-bar-top b {
    color: #0f172a;
}

.ai-report--dashboard .ai-report__insight--compact,
.ai-report--dashboard .ai-report__card-text,
.ai-report--dashboard .ai-report__summary-line,
.ai-report--dashboard .ai-report__kpi-label,
.ai-report--dashboard .ai-report__mini-bar-top span {
    color: #475569;
}

.ai-report--dashboard .ai-report__query {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    color: #334155;
}

.ai-report--dashboard .ai-report__details {
    background: #ffffff;
    color: #334155;
}

.ai-report--dashboard .ai-report__details summary {
    color: #2563eb;
}

.ai-report--dashboard .ai-report__bar-track {
    background: #e5e7eb;
}

.ai-report--dashboard .ai-report__table-wrap {
    background: #ffffff;
    border: 1px solid #e5e7eb;
}

.ai-report--dashboard .ai-report__table {
    color: #0f172a;
}

.ai-report--dashboard .ai-report__table th {
    background: #f8fafc;
    color: #334155;
    border-bottom: 1px solid #e5e7eb;
}

.ai-report--dashboard .ai-report__table td {
    border-bottom: 1px solid #f1f5f9;
    color: #334155;
}

.ai-report__management {
    margin: 22px 0;
    padding: 18px;
    border-radius: 22px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.ai-report__management-summary {
    font-size: 15px;
    line-height: 1.55;
    color: #0f172a;
    margin-bottom: 14px;
}

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

.ai-report__management-card {
    border-radius: 16px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    padding: 14px;
}

.ai-report__management-card-title {
    font-size: 13px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 8px;
}

.ai-report__management-card ul {
    margin: 0;
    padding-left: 18px;
}

.ai-report__management-card li {
    font-size: 13px;
    line-height: 1.4;
    color: #334155;
    margin-bottom: 6px;
}

.ai-report--forecast .ai-report__chart,
.ai-report--forecast .ai-report__section,
.ai-report--forecast .ai-report__details {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    padding: 16px;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
    margin-top: 16px;
}

.ai-report--forecast .ai-report__details summary {
    cursor: pointer;
    color: #2563eb;
    font-weight: 700;
}

.ai-report--forecast .ai-report__table-wrap {
    max-height: 520px;
    overflow: auto;
}

.ai-report--forecast .ai-report__table td,
.ai-report--forecast .ai-report__table th {
    font-size: 13px;
    line-height: 1.3;
}

@media (max-width: 1000px) {
    .ai-report__management-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    .ai-report__dashboard-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .ai-report__kpis {
        grid-template-columns: 1fr 1fr;
    }

    .ai-report__bar-row {
        grid-template-columns: 1fr;
        gap: 5px;
    }

    .ai-report__bar-value {
        text-align: left;
    }
}

/* ===== Единый тостер уведомлений (общий для админки и кабинета; логика — /notify.js) ===== */
#toastContainer {
    position: fixed;
    top: 12px;
    right: 16px;
    z-index: 9999;            /* выше модалок */
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 460px;
    pointer-events: none;     /* клики мимо стопки проходят; сами тосты кликабельны */
}

.toast {
    pointer-events: auto;
    padding: 12px 38px 12px 14px;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.18);
    font-weight: 400;         /* тело сообщения — обычный вес */
    line-height: 1.4;
    position: relative;
    opacity: 0;
    transform: translateX(24px);
    transition: opacity .25s ease, transform .25s ease;
    word-break: break-word;
}

.toast.show { opacity: 1; transform: translateX(0); }
.toast__title { font-weight: 700; display: block; margin-bottom: 2px; }

.toast.success { background: #ecfdf5; color: #047857; }
.toast.error   { background: #fef2f2; color: #b91c1c; }
.toast.info    { background: #eff6ff; color: #1e40af; }
.toast.warning { background: #fffbeb; color: #92400e; }

.toast__close {
    position: absolute;
    top: 4px;                 /* строго к верхней границе тоста */
    right: 8px;
    padding: 0;
    border: none;
    background: transparent;
    color: inherit;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    opacity: .65;
}

.toast__close:hover { opacity: 1; }
