@tailwind base;
@tailwind components;
@tailwind utilities;

@layer base {
    :root {
        --sphf-bg: #f3f5f6;
        --sphf-card: #ffffff;
        --sphf-green: #0a9a4c;
        --sphf-green-dark: #006e2d;
        --sphf-text: #1f2937;
        --sphf-muted: #9aa2ad;
        --sphf-border: #e7ecef;
    }
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--sphf-bg);
    color: var(--sphf-text);
    font-family: "Inter", "Segoe UI", Arial, sans-serif;
}

.sphf-shell {
    min-height: 100vh;
}

.sphf-header {
    height: 70px;
    background: #ffffff;
    border-bottom: 1px solid #dde3e7;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 0 18px;
    flex-wrap: nowrap;
}

.sphf-header__left,
.sphf-header__right {
    width: 100px;
    display: flex;
    align-items: center;
}

.sphf-header__left {
    gap: 10px;
}

.sphf-header__right {
    justify-content: flex-end;
    width: auto;
}

.sphf-brand-logo {
    height: 40px;
    width: auto;
    object-fit: contain;
}

.sphf-header__nav {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 30px;
    margin-left: auto;
}

.sphf-nav-link {
    color: #596476;
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.02em;
    padding: 21px 4px 16px;
    border-bottom: 2px solid transparent;
}

.sphf-nav-link.is-active {
    color: var(--sphf-green-dark);
    border-bottom-color: var(--sphf-green);
}

.sphf-profile-btn {
    height: 36px;
    width: 36px;
    border-radius: 10px;
    border: 1px solid #c8ced4;
    background: #f7f9fa;
    color: #6e7682;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.sphf-main {
    padding: 8px 10px;
}

.sphf-page {
    background: var(--sphf-bg);
    padding: 0;
}

.sphf-page-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.sphf-page-tab {
    padding: 10px 18px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid #d1d5db;
    color: #374151;
    background: #fff;
    transition: all 0.15s ease;
}

.sphf-page-tab:hover {
    background: #f0fdf4;
    border-color: var(--sphf-green);
    color: var(--sphf-green);
}

.sphf-page-tab.is-active {
    background: var(--sphf-green);
    border-color: var(--sphf-green);
    color: #fff;
}

.sphf-page__heading-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    background: #f2f4f5;
    padding: 10px 12px;
}

.sphf-page__title-wrap {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.sphf-page__title {
    margin: 0;
    font-size: 34px;
    color: #0f6d49;
    font-weight: 700;
}

.sphf-page__badge {
    background: #a4d596;
    color: #155e45;
    font-size: 11px;
    font-weight: 700;
    border-radius: 999px;
    padding: 4px 10px;
}

.sphf-export-btn {
    border: 1px solid #98d8af;
    color: #1a8f57;
    background: #f2fcf6;
    border-radius: 10px;
    padding: 11px 12px;
    font-size: 11px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-transform: uppercase;
    cursor: pointer;
}

.sphf-filter-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 50px;
    background: var(--sphf-green);
    border-radius: 6px;
    padding: 18px 12px;
    margin-bottom: 16px;
}

.sphf-filter-btn,
.sphf-reset-btn {
    border: 0;
    background: transparent;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
}

.sphf-filter-item {
    position: relative;
}

.sphf-reset-btn {
    margin-left: auto;
}

.sphf-filter-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    min-width: 230px;
    background: #fff;
    border: 1px solid #ccdad6;
    border-radius: 4px;
    box-shadow: 0 6px 16px rgba(20, 40, 35, 0.14);
    z-index: 70;
    display: none;
    overflow: hidden;
}

.sphf-filter-item.is-open .sphf-filter-dropdown {
    display: block;
}

.sphf-filter-dropdown__item {
    width: 100%;
    border: 0;
    border-bottom: 1px solid #edf2f1;
    background: #fff;
    color: #315d56;
    font-size: 13px;
    font-weight: 500;
    text-align: left;
    padding: 11px 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sphf-filter-dropdown__item:last-child {
    border-bottom: 0;
}

.sphf-filter-dropdown__item.is-active {
    background: #f0f6f4;
    color: #0f766e;
    font-weight: 700;
}

.sphf-kpi-grid {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(5, minmax(160px, 1fr));
    margin-bottom: 8px;
}

.sphf-kpi-card {
    background: var(--sphf-card);
    border: 1px solid var(--sphf-border);
    border-radius: 8px;
    padding: 10px 12px;
    min-height: 84px;
    cursor: pointer;
    transition: box-shadow 0.15s ease, transform 0.15s ease, border-color 0.15s ease;
}

.sphf-kpi-card:hover {
    border-color: #cfd8df;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
    transform: translateY(-1px);
}

.sphf-kpi-card.is-highlight {
    border-left: 3px solid #007f5f;
}

.sphf-kpi-card__label {
    margin: 0 0 7px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.03em;
    color: #8b95a3;
}

.sphf-kpi-card__value {
    margin: 0 0 6px;
    font-size: 24px;
    line-height: 1;
    font-weight: 700;
    color: #151c2a;
}

.sphf-kpi-card__value span {
    font-size: 12px;
    color: #0ea252;
    font-weight: 600;
}

.sphf-kpi-card__value span.is-alert {
    color: #d3464f;
}

.sphf-kpi-card__value span.is-warning {
    color: #f3a533;
}

.sphf-kpi-card__value span.is-dot,
.sphf-kpi-card__value span.is-good {
    color: #0ea252;
}

.sphf-kpi-card__meta {
    margin: 0;
    font-size: 10px;
    color: #a2aab7;
    font-weight: 600;
}

.sphf-card-row {
    display: grid;
    grid-template-columns: 1.3fr 0.95fr 1.15fr;
    gap: 14px;
    margin-bottom: 14px;
}

.sphf-stage-switcher {
    width: 100%;
    margin-bottom: 14px;
    background: #fff;
    border: 1px solid #e5eaef;
    border-radius: 12px;
    padding: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
}

.sphf-stage-row {
    display: block;
}

.sphf-stage-switcher__btn {
    border: 1px solid transparent;
    background: #f4f6f8;
    color: #738195;
    font-size: 11px;
    font-weight: 700;
    border-radius: 999px;
    padding: 7px 14px;
    cursor: pointer;
}

.sphf-stage-switcher__btn.is-active {
    background: #ffffff;
    border-color: #d9dfe6;
    color: #2a3647;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.sphf-card-row--bottom {
    grid-template-columns: 1fr 1fr;
}

.sphf-card {
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e5eaef;
    padding: 14px 16px 16px;
    min-height: 390px;
    display: flex;
    flex-direction: column;
}

.sphf-card--wide {
    min-height: 300px;
}

.sphf-card--alarm {
    min-height: 390px;
}

.sphf-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.sphf-card__header h3,
.sphf-heatmap h3 {
    margin: 0;
    font-size: 18px;
    letter-spacing: 0.01em;
    font-weight: 700;
    color: #202c3a;
}

.sphf-dots-btn {
    height: 24px;
    width: 24px;
    border: 0;
    background: transparent;
    color: #6f7a8b;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.sphf-chart {
    min-height: 260px;
    flex: 1;
}

.sphf-chart--line {
    min-height: 240px;
}

.sphf-chart--dashboard {
    min-height: 280px;
}

.sphf-chart--donut {
    min-height: 280px;
}

.sphf-card__legend {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin: 2px 0 6px;
    padding-right: 36px;
    font-size: 10px;
    font-weight: 700;
    color: #6f7c8d;
}

.sphf-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}

.sphf-legend-item i {
    width: 12px;
    height: 12px;
    border-radius: 999px;
    display: inline-block;
}

.sphf-legend-item i.is-green {
    background: #22c55e;
}

.sphf-legend-item i.is-orange {
    background: #f59e0b;
}

.sphf-legend-item i.is-slate {
    background: #c8ced8;
}

.sphf-legend-item i.is-red {
    background: #ef4444;
}

.sphf-legend-item i.is-blue {
    background: #4285f4;
}

.sphf-card__legend--donut {
    gap: 16px;
}

.sphf-card__legend--bars {
    margin-bottom: 8px;
}

.sphf-alarm-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
}

.sphf-alarm-item {
    position: relative;
    border-left: 3px solid #d3d7de;
    background: #fff;
    padding: 12px 12px 12px 14px;
    border-bottom: 1px solid #eef2f6;
    min-height: 86px;
}

.sphf-alarm-item.is-critical {
    border-left-color: #ef4444;
}

.sphf-alarm-item.is-high {
    border-left-color: #fb923c;
}

.sphf-alarm-item.is-medium {
    border-left-color: #facc15;
}

.sphf-alarm-item__top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 2px;
}

.sphf-alarm-item__title {
    margin: 0 0 2px;
    font-size: 14px;
    font-weight: 700;
    color: #162133;
}

.sphf-alarm-item__desc {
    margin: 0;
    font-size: 12px;
    line-height: 1.35;
    color: #7c8796;
    max-width: 92%;
}
.modal-width{
    max-width: 80rem;
}

.sphf-alarm-item__time {
    flex-shrink: 0;
    font-size: 10px;
    color: #8b95a3;
    font-weight: 600;
    margin-top: 3px;
}

.sphf-alarm-item__footer {
    margin-top: 6px;
    display: inline-flex;
    gap: 8px;
}

.sphf-alarm-item__footer span {
    font-size: 11px;
    padding: 4px 9px;
    border-radius: 6px;
    background: #f6f8fa;
    color: #6d7887;
    font-weight: 700;
}

.sphf-alarm-item__footer span.is-alert {
    background: #fee2e2;
    color: #dc2626;
}

.sphf-alarm-note {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    font-size: 12px;
    color: #8c96a4;
    padding: 12px 2px 2px;
}

.sphf-alarm-note span:first-child {
    max-width: 82%;
}

.sphf-heatmap {
    background: #fff;
    border: 1px solid #e5eaef;
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 8px;
}

.sphf-heatmap-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(120px, 1fr));
    gap: 8px;
    margin-top: 8px;
}

.sphf-heatmap-tile {
    color: #fff;
    border-radius: 4px;
    padding: 10px;
    min-height: 80px;
}

.sphf-heatmap-tile p {
    margin: 0 0 4px;
    font-size: 18px;
    font-weight: 600;
}

.sphf-heatmap-tile h4 {
    margin: 0;
    font-size: 36px;
    line-height: 1;
    font-weight: 700;
}

.sphf-heatmap-tile span {
    font-size: 10px;
    opacity: 0.86;
}

.sphf-heatmap-tile.is-green {
    background: linear-gradient(135deg, #0f3f34, #145748);
}

.sphf-heatmap-tile.is-teal {
    background: linear-gradient(135deg, #005f50, #0d7b66);
}

.sphf-heatmap-tile.is-blue {
    background: linear-gradient(135deg, #124ea8, #3274dc);
}

.sphf-heatmap-tile.is-orange {
    background: linear-gradient(135deg, #ce7500, #eb9217);
}

.sphf-heatmap-tile.is-red {
    background: linear-gradient(135deg, #a52424, #cd3e3e);
}

.sphf-table-card {
    background: #fff;
    border: 1px solid #e5eaef;
    border-radius: 8px;
    margin-bottom: 8px;
    overflow: hidden;
}

.sphf-table-card__header {
    padding: 12px 14px;
    font-size: 28px;
    font-weight: 500;
    color: #2a3342;
    border-bottom: 1px solid #edf1f5;
}

.sphf-table-hint {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    border-radius: 999px;
    background: #f6e8d6;
    color: #c2410c;
    font-size: 12px;
    font-weight: 700;
}

.sphf-table-wrap {
    overflow-x: auto;
}

.sphf-table {
    width: 100%;
    border-collapse: collapse;
}

.sphf-table thead th {
    background: #f3f5f8;
    color: #7a8698;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.04em;
    padding: 9px 10px;
    text-align: left;
}

.sphf-table tbody td {
    border-top: 1px solid #eef2f6;
    padding: 10px;
    font-size: 14px;
    color: #2b3443;
}

.sphf-table tbody tr[data-drill-row="true"] {
    cursor: pointer;
}

.sphf-table tbody tr[data-drill-row="true"]:hover {
    background: #f8fafc;
}

table.dataTable th.dt-type-numeric,
table.dataTable th.dt-type-date,
table.dataTable td.dt-type-numeric,
table.dataTable td.dt-type-date {
    text-align: left !important;
}

.sphf-table tbody td.is-critical {
    color: #dc2626;
    font-weight: 600;
}

.sphf-table tbody td.is-warning {
    color: #d97706;
    font-weight: 600;
}

.sphf-table tbody td.is-healthy {
    color: #16a34a;
    font-weight: 600;
}

.sphf-status-tag {
    display: inline-flex;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    line-height: 1.1;
}

.sphf-status-tag.is-escalated {
    background: #ef4444;
    color: #fff;
}

.sphf-status-tag.is-watch {
    background: #f59e0b;
    color: #fff;
}

.sphf-status-tag.is-healthy {
    background: #22c55e;
    color: #fff;
}

.sphf-table a {
    color: #0f172a;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
}

.sphf-ageing .sphf-page__heading-row {
    align-items: flex-start;
}

.sphf-ageing .sphf-page__title {
    font-size: 36px;
}

.sphf-ageing__subtitle {
    margin: 2px 0 0;
    color: #6f7f93;
    font-size: 14px;
}

.sphf-ageing-kpi-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(220px, 1fr));
    gap: 10px;
    margin-bottom: 10px;
}

.sphf-ageing-kpi-card {
    background: #fff;
    border: 1px solid #e6ebf0;
    border-radius: 8px;
    padding: 12px 14px;
    border-left: 4px solid #d0d5db;
    cursor: pointer;
}

.sphf-ageing-kpi-card.is-green {
    border-left-color: #22C55E;
}

.sphf-ageing-kpi-card.is-yellow {
    border-left-color: #facc15;
}

.sphf-ageing-kpi-card.is-orange {
    border-left-color: #f97316;
}

.sphf-ageing-kpi-card.is-red {
    border-left-color: #ef4444;
}

.sphf-ageing-kpi-card__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.sphf-ageing-kpi-card__top p {
    margin: 0;
    font-size: 11px;
    color: #7a8698;
    font-weight: 700;
}

.sphf-ageing-kpi-card__top span {
    font-size: 10px;
    font-weight: 700;
    color: #f97316;
}

.sphf-ageing-kpi-card h3 {
    margin: 0 0 4px;
    font-size: 40px;
    line-height: 1;
}

.sphf-ageing-kpi-card small {
    font-size: 11px;
    font-weight: 600;
}

.sphf-ageing-kpi-card small.is-down {
    color: #16a34a;
}

.sphf-ageing-kpi-card small.is-up {
    color: #ef4444;
}

.sphf-ageing-kpi-card small.is-neutral {
    color: #8c96a3;
}

.sphf-ageing-main-grid {
    display: grid;
    grid-template-columns: 1.66fr 0.82fr;
    gap: 10px;
    margin-bottom: 10px;
}

.sphf-ageing-card__sub {
    margin: -4px 0 8px;
    color: #8b97a7;
    font-size: 11px;
}

.sphf-ageing-rules {
    position: relative;
    border-top: 4px solid #0f766e;
    padding-top: 16px;
}

.sphf-ageing-rules .sphf-card__header {
    margin-bottom: 14px;
}

.sphf-ageing-rule-list {
    display: flex;
    flex-direction: column;
    gap: 23px;
    flex: 1;
}

.sphf-ageing-rule-item {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sphf-ageing-rule-item__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.sphf-ageing-rule-item__title {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    font-weight: 700;
    color: #273444;
}

.sphf-ageing-rule-item__icon {
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 18px;
}

.sphf-ageing-rule-item__icon svg {
    width: 18px;
    height: 18px;
    display: block;
}

.sphf-ageing-rule-item__icon.is-green {
    color: #22c55e;
}

.sphf-ageing-rule-item__icon.is-yellow {
    color: #facc15;
}

.sphf-ageing-rule-item__icon.is-orange {
    color: #f97316;
}

.sphf-ageing-rule-item__icon.is-red {
    color: #ef4444;
}

.sphf-ageing-rule-item__badge {
    flex-shrink: 0;
    font-size: 10px;
    font-weight: 700;
    padding: 5px 12px;
    border-radius: 999px;
    letter-spacing: 0.02em;
}

.sphf-ageing-rule-item__badge.is-green {
    color: #15803d;
    background: #dcfce7;
}

.sphf-ageing-rule-item__badge.is-yellow {
    color: #a16207;
    background: #fef3c7;
}

.sphf-ageing-rule-item__badge.is-orange {
    color: #c2410c;
    background: #ffedd5;
}

.sphf-ageing-rule-item__badge.is-red {
    color: #dc2626;
    background: #fee2e2;
}

.sphf-ageing-rule-item__body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
}

.sphf-ageing-rule-item__bar {
    position: relative;
    height: 8px;
    border-radius: 999px;
    background: #edf0f4;
    overflow: hidden;
}

.sphf-ageing-rule-item__bar span {
    position: absolute;
    inset: 0 auto 0 0;
    border-radius: inherit;
}

.sphf-ageing-rule-item__bar span.is-green {
    width: 24%;
    background: #22c55e;
}

.sphf-ageing-rule-item__bar span.is-yellow {
    width: 50%;
    background: #facc15;
}

.sphf-ageing-rule-item__bar span.is-orange {
    width: 74%;
    background: #fb923c;
}

.sphf-ageing-rule-item__bar span.is-red {
    width: 100%;
    background: #ef4444;
}

.sphf-ageing-rule-item__range {
    font-size: 11px;
    font-weight: 700;
    color: #728196;
    justify-self: end;
    white-space: nowrap;
}

.sphf-ageing-rule-item.is-green .sphf-ageing-rule-item__bar,
.sphf-ageing-rule-item.is-yellow .sphf-ageing-rule-item__bar,
.sphf-ageing-rule-item.is-orange .sphf-ageing-rule-item__bar,
.sphf-ageing-rule-item.is-red .sphf-ageing-rule-item__bar {
    background: #edf0f4;
}

.sphf-stage-pill {
    display: inline-flex;
    align-items: center;
    background: #eef2f7;
    color: #5f6d81;
    border-radius: 999px;
    font-size: 9px;
    font-weight: 700;
    padding: 3px 8px;
}

.sphf-stage-caption {
    display: inline-flex;
    align-items: center;
    padding: 8px 14px;
    border-radius: 999px;
    background: #dbeafe;
    color: #1d4ed8;
    font-size: 15px;
    font-weight: 700;
    line-height: 1;
}

.sphf-matrix-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 58px;
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.2;
}

.sphf-matrix-chip.is-green {
    color: #05603a;
    background: #c3efe4;
}

.sphf-matrix-chip.is-yellow {
    color: #9b5c00;
    background: #e7e7b3;
}

.sphf-matrix-chip.is-orange {
    color: #c2410c;
    background: #f6e3c8;
}

.sphf-matrix-chip.is-red {
    color: #d91a00;
    background: #f6dfdb;
}

.sphf-status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    padding: 6px 14px;
}

.sphf-status-pill.is-green {
    color: #046850;
    background: #bfe9dd;
}

.sphf-status-pill.is-yellow {
    color: #996400;
    background: #e6e7b8;
}

.sphf-status-pill.is-orange {
    color: #c2410c;
    background: #efd9b6;
}

.sphf-status-pill.is-red {
    color: #d91a00;
    background: #f3ddd8;
}

.alarm-dot {
    display: inline-flex;
    width: 10px;
    height: 10px;
    border-radius: 999px;
}

.alarm-dot.is-red {
    background: #ef4444;
}

.alarm-dot.is-orange {
    background: #f97316;
}

.alarm-dot.is-yellow {
    background: #facc15;
}

.alarm-dot.is-green {
    background: #22c55e;
}

.sphf-table-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid #eef2f6;
    padding: 10px 12px;
    color: #8a95a5;
    font-size: 11px;
}

.sphf-pagination-footer {
    flex-wrap: wrap;
    gap: 8px;
}

.sphf-pagination-info {
    color: #8a95a5;
    font-size: 11px;
    min-width: 140px;
}

.sphf-pager {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.sphf-pager a,
.sphf-pager span {
    color: #334155;
    text-decoration: none;
    font-size: 11px;
}

/* Force white text on active pagination button */
div.dt-container .dt-paging .dt-paging-button.current,
div.dt-container .dt-paging .dt-paging-button.current:hover {
    color: #ffffff !important;
}

.sphf-pager__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 26px;
    height: 26px;
    padding: 0 6px;
    border-radius: 4px;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #334155;
    font-size: 11px;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s;
}

.sphf-pager__btn:hover:not(.active):not(.is-disabled) {
    background: #f1f5f9;
}

.sphf-pager__btn.active {
    background: #0f8a58;
    color: #fff;
    border-color: #0f8a58;
    font-weight: 600;
}

.sphf-pager__btn.is-disabled {
    opacity: 0.35;
    cursor: default;
    pointer-events: none;
}

.sphf-pager__ellipsis {
    color: #8a95a5;
    font-size: 11px;
    padding: 0 2px;
}

.sphf-per-page {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.sphf-per-page__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 22px;
    padding: 0 6px;
    border-radius: 4px;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #334155;
    font-size: 10px;
    text-decoration: none;
    cursor: pointer;
}

.sphf-per-page__btn.active {
    background: #0f8a58;
    color: #fff;
    border-color: #0f8a58;
    font-weight: 600;
}

.sphf-per-page__label {
    font-size: 10px;
    color: #8a95a5;
}

.sphf-table-count {
    margin-left: 8px;
    font-size: 10px;
    font-weight: 500;
    color: #8a95a5;
    background: #f1f5f9;
    border-radius: 10px;
    padding: 1px 8px;
}

/* ── Filter chips ── */
.sphf-filter-chips {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-bottom: 10px;
}

.sphf-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #e0f2fe;
    color: #0369a1;
    border: 1px solid #bae6fd;
    border-radius: 20px;
    padding: 3px 10px 3px 10px;
    font-size: 11px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.12s;
}

.sphf-filter-chip:hover {
    background: #bae6fd;
}

.sphf-filter-chip__remove {
    font-size: 14px;
    line-height: 1;
    color: #0369a1;
    opacity: 0.7;
}

.sphf-filter-chip--clear {
    background: #fee2e2;
    color: #b91c1c;
    border-color: #fca5a5;
}

.sphf-filter-chip--clear:hover {
    background: #fca5a5;
}

/* Chart bar variant */
.sphf-chart--bar {
    min-height: 250px;
}

.sphf-branch-chart-grid {
    display: grid;
    grid-template-columns: 0.85fr 1.15fr;
    gap: 10px;
    margin-bottom: 10px;
}

.sphf-branch .sphf-table .sphf-status-tag {
    text-transform: none;
}

.sphf-branch .sphf-table tbody td {
    font-size: 14px;
}

.sphf-branch .sphf-table tbody td small {
    color: #9aa6b4;
    font-size: 10px;
    font-weight: 600;
}

.sphf-ip-chart-grid {
    display: grid;
    grid-template-columns: 0.7fr 1.3fr;
    gap: 10px;
    margin-bottom: 10px;
}

.legend-dot {
    width: 8px;
    height: 8px;
    display: inline-block;
    border-radius: 999px;
    margin-right: 6px;
}

.legend-dot--green {
    background: #22c55e;
}

.sphf-table-subtitle {
    margin: -6px 0 8px;
    padding: 0 14px;
}

.sphf-ip-ranking-table td small {
    font-size: 11px;
    font-weight: 700;
    margin-left: 8px;
}

.sphf-progress {
    width: 72px;
    height: 5px;
    border-radius: 999px;
    background: #dbe5f3;
    display: inline-block;
    overflow: hidden;
    vertical-align: middle;
}

.sphf-progress>span {
    display: block;
    height: 100%;
    border-radius: inherit;
}

.sphf-num-pill {
    background: #fee2e2;
    color: #dc2626;
    border-radius: 999px;
    padding: 3px 8px;
    font-size: 11px;
    font-weight: 700;
}

.sphf-rank-pill {
    display: inline-flex;
    background: #dbe4f2;
    color: #334155;
    border-radius: 6px;
    padding: 4px 6px;
    font-size: 12px;
    font-weight: 700;
}

.sphf-rank-pill.is-top {
    background: #16a34a;
    color: #fff;
}

.sphf-under-progress {
    font-family: "Inter", "Segoe UI", Arial, sans-serif;
    color: var(--sphf-text);
}

.sphf-under-progress__note {
    margin: 0 0 8px;
    color: #8b95a3;
    font-size: 11px;
    font-weight: 500;
}

.sphf-up-message {
    margin: 0 0 10px;
    border: 1px solid #fde68a;
    border-radius: 8px;
    background: #fffbeb;
    color: #92400e;
    padding: 10px 12px;
    font-size: 12px;
    font-weight: 600;
}

.sphf-up-kpi-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 10px;
}

.sphf-up-kpi-card {
    background: #fff;
    border: 1px solid #e5eaef;
    border-radius: 8px;
    padding: 10px 12px;
    min-height: 86px;
}

.sphf-up-kpi-card__label {
    margin: 0 0 7px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: #8b95a3;
}

.sphf-up-kpi-card__value {
    margin: 0 0 5px;
    font-size: 24px;
    line-height: 1;
    font-weight: 700;
    color: #151c2a;
}

.sphf-up-kpi-card__value.is-blue {
    color: #2563eb;
}

.sphf-up-kpi-card__value.is-red {
    color: #dc2626;
}

.sphf-up-kpi-card__value.is-orange {
    color: #d97706;
}

.sphf-up-kpi-card__value.is-yellow {
    color: #ca8a04;
}

.sphf-up-kpi-card__value.is-purple {
    color: #7c3aed;
}

.sphf-up-kpi-card__value.is-green {
    color: #16a34a;
}

.sphf-up-kpi-card__meta {
    margin: 0;
    color: #a2aab7;
    font-size: 10px;
    font-weight: 600;
}

.sphf-up-grid {
    display: grid;
    gap: 10px;
    margin-bottom: 10px;
}

.sphf-up-grid--three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.sphf-up-grid--split {
    grid-template-columns: minmax(0, 1fr) 320px;
}

.sphf-up-grid--stage {
    grid-template-columns: minmax(0, 1.8fr) minmax(280px, 0.9fr);
}

.sphf-up-financial-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 10px;
}

.sphf-up-card {
    position: relative;
    background: #fff;
    border: 1px solid #e5eaef;
    border-radius: 8px;
    min-width: 0;
    overflow: hidden;
}

.sphf-up-card--chart {
    min-height: 340px;
}

.sphf-up-card__header {
    min-height: 48px;
    padding: 12px 14px;
    border-bottom: 1px solid #edf1f5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.sphf-up-card__title {
    margin: 0;
    color: #202c3a;
    font-size: 18px;
    line-height: 1.2;
    font-weight: 700;
}

.sphf-up-card__body {
    padding: 12px 14px 14px;
}

.sphf-up-card__body--chart {
    min-height: 280px;
}

.sphf-up-chart {
    min-height: 260px;
}

.sphf-up-card__body--chart canvas {
    width: 100% !important;
    height: 260px !important;
}

.sphf-up-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 5px 10px;
    font-size: 10px;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
}

.sphf-up-badge.is-blue {
    color: #1d4ed8;
    background: #dbeafe;
}

.sphf-up-badge.is-red {
    color: #b91c1c;
    background: #fee2e2;
}

.sphf-up-badge.is-orange {
    color: #c2410c;
    background: #ffedd5;
}

.sphf-up-badge.is-green {
    color: #166534;
    background: #dcfce7;
}

.sphf-up-health-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.sphf-up-health-tile {
    border-radius: 8px;
    padding: 10px;
    min-width: 0;
}

.sphf-up-health-tile p {
    margin: 0 0 6px;
    font-size: 11px;
    font-weight: 800;
}

.sphf-up-health-tile strong {
    display: block;
    color: inherit;
    font-size: 17px;
    line-height: 1;
    font-weight: 800;
}

.sphf-up-health-tile.is-green {
    color: #166534;
    background: #dcfce7;
}

.sphf-up-health-tile.is-yellow {
    color: #854d0e;
    background: #fef9c3;
}

.sphf-up-health-tile.is-orange {
    color: #9a3412;
    background: #ffedd5;
}

.sphf-up-health-tile.is-red {
    color: #991b1b;
    background: #fee2e2;
}

.sphf-up-ranking {
    display: grid;
    gap: 11px;
}

.sphf-up-ranking__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 5px;
}

.sphf-up-ranking__label {
    color: #374151;
    font-size: 12px;
    font-weight: 700;
}

.sphf-up-ranking__value {
    color: #8b95a3;
    font-size: 11px;
    font-weight: 700;
}

.sphf-up-ranking__bar {
    height: 7px;
    overflow: hidden;
    border-radius: 999px;
    background: #edf1f5;
}

.sphf-up-ranking__bar span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: #dc2626;
}

.sphf-up-alert-list,
.sphf-up-escalation-list {
    display: grid;
    gap: 8px;
}

.sphf-up-alert,
.sphf-up-escalation {
    border-radius: 8px;
    border-left: 4px solid #d3d7de;
    padding: 10px 12px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.sphf-up-alert strong,
.sphf-up-escalation strong {
    display: block;
    margin-bottom: 3px;
    font-size: 12px;
    font-weight: 800;
}

.sphf-up-alert p,
.sphf-up-escalation p {
    margin: 0;
    color: #64748b;
    font-size: 11px;
    line-height: 1.35;
}

.sphf-up-alert.is-red,
.sphf-up-escalation.is-red {
    background: #fef2f2;
    border-left-color: #ef4444;
}

.sphf-up-alert.is-orange,
.sphf-up-escalation.is-orange {
    background: #fff7ed;
    border-left-color: #f97316;
}

.sphf-up-alert.is-yellow,
.sphf-up-escalation.is-yellow {
    background: #fefce8;
    border-left-color: #eab308;
}

.sphf-up-alert.is-green,
.sphf-up-escalation.is-green {
    background: #f0fdf4;
    border-left-color: #22c55e;
}

.sphf-up-alert.is-red strong,
.sphf-up-escalation.is-red strong {
    color: #b91c1c;
}

.sphf-up-alert.is-orange strong,
.sphf-up-escalation.is-orange strong {
    color: #c2410c;
}

.sphf-up-alert.is-yellow strong,
.sphf-up-escalation.is-yellow strong {
    color: #854d0e;
}

.sphf-up-alert.is-green strong,
.sphf-up-escalation.is-green strong {
    color: #166534;
}

.sphf-up-table-card {
    background: #fff;
    border: 1px solid #e5eaef;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 10px;
}

.sphf-up-table-card__header {
    padding: 12px 14px;
    border-bottom: 1px solid #edf1f5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.sphf-up-table-card__title {
    margin: 0;
    color: #202c3a;
    font-size: 18px;
    font-weight: 700;
}

.sphf-filter-title {
    font-size: 14px;
}

.sphf-under-progress .sphf-table thead th {
    font-size: 14px;
}

.sphf-under-progress .sphf-table tbody td {
    font-size: 13px;
}

.sphf-under-progress .sphf-table tbody tr:hover td {
    background: #f8fafc;
}

.sphf-up-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 800;
    line-height: 1;
}

.sphf-up-status.is-red {
    color: #b91c1c;
    background: #fee2e2;
}

.sphf-up-status.is-orange {
    color: #c2410c;
    background: #ffedd5;
}

.sphf-up-status.is-yellow {
    color: #854d0e;
    background: #fef3c7;
}

.sphf-up-status.is-green {
    color: #166534;
    background: #dcfce7;
}

.sphf-dt-footer {
    display: flex;
    justify-content: flex-end;
    padding: 10px 12px;
    border-top: 1px solid #eef2f6;
}

.sphf-dt-footer .dt-paging {
    display: inline-flex;
    gap: 14px;
    align-items: center;
    flex-wrap: wrap;
}

.sphf-dt-footer .dt-paging-button {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    border: 0 !important;
    background: transparent !important;
    color: #111827 !important;
    font-size: 15px !important;
    font-weight: 500 !important;
    line-height: 1 !important;
    padding: 0 2px !important;
    margin: 0 !important;
    box-shadow: none !important;
    text-decoration: none !important;
}

.sphf-dt-footer .dt-paging-button.current {
    background: #0f8a58 !important;
    color: #fff !important;
    border-radius: 4px !important;
    min-width: 28px;
    height: 28px;
    padding: 0 8px !important;
}

.sphf-dt-footer .dt-paging-button.previous,
.sphf-dt-footer .dt-paging-button.next {
    font-weight: 500 !important;
    color: #111827 !important;
}

.sphf-dt-footer .dt-paging-button.previous {
    margin-right: 6px !important;
}

.sphf-dt-footer .dt-paging-button.next {
    margin-left: 6px !important;
}

.sphf-modal-open {
    overflow: hidden;
}

.sphf-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(17, 24, 39, 0.45);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
}

.sphf-modal-backdrop.is-open {
    display: flex;
}

.sphf-modal {
    width: min(1200px, 100%);
    max-height: calc(100vh - 40px);
    overflow: auto;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    border: 1px solid #e5eaef;
}

.sphf-modal__header {
    padding: 14px 16px;
    border-bottom: 1px solid #edf1f5;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sphf-modal__header h3 {
    margin: 0;
    font-size: 30px;
    font-weight: 700;
    color: #1f2937;
}

.sphf-modal__close {
    border: 0;
    background: transparent;
    color: #7a8698;
    cursor: pointer;
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.sphf-modal__toolbar {
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.sphf-modal__search {
    border: 1px solid #d8dee7;
    border-radius: 6px;
    height: 38px;
    padding: 0 12px;
    min-width: 360px;
}

.sphf-modal__toolbar-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.sphf-modal__btn {
    border: 1px solid #d8dee7;
    background: #fff;
    color: #374151;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.sphf-modal__btn.is-primary {
    background: #16a34a;
    color: #fff;
    border-color: #16a34a;
}

.sphf-journey-modal {
    width: min(1120px, calc(100vw - 36px));
    border-radius: 22px;
    padding: 0 18px 18px;
    background: #f8fafc;
}

.sphf-journey-modal__header {
    margin: 0 -18px 18px;
    padding: 16px 20px;
    border-radius: 22px 22px 0 0;
    border-bottom: 0;
}

.sphf-journey-modal__header h3 {
    color: #fff;
    font-size: 18px;
    font-weight: 700;
}

.sphf-journey-close-btn {
    background: #1aa0a8;
    border: 0;
    color: #fff;
    border-radius: 12px;
    padding: 10px 18px;
    font-size: 13px;
    font-weight: 700;
}

.sphf-journey-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(180px, 1fr));
    gap: 14px;
    margin-bottom: 14px;
}

.sphf-journey-card {
    border: 1px solid #d8e0ea;
    border-radius: 16px;
    padding: 12px 14px;
    background: #f3f6fb;
}

.sphf-journey-card small {
    display: block;
    color: #6b7c93;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 4px;
}

.sphf-journey-card strong {
    color: #1b2b42;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.2;
}

.sphf-journey-note-row {
    border: 1px solid #d8e0ea;
    border-radius: 16px;
    padding: 14px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: #f3f6fb;
}

.sphf-journey-note-row h4 {
    margin: 0 0 4px;
    color: #1b2b42;
    font-size: 14px;
    font-weight: 700;
}

.sphf-journey-note-row p {
    margin: 0;
    color: #64748b;
    font-size: 12px;
}

.sphf-journey-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
}

.sphf-journey-chip.is-done {
    color: #065f46;
    background: #bbf7d0;
}

.sphf-journey-chip.is-alert.is-red {
    color: #b91c1c;
    background: #fee2e2;
}

.sphf-journey-chip.is-alert.is-orange {
    color: #c2410c;
    background: #ffedd5;
}

.sphf-journey-chip.is-alert.is-yellow {
    color: #92400e;
    background: #fef3c7;
}

.sphf-journey-chip.is-alert.is-green {
    color: #166534;
    background: #dcfce7;
}

.sphf-journey-chip.is-action {
    color: #1e40af;
    background: #dbeafe;
}

@media (max-width: 1280px) {
    .sphf-kpi-grid {
        grid-template-columns: repeat(2, minmax(220px, 1fr));
    }

    .sphf-stage-row {
        grid-template-columns: 1fr;
    }

    .sphf-stage-switcher {
        grid-column: 1;
    }

    .sphf-ageing-kpi-grid,
    .sphf-ageing-main-grid {
        grid-template-columns: 1fr;
    }

    .sphf-up-kpi-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .sphf-up-grid--three,
    .sphf-up-grid--split,
    .sphf-up-grid--stage,
    .sphf-up-financial-grid {
        grid-template-columns: 1fr;
    }

    .sphf-branch-chart-grid {
        grid-template-columns: 1fr;
    }

    .sphf-ip-chart-grid {
        grid-template-columns: 1fr;
    }

    .sphf-card-row,
    .sphf-card-row--bottom {
        grid-template-columns: 1fr;
    }

    .sphf-heatmap-grid {
        grid-template-columns: repeat(2, minmax(160px, 1fr));
    }

    .sphf-journey-grid {
        grid-template-columns: repeat(2, minmax(180px, 1fr));
    }

    .sphf-journey-card strong {
        font-size: 17px;
    }

    .sphf-journey-note-row h4 {
        font-size: 13px;
    }

    .sphf-journey-note-row p {
        font-size: 12px;
    }

    .sphf-journey-chip {
        font-size: 12px;
    }
}

@media (max-width: 768px) {
    .sphf-page__heading-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .sphf-page__title {
        font-size: 26px;
    }

    .sphf-header {
        height: auto;
        padding: 10px 12px;
        flex-wrap: wrap;
    }

    .sphf-header__left,
    .sphf-header__right {
        width: auto;
    }

    .sphf-header__nav {
        order: 3;
        width: 100%;
        justify-content: flex-start;
        gap: 16px;
        overflow: auto;
    }

    .sphf-page-tabs {
        margin-bottom: 14px;
    }

    .sphf-page-tab {
        padding: 7px 14px;
        font-size: 12px;
    }

    .sphf-kpi-grid {
        grid-template-columns: 1fr;
    }

    .sphf-up-kpi-grid,
    .sphf-up-health-grid {
        grid-template-columns: 1fr;
    }

    .sphf-up-card__header,
    .sphf-up-table-card__header {
        align-items: flex-start;
        flex-direction: column;
    }

    .sphf-heatmap-grid {
        grid-template-columns: 1fr;
    }

    .sphf-journey-grid {
        grid-template-columns: 1fr;
    }

    .sphf-journey-modal {
        width: min(100vw, calc(100vw - 16px));
        border-radius: 14px;
        padding: 0 10px 10px;
    }

    .sphf-journey-modal__header {
        margin: 0 -10px 12px;
        border-radius: 14px 14px 0 0;
    }

    .sphf-journey-card strong {
        font-size: 16px;
    }

    .sphf-journey-note-row {
        align-items: flex-start;
        flex-direction: column;
    }

    .sphf-journey-note-row h4 {
        font-size: 13px;
    }

    .sphf-journey-note-row p {
        font-size: 14px;
    }

    .sphf-journey-chip {
        font-size: 14px;
    }
}

/* ── Filter / AJAX preloader ────────────────────────────────────────────── */

#sphfFilterLoader {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    pointer-events: none;
}

#sphfFilterLoader.is-active {
    display: block;
    pointer-events: all;
}

/* thin animated bar at very top */
#sphfFilterLoader::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    width: 0;
    background: linear-gradient(90deg, #0a9a4c, #43d87e);
    animation: sphfLoaderBar 1.6s ease-in-out infinite;
    border-radius: 0 2px 2px 0;
}

@keyframes sphfLoaderBar {
    0% {
        width: 0;
        opacity: 1;
    }

    60% {
        width: 80%;
        opacity: 1;
    }

    100% {
        width: 95%;
        opacity: 0.6;
    }
}

/* semi-transparent overlay */
#sphfFilterLoader::after {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.35);
}

/* spinner centered in the dynamic content area */
#sphfFilterSpinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 52px;
    height: 52px;
    border: 4px solid rgba(10, 154, 76, 0.18);
    border-top-color: #0a9a4c;
    border-radius: 50%;
    animation: sphfSpinnerRotate 0.75s linear infinite;
    z-index: 10000;
    position: fixed;
}

@keyframes sphfSpinnerRotate {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}