:root {
    --hiro-blue: #244fe6;
    --hiro-navy: #001fd6;
    --hiro-ink: #182b45;
    --hiro-muted: #526073;
    --hiro-line: #e9eef5;
    --hiro-bg: #f6f7fb;
    --hiro-soft: #f0f5ff;
    --hiro-green: #098573;
    --hiro-shadow-sm: 0 8px 24px rgba(11, 31, 99, 0.08);
    --hiro-shadow-md: 0 16px 42px rgba(11, 31, 99, 0.13);
    --hiro-shadow-lg: 0 30px 90px rgba(0, 0, 0, 0.26);
    --hiro-motion: 180ms cubic-bezier(0.2, 0.8, 0.2, 1);
    --hiro-motion-slow: 320ms cubic-bezier(0.16, 1, 0.3, 1);
}
body {
    background: #f6f7fb;
}

@keyframes hiroFadeUp {
    from {
        opacity: 0;
        transform: translate3d(0, 12px, 0) scale(0.99);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0) scale(1);
    }
}

@keyframes hiroModalIn {
    from {
        opacity: 0;
        transform: translate3d(0, 18px, 0) scale(0.975);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0) scale(1);
    }
}

.sidebar {
    background: #244fe6 !important;
    box-shadow: none !important;
}

.main-content {
    background: #f6f7fb;
    transition: background-color var(--hiro-motion);
}

.header {
    background: transparent;
    border: 0;
    border-radius: 0;
    margin-bottom: 14px;
    padding: 0;
    transition: border-color var(--hiro-motion), box-shadow var(--hiro-motion);
}

.header h2 {
    color: #001fd6;
    font-size: 1.45rem;
    font-weight: 600;
}

.btn-cms,
.primary-action {
    background: var(--hiro-blue);
    border-radius: 7px;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    padding: 7px 13px;
    text-decoration: none;
    transition: background-color var(--hiro-motion), box-shadow var(--hiro-motion), transform var(--hiro-motion);
}

.btn-cms {
    background: #001fd6;
}

.btn-cms:hover,
.primary-action:hover {
    box-shadow: 0 10px 22px rgba(0, 31, 214, 0.22);
    transform: translateY(-1px);
}

.user-profile {
    border: 1px solid #e9edf6;
    box-shadow: 0 4px 14px rgba(10, 31, 82, 0.08);
    font-size: 13px;
    padding: 7px 14px;
}

.hiro-shell {
    background: #fff;
    border: 1px solid var(--hiro-line);
    border-radius: 10px;
    color: var(--hiro-ink);
    padding: 16px 20px 24px;
    animation: hiroFadeUp var(--hiro-motion-slow) both;
}

[data-dashboard-endpoint],
[data-dashboard-section],
.detail-card {
    position: relative;
}

[data-dashboard-endpoint][aria-busy="true"]::after,
[data-dashboard-section][aria-busy="true"]::after,
.detail-card[aria-busy="true"]::after {
    align-items: center;
    background: rgba(255, 255, 255, 0.72);
    color: var(--hiro-blue);
    content: 'Loading…';
    display: flex;
    font-size: 12px;
    font-weight: 700;
    inset: 0;
    justify-content: center;
    position: absolute;
    z-index: 5;
}

[data-dashboard-endpoint][aria-busy="true"]::after {
    border-radius: 10px;
}

.hiro-filters,
.metric-row,
.dashboard-layout,
.panel-heading,
.legend,
.chips,
.detail-header,
.summary-strip,
.diagnosis-top {
    display: flex;
}

.hiro-filters {
    align-items: center;
    flex-wrap: nowrap;
    gap: 10px;
    margin-bottom: 12px;
    min-height: 36px;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: thin;
}

.filter-pill {
    align-items: center;
    background: #fff;
    border: 1px solid #ecf0f6;
    border-radius: 6px;
    color: #182b45;
    display: inline-flex;
    flex: 0 0 auto;
    font-size: 13px;
    font-weight: 600;
    gap: 8px;
    height: 25px;
    justify-content: space-between;
    min-width: 0;
    padding: 0 10px;
    transition: border-color var(--hiro-motion), box-shadow var(--hiro-motion), transform var(--hiro-motion), background-color var(--hiro-motion);
}

.filter-pill[data-filter-key="date"] {
    width: 126px;
}

.filter-pill[data-filter-key="categorie"],
.filter-pill[data-filter-key="category"] {
    width: 164px;
}

.filter-pill[data-filter-key="service"] {
    width: 166px;
}

.filter-pill[data-filter-key="countrie"],
.filter-pill[data-filter-key="country"] {
    width: 91px;
}

.filter-pill[data-filter-key="citie"],
.filter-pill[data-filter-key="city"] {
    width: 78px;
}

.filter-pill[data-filter-key="area"] {
    width: 84px;
}

.filter-pill:hover,
.filter-pill:focus-within {
    border-color: #b8c7ff;
    box-shadow: 0 8px 20px rgba(11, 57, 244, 0.08);
    transform: translateY(-1px);
}

.filter-pill input,
.filter-pill select,
.search-line input {
    background: transparent;
    border: 0;
    color: inherit;
    font: inherit;
    min-width: 0;
    outline: 0;
    text-overflow: ellipsis;
    width: 100%;
}

.filter-pill select {
    appearance: none;
    cursor: pointer;
    line-height: 1;
}

.filter-pill i {
    color: #17325d;
    flex: 0 0 auto;
    font-size: 11px;
}

.filter-pill .fa-chevron-down {
    color: #60708a;
    font-size: 9px;
}

.filter-pill:has(select option:checked[value="Select city"]),
.filter-pill:has(select option:checked[value="Select area"]) {
    background: #f6f6f6;
    border-color: transparent;
    color: #898989;
}

.filter-reset {
    align-items: center;
    background: #fff;
    border: 1px solid #ecf0f6;
    border-radius: 6px;
    color: #182b45;
    cursor: pointer;
    display: inline-flex;
    flex: 0 0 auto;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    gap: 6px;
    height: 25px;
    justify-content: center;
    padding: 0 10px;
    white-space: nowrap;
    transition: border-color var(--hiro-motion), box-shadow var(--hiro-motion), color var(--hiro-motion), background-color var(--hiro-motion);
}

.filter-reset:hover {
    background: #f8fbff;
    border-color: #b8c7ff;
    box-shadow: 0 8px 20px rgba(11, 57, 244, 0.08);
    color: #0b39f4;
}

.filter-reset i {
    font-size: 11px;
}

#dashboardFilters .filter-reset {
    border-color: #e0e6ef;
    font-size: 11px;
    font-weight: 500;
    height: 30px;
}

.source-note {
    background: #f8fbff;
    border: 1px solid var(--hiro-line);
    border-radius: 8px;
    color: var(--hiro-muted);
    font-size: 12px;
    font-weight: 600;
    margin: 0 0 12px;
    padding: 10px 12px;
    animation: hiroFadeUp var(--hiro-motion-slow) 80ms both;
}

.metric-row {
    gap: 8px;
    margin-bottom: 12px;
}

.metric-card,
.panel,
.detail-card {
    background: #fff;
    border: 1px solid var(--hiro-line);
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(11, 31, 99, 0.04);
    transition: border-color var(--hiro-motion), box-shadow var(--hiro-motion), transform var(--hiro-motion);
    will-change: transform;
}

.metric-card:hover,
.panel:hover,
.detail-card:hover {
    border-color: #c7d3f2;
    box-shadow: var(--hiro-shadow-sm);
    transform: translateY(-2px);
}

.metric-card {
    flex: 1;
    min-height: 53px;
    padding: 9px 14px;
    animation: hiroFadeUp var(--hiro-motion-slow) both;
}

.metric-row .metric-card:nth-child(2) {
    animation-delay: 35ms;
}

.metric-row .metric-card:nth-child(3) {
    animation-delay: 70ms;
}

.metric-row .metric-card:nth-child(4) {
    animation-delay: 105ms;
}

.metric-row .metric-card:nth-child(5) {
    animation-delay: 140ms;
}

.metric-card span,
.panel-heading span,
.detail-header p,
.patient-hero p,
.search-line,
.detail-table th {
    color: var(--hiro-muted);
}

.metric-card span {
    display: block;
    font-size: 11px;
}

.metric-card strong {
    color: var(--hiro-ink);
    display: block;
    font-size: 22px;
    font-weight: 500;
    line-height: 1.1;
}

.dashboard-layout {
    gap: 12px;
}

.ehr-panel {
    flex: 1 1 62%;
    padding: 16px 17px 13px;
}

.services-panel {
    flex: 1 1 38%;
}

.panel {
    padding: 14px;
    animation: hiroFadeUp var(--hiro-motion-slow) 120ms both;
}

.panel-heading {
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 11px;
}

.panel-heading.compact {
    margin-bottom: 6px;
}

.panel-heading h3,
.table-panel h3 {
    color: var(--hiro-ink);
    font-size: 17px;
    font-weight: 700;
    margin: 0 0 4px;
}

.ehr-panel .panel-heading h3 {
    font-size: 17px;
    line-height: 1.15;
    margin: 0;
}

.panel-heading a {
    color: var(--hiro-blue);
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
}

.panel-heading a.primary-action {
    color: #fff;
}

.ehr-panel .primary-action {
    border-radius: 8px;
    box-shadow: none;
    font-size: 11px;
    min-height: 28px;
    padding: 6px 14px;
}

.progress-header {
    align-items: center;
    background: #f8fafc;
    border: 1px solid #eef2f5;
    border-radius: 6px;
    color: #94a3b8;
    display: grid;
    font-size: 11px;
    font-weight: 600;
    grid-template-columns: 250px 1fr 76px;
    height: 21px;
    line-height: 1;
    padding: 0 8px;
}

.progress-header span:nth-child(2) {
    grid-column: 2 / 4;
}

.progress-list {
    max-height: 318px;
    overflow-y: auto;
    padding-right: 3px;
    scrollbar-color: #c8d5ea transparent;
    scrollbar-width: thin;
}

.progress-list::-webkit-scrollbar {
    width: 7px;
}

.progress-list::-webkit-scrollbar-track {
    background: transparent;
}

.progress-list::-webkit-scrollbar-thumb {
    background: #c8d5ea;
    border-radius: 999px;
}

.progress-row,
.stacked-row,
.bar-row {
    align-items: center;
    display: grid;
    gap: 10px;
    border-radius: 7px;
    transition: background-color var(--hiro-motion), box-shadow var(--hiro-motion), transform var(--hiro-motion), opacity var(--hiro-motion);
}

.progress-row:hover,
.stacked-row:hover,
.bar-row:hover {
    background: #f8fbff;
    box-shadow: inset 3px 0 0 rgba(11, 57, 244, 0.22);
    transform: translateX(2px);
}

.progress-row {
    border-bottom: 1px solid #e8eff7;
    grid-template-columns: 250px minmax(180px, 1fr) 48px;
    min-height: 25px;
    padding: 0 8px;
}

.progress-row strong,
.stacked-row strong,
.bar-row strong {
    font-size: 13px;
    font-weight: 600;
}

.progress-row em,
.stacked-row em,
.bar-row em {
    color: var(--hiro-ink);
    font-size: 13px;
    font-weight: 700;
    font-style: normal;
    text-align: right;
}

.track,
.stacked-track {
    background: #e0e8f2;
    border-radius: 999px;
    height: 7px;
    overflow: hidden;
}

.track span {
    background: var(--hiro-blue);
    display: block;
    height: 100%;
    transition: width var(--hiro-motion-slow);
}

.progress-row.is-green .track span {
    background: var(--hiro-green);
}

.legend {
    display: grid;
    flex-wrap: wrap;
    gap: 8px 24px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-bottom: 14px;
}

.legend span {
    color: #526073;
    font-size: 11px;
    font-weight: 500;
}

.swatch {
    border-radius: 2px;
    display: inline-block;
    height: 8px;
    margin-right: 5px;
    width: 8px;
}

.primary,
.seg.primary {
    background: var(--hiro-blue);
}

.mid,
.seg.mid {
    background: #7c9bff;
}

.soft,
.seg.soft {
    background: #afc2ff;
}

.pale,
.seg.pale {
    background: #d9e6ff;
}

.stacked-row {
    grid-template-columns: 130px 1fr 48px;
    margin: 12px 0;
}

.stacked-track {
    display: flex;
    height: 15px;
}

.seg {
    display: block;
    height: 100%;
    transition: width var(--hiro-motion-slow), opacity var(--hiro-motion);
}

.area-summary {
    background: #f7faff;
    border: 1px solid var(--hiro-line);
    border-radius: 8px;
    margin-top: 16px;
    padding: 12px;
    transition: border-color var(--hiro-motion), box-shadow var(--hiro-motion), transform var(--hiro-motion);
}

.area-summary:hover {
    border-color: #c7d3f2;
    box-shadow: var(--hiro-shadow-sm);
    transform: translateY(-1px);
}

.area-summary h4 {
    color: var(--hiro-blue);
    font-size: 13px;
    font-weight: 600;
    margin: 0 0 6px;
}

.area-summary p {
    border-bottom: 1px solid #e8eff7;
    display: flex;
    font-size: 13px;
    justify-content: space-between;
    margin: 0;
    padding: 6px 0;
}

.area-summary p:last-child {
    border-bottom: 0;
}

.diagnosis-panel,
.table-panel {
    margin-top: 12px;
}

.chips {
    flex-wrap: wrap;
    gap: 6px;
}

.chips span,
.chips button {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    color: #768498;
    font-size: 11px;
    font-weight: 500;
    padding: 4px 10px;
    cursor: pointer;
    transition: background-color var(--hiro-motion), border-color var(--hiro-motion), color var(--hiro-motion), box-shadow var(--hiro-motion), transform var(--hiro-motion);
}

.chips span:hover,
.chips button:hover {
    border-color: #b8c7ff;
    box-shadow: 0 7px 16px rgba(11, 57, 244, 0.1);
    transform: translateY(-1px);
}

.chips .active,
.chips button.active {
    background: var(--hiro-blue);
    border-color: var(--hiro-blue);
    color: #fff;
    font-weight: 600;
}

.horizontal-bars {
    max-height: 260px;
    overflow-y: auto;
    padding-right: 4px;
    scrollbar-color: #c8d5ea transparent;
    scrollbar-width: thin;
}

.horizontal-bars::-webkit-scrollbar {
    width: 7px;
}

.horizontal-bars::-webkit-scrollbar-track {
    background: transparent;
}

.horizontal-bars::-webkit-scrollbar-thumb {
    background: #c8d5ea;
    border-radius: 999px;
}

.bar-row {
    color: var(--hiro-ink);
    grid-template-columns: 190px 1fr;
    min-height: 13px;
    text-decoration: none;
}

.bar-row .track {
    background: transparent;
    border-radius: 0;
    height: 9px;
}

.bar-row .track span {
    background: var(--hiro-blue);
    border-radius: 0;
}

.table-panel table,
.detail-table {
    border-collapse: collapse;
    width: 100%;
}

.table-panel th,
.table-panel td,
.detail-table th,
.detail-table td {
    border-bottom: 1px solid #e8eff7;
    font-size: 12px;
    padding: 11px 12px;
    text-align: left;
    transition: background-color var(--hiro-motion);
}

.table-panel th,
.table-panel td {
    background: #f7faff;
    padding: 3px 10px;
}

.table-panel th,
.detail-table th {
    background: #f7faff;
    font-weight: 600;
}

.detail-stage {
    align-items: flex-start;
    background: #f7f9fd;
    display: flex;
    justify-content: center;
    margin: -20px;
    min-height: calc(100vh - 40px);
    padding: 48px 20px;
    animation: hiroFadeUp var(--hiro-motion-slow) both;
}

.detail-card {
    animation: hiroModalIn var(--hiro-motion-slow) both;
    box-shadow: var(--hiro-shadow-lg);
    padding: 22px;
}

.detail-card:hover {
    box-shadow: var(--hiro-shadow-lg);
    transform: translateY(-1px);
}

.detail-card.wide {
    max-width: 980px;
    width: min(980px, 100%);
}

.detail-header {
    align-items: center;
    border-bottom: 1px solid #e6edf6;
    gap: 14px;
    margin: -4px -4px 18px;
    padding: 0 0 18px;
}

.detail-header.slim {
    justify-content: space-between;
}

.detail-header h2,
.patient-hero h2 {
    color: var(--hiro-ink);
    font-size: 24px;
    line-height: 1;
    margin: 0 0 7px;
}

.detail-header p,
.patient-hero p {
    font-size: 12px;
    margin: 0;
}

.detail-icon {
    align-items: center;
    background: #eef3ff;
    border-radius: 8px;
    color: var(--hiro-blue);
    display: inline-flex;
    height: 44px;
    justify-content: center;
    width: 44px;
}

.close-button {
    align-items: center;
    background: #f3f6fb;
    border-radius: 8px;
    color: #7890af;
    display: inline-flex;
    height: 30px;
    justify-content: center;
    margin-left: auto;
    text-decoration: none;
    width: 30px;
    transition: background-color var(--hiro-motion), color var(--hiro-motion), transform var(--hiro-motion), box-shadow var(--hiro-motion);
}

.close-button:hover {
    background: #e8efff;
    color: var(--hiro-blue);
    box-shadow: 0 8px 18px rgba(11, 57, 244, 0.12);
    transform: rotate(90deg) scale(1.04);
}

.summary-strip {
    background: #f8fbff;
    border: 1px solid var(--hiro-line);
    border-radius: 8px;
    justify-content: space-between;
    margin-bottom: 18px;
    padding: 16px;
    transition: box-shadow var(--hiro-motion), transform var(--hiro-motion);
}

.summary-strip:hover {
    box-shadow: var(--hiro-shadow-sm);
    transform: translateY(-1px);
}

.summary-strip div {
    min-width: 0;
    text-align: center;
}

.summary-strip strong {
    color: var(--hiro-ink);
    display: block;
    font-size: 24px;
}

.summary-strip span {
    color: var(--hiro-muted);
    display: block;
    font-size: 11px;
}

.summary-strip div:last-child strong {
    color: var(--hiro-blue);
}

.search-line {
    align-items: center;
    border: 1px solid var(--hiro-line);
    border-radius: 8px;
    display: flex;
    font-size: 13px;
    gap: 10px;
    height: 42px;
    margin-bottom: 12px;
    padding: 0 14px;
    transition: border-color var(--hiro-motion), box-shadow var(--hiro-motion), transform var(--hiro-motion);
}

.search-line:hover,
.search-line:focus-within {
    border-color: #b8c7ff;
    box-shadow: 0 10px 24px rgba(11, 57, 244, 0.09);
    transform: translateY(-1px);
}

.search-line kbd,
.search-line i:last-child,
.search-line button {
    margin-left: auto;
}

.search-line button {
    align-items: center;
    background: transparent;
    border: 0;
    color: #94a3b8;
    cursor: pointer;
    display: inline-flex;
    height: 28px;
    justify-content: center;
    width: 28px;
}

.detail-table {
    border: 1px solid var(--hiro-line);
    border-radius: 8px;
    margin-top: 16px;
    overflow: hidden;
}

.detail-table tbody tr {
    transition: background-color var(--hiro-motion), box-shadow var(--hiro-motion), transform var(--hiro-motion);
}

.detail-table tbody tr:hover {
    background: #f8fbff;
    box-shadow: inset 3px 0 0 rgba(11, 57, 244, 0.22);
}

.detail-table a {
    color: var(--hiro-blue);
    font-weight: 800;
    text-decoration: none;
}

.detail-table tr.selected {
    background: #eaf0ff;
}

.status {
    border-radius: 8px;
    display: inline-flex;
    font-size: 11px;
    font-weight: 800;
    padding: 6px 10px;
}

.status.partial {
    background: #f2f5fb;
    color: #5e6d83;
}

.status.complete {
    background: #ddf7e8;
    color: #087b46;
}

.back-link {
    color: var(--hiro-blue);
    font-size: 13px;
    font-weight: 800;
    text-decoration: none;
}

.patient-hero {
    align-items: center;
    background: #f8fbff;
    border: 1px solid var(--hiro-line);
    border-radius: 8px;
    display: grid;
    grid-template-columns: 1fr 54px 150px;
    gap: 14px;
    margin-bottom: 18px;
    padding: 18px;
    transition: border-color var(--hiro-motion), box-shadow var(--hiro-motion), transform var(--hiro-motion);
}

.patient-hero:hover {
    border-color: #c7d3f2;
    box-shadow: var(--hiro-shadow-sm);
    transform: translateY(-1px);
}

.patient-hero strong {
    color: var(--hiro-blue);
    font-size: 22px;
}

.accordion-item {
    border: 1px solid var(--hiro-line);
    border-radius: 8px;
    margin-bottom: 8px;
    overflow: hidden;
    transition: border-color var(--hiro-motion), box-shadow var(--hiro-motion), transform var(--hiro-motion);
}

.accordion-item:hover {
    border-color: #c7d3f2;
    box-shadow: var(--hiro-shadow-sm);
    transform: translateY(-1px);
}

.accordion-item header {
    align-items: center;
    background: #eaf0ff;
    display: grid;
    grid-template-columns: 22px 1fr 70px 120px;
    gap: 8px;
    padding: 12px 16px;
    transition: background-color var(--hiro-motion);
}

.accordion-item header b,
.point-row span {
    color: var(--hiro-ink);
    font-size: 13px;
}

.point-row {
    align-items: center;
    border-top: 1px solid #e5ebf4;
    display: grid;
    grid-template-columns: 22px 1fr 100px 18px;
    min-height: 38px;
    padding: 0 16px;
    text-decoration: none;
    transition: background-color var(--hiro-motion), transform var(--hiro-motion);
}

.point-row:hover {
    background: #f8fbff;
    transform: translateX(2px);
}

.point-row .fa-check {
    color: #15945f;
}

.point-row em {
    color: #15945f;
    font-size: 11px;
    font-style: normal;
    text-align: right;
}

.point-row .fa-circle,
.point-row .fa-chevron-right {
    color: var(--hiro-blue);
}

.point-row:has(.fa-circle) em {
    color: var(--hiro-muted);
}

.accordion-item header {
    cursor: pointer;
}

.accordion-body {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height var(--hiro-motion-slow), opacity var(--hiro-motion);
}

.accordion-item.open .accordion-body {
    max-height: 900px;
    opacity: 1;
}

.empty-row {
    grid-template-columns: 22px 1fr 100px;
}

.empty-state {
    color: var(--hiro-muted);
    font-size: 13px;
    font-weight: 700;
    margin: 14px 0 0;
    text-align: center;
}

.compact-stage {
    padding-top: 38px;
}

.diagnoses-card {
    max-width: 700px;
    width: min(700px, 100%);
}

.diagnosis-top {
    align-items: center;
    border: 1px solid var(--hiro-line);
    border-radius: 8px;
    gap: 22px;
    margin-bottom: 16px;
    padding: 18px;
    transition: border-color var(--hiro-motion), box-shadow var(--hiro-motion), transform var(--hiro-motion);
}

.diagnosis-top:hover {
    border-color: #c7d3f2;
    box-shadow: var(--hiro-shadow-sm);
    transform: translateY(-1px);
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 1ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 1ms !important;
    }
}

.diagnosis-top > .diagnosis-visual {
    flex: 1;
    min-width: 0;
}

/* Diagnosis chart + legend, matching the patient-categories diagram. */
.diagnosis-visual {
    border: 1px solid var(--hiro-line);
    border-radius: 8px;
    padding: 18px;
}

.diagnosis-visual h3 {
    color: #14377b;
    font-size: 19px;
    margin: 0 0 20px;
}

.diagnosis-visual-body {
    align-items: center;
    display: flex;
    gap: 22px;
}

.category-pie {
    flex: none;
    overflow: visible;
    width: 42%;
}

.category-pie text {
    font: 600 11px sans-serif;
    pointer-events: none;
}

.category-pie a:focus {
    outline-offset: 2px;
}

.category-pie a:hover path,
.category-pie a:focus path {
    filter: brightness(1.12);
    stroke: #243e88;
    stroke-width: 2;
}

.diagnosis-legend {
    flex: 1;
    font-size: 12px;
    min-width: 0;
}

.diagnosis-legend-head,
.diagnosis-legend > a {
    align-items: center;
    display: grid;
    gap: 8px;
    grid-template-columns: minmax(0, 1fr) 55px 65px;
    padding: 10px 0;
    text-decoration: none;
}

.diagnosis-legend-head {
    color: #8297b6;
    font-size: 11px;
}

.diagnosis-legend > a {
    border-bottom: 1px solid #f2f4f9;
    color: #27436e;
}

.diagnosis-legend > a:hover,
.diagnosis-legend > a.is-active {
    background: #f1f5ff;
}

.diagnosis-legend > a.is-active {
    box-shadow: inset 3px 0 0 var(--hiro-blue);
}

.diagnosis-legend > a > span {
    align-items: center;
    display: flex;
    gap: 8px;
}

.diagnosis-legend i {
    border-radius: 50%;
    display: inline-block;
    flex: none;
    height: 13px;
    width: 13px;
}

.diagnosis-legend b {
    font-weight: 500;
    text-align: right;
}

.has-selection .category-pie {
    width: 25%;
}

.diagnosis-selection {
    background: #f1f6ff;
    border-radius: 9px;
    flex: 1;
    min-width: 0;
    padding: 16px;
}

.diagnosis-selection h3 {
    font-size: 18px;
    margin-bottom: 12px;
}

.diagnosis-selection h3 > span {
    background: #1649f6;
    border-radius: 4px;
    color: #fff;
    float: right;
    font-size: 10px;
    padding: 5px;
}

.diagnosis-selection > div {
    background: #fff;
    border-radius: 7px;
    display: flex;
    padding: 8px;
}

.diagnosis-selection p {
    border-right: 1px solid #edf0f5;
    flex: 1;
    font-size: 10px;
    margin: 0;
    padding: 4px 10px;
}

.diagnosis-selection strong {
    display: block;
    font-size: 12px;
    margin-top: 6px;
}

.diagnosis-selection > a {
    color: var(--hiro-blue);
    display: block;
    font-size: 11px;
    margin-top: 10px;
    text-decoration: none;
}

.chart-note {
    color: #788ba5;
    font-size: 10px;
    line-height: 1.5;
    margin: 15px 0 0;
}

.popup-help {
    background: #f0f6ff;
    border-radius: 7px;
    color: #4675c6;
    font-size: 12px;
    margin: 15px 0 0;
    padding: 15px;
}

@media (max-width: 720px) {
    .diagnosis-visual-body {
        flex-direction: column;
    }

    .category-pie,
    .has-selection .category-pie {
        max-width: 240px;
        width: 55%;
    }

    .diagnosis-legend,
    .diagnosis-selection {
        width: 100%;
    }
}

@media (max-width: 1100px) {
    .metric-row,
    .dashboard-layout,
    .summary-strip,
    .diagnosis-top {
        flex-wrap: wrap;
    }

    .metric-card {
        flex-basis: calc(50% - 8px);
    }

    .ehr-panel,
    .services-panel {
        flex-basis: 100%;
    }
}

@media (max-width: 720px) {
    .hiro-shell {
        padding: 12px;
    }

    .metric-card {
        flex-basis: 100%;
        width: 100%;
    }

    .progress-row,
    .stacked-row,
    .bar-row,
    .patient-hero,
    .accordion-item header {
        grid-template-columns: 1fr;
    }

    .detail-stage {
        margin: -15px;
        padding: 20px 10px;
    }

    .summary-strip {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .diagnosis-top {
        justify-content: center;
    }

    .detail-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
}

.metric-card { text-decoration: none; }
.main-content { min-width: 0; }
.hiro-filters { flex-wrap: wrap; overflow-x: visible; }
.metric-card:focus-visible { outline: 3px solid #6f8bff; box-shadow: var(--hiro-shadow-md); transform: translateY(-2px); }
.ehr-panel .progress-list { height: 318px; }
.dashboard-layout > .panel { min-width: 0; }
.progress-header { grid-template-columns: minmax(130px, 40%) 1fr 48px; }
.progress-row { grid-template-columns: minmax(130px, 40%) minmax(0, 1fr) 48px; }
.stacked-row { grid-template-columns: minmax(75px, 30%) minmax(0, 1fr) 48px; }
.stacked-bars { max-height: 230px; overflow-y: auto; padding-right: 8px; }
.chips a { border: 1px solid var(--hiro-line); border-radius: 999px; color: #60708a; font-size: 11px; padding: 6px 10px; text-decoration: none; }
.chips a.active { color: white; }
.other, .seg.other { background: #8a6ec8; }
.protocol-scroll { max-height: 340px; overflow: auto; }
.protocol-scroll thead { position: sticky; top: 0; }
.filter-pill[data-filter-key="country"], .filter-pill[data-filter-key="city"], .filter-pill[data-filter-key="area"] { width: 140px; }
.hiro-filters button { border: 0; cursor: pointer; flex-shrink: 0; }
@media (max-width: 720px) { .progress-row, .stacked-row { grid-template-columns: 1fr; padding: 8px; } }
.dashboard-pagination { display:flex; align-items:center; justify-content:space-between; gap:10px; padding:12px 0 0; font-size:12px; }
.dashboard-pagination a { color:var(--hiro-blue); border:1px solid var(--hiro-line); border-radius:6px; padding:6px 10px; text-decoration:none; }
.dashboard-pagination [aria-disabled] { color:var(--hiro-muted); padding:6px 10px; }
.patient-filters { flex-wrap:wrap; height:auto; padding:10px; }
.patient-filters input:not([type=hidden]) { flex:1 1 160px; width:auto; }
.patient-filters select { max-width:100%; flex:1 1 120px; border:1px solid var(--hiro-line); border-radius:6px; padding:6px; }
.patient-filters button { width:auto; padding:6px 12px; background:var(--hiro-blue); color:white; border-radius:6px; font-weight:700; }
.card-refresh{border:1px solid #dce4f0;background:#fff;border-radius:8px;padding:5px 12px;cursor:pointer;font-size:20px;color:#1745d1}.card-refresh:hover{background:#edf3ff}.scroll-sentinel{text-align:center;padding:16px;font-size:12px;color:#64748b}.scroll-sentinel a{display:block;padding:8px}.scroll-sentinel[hidden]{display:none}.table-scroll{max-height:620px;overflow:auto}.table-scroll thead{position:sticky;top:0;background:white;z-index:1}[aria-busy=true]{opacity:.65;cursor:progress}.card-error{color:#a42323;padding:12px}
.hiro-filters{display:flex;align-items:center;gap:8px;padding:14px 0;flex-wrap:nowrap}.hiro-filters .filter-pill{width:auto;min-width:100px;flex:1;border:1px solid #dce4f2;border-radius:6px;background:white;height:34px;margin:0;padding:0 10px}.hiro-filters .filter-pill select{font-size:11px;min-width:0;width:100%;padding-right:15px}.date-range-control{position:relative;flex:1.35;min-width:180px}.date-range-control>summary{display:flex;align-items:center;gap:7px;cursor:pointer;list-style:none;border:1px solid #dce4f2;border-radius:6px;padding:9px;background:white;font-size:11px;white-space:nowrap}.date-range-control summary::-webkit-details-marker{display:none}.date-range-popover{position:absolute;top:42px;left:0;z-index:20;background:white;border:1px solid #dce4f2;box-shadow:0 10px 28px #1a315622;border-radius:9px;padding:15px;display:grid;gap:12px;min-width:240px}.date-range-popover label{display:flex;justify-content:space-between;align-items:center;gap:10px;font-size:12px}.date-range-popover input{border:1px solid #dce4f2;border-radius:5px;padding:7px;font:inherit}.filter-icon-button{border:1px solid #dce4f2;background:white;color:#5a6c87;border-radius:6px;padding:5px 9px;font-size:18px;text-decoration:none;cursor:pointer}.metric-card{border:1px solid #dce4f2;box-shadow:none}.metric-card>span{font-size:11px}.metric-card>strong{font-size:26px;font-weight:500}.category-list .hiro-filters{flex-wrap:wrap;padding:12px 16px}.category-list .date-range-control{flex:1 1 200px}.category-list .filter-pill{flex:1 1 125px}@media(max-width:1100px){.hiro-filters{flex-wrap:wrap}.hiro-filters .filter-pill{flex:1 1 125px}.date-range-control{flex:1 1 200px}}

/* Diagnoses chart matches the supplied compact reference. */
.diagnosis-panel { --hiro-blue: #284df1; --hiro-ink: #182f50; --hiro-muted: #71809a; --hiro-line: #dce5f5; }
.diagnosis-panel .panel-heading { margin-bottom: 6px; align-items: center; }
.diagnosis-panel .panel-heading h3 { margin: 0; font-size: 14px; font-weight: 600; }
.diagnosis-panel .panel-heading > a { color: #71809a; font-size: 11px; font-weight: 400; }
.diagnosis-panel .chips { gap: 7px; margin-bottom: 7px; }
.diagnosis-panel .chips a { padding: 4px 9px; font-size: 10px; font-weight: 400; white-space: nowrap; }
.diagnosis-panel .chips a.active { font-weight: 600; }
.diagnosis-panel .bar-row { grid-template-columns: 18% minmax(0, 1fr); min-height: 19px; gap: 0; padding: 0; }
.diagnosis-panel .bar-row strong { font-size: 11px; font-weight: 600; padding-right: 8px; }
.diagnosis-panel .diagnosis-plot-cell { align-self: stretch; display: flex; align-items: center; margin-right: 50px; border-left: 1px solid #dce5f5; border-right: 1px solid #dce5f5; background: repeating-linear-gradient(to right, transparent 0, transparent calc(33.333% - 1px), #e5ebf6 calc(33.333% - 1px), #e5ebf6 33.333%); }
.diagnosis-panel .diagnosis-bar { height: 11px; position: relative; }
.diagnosis-panel .diagnosis-bar > span { display: block; height: 100%; background: #284df1; border-radius: 1px; }
.diagnosis-panel .diagnosis-bar em { position: absolute; left: 100%; top: 50%; transform: translateY(-50%); padding-left: 8px; font-size: 11px; font-style: normal; font-weight: 600; white-space: nowrap; }
.diagnosis-panel .diagnosis-chart-axis { margin-left: 18%; margin-right: 54px; padding-top: 6px; font-size: 10px; }
.diagnosis-panel .diagnosis-chart-axis > div { display: flex; justify-content: space-between; }
@media (max-width: 600px) {
    .diagnosis-panel .panel-heading { flex-wrap: wrap; gap: 5px; }
    .diagnosis-panel .bar-row { grid-template-columns: 32% minmax(0, 1fr); }
    .diagnosis-panel .diagnosis-chart-axis { margin-left: 32%; }
}

/* Services chart follows the supplied UI reference; data categories stay unchanged. */
.services-panel { --hiro-blue: #284df1; --hiro-ink: #182f50; --hiro-line: #dce5f5; }
.services-panel .panel-heading h3 { font-size: 16px; font-weight: 700; }
.services-panel .legend { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 20px; margin: 8px 0 14px; }
.services-panel .legend span { color: var(--hiro-ink); font-size: 11px; font-weight: 600; }
.services-panel .swatch { width: 10px; height: 10px; }
.services-panel .swatch.primary,
.services-panel .seg.primary { background-color: #284df1; }
.services-panel .mid { background: #7e98ff; }
.services-panel .soft { background: #afc0ff; }
.services-panel .pale { background: #d7e4ff; }
.services-panel .stacked-row,
.services-panel .service-chart-axis { display: grid; grid-template-columns: minmax(95px, 28%) minmax(0, 1fr) 48px; gap: 0; }
.services-panel .stacked-row { min-height: 36px; margin: 0; border-radius: 6px; padding: 0 6px; }
.services-panel .stacked-row:first-child { background: #f0f4ff; }
.services-panel .stacked-row strong,
.services-panel .stacked-row em { font-size: 13px; font-weight: 600; }
.services-panel .stacked-row strong { padding-right: 8px; }
.services-panel .stacked-row em { text-align: center; }
.services-panel .service-plot-cell { align-self: stretch; display: flex; align-items: center; border-left: 1px solid #e2eaff; border-right: 1px solid #e2eaff; background: linear-gradient(#e2eaff, #e2eaff) center / 1px 100% no-repeat; }
.services-panel .stacked-track { display: flex; height: 14px; border-radius: 0; background: transparent; overflow: hidden; }
.services-panel .service-chart-axis { padding: 9px 6px 0; margin-bottom: 12px; color: #142c50; font-size: 10px; }
.services-panel .service-chart-axis > div { display: flex; justify-content: space-between; }
.services-panel .area-summary { background: #f6f9fe; border: 1px solid #dce5f5; border-radius: 10px; padding: 10px; }
.services-panel .area-summary h4 { color: #1247f5; font-size: 14px; font-weight: 600; margin: 0 0 22px; }
.services-panel .area-summary p { border: 0; padding: 3px 0; font-size: 13px; }
@media (max-width: 480px) {
    .services-panel .stacked-row, .services-panel .service-chart-axis { grid-template-columns: minmax(85px, 28%) minmax(0, 1fr) 42px; }
}

/* Dashboard filter row follows the supplied reference. */
#dashboardFilters { display: grid; grid-template-columns: 1.35fr 1.8fr 1.8fr 1fr .85fr .9fr; gap: 8px; padding: 8px 0; overflow: visible; }
#dashboardFilters .filter-pill { width: auto; min-width: 0; height: 30px; border: 1px solid #e0e6ef; border-radius: 6px; padding: 0 10px; }
#dashboardFilters .filter-pill select { font-size: 11px; font-weight: 500; }
#dashboardFilters .date-range-control { min-width: 0; }
#dashboardFilters .date-range-control > summary { height: 30px; padding: 0 9px; font-size: 11px; font-weight: 600; }
#dashboardFilters .filter-pill[data-filter-key="city"]:has(option:checked[value=""]),
#dashboardFilters .filter-pill[data-filter-key="area"]:has(option:checked[value=""]) { background: #f6f6f6; color: #969696; border-color: #e6e6e6; }
#dashboardFilters .filter-pill[data-filter-key="city"]:has(option:checked[value=""]) select,
#dashboardFilters .filter-pill[data-filter-key="area"]:has(option:checked[value=""]) select { color: #969696; }
@media (max-width: 900px) { #dashboardFilters { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 480px) { #dashboardFilters { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
