/* SIGFAD_ALERTAS_REDESIGN_V2 */

#alertsOffcanvas.alerts-center-v2 {
    width: min(540px, 100vw);
    border-left: 0;
    box-shadow: -1.25rem 0 3.5rem rgba(8, 25, 48, .24);
}
.alerts-center-header {
    padding: 1rem 1.1rem;
    background:
        radial-gradient(
            circle at top right,
            rgba(31, 111, 235, .12),
            transparent 42%
        ),
        #fff;
    border-bottom: 1px solid #e1e8f0;
}

.alerts-center-heading {
    display: flex;
    min-width: 0;
    gap: .75rem;
    align-items: center;
}

.alerts-center-heading-icon {
    display: grid;
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
    place-items: center;
    color: #1264d7;
    background: #e8f1ff;
    border-radius: .85rem;
}

.alerts-center-kicker {
    display: block;
    margin-bottom: .12rem;
    color: #55769d;
    font-size: .65rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.alerts-center-header h5 {
    margin: 0;
    color: #132d4f;
    font-size: 1.05rem;
    font-weight: 800;
}

.alerts-center-sync {
    margin-top: .12rem;
    color: #75859a;
    font-size: .72rem;
}

.alerts-summary-section {
    padding: 1rem;
    background: #f5f8fc;
    border-bottom: 1px solid #e1e8f0;
}

.alerts-summary-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .65rem;
}

.alerts-summary-card-v2 {
    display: flex;
    min-width: 0;
    gap: .65rem;
    align-items: center;
    padding: .78rem;
    background: #fff;
    border: 1px solid #e0e7ef;
    border-radius: .85rem;
    box-shadow: 0 .25rem .75rem rgba(21, 52, 88, .045);
}

.alerts-summary-icon {
    display: grid;
    width: 34px;
    height: 34px;
    flex: 0 0 auto;
    place-items: center;
    color: #2864a7;
    background: #eaf2fc;
    border-radius: .68rem;
}

.alerts-summary-content {
    min-width: 0;
}

.alerts-summary-content strong,
.alerts-summary-content span,
.alerts-summary-content small {
    display: block;
}

.alerts-summary-content strong {
    color: #142e4f;
    font-size: 1.08rem;
    line-height: 1;
}

.alerts-summary-content span {
    margin-top: .16rem;
    color: #394f6c;
    font-size: .76rem;
    font-weight: 750;
}

.alerts-summary-content small {
    overflow: hidden;
    margin-top: .08rem;
    color: #8290a2;
    font-size: .64rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.alerts-summary-card-v2.tone-critical
.alerts-summary-icon {
    color: #c92638;
    background: #fdebed;
}

.alerts-summary-card-v2.tone-high
.alerts-summary-icon {
    color: #a96100;
    background: #fff0d9;
}

.alerts-summary-card-v2.tone-unread
.alerts-summary-icon {
    color: #136e98;
    background: #e7f5fb;
}

.alerts-command-bar {
    display: flex;
    justify-content: flex-end;
    gap: .5rem;
    margin-top: .8rem;
}

.alerts-command-bar .btn {
    border-radius: .68rem;
    font-size: .78rem;
    font-weight: 700;
}

.alerts-new-button {
    min-width: 118px;
}

.alerts-filter-section {
    padding: .9rem 1rem;
    background: #fff;
    border-bottom: 1px solid #e1e8f0;
}

.alerts-search-box {
    position: relative;
}

.alerts-search-box > i {
    position: absolute;
    z-index: 2;
    top: 50%;
    left: .85rem;
    color: #8492a3;
    transform: translateY(-50%);
}

.alerts-search-box .form-control {
    min-height: 40px;
    padding-left: 2.3rem;
    border-color: #dce4ed;
    border-radius: .72rem;
}

.alerts-filter-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .65rem;
    margin-top: .65rem;
}

.alerts-filter-grid .form-label {
    margin-bottom: .25rem;
    color: #6a7a8e;
    font-size: .66rem;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.alerts-filter-grid .form-select {
    min-height: 38px;
    border-color: #dce4ed;
    border-radius: .68rem;
    font-size: .78rem;
}

.alerts-result-line {
    display: flex;
    justify-content: space-between;
    gap: .75rem;
    margin-top: .65rem;
    color: #8290a2;
    font-size: .67rem;
}

.alerts-result-line span:first-child {
    color: #4e6179;
    font-weight: 700;
}

.alerts-list-v2 {
    display: grid;
    align-content: start;
    gap: .72rem;
    padding: .9rem 1rem 1.2rem;
    background: #f5f8fc;
}

.alert-card-v2 {
    position: relative;
    display: block;
    overflow: hidden;
    margin: 0;
    padding: 0;
    background: #fff;
    border: 1px solid #dfe6ee;
    border-radius: .92rem;
    box-shadow: 0 .3rem .9rem rgba(19, 49, 83, .055);
}

.alert-card-accent {
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: #7890aa;
}

.alert-card-v2.severity-critical
.alert-card-accent {
    background: #dc3545;
}

.alert-card-v2.severity-high
.alert-card-accent {
    background: #f08a12;
}

.alert-card-v2.severity-medium
.alert-card-accent {
    background: #e2b20b;
}

.alert-card-v2.severity-low
.alert-card-accent {
    background: #2f8bb7;
}

.alert-card-v2.status-resolved,
.alert-card-v2.status-ignored {
    opacity: .82;
}

.alert-card-v2-body {
    padding: .85rem .85rem .8rem 1rem;
}

.alert-card-topline {
    display: flex;
    justify-content: space-between;
    gap: .7rem;
    align-items: flex-start;
}

.alert-card-badges {
    display: flex;
    min-width: 0;
    flex-wrap: wrap;
    gap: .32rem;
}

.alert-chip {
    display: inline-flex;
    gap: .3rem;
    align-items: center;
    padding: .24rem .46rem;
    color: #53657b;
    background: #eef2f6;
    border: 1px solid #dfe5eb;
    border-radius: 999px;
    font-size: .64rem;
    font-weight: 750;
}

.alert-chip > i.fa-circle {
    font-size: .38rem;
}

.alert-chip.severity-critical {
    color: #a92131;
    background: #fdebed;
    border-color: #f3c8ce;
}

.alert-chip.severity-high {
    color: #965700;
    background: #fff0d9;
    border-color: #f2d2a4;
}

.alert-chip.severity-medium {
    color: #786000;
    background: #fff8d8;
    border-color: #ebdfa8;
}

.alert-chip.severity-low {
    color: #176181;
    background: #e8f5fa;
    border-color: #c8e5ef;
}

.alert-chip.status-open {
    color: #a92131;
    background: #fff;
    border-color: #efc2c8;
}

.alert-chip.status-read {
    color: #466078;
    background: #edf2f7;
}

.alert-chip.status-resolved {
    color: #12653d;
    background: #e8f7ef;
    border-color: #b7e3cb;
}

.alert-chip.status-ignored {
    color: #687587;
    background: #eceff3;
}

.alert-chip.context-document {
    color: #1c5ea8;
    background: #eaf2ff;
    border-color: #cbdcf4;
}

.alert-chip.context-deadline {
    color: #796000;
    background: #fff8dc;
    border-color: #eadfae;
}

.alert-chip.context-inspection {
    color: #6a4ba3;
    background: #f0ebfa;
    border-color: #d9cef0;
}

.alert-chip.context-manual {
    color: #6b4b29;
    background: #f7efe6;
    border-color: #e6d4c1;
}

.alert-card-menu {
    display: grid;
    width: 30px;
    height: 30px;
    flex: 0 0 auto;
    place-items: center;
    padding: 0;
    color: #6f7e91;
    background: transparent;
    border: 0;
    border-radius: .55rem;
}

.alert-card-menu:hover {
    color: #1b4d88;
    background: #edf3fa;
}

.alert-card-title {
    margin: .65rem 0 0;
    color: #182f4d;
    font-size: .91rem;
    font-weight: 800;
    line-height: 1.3;
}

.alert-card-description {
    margin: .35rem 0 0;
    color: #67778b;
    font-size: .78rem;
    line-height: 1.45;
}

.alert-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: .42rem .75rem;
    margin-top: .65rem;
    color: #6e7e91;
    font-size: .69rem;
}

.alert-card-meta > span {
    display: inline-flex;
    gap: .28rem;
    align-items: center;
}

.alert-card-meta i {
    color: #8293a6;
}

.alerts-deadline.tone-expired,
.alerts-deadline.tone-today {
    color: #b42635;
    font-weight: 700;
}

.alerts-deadline.tone-soon {
    color: #a35d00;
    font-weight: 700;
}

.alert-card-footer {
    display: flex;
    justify-content: space-between;
    gap: .75rem;
    align-items: center;
    margin-top: .75rem;
    padding-top: .65rem;
    border-top: 1px solid #edf1f5;
}

.alert-card-origin {
    min-width: 0;
    overflow: hidden;
    color: #8390a1;
    font-size: .65rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.alert-card-origin i {
    margin-right: .22rem;
}

.alert-card-primary-action {
    flex: 0 0 auto;
}

.alert-card-primary-action .btn {
    border-radius: .62rem;
    font-size: .72rem;
    font-weight: 700;
}

.alerts-empty-v2 {
    display: grid;
    min-height: 240px;
    place-items: center;
    align-content: center;
    padding: 2rem;
    color: #718196;
    text-align: center;
    background: #fff;
    border: 1px dashed #ccd7e3;
    border-radius: .9rem;
}

.alerts-empty-v2 > span {
    display: grid;
    width: 48px;
    height: 48px;
    place-items: center;
    color: #16864f;
    background: #e8f7ef;
    border-radius: 50%;
}

.alerts-empty-v2 strong {
    margin-top: .7rem;
    color: #304864;
}

.alerts-empty-v2 p {
    max-width: 300px;
    margin: .25rem 0 0;
    font-size: .78rem;
}

@media (max-width: 575.98px) {
    #alertsOffcanvas.alerts-center-v2 {
        width: 100vw;
    }

    .alerts-summary-grid {
        grid-template-columns: 1fr;
    }

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

    .alerts-result-line {
        display: grid;
    }

    .alert-card-footer {
        display: grid;
    }

    .alert-card-primary-action,
    .alert-card-primary-action .btn {
        width: 100%;
    }
}

[data-bs-theme="dark"] .alerts-center-header,
[data-bs-theme="dark"] .alerts-filter-section,
body.dark-mode .alerts-center-header,
body.dark-mode .alerts-filter-section {
    background: #172334;
    border-color: #2b3b50;
}

[data-bs-theme="dark"] .alerts-summary-section,
[data-bs-theme="dark"] .alerts-list-v2,
body.dark-mode .alerts-summary-section,
body.dark-mode .alerts-list-v2 {
    background: #101a28;
    border-color: #2b3b50;
}

[data-bs-theme="dark"] .alerts-summary-card-v2,
[data-bs-theme="dark"] .alert-card-v2,
body.dark-mode .alerts-summary-card-v2,
body.dark-mode .alert-card-v2 {
    background: #172334;
    border-color: #2b3b50;
}

[data-bs-theme="dark"] .alerts-center-header h5,
[data-bs-theme="dark"] .alerts-summary-content strong,
[data-bs-theme="dark"] .alert-card-title,
body.dark-mode .alerts-center-header h5,
body.dark-mode .alerts-summary-content strong,
body.dark-mode .alert-card-title {
    color: #e5edf7;
}

[data-bs-theme="dark"] .alerts-search-box .form-control,
[data-bs-theme="dark"] .alerts-filter-grid .form-select,
body.dark-mode .alerts-search-box .form-control,
body.dark-mode .alerts-filter-grid .form-select {
    color: #dce6f2;
    background: #111d2b;
    border-color: #2b3b50;
}

/* SIGFAD_ALERT_CARD_FOOTER_FIX_V1_START */

/*
 * Garante que cada card calcule a própria altura completa.
 * Evita que o rodapé e o botão contextual sejam recortados
 * ou invadam o card seguinte.
 */

#alertsOffcanvas .alerts-list-v2 {
    display: block !important;
}

#alertsOffcanvas .alert-card-v2 {
    display: block !important;
    width: 100%;
    height: auto !important;
    min-height: 0 !important;
    margin: 0 0 .72rem !important;
    overflow: hidden;
    contain: none !important;
}

#alertsOffcanvas .alert-card-v2:last-child {
    margin-bottom: 0 !important;
}

#alertsOffcanvas .alert-card-v2-body {
    display: flow-root;
    width: 100%;
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
    padding-bottom: .9rem;
}

#alertsOffcanvas .alert-card-footer {
    position: static !important;
    inset: auto !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto;
    width: 100%;
    min-height: 38px;
    float: none !important;
    clear: both;
    transform: none !important;
    overflow: visible !important;
}

#alertsOffcanvas .alert-card-origin {
    align-self: center;
}

#alertsOffcanvas .alert-card-primary-action {
    position: static !important;
    align-self: center;
    float: none !important;
    transform: none !important;
}

#alertsOffcanvas .alert-card-primary-action .btn {
    position: static !important;
    display: inline-flex;
    min-height: 34px;
    align-items: center;
    justify-content: center;
    transform: none !important;
}

@media (max-width: 575.98px) {
    #alertsOffcanvas .alert-card-footer {
        grid-template-columns: 1fr;
    }

    #alertsOffcanvas .alert-card-primary-action,
    #alertsOffcanvas .alert-card-primary-action .btn {
        width: 100%;
    }
}

/* SIGFAD_ALERT_CARD_FOOTER_FIX_V1_END */
