.app-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.topbar {
    height: 74px;
    background: rgba(255, 255, 255, 0.86);
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 22px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.topbar-left,
.topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.topbar-icon-btn {
    width: 42px;
    height: 42px;
    border: 1px solid var(--color-border);
    background: #ffffff;
    color: var(--color-primary-strong);
    border-radius: 12px;
    cursor: pointer;
    font-size: 18px;
    box-shadow: 0 6px 16px rgba(17, 34, 78, 0.06);
}

.topbar-icon-btn:focus-visible,
.sidebar-link:focus-visible,
.sidebar-logout-btn:focus-visible {
    outline: 3px solid rgba(126, 162, 255, 0.72);
    outline-offset: 3px;
}

.profile-pill {
    height: 42px;
    padding: 0 14px 0 10px;
    border-radius: 12px;
    background: linear-gradient(180deg, #1f56c8 0%, #0f76b5 100%);
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 10px 22px rgba(15, 118, 181, 0.20);
}

.profile-avatar {
    width: 26px;
    height: 26px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.14);
    font-size: 14px;
}

.profile-name {
    font-size: 14px;
    font-weight: 700;
}

.page-body {
    padding: 28px;
}

.page-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.page-header-icon {
    width: 62px;
    height: 62px;
    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: 28px;
    box-shadow: 0 10px 22px rgba(35, 70, 191, 0.10);
}

.page-title {
    margin: 0;
    font-size: 54px;
    line-height: 1;
    color: #1483d3;
    font-weight: 800;
}

.page-subtitle {
    margin: 8px 0 0 0;
    color: var(--color-text-soft);
    font-size: 17px;
}

.home-contingencia-page-header {
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.home-contingencia-page-heading {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
}

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

.home-contingencia-primary-grid,
.home-contingencia-secondary-grid {
    display: grid;
    gap: 20px;
    margin-bottom: 20px;
}

.home-contingencia-primary-grid {
    grid-template-columns: minmax(0, 1.35fr) minmax(340px, 0.65fr);
}

.home-contingencia-secondary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.home-contingencia-rankings-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin: 18px 0;
}

.home-contingencia-modal-kpis {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
}

.operational-grid {
    display: grid;
    grid-template-columns: 1.3fr 0.7fr;
    gap: 20px;
    margin-bottom: 28px;
}

.chart-panel,
.stat-card,
.quick-card,
.summary-card,
.coming-soon-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
}

.chart-panel {
    padding: 20px;
    min-height: 360px;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
}

.panel-title {
    font-size: 18px;
    font-weight: 800;
    color: var(--color-text);
}

.panel-badge {
    font-size: 13px;
    color: var(--color-primary-strong);
    background: var(--color-primary-soft);
    border: 1px solid #d5e3ff;
    border-radius: 999px;
    padding: 8px 12px;
    font-weight: 700;
}

.chart-placeholder {
    width: 100%;
    height: calc(100% - 52px);
    border-radius: 16px;
    background:
        linear-gradient(180deg, rgba(35, 70, 191, 0.04), rgba(35, 70, 191, 0.08)),
        #f8fbff;
    border: 1px dashed #bfd0f2;
    position: relative;
    overflow: hidden;
}

.chart-placeholder.big {
    min-height: 260px;
}

.fake-chart-line {
    position: absolute;
    left: 30px;
    right: 30px;
    height: 4px;
    border-radius: 999px;
}

.line-a {
    bottom: 118px;
    background: linear-gradient(90deg, transparent 0%, #5f88ff 20%, #2d55da 40%, #7faaff 65%, transparent 100%);
}

.line-b {
    bottom: 70px;
    background: linear-gradient(90deg, transparent 0%, #8bc1ff 18%, #1483d3 45%, #79c4ff 70%, transparent 100%);
}

.fake-chart-bars {
    position: absolute;
    left: 24px;
    right: 24px;
    bottom: 24px;
    height: 110px;
    background:
        linear-gradient(90deg,
            #cfe0ff 0 8%,
            transparent 8% 12%,
            #acc4ff 12% 20%,
            transparent 20% 24%,
            #7ea2ff 24% 32%,
            transparent 32% 36%,
            #9bc2ff 36% 44%,
            transparent 44% 48%,
            #5f88ff 48% 56%,
            transparent 56% 60%,
            #bfd4ff 60% 68%,
            transparent 68% 72%,
            #7ea2ff 72% 80%,
            transparent 80% 84%,
            #d9e7ff 84% 100%);
    opacity: 0.85;
    border-radius: 12px 12px 0 0;
    mask-image: linear-gradient(to top, rgba(0, 0, 0, 1), rgba(0, 0, 0, 0.2));
}

.stats-panel {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.stat-card {
    min-height: 170px;
    padding: 24px;
    background: linear-gradient(180deg, #f8fbff 0%, #edf5ff 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.stat-card-title {
    font-size: 16px;
    color: var(--color-text-soft);
    margin-bottom: 12px;
    font-weight: 600;
}

.stat-card-value {
    font-size: 48px;
    line-height: 1;
    font-weight: 800;
    color: #1483d3;
}

.section-block {
    margin-bottom: 28px;
}

.section-title-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    color: #1483d3;
}

.section-title-wrap i {
    font-size: 20px;
}

.section-title-wrap h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 800;
}

.quick-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.quick-card {
    min-height: 160px;
    padding: 22px;
}

.quick-card-title {
    font-size: 18px;
    font-weight: 800;
    color: var(--color-text);
    margin-bottom: 12px;
}

.quick-card-description {
    font-size: 15px;
    line-height: 1.6;
    color: var(--color-text-soft);
}

.summary-row {
    display: grid;
    grid-template-columns: 1.4fr 0.8fr 0.8fr;
    gap: 16px;
}

.summary-card {
    min-height: 150px;
    padding: 22px;
}

.summary-card.large {
    min-height: 150px;
}

.summary-card-title {
    font-size: 18px;
    font-weight: 800;
    color: var(--color-text);
    margin-bottom: 12px;
}

.summary-card-text {
    font-size: 15px;
    line-height: 1.6;
    color: var(--color-text-soft);
}

.summary-card-number {
    font-size: 46px;
    font-weight: 800;
    color: var(--color-primary);
    margin-top: 14px;
}

.coming-soon-card {
    padding: 28px;
    max-width: 700px;
}

.coming-soon-title {
    font-size: 28px;
    font-weight: 800;
    color: var(--color-primary);
    margin-bottom: 10px;
}

.coming-soon-text {
    margin: 0;
    color: var(--color-text-soft);
    line-height: 1.7;
    font-size: 16px;
}

.app-shell {
    min-height: 100vh;
    display: flex;
    background: var(--color-bg);
}

.app-sidebar {
    width: 270px;
    min-width: 270px;
    background: linear-gradient(180deg, var(--color-navy) 0%, var(--color-navy-2) 100%);
    color: #ffffff;
    display: flex;
    flex-direction: column;
    padding: 24px 18px;
    box-shadow: 8px 0 22px rgba(10, 23, 55, 0.12);
    overflow-x: hidden;
    transition: width 0.22s ease, min-width 0.22s ease, padding 0.22s ease, transform 0.22s ease;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 28px;
    min-width: 0;
}

.sidebar-brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, #3c67f0 0%, #2146c5 100%);
    color: #ffffff;
    font-size: 20px;
    font-weight: 800;
    box-shadow: 0 10px 22px rgba(45, 85, 218, 0.28);
}

.sidebar-brand-title {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: 0.4px;
}

.sidebar-brand-subtitle {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.72);
    margin-top: 2px;
}

.sidebar-brand-text-wrap,
.sidebar-section-title,
.sidebar-link-text,
.sidebar-logout-btn span {
    transition: opacity 0.14s ease, visibility 0.14s ease;
}

.sidebar-section-title {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.52);
    margin-bottom: 14px;
    padding: 0 8px;
}

.sidebar-links {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 14px;
    border-radius: 14px;
    color: rgba(255, 255, 255, 0.82);
    transition: background 0.18s ease, transform 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.sidebar-link:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    transform: translateX(2px);
}

.sidebar-link.active,
.sidebar-link.active:hover,
.sidebar-link.active:focus-visible {
    background: linear-gradient(
        90deg,
        rgba(61, 106, 242, 0.40) 0%,
        rgba(35, 70, 191, 0.26) 100%
    );

    color: #ffffff;

    box-shadow:
        inset 3px 0 0 rgba(126, 162, 255, 0.78);

    transform: none;
}

.sidebar-link-icon {
    font-size: 18px;
    width: 20px;
    text-align: center;
}

.sidebar-link-text {
    font-size: 15px;
    font-weight: 600;
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 18px;
}

.sidebar-logout-btn {
    width: 100%;
    height: 46px;
    border: 0;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.10);
    color: #ffffff;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: background 0.18s ease, transform 0.18s ease;
}

.sidebar-logout-btn:hover {
    background: rgba(255, 255, 255, 0.16);
    transform: translateY(-1px);
}

.sidebar-backdrop {
    display: none;
}

.app-shell.sidebar-collapsed .app-sidebar {
    width: 78px;
    min-width: 78px;
    padding-right: 10px;
    padding-left: 10px;
}

.app-shell.sidebar-collapsed .sidebar-brand {
    justify-content: center;
    gap: 0;
}

.app-shell.sidebar-collapsed .sidebar-brand-text-wrap,
.app-shell.sidebar-collapsed .sidebar-section-title,
.app-shell.sidebar-collapsed .sidebar-link-text,
.app-shell.sidebar-collapsed .sidebar-logout-btn span {
    width: 0;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
}

.app-shell.sidebar-collapsed .sidebar-links {
    width: 100%;
    align-items: center;
}

.app-shell.sidebar-collapsed .sidebar-link {
    width: 52px;
    min-width: 52px;
    max-width: 52px;

    height: 52px;
    min-height: 52px;
    max-height: 52px;

    flex: 0 0 52px;

    justify-content: center;
    align-items: center;
    gap: 0;

    padding: 0;
    margin: 0 auto;

    box-sizing: border-box;
    overflow: hidden;
}

.app-shell.sidebar-collapsed .sidebar-link-icon {
    width: 22px;
    min-width: 22px;
    height: 22px;
    flex: 0 0 22px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    margin: 0;
    padding: 0;

    line-height: 1;
    text-align: center;
}

.app-shell.sidebar-collapsed .sidebar-link:hover,
.app-shell.sidebar-collapsed .sidebar-link:focus-visible {
    transform: none;
    color: #ffffff;
}

.app-shell.sidebar-collapsed
.sidebar-link:not(.active):hover {
    background: rgba(255, 255, 255, 0.08);
    box-shadow: inset 0 0 0 1px rgba(126, 162, 255, 0.22);
}

.app-shell.sidebar-collapsed .sidebar-link.active,
.app-shell.sidebar-collapsed .sidebar-link.active:hover,
.app-shell.sidebar-collapsed .sidebar-link.active:focus-visible {
    background: linear-gradient(
        180deg,
        rgba(61, 106, 242, 0.38) 0%,
        rgba(35, 70, 191, 0.26) 100%
    );

    color: #ffffff;

    box-shadow:
        inset 3px 0 0 rgba(126, 162, 255, 0.82);

    transform: none;
}

.app-shell.sidebar-collapsed .sidebar-logout-btn {
    width: 52px;
    min-width: 52px;
    max-width: 52px;

    height: 52px;
    min-height: 52px;
    max-height: 52px;

    margin: 0 auto;
    padding: 0;
    gap: 0;

    flex: 0 0 52px;
    box-sizing: border-box;
}
