html {
    font-size: 14px;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
    position: relative;
    min-height: 100%;
}

body {
    margin-bottom: 60px;
}

.form-floating > .form-control-plaintext::placeholder,
.form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder,
.form-floating > .form-control:focus::placeholder {
    text-align: start;
}


:root {
    --surface-50: #f7fafc;
    --surface-100: #edf3f8;
    --surface-200: #d9e4ea;
    --surface-300: #c4d3dc;
    --surface-600: #5f7280;
    --surface-800: #1d3948;
    --surface-850: #17313f;
    --surface-900: #102532;
    --surface-950: #091923;
    --bg-body: #ffffff;
    --bg-canvas: #edf3f8;
    --bg-card: #ffffff;
    --bg-panel: #ffffff;
    --border-subtle: var(--surface-200);
    --border-strong: var(--surface-300);
    --text-primary: var(--surface-900);
    --text-muted: var(--surface-600);
    --neutral-500: #BDBDBD;
    --brand-400: #2fc1cf;
    --brand-500: #0e9fb2;
    --brand-600: #087d91;
    --brand-700: #075f70;
    --brand-soft: #dff6f7;
    --navy-700: #173b4d;
    --navy-800: #102a3a;
    --navy-900: #091d29;
    --success-400: #35ad87;
    --success-500: #16815e;
    --success-600: #106849;
    --warning-400: #dea344;
    --warning-500: #c57b13;
    --warning-600: #9f600d;
    --danger-400: #dd6a76;
    --danger-500: #c84756;
    --danger-600: #a83443;
    --chart-primary: #0e9fb2;
    --chart-primary-fill: rgba(14, 159, 178, 0.12);
    --chart-secondary: #2169d3;
    --chart-secondary-fill: rgba(33, 105, 211, 0.1);
    --chart-tertiary: #65b9c8;
    --chart-accent: #8a75d1;
    --chart-muted: #5f7280;
    --chart-grid: rgba(95, 114, 128, 0.45);
    --chart-tooltip-bg: #102532;
    --chart-tooltip-text: #f7fafc;
    --chart-rank-1: #087d91;
    --chart-rank-2: #0e9fb2;
    --chart-rank-3: #39afbd;
    --chart-rank-4: #65b9c8;
    --chart-rank-5: #9bd4dc;
    --chart-category-1: #0e9fb2;
    --chart-category-2: #2169d3;
    --chart-category-3: #16815e;
    --chart-category-4: #8a75d1;
    --chart-category-5: #c57b13;
    --chart-category-6: #c84756;
    --chart-category-7: #5f7280;
    --chart-category-8: #9badb7;
    --chart-other: #334b5a;
    --chart-group-cdg-1: #087d91;
    --chart-group-cdg-2: #0e9fb2;
    --chart-group-cdg-3: #39afbd;
    --chart-group-cdg-4: #65b9c8;
    --chart-group-cdg-5: #9bd4dc;
    --chart-group-tij-1: #14532d;
    --chart-group-tij-2: #16815e;
    --chart-group-tij-3: #22a06b;
    --chart-group-tij-4: #4caf82;
    --chart-group-tij-5: #8bc9a8;
    --chart-group-cpt-1: #1a4a9e;
    --chart-group-cpt-2: #2169d3;
    --chart-group-cpt-3: #4a86de;
    --chart-group-cpt-4: #74a4e8;
    --chart-group-cpt-5: #a3c4f0;
    --chart-group-ptg-1: #5b4a9e;
    --chart-group-ptg-2: #8a75d1;
    --chart-group-ptg-3: #a392db;
    --chart-group-ptg-4: #bbaee5;
    --chart-group-ptg-5: #d4ccef;
    --chart-group-pta-1: #9a5a0a;
    --chart-group-pta-2: #c57b13;
    --chart-group-pta-3: #d4943a;
    --chart-group-pta-4: #e0ad66;
    --chart-group-pta-5: #ecc998;
    --chart-group-sma-1: #8f2f3c;
    --chart-group-sma-2: #c84756;
    --chart-group-sma-3: #d46a76;
    --chart-group-sma-4: #e08d96;
    --chart-group-sma-5: #ecb0b7;
    --chart-group-otros-1: #1f3340;
    --chart-group-otros-2: #334b5a;
    --chart-group-otros-3: #4a6270;
    --chart-group-otros-4: #6b7f8a;
    --chart-group-otros-5: #9badb7;
    --radius-card: 16px;
    --radius-lg: 14px;
    --radius-badge: 999px;
    --shadow-card: 0 10px 30px rgba(26, 62, 78, 0.08);
    --shadow-card-hover: 0 16px 38px rgba(26, 62, 78, 0.14);
    --shadow-glow: 0 0 22px rgba(14, 159, 178, 0.16);
    --AuthPrimary: #1e3a5f;
    --AuthPrimaryDark: #162c49;
    --AuthAccent: #d99a00;
    --AuthBackground: #f4f6f8;
    --AuthSurface: #ffffff;
    --AuthText: #111827;
    --AuthMuted: #6b7280;
    --AuthBorder: #6b7280;
    --AuthShadow: 0 22px 55px rgba(15, 23, 42, 0.16);
}

body {
    background: var(--bg-canvas);
    color: var(--text-primary);
    font-family: 'DM Sans', ui-sans-serif, system-ui, -apple-system, sans-serif;
    -webkit-font-smoothing: antialiased;
}

/* Executive shell */
#k_content {
    width: 100%;
    padding-right: 0 !important;
    padding-left: 0 !important;
}

#k_header {
    background: rgba(255, 255, 255, 0.96);
    border-bottom: 1px solid var(--border-subtle);
    box-shadow: 0 8px 28px rgba(26, 62, 78, 0.06);
    backdrop-filter: blur(14px);
}

.k-header .k-header__topbar {
    gap: 0.5rem;
}

    .k-header .k-header__topbar .k-header__topbar-item .k-header__topbar-icon i {
        color: var(--brand-500);
    }

.digs-header-page-heading {
    display: flex;
    align-items: center;
    min-width: 0;
    max-width: min(42vw, 28rem);
    height: 100%;
    padding: 0.35rem 0.75rem 0.35rem 1rem;
}

.digs-header-page-heading-main {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.5rem 0.75rem;
    min-width: 0;
}

.digs-header-page-heading-text {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
}

.digs-header-page-title {
    margin: 0;
    color: var(--text-primary, #1f2937);
    font-size: 1.05rem;
    font-weight: 650;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.digs-header-page-subtitle {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1.25;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
}

.digs-header-page-freshness {
    flex: 0 0 auto;
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 600;
    white-space: nowrap;
}

@media (max-width: 1024px) {
    .digs-header-page-heading {
        max-width: none;
        width: 100%;
        padding: 0.35rem 0.75rem;
    }

    .digs-header-page-subtitle {
        -webkit-line-clamp: 1;
        line-clamp: 1;
    }
}

.k-header-filters {
    align-items: center;
    padding-right: 0.75rem;
}

.digs-header-filters-inner,
.digs-header-filter-group {
    display: flex;
    align-items: center;
}

.digs-header-filters-inner {
    gap: 0.75rem;
}

.digs-header-filter-group {
    min-height: 42px;
    gap: 0.55rem;
    padding: 0.35rem 0.65rem;
    background: var(--surface-100);
    border: 2px solid var(--border-subtle);
    border-radius: 12px;
}

.digs-header-filter-group--date {
    flex-direction: column;
    align-items: stretch;
    gap: 0.3rem;
    padding-top: 0.3rem;
    padding-bottom: 0.3rem;
}

.digs-header-filter-group--clinic {
    flex-direction: column;
    align-items: stretch;
    gap: 0.3rem;
    padding-top: 0.3rem;
    padding-bottom: 0.3rem;
}

.digs-header-clinic-row {
    display: flex;
    align-items: center;
    gap: 0.55rem;
}

.digs-header-date-row {
    display: flex;
    align-items: center;
    gap: 0.55rem;
}

.digs-header-date-presets,
.digs-header-clinic-groups {
    display: flex;
    flex-wrap: nowrap;
    align-items: flex-start;
    gap: 0.25rem;
    max-width: 280px;
    padding-bottom: 0.65rem;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(14, 159, 178, 0.35) transparent;
}

    .digs-header-date-presets::-webkit-scrollbar,
    .digs-header-clinic-groups::-webkit-scrollbar {
        height: 6px;
    }

    .digs-header-date-presets::-webkit-scrollbar-track,
    .digs-header-clinic-groups::-webkit-scrollbar-track {
        background: transparent;
    }

    .digs-header-date-presets::-webkit-scrollbar-thumb,
    .digs-header-clinic-groups::-webkit-scrollbar-thumb {
        background: rgba(14, 159, 178, 0.35);
        border-radius: 999px;
    }

.digs-header-date-preset,
.digs-header-clinic-group {
    margin: 0;
    padding: 0.12rem 0.4rem;
    border: 1px solid var(--border-subtle);
    border-radius: 999px;
    background: var(--surface-50);
    color: var(--text-muted);
    font-size: 0.62rem;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    cursor: pointer;
    flex: 0 0 auto;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

    .digs-header-date-preset:hover,
    .digs-header-clinic-group:hover {
        color: var(--brand-600);
        background: var(--brand-soft);
        border-color: rgba(14, 159, 178, 0.35);
    }

    .digs-header-date-preset.is-active,
    .digs-header-date-preset[aria-pressed="true"],
    .digs-header-clinic-group.is-active,
    .digs-header-clinic-group[aria-pressed="true"] {
        color: #fff;
        background: var(--brand-500);
        border-color: var(--brand-500);
    }

#k_header.digs-header-filters-expanded {
    height: auto;
    min-height: 75px;
}

    #k_header.digs-header-filters-expanded .k-header__topbar {
        align-items: center;
        min-height: 75px;
        padding-top: 0.35rem;
        padding-bottom: 0.35rem;
    }

@media (min-width: 1025px) {
    body.k-header--fixed.digs-header-filters-expanded .k-wrapper {
        padding-top: 108px;
    }
}

.k-header-filter-label {
    margin-bottom: 0;
    color: var(--text-muted);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.digs-header-filter-icon {
    color: var(--brand-500);
    font-size: 1.35rem;
}

#headerDateRangePicker {
    min-width: 210px;
    cursor: pointer;
    color: var(--text-primary);
    background: transparent;
    border: 0;
    box-shadow: none;
    font-size: 0.78rem;
    font-weight: 600;
}

#headerFilters .bootstrap-select > .dropdown-toggle {
    color: var(--text-primary);
    background: transparent;
    border: 0;
    box-shadow: none;
    font-size: 0.78rem;
    font-weight: 600;
}

#headerFilters .bootstrap-select .dropdown-menu.inner > li.dropdown-header {
    cursor: pointer;
    user-select: none;
}

    #headerFilters .bootstrap-select .dropdown-menu.inner > li.dropdown-header:hover {
        color: var(--brand-600);
        background: var(--brand-soft);
    }

.digs-user-trigger {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.4rem 0.7rem;
    background: var(--surface-50);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
}

.digs-user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.digs-user-welcome {
    color: var(--text-muted);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.digs-user-name {
    color: var(--text-primary);
    font-size: 0.78rem;
    font-weight: 700;
}

.digs-header-filters-toggle {
    display: none;
    align-items: center;
    gap: 0.35rem;
    margin: 0;
    padding: 0.4rem 0.7rem;
    min-height: 44px;
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    background: var(--surface-50);
    color: var(--brand-600);
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

    .digs-header-filters-toggle:hover,
    .digs-header-filters-toggle[aria-expanded="true"] {
        color: var(--brand-600);
        background: var(--brand-soft);
        border-color: rgba(14, 159, 178, 0.35);
    }

    .digs-header-filters-toggle i {
        font-size: 1.15rem;
    }

.digs-header-filters-panel {
    display: contents;
}

#k_aside,
#k_aside_brand {
    background: var(--navy-800);
}

#k_aside {
    font-family: 'DM Sans', ui-sans-serif, system-ui, -apple-system, sans-serif;
    border-right: 1px solid rgba(125, 181, 196, 0.14);
    box-shadow: 12px 0 32px rgba(9, 29, 41, 0.1);
}

#k_aside_brand {
    height: 75px;
    border-bottom: 1px solid rgba(199, 216, 223, 0.12);
}

.digs-aside-brand-logo {
    display: flex;
    align-items: center;
}

.digs-aside-logo {
    width: 150px;
    max-width: 100%;
}

.digs-release-label {
    display: block;
    margin-top: -.9rem;
    font-weight: 500;
    margin-left: 4rem;
    color: #7fb9c5;
    font-size: .75rem;
    font-style: normal;
    letter-spacing: 0.05em;
}

.k-aside--minimize .k-aside__brand .digs-release-label {
    display: none;
}

.digs-aside-menu-wrapper {
    margin-top: -0.75rem;
}

#k_aside_menu {
    padding: 0.65rem;
    background: transparent;
    border-radius: 0;
}

.k-aside-menu .k-menu__nav > .k-menu__item {
    margin-bottom: 0.3rem;
}

    .k-aside-menu .k-menu__nav > .k-menu__item > .k-menu__link {
        display: flex;
        min-height: 44px;
        align-items: center;
        justify-content: flex-start;
        gap: 0.75rem;
        padding: 0 0.8rem;
        border: 1px solid transparent;
        border-radius: 12px;
    }

        .k-aside-menu .k-menu__nav > .k-menu__item > .k-menu__link .k-menu__link-text {
            color: #c7d8df;
            font-size: 0.88rem !important;
            font-weight: 600;
        }

        .k-aside-menu .k-menu__nav > .k-menu__item > .k-menu__link .k-menu__link-icon {
            display: inline-grid;
            width: 28px;
            height: 28px;
            place-items: center;
            color: #7f9ba7;
            background: rgba(199, 216, 223, 0.07);
            border-radius: 9px;
            margin-right: 0;
        }

        .k-aside-menu .k-menu__nav > .k-menu__item > .k-menu__link .k-menu__link-text {
            display: inline-flex;
            min-height: 28px;
            align-items: center;
            line-height: 1.2;
        }

.k-aside--minimize .k-aside-menu .k-menu__nav > .k-menu__item > .k-menu__link {
    justify-content: center;
    padding-right: 0;
    padding-left: 0;
}

.k-aside-menu .k-menu__nav > .k-menu__item.k-menu__item--active > .k-menu__link,
.k-aside-menu .k-menu__nav > .k-menu__item:hover > .k-menu__link {
    background: rgba(14, 159, 178, 0.17);
    border-color: rgba(47, 193, 207, 0.2);
}

    .k-aside-menu .k-menu__nav > .k-menu__item.k-menu__item--active > .k-menu__link .k-menu__link-text,
    .k-aside-menu .k-menu__nav > .k-menu__item:hover > .k-menu__link .k-menu__link-text {
        color: #ffffff;
    }

    .k-aside-menu .k-menu__nav > .k-menu__item.k-menu__item--active > .k-menu__link .k-menu__link-icon,
    .k-aside-menu .k-menu__nav > .k-menu__item:hover > .k-menu__link .k-menu__link-icon {
        color: var(--brand-400);
        background: rgba(47, 193, 207, 0.12);
    }

@media (max-width: 1024px) {
    #k_header_mobile {
        z-index: 103;
    }

    #k_header {
        position: relative;
        z-index: 98;
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
    }

    .digs-header-filters-toggle {
        display: inline-flex;
    }

    .k-header-filters {
        position: static;
        padding-right: 0;
        align-items: center;
    }

    /* El topbar siempre se ancla bajo el header mobile de 60px. */
    body.k-header-mobile--fixed .k-header__topbar {
        top: 60px;
        margin-top: 0;
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transform: translateY(-100%);
        z-index: 100;
        transition: transform 0.3s ease, opacity 0.2s ease, visibility 0.3s ease;
    }

    body.k-header-mobile--fixed.k-header__topbar--mobile-on .k-header__topbar {
        margin-top: 0;
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transform: translateY(0);
    }

    .digs-header-filters-panel {
        display: none;
        position: absolute;
        top: 50px;
        left: 12px;
        right: 12px;
        z-index: 102;
        padding: 0.75rem;
        background: #fff;
        border: 1px solid var(--border-subtle);
        border-radius: 12px;
        box-shadow: 0 12px 32px rgba(15, 23, 42, 0.14);
        overflow: visible;
    }

        .digs-header-filters-panel.is-open {
            display: block;
        }

    .digs-header-filters-inner {
        flex-direction: column;
        flex-wrap: nowrap;
        align-items: stretch;
        justify-content: flex-start;
        gap: 0.65rem;
    }

    .digs-header-filter-group {
        min-height: 38px;
        width: 100%;
    }

    .digs-header-filter-group--date {
        width: 100%;
    }

    .digs-header-filter-group--clinic {
        width: 100%;
    }

    .digs-header-date-presets,
    .digs-header-clinic-groups {
        max-width: none;
    }

    .digs-header-date-preset,
    .digs-header-clinic-group {
        font-size: 0.58rem;
        padding: 0.1rem 0.32rem;
    }

    #headerDateRangePicker {
        min-width: 0;
        width: 100%;
    }

    #headerFilters .bootstrap-select {
        width: 100% !important;
    }

    /* Keep topbar as a single compact row; filters live in the overlay panel. */
    #k_header.digs-header-filters-expanded {
        height: auto;
        min-height: 0;
    }

        #k_header.digs-header-filters-expanded .k-header__topbar {
            top: 60px;
            margin-top: 0;
            height: 50px;
            min-height: 50px;
            align-items: center;
            overflow: visible;
            padding-top: 0;
            padding-bottom: 0;
        }

    /* El topbar es un overlay temporal y no desplaza el contenido. */
    body.k-header-mobile--fixed.k-header__topbar--mobile-on .k-wrapper,
    body.k-header-mobile--fixed.digs-header-filters-expanded .k-wrapper {
        padding-top: 60px;
    }

    .digs-user-trigger {
        min-height: 44px;
        min-width: 44px;
        justify-content: center;
        padding: 0.25rem;
    }

    .digs-user-avatar {
        width: 36px;
        height: 36px;
    }
}

@media (min-width: 1025px) {
    .digs-header-filters-toggle {
        display: none !important;
    }

    .digs-header-filters-panel {
        display: contents;
    }

    .digs-user-avatar {
        display: none;
    }
}

.disparidades-page {
    width: 100%;
    max-width: none;
    margin: 0 auto;
    padding: 1.5rem;
    position: relative;
}

.page-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.page-title-row {
    gap: 0.625rem;
    margin-bottom: 0.25rem;
}

.page-subtitle {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.kpi-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

@media (min-width: 768px) {
    .kpi-grid {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    }
}

.kpi-card {
    --kpi-accent: var(--neutral-500);
    --kpi-icon-accent: var(--brand-400);
    position: relative;
    overflow: hidden;
    background: linear-gradient(145deg, #ffffff, var(--surface-50));
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    min-height: 120px;
    padding: 1rem 1.25rem;
    border-width: 3px;
    border-style: solid;
    border-color: var(--kpi-accent);
    transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

    .kpi-card > * {
        position: relative;
        z-index: 1;
    }

.kpi-card-has-footer {
    display: flex;
    flex-direction: column;
    padding-bottom: 1rem;
}

.kpi-card-body {
    flex: 1 1 auto;
}

.kpi-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 0.75rem;
    gap: 0.5rem;
}

.kpi-card-action {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-muted);
}

.kpi-card-action-arrow {
    transition: transform 0.2s ease;
}

.kpi-card:hover .kpi-card-action-arrow {
    transform: translateX(4px);
}

.kpi-card.tone-success {
    --kpi-accent: var(--success-400);
    --kpi-icon-accent: var(--success-400);
}

.kpi-card.tone-warning {
    --kpi-accent: var(--warning-400);
    --kpi-icon-accent: var(--warning-400);
}

.kpi-card.tone-danger {
    --kpi-accent: var(--danger-500);
    --kpi-icon-accent: var(--danger-400);
}

.kpi-card.tone-neutral {
    --kpi-accent: var(--neutral-500);
}

.kpi-card .kpi-badge {
    margin-left: auto;
}

.kpi-card:hover {
    box-shadow: var(--shadow-card-hover);
    border-color: black;
    border-width: 3px;
    transform: translateY(-2px);
}

.kpi-icon {
    display: inline-grid;
    width: 34px;
    height: 34px;
    flex: 0 0 auto;
    place-items: center;
    color: var(--kpi-icon-accent);
}

    .kpi-icon i {
        color: inherit !important;
        font-size: 0.95rem;
    }

.digs-page-shell {
    position: relative;
    width: 100%;
    max-width: none;
    margin: 0 auto;
    padding: 0.25rem clamp(0.75rem, 1.5vw, 1.5rem) 2rem;
}

.digs-section-heading {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

    .digs-section-heading::after {
        height: 1px;
        flex: 1 1 auto;
        content: "";
        background: var(--border-subtle);
    }

    .digs-section-heading h4 {
        color: var(--text-primary);
        font-size: 0.9rem;
        font-weight: 750;
        letter-spacing: 0.015em;
    }

.digs-section-update {
    order: 2;
    cursor: help;
    color: var(--text-muted);
    font-size: 0.7rem;
    margin-left: 0.5rem;
    white-space: nowrap;
}

.digs-alert-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.25rem 0.55rem;
    color: var(--danger-600);
    background: color-mix(in srgb, var(--danger-500) 11%, white);
    border-radius: var(--radius-badge);
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.06em;
}

    .digs-alert-badge::before {
        width: 0.35rem;
        height: 0.35rem;
        content: "";
        background: currentColor;
        border-radius: 50%;
    }

.digs-chart-grid {
    margin-top: 1.25rem;
}

.digs-chart-card {
    overflow: hidden;
    background: var(--bg-panel);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
}

    .digs-chart-card .card-body {
        background: transparent;
    }

.digs-chart-header-row {
    gap: 0.75rem;
}

.digs-chart-sort-toggle {
    flex-shrink: 0;
    white-space: nowrap;
}

    .digs-chart-sort-toggle.is-active {
        border-color: var(--brand-500);
        color: var(--brand-500);
        background: rgba(14, 159, 178, 0.08);
    }

.digs-chart-group-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 0.65rem;
    margin-top: 0.65rem;
}

.digs-chart-group-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--text-secondary, var(--chart-muted));
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.digs-chart-group-swatch {
    width: 0.65rem;
    height: 0.65rem;
    border-radius: 999px;
    flex-shrink: 0;
}

.digs-chart-title {
    margin-bottom: 0.25rem;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 750;
    letter-spacing: -0.01em;
}

.digs-chart-subtitle {
    margin-bottom: 0;
    color: var(--text-muted);
    font-size: 0.78rem;
}

.digs-chart-container {
    position: relative;
    width: 100%;
    height: 320px;
}

    .digs-chart-container.digs-chart-container-tall {
        height: 450px;
    }

.digs-chart-scroll {
    max-height: min(70vh, 560px);
    overflow-x: hidden;
    overflow-y: auto;
}

.digs-chart-scroll-host {
    position: relative;
    width: 100%;
    min-height: 240px;
}

.doctors-page .doctors-preview-workspace {
    grid-template-columns: minmax(0, 1.2fr) minmax(320px, 2fr);
}

.doctors-page .doctors-preview-ranking .card-body,
.doctors-page .doctors-preview-detail .card-body {
    padding: 0.85rem 1.15rem 1.1rem;
}

.doctors-page .kpi-value,
.doctors-page .doctors-preview-detail-kpis strong,
.doctors-page .table td.doctors-money {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.doctors-ranking-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem 0.75rem;
    padding: 0.75rem 1.15rem;
    border-bottom: 1px solid var(--border-subtle);
    background: color-mix(in srgb, var(--brand-soft, #e8f6f8) 22%, var(--bg-card, #fff));
}

.doctors-ranking-search {
    width: min(240px, 100%);
    flex: 1 1 180px;
}

.doctors-ranking-topn {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.doctors-ranking-visible-count {
    margin-left: auto;
    white-space: nowrap;
}

.doctors-out-of-view {
    margin-bottom: 0.75rem;
    padding: 0.55rem 0.75rem;
    font-size: 0.8rem;
}

.doctors-empty-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
}

.doctors-detail-table-wrapper {
    max-height: none;
    overflow: visible;
}

.doctors-treatment-cell {
    max-width: 14rem;
}

.doctors-treatment-truncate {
    max-width: 14rem;
    vertical-align: bottom;
}

.doctors-tab-badge {
    margin-left: 0.25rem;
    font-weight: 650;
}

@media (max-width: 991.98px) {
    .doctors-ranking-visible-count {
        margin-left: 0;
        width: 100%;
    }

    .doctors-ranking-search {
        width: 100%;
        flex: 1 1 100%;
    }
}

.digs-chart-container-centered {
    display: flex;
    height: 350px;
    justify-content: center;
}

.treatment-distribution-chart-host {
    position: relative;
}

.treatment-others-popover {
    position: absolute;
    top: 3.25rem;
    right: 1rem;
    z-index: 20;
    display: flex;
    flex-direction: column;
    width: min(320px, calc(100% - 2rem));
    max-height: 280px;
    overflow: hidden;
    border: 1px solid rgba(16, 37, 50, 0.12);
    border-radius: 10px;
    background: #ffffff;
    box-shadow: 0 12px 28px rgba(16, 37, 50, 0.16);
}

    .treatment-others-popover[hidden] {
        display: none !important;
    }

.treatment-others-popover-header {
    position: relative;
    flex: 0 0 auto;
    padding: 0.75rem 2.25rem 0.65rem 0.85rem;
    border-bottom: 1px solid rgba(16, 37, 50, 0.08);
}

.treatment-others-popover-title {
    color: var(--text-primary, #102532);
    font-size: 0.85rem;
    font-weight: 700;
}

.treatment-others-popover-subtitle {
    margin-top: 0.15rem;
    color: var(--text-muted, #5f7280);
    font-size: 0.75rem;
}

.treatment-others-popover-close {
    position: absolute;
    top: 0.45rem;
    right: 0.45rem;
    width: 1.75rem;
    height: 1.75rem;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--text-muted, #5f7280);
    font-size: 0.85rem;
    line-height: 1;
    cursor: pointer;
}

    .treatment-others-popover-close:hover {
        background: rgba(16, 37, 50, 0.06);
        color: var(--text-primary, #102532);
    }

.treatment-others-popover-list {
    flex: 1 1 auto;
    margin: 0;
    padding: 0.35rem 0;
    overflow-y: auto;
    list-style: none;
}

.treatment-others-popover-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.4rem 0.85rem;
}

    .treatment-others-popover-item:nth-child(even) {
        background: rgba(14, 159, 178, 0.04);
    }

.treatment-others-popover-name {
    color: var(--text-primary, #102532);
    font-size: 0.78rem;
    line-height: 1.35;
}

.treatment-others-popover-meta {
    flex: 0 0 auto;
    color: var(--text-muted, #5f7280);
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

@media (max-width: 767.98px) {
    .digs-page-shell {
        padding-right: 0.75rem;
        padding-left: 0.75rem;
    }

    .digs-section-heading {
        flex-wrap: wrap;
    }

        .digs-section-heading::after {
            display: none;
        }

    .digs-section-update {
        width: 100%;
    }

    .digs-chart-container,
    .digs-chart-container.digs-chart-container-tall {
        height: 280px;
    }
}

/* —— Doctors preview (vista estática de prueba) —— */
.doctors-preview-heading {
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    gap: 1rem;
}

.doctors-preview-title-icon {
    display: inline-grid;
    place-items: center;
    width: 2.15rem;
    height: 2.15rem;
    border-radius: 0.75rem;
    color: var(--brand-500, #1f8f9a);
    background: color-mix(in srgb, var(--brand-400) 16%, white);
}

.doctors-preview-freshness,
.doctors-preview-demo-chip,
.doctors-preview-count {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    color: var(--text-muted);
    background: var(--surface-50);
    border: 1px solid var(--border-subtle);
    font-size: 0.76rem;
    font-weight: 650;
    white-space: nowrap;
}

.doctors-preview-filter-card,
.doctors-preview-ranking,
.doctors-preview-detail {
    border-color: var(--border-subtle);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
}

.doctors-preview-filter-heading,
.doctors-preview-card-heading,
.doctors-preview-detail-heading,
.doctors-preview-doctor-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.doctors-preview-section-title,
.doctors-preview-detail-title {
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 700;
}

.doctors-preview-filters {
    display: grid;
    grid-template-columns: minmax(220px, 1.5fr) minmax(210px, 1fr) minmax(180px, 1fr) auto;
    align-items: end;
    gap: 0.8rem;
}

.doctors-preview-filter {
    display: grid;
    gap: 0.35rem;
    margin: 0;
}

.doctors-preview-filter > span {
    color: var(--text-muted);
    font-size: 0.76rem;
    font-weight: 650;
}

.doctors-preview-apply {
    min-height: 31px;
}

.doctors-preview-workspace {
    display: grid;
    grid-template-columns: minmax(300px, 380px) minmax(0, 1fr);
    align-items: start;
    gap: 1.25rem;
}

.doctors-preview-card-heading {
    padding: 1.1rem 1.15rem;
    border-bottom: 1px solid var(--border-subtle);
}

.doctors-preview-ranking-list {
    display: grid;
}

.doctors-preview-doctor {
    display: flex;
    gap: 0.8rem;
    padding: 1rem 1.15rem;
    border-left: 3px solid transparent;
    border-bottom: 1px solid var(--border-subtle);
    background: #fff;
}

.doctors-preview-doctor:last-child {
    border-bottom: 0;
}

.doctors-preview-doctor.is-selected {
    border-left-color: var(--brand-400);
    background: color-mix(in srgb, var(--brand-400) 6%, white);
}

.doctors-preview-position {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 1.8rem;
    height: 1.8rem;
    border-radius: 50%;
    color: var(--text-primary);
    background: var(--surface-50);
    border: 1px solid var(--border-subtle);
    font-size: 0.78rem;
    font-weight: 750;
}

.doctors-preview-doctor-main {
    flex: 1 1 auto;
    min-width: 0;
}

.doctors-preview-doctor-row > div {
    display: grid;
    min-width: 0;
}

.doctors-preview-doctor-row span,
.doctors-preview-doctor-meta,
.doctors-preview-footnote {
    color: var(--text-muted);
    font-size: 0.76rem;
}

.doctors-preview-production {
    color: var(--text-primary);
    font-size: 0.88rem;
    white-space: nowrap;
}

.doctors-preview-bar {
    height: 0.32rem;
    margin: 0.65rem 0 0.45rem;
    overflow: hidden;
    border-radius: 999px;
    background: color-mix(in srgb, var(--neutral-500) 14%, white);
}

.doctors-preview-bar span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--brand-500, #1f8f9a), var(--brand-400));
}

.doctors-preview-doctor-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.4rem 0.8rem;
}

.doctors-preview-detail-heading {
    justify-content: flex-start;
}

.doctors-preview-avatar {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 3rem;
    height: 3rem;
    border-radius: 1rem;
    color: white;
    background: linear-gradient(145deg, var(--brand-500, #1f8f9a), var(--brand-400));
    font-size: 0.85rem;
    font-weight: 800;
}

.doctors-preview-detail-kpis {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
}

.doctors-preview-detail-kpis > div {
    display: grid;
    gap: 0.25rem;
    padding: 0.8rem;
    border-radius: 0.75rem;
    background: var(--surface-50);
    border: 1px solid var(--border-subtle);
}

.doctors-preview-detail-kpis span {
    color: var(--text-muted);
    font-size: 0.74rem;
}

.doctors-preview-detail-kpis strong {
    color: var(--text-primary);
    font-size: 1rem;
}

.doctors-preview-tabs {
    display: flex;
    gap: 0.35rem;
    border-bottom: 1px solid var(--border-subtle);
}

.doctors-preview-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.65rem 0.85rem;
    color: var(--text-muted);
    background: transparent;
    border: 0;
    border-bottom: 2px solid transparent;
    font-size: 0.84rem;
    font-weight: 700;
}

.doctors-preview-tab span {
    display: inline-grid;
    place-items: center;
    min-width: 1.35rem;
    height: 1.35rem;
    padding: 0 0.3rem;
    border-radius: 999px;
    background: var(--surface-50);
    font-size: 0.7rem;
}

.doctors-preview-tab.is-active {
    color: var(--brand-500, #1f8f9a);
    border-bottom-color: var(--brand-400);
}

.doctors-preview-tab:focus-visible {
    outline: 2px solid var(--brand-400);
    outline-offset: 2px;
}

.doctors-preview-panel {
    padding-top: 1rem;
}

.doctors-preview-table-wrapper {
    overflow-x: auto;
    border: 1px solid var(--border-subtle);
    border-radius: 0.75rem;
}

.doctors-preview-table {
    min-width: 660px;
    font-size: 0.8rem;
}

.doctors-preview-table th {
    color: var(--text-muted);
    background: var(--surface-50);
    border-top: 0;
    white-space: nowrap;
}

.doctors-preview-table td {
    vertical-align: middle;
    white-space: nowrap;
}

.doctors-preview-footnote {
    margin-top: 0.75rem;
}

@media (max-width: 1199.98px) {
    .doctors-preview-filters {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .doctors-preview-workspace {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 767.98px) {
    .doctors-preview-heading,
    .doctors-preview-filter-heading {
        align-items: stretch;
        flex-direction: column;
    }

    .doctors-preview-freshness {
        align-self: flex-start;
    }

    .doctors-preview-filters,
    .doctors-preview-detail-kpis {
        grid-template-columns: 1fr;
    }

    .doctors-preview-tab {
        flex: 1 1 50%;
        justify-content: center;
    }
}

.kpi-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-muted);
}

.kpi-value {
    font-size: 1.5rem;
    font-weight: 600;
    margin-top: 0.25rem;
    color: var(--text-primary);
}

.kpi-subtitle {
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

    .kpi-subtitle.success {
        color: var(--success-500);
    }

    .kpi-subtitle.warning {
        color: var(--warning-400);
    }

.kpi-badge {
    display: inline-block;
    background: var(--success-600);
    color: white;
    padding: 0.15rem 0.5rem;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 600;
}

.filters-bar {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.filters-bar-left {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.filters-bar-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0;
    white-space: nowrap;
}

.filters-bar .form-control,
.filters-bar .form-select {
    width: auto;
    max-width: 140px;
    font-size: 0.875rem;
}

.filters-bar label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-right: 0.5rem;
}

.table-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    overflow: hidden;
}

.table-wrapper {
    max-height: 820px;
    overflow-y: auto;
}

.disparities-table-card {
    position: relative;
    border-color: color-mix(in srgb, var(--brand-500) 16%, var(--border-subtle));
    box-shadow: 0 12px 32px rgba(26, 62, 78, 0.1);
}

    .disparities-table-card::before {
        position: absolute;
        top: 0;
        right: 0;
        left: 0;
        z-index: 6;
        height: 3px;
        background: linear-gradient(90deg, var(--brand-500), var(--brand-400));
        content: "";
    }

.disparities-table-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.25rem 0.9rem;
    background: var(--bg-card);
}

.disparities-table-card-title {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.disparities-table-card-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    flex: 0 0 2.5rem;
    border: 1px solid color-mix(in srgb, var(--brand-500) 18%, transparent);
    border-radius: 10px;
    color: var(--brand-600);
    background: var(--brand-soft);
}

.disparities-table-card-title h3 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.disparities-table-card-title p {
    margin: 0.18rem 0 0;
    color: var(--text-muted);
    font-size: 0.76rem;
}

.disparities-toolbar {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.9rem 1.25rem 1.1rem;
    background: linear-gradient(180deg, var(--bg-card) 0%, color-mix(in srgb, var(--brand-soft) 18%, var(--bg-card)) 100%);
    border-bottom: 1px solid var(--border-subtle);
}

.disparities-toolbar-filters,
.disparities-toolbar-actions {
    display: flex;
    align-items: flex-end;
    gap: 0.75rem;
}

.disparities-filter {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    min-width: 150px;
}

.disparities-filter-label {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

    .disparities-filter-label .fa-info-circle {
        margin-left: 0.2rem;
        color: var(--brand-500) !important;
    }

.disparities-filter-hint {
    color: var(--text-muted);
    font-size: 0.68rem;
    line-height: 1;
}

.disparities-filter .form-control {
    min-height: 38px;
    border-color: var(--border-subtle);
    border-radius: 8px;
    color: var(--text-primary);
    background-color: var(--bg-card);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}

    .disparities-filter .form-control:focus,
    .disparities-search .form-control:focus {
        border-color: var(--brand-400);
        box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-500) 13%, transparent);
    }

.disparities-percentage-input .form-control {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.disparities-percentage-input .input-group-text {
    min-width: 2.25rem;
    justify-content: center;
    border-color: var(--border-subtle);
    border-radius: 0 8px 8px 0;
    color: var(--brand-700);
    background: var(--brand-soft);
    font-size: 0.75rem;
    font-weight: 700;
}

.disparities-search {
    position: relative;
    width: min(310px, 30vw);
}

.disparities-search-icon {
    position: absolute;
    top: 50%;
    left: 0.75rem;
    z-index: 1;
    color: var(--text-muted);
    pointer-events: none;
    transform: translateY(-50%);
}

.disparities-search .form-control {
    min-height: 38px;
    padding-left: 2.15rem;
    border-color: var(--border-subtle);
    border-radius: 8px;
    background: var(--bg-card);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}

.disparities-export-button,
.disparities-col-action .btn-ver-detalle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    white-space: nowrap;
}

.disparities-export-button,
.digs-dt-toolbar .dt-buttons .btn,
.digs-dt-toolbar .dt-buttons .dt-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    min-height: 38px;
    padding: 0.35rem 0.9rem;
    border: 1px solid color-mix(in srgb, var(--success-500) 45%, var(--border-subtle));
    border-radius: 8px;
    color: var(--success-600);
    background: var(--bg-card);
    background-color: var(--bg-card);
    font-weight: 600;
    white-space: nowrap;
}

.disparities-export-button:hover,
.disparities-export-button:focus,
.digs-dt-toolbar .dt-buttons .btn:hover,
.digs-dt-toolbar .dt-buttons .dt-button:hover,
.digs-dt-toolbar .dt-buttons .btn:focus,
.digs-dt-toolbar .dt-buttons .dt-button:focus,
.digs-dt-toolbar .dt-buttons .btn:active,
.digs-dt-toolbar .dt-buttons .dt-button:active {
    border-color: var(--success-500) !important;
    color: #fff !important;
    background: var(--success-500) !important;
    background-color: var(--success-500) !important;
    box-shadow: 0 5px 14px rgba(22, 129, 94, 0.18);
}

.disparities-export-button:hover i,
.disparities-export-button:focus i,
.digs-dt-toolbar .dt-buttons .btn:hover i,
.digs-dt-toolbar .dt-buttons .dt-button:hover i,
.digs-dt-toolbar .dt-buttons .btn:focus i,
.digs-dt-toolbar .dt-buttons .dt-button:focus i,
.digs-dt-toolbar .dt-buttons .btn:hover .text-success,
.digs-dt-toolbar .dt-buttons .dt-button:hover .text-success,
.digs-dt-toolbar .dt-buttons .btn:focus .text-success,
.digs-dt-toolbar .dt-buttons .dt-button:focus .text-success {
    color: #fff !important;
}

.digs-dt-toolbar .dt-buttons .btn i,
.digs-dt-toolbar .dt-buttons .dt-button i {
    color: inherit;
}

.disparities-table-wrapper {
    max-height: min(70vh, 820px);
    overflow: auto;
    scrollbar-gutter: stable;
}

    .disparities-table-wrapper:focus-visible {
        outline: 2px solid var(--brand-500);
        outline-offset: -2px;
    }

/* --- DataTables DIGS (estilo canónico; Disparidades como alias) --- */
.digs-datatable,
.disparities-table {
    border-collapse: separate;
    border-spacing: 0;
    width: max-content;
    min-width: 100%;
    color: var(--text-primary);
}

.digs-datatable > thead > tr > th,
.disparities-table > thead > tr:last-child > th {
    padding-top: 0.72rem;
    padding-bottom: 0.72rem;
    color: var(--text-muted);
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-strong);
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.digs-datatable thead th,
.digs-datatable tbody td,
.disparities-table thead th,
.disparities-table tbody td {
    border-right: 1px solid color-mix(in srgb, var(--border-subtle) 70%, transparent);
}

.digs-datatable thead th:last-child,
.digs-datatable tbody td:last-child,
.disparities-table thead th:last-child,
.disparities-table tbody td:last-child {
    border-right: 0;
}

.digs-datatable tbody td,
.disparities-table tbody td {
    padding-top: 0.82rem;
    padding-bottom: 0.82rem;
    background: var(--bg-card);
    border-bottom-color: color-mix(in srgb, var(--border-subtle) 76%, transparent);
    font-size: 0.82rem;
    font-variant-numeric: tabular-nums;
    transition: background-color 0.16s ease;
}

.digs-datatable tbody tr:nth-child(even) td,
.disparities-table tbody tr:nth-child(even) td {
    background: color-mix(in srgb, var(--brand-soft) 13%, var(--bg-card));
}

.digs-datatable tbody tr:hover td,
.disparities-table tbody tr:hover td {
    background: color-mix(in srgb, var(--brand-soft) 70%, var(--bg-card));
}

.digs-dt-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
    margin-bottom: 0.75rem;
}

.digs-dt-toolbar .digs-dt-buttons,
.digs-dt-toolbar .digs-dt-filter {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.digs-dt-toolbar .dataTables_filter label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 600;
}

.digs-dt-toolbar .dataTables_filter input {
    min-height: 34px;
    margin-left: 0.35rem !important;
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    color: var(--text-primary);
    background-color: var(--bg-card);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}

.digs-dt-toolbar .dataTables_filter input:focus {
    border-color: var(--brand-400);
    outline: 0;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-500) 13%, transparent);
}

.digs-datatable-footer,
.disparities-table-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: 56px;
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--border-subtle);
    background: color-mix(in srgb, var(--brand-soft) 14%, var(--bg-card));
}

.digs-datatable-footer .dataTables_info,
.digs-datatable-footer .digs-datatable-summary,
.disparities-table-footer .dataTables_info,
.disparities-table-footer .disparities-table-summary {
    padding-top: 0;
    color: var(--text-muted);
    font-size: 0.78rem;
}

.digs-datatable-footer .dataTables_length,
.digs-datatable-footer .digs-datatable-length {
    padding-top: 0;
    color: var(--text-muted);
    font-size: 0.78rem;
}

.digs-datatable-footer .dataTables_paginate,
.digs-datatable-footer .digs-datatable-pagination,
.disparities-table-footer .dataTables_paginate,
.disparities-table-footer .disparities-table-pagination {
    padding-top: 0;
}

.digs-datatable-footer .pagination,
.disparities-table-footer .pagination {
    margin-bottom: 0;
}

.doctors-detail-table-wrapper .dataTables_wrapper .digs-dt-toolbar,
.doctors-detail-table-wrapper .dataTables_wrapper .digs-datatable-footer {
    margin-left: 0;
    margin-right: 0;
}

    .disparities-table thead tr.disparities-thead-tier1 th {
        height: 38px;
        padding-top: 0.5rem;
        padding-bottom: 0.5rem;
        vertical-align: middle;
        color: var(--brand-700);
        background: color-mix(in srgb, var(--brand-soft) 58%, var(--bg-card));
        border-bottom: 1px solid color-mix(in srgb, var(--brand-500) 18%, var(--border-subtle));
        font-size: 0.68rem;
        font-weight: 700;
        letter-spacing: 0.06em;
        text-transform: none;
    }

    .disparities-table .disparities-column-group {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 0.42rem;
    }

        .disparities-table .disparities-column-group i {
            color: var(--brand-500);
            font-size: 0.68rem;
        }

    .disparities-table thead tr:nth-child(2) th {
        position: sticky;
        top: 0;
        z-index: 4;
    }

    .disparities-table .disparities-col-dcn {
        width: 6rem;
        white-space: nowrap;
    }

    .disparities-table .disparities-col-clinic,
    .disparities-table .disparities-col-patient {
        min-width: 10rem;
    }

    .disparities-table .disparities-col-amount,
    .disparities-table .disparities-col-difference {
        min-width: 9rem;
        white-space: nowrap;
    }

    .disparities-table .disparities-col-date {
        min-width: 10rem;
        white-space: nowrap;
    }

    .disparities-table .disparities-col-note {
        min-width: 12rem;
    }

.disparities-cell-text {
    display: block;
    max-width: 18rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.disparity-detail-clamp {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 14rem;
    line-height: 1.35;
    word-break: break-word;
}

.disparity-guidance {
    --guidance-bg: #f8fafc;
    --guidance-border: #e2e8f0;
    --guidance-title: #1e293b;
    --guidance-icon: #64748b;
    --guidance-cause-fg: #334155;
    --guidance-cause-bg: #e2e8f0;
    --guidance-instruction: #374151;
    --guidance-link: #2563eb;
    --guidance-calc-bg: #ffffff;
    --guidance-calc-fg: #111827;
    --guidance-bullet: #64748b;
    --guidance-amount: #64748b;
    --guidance-system-fg: #1d4ed8;
    --guidance-system-bg: #dbeafe;
    --guidance-system-border: #93c5fd;
    background: var(--guidance-bg);
    border: 1px solid var(--guidance-border);
    border-radius: 10px;
    padding: 12px 16px;
}

.disparity-guidance--success {
    --guidance-title: #0f6e56;
    --guidance-icon: #1d9e75;
    --guidance-cause-fg: #0f6e56;
    --guidance-cause-bg: #e1f5ee;
    --guidance-link: #0f6e56;
    --guidance-amount: #0f6e56;
    --guidance-border: #bce4d8;
}

.disparity-guidance--warning {
    --guidance-title: #92400e;
    --guidance-icon: #d97706;
    --guidance-cause-fg: #92400e;
    --guidance-cause-bg: #fef3c7;
    --guidance-link: #b45309;
    --guidance-amount: #b45309;
    --guidance-border: #fde68a;
}

.disparity-guidance--danger {
    --guidance-title: #dc2626;
    --guidance-icon: #dc2626;
    --guidance-cause-fg: #dc2626;
    --guidance-cause-bg: #fee2e2;
    --guidance-link: #b91c1c;
    --guidance-amount: #dc2626;
    --guidance-border: #fecaca;
}

.disparity-guidance__header {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.disparity-guidance__icon {
    flex-shrink: 0;
    margin-top: 2px;
    font-size: 18px;
    color: var(--guidance-icon);
}

.disparity-guidance__title-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.disparity-guidance__title {
    font-size: 14px;
    font-weight: 600;
    color: var(--guidance-title);
    line-height: 1.3;
}

.disparity-guidance__cause {
    display: inline-flex;
    align-items: center;
    font-size: 11px;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: 20px;
    background: var(--guidance-cause-bg);
    color: var(--guidance-cause-fg);
    line-height: 1.4;
}

.disparity-guidance__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
    margin-left: 28px;
}

.disparity-guidance__chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    border-radius: 8px;
    padding: 4px 10px;
    line-height: 1.35;
    border: 1px solid transparent;
}

/* Chip primario: qué sistema corregir — es el dato más accionable */
.disparity-guidance__chip--system {
    background: var(--guidance-system-bg);
    border-color: var(--guidance-system-border);
    color: var(--guidance-system-fg);
    font-weight: 500;
}

    .disparity-guidance__chip--system strong {
        color: var(--guidance-system-fg);
        font-weight: 700;
    }

/* Chip secundario: el importe, informativo pero no la acción principal */
.disparity-guidance__chip--amount {
    background: #f1f5f9;
    border-color: #e2e8f0;
    color: #64748b;
    font-weight: 400;
}

    .disparity-guidance__chip--amount strong {
        color: var(--guidance-amount);
        font-weight: 600;
        font-variant-numeric: tabular-nums;
    }

.disparity-guidance__instruction {
    margin: 10px 0 0 28px;
    max-width: 56rem;
    font-size: 14px;
    line-height: 1.45;
    color: var(--guidance-instruction);
}

.disparity-guidance__instruction-label {
    font-weight: 700;
    color: var(--guidance-title);
    margin-right: 4px;
}

.disparity-guidance__calc {
    margin: 10px 0 0 28px;
}

    .disparity-guidance__calc > summary {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        list-style: none;
        font-size: 12px;
        font-weight: 600;
        color: var(--guidance-link);
        cursor: pointer;
        user-select: none;
        padding: 4px 10px;
        border-radius: 6px;
        background: var(--guidance-calc-bg);
        border: 1px solid var(--guidance-border);
        transition: background 0.15s ease, box-shadow 0.15s ease;
    }

        .disparity-guidance__calc > summary::-webkit-details-marker {
            display: none;
        }

        .disparity-guidance__calc > summary::before {
            content: "";
            display: inline-block;
            width: 0;
            height: 0;
            border-top: 4px solid transparent;
            border-bottom: 4px solid transparent;
            border-left: 5px solid currentColor;
            transition: transform 0.15s ease;
        }

    .disparity-guidance__calc[open] > summary::before {
        transform: rotate(90deg);
    }

    .disparity-guidance__calc > summary:hover {
        box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
    }

.disparity-guidance__calc-steps {
    margin: 8px 0 0;
    padding: 8px 12px 8px 1.25rem;
    list-style: disc;
    background: var(--guidance-calc-bg);
    border: 1px solid var(--guidance-border);
    border-radius: 8px;
    font-size: 12px;
    color: var(--guidance-calc-fg);
    font-variant-numeric: tabular-nums;
}

    .disparity-guidance__calc-steps li {
        margin-bottom: 4px;
        color: var(--guidance-bullet);
    }

        .disparity-guidance__calc-steps li:last-child {
            margin-bottom: 0;
        }

    .disparity-guidance__calc-steps code {
        background: transparent;
        color: var(--guidance-calc-fg);
        font-size: 12px;
        padding: 0;
    }

.disparity-delta {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.35rem;
    min-width: 7.2rem;
    padding: 0.28rem 0.5rem;
    border-radius: var(--radius-badge);
    font-variant-numeric: tabular-nums;
    font-size: 0.76rem;
    font-weight: 700;
}

.disparity-delta-positive {
    color: var(--warning-400);
    background: color-mix(in srgb, var(--warning-400) 11%, transparent);
}

.disparity-delta-negative {
    color: var(--danger-500);
    background: color-mix(in srgb, var(--danger-500) 10%, transparent);
}

.disparity-delta-neutral {
    color: var(--success-600);
    background: color-mix(in srgb, var(--success-500) 10%, transparent);
}


.disparities-col-action {
    position: sticky;
    right: 0;
    z-index: 2;
    min-width: 8rem;
    box-shadow: -5px 0 8px -8px rgba(15, 23, 42, 0.55);
}

.disparities-table thead .disparities-col-action,
.disparities-table thead th:last-child {
    z-index: 5;
    background: var(--bg-card);
}

.disparities-table thead tr.disparities-thead-tier1 th:last-child {
    background: color-mix(in srgb, var(--brand-soft) 58%, var(--bg-card));
}

.disparities-col-action .btn-ver-detalle {
    min-height: 32px;
    padding: 0.38rem 0.75rem;
    border: 1px solid color-mix(in srgb, var(--brand-500) 25%, transparent);
    border-radius: 8px;
    color: #fff;
    background: linear-gradient(135deg, var(--brand-500), var(--brand-600));
    box-shadow: 0 4px 10px rgba(14, 159, 178, 0.16);
    font-size: 0.75rem;
    font-weight: 700;
    transition: transform 0.16s ease, box-shadow 0.16s ease;
}

    .disparities-col-action .btn-ver-detalle:hover,
    .disparities-col-action .btn-ver-detalle:focus {
        color: #fff;
        background: linear-gradient(135deg, var(--brand-600), var(--brand-700));
        box-shadow: 0 6px 14px rgba(14, 159, 178, 0.24);
        transform: translateY(-1px);
    }

    .disparities-col-action .btn-ver-detalle:active {
        box-shadow: 0 2px 6px rgba(14, 159, 178, 0.18);
        transform: translateY(0);
}

.disparities-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    padding: 2rem 1rem;
    color: var(--text-muted);
    white-space: normal;
}

    .disparities-empty-state > i {
        margin-bottom: 0.3rem;
        color: var(--brand-500);
        font-size: 1.5rem;
    }

    .disparities-empty-state strong {
        color: var(--text-primary);
        font-size: 0.9rem;
    }

    .disparities-empty-state span {
        font-size: 0.78rem;
    }

.disparities-table-wrapper .dtr-details {
    width: 100%;
    margin: 0;
}

    .disparities-table-wrapper .dtr-details li {
        display: grid;
        grid-template-columns: minmax(8rem, 35%) 1fr;
        gap: 0.75rem;
        padding: 0.45rem 0;
    }

.disparities-table-wrapper .dtr-title {
    color: var(--text-muted);
    font-size: 0.72rem;
    text-transform: uppercase;
}

@media (max-width: 991.98px) {
    .disparities-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .disparities-toolbar-actions {
        justify-content: space-between;
    }

    .disparities-search {
        width: min(100%, 360px);
    }

    .disparities-col-action,
    .disparities-table thead .disparities-col-action,
    .disparities-table thead th:last-child {
        position: static;
        right: auto;
        z-index: auto;
        box-shadow: none;
    }
}

@media (max-width: 575.98px) {
    .disparities-table-card-header {
        padding-right: 1rem;
        padding-left: 1rem;
    }

    .disparities-table-card-title p {
        max-width: 15rem;
    }

    .disparities-toolbar {
        padding-right: 1rem;
        padding-left: 1rem;
    }

    .disparities-toolbar-filters,
    .disparities-toolbar-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .disparities-filter,
    .disparities-search,
    .disparities-export-button {
        width: 100%;
    }

    .disparities-table-footer {
        align-items: stretch;
        flex-direction: column;
        text-align: center;
    }

        .disparities-table-footer .dataTables_paginate {
            display: flex;
            justify-content: center;
        }
}

#productionTableCard .table-wrapper {
    max-height: none;
    overflow: visible;
}

.table {
    margin-bottom: 0;
}

    .table thead th {
        background: var(--bg-panel);
        border-bottom: 1px solid var(--border-strong);
        font-size: 0.65rem;
        font-weight: 600;
        letter-spacing: 0.1em;
        text-transform: uppercase;
        color: var(--text-muted);
        padding: 0.75rem 1rem;
    }

    .table tbody td {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
        vertical-align: middle;
        border-bottom: 1px solid var(--border-subtle);
    }

    .table tbody tr:hover {
        background: var(--bg-panel);
    }

.text-numeric {
    text-align: right;
}

.pagination-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--border-subtle);
    flex-wrap: wrap;
    gap: 0.5rem;
}

    .pagination-bar .pagination {
        margin: 0;
    }

    .pagination-bar .page-info {
        font-size: 0.75rem;
        color: var(--text-muted);
    }

    .pagination-bar .pagination .page-link {
        font-size: 0.75rem;
        color: var(--text-muted);
        border: none;
        background: transparent;
        padding: 0.35rem 0.6rem;
        border-radius: 6px;
    }

        .pagination-bar .pagination .page-link:hover:not(:disabled) {
            background: var(--bg-card);
            color: var(--text-primary);
        }

    .pagination-bar .pagination .page-item.active .page-link {
        border: 1px solid var(--border-subtle);
        color: var(--text-primary);
        background: transparent;
    }

    .pagination-bar .pagination .page-item.disabled .page-link {
        cursor: not-allowed;
        opacity: 0.6;
    }

.pagination-buttons {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.btn-pagination {
    color: var(--text-muted);
    border: none;
    background: transparent;
    font-size: 0.75rem;
    padding: 0.35rem 0.6rem;
    border-radius: 6px;
    transition: all 0.18s ease;
}

    .btn-pagination:hover:not(:disabled) {
        background: var(--bg-card);
        color: var(--text-primary);
    }

    .btn-pagination:disabled {
        cursor: not-allowed;
        opacity: 0.6;
    }

.btn-primary-custom {
    background: var(--brand-400);
    color: var(--surface-950);
    border: none;
}

.btn-primary-custom {
    font-weight: 600;
    border-radius: 6px;
    transition: all 0.18s ease;
}

    .btn-primary-custom:hover {
        background: var(--brand-400);
        color: var(--surface-950);
        transform: translateY(-1px);
        box-shadow: var(--shadow-glow);
    }

.btn-outline-custom {
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    background: transparent;
    border-radius: 6px;
    transition: all 0.18s ease;
}

    .btn-outline-custom:hover {
        border-color: var(--brand-500);
        color: var(--brand-400);
        background: transparent;
    }

.modal-content {
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
}

.modal-header {
    border-bottom: 1px solid var(--border-subtle);
    padding: 1rem 1.5rem;
}

.modal-body {
    padding: 1.5rem;
}

/* Modales XL: más ancho en pantallas grandes (90vw) */
@media (min-width: 1200px) {
    .modal-dialog.modal-xl {
        max-width: 90vw;
        width: 90vw;
    }
}

.nav-tabs {
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: 1rem;
}

    .nav-tabs .nav-link {
        border: none;
        color: var(--text-muted);
        padding-bottom: 0.75rem;
        margin-right: 1rem;
    }

        .nav-tabs .nav-link.active {
            color: var(--brand-500);
            font-weight: 600;
            border-bottom: 2px solid var(--brand-500);
        }

.section-title {
    font-weight: 600;
    margin-bottom: 0.75rem;
    font-size: 0.9375rem;
}

.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

@media (max-width: 768px) {
    .detail-grid {
        grid-template-columns: 1fr;
    }
}

/* Overlay de carga por sección */
.section-loading {
    position: relative;
}

    .section-loading.is-loading:not(.has-overlay)::before {
        content: "";
        position: absolute;
        inset: 0;
        background: rgba(0, 0, 0, 0.6);
        border-radius: inherit;
        z-index: 4;
    }

    .section-loading.is-loading:not(.has-overlay)::after {
        content: "";
        position: absolute;
        top: 50%;
        left: 50%;
        width: 2rem;
        height: 2rem;
        margin-top: -1rem;
        margin-left: -1rem;
        border-radius: 999px;
        border-width: 3px;
        border-style: solid;
        border-color: rgba(25, 26, 27, 0.8);
        border-top-color: var(--brand-500);
        animation: section-loading-spin 0.8s linear infinite;
        z-index: 5;
    }

.section-loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    border-radius: inherit;
    z-index: 6;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.section-loading-box {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(0, 0, 0, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    padding: 0.75rem 1rem;
    color: #fff;
}

    .section-loading-box .spinner-border {
        display: inline-block;
        width: 1.5rem;
        height: 1.5rem;
        vertical-align: text-bottom;
        border: 0.25em solid currentColor;
        border-right-color: transparent;
        border-radius: 50%;
        animation: spinner-border .75s linear infinite;
        color: var(--brand-500);
    }

@keyframes spinner-border {
    to {
        transform: rotate(360deg);
    }
}

.section-loading-text {
    color: #fff;
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
}

@keyframes section-loading-spin {
    to {
        transform: rotate(360deg);
    }
}

.clinic-selection-empty {
    width: 100%;
    font-size: 0.95rem;
    line-height: 1.4;
}

/* Loading overlay (estilo DIGS) */
.loading-overlay-wrap {
    position: relative;
    min-height: 0;
}

    .loading-overlay-wrap.loading-active {
        min-height: 400px;
    }

.loading-overlay {
    display: none;
    position: absolute;
    inset: 0;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.8);
    border-radius: var(--radius-lg);
    z-index: 2;
}

    .loading-overlay.active {
        display: flex;
    }

.loading-overlay-box {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 1rem 1.25rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

    .loading-overlay-box .spinner-border {
        color: var(--brand-500);
        width: 1.5rem;
        height: 1.5rem;
        border-width: 3px;
    }

.detail-table-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    padding: 1rem;
}

    .detail-table-card .idcotejo-col {
        width: 1%;
        white-space: nowrap;
        padding-left: 0.25rem;
        padding-right: 0.25rem;
    }

    .detail-table-card td.idcotejo-col.is-empty {
        padding-left: 0;
        padding-right: 0;
    }

    .detail-table-card .table {
        font-size: 0.8125rem;
    }

.badge-ok {
    background: #c6f6d5;
    color: #276749;
}

.badge-warning {
    background: #fefcbf;
    color: #975a16;
}

.kpi-card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.5rem;
}

.kpi-value-row {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    width: 100%;
    margin-top: 0.25rem;
}

    .kpi-value-row > .kpi-value {
        margin-top: 0;
        flex: 1 1 auto;
        min-width: 0;
    }

.kpi-card-has-change {
    position: relative;
}

    .kpi-card-has-change .kpi-card-header-row {
        padding-right: 3rem;
    }

        .kpi-card-has-change .kpi-card-header-row .kpi-icon {
            position: absolute;
            top: 0;
            right: 0;
        }

.kpi-change-inline {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    text-align: right;
    flex-shrink: 0;
    line-height: 1.2;
}

    .kpi-change-inline .kpi-change-percent {
        font-size: 1rem;
        line-height: 1.5rem;
    }

    .kpi-change-inline .kpi-change-label {
        display: block;
        font-size: 0.7rem;
        margin-top: 0.1rem;
    }

.kpi-change-corner {
    text-align: right;
    font-size: 0.8rem;
    line-height: 1.2;
    margin-top: 0;
    flex-shrink: 0;
}

.kpi-card-clickable {
    cursor: pointer;
}

    .kpi-card-clickable:hover {
        box-shadow: var(--shadow-card-hover);
        transform: translateY(-2px);
    }

/* Patient 360 */
.patient-filters .form-control,
.patient-filters .form-select {
    max-width: 260px;
}

.patient-filters .input-group .form-control {
    max-width: none;
}

@media (max-width: 767.98px) {
    .patient-filters .filters-bar-left {
        width: 100%;
    }

    .patient-filters .input-group,
    .patient-filters .form-select {
        max-width: 100%;
        width: 100%;
    }

    .patient-filters .filters-bar-right {
        width: 100%;
    }

        .patient-filters .filters-bar-right .btn {
            width: 100%;
        }
}

.patient-name {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.patient-meta {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin: 0.25rem 0 0;
}

.section-header {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.timeline-wrapper {
    overflow-x: auto;
    padding-bottom: 0.5rem;
}

.timeline-items {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.timeline-item {
    text-align: center;
    min-width: 100px;
}

.timeline-badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-badge);
    font-size: 0.7rem;
    font-weight: 600;
}

    .timeline-badge.badge-treatment {
        background: #e0f2fe;
        color: #0369a1;
    }

    .timeline-badge.badge-cotejo {
        background: #dbeafe;
        color: #1d4ed8;
    }

    .timeline-badge.badge-payment {
        background: #d1fae5;
        color: #047857;
    }

    .timeline-badge.badge-supply {
        background: #ffedd5;
        color: #9a3412;
    }

.timeline-item-label {
    font-size: 0.6875rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.margin-section {
    border-top: 1px solid var(--border-subtle);
    padding-top: 1rem;
    margin-top: 1rem;
}

.margin-bar {
    height: 8px;
    border-radius: 4px;
    background: var(--surface-200);
}

.margin-bar-fill {
    height: 100%;
    border-radius: 4px;
    background: linear-gradient(90deg, var(--success-500), var(--success-400));
    transition: width 0.4s ease;
}

    .margin-bar-fill.fill-warning {
        background: linear-gradient(90deg, var(--warning-400), var(--warning-400));
    }

    .margin-bar-fill.fill-danger {
        background: linear-gradient(90deg, var(--danger-500), var(--danger-400));
    }

.patient-header {
    display: flex;
    align-items: center;
    column-gap: 0.5rem;
}

.patient-status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid transparent;
    background-color: rgba(148, 163, 184, 0.08);
    color: #475569;
}

    .patient-status-badge.status-pending {
        background-color: rgba(245, 158, 11, 0.08);
        color: var(--warning-600, #b45309);
        border-color: rgba(245, 158, 11, 0.4);
    }

    .patient-status-badge.status-completed {
        background-color: rgba(16, 185, 129, 0.08);
        color: var(--success-600, #047857);
        border-color: rgba(16, 185, 129, 0.4);
    }

.modern-timeline {
    position: relative;
    padding: 2rem 0 1rem 0;
    overflow-x: auto;
    white-space: nowrap;
    display: flex;
    align-items: flex-start;
    gap: 2rem;
    min-height: 200px;
}

    .modern-timeline::before {
        content: '';
        position: absolute;
        top: 4.5rem;
        left: 0;
        right: 0;
        height: 2px;
        background: #e2e8f0;
        z-index: 1;
    }

.timeline-node {
    position: relative;
    z-index: 2;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    min-width: 160px;
    max-width: 200px;
    white-space: normal;
    text-align: center;
}

.timeline-date {
    font-size: 0.75rem;
    color: #64748b;
    margin-bottom: 0.75rem;
    font-weight: 600;
    background: #fff;
    padding: 0 0.5rem;
    border-radius: 4px;
}

.timeline-dot {
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 50%;
    background: #fff;
    border: 3px solid #3b82f6;
    margin-bottom: 1rem;
    box-shadow: 0 0 0 4px #fff, 0 2px 4px rgba(0,0,0,0.1);
}

.timeline-content {
    background: #fff;
    border-radius: 0.5rem;
    padding: 1rem;
    width: 100%;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    transition: transform 0.2s, box-shadow 0.2s;
}

    .timeline-content:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    }

.timeline-type {
    font-size: 0.7rem;
    text-transform: uppercase;
    font-weight: 700;
    margin-bottom: 0.5rem;
    padding: 0.2rem 0.5rem;
    border-radius: 1rem;
    display: inline-block;
    letter-spacing: 0.05em;
}

.timeline-desc {
    font-size: 0.8125rem;
    color: #334155;
    margin-bottom: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.5rem;
}

.timeline-amount {
    font-size: 0.875rem;
    font-weight: 700;
    color: #0f172a;
    padding-top: 0.5rem;
    border-top: 1px dashed #e2e8f0;
}

.type-treatment .timeline-dot {
    border-color: #0ea5e9;
}

.type-treatment .timeline-type {
    background: #e0f2fe;
    color: #0369a1;
}

.type-cotejo .timeline-dot {
    border-color: #8b5cf6;
}

.type-cotejo .timeline-type {
    background: #ede9fe;
    color: #5b21b6;
}

.type-payment .timeline-dot {
    border-color: #10b981;
}

.type-payment .timeline-type {
    background: #d1fae5;
    color: #047857;
}

.type-refund .timeline-dot {
    border-color: #ef4444;
}

.type-refund .timeline-type {
    background: #fee2e2;
    color: #b91c1c;
}

.type-supply .timeline-dot {
    border-color: #f59e0b;
}

.type-supply .timeline-type {
    background: #fef3c7;
    color: #b45309;
}

.modern-timeline::-webkit-scrollbar {
    height: 8px;
}

.modern-timeline::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
    margin: 0 1rem;
}

.modern-timeline::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

    .modern-timeline::-webkit-scrollbar-thumb:hover {
        background: #94a3b8;
    }

.bg-danger-subtle {
    background-color: #ffa7a7; /* Light red background for black text */
}

.bg-info-subtle {
    background-color: #acd7ff; /* Light blue background for black text */
}

.bg-warning-subtle {
    background-color: #ffeea9; /* Light yellow background for black text */
}

.bg-success-subtle {
    background-color: #b6ffdf; /* Light green background for black text */
}

.bootstrap-select .dropdown-menu.inner > li.selected > a {
    background: #ddf4ff;
}

    .bootstrap-select .dropdown-menu.inner > li.selected > a span.check-mark {
        color: #047857;
    }

body.auth-page {
    min-height: 100vh;
    margin: 0;
    padding: 32px;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 52%, var(--AuthBackground) 52%, #e9eef3 100%);
    color: var(--AuthText);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: "Segoe UI", Roboto, Arial, sans-serif;
}

.auth-shell {
    width: min(1080px, 100%);
    min-height: 620px;
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    overflow: hidden;
    border: 2px solid rgba(82, 82, 82, 0.8);
    border-radius: 22px;
    box-shadow: var(--AuthShadow);
}

.auth-brand-panel {
    position: relative;
    padding: 56px;
    color: #ffffff;
    background: radial-gradient(circle at 20% 20%, rgba(28, 54, 90, 0.5), transparent 28%), linear-gradient(135deg, #0f172a 0%, var(--AuthPrimary) 100%);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

    .auth-brand-panel::after {
        position: absolute;
        inset: 0;
        content: "";
        pointer-events: none;
        background-image: linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
        background-size: 34px 34px;
        mask-image: linear-gradient(135deg, rgba(0, 0, 0, 0.9), rgba(0, 0, 0, 0.15));
    }

.auth-brand-content {
    position: relative;
    z-index: 1;
}

.auth-brand-title {
    margin: 0;
    font-size: 42px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: 0.04em;
}

.auth-brand-subtitle {
    max-width: 460px;
    margin: 14px 0 0;
    color: rgba(255, 255, 255, 0.82);
    font-size: 17px;
    line-height: 1.6;
}

.auth-highlights {
    margin-top: 42px;
    display: grid;
    gap: 16px;
}

.auth-highlight {
    color: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
}

.auth-highlight-icon {
    width: 34px;
    height: 34px;
    min-width: 34px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-panel {
    padding: 56px;
    background: var(--AuthSurface);
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-container {
    width: 100%;
    max-width: 420px;
}

.auth-header {
    margin-bottom: 32px;
}

.auth-title {
    margin: 0;
    color: var(--AuthText);
    font-size: 26px;
    font-weight: 750;
    letter-spacing: -0.02em;
}

.auth-description {
    margin: 10px 0 0;
    color: var(--AuthMuted);
    font-size: 14px;
    line-height: 1.55;
}

.auth-form .form-label {
    margin-bottom: 8px;
    color: #263244;
    font-size: 13px;
    font-weight: 650;
}

.auth-form .input-group-text {
    min-width: 46px;
    border-color: var(--AuthBorder);
    border-right: 0;
    border-radius: 10px 0 0 10px;
    background: #ffffff;
    color: #64748b;
    justify-content: center;
}

.auth-form .form-control {
    height: 48px;
    border-color: var(--AuthBorder);
    border-radius: 0 10px 10px 0;
    color: var(--AuthText);
    font-size: 14px;
    transition: border-color 160ms ease, box-shadow 160ms ease;
}

    .auth-form .form-control:focus {
        border-color: var(--AuthPrimary);
        box-shadow: 0 0 0 4px rgba(30, 58, 95, 0.12);
    }

.auth-form .input-group:focus-within .input-group-text {
    border-color: var(--AuthPrimary);
    color: var(--AuthPrimary);
}

.auth-form .password-control {
    border-radius: 0;
}

.password-toggle {
    width: 46px;
    border: 1px solid var(--AuthBorder);
    border-left: 0;
    border-radius: 0 10px 10px 0;
    background: #ffffff;
    color: #64748b;
    transition: background 160ms ease, color 160ms ease;
}

    .password-toggle:hover,
    .password-toggle:focus {
        background: #f1f5f9;
        color: var(--AuthPrimary);
    }

.btn-login {
    height: 48px;
    border: 0;
    border-radius: 10px;
    background: var(--AuthPrimary);
    box-shadow: 0 14px 24px rgba(30, 58, 95, 0.22);
    color: #ffffff;
    font-size: 14px;
    font-weight: 750;
    transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

    .btn-login:hover,
    .btn-login:focus {
        background: var(--AuthPrimaryDark);
        box-shadow: 0 16px 28px rgba(30, 58, 95, 0.25);
        color: #ffffff;
        transform: translateY(-1px);
    }

.auth-alert {
    border: 0;
    border-radius: 10px;
    font-size: 13px;
}

    .auth-alert:empty {
        display: none;
    }

.two-factor-setup {
    display: grid;
    gap: 24px;
}

.two-factor-step {
    padding: 20px;
    border: 1px solid var(--AuthBorder);
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
}

.two-factor-step-heading {
    margin-bottom: 18px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.two-factor-step-number {
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    border-radius: 50%;
    background: var(--AuthPrimary);
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 750;
}

.two-factor-step-title {
    margin: 2px 0 4px;
    color: var(--AuthText);
    font-size: 16px;
    font-weight: 750;
}

.two-factor-step-description {
    margin: 0;
    color: var(--AuthMuted);
    font-size: 13px;
    line-height: 1.5;
}

.two-factor-qr {
    margin: 22px 0 26px;
    text-align: center;
}

    .two-factor-qr img {
        max-width: 100%;
        height: auto;
        padding: 8px;
        border: 1px solid var(--AuthBorder);
        border-radius: 12px;
        background: #ffffff;
    }

.two-factor-manual {
    border-top: 1px solid var(--AuthBorder);
    padding-top: 14px;
}

.two-factor-manual-toggle {
    padding: 0;
    color: var(--AuthPrimary);
    font-size: 13px;
    font-weight: 650;
    text-align: left;
}

.two-factor-manual-panel {
    margin-top: 14px;
    padding: 14px;
    border-radius: 10px;
    background: #f8fafc;
}

.auth-form .two-factor-manual-key {
    border-radius: 0;
    background: #ffffff;
    letter-spacing: 0.04em;
}

.two-factor-copy-button {
    border-color: var(--AuthBorder);
    border-radius: 0 10px 10px 0;
    font-size: 13px;
    font-weight: 650;
}

.two-factor-security-note {
    color: #854d0e;
    font-size: 12px;
    line-height: 1.45;
}

.two-factor-copy-status {
    min-height: 18px;
    margin-top: 6px;
    color: #166534;
    font-size: 12px;
    font-weight: 650;
}

.two-factor-code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 17px !important;
    letter-spacing: 0.18em;
}

.btn-login:disabled {
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}

@media (max-width: 900px) {
    body.auth-page {
        padding: 20px;
        background: var(--AuthBackground);
    }

    .auth-shell {
        min-height: auto;
        grid-template-columns: 1fr;
        border-radius: 18px;
    }

    .auth-brand-panel {
        display: none;
    }

    .auth-panel {
        padding: 36px 28px;
    }
}

@media (max-width: 480px) {
    body.auth-page {
        padding: 14px;
    }

    .auth-panel {
        padding: 30px 22px;
    }

    .auth-title {
        font-size: 23px;
    }
}

/* Summary: modal ingresos diarios (responsive móvil) */
.summary-daily-income-chart-container {
    position: relative;
    width: 100%;
    height: 320px;
}

.summary-daily-income-comparison-filters {
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    background: rgba(248, 250, 252, 0.9);
}

.summary-daily-income-comparison-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.summary-daily-income-comparison-chip {
    border: 1px solid rgba(15, 23, 42, 0.14);
    background: #fff;
    color: #334155;
}

.summary-daily-income-comparison-chip.is-active,
.summary-daily-income-comparison-chip[aria-pressed="true"] {
    border-color: #0e9fb2;
    background: rgba(14, 159, 178, 0.12);
    color: #0f766e;
    font-weight: 600;
}

.summary-daily-income-comparison-chip:disabled {
    opacity: 0.65;
}

.summary-daily-income-custom-panel {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(15, 23, 42, 0.08);
}

.summary-daily-income-comparison-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.75rem;
}

.summary-daily-income-comparison-field {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin: 0;
    min-width: 9.5rem;
}

.summary-daily-income-comparison-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.summary-daily-income-kpi-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.summary-daily-income-modal .kpi-value {
    word-break: break-word;
}

@media (max-width: 767.98px) {
    .summary-daily-income-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .summary-daily-income-kpi-cell-wide {
        grid-column: 1 / -1;
    }

    .summary-daily-income-modal .kpi-card {
        min-height: 0;
        padding: 0.75rem 0.875rem;
    }

    .summary-daily-income-modal .kpi-value {
        font-size: clamp(1rem, 4.5vw, 1.35rem);
    }

    .summary-daily-income-modal .kpi-subtitle {
        font-size: 0.8125rem;
    }
}

@media (max-width: 575.98px) {
    #summaryDetailModal.summary-daily-income-active .modal-dialog.summary-daily-income-dialog {
        max-width: 100%;
        width: 100%;
        height: 100%;
        margin: 0;
    }

        #summaryDetailModal.summary-daily-income-active .modal-dialog.summary-daily-income-dialog .modal-content {
            height: 100%;
            border: 0;
            border-radius: 0;
        }

        #summaryDetailModal.summary-daily-income-active .modal-dialog.summary-daily-income-dialog .modal-body {
            overflow-y: auto;
        }

    .summary-daily-income-chart-container {
        height: min(52vw, 280px);
        min-height: 220px;
    }

    .summary-daily-income-modal .modal-header {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
        padding: 1rem;
    }

        .summary-daily-income-modal .modal-header .summary-daily-income-close {
            align-self: flex-end;
        }

    .summary-daily-income-modal .modal-body {
        padding: 1rem;
    }

    .summary-daily-income-modal .section-title {
        font-size: 0.875rem;
    }
}

/* —— Summary goal previews (vistas estáticas de prueba) —— */
.summary-preview-banner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem 1rem;
    padding: 0.75rem 1rem;
    background: linear-gradient(145deg, #ffffff, var(--surface-50));
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
}

.summary-preview-banner-copy {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
    min-width: 0;
}

.summary-preview-banner-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.summary-preview-badge {
    background: color-mix(in srgb, var(--brand-400) 18%, white);
    color: var(--text-primary);
    border: 1px solid color-mix(in srgb, var(--brand-400) 40%, transparent);
}

.summary-preview-help {
    font-size: 0.85rem;
    max-width: 56rem;
}

.summary-preview-clinic-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.summary-preview-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    border: 1px solid var(--border-subtle);
    background: #fff;
    color: var(--text-primary);
    font-size: 0.8rem;
    font-weight: 600;
}

.summary-preview-chip.is-active {
    border-color: var(--brand-400);
    box-shadow: inset 0 0 0 1px var(--brand-400);
}

.summary-preview-chip-muted {
    color: var(--text-muted);
    font-weight: 500;
}

.summary-preview-direction {
    font-size: 0.75rem;
    font-weight: 650;
    color: var(--text-muted);
    white-space: nowrap;
}

.goal-progress {
    width: 100%;
    height: 0.45rem;
    border-radius: 999px;
    background: color-mix(in srgb, var(--neutral-500) 16%, white);
    overflow: hidden;
}

.goal-progress-fill {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--brand-500, #1f8f9a), var(--brand-400));
}

.goal-progress-fill.is-good {
    background: linear-gradient(90deg, var(--success-500, #2a9472), var(--success-400));
}

.goal-progress-fill.is-warn {
    background: linear-gradient(90deg, var(--warning-500, #d39b2a), var(--warning-400, #e0b14a));
}

.goal-progress-fill.is-bad {
    background: linear-gradient(90deg, var(--danger-600, #c0392b), var(--danger-500, #e74c3c));
}

.goal-progress-fill.is-muted {
    background: color-mix(in srgb, var(--neutral-500) 35%, white);
}

.summary-preview-bars {
    display: flex;
    align-items: flex-end;
    gap: 0.45rem;
    min-height: 180px;
    padding: 0.5rem 0.25rem 0;
}

.summary-preview-bars > span {
    flex: 1 1 0;
    height: var(--h, 50%);
    min-height: 8%;
    border-radius: 8px 8px 4px 4px;
    background: linear-gradient(180deg, var(--brand-400), color-mix(in srgb, var(--brand-400) 35%, white));
}

.summary-preview-bars-dual > span.is-alt {
    background: linear-gradient(180deg, var(--success-400), color-mix(in srgb, var(--success-400) 35%, white));
}

.summary-preview-rank li {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.65rem 0;
    border-bottom: 1px solid var(--border-subtle);
    font-size: 0.9rem;
}

.summary-preview-rank li:last-child {
    border-bottom: 0;
}

.summary-preview-rank strong {
    color: var(--text-primary);
    white-space: nowrap;
}

.summary-preview-status-composite {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.summary-preview-alert-dot {
    display: inline-block;
    flex: 0 0 auto;
    width: 0.42rem;
    height: 0.42rem;
    border-radius: 50%;
    background: var(--warning-400, #e0b14a);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--warning-400, #e0b14a) 28%, transparent);
}

.summary-preview-alert-dot.is-warn {
    background: var(--warning-400, #e0b14a);
}

.summary-preview-alert-dot.is-bad {
    background: var(--danger-500, #e74c3c);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--danger-500, #e74c3c) 28%, transparent);
}

.summary-preview-detail-table-card {
    margin-top: 0.15rem;
}

.summary-preview-detail-table-card .disparities-table-wrapper {
    max-height: min(55vh, 480px);
}

.summary-preview-detail-table-card .disparities-table {
    width: 100%;
}

.summary-preview-detail-table-card .summary-preview-cell-progress {
    margin-left: auto;
}

.summary-preview-table {
    font-size: 0.85rem;
}

.summary-preview-table th {
    white-space: nowrap;
    color: var(--text-muted);
    font-weight: 700;
    border-top: 0;
}

.summary-preview-table td {
    vertical-align: middle;
}

.summary-preview-cell-progress {
    display: grid;
    gap: 0.35rem;
    min-width: 5.5rem;
}

.summary-preview-status {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    white-space: nowrap;
}

.summary-preview-status.is-good {
    color: var(--success-600, #1f7a5c);
    background: color-mix(in srgb, var(--success-400) 18%, white);
}

.summary-preview-status.is-warn {
    color: var(--warning-600, #9a6b10);
    background: color-mix(in srgb, var(--warning-400, #e0b14a) 22%, white);
}

.summary-preview-status.is-bad {
    color: var(--danger-600);
    background: color-mix(in srgb, var(--danger-500, #e74c3c) 16%, white);
}

.summary-preview-status.is-muted {
    color: var(--text-muted);
    background: var(--surface-50);
}

.summary-preview-goals-single {
    grid-template-columns: minmax(260px, 420px);
}

.summary-preview-modal-header {
    align-items: flex-start;
    gap: 1rem;
}

.summary-preview-modal-heading {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    min-width: 0;
}

.summary-preview-back-btn {
    flex: 0 0 auto;
    margin-top: 0.1rem;
}

@media (max-width: 767.98px) {
    .summary-preview-banner {
        align-items: stretch;
    }

    .summary-preview-banner-actions {
        width: 100%;
    }

    .summary-preview-banner-actions .btn {
        flex: 1 1 auto;
        text-align: center;
    }

    .summary-preview-goals-single {
        grid-template-columns: 1fr;
    }

    .summary-preview-modal-heading {
        flex-direction: column;
        gap: 0.5rem;
    }
}

/* ---------- Configuración (acceso a clínicas por usuario) ---------- */

.configuration-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 0.9rem 1.25rem;
    background: linear-gradient(180deg, var(--bg-card) 0%, color-mix(in srgb, var(--brand-soft) 18%, var(--bg-card)) 100%);
    border-bottom: 1px solid var(--border-subtle);
}

.configuration-toolbar-info {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.configuration-search {
    position: relative;
    min-width: 260px;
}

    .configuration-search .form-control {
        padding-left: 2rem;
    }

.configuration-search-icon {
    position: absolute;
    top: 50%;
    left: 0.65rem;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.8rem;
    pointer-events: none;
}

.configuration-combobox-results {
    position: absolute;
    z-index: 1060;
    width: 100%;
    max-height: 220px;
    overflow-y: auto;
    box-shadow: var(--shadow-card);
}

.configuration-clinic-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.25rem;
    max-height: 260px;
    overflow-y: auto;
    padding: 0.5rem 0.25rem;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
}

.configuration-clinic-item {
    flex: 0 0 auto;
    min-width: 160px;
}

.configuration-clinic-chip {
    font-weight: 600;
    margin: 0.1rem;
}
}
