.filters-card,
.table-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
}

.filters-card {
    padding: 20px;
    margin-bottom: 20px;
}

.analise-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.analise-panel-title {
    font-size: 18px;
    font-weight: 800;
    color: var(--color-text);
}

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

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

.filter-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.field-label {
    font-size: 14px;
    font-weight: 700;
    color: #10224d;
}

.field-input.dash-input-container,
.field-native-input {
    width: 100%;
    height: 46px;
    border-radius: 14px !important;
    border: 1px solid #cfd9ea !important;
    background: #ffffff !important;
    box-shadow: none !important;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.field-input.dash-input-container:focus-within,
.field-native-input:focus {
    border-color: #153a8a !important;
    box-shadow: 0 0 0 3px rgba(21, 58, 138, 0.12) !important;
    outline: none;
}

.field-input.dash-input-container .dash-input-element {
    width: 100%;
    height: 100%;
    padding: 0 14px;
    border: none !important;
    outline: none !important;
    background: transparent !important;
    color: #1d2e55 !important;
    font-size: 14px;
}

.field-native-input {
    padding: 0 14px;
    color: #1d2e55 !important;
    font-size: 14px;
    font-family: "Segoe UI", Arial, sans-serif;
}

.action-row {
    margin-top: 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.action-row--left {
    justify-content: flex-start;
}

.field-checklist {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 18px;
}

.field-checklist label {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: #112250;
    cursor: pointer;
}

.field-checklist input[type="checkbox"] {
    width: 14px;
    height: 14px;
    margin: 0;
    accent-color: #2347c8;
    cursor: pointer;
}

.action-button {
    height: 46px;
    border: 0;
    border-radius: 14px;
    padding: 0 18px;
    background: linear-gradient(180deg, #2d55da 0%, #2346bf 100%);
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(35, 70, 191, 0.24);
}

.action-button-secondary {
    background: #ffffff;
    color: #2346bf;
    border: 1px solid #c7d8f8;
    box-shadow: 0 8px 18px rgba(35, 70, 191, 0.10);
}

.action-button:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    box-shadow: none;
}

.status-box {
    display: none;
    margin-bottom: 18px;
    padding: 14px 16px;
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.5;
    border: 1px solid transparent;
}

.status-box:empty {
    display: none;
}

.status-box.info {
    display: block;
    background: #f6f9ff;
    color: #52709c;
    border-color: #dfe9fb;
}

.status-box.success,
.status-box.error,
.status-box.warning {
    display: block;
}

.status-box.success {
    background: #edf9f2;
    color: #166534;
    border-color: #cbead5;
}

.status-box.error {
    background: #fff1f2;
    color: #b42318;
    border-color: #fecdd3;
}

.status-box.warning {
    display: block;
    background: #fff8e7;
    color: #8a5a00;
    border-color: #f2d28b;
}

.home-contingencia-refresh {
    flex: 0 0 auto;
}

.home-contingencia-updated {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 7px;
    min-height: 22px;
    margin: -8px 0 14px;
    color: var(--color-text-soft);
    font-size: 12px;
    font-weight: 600;
}

.home-contingencia-kpi {
    min-width: 0;
    min-height: 128px;
    padding: 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
}

.home-contingencia-kpi--primary {
    background: linear-gradient(145deg, #153a8a, #2346bf);
    border-color: transparent;
}

.home-contingencia-kpi--warning {
    background: linear-gradient(145deg, #fffaf0, #fff4d9);
    border-color: #f2d28b;
}

.home-contingencia-kpi-icon {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 13px;
    color: var(--color-primary);
    background: var(--color-primary-soft);
    font-size: 19px;
}

.home-contingencia-kpi--primary .home-contingencia-kpi-icon {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.15);
}

.home-contingencia-kpi--warning .home-contingencia-kpi-icon {
    color: #9a6200;
    background: rgba(242, 210, 139, 0.38);
}

.home-contingencia-kpi-label {
    margin-bottom: 5px;
    color: var(--color-text-soft);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.3;
}

.home-contingencia-kpi-value {
    overflow: hidden;
    color: var(--color-text);
    font-size: clamp(22px, 2vw, 30px);
    font-weight: 800;
    line-height: 1.1;
    text-overflow: ellipsis;
}

.home-contingencia-kpi--primary .home-contingencia-kpi-label,
.home-contingencia-kpi--primary .home-contingencia-kpi-value {
    color: #ffffff;
}

.home-contingencia-panel {
    min-width: 0;
    padding: 20px;
    overflow: hidden;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
}

.home-contingencia-panel-header {
    margin-bottom: 4px;
}

.home-contingencia-panel-header h2 {
    margin: 0;
    color: var(--color-text);
    font-size: 18px;
    font-weight: 800;
}

.home-contingencia-panel-header p {
    margin: 6px 0 0;
    color: var(--color-text-soft);
    font-size: 13px;
    line-height: 1.45;
}

.home-contingencia-map {
    cursor: pointer;
}

.home-contingencia-graph {
    /* Necessário para superar o height: 100% inline aplicado pelo dcc.Graph. */
    height: 360px !important;
}

.home-contingencia-map {
    height: 500px !important;
}

.home-contingencia-graph--reasons {
    height: 430px !important;
}

.home-contingencia-empty {
    min-height: 420px;
}

.home-contingencia-modal {
    position: fixed;
    inset: 0;
    z-index: var(--z-modal);
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.home-contingencia-modal-backdrop {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    background: rgba(12, 29, 74, 0.34);
    cursor: pointer;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.home-contingencia-modal-card {
    position: relative;
    z-index: 1;
    width: min(96vw, 1440px);
    max-height: calc(100vh - 48px);
    margin: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-modal);
}

.home-contingencia-modal-header {
    flex: 0 0 auto;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--color-border);
}

.home-contingencia-modal-header h2 {
    margin: 0;
    color: var(--color-text);
    font-size: 22px;
}

.home-contingencia-modal-header p {
    margin: 5px 0 0;
    color: var(--color-text-soft);
    font-size: 13px;
}

.home-contingencia-modal-close {
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    color: var(--color-text);
    background: #ffffff;
    cursor: pointer;
    transition: background-color var(--transition-fast), color var(--transition-fast);
}

.home-contingencia-modal-close:hover {
    color: #b42318;
    background: #fff1f2;
}

.home-contingencia-modal-content {
    flex: 1 1 auto;
    min-height: 260px;
    padding: 18px 6px 4px 0;
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #b8c7e6 transparent;
}

.home-contingencia-ranking {
    min-width: 0;
    padding: 16px;
    border: 1px solid var(--color-border);
    border-radius: 16px;
    background: #f8fbff;
}

.home-contingencia-ranking h3 {
    margin: 0 0 14px;
    color: var(--color-text);
    font-size: 15px;
}

.home-contingencia-ranking-item + .home-contingencia-ranking-item {
    margin-top: 12px;
}

.home-contingencia-ranking-line {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 5px;
    color: var(--color-text);
    font-size: 12px;
}

.home-contingencia-ranking-line span {
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.home-contingencia-ranking-line strong {
    flex: 0 0 auto;
    color: var(--color-primary-strong);
}

.home-contingencia-ranking-track {
    height: 5px;
    overflow: hidden;
    border-radius: 999px;
    background: #dfe9fb;
}

.home-contingencia-ranking-bar {
    height: 100%;
    min-width: 2px;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--color-primary), #1483d3);
}

.home-contingencia-refresh-spin {
    animation: home-contingencia-spin 0.8s linear infinite;
}

@keyframes home-contingencia-spin {
    to {
        transform: rotate(360deg);
    }
}

.meta-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

.meta-card {
    background: linear-gradient(180deg, #f8fbff 0%, #edf5ff 100%);
    border: 1px solid var(--color-border);
    border-radius: 16px;
    box-shadow: var(--shadow-card);
    padding: 16px;
    min-height: 96px;
}

.meta-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--color-text-soft);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.meta-value {
    font-size: 15px;
    line-height: 1.45;
    color: var(--color-text);
    font-weight: 700;
    word-break: break-word;
}

.table-card {
    padding: 16px;
}

.empty-state {
    min-height: 220px;
    border: 1px dashed #c7d8f8;
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(35, 70, 191, 0.04), rgba(35, 70, 191, 0.08));
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    text-align: center;
    padding: 24px;
    color: #5f7297;
}

.empty-state i {
    font-size: 32px;
    color: #2d55da;
}





.field-date-picker {
    width: 100%;
}

.field-date-picker .SingleDatePicker,
.field-date-picker .SingleDatePickerInput,
.field-date-picker .DateInput,
.field-date-picker .DateInput_input {
    width: 100%;
}

.field-date-picker .SingleDatePickerInput {
    border: 1px solid #cfd9ea;
    border-radius: 14px;
    background: #ffffff;
    height: 46px;
}

.field-date-picker .DateInput {
    border-radius: 14px;
    background: #ffffff;
}

.field-date-picker .DateInput_input {
    height: 44px;
    padding: 0 14px;
    border-radius: 14px;
    border: 0;
    color: #1d2e55;
    font-size: 14px;
    font-family: "Segoe UI", Arial, sans-serif;
}

.app-date-picker--readonly .DateInput_input {
    cursor: pointer;
    caret-color: transparent;
}

.field-date-picker .DateInput_input:focus {
    outline: none;
}

.field-date-picker .SingleDatePickerInput__withBorder:focus-within {
    border-color: #153a8a;
    box-shadow: 0 0 0 3px rgba(21, 58, 138, 0.12);
}

.filter-field--full-row {
    grid-column: 1 / -1;
}

.helper-text {
    font-size: 12px;
    line-height: 1.45;
    color: #5f7193;
}

.helper-text-strong {
    font-weight: 700;
    color: #10224d;
}

.app-scrollbar {
    scrollbar-width: thin;
    scrollbar-color: #b8c7e6 transparent;
}

.app-scrollbar::-webkit-scrollbar {
    width: 7px;
    height: 7px;
}

.app-scrollbar::-webkit-scrollbar-track {
    background: transparent;
}

.app-scrollbar::-webkit-scrollbar-thumb {
    background: #b8c7e6;
    border-radius: 999px;
}

.app-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #8fa6d5;
}

.confirmation-modal-overlay {
    position: fixed;
    inset: 0;
    align-items: center;
    justify-content: center;
    z-index: var(--z-modal);
    padding: 24px;
    background-color: rgba(12, 29, 74, 0.18);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.confirmation-modal-card {
    width: min(94vw, 680px);
    max-height: 88vh;
    margin: 0 auto;
    overflow-y: auto;
    box-shadow: var(--shadow-modal);
}

.confirmation-modal-card--wide {
    width: min(96vw, 1180px);
    max-height: 92vh;
}

.confirmation-modal-card--analysis,
.confirmation-modal-card--audit {
    max-height: calc(100vh - 48px);
    padding: 22px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background-color: #ffffff;
    border-radius: 18px;
    box-shadow: 0 22px 60px rgba(16, 34, 77, 0.24);
}

.confirmation-modal-card--analysis {
    width: min(94vw, 720px);
}

.confirmation-modal-card--audit {
    width: min(96vw, 980px);
}

.confirmation-modal-header {
    flex: 0 0 auto;
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.confirmation-modal-icon {
    flex: 0 0 auto;
}

.confirmation-modal-body {
    margin-top: 8px;
}

.confirmation-modal-subtitle {
    margin-bottom: 14px;
}

.confirmation-modal-title-icon {
    margin-right: 8px;
}

.confirmation-modal-actions {
    justify-content: flex-end;
    flex-shrink: 0;
    margin-top: 18px;
}

.confirmation-modal-summary {
    flex: 1 1 auto;
    min-height: 0;
    margin-top: 16px;
    padding-right: 8px;
    overflow-y: auto;
    overflow-x: hidden;
}

.confirmation-modal-helper {
    margin-top: 6px;
}

.confirmation-modal-warning {
    flex-shrink: 0;
    margin-top: 14px;
}

.correction-modal-note {
    margin-top: 16px;
}

.correction-summary-section {
    margin-bottom: 10px;
}

.correction-summary-lead {
    margin-top: 6px;
}

.correction-summary-detail {
    margin-top: 4px;
}

.correction-summary-detail--small,
.correction-summary-note {
    font-size: 0.88rem;
}

.correction-summary-emphasis {
    margin-top: 6px;
    font-weight: 600;
}

.correction-summary-list {
    margin-top: 8px;
    margin-bottom: 0;
}

.correction-summary-list--spaced {
    margin-bottom: 12px;
}

.correction-summary-table-title {
    margin-top: 10px;
    margin-bottom: 8px;
    font-weight: 600;
}

.correction-summary-table-wrap {
    margin-top: 10px;
    overflow-x: auto;
}

.correction-summary-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.correction-summary-table--comfortable {
    font-size: 0.92rem;
}

.correction-summary-deadline {
    margin-top: 10px;
    font-size: 0.9rem;
    font-weight: 600;
}

.correction-summary-note {
    margin-top: 8px;
}

.correction-summary-caption {
    margin-top: 8px;
}

.correction-result {
    margin-top: 12px;
}

.app-loading-overlay {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    z-index: var(--z-loading);
    pointer-events: all;
    background-color: rgba(12, 29, 74, 0.10);
    backdrop-filter: blur(6px) saturate(115%);
    -webkit-backdrop-filter: blur(6px) saturate(115%);
}

.app-loading-card {
    width: min(92vw, 330px);
    margin: 0 auto;
}

.app-loading-content {
    position: relative;
}

.app-loading-overlay {
    min-height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.app-loading-card {
    min-width: 280px;
    max-width: 360px;
    padding: 22px 24px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(191, 208, 242, 0.95);
    box-shadow: 0 22px 50px rgba(17, 39, 96, 0.16);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 10px;
}

.app-loading-spinner {
    width: 72px;
    height: 72px;
    border-radius: 22px;
    background: linear-gradient(180deg, rgba(35, 70, 191, 0.08), rgba(35, 70, 191, 0.14));
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.app-loading-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: var(--color-primary, #2346bf);
    animation: app-loading-bounce 0.9s infinite ease-in-out;
}

.app-loading-dot:nth-child(2) {
    animation-delay: 0.15s;
}

.app-loading-dot:nth-child(3) {
    animation-delay: 0.3s;
}

.app-loading-title {
    font-size: 18px;
    font-weight: 800;
    color: var(--color-text, #10224d);
}

.app-loading-subtitle {
    font-size: 13px;
    line-height: 1.5;
    color: var(--color-text-soft, #5f7193);
}

@keyframes app-loading-bounce {
    0%,
    80%,
    100% {
        transform: translateY(0);
        opacity: 0.45;
    }
    40% {
        transform: translateY(-7px);
        opacity: 1;
    }
}


/* =========================================================
   CENTRAL DE ALERTAS OPERACIONAIS
   ========================================================= */

.home-alerts-button {
    position: relative;
}

.home-alerts-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    z-index: 2;

    min-width: 18px;
    height: 18px;
    padding: 0 5px;

    display: none;
    align-items: center;
    justify-content: center;

    border: 2px solid var(--color-surface);
    border-radius: 999px;

    background: var(--color-error);
    color: #ffffff;

    font-size: 10px;
    font-weight: 800;
    line-height: 1;

    pointer-events: none;
}

.home-alerts-badge--visible {
    display: inline-flex;
}

.home-alerts-header {
    flex: 0 0 auto;

    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--spacing-md);

    padding: 18px 18px 14px;
    border-bottom: 1px solid var(--color-border);
}

.home-alerts-header h2 {
    margin: 0;
    color: var(--color-text);
    font-size: 17px;
    font-weight: 800;
}

.home-alerts-header p {
    margin: 5px 0 0;
    color: var(--color-text-soft);
    font-size: 12px;
    line-height: 1.45;
}

.home-alerts-close {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);

    background: var(--color-surface);
    color: var(--color-text-soft);

    cursor: pointer;
    transition:
        color var(--transition-fast),
        background-color var(--transition-fast),
        border-color var(--transition-fast);
}

.home-alerts-close:hover {
    border-color: #fecdd3;
    background: #fff1f2;
    color: var(--color-error);
}

.home-alerts-list {
    flex: 1 1 auto;
    min-height: 0;

    padding: 14px;

    overflow-y: auto;
    overflow-x: hidden;
}

.home-alerts-item {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 12px;

    padding: 14px;

    border: 1px solid var(--color-border);
    border-left-width: 4px;
    border-radius: var(--radius-md);

    background: var(--color-surface);
}

.home-alerts-item + .home-alerts-item {
    margin-top: 10px;
}

.home-alerts-item--warning {
    border-left-color: #d99000;
    background: #fffaf0;
}

.home-alerts-item--critical {
    border-left-color: var(--color-error);
    background: #fff5f5;
}

.home-alerts-item-icon {
    width: 38px;
    height: 38px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    border-radius: 12px;

    background: var(--color-primary-soft);
    color: var(--color-primary);

    font-size: 17px;
}

.home-alerts-item--warning .home-alerts-item-icon {
    background: #fff0c7;
    color: var(--color-warning);
}

.home-alerts-item--critical .home-alerts-item-icon {
    background: #fee2e2;
    color: var(--color-error);
}

.home-alerts-item-content {
    min-width: 0;
}

.home-alerts-item-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.home-alerts-item-heading strong {
    color: var(--color-text);
    font-size: 13px;
    line-height: 1.35;
}

.home-alerts-severity {
    flex: 0 0 auto;

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

    background: #fff0c7;
    color: var(--color-warning);

    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.04em;
    line-height: 1.2;
    text-transform: uppercase;
}

.home-alerts-item--critical .home-alerts-severity {
    background: #fee2e2;
    color: var(--color-error);
}

.home-alerts-item-content p {
    margin: 7px 0 0;
    color: var(--color-text-soft);
    font-size: 12px;
    line-height: 1.5;
}

.home-alerts-item-detail {
    display: block;
    margin-top: 7px;

    color: var(--color-error);
    font-size: 11px;
    line-height: 1.45;
}

.home-alerts-action {
    min-height: 34px;
    margin-top: 10px;
    padding: 0 11px;

    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;

    border: 1px solid #c7d8f8;
    border-radius: 10px;

    background: var(--color-surface);
    color: var(--color-primary);

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

    cursor: pointer;
    transition:
        border-color var(--transition-fast),
        background-color var(--transition-fast),
        transform var(--transition-fast);
}

.home-alerts-action:hover {
    border-color: var(--color-primary);
    background: var(--color-primary-soft);
    transform: translateY(-1px);
}

.home-alerts-empty {
    min-height: 190px;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    padding: 24px;
    text-align: center;
}

.home-alerts-empty-icon {
    width: 48px;
    height: 48px;
    margin-bottom: 12px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    border-radius: 15px;

    background: #edf9f2;
    color: var(--color-success);

    font-size: 22px;
}

.home-alerts-empty strong {
    color: var(--color-text);
    font-size: 14px;
}

.home-alerts-empty p {
    max-width: 290px;
    margin: 7px 0 0;

    color: var(--color-text-soft);
    font-size: 12px;
    line-height: 1.5;
}

.home-alerts-generated-at {
    flex: 0 0 auto;

    min-height: 38px;
    padding: 11px 16px;

    border-top: 1px solid var(--color-border);

    color: var(--color-text-soft);
    font-size: 11px;
    font-weight: 600;
    text-align: right;
}
