/* =========================
   LOGIN
========================= */

.login-page {
    min-height: 100vh;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 16px;
    background:
        linear-gradient(
            180deg,
            #f1f4f7 0%,
            #d4dfec 28%,
            #a4b7da 55%,
            #5f7ec0 78%,
            #24439d 100%
        );
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: #ffffff;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 22px 50px rgba(17, 34, 78, 0.18);
}

.login-banner {
    position: relative;
    height: 188px;
    overflow: hidden;
    background:
        radial-gradient(circle at 78% 70%, rgba(49, 92, 255, 0.65), transparent 32%),
        linear-gradient(135deg, #0a1737 0%, #12285f 48%, #2946c4 100%);
}

.banner-card {
    position: absolute;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.10);
    border: 1px solid rgba(255, 255, 255, 0.10);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.banner-card-left {
    top: 16px;
    left: 20px;
    width: 102px;
    height: 58px;
    padding: 10px 12px;
}

.banner-card-right {
    top: 16px;
    right: 18px;
    width: 98px;
    height: 62px;
    padding: 12px;
}

.mini-line {
    height: 6px;
    margin-bottom: 7px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.55);
}

.mini-line.light {
    background: rgba(255, 255, 255, 0.85);
}

.w40 { width: 40%; }
.w32 { width: 32%; }
.w28 { width: 28%; }
.w18 { width: 18%; }

.mini-pill {
    width: 60px;
    height: 18px;
    margin-top: 10px;
    border-radius: 999px;
    background: linear-gradient(90deg, #4d7cff 0%, #48d19f 100%);
}

.banner-ring,
.banner-ring.small {
    position: absolute;
    border-radius: 50%;
}

.banner-ring {
    top: 24px;
    left: 50%;
    width: 52px;
    height: 52px;
    transform: translateX(-50%);
    background:
        conic-gradient(#f7a71c 0 22%, #4a7cff 22% 68%, #27d36d 68% 100%);
}

.banner-ring::after {
    content: "";
    position: absolute;
    inset: 10px;
    background: #13275d;
    border-radius: 50%;
}

.banner-ring.small {
    right: 66px;
    top: 106px;
    width: 60px;
    height: 60px;
    background:
        conic-gradient(#1dd66f 0 28%, #5f88ff 28% 68%, #13275d 68% 100%);
}

.banner-ring.small::after {
    content: "";
    position: absolute;
    inset: 12px;
    background: #0e1d4a;
    border-radius: 50%;
}

.banner-badge {
    position: absolute;
    right: 32px;
    top: 128px;
    width: 58px;
    height: 36px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.10);
    border: 1px solid rgba(255, 255, 255, 0.10);
}

.banner-badge::before,
.banner-badge::after {
    content: "";
    position: absolute;
    left: 12px;
    height: 5px;
    border-radius: 999px;
    background: linear-gradient(90deg, #4c7dff 0%, #45d5a0 100%);
}

.banner-badge::before {
    top: 11px;
    width: 30px;
}

.banner-badge::after {
    top: 20px;
    width: 22px;
}

.banner-line {
    position: absolute;
    height: 3px;
    border-radius: 999px;
    opacity: 0.85;
}

.line-1 {
    top: 78px;
    left: 38px;
    width: 70px;
    transform: rotate(-18deg);
    background: linear-gradient(90deg, rgba(255,255,255,0.18), rgba(255,255,255,0.95));
}

.line-2 {
    top: 82px;
    left: 104px;
    width: 68px;
    transform: rotate(14deg);
    background: linear-gradient(90deg, rgba(255,255,255,0.45), #f5a623);
}

.banner-bars {
    position: absolute;
    left: 26px;
    right: 26px;
    bottom: 0;
    height: 96px;
    display: flex;
    align-items: flex-end;
    gap: 10px;
}

.bar {
    width: 30px;
    border-radius: 9px 9px 0 0;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.10);
}

.bar.orange { height: 44px; background: linear-gradient(180deg, #f7b01f 0%, #ee9800 100%); }
.bar.blue { height: 78px; background: linear-gradient(180deg, #76b3ff 0%, #2353d8 100%); }
.bar.green { height: 56px; background: linear-gradient(180deg, #4edb8f 0%, #29bf6d 100%); }
.bar.lightblue { height: 98px; background: linear-gradient(180deg, #88bfff 0%, #5b8ee8 100%); }
.bar.pink { height: 70px; background: linear-gradient(180deg, #f8a7b8 0%, #ef738f 100%); }

.login-content {
    padding: 22px 32px 26px 32px;
}

.login-title {
    margin: 0 0 8px 0;
    font-size: 30px;
    line-height: 1;
    font-weight: 700;
    color: #081b44;
}

.login-subtitle {
    margin: 0 0 20px 0;
    font-size: 14px;
    line-height: 1.45;
    color: #66789d;
}

.form-group {
    margin-bottom: 14px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #081b44;
}

:root {
    --Dash-Fill-Interactive-Strong: #153a8a !important;

    --Dash-Fill-Interactive-Weak: #a8c4ff !important;
}
.form-input.dash-input-container {
    width: 100%;
    height: 42px;
    border-radius: 999px !important;
    border: 1px solid #c9d4e5 !important;
    background: #ffffff !important;
    box-shadow: none !important;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

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

.form-input.dash-input-container .dash-input-element {
    width: 100%;
    height: 100%;
    padding: 0 16px;
    border: none !important;
    outline: none !important;
    background: transparent !important;
    color: #1d2e55 !important;
    caret-color: #153a8a !important;
    font-size: 14px;
    box-shadow: none !important;
}

.form-input.dash-input-container .dash-input-element::placeholder {
    color: #9aabc5 !important;
}

.password-wrapper {
    position: relative;
}

.password-input {
    padding-right: 16px;
}

.remember-row {
    margin: 6px 0 18px 0;
}

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

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

.login-alert {
    display: none;
    margin-bottom: 14px;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.4;
}

.login-alert.show {
    display: block;
}

.login-alert.success {
    background: #edf9f2;
    color: #166534;
    border: 1px solid #cbead5;
}

.login-alert.error {
    background: #fff1f2;
    color: #b42318;
    border: 1px solid #fecdd3;
}

.login-button {
    width: 100%;
    height: 42px;
    border: 0;
    border-radius: 10px;
    background: linear-gradient(180deg, #2d55da 0%, #2346bf 100%);
    color: #ffffff;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(35, 70, 191, 0.24);
    transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.login-button {
    width: 100%;
    height: 42px;

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

    border: 0;
    border-radius: 10px;

    background: linear-gradient(
        180deg,
        #2d55da 0%,
        #2346bf 100%
    );

    color: #ffffff;
    font-size: 16px;
    font-weight: 700;

    cursor: pointer;

    box-shadow:
        0 10px 20px rgba(35, 70, 191, 0.24);

    transition:
        transform 0.18s ease,
        box-shadow 0.18s ease,
        filter 0.18s ease,
        opacity 0.18s ease;
}

.login-button:hover:not(:disabled) {
    filter: brightness(1.03);
    transform: translateY(-1px);
}

.login-button:active:not(:disabled) {
    transform: translateY(0);
}

.login-button:disabled {
    cursor: wait;
    pointer-events: none;

    opacity: 0.88;
    filter: none;
    transform: none;

    box-shadow:
        0 6px 14px rgba(35, 70, 191, 0.18);
}

.login-button-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    line-height: 1;
}

.login-button-spinner {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;

    border: 2px solid rgba(255, 255, 255, 0.38);
    border-top-color: #ffffff;
    border-radius: 50%;

    animation: login-button-spin 700ms linear infinite;
}

@keyframes login-button-spin {
    to {
        transform: rotate(360deg);
    }
}

@media (prefers-reduced-motion: reduce) {
    .login-button {
        transition: none;
    }

    .login-button-spinner {
        animation-duration: 1400ms;
    }
}

.mcp-source-chip {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 6px 10px;
    border: 1px solid #d9e4f6;
    border-radius: 999px;
    background: #f6f9ff;
    color: #526b94;
    font-size: 12px;
    font-weight: 700;
}

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

.mcp-overview-card {
    min-height: 96px;
    padding: 16px;
    border: 1px solid #dce6f5;
    border-radius: 16px;
    background: linear-gradient(180deg, #f8fbff 0%, #eef5ff 100%);
    box-shadow: 0 10px 24px rgba(22, 52, 112, 0.07);
}

.mcp-overview-card--success {
    border-color: #cde9d7;
    background: linear-gradient(180deg, #f5fcf7 0%, #eaf8ef 100%);
}

.mcp-overview-card--warning {
    border-color: #f1dbab;
    background: linear-gradient(180deg, #fffaf0 0%, #fff4db 100%);
}

.mcp-overview-card--error {
    border-color: #f1cdd2;
    background: linear-gradient(180deg, #fff8f8 0%, #ffeded 100%);
}

.mcp-overview-card--wide {
    grid-column: 1 / -1;
    min-height: auto;
}

.mcp-overview-label {
    margin-bottom: 8px;
    color: #63799f;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.45px;
    text-transform: uppercase;
}

.mcp-overview-value {
    color: #10224d;
    font-size: 28px;
    font-weight: 900;
    line-height: 1;
}

.mcp-overview-scope {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
    color: #36507b;
    font-size: 13px;
    font-weight: 700;
}

.mcp-log-list {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.mcp-log-card {
    overflow: hidden;
    border: 1px solid #dbe5f3;
    border-left: 5px solid #2d55da;
    border-radius: 18px;
    background: #ffffff;
    box-shadow: 0 14px 32px rgba(16, 34, 77, 0.09);
}

.mcp-log-card--success {
    border-left-color: #2f9b5d;
}

.mcp-log-card--warning {
    border-left-color: #d89925;
}

.mcp-log-card--error {
    border-left-color: #cc3f4d;
}

.mcp-log-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding: 18px 20px;
    border-bottom: 1px solid #e8eef7;
    background: linear-gradient(180deg, #fbfdff 0%, #f4f8ff 100%);
}

.mcp-log-card-title {
    color: #10224d;
    font-size: 17px;
    font-weight: 900;
    line-height: 1.35;
}

.mcp-log-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
    margin-top: 7px;
    color: #657a9e;
    font-size: 12px;
    font-weight: 650;
}

.mcp-status-badge {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 7px;
    min-height: 32px;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

.mcp-status-badge--success {
    background: #eaf8ef;
    color: #187342;
}

.mcp-status-badge--warning {
    background: #fff4d8;
    color: #966000;
}

.mcp-status-badge--error {
    background: #ffebed;
    color: #ad2835;
}

.mcp-error-box,
.mcp-invalid-payload {
    margin: 16px 20px 0;
    padding: 14px 16px;
    border: 1px solid #f0c7cc;
    border-radius: 14px;
    background: #fff4f5;
    color: #9d2631;
}

.mcp-error-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    font-size: 14px;
}

.mcp-error-text {
    max-height: 260px;
    margin: 0;
    padding: 12px;
    overflow: auto;
    border-radius: 10px;
    background: #2a1620;
    color: #ffe9ed;
    font-family: Consolas, "Courier New", monospace;
    font-size: 12px;
    line-height: 1.55;
    white-space: pre-wrap;
    word-break: break-word;
}

.mcp-invalid-payload-title {
    font-size: 14px;
    font-weight: 800;
}

.mcp-invalid-payload-error {
    margin-top: 6px;
    color: #b13c48;
    font-size: 12px;
}

.mcp-payload-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(120px, 160px)) minmax(0, 1fr);
    gap: 12px;
    padding: 16px 20px 0;
}

.mcp-mini-card {
    padding: 12px 14px;
    border: 1px solid #e0e8f5;
    border-radius: 13px;
    background: #f8fbff;
}

.mcp-mini-value {
    color: #183b93;
    font-size: 21px;
    font-weight: 900;
    line-height: 1;
}

.mcp-mini-label {
    margin-top: 5px;
    color: #6b7e9f;
    font-size: 11px;
    font-weight: 750;
    text-transform: uppercase;
}

.mcp-collection-badges {
    display: flex;
    align-content: flex-start;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 8px;
    padding: 4px 0;
}

.mcp-collection-badge {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 5px 10px;
    border: 1px solid #d9e4f7;
    border-radius: 999px;
    background: #eef4ff;
    color: #36558d;
    font-size: 12px;
    font-weight: 750;
}

.mcp-payload-content {
    padding: 16px 20px 20px;
}

.mcp-json-details {
    overflow: hidden;
    margin-top: 10px;
    border: 1px solid #dfe7f3;
    border-radius: 13px;
    background: #ffffff;
}

.mcp-json-details:first-child {
    margin-top: 0;
}

.mcp-json-summary {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 46px;
    padding: 10px 14px;
    cursor: pointer;
    list-style: none;
    background: #f7faff;
    color: #17356f;
    font-size: 13px;
    font-weight: 800;
    user-select: none;
}

.mcp-json-summary::-webkit-details-marker,
.mcp-list-item-summary::-webkit-details-marker {
    display: none;
}

.mcp-json-summary::before,
.mcp-list-item-summary::before {
    content: "›";
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    color: #456aa8;
    font-size: 20px;
    font-weight: 900;
    transition: transform 0.16s ease;
}

details[open] > .mcp-json-summary::before,
details[open] > .mcp-list-item-summary::before {
    transform: rotate(90deg);
}

.mcp-json-summary-title {
    flex: 1;
}

.mcp-json-summary-count {
    color: #6b7f9f;
    font-size: 11px;
    font-weight: 750;
}

.mcp-json-details-body {
    padding: 14px;
    border-top: 1px solid #e7edf6;
}

.mcp-scalars-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.mcp-scalar-field {
    min-width: 0;
    padding: 10px 11px;
    border: 1px solid #e6ecf5;
    border-radius: 11px;
    background: #fbfdff;
}

.mcp-scalar-label {
    overflow: hidden;
    color: #7385a3;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.35px;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}

.mcp-scalar-value {
    margin-top: 5px;
    overflow: hidden;
    color: #1e315c;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.4;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mcp-nested-sections {
    margin-top: 12px;
}

.mcp-list-items {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mcp-list-item {
    overflow: hidden;
    border: 1px solid #e0e8f4;
    border-radius: 11px;
    background: #ffffff;
}

.mcp-list-item-summary {
    display: flex;
    align-items: center;
    gap: 7px;
    min-height: 42px;
    padding: 9px 12px;
    cursor: pointer;
    list-style: none;
    background: #fbfdff;
    color: #2c477a;
    font-size: 12px;
    font-weight: 750;
}

.mcp-list-item-body {
    padding: 10px 12px 12px;
    border-top: 1px solid #edf1f7;
}

.mcp-list-simple-item {
    padding: 9px 11px;
    border: 1px solid #e4eaf4;
    border-radius: 10px;
    background: #fafcff;
    color: #334f7d;
    font-size: 12px;
}

.mcp-code-block {
    max-height: 360px;
    margin: 0;
    padding: 14px;
    overflow: auto;
    border-radius: 11px;
    background: #10203e;
    color: #e8efff;
    font-family: Consolas, "Courier New", monospace;
    font-size: 11px;
    line-height: 1.55;
    white-space: pre-wrap;
    word-break: break-word;
}

.mcp-truncated-note {
    margin: 0 0 10px;
    color: #8a640e;
    font-size: 11px;
    font-weight: 700;
}

.sped-upload-wrap {
    margin-bottom: 12px;
}

.sped-validation-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 12px;
}

.sped-validation-badge {
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.sped-validation-badge--high {
    background-color: #fff1f2;
    color: #9f1239;
}

.sped-validation-badge--medium {
    background-color: #fff7ed;
    color: #9a3412;
}

.sped-validation-badge--comparison {
    background-color: #eff6ff;
    color: #1d4ed8;
}

.sped-validation-badge--cancelled {
    background-color: #fef2f2;
    color: #b91c1c;
}

.sped-upload {
    width: 100%;
}

.sped-upload > div {
    width: 100%;
}

.sped-upload-inner {
    min-height: 170px;
    border: 2px dashed #bfd0f2;
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(35, 70, 191, 0.03), rgba(35, 70, 191, 0.06));
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-align: center;
    padding: 24px;
    cursor: pointer;
    transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.sped-upload-inner:hover {
    border-color: #8eabdf;
    background: linear-gradient(180deg, rgba(35, 70, 191, 0.05), rgba(35, 70, 191, 0.08));
}

.sped-upload-icon {
    width: 58px;
    height: 58px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, #eef4ff 0%, #dde9ff 100%);
    color: var(--color-primary);
    font-size: 24px;
    box-shadow: 0 10px 22px rgba(35, 70, 191, 0.10);
    margin-bottom: 4px;
}

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

.sped-upload-subtitle {
    font-size: 14px;
    color: var(--color-text-soft);
}

.sped-meta-grid {
    margin-bottom: 20px;
}

.sped-meta-card {
    min-height: 108px;
}

.sped-meta-value {
    font-size: 20px;
    line-height: 1.35;
}

.sped-tabs-card {
    padding-top: 12px;
}

.sped-tabs-parent {
    margin-bottom: 16px;
}

.sped-tabs {
    border-bottom: 1px solid var(--color-border);
}

.sped-tab {
    background: #f8fbff !important;
    border: 1px solid var(--color-border) !important;
    border-bottom: 0 !important;
    border-radius: 16px 16px 0 0 !important;
    color: var(--color-text-soft) !important;
    font-weight: 700 !important;
    padding: 14px 18px !important;
    margin-right: 8px !important;
}

.sped-tab--selected {
    background: #ffffff !important;
    color: var(--color-primary-strong) !important;
    box-shadow: 0 -1px 0 #ffffff inset;
}

.sped-tab-content {
    min-height: 320px;
}

.sped-tab-content .table-card {
    padding: 0;
    border: 0;
    box-shadow: none;
    background: transparent;
}

.sped-tab-content .dash-table-container {
    background: #fff;
    border-radius: 18px;
    overflow: hidden;
}

.sped-meta-card-wide {
    grid-column: 1 / -1;
}

.sped-processing-shell {
    position: relative;
}

#sped-upload-feedback {
    margin-bottom: 4px;
}

.home-contingencia-ranking {
    display: flex;
    flex-direction: column;

    min-width: 0;
    min-height: 0;
}

.home-contingencia-ranking > h3 {
    flex: 0 0 auto;
    margin-bottom: 12px;
}

.home-contingencia-ranking-list {
    min-height: 0;
    max-height: 260px;

    padding-right: 8px;

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

    overscroll-behavior: contain;
    scrollbar-gutter: stable;
}

/* =========================================================
   HOME — MODAL DE DETALHAMENTO DA CONTINGÊNCIA
   ========================================================= */

.home-contingencia-modal {
    position: fixed;
    inset: 0;
    z-index: var(--z-modal);

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

    padding: 12px;

    overflow: hidden;
}

.home-contingencia-modal-backdrop {
    position: absolute;
    inset: 0;
    z-index: 0;

    width: 100%;
    height: 100%;

    padding: 0;
    border: 0;

    background: rgba(10, 27, 67, 0.28);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);

    cursor: default;
}

.home-contingencia-modal-card {
    position: relative;
    z-index: 1;

    width: min(98vw, 1320px);

    /*
     * Limita o modal à janela do navegador.
     * O fallback com vh vem antes do dvh.
     */
    height: min(94vh, 920px);
    height: min(94dvh, 920px);

    max-height: calc(100vh - 24px);
    max-height: calc(100dvh - 24px);

    display: flex;
    flex-direction: column;

    min-height: 0;
    padding: 16px 18px;

    overflow: hidden;

    border-radius: 18px;
    background: #ffffff;
    box-shadow: 0 24px 70px rgba(9, 29, 74, 0.28);
}

.home-contingencia-modal-header {
    flex: 0 0 auto;

    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;

    padding-bottom: 12px;

    border-bottom: 1px solid #d9e4f5;
    background: #ffffff;
}

.home-contingencia-modal-body {
    flex: 1 1 auto;

    /*
     * Essencial em estruturas flex:
     * permite que esta área diminua e crie a rolagem.
     */
    min-width: 0;
    min-height: 0;

    margin-top: 14px;
    padding-right: 8px;
    padding-bottom: 14px;

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

    overscroll-behavior: contain;
    scrollbar-gutter: stable;
}

.home-contingencia-modal-loading {
    min-width: 0;
    min-height: 100%;
}

.home-contingencia-modal-content {
    min-width: 0;
}

.home-contingencia-modal-card > .confirmation-modal-actions {
    flex: 0 0 auto;

    margin-top: 0;
    padding-top: 12px;

    border-top: 1px solid #d9e4f5;
    background: #ffffff;
}


/* =========================================================
   HOME — CENTRAL DE ALERTAS OPERACIONAIS
   ========================================================= */

.home-alerts-root {
    position: relative;

    display: inline-flex;
    align-items: center;
}

.home-alerts-backdrop {
    position: fixed;
    inset: 0;
    z-index: calc(var(--z-modal) - 102);

    padding: 0;
    border: 0;

    background: rgba(13, 26, 58, 0.10);

    opacity: 0;
    visibility: hidden;
    pointer-events: none;

    cursor: default;
    transition:
        opacity var(--transition-fast),
        visibility var(--transition-fast);
}

.home-alerts-backdrop--open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.home-alerts-panel {
    position: fixed;
    top: 68px;
    right: 18px;
    z-index: calc(var(--z-modal) - 101);

    width: min(410px, calc(100vw - 36px));
    max-height: min(620px, calc(100vh - 86px));
    max-height: min(620px, calc(100dvh - 86px));

    display: flex;
    flex-direction: column;

    overflow: hidden;

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

    background: var(--color-surface);
    box-shadow: var(--shadow-modal);

    opacity: 0;
    visibility: hidden;
    pointer-events: none;

    transform: translateY(-8px) scale(0.985);
    transform-origin: top right;

    transition:
        opacity var(--transition-fast),
        visibility var(--transition-fast),
        transform var(--transition-fast);
}

.home-alerts-panel--open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

#home-contingencia-map-section,
#home-contingencia-reasons-section {
    scroll-margin-top: 86px;
}

.home-dashboard-tabs-parent {
    min-width: 0;
    margin-bottom: 18px;
}

.home-dashboard-tabs {
    display: flex !important;
    align-items: flex-end;
    gap: 8px;

    min-width: 0;

    border-bottom: 1px solid var(--color-border) !important;
}

.home-dashboard-tab {
    flex: 0 0 auto !important;

    min-width: 150px;
    padding: 13px 18px !important;

    border: 1px solid var(--color-border) !important;
    border-bottom: 0 !important;
    border-radius: 14px 14px 0 0 !important;

    color: var(--color-text-soft) !important;
    background: #f3f7fd !important;

    font-size: 14px !important;
    font-weight: 750 !important;

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

.home-dashboard-tab:hover {
    color: var(--color-primary-strong) !important;
    background: #edf4ff !important;
}

.home-dashboard-tab--selected {
    color: var(--color-primary-strong) !important;
    background: #ffffff !important;
    border-color: #bfd0f2 !important;

    box-shadow:
        0 -3px 0 var(--color-primary) inset,
        0 8px 18px rgba(17, 34, 78, 0.05);
}

.home-dashboard-panels,
.home-dashboard-panel {
    min-width: 0;
}

.home-dashboard-panel {
    display: none;
}

.home-dashboard-panel--active {
    display: block;
}

.home-dashboard-toolbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;

    margin-bottom: 14px;
    padding: 18px 20px;

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

    background:
        linear-gradient(
            135deg,
            rgba(35, 70, 191, 0.05),
            rgba(20, 131, 211, 0.02)
        ),
        var(--color-surface);

    box-shadow: var(--shadow-card);
}

.home-dashboard-toolbar-text {
    min-width: 0;
}

.home-dashboard-toolbar-text h2 {
    margin: 0;

    color: var(--color-text);
    font-size: 20px;
    font-weight: 800;
}

.home-dashboard-toolbar-text p {
    margin: 6px 0 0;

    color: var(--color-text-soft);
    font-size: 13px;
    line-height: 1.45;
}

.home-dashboard-placeholder {
    display: flex;
    align-items: center;
    gap: 18px;

    min-height: 260px;
    padding: 28px;

    border: 1px dashed #a9bfe8;
    border-radius: var(--radius-lg);

    background:
        linear-gradient(
            145deg,
            rgba(35, 70, 191, 0.035),
            rgba(20, 131, 211, 0.055)
        ),
        #ffffff;
}

.home-dashboard-placeholder-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 58px;

    width: 58px;
    height: 58px;

    border-radius: 18px;

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

    font-size: 24px;
}

.home-dashboard-placeholder-content {
    min-width: 0;
}

.home-dashboard-placeholder-content h2 {
    margin: 0;

    color: var(--color-text);
    font-size: 20px;
    font-weight: 800;
}

.home-dashboard-placeholder-content p {
    max-width: 760px;
    margin: 8px 0 0;

    color: var(--color-text-soft);
    font-size: 14px;
    line-height: 1.6;
}

.home-contingencia-tertiary-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;

    margin-top: 20px;
}

.home-versoes-kpi-content {
    min-width: 0;
}

.home-versoes-kpi-value {
    font-size: clamp(20px, 1.65vw, 27px);
    overflow-wrap: anywhere;
}

.home-versoes-kpi-helper {
    display: block;
    margin-top: 6px;
    color: var(--color-text-soft);
    font-size: 11px;
    font-weight: 700;
    line-height: 1.35;
}

.home-contingencia-kpi--primary .home-versoes-kpi-helper {
    color: rgba(255, 255, 255, 0.78);
}

.home-versoes-kpi--success {
    background: linear-gradient(145deg, #effcf6, #dcf7eb);
    border-color: #aee8d0;
}

.home-versoes-kpi--success .home-contingencia-kpi-icon {
    color: #087a53;
    background: rgba(15, 159, 110, 0.14);
}

.home-versoes-kpi--danger {
    background: linear-gradient(145deg, #fff7f7, #ffe7e7);
    border-color: #f2bcbc;
}

.home-versoes-kpi--danger .home-contingencia-kpi-icon {
    color: #bd2929;
    background: rgba(217, 63, 63, 0.13);
}

.home-versoes-kpi--warning {
    background: linear-gradient(145deg, #fffaf0, #fff0c9);
    border-color: #efd18a;
}

.home-versoes-kpi--warning .home-contingencia-kpi-icon {
    color: #9a6200;
    background: rgba(216, 144, 0, 0.14);
}

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

.home-versoes-footnote {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    margin-top: 18px;
    padding: 12px 14px;
    border: 1px solid #d7e4fa;
    border-radius: 14px;
    color: var(--color-text-soft);
    background: #f8fbff;
    font-size: 12px;
    line-height: 1.5;
}

.home-versoes-footnote i {
    flex: 0 0 auto;
    margin-top: 1px;
    color: var(--color-primary);
}

/* =========================================================
   HOME — ATENDIMENTOS EM ABERTO
   ========================================================= */

.home-open-tickets-filters-card {
    margin-bottom: 14px;
    padding: 18px 20px;

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

    background:
        linear-gradient(
            145deg,
            rgba(35, 70, 191, 0.035),
            rgba(20, 131, 211, 0.025)
        ),
        var(--color-surface);

    box-shadow: var(--shadow-card);
}

.home-open-tickets-filters-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;

    margin-bottom: 16px;
}

.home-open-tickets-filters-header h3 {
    margin: 0;

    color: var(--color-text);
    font-size: 16px;
    font-weight: 800;
}

.home-open-tickets-filters-header p {
    max-width: 720px;
    margin: 5px 0 0;

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

.home-open-tickets-clear-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex: 0 0 auto;

    min-height: 38px;
    padding: 8px 13px;

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

    color: var(--color-primary-strong);
    background: #ffffff;

    font-size: 12px;
    font-weight: 750;

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

.home-open-tickets-clear-button:hover {
    border-color: #9eb7e3;
    background: #f1f6ff;
    transform: translateY(-1px);
}

.home-open-tickets-clear-button:active {
    transform: translateY(0);
}

.home-open-tickets-filters-grid {
    width: 100%;
    display: grid;
    grid-template-columns:
        repeat(3, minmax(0, 1fr))
        minmax(290px, 1.25fr);
    gap: 14px;
}

.home-open-tickets-filter-field {
    width: 100%;
    min-width: 0;
}

.home-open-tickets-filter-field > label {
    display: block;
    margin-bottom: 7px;

    color: var(--color-text);
    font-size: 12px;
    font-weight: 750;
}

.home-open-tickets-dropdown {
    min-width: 0;
}

.home-open-tickets-dropdown .Select-control {
    min-height: 42px;

    border: 1px solid #cbd8ec;
    border-radius: 11px;

    background: #ffffff;
    box-shadow: none;

    transition:
        border-color var(--transition-fast),
        box-shadow var(--transition-fast);
}

.home-open-tickets-dropdown.is-focused .Select-control,
.home-open-tickets-dropdown .Select-control:hover {
    border-color: #91afe5;
}

.home-open-tickets-dropdown.is-focused:not(.is-open) .Select-control {
    border-color: var(--color-primary);
    box-shadow:
        0 0 0 3px rgba(35, 70, 191, 0.12);
}

.home-open-tickets-dropdown .Select-placeholder,
.home-open-tickets-dropdown .Select-value-label,
.home-open-tickets-dropdown .Select-input > input {
    color: var(--color-text-soft);
    font-size: 12px;
}

.home-open-tickets-dropdown .Select--multi .Select-value {
    margin-top: 6px;

    border: 1px solid #bed0f0;
    border-radius: 8px;

    color: var(--color-primary-strong);
    background: #edf4ff;
}

.home-open-tickets-dropdown .Select--multi .Select-value-icon {
    border-right-color: #bed0f0;
}

.home-open-tickets-dropdown .Select-menu-outer {
    z-index: calc(var(--z-modal) - 10);

    border-color: #cbd8ec;
    border-radius: 0 0 11px 11px;

    box-shadow: var(--shadow-card);
}

.home-open-tickets-date-picker,
.home-open-tickets-date-picker .DateRangePicker,
.home-open-tickets-date-picker .DateRangePickerInput {
    width: 100%;
}

.home-open-tickets-date-picker .DateRangePickerInput {
    min-height: 42px;
    display: flex;
    align-items: center;

    border: 1px solid #cbd8ec;
    border-radius: 11px;

    background: #ffffff;
    overflow: hidden;

    transition:
        border-color var(--transition-fast),
        box-shadow var(--transition-fast);
}

.home-open-tickets-date-picker .DateRangePickerInput:hover,
.home-open-tickets-date-picker .DateRangePickerInput__withBorder {
    border-color: #91afe5;
}

.home-open-tickets-date-picker .DateInput {
    flex: 1 1 0;
    width: auto;
    min-width: 0;
    background: transparent;
}

.home-open-tickets-date-picker .DateInput_input {
    width: 100%;
    height: 40px;
    padding: 0 10px;

    border: 0;
    background: transparent;

    color: var(--color-text-soft);
    font-family: inherit;
    font-size: 12px;
    font-weight: 500;
    line-height: 40px;
    text-align: center;
}

.home-open-tickets-date-picker .DateInput_input__focused {
    border-bottom: 2px solid var(--color-primary);
}

.home-open-tickets-date-picker .DateInput_input[readonly] {
    cursor: pointer;
    caret-color: transparent;
    user-select: none;
    -webkit-user-select: none;
}

.home-open-tickets-date-picker .DateInput_input[readonly]::selection {
    background: transparent;
}

.home-open-tickets-date-picker .DayPicker,
.home-open-tickets-date-picker .DayPicker_transitionContainer {
    width: auto !important;
}

.home-open-tickets-date-picker .DateRangePickerInput_arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    color: var(--color-text-soft);
}

.home-open-tickets-date-picker .DateRangePickerInput_clearDates {
    margin: 0 4px 0 0;
    padding: 4px;
}

.home-open-tickets-date-picker .DateRangePicker_picker {
    z-index: calc(var(--z-modal) - 10);
}

.home-open-tickets-filter-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;

    margin-top: 14px;
    padding-top: 12px;

    border-top: 1px solid #d9e4f5;

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

.home-open-tickets-filter-summary strong {
    color: var(--color-text);
    font-weight: 800;
}

.home-open-tickets-filter-summary span {
    flex: 0 0 auto;

    padding: 5px 9px;

    border: 1px solid #cfdbef;
    border-radius: 999px;

    color: var(--color-primary-strong);
    background: #f2f7ff;

    font-size: 11px;
    font-weight: 750;
}

.home-open-tickets-dashboard {
    min-width: 0;
}

.home-open-tickets-kpi--time {
    background:
        linear-gradient(
            145deg,
            #f5f8ff,
            #e8efff
        );
    border-color: #c3d3f1;
}

.home-open-tickets-kpi--time .home-contingencia-kpi-icon {
    color: #375fb9;
    background: rgba(55, 95, 185, 0.12);
}

.home-open-tickets-map {
    cursor: pointer;
}

#home-open-tickets-map-section {
    scroll-margin-top: 86px;
}

.home-open-tickets-panel--table {
    margin-top: 20px;
}

.home-open-tickets-panel--table .ag-root-wrapper {
    border-radius: 12px;
}

.home-open-tickets-dashboard .home-contingencia-panel-header p {
    max-width: 900px;
}
