/* Единая непрозрачная палитра для всплывающих и встроенных уведомлений. */
:root {
    --notice-bg: #eff6ff;
    --notice-text: #1e3a5f;
    --notice-accent: #2563eb;
    --notice-success-bg: #ecfdf3;
    --notice-success-text: #14532d;
    --notice-success-accent: #15803d;
    --notice-warning-bg: #fffbeb;
    --notice-warning-text: #713f12;
    --notice-warning-accent: #a16207;
    --notice-error-bg: #fff1f2;
    --notice-error-text: #881337;
    --notice-error-accent: #be123c;
}
:is([data-theme="dark"], [data-bs-theme="dark"], .dark-theme, body.dark-mode) {
    --notice-bg: #172b46;
    --notice-text: #dbeafe;
    --notice-accent: #60a5fa;
    --notice-success-bg: #16352a;
    --notice-success-text: #dcfce7;
    --notice-success-accent: #4ade80;
    --notice-warning-bg: #3b2e18;
    --notice-warning-text: #fef3c7;
    --notice-warning-accent: #facc15;
    --notice-error-bg: #421f2a;
    --notice-error-text: #ffe4e6;
    --notice-error-accent: #fb7185;
}
/* Специфичность перекрывает прежние стили модулей и dark-theme.css. */
html body :is(.alert, .crm-notification)[class] {
    --notice-current-bg: var(--notice-bg);
    --notice-current-text: var(--notice-text);
    --notice-current-accent: var(--notice-accent);
    background: var(--notice-current-bg) !important;
    color: var(--notice-current-text) !important;
    border: 1px solid var(--notice-current-accent) !important;
    border-left: 4px solid var(--notice-current-accent) !important;
    border-radius: 10px !important;
    padding: 14px 16px;
    font-size: 14px;
    line-height: 1.5;
    overflow-wrap: anywhere;
    backdrop-filter: none !important;
}
html body .alert-success[class] {
    --notice-current-bg: var(--notice-success-bg);
    --notice-current-text: var(--notice-success-text);
    --notice-current-accent: var(--notice-success-accent);
}
html body .alert-warning[class] {
    --notice-current-bg: var(--notice-warning-bg);
    --notice-current-text: var(--notice-warning-text);
    --notice-current-accent: var(--notice-warning-accent);
}
html body :is(.alert-danger, .alert-error)[class] {
    --notice-current-bg: var(--notice-error-bg);
    --notice-current-text: var(--notice-error-text);
    --notice-current-accent: var(--notice-error-accent);
}
.crm-notifications {
    position: fixed;
    top: 5rem;
    right: 1rem;
    z-index: 1090;
    width: min(26rem, calc(100vw - 2rem));
    max-height: calc(100dvh - 6rem);
    overflow-y: auto;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
html body .crm-notification {
    position: relative;
    margin: 0;
    padding-right: 44px;
    pointer-events: auto;
    box-shadow: 0 6px 20px #00000026;
}
.crm-notification-title { display: block; margin-bottom: 4px; }
.crm-notification-message { white-space: pre-line; }
.crm-notification-close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 6px;
    background: none;
    color: inherit;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}
.crm-notification-close:hover { background: var(--notice-current-accent); color: var(--notice-current-bg); }
.crm-notification-close:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
html body .alert a:not(.btn) { color: inherit; text-decoration: underline; }
html body .alert .text-muted { color: inherit !important; }
html body .alert-dismissible { padding-right: 3rem; }
#notification-bar[hidden] { display: none !important; }
#notification-bar .messages { list-style: none; padding: 0; margin: 0; }
#notification-bar .btn-close-notification { display: none; }