:root {
    --kpi-navy: #062543;
    --kpi-navy-2: #0b3b68;
    --kpi-blue: #2563eb;
    --kpi-green: #16a34a;
    --kpi-green-soft: #dcfce7;
    --kpi-yellow: #f59e0b;
    --kpi-orange: #f97316;
    --kpi-red: #dc2626;
    --kpi-red-soft: #fee2e2;
    --kpi-bg: #eef3f8;
    --kpi-panel: #ffffff;
    --kpi-text: #0f172a;
    --kpi-muted: #64748b;
    --kpi-line: #dbe4ef;
    --kpi-shadow: 0 18px 45px rgba(15, 23, 42, .10);
    --kpi-radius: 18px;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
    font-family: "Segoe UI", Arial, sans-serif;
    background:
        radial-gradient(circle at top left, rgba(37, 99, 235, .08), transparent 32vw),
        linear-gradient(180deg, #f8fafc, var(--kpi-bg));
    color: var(--kpi-text);
}

body.modal-open,
body.kpi-drawer-open {
    overflow: hidden;
}

button,
input,
select {
    font-family: inherit;
}

button {
    -webkit-tap-highlight-color: transparent;
}

.kpi-page {
    width: 100%;
    min-height: 100vh;
    padding: 14px 16px 18px 78px;
}

.kpi-slide,
.kpi-normal {
    width: min(1480px, 100%);
    margin: 0 auto;
}

.kpi-slide {
    min-height: 760px;
    padding: 18px;
    background: rgba(255,255,255,.92);
    border: 1px solid rgba(148, 163, 184, .28);
    border-radius: 24px;
    box-shadow: var(--kpi-shadow);
    backdrop-filter: blur(8px);
}

.kpi-header,
.kpi-normal-header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
    margin-bottom: 14px;
}

.kpi-header-left {
    display: flex;
    gap: 13px;
    align-items: flex-start;
    min-width: 0;
}

.kpi-blue-mark {
    width: 12px;
    height: 48px;
    border-radius: 999px;
    background: linear-gradient(180deg, var(--kpi-blue), var(--kpi-navy));
    flex: 0 0 12px;
    margin-top: 2px;
}

.kpi-header h1,
.kpi-normal-header h1 {
    margin: 0;
    color: #08111f;
    font-size: clamp(25px, 2.55vw, 38px);
    line-height: 1.05;
    font-weight: 950;
    letter-spacing: -.9px;
}

.kpi-header p,
.kpi-normal-header p {
    margin: 8px 0 0;
    color: #334155;
    font-size: 15px;
    font-weight: 650;
}

.kpi-header p span {
    margin: 0 10px;
    color: #94a3b8;
}

.kpi-header-right {
    display: grid;
    gap: 8px;
    justify-items: end;
    min-width: 430px;
}

.kpi-filter,
.kpi-form-filter {
    display: flex;
    gap: 8px;
    align-items: end;
    background: #f8fafc;
    border: 1px solid var(--kpi-line);
    border-radius: 16px;
    padding: 9px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.8);
}

.kpi-filter label,
.kpi-form-filter label {
    display: grid;
    gap: 4px;
}

.kpi-filter label span,
.kpi-form-filter label span {
    color: #475569;
    font-size: 10.5px;
    font-weight: 850;
    letter-spacing: .02em;
    text-transform: uppercase;
}

.kpi-filter select,
.kpi-filter input,
.kpi-form-filter select,
.kpi-form-filter input,
.kpi-input-table input {
    height: 36px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: var(--kpi-text);
    border-radius: 11px;
    padding: 6px 10px;
    font-size: 13px;
    outline: none;
    transition: border .18s ease, box-shadow .18s ease;
}

.kpi-filter select,
.kpi-filter input {
    width: 84px;
}

.kpi-filter .area-select {
    width: 150px;
}

.kpi-filter select:focus,
.kpi-filter input:focus,
.kpi-form-filter select:focus,
.kpi-form-filter input:focus,
.kpi-input-table input:focus {
    border-color: var(--kpi-blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .14);
}

.kpi-filter button,
.kpi-form-filter button,
.kpi-sticky-save button {
    height: 36px;
    border: none;
    background: linear-gradient(135deg, var(--kpi-navy), var(--kpi-navy-2));
    color: #ffffff;
    border-radius: 11px;
    padding: 0 14px;
    font-size: 13px;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(6, 44, 82, .18);
}

.kpi-filter button:hover,
.kpi-form-filter button:hover,
.kpi-sticky-save button:hover {
    filter: brightness(1.06);
}

.kpi-top-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-end;
}

.kpi-top-nav a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    text-decoration: none;
    color: var(--kpi-navy);
    border: 1px solid #cbd5e1;
    background: #ffffff;
    border-radius: 999px;
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 850;
}

.kpi-top-nav a.active,
.kpi-top-nav a:hover {
    background: var(--kpi-navy);
    color: #ffffff;
    border-color: var(--kpi-navy);
}

.kpi-alert {
    padding: 11px 13px;
    border-radius: 14px;
    font-weight: 850;
    margin: 0 0 12px;
}

.kpi-alert.success {
    background: var(--kpi-green-soft);
    color: #166534;
    border: 1px solid #86efac;
}

.kpi-stat-strip {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    margin-bottom: 10px;
}

.kpi-stat-card {
    border: 1px solid var(--kpi-line);
    border-radius: 16px;
    padding: 10px 12px;
    background: linear-gradient(180deg, #ffffff, #f8fafc);
    min-height: 68px;
    box-shadow: 0 8px 22px rgba(15, 23, 42, .05);
}

.kpi-stat-card span {
    display: block;
    color: #64748b;
    font-size: 11px;
    font-weight: 850;
    letter-spacing: .03em;
    text-transform: uppercase;
}

.kpi-stat-card strong {
    display: block;
    margin-top: 4px;
    color: #0f172a;
    font-size: clamp(19px, 1.8vw, 26px);
    line-height: 1;
    font-weight: 950;
}

.kpi-stat-card small {
    display: block;
    margin-top: 4px;
    color: #64748b;
    font-size: 10.8px;
    line-height: 1.18;
}

.kpi-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.02fr) minmax(0, 1.08fr);
    grid-template-rows: 224px 224px 120px;
    grid-template-areas:
        "score achievements"
        "progress issues"
        "legend bottom";
    gap: 10px;
    width: 100%;
}

.kpi-panel {
    background: var(--kpi-panel);
    border: 1px solid var(--kpi-line);
    border-radius: var(--kpi-radius);
    box-shadow: 0 10px 30px rgba(15, 23, 42, .06);
    overflow: hidden;
    min-height: 0;
    color: var(--kpi-text);
}

.kpi-score-panel {
    grid-area: score;
    display: grid;
    overflow: auto;
    overscroll-behavior: contain;
    grid-template-columns: 150px 1fr;
    align-items: center;
    gap: 16px;
    padding: 16px 18px;
    border-left: 6px solid var(--kpi-green);
    background:
        radial-gradient(circle at 12% 25%, rgba(34, 197, 94, .18), transparent 120px),
        linear-gradient(135deg, #ffffff, #f8fbff);
}

.kpi-score-icon {
    display: grid;
    place-items: center;
}

.kpi-icon-circle {
    width: 132px;
    height: 132px;
    border-radius: 34px;
    position: relative;
    background:
        linear-gradient(135deg, rgba(6, 44, 82, .08), rgba(37, 99, 235, .09)),
        #ffffff;
    border: 1px solid #cbd5e1;
    box-shadow: inset 0 0 0 9px rgba(255,255,255,.65);
    display: grid;
    place-items: center;
    padding: 14px;
}

.kpi-icon-circle::before,
.kpi-icon-circle::after {
    content: none;
}

.kpi-score-icon-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 26px;
    display: block;
}

.kpi-gear {
    display: none;
}

.kpi-score-divider {
    display: none;
}

.kpi-score-content {
    min-width: 0;
}

.kpi-kicker {
    display: block;
    color: #475569;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .04em;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.kpi-score-content h2 {
    margin: 0;
    color: #0f172a;
    font-size: 23px;
    line-height: 1.1;
    font-weight: 900;
}

.kpi-score-big {
    display: block;
    font-size: clamp(50px, 5.5vw, 78px);
    line-height: .9;
    letter-spacing: -3px;
    color: var(--kpi-green);
    margin: 6px 0 9px;
    font-weight: 950;
}

.kpi-status-row {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-wrap: wrap;
    margin-bottom: 9px;
}

.kpi-status-badge,
.chip {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    border-radius: 999px;
    padding: 4px 9px;
    font-size: 11.5px;
    font-weight: 900;
    background: #e0f2fe;
    color: #075985;
}

.kpi-status-note {
    color: #64748b;
    font-size: 12px;
}

.kpi-status-badge.very-good,
.kpi-status-badge.good {
    background: #dcfce7;
    color: #166534;
}

.kpi-status-badge.fair {
    background: #fef3c7;
    color: #92400e;
}

.kpi-status-badge.need {
    background: #ffedd5;
    color: #c2410c;
}

.kpi-status-badge.poor {
    background: #fee2e2;
    color: #b91c1c;
}

.kpi-progress-line {
    display: flex;
    align-items: center;
    gap: 9px;
}

.kpi-progress-track {
    flex: 1;
    min-width: 150px;
    height: 12px;
    background: #e2e8f0;
    border-radius: 999px;
    overflow: hidden;
}

.kpi-progress-track div {
    height: 100%;
    background: linear-gradient(90deg, #15803d, #22c55e);
    border-radius: inherit;
}

.kpi-progress-line b {
    font-size: 17px;
    color: var(--kpi-green);
    font-weight: 950;
}

.kpi-progress-line em {
    color: #64748b;
    font-style: normal;
}

.kpi-achievements,
.kpi-progress-panel,
.kpi-issues {
    position: relative;
    padding: 0;
    min-height: 0;
}

.kpi-panel-scroll {
    height: 100%;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: #94a3b8 #e2e8f0;
}

.kpi-panel-scroll::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.kpi-panel-scroll::-webkit-scrollbar-track {
    background: #e2e8f0;
    border-radius: 999px;
}

.kpi-panel-scroll::-webkit-scrollbar-thumb {
    background: #94a3b8;
    border-radius: 999px;
}

.kpi-panel-scroll::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}

.kpi-scroll-with-title {
    padding: 38px 14px 8px;
}

.kpi-scroll-plain {
    padding: 0;
}

.kpi-achievements {
    grid-area: achievements;
}

.kpi-progress-panel {
    grid-area: progress;
}

.kpi-issues {
    grid-area: issues;
    border-left: 6px solid var(--kpi-red);
}

.kpi-floating-title {
    position: absolute;
    left: 0;
    top: 0;
    min-width: 220px;
    height: 30px;
    border-radius: 0 16px 16px 0;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 14px;
    color: #ffffff;
    font-size: 14px;
    font-weight: 950;
    background: linear-gradient(135deg, var(--kpi-navy), var(--kpi-navy-2));
    z-index: 2;
}

.kpi-floating-title.red {
    min-width: 286px;
    background: linear-gradient(135deg, #b91c1c, var(--kpi-red));
}

.kpi-floating-title.compact {
    min-width: 256px;
}

.kpi-achievement-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px 10px;
}

.kpi-achievement-item,
.kpi-issue-row {
    border: 1px solid transparent;
    background: transparent;
    text-align: left;
    cursor: pointer;
    width: 100%;
    color: var(--kpi-text);
    transition: background .16s ease, border .16s ease, transform .16s ease;
}

.kpi-achievement-item {
    display: grid;
    grid-template-columns: 40px 1fr;
    gap: 8px;
    align-items: center;
    min-height: 54px;
    padding: 5px 7px;
    border-radius: 12px;
}

.kpi-achievement-item:hover,
.kpi-issue-row:hover,
.kpi-area-table tbody tr:hover {
    background: #f8fafc;
    border-color: #dbeafe;
}

.kpi-achievement-item:active,
.kpi-issue-row:active {
    transform: scale(.995);
}

.kpi-achievement-icon {
    width: 36px;
    height: 36px;
    border: 1px solid #cbd5e1;
    color: var(--kpi-navy);
    background: #eff6ff;
    border-radius: 12px;
    display: grid;
    place-items: center;
    font-size: 18px;
}

.kpi-achievement-copy strong,
.kpi-issue-row strong {
    display: block;
    color: #0f172a;
    font-size: 12.8px;
    line-height: 1.18;
    font-weight: 950;
}

.kpi-achievement-copy em,
.kpi-achievement-copy small,
.kpi-issue-row em {
    display: block;
    font-style: normal;
    color: #475569;
    font-size: 11.3px;
    line-height: 1.22;
}

.kpi-achievement-copy b,
.kpi-good,
.kpi-very-good,
.kpi-good-text {
    color: var(--kpi-green);
    font-weight: 950;
}

.kpi-achievement-copy b.miss,
.kpi-bad-text,
.kpi-critical,
.kpi-poor {
    color: var(--kpi-red);
    font-weight: 950;
}

.kpi-fair,
.kpi-warn-text {
    color: var(--kpi-yellow);
    font-weight: 950;
}

.kpi-need {
    color: var(--kpi-orange);
    font-weight: 950;
}

.kpi-nodata {
    color: #64748b;
    font-weight: 950;
}

.kpi-area-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 12px;
}

.kpi-area-table th,
.kpi-area-table td {
    padding: 4px 6px;
    border-bottom: 1px solid #e2e8f0;
    text-align: left;
    color: var(--kpi-text);
    line-height: 1.15;
}

.kpi-area-table th {
    color: #475569;
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
}

.kpi-area-table tbody tr {
    cursor: pointer;
}

.kpi-num-dot {
    width: 23px;
    height: 23px;
    border-radius: 8px;
    background: var(--kpi-navy);
    color: #ffffff;
    display: inline-grid;
    place-items: center;
    font-weight: 950;
    font-size: 12px;
}

.kpi-inline-bar {
    display: inline-block;
    width: 118px;
    height: 8px;
    background: #e2e8f0;
    border-radius: 999px;
    overflow: hidden;
    vertical-align: middle;
    margin-right: 6px;
}

.kpi-inline-bar div {
    height: 100%;
    border-radius: inherit;
}

.kpi-bar-green { background: var(--kpi-green); }
.kpi-bar-yellow { background: var(--kpi-yellow); }
.kpi-bar-red { background: var(--kpi-red); }

.kpi-total-row td {
    color: var(--kpi-green);
    font-weight: 950;
}

.kpi-issue-list {
    display: grid;
    gap: 4px;
}

.kpi-issue-row {
    display: grid;
    grid-template-columns: 22px 1fr auto;
    align-items: center;
    gap: 7px;
    min-height: 34px;
    border-radius: 11px;
    padding: 4px 7px;
}

.kpi-issue-row .warn {
    color: var(--kpi-red);
    font-size: 16px;
}

.kpi-issue-row b {
    color: var(--kpi-red);
    font-weight: 950;
    white-space: nowrap;
    font-size: 11.2px;
}

.kpi-legend {
    grid-area: legend;
    overflow: hidden;
    min-height: 0;
}

.kpi-legend table {
    width: 100%;
    border-collapse: collapse;
    font-size: 9.2px;
    text-align: center;
}

.kpi-legend th,
.kpi-legend td {
    border: 1px solid #dbe4ef;
    padding: 2px 5px;
    background: #ffffff;
    line-height: 1.1;
}

.kpi-legend thead th {
    background: var(--kpi-navy);
    color: #ffffff;
    font-weight: 950;
}

.green-cell { background: #16a34a !important; color: #ffffff; font-weight: 950; }
.green-soft-cell { background: #86efac !important; color: #052e16; font-weight: 950; }
.yellow-cell { background: #fde68a !important; color: #422006; font-weight: 950; }
.orange-cell { background: #fdba74 !important; color: #431407; font-weight: 950; }
.red-cell { background: var(--kpi-red) !important; color: #ffffff; font-weight: 950; }

.kpi-bottom {
    grid-area: bottom;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    overflow: auto;
    min-height: 0;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: #94a3b8 #e2e8f0;
}

.kpi-bottom::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.kpi-bottom::-webkit-scrollbar-track {
    background: #e2e8f0;
    border-radius: 999px;
}

.kpi-bottom::-webkit-scrollbar-thumb {
    background: #94a3b8;
    border-radius: 999px;
}

.kpi-bottom article {
    display: grid;
    grid-template-columns: 34px 1fr;
    gap: 8px;
    align-items: start;
    padding: 10px 12px;
    border-right: 1px solid #dbe4ef;
}

.kpi-bottom article:last-child {
    border-right: none;
}

.kpi-bottom span {
    width: 30px;
    height: 30px;
    border-radius: 10px;
    background: var(--kpi-navy);
    color: #ffffff;
    display: grid;
    place-items: center;
    font-size: 15px;
    font-weight: 950;
}

.kpi-bottom p {
    margin: 0;
    color: #334155;
    font-size: 11.5px;
    line-height: 1.42;
}

.kpi-footer {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    font-size: 11px;
    color: #475569;
    padding: 10px 2px 4px;
}

.kpi-footer span {
    font-style: italic;
}

.kpi-footer b {
    font-size: 12px;
    color: #334155;
}

.kpi-context {
    border: 1px solid #dbe4ef;
    border-radius: 14px;
    padding: 9px 11px;
    margin-top: 6px;
    font-size: 11.5px;
    color: #334155;
    background: #f8fafc;
}

.kpi-context strong {
    color: var(--kpi-navy);
}

.kpi-empty {
    color: #64748b;
    padding: 10px;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px dashed #cbd5e1;
}

.kpi-sidebar-toggle {
    position: fixed;
    left: 16px;
    top: 16px;
    z-index: 10020;
    width: 46px;
    height: 46px;
    border: none;
    border-radius: 15px;
    background: linear-gradient(135deg, var(--kpi-navy), var(--kpi-navy-2));
    color: #ffffff;
    font-size: 23px;
    font-weight: 950;
    cursor: pointer;
    box-shadow: 0 14px 28px rgba(6, 44, 82, .24);
}

.kpi-drawer-backdrop,
.kpi-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .55);
    opacity: 0;
    visibility: hidden;
    transition: opacity .2s ease, visibility .2s ease;
}

.kpi-drawer-backdrop {
    z-index: 10010;
}

.kpi-drawer-backdrop.show {
    opacity: 1;
    visibility: visible;
}

.kpi-drawer {
    position: fixed;
    top: 0;
    left: 0;
    width: 306px;
    max-width: 88vw;
    height: 100vh;
    background:
        radial-gradient(circle at 20% 0, rgba(37, 99, 235, .30), transparent 36%),
        linear-gradient(180deg, #061a33, #062543 56%, #03111f);
    color: #ffffff;
    z-index: 10030;
    transform: translateX(-104%);
    transition: transform .23s ease;
    box-shadow: 22px 0 55px rgba(0,0,0,.28);
    padding: 18px 16px;
    display: flex;
    flex-direction: column;
}

.kpi-drawer.open {
    transform: translateX(0);
}

.kpi-drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255,255,255,.14);
    margin-bottom: 16px;
}

.kpi-drawer-brand {
    display: flex;
    gap: 11px;
    align-items: center;
}

.kpi-drawer-logo {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: #ffffff;
    color: var(--kpi-navy);
    display: grid;
    place-items: center;
    font-weight: 950;
    font-size: 17px;
}

.kpi-drawer-brand strong {
    display: block;
    font-size: 15px;
    color: #ffffff;
    line-height: 1.1;
}

.kpi-drawer-brand span {
    display: block;
    color: rgba(255,255,255,.68);
    font-size: 12px;
    margin-top: 3px;
}

.kpi-drawer-close {
    border: none;
    background: rgba(255,255,255,.10);
    color: #ffffff;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
}

.kpi-drawer-menu {
    display: grid;
    gap: 8px;
}

.kpi-drawer-menu a {
    display: grid;
    grid-template-columns: 28px 1fr;
    align-items: center;
    gap: 10px;
    min-height: 46px;
    padding: 10px 12px;
    border-radius: 14px;
    text-decoration: none;
    color: rgba(255,255,255,.86);
    background: transparent;
    border: 1px solid transparent;
    font-size: 14px;
    font-weight: 750;
}

.kpi-drawer-menu a:hover,
.kpi-drawer-menu a.active {
    background: rgba(255,255,255,.12);
    border-color: rgba(255,255,255,.18);
    color: #ffffff;
}

.kpi-drawer-note {
    margin-top: auto;
    padding: 13px;
    border-radius: 15px;
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.14);
    color: rgba(255,255,255,.72);
    font-size: 12px;
    line-height: 1.45;
}

.kpi-modal-backdrop[hidden],
#modalBackdrop[hidden] {
    display: none;
}

.kpi-modal-backdrop {
    z-index: 10000;
    display: grid;
    place-items: center;
    padding: 16px;
    opacity: 1;
    visibility: visible;
}

.kpi-modal {
    position: relative;
    width: min(1480px, 98vw);
    max-height: 96vh;
    overflow: auto;
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 24px 80px rgba(0,0,0,.38);
    padding: 20px;
    color: var(--kpi-text);
}

.kpi-modal-close {
    position: sticky;
    float: right;
    right: 12px;
    top: 8px;
    z-index: 3;
    background: #f1f5f9;
    border: 1px solid #dbe4ef;
    font-size: 28px;
    color: #0f172a;
    cursor: pointer;
    line-height: 1;
    width: 38px;
    height: 38px;
    border-radius: 12px;
}

.kpi-modal-title {
    padding-right: 48px;
    margin-bottom: 14px;
}

.kpi-modal-title h2 {
    margin: 0 0 6px;
    color: var(--kpi-navy);
    font-size: 24px;
    font-weight: 950;
}

.kpi-modal-title p {
    margin: 0;
    color: #475569;
    font-weight: 700;
    line-height: 1.45;
}

.kpi-modal-summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 12px;
}

.kpi-modal-summary article {
    border: 1px solid var(--kpi-line);
    border-radius: 15px;
    padding: 12px;
    background: #f8fafc;
}

.kpi-modal-summary span {
    display: block;
    font-size: 11px;
    font-weight: 850;
    color: #64748b;
    letter-spacing: .03em;
    text-transform: uppercase;
}

.kpi-modal-summary strong {
    display: block;
    font-size: 22px;
    margin: 4px 0;
    color: var(--kpi-navy);
    font-weight: 950;
}

.kpi-modal-summary small {
    color: #64748b;
}

.kpi-modal-grid {
    display: grid;
    grid-template-columns: 1.22fr .78fr;
    gap: 12px;
    margin-bottom: 12px;
}

.kpi-modal-grid.bottom {
    grid-template-columns: .9fr 1.1fr;
}

.kpi-modal-box {
    border: 1px solid var(--kpi-line);
    border-radius: 15px;
    padding: 13px;
    background: #ffffff;
}

.kpi-modal-box.full {
    grid-column: 1 / -1;
}

.kpi-modal-box h4 {
    margin: 0 0 10px;
    color: var(--kpi-navy);
    font-weight: 950;
}

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

.kpi-modal-table th,
.kpi-modal-table td {
    border: 1px solid #e2e8f0;
    padding: 8px;
    text-align: left;
    font-size: 13px;
    color: var(--kpi-text);
}

.kpi-modal-table th {
    background: #f1f5f9;
    color: #334155;
    font-weight: 900;
}

.kpi-modal-table th small {
    display: block;
    margin-top: 3px;
    color: #64748b;
    font-size: 10.5px;
    font-weight: 800;
}

.area-month-table {
    min-width: 1240px;
}

.area-month-table th,
.area-month-table td {
    vertical-align: top;
}

.monthly-kpi-name {
    min-width: 330px;
}

.area-kpi-link {
    display: block;
    width: 100%;
    border: 0;
    background: transparent;
    color: var(--kpi-navy);
    font: inherit;
    font-weight: 950;
    text-align: left;
    cursor: pointer;
    padding: 0;
}

.area-kpi-link:hover {
    text-decoration: underline;
}

.monthly-kpi-name small,
.monthly-cell small,
.period-score-cell small {
    display: block;
    margin-top: 4px;
    color: #64748b;
    font-size: 11px;
    line-height: 1.25;
}

.monthly-cell {
    min-width: 126px;
}

.monthly-cell-actual {
    color: #0f172a;
    font-weight: 900;
    line-height: 1.15;
}

.monthly-cell-score {
    display: inline-block;
    margin-top: 5px;
    font-size: 12px;
    font-weight: 950;
}

.area-month-empty {
    color: #94a3b8;
    text-align: center;
    font-weight: 900;
}

.area-month-note {
    margin: 0 0 10px;
    color: #475569;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.45;
}

.area-month-table-wrap {
    overflow: auto;
    border: 1px solid var(--kpi-line);
    border-radius: 14px;
}

.total-kpi-table-wrap {
    overflow: auto;
    border: 1px solid #cbd5e1;
    border-radius: 16px;
    max-height: 70vh;
    background: #ffffff;
}

.total-kpi-table {
    min-width: 1380px;
    width: 100%;
    border-collapse: collapse;
    font-size: 12.2px;
}

.total-kpi-table th {
    position: sticky;
    top: 0;
    z-index: 3;
    background: linear-gradient(180deg, #08245a, #061a33);
    color: #ffffff;
    border: 1px solid #dbe4ef;
    padding: 9px 8px;
    text-align: center;
    font-weight: 950;
    vertical-align: middle;
}

.total-kpi-table td {
    border: 1px solid #e2e8f0;
    padding: 8px 8px;
    vertical-align: middle;
    color: #0f172a;
    background: #ffffff;
}

.total-kpi-table tbody tr:hover td {
    background: #f8fbff;
}

.total-kpi-no {
    width: 42px;
    text-align: center;
    color: #ffffff !important;
    font-weight: 950;
}

.total-kpi-area {
    min-width: 120px;
    text-align: center;
    font-weight: 950;
    color: #06164a;
}

.total-kpi-name {
    min-width: 250px;
    color: #06164a;
    font-weight: 900;
}

.total-kpi-target,
.total-kpi-unit,
.total-kpi-weight,
.total-kpi-month,
.total-kpi-ytd,
.total-kpi-score {
    text-align: center;
    white-space: nowrap;
}

.total-kpi-score strong {
    font-weight: 950;
}

.total-area-productivity { background: #0b63ce !important; }
.total-area-quality { background: #19a64a !important; }
.total-area-plan { background: #f2b705 !important; color: #06164a !important; }
.total-area-material { background: #f97316 !important; }
.total-area-5s { background: #7c3aed !important; }

.total-area-bg-productivity { background: #eaf3ff !important; }
.total-area-bg-quality { background: #ecfdf3 !important; }
.total-area-bg-plan { background: #fff8db !important; }
.total-area-bg-material { background: #fff1e7 !important; }
.total-area-bg-5s { background: #f4edff !important; }

.total-kpi-note {
    margin: 0 0 12px;
    color: #475569;
    font-size: 12px;
    font-weight: 700;
}

.total-kpi-modal .kpi-modal-title h2 {
    font-size: 28px;
}

.total-kpi-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 18px;
    align-items: center;
    border-radius: 22px;
    padding: 18px 20px;
    margin: 0 0 16px;
    background:
        radial-gradient(circle at 8% 20%, rgba(37, 99, 235, .16), transparent 220px),
        linear-gradient(135deg, #061a33 0%, #08245a 58%, #0f3b84 100%);
    color: #ffffff;
    box-shadow: 0 18px 42px rgba(6, 44, 82, .22);
}

.total-kpi-hero h2 {
    margin: 0 0 8px;
    font-size: 30px;
    line-height: 1.05;
    font-weight: 950;
    letter-spacing: -.4px;
}

.total-kpi-hero p {
    margin: 0;
    color: rgba(255,255,255,.78);
    font-size: 13px;
    font-weight: 750;
    line-height: 1.45;
}

.total-kpi-hero-score {
    min-width: 190px;
    text-align: right;
}

.total-kpi-hero-score span {
    display: block;
    color: rgba(255,255,255,.72);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.total-kpi-hero-score strong {
    display: block;
    margin-top: 4px;
    font-size: 46px;
    line-height: .95;
    font-weight: 950;
}

.total-kpi-hero-score small {
    display: inline-flex;
    margin-top: 8px;
    padding: 5px 10px;
    border-radius: 999px;
    background: rgba(255,255,255,.14);
    color: #ffffff;
    font-size: 12px;
    font-weight: 900;
}

.total-kpi-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin: 0 0 14px;
}

.total-kpi-summary-card {
    border: 1px solid #dbe4ef;
    border-radius: 16px;
    padding: 12px 14px;
    background: linear-gradient(180deg, #ffffff, #f8fafc);
    box-shadow: 0 10px 24px rgba(15, 23, 42, .05);
}

.total-kpi-summary-card span {
    display: block;
    color: #64748b;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .03em;
}

.total-kpi-summary-card strong {
    display: block;
    margin-top: 5px;
    color: #06164a;
    font-size: 24px;
    line-height: 1;
    font-weight: 950;
}

.total-kpi-summary-card small {
    display: block;
    margin-top: 5px;
    color: #64748b;
    font-size: 11px;
    font-weight: 700;
}

.total-kpi-toolbar {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    margin-bottom: 10px;
}

.total-kpi-toolbar-title {
    color: #06164a;
    font-size: 17px;
    font-weight: 950;
}

.total-kpi-legend-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
    color: #475569;
    font-size: 11px;
    font-weight: 800;
}

.total-kpi-legend-inline span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.total-kpi-legend-dot {
    width: 9px;
    height: 9px;
    border-radius: 999px;
    display: inline-block;
}

.total-kpi-table-wrap {
    max-height: 66vh;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.55);
}

.total-kpi-table {
    font-size: 13.5px;
}

.total-kpi-table th {
    padding: 11px 9px;
    font-size: 12.5px;
}

.total-kpi-table td {
    padding: 10px 9px;
}

.total-kpi-score strong {
    font-size: 14px;
}

@media (max-width: 760px) {
    .total-kpi-hero {
        grid-template-columns: 1fr;
    }

    .total-kpi-hero-score {
        text-align: left;
    }

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

    .total-kpi-toolbar {
        align-items: flex-start;
        flex-direction: column;
    }
}

.kpi-modal-box ul {
    margin: 0;
    padding-left: 20px;
    line-height: 1.55;
    color: #334155;
}

.score-status {
    font-weight: 950;
}

.kpi-modal-footnote {
    color: #64748b;
    border-top: 1px solid #e2e8f0;
    padding-top: 10px;
    font-size: 12px;
}

.kpi-normal {
    min-height: 100vh;
    padding: 22px 16px 22px 78px;
}

.kpi-form-panel {
    padding: 14px;
}

.kpi-table-scroll {
    overflow: auto;
    border-radius: 14px;
    border: 1px solid var(--kpi-line);
}

.kpi-input-table {
    min-width: 1120px;
    width: 100%;
    border-collapse: collapse;
    background: #ffffff;
}

.kpi-input-table th,
.kpi-input-table td {
    border-bottom: 1px solid #e2e8f0;
    padding: 10px;
    text-align: left;
    color: var(--kpi-text);
    vertical-align: middle;
}

.kpi-input-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #f1f5f9;
    color: var(--kpi-navy);
    font-size: 12px;
    font-weight: 950;
    text-transform: uppercase;
}

.kpi-input-table tr:hover td {
    background: #f8fafc;
}

.kpi-input-table input {
    width: 100%;
}

.kpi-input-table input[type="number"] {
    width: 132px;
}

.kpi-sticky-save {
    position: sticky;
    bottom: 12px;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    margin-top: 12px;
    border: 1px solid var(--kpi-line);
    border-radius: 16px;
    background: rgba(255,255,255,.96);
    backdrop-filter: blur(8px);
    padding: 12px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, .10);
}

.kpi-sticky-save span {
    color: #334155;
    font-weight: 800;
}

.kpi-method-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}

.kpi-method-card {
    padding: 16px;
}

.kpi-method-card h3 {
    color: var(--kpi-navy);
    margin: 0 0 8px;
    font-weight: 950;
}

.kpi-method-card p {
    color: #334155;
    line-height: 1.45;
}



@media (min-width: 1025px) and (max-height: 850px) {
    .kpi-page { padding-top: 10px; padding-bottom: 10px; }
    .kpi-slide { min-height: auto; padding: 14px 16px; }
    .kpi-header { margin-bottom: 8px; }
    .kpi-header h1 { font-size: clamp(25px, 2.4vw, 34px); }
    .kpi-header p { margin-top: 6px; font-size: 13px; }
    .kpi-stat-strip { margin-bottom: 8px; }
    .kpi-stat-card { min-height: 60px; padding: 8px 10px; }
    .kpi-stat-card span { font-size: 10px; }
    .kpi-stat-card small { font-size: 10px; }
    .kpi-grid { grid-template-rows: 214px 214px 110px; gap: 8px; }
    .kpi-panel { border-radius: 16px; }
    .kpi-score-panel { grid-template-columns: 130px 1fr; padding: 14px 16px; }
    .kpi-icon-circle { width: 118px; height: 118px; border-radius: 30px; }
    
    .kpi-gear { right: 15px; bottom: 12px; font-size: 29px; }
    .kpi-kicker { font-size: 11px; margin-bottom: 4px; }
    .kpi-score-content h2 { font-size: 20px; }
    .kpi-score-big { font-size: clamp(46px, 5vw, 70px); margin: 5px 0 7px; }
    .kpi-status-row { margin-bottom: 7px; }
    .kpi-progress-track { height: 10px; }
    .kpi-scroll-with-title { padding: 34px 12px 7px; }
    .kpi-floating-title { height: 28px; font-size: 13px; }
    .kpi-achievement-item { min-height: 51px; padding: 4px 6px; }
    .kpi-achievement-icon { width: 34px; height: 34px; font-size: 17px; }
    .kpi-achievement-copy strong, .kpi-issue-row strong { font-size: 12px; }
    .kpi-achievement-copy em, .kpi-achievement-copy small, .kpi-issue-row em { font-size: 10.7px; }
    .kpi-area-table th, .kpi-area-table td { padding: 3px 5px; font-size: 11px; }
    .kpi-area-table th { font-size: 9.5px; }
    .kpi-num-dot { width: 21px; height: 21px; font-size: 11px; }
    .kpi-inline-bar { width: 105px; height: 7px; }
    .kpi-issue-row { min-height: 31px; padding: 3px 6px; }
    .kpi-issue-row b { font-size: 10.5px; }
    .kpi-legend table { font-size: 8.5px; }
    .kpi-legend th, .kpi-legend td { padding: 1px 4px; }
    .kpi-bottom article { padding: 8px 10px; }
    .kpi-bottom p { font-size: 10.8px; line-height: 1.28; }
    .kpi-footer { padding-top: 5px; font-size: 10px; }
    .kpi-context { margin-top: 5px; padding: 7px 10px; font-size: 10px; }
}

@media (max-width: 1200px) {
    .kpi-page,
    .kpi-normal {
        padding-left: 16px;
        padding-top: 72px;
    }

    .kpi-header,
    .kpi-normal-header {
        flex-direction: column;
    }

    .kpi-header-right {
        min-width: 0;
        width: 100%;
        justify-items: start;
    }

    .kpi-grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
        grid-template-areas:
            "score"
            "achievements"
            "progress"
            "issues"
            "legend"
            "bottom";
    }

    .kpi-stat-strip {
        grid-template-columns: repeat(2, 1fr);
    }

    .kpi-achievement-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .kpi-bottom,
    .kpi-method-grid {
        grid-template-columns: 1fr 1fr;
    }

    .kpi-score-panel {
        grid-template-columns: 152px 1fr;
    }

    .kpi-icon-circle {
        width: 132px;
        height: 132px;
    }
}

@media (max-width: 720px) {
    .kpi-page,
    .kpi-normal {
        padding: 72px 10px 14px;
    }

    .kpi-slide {
        border-radius: 18px;
        padding: 12px;
    }

    .kpi-filter,
    .kpi-form-filter,
    .kpi-sticky-save {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
    }

    .kpi-filter label,
    .kpi-filter select,
    .kpi-filter input,
    .kpi-filter button,
    .kpi-filter .area-select,
    .kpi-form-filter label,
    .kpi-form-filter select,
    .kpi-form-filter input,
    .kpi-form-filter button {
        width: 100%;
    }

    .kpi-top-nav {
        display: none;
    }

    .kpi-stat-strip,
    .kpi-achievement-grid,
    .kpi-bottom,
    .kpi-modal-summary,
    .kpi-modal-grid,
    .kpi-modal-grid.bottom,
    .kpi-method-grid {
        grid-template-columns: 1fr;
    }

    .kpi-score-panel {
        grid-template-columns: 1fr;
        text-align: left;
    }

    .kpi-score-icon {
        display: none;
    }

    .kpi-score-big {
        font-size: 56px;
        letter-spacing: -2px;
    }

    .kpi-progress-line {
        flex-wrap: wrap;
    }

    .kpi-floating-title,
    .kpi-floating-title.compact,
    .kpi-floating-title.red {
        min-width: 0;
        max-width: calc(100% - 14px);
        font-size: 13px;
    }

    .kpi-area-table,
    .kpi-legend table {
        min-width: 620px;
    }

    .kpi-progress-panel .kpi-panel-scroll,
    .kpi-legend .kpi-panel-scroll {
        overflow-x: auto;
    }

    .kpi-issue-row {
        grid-template-columns: 22px 1fr;
    }

    .kpi-issue-row b {
        grid-column: 2;
    }

    .kpi-bottom article {
        border-right: none;
        border-bottom: 1px solid var(--kpi-line);
    }

    .kpi-footer {
        flex-direction: column;
        align-items: flex-start;
    }

    .kpi-modal {
        padding: 14px;
        border-radius: 16px;
    }

    .kpi-modal-title h2 {
        font-size: 20px;
    }
}
    

/* ===== Dashboard redesign to match Production KPI Progress reference ===== */
.kpi-body-dashboard {
    background:
        radial-gradient(circle at 8% 0%, rgba(37, 99, 235, .10), transparent 28vw),
        radial-gradient(circle at 92% 12%, rgba(22, 163, 74, .07), transparent 28vw),
        linear-gradient(180deg, #fbfdff 0%, #eef4fa 100%);
}

.kpi-body-dashboard .kpi-sidebar-toggle {
    display: grid;
    place-items: center;
    left: 18px;
    top: 18px;
    z-index: 10040;
}

.kpi-body-dashboard .kpi-page {
    padding: 4px;
    min-height: 100vh;
}

.kpi-body-dashboard .kpi-slide {
    width: min(1980px, 100%);
    min-height: calc(100vh - 8px);
    padding: 26px 26px 18px;
    border-radius: 26px;
    box-shadow: 0 28px 70px rgba(15, 23, 42, .10);
    background: rgba(255, 255, 255, .96);
}

.kpi-body-dashboard .kpi-header {
    align-items: flex-start;
    gap: 22px;
    margin-bottom: 14px;
}

.kpi-body-dashboard .kpi-header-left {
    gap: 18px;
}

.kpi-body-dashboard .kpi-blue-mark {
    width: 18px;
    height: 78px;
    margin-top: 0;
    border-radius: 999px;
    box-shadow: 0 12px 26px rgba(37, 99, 235, .30);
}

.kpi-body-dashboard .kpi-header h1 {
    font-size: clamp(38px, 3.05vw, 60px);
    letter-spacing: -1.8px;
    line-height: .98;
    color: #07111f;
}

.kpi-body-dashboard .kpi-header p {
    margin-top: 12px;
    font-size: clamp(15px, 1.12vw, 22px);
    font-weight: 800;
    color: #334155;
}

.kpi-body-dashboard .kpi-header p span {
    margin: 0 14px;
    color: #94a3b8;
}

.kpi-body-dashboard .kpi-header-right {
    min-width: 770px;
    gap: 12px;
}

.kpi-body-dashboard .kpi-filter {
    background: transparent;
    border: 0;
    box-shadow: none;
    padding: 0;
    gap: 16px;
}

.kpi-body-dashboard .kpi-filter label span {
    color: #0b1f3a;
    font-size: 14px;
    font-weight: 950;
}

.kpi-body-dashboard .kpi-filter select,
.kpi-body-dashboard .kpi-filter input {
    width: 160px;
    height: 52px;
    border-radius: 14px;
    border-color: #cfd9e8;
    color: #081f49;
    font-size: 16px;
    font-weight: 750;
    padding: 0 16px;
    background: linear-gradient(180deg, #ffffff, #fbfdff);
}

.kpi-body-dashboard .kpi-filter .area-select {
    width: 190px;
}

.kpi-body-dashboard .kpi-filter button {
    height: 52px;
    min-width: 98px;
    border-radius: 16px;
    font-size: 16px;
    box-shadow: 0 16px 30px rgba(6, 44, 82, .24);
}

.kpi-body-dashboard .kpi-top-nav {
    gap: 14px;
}

.kpi-body-dashboard .kpi-top-nav a {
    min-width: 104px;
    min-height: 40px;
    border-radius: 999px;
    font-size: 15px;
    font-weight: 950;
    background: #ffffff;
    border-color: #d7e0ed;
    box-shadow: 0 6px 18px rgba(15, 23, 42, .04);
}

.kpi-body-dashboard .kpi-top-nav a.active,
.kpi-body-dashboard .kpi-top-nav a:hover {
    background: linear-gradient(135deg, #08245a, #0f3b84);
    border-color: #08245a;
    color: #ffffff;
}

.kpi-body-dashboard .kpi-grid {
    display: grid;
    grid-template-columns: minmax(0, .94fr) minmax(0, 1.06fr);
    grid-template-rows: 310px 290px 270px;
    grid-template-areas:
        "score trend"
        "progress issues"
        "achievements issues";
    gap: 16px 20px;
}

.kpi-body-dashboard .kpi-panel {
    border: 1px solid #dfe7f2;
    border-radius: 22px;
    box-shadow: 0 12px 34px rgba(15, 23, 42, .065);
    background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
}

.kpi-body-dashboard .kpi-score-panel {
    grid-area: score;
    display: block;
    padding: 0;
    border-left: 0;
    overflow: hidden;
    background:
        radial-gradient(circle at 12% 52%, rgba(37, 99, 235, .08), transparent 210px),
        linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
}

.ohi-panel-inner {
    height: 100%;
    display: grid;
    grid-template-rows: auto 1fr;
    padding: 20px 24px 18px;
}

.ohi-title {
    color: #334766;
    font-size: 19px;
    font-weight: 950;
    letter-spacing: .02em;
    text-transform: uppercase;
}

.ohi-body {
    min-height: 0;
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr) 265px;
    align-items: center;
    gap: 22px;
}

.ohi-icon-wrap {
    width: 164px;
    height: 164px;
    border-radius: 50%;
    background: #ffffff;
    border: 1px solid #dce6f3;
    box-shadow: 0 18px 35px rgba(15, 23, 42, .13);
    display: grid;
    place-items: center;
    padding: 23px;
}

.ohi-icon-wrap img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.ohi-score-copy h2 {
    margin: 0 0 7px;
    color: #06164a;
    font-size: 28px;
    line-height: 1;
    font-weight: 950;
}

.ohi-score-value {
    display: block;
    color: #08a83c;
    font-size: clamp(68px, 5vw, 98px);
    line-height: .88;
    font-weight: 950;
    letter-spacing: -4px;
    margin-bottom: 16px;
}

.ohi-score-button {
    border: 0;
    background: transparent;
    padding: 0;
    text-align: left;
    cursor: pointer;
    font-family: inherit;
}

.ohi-score-button:hover {
    filter: brightness(.92);
    transform: translateY(-1px);
}

.ohi-score-button:active {
    transform: translateY(0);
}

.ohi-progress-score-button {
    border: 0;
    background: transparent;
    padding: 0;
    cursor: pointer;
    font-family: inherit;
    font-size: 20px;
    font-weight: 950;
}

.ohi-progress-score-button:hover {
    text-decoration: underline;
}

.ohi-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    color: #06164a;
    font-size: 15px;
    font-weight: 800;
}

.ohi-progress-row {
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: 12px;
    margin-top: 24px;
}

.ohi-progress-track {
    height: 17px;
    border-radius: 999px;
    background: #e7ecf3;
    overflow: hidden;
}

.ohi-progress-track span {
    display: block;
    height: 100%;
    width: var(--progress-width, 0%);
    border-radius: inherit;
    background: linear-gradient(90deg, #07a339, #12c154);
}

.ohi-progress-row b {
    color: #09a63a;
    font-size: 20px;
    font-weight: 950;
}

.ohi-progress-row em {
    color: #475569;
    font-style: normal;
    font-size: 20px;
    font-weight: 900;
}

.score-class-card {
    align-self: center;
    border: 1px solid #d8e2ef;
    border-radius: 18px;
    background: rgba(255, 255, 255, .92);
    padding: 14px 18px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.9);
}

.score-class-card h3 {
    margin: 0 0 10px;
    color: #07164d;
    font-size: 17px;
    font-weight: 950;
}

.score-class-row {
    display: grid;
    grid-template-columns: 18px 82px 1fr;
    align-items: center;
    gap: 8px;
    min-height: 30px;
    border-top: 1px solid #e3eaf4;
    color: #0e2447;
    font-size: 12.5px;
    font-weight: 850;
}

.score-class-row:first-of-type {
    border-top: 0;
}

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

.dot-vg { background: #009b36; }
.dot-good { background: #5fcf7a; }
.dot-fair { background: #f6b10a; }
.dot-need { background: #fb8500; }
.dot-poor { background: #ed0b16; }

.kpi-panel-title {
    display: flex;
    align-items: center;
    gap: 14px;
    color: #07164d;
    font-size: 26px;
    line-height: 1.1;
    font-weight: 950;
    padding: 20px 26px 10px;
}

.kpi-panel-title-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: linear-gradient(135deg, #08245a, #0f3b84);
    color: #ffffff;
    display: grid;
    place-items: center;
    font-size: 22px;
    box-shadow: 0 12px 22px rgba(6, 44, 82, .20);
}

.kpi-body-dashboard .kpi-progress-panel {
    grid-area: progress;
}

.kpi-body-dashboard .kpi-progress-panel .kpi-panel-scroll,
.kpi-body-dashboard .kpi-achievements .kpi-panel-scroll,
.kpi-body-dashboard .kpi-issues .kpi-panel-scroll {
    height: calc(100% - 72px);
    padding: 0 22px 16px;
}

.kpi-body-dashboard .kpi-area-table {
    font-size: 15px;
}

.kpi-body-dashboard .kpi-area-table th,
.kpi-body-dashboard .kpi-area-table td {
    padding: 11px 10px;
    line-height: 1.15;
}

.kpi-body-dashboard .kpi-area-table th {
    font-size: 12px;
    color: #07164d;
}

.kpi-body-dashboard .kpi-num-dot {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: #08245a;
}

.kpi-body-dashboard .kpi-inline-bar {
    width: 170px;
    height: 12px;
    margin-right: 12px;
}

.kpi-trend-panel {
    grid-area: trend;
    overflow: hidden;
    padding-bottom: 8px;
}

.trend-chart-wrap {
    height: calc(100% - 72px);
    padding: 0 30px 18px;
}

.trend-chart {
    width: 100%;
    height: 100%;
    min-height: 210px;
    display: block;
}

.trend-click-target {
    cursor: pointer;
    outline: none;
}

.trend-click-target:hover .trend-point-dot,
.trend-click-target:focus-visible .trend-point-dot {
    filter: drop-shadow(0 8px 14px rgba(15, 23, 42, .26));
    stroke-width: 5;
}

.trend-hit-area {
    fill: transparent;
}

.trend-point-dot {
    transition: filter .16s ease, stroke-width .16s ease;
}

.trend-click-target:hover .trend-score-label,
.trend-click-target:focus-visible .trend-score-label,
.trend-click-target:hover .trend-month-label,
.trend-click-target:focus-visible .trend-month-label {
    text-decoration: underline;
}

.trend-axis-label,
.trend-month-label {
    fill: #07164d;
    font-size: 20px;
    font-weight: 900;
}

.trend-score-label {
    font-size: 24px;
    font-weight: 950;
}

.trend-last-label {
    font-size: 36px;
    font-weight: 950;
    pointer-events: none;
}

.kpi-body-dashboard .kpi-issues {
    grid-area: issues;
    border-left: 0;
    border-color: #ffd1d1;
    background:
        radial-gradient(circle at 0% 0%, rgba(220, 38, 38, .08), transparent 280px),
        linear-gradient(180deg, #fffafa 0%, #fff6f6 100%);
}

.kpi-body-dashboard .kpi-issues .kpi-panel-title-icon {
    background: linear-gradient(135deg, #c1121f, #e11d48);
}

.kpi-body-dashboard .kpi-issues .kpi-panel-scroll {
    border: 1px solid #ffd4d4;
    border-radius: 18px;
    margin: 0 14px 14px;
    height: calc(100% - 88px);
    padding: 0;
    background: rgba(255,255,255,.72);
}

.issue-card {
    width: 100%;
    min-height: 86px;
    border: 0;
    border-bottom: 1px solid #e8eef6;
    background: transparent;
    display: grid;
    grid-template-columns: 78px minmax(0, 1fr) 220px 38px;
    align-items: center;
    gap: 16px;
    padding: 12px 18px;
    text-align: left;
    cursor: pointer;
}

.issue-card:hover {
    background: #fff7f7;
}

.issue-card:last-child {
    border-bottom: 0;
}

.issue-alert {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: #e11d28;
    background: #fff1f1;
    border: 1px solid #ffd7d7;
    font-size: 28px;
    font-weight: 950;
}

.issue-copy strong,
.issue-value strong {
    display: block;
    color: #07164d;
    font-size: 19px;
    line-height: 1.16;
    font-weight: 950;
}

.issue-copy b {
    display: block;
    color: #ff0000;
    font-size: 15px;
    margin-top: 7px;
    font-weight: 950;
}

.issue-value {
    text-align: right;
}

.issue-value small {
    display: block;
    margin-top: 6px;
    color: #40587b;
    font-size: 14px;
    line-height: 1.18;
}

.issue-arrow {
    color: #40587b;
    font-size: 46px;
    line-height: 1;
}

.kpi-body-dashboard .kpi-achievements {
    grid-area: achievements;
}

.achievement-grid-v2 {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px 16px;
}

.achievement-card {
    min-height: 88px;
    border: 0;
    border-right: 1px solid #e1e8f2;
    background: transparent;
    display: grid;
    grid-template-columns: 66px 1fr;
    align-items: center;
    gap: 14px;
    padding: 8px 8px;
    text-align: left;
    cursor: pointer;
    border-radius: 16px;
}

.achievement-card:hover {
    background: #f8fbff;
}

.achievement-avatar {
    width: 62px;
    height: 62px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: #07164d;
    background: linear-gradient(145deg, #eef6ff, #ffffff);
    border: 1px solid #dbe8f8;
    box-shadow: inset 0 1px 0 #ffffff;
    font-size: 18px;
    font-weight: 950;
}

.achievement-card.is-good .achievement-avatar {
    color: #078c35;
    background: linear-gradient(145deg, #dcfce7, #f9fffb);
    border-color: #c4f2d0;
}

.achievement-card.is-bad .achievement-avatar {
    color: #e11d28;
    background: linear-gradient(145deg, #fff1f1, #ffffff);
    border-color: #ffd1d1;
}

.achievement-copy strong {
    display: block;
    color: #07164d;
    font-size: 15px;
    line-height: 1.18;
    font-weight: 950;
}

.achievement-copy em {
    display: block;
    margin-top: 7px;
    color: #07164d;
    font-style: normal;
    font-size: 16px;
    font-weight: 950;
}

.achievement-copy small {
    display: block;
    margin-top: 7px;
    color: #40587b;
    font-size: 13px;
    line-height: 1.2;
    font-weight: 750;
}

.achievement-copy b {
    font-weight: 950;
}

.achievement-copy b.meet,
.status-good {
    color: #08a83c;
}

.achievement-copy b.miss,
.status-bad {
    color: #ff0000;
}

.kpi-body-dashboard .kpi-legend,
.kpi-body-dashboard .kpi-bottom,
.kpi-body-dashboard .kpi-floating-title {
    display: none;
}

.kpi-body-dashboard .kpi-footer,
.kpi-body-dashboard .kpi-context {
    display: none;
}

@media (max-width: 1500px) {
    .kpi-body-dashboard .kpi-header-right { min-width: 640px; }
    .kpi-body-dashboard .kpi-filter select,
    .kpi-body-dashboard .kpi-filter input { width: 128px; }
    .kpi-body-dashboard .kpi-filter .area-select { width: 160px; }
    .ohi-body { grid-template-columns: 145px minmax(0, 1fr) 235px; gap: 16px; }
    .ohi-icon-wrap { width: 136px; height: 136px; }
    .ohi-score-value { font-size: 74px; }
    .score-class-row { grid-template-columns: 18px 70px 1fr; font-size: 11px; }
    .kpi-body-dashboard .kpi-grid { grid-template-rows: 280px 270px 250px; }
    .achievement-grid-v2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .issue-card { grid-template-columns: 66px minmax(0, 1fr) 190px 30px; }
}

@media (max-width: 1180px) {
    .kpi-body-dashboard .kpi-page { padding: 10px; }
    .kpi-body-dashboard .kpi-slide { padding: 16px; }
    .kpi-body-dashboard .kpi-header { flex-direction: column; }
    .kpi-body-dashboard .kpi-header-right { min-width: 0; width: 100%; justify-items: stretch; }
    .kpi-body-dashboard .kpi-filter { flex-wrap: wrap; }
    .kpi-body-dashboard .kpi-grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
        grid-template-areas:
            "score"
            "trend"
            "progress"
            "issues"
            "achievements";
    }
    .kpi-body-dashboard .kpi-score-panel,
    .kpi-trend-panel,
    .kpi-body-dashboard .kpi-progress-panel,
    .kpi-body-dashboard .kpi-issues,
    .kpi-body-dashboard .kpi-achievements { min-height: 320px; }
}

@media (max-width: 760px) {
    .kpi-body-dashboard .kpi-header h1 { font-size: 36px; }
    .kpi-body-dashboard .kpi-header p { font-size: 14px; }
    .kpi-body-dashboard .kpi-filter,
    .kpi-body-dashboard .kpi-top-nav { width: 100%; }
    .kpi-body-dashboard .kpi-filter label,
    .kpi-body-dashboard .kpi-filter select,
    .kpi-body-dashboard .kpi-filter input,
    .kpi-body-dashboard .kpi-filter .area-select,
    .kpi-body-dashboard .kpi-filter button { width: 100%; }
    .kpi-body-dashboard .kpi-top-nav { display: grid; grid-template-columns: repeat(2, 1fr); }
    .ohi-body { grid-template-columns: 1fr; align-items: start; }
    .ohi-icon-wrap { display: none; }
    .score-class-card { width: 100%; }
    .ohi-score-value { font-size: 56px; }
    .achievement-grid-v2 { grid-template-columns: 1fr; }
    .issue-card { grid-template-columns: 58px 1fr; }
    .issue-value, .issue-arrow { grid-column: 2; text-align: left; }
    .kpi-body-dashboard .kpi-area-table { min-width: 720px; }
}

    

/* ===== RESPONSIVE OVERRIDE V2: dashboard tidak lagi maksa ukuran poster 16:9 di semua device ===== */
@media (min-width: 1181px) {
    .kpi-body-dashboard {
        overflow: hidden;
    }

    .kpi-body-dashboard .kpi-slide {
        height: calc(100vh - 8px);
        min-height: 720px;
        overflow: hidden;
    }

    .kpi-body-dashboard .kpi-grid {
        height: calc(100vh - 170px);
        min-height: 540px;
        grid-template-rows: minmax(210px, 1.02fr) minmax(195px, .95fr) minmax(185px, .88fr);
    }

    .kpi-body-dashboard .kpi-score-panel,
    .kpi-trend-panel,
    .kpi-body-dashboard .kpi-progress-panel,
    .kpi-body-dashboard .kpi-issues,
    .kpi-body-dashboard .kpi-achievements {
        min-height: 0;
    }
}

@media (min-width: 1181px) and (max-height: 820px) {
    .kpi-body-dashboard .kpi-slide {
        padding: 14px 18px 12px;
        min-height: 0;
    }

    .kpi-body-dashboard .kpi-header {
        margin-bottom: 10px;
        gap: 14px;
    }

    .kpi-body-dashboard .kpi-blue-mark {
        width: 14px;
        height: 58px;
    }

    .kpi-body-dashboard .kpi-header h1 {
        font-size: clamp(32px, 2.65vw, 48px);
        letter-spacing: -1.4px;
    }

    .kpi-body-dashboard .kpi-header p {
        margin-top: 7px;
        font-size: 14px;
    }

    .kpi-body-dashboard .kpi-header-right {
        min-width: 610px;
        gap: 8px;
    }

    .kpi-body-dashboard .kpi-filter {
        gap: 10px;
    }

    .kpi-body-dashboard .kpi-filter label span {
        font-size: 11px;
    }

    .kpi-body-dashboard .kpi-filter select,
    .kpi-body-dashboard .kpi-filter input {
        height: 42px;
        width: 118px;
        border-radius: 12px;
        font-size: 13px;
        padding: 0 10px;
    }

    .kpi-body-dashboard .kpi-filter .area-select {
        width: 148px;
    }

    .kpi-body-dashboard .kpi-filter button {
        height: 42px;
        min-width: 82px;
        font-size: 13px;
        border-radius: 12px;
    }

    .kpi-body-dashboard .kpi-top-nav {
        gap: 8px;
    }

    .kpi-body-dashboard .kpi-top-nav a {
        min-width: 84px;
        min-height: 32px;
        padding: 4px 10px;
        font-size: 12px;
    }

    .kpi-body-dashboard .kpi-grid {
        height: calc(100vh - 126px);
        gap: 10px 12px;
    }

    .ohi-panel-inner {
        padding: 14px 16px 12px;
    }

    .ohi-title {
        font-size: 14px;
    }

    .ohi-body {
        grid-template-columns: 118px minmax(0, 1fr) 210px;
        gap: 13px;
    }

    .ohi-icon-wrap {
        width: 112px;
        height: 112px;
        padding: 18px;
    }

    .ohi-score-copy h2 {
        font-size: 20px;
    }

    .ohi-score-value {
        font-size: clamp(50px, 4.2vw, 72px);
        margin-bottom: 10px;
    }

    .ohi-meta {
        gap: 8px;
        font-size: 12px;
    }

    .ohi-progress-row {
        margin-top: 14px;
        gap: 8px;
    }

    .ohi-progress-track {
        height: 12px;
    }

    .ohi-progress-row b,
    .ohi-progress-row em {
        font-size: 15px;
    }

    .score-class-card {
        padding: 10px 12px;
        border-radius: 14px;
    }

    .score-class-card h3 {
        font-size: 13px;
        margin-bottom: 6px;
    }

    .score-class-row {
        min-height: 23px;
        grid-template-columns: 14px 62px 1fr;
        gap: 6px;
        font-size: 9.8px;
    }

    .score-dot {
        width: 8px;
        height: 8px;
    }

    .kpi-panel-title {
        padding: 12px 16px 8px;
        gap: 10px;
        font-size: 18px;
    }

    .kpi-panel-title-icon {
        width: 32px;
        height: 32px;
        border-radius: 10px;
        font-size: 17px;
    }

    .kpi-body-dashboard .kpi-progress-panel .kpi-panel-scroll,
    .kpi-body-dashboard .kpi-achievements .kpi-panel-scroll,
    .kpi-body-dashboard .kpi-issues .kpi-panel-scroll {
        height: calc(100% - 52px);
        padding: 0 14px 10px;
    }

    .kpi-body-dashboard .kpi-area-table {
        font-size: 12px;
    }

    .kpi-body-dashboard .kpi-area-table th,
    .kpi-body-dashboard .kpi-area-table td {
        padding: 6px 6px;
    }

    .kpi-body-dashboard .kpi-area-table th {
        font-size: 9.5px;
    }

    .kpi-body-dashboard .kpi-num-dot {
        width: 23px;
        height: 23px;
        font-size: 11px;
    }

    .kpi-body-dashboard .kpi-inline-bar {
        width: 112px;
        height: 8px;
        margin-right: 8px;
    }

    .trend-chart-wrap {
        height: calc(100% - 52px);
        padding: 0 16px 10px;
    }

    .trend-chart {
        min-height: 160px;
    }

    .trend-axis-label,
    .trend-month-label {
        font-size: 12px;
    }

    .trend-score-label {
        font-size: 12px;
    }

    .trend-last-label {
        font-size: 19px;
    }

    .kpi-body-dashboard .kpi-issues .kpi-panel-scroll {
        height: calc(100% - 60px);
        margin: 0 10px 10px;
    }

    .issue-card {
        min-height: 56px;
        grid-template-columns: 48px minmax(0, 1fr) 150px 24px;
        gap: 10px;
        padding: 7px 12px;
    }

    .issue-alert {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }

    .issue-copy strong,
    .issue-value strong {
        font-size: 14px;
    }

    .issue-copy b {
        margin-top: 4px;
        font-size: 11px;
    }

    .issue-value small {
        margin-top: 3px;
        font-size: 10.5px;
    }

    .issue-arrow {
        font-size: 30px;
    }

    .achievement-grid-v2 {
        gap: 8px 10px;
    }

    .achievement-card {
        min-height: 62px;
        grid-template-columns: 46px 1fr;
        gap: 9px;
        padding: 4px 6px;
        border-radius: 12px;
    }

    .achievement-avatar {
        width: 42px;
        height: 42px;
        font-size: 13px;
    }

    .achievement-copy strong {
        font-size: 12px;
    }

    .achievement-copy em {
        margin-top: 4px;
        font-size: 12px;
    }

    .achievement-copy small {
        margin-top: 4px;
        font-size: 10.5px;
    }
}

@media (max-width: 1180px) {
    .kpi-body-dashboard {
        overflow-x: hidden;
    }

    .kpi-body-dashboard .kpi-page {
        padding: 10px;
    }

    .kpi-body-dashboard .kpi-slide {
        min-height: 0;
        height: auto;
        overflow: visible;
        padding: 16px;
    }

    .kpi-body-dashboard .kpi-header {
        gap: 14px;
        margin-bottom: 14px;
    }

    .kpi-body-dashboard .kpi-header-left {
        width: 100%;
    }

    .kpi-body-dashboard .kpi-header-right {
        width: 100%;
        min-width: 0;
        justify-items: stretch;
    }

    .kpi-body-dashboard .kpi-filter {
        display: grid;
        grid-template-columns: repeat(5, minmax(0, 1fr));
        align-items: end;
        gap: 10px;
        width: 100%;
    }

    .kpi-body-dashboard .kpi-filter label,
    .kpi-body-dashboard .kpi-filter select,
    .kpi-body-dashboard .kpi-filter input,
    .kpi-body-dashboard .kpi-filter .area-select,
    .kpi-body-dashboard .kpi-filter button {
        width: 100%;
        min-width: 0;
    }

    .kpi-body-dashboard .kpi-top-nav {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        justify-content: flex-start;
        padding-bottom: 2px;
        scrollbar-width: thin;
    }

    .kpi-body-dashboard .kpi-top-nav a {
        flex: 0 0 auto;
    }

    .kpi-body-dashboard .kpi-grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
        grid-template-areas:
            "score"
            "trend"
            "progress"
            "issues"
            "achievements";
        gap: 14px;
    }

    .kpi-body-dashboard .kpi-score-panel,
    .kpi-trend-panel,
    .kpi-body-dashboard .kpi-progress-panel,
    .kpi-body-dashboard .kpi-issues,
    .kpi-body-dashboard .kpi-achievements {
        min-height: 0;
        height: auto;
    }

    .ohi-panel-inner {
        min-height: 0;
    }

    .kpi-body-dashboard .kpi-progress-panel .kpi-panel-scroll,
    .kpi-body-dashboard .kpi-achievements .kpi-panel-scroll,
    .kpi-body-dashboard .kpi-issues .kpi-panel-scroll {
        height: auto;
        max-height: none;
    }

    .trend-chart-wrap {
        height: 300px;
    }

    .kpi-body-dashboard .kpi-issues .kpi-panel-scroll {
        max-height: 520px;
        overflow-y: auto;
    }
}

@media (max-width: 900px) {
    .kpi-body-dashboard .kpi-header h1 {
        font-size: clamp(32px, 7vw, 44px);
    }

    .kpi-body-dashboard .kpi-header p {
        font-size: 14px;
        line-height: 1.35;
    }

    .kpi-body-dashboard .kpi-filter {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .kpi-body-dashboard .kpi-filter label:nth-of-type(4) {
        grid-column: span 2;
    }

    .kpi-body-dashboard .kpi-filter button {
        grid-column: span 2;
    }

    .ohi-body {
        grid-template-columns: 132px minmax(0, 1fr);
        align-items: center;
    }

    .score-class-card {
        grid-column: 1 / -1;
        width: 100%;
    }

    .achievement-grid-v2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .issue-card {
        grid-template-columns: 58px minmax(0, 1fr) 170px 24px;
        gap: 10px;
        padding: 12px 14px;
    }

    .issue-copy strong,
    .issue-value strong {
        font-size: 16px;
    }

    .issue-arrow {
        font-size: 32px;
    }
}

@media (max-width: 760px) {
    .kpi-body-dashboard .kpi-page {
        padding: 8px;
    }

    .kpi-body-dashboard .kpi-slide {
        padding: 12px;
        border-radius: 18px;
        box-shadow: 0 16px 38px rgba(15, 23, 42, .08);
    }

    .kpi-body-dashboard .kpi-header {
        gap: 12px;
    }

    .kpi-body-dashboard .kpi-header-left {
        gap: 10px;
    }

    .kpi-body-dashboard .kpi-blue-mark {
        width: 10px;
        height: 54px;
    }

    .kpi-body-dashboard .kpi-header h1 {
        font-size: clamp(27px, 9vw, 36px);
        letter-spacing: -1px;
        line-height: 1;
    }

    .kpi-body-dashboard .kpi-header p {
        margin-top: 8px;
        font-size: 12.5px;
        line-height: 1.35;
    }

    .kpi-body-dashboard .kpi-header p span {
        margin: 0 6px;
    }

    .kpi-body-dashboard .kpi-filter {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 9px;
        padding: 10px;
        border: 1px solid #dbe4ef;
        border-radius: 16px;
        background: #f8fafc;
    }

    .kpi-body-dashboard .kpi-filter label span {
        font-size: 10.5px;
    }

    .kpi-body-dashboard .kpi-filter select,
    .kpi-body-dashboard .kpi-filter input {
        height: 42px;
        border-radius: 12px;
        font-size: 13px;
        padding: 0 10px;
    }

    .kpi-body-dashboard .kpi-filter button {
        height: 42px;
        border-radius: 12px;
        font-size: 13px;
    }

    .kpi-body-dashboard .kpi-top-nav {
        display: flex;
        gap: 8px;
        overflow-x: auto;
        padding: 2px 0 6px;
    }

    .kpi-body-dashboard .kpi-top-nav a {
        min-width: 88px;
        min-height: 34px;
        font-size: 12px;
        padding: 5px 12px;
    }

    .ohi-panel-inner {
        padding: 15px;
    }

    .ohi-title {
        font-size: 13px;
        margin-bottom: 12px;
    }

    .ohi-body {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .ohi-icon-wrap {
        display: none;
    }

    .ohi-score-copy h2 {
        font-size: 18px;
        margin-bottom: 6px;
    }

    .ohi-score-value {
        font-size: clamp(46px, 15vw, 62px);
        letter-spacing: -2px;
        margin-bottom: 12px;
    }

    .ohi-meta {
        gap: 7px;
        font-size: 12px;
    }

    .ohi-meta span:nth-child(3) {
        display: none;
    }

    .ohi-progress-row {
        grid-template-columns: 1fr;
        gap: 7px;
        margin-top: 14px;
    }

    .ohi-progress-track {
        height: 12px;
    }

    .ohi-progress-row b,
    .ohi-progress-row em {
        font-size: 14px;
    }

    .score-class-card {
        padding: 11px 12px;
        border-radius: 14px;
    }

    .score-class-card h3 {
        font-size: 13px;
    }

    .score-class-row {
        grid-template-columns: 15px 72px 1fr;
        min-height: 26px;
        font-size: 10.5px;
        gap: 6px;
    }

    .kpi-panel-title {
        padding: 14px 14px 8px;
        gap: 9px;
        font-size: 18px;
    }

    .kpi-panel-title-icon {
        width: 34px;
        height: 34px;
        font-size: 17px;
        border-radius: 10px;
    }

    .trend-chart-wrap {
        height: 260px;
        overflow-x: auto;
        padding: 0 10px 12px;
    }

    .trend-chart {
        min-width: 620px;
        min-height: 240px;
    }

    .trend-axis-label,
    .trend-month-label {
        font-size: 12px;
    }

    .trend-score-label {
        font-size: 12px;
    }

    .trend-last-label {
        font-size: 20px;
    }

    .kpi-body-dashboard .kpi-progress-panel .kpi-panel-scroll {
        overflow-x: auto;
        padding: 0 12px 12px;
    }

    .kpi-body-dashboard .kpi-area-table {
        min-width: 680px;
        font-size: 12px;
    }

    .kpi-body-dashboard .kpi-area-table th,
    .kpi-body-dashboard .kpi-area-table td {
        padding: 8px 7px;
    }

    .kpi-body-dashboard .kpi-inline-bar {
        width: 110px;
        height: 8px;
    }

    .kpi-body-dashboard .kpi-issues .kpi-panel-scroll {
        margin: 0 10px 12px;
        max-height: 450px;
    }

    .issue-card {
        grid-template-columns: 44px minmax(0, 1fr);
        gap: 10px;
        min-height: 0;
        padding: 12px;
    }

    .issue-alert {
        width: 40px;
        height: 40px;
        font-size: 19px;
    }

    .issue-copy strong,
    .issue-value strong {
        font-size: 15px;
    }

    .issue-copy b {
        font-size: 12px;
        margin-top: 4px;
    }

    .issue-value,
    .issue-arrow {
        grid-column: 2;
        text-align: left;
    }

    .issue-value small {
        font-size: 11.5px;
        margin-top: 3px;
    }

    .issue-arrow {
        display: none;
    }

    .kpi-body-dashboard .kpi-achievements .kpi-panel-scroll {
        padding: 0 12px 12px;
    }

    .achievement-grid-v2 {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .achievement-card {
        min-height: 70px;
        grid-template-columns: 48px 1fr;
        gap: 10px;
        padding: 8px 6px;
        border-right: 0;
        border-bottom: 1px solid #e1e8f2;
        border-radius: 12px;
    }

    .achievement-card:last-child {
        border-bottom: 0;
    }

    .achievement-avatar {
        width: 44px;
        height: 44px;
        font-size: 13px;
    }

    .achievement-copy strong {
        font-size: 13px;
    }

    .achievement-copy em {
        margin-top: 4px;
        font-size: 13px;
    }

    .achievement-copy small {
        margin-top: 4px;
        font-size: 11.5px;
    }

    .kpi-modal {
        width: 96vw;
        max-height: 92vh;
        padding: 14px;
    }

    .kpi-modal-summary,
    .kpi-modal-grid,
    .kpi-modal-grid.bottom {
        grid-template-columns: 1fr;
    }

    .kpi-modal-table {
        min-width: 620px;
    }

    .kpi-modal-box {
        overflow-x: auto;
    }
}

@media (max-width: 480px) {
    .kpi-body-dashboard .kpi-page {
        padding: 6px;
    }

    .kpi-body-dashboard .kpi-slide {
        padding: 10px;
        border-radius: 16px;
    }

    .kpi-body-dashboard .kpi-header-left {
        align-items: flex-start;
    }

    .kpi-body-dashboard .kpi-blue-mark {
        height: 48px;
    }

    .kpi-body-dashboard .kpi-header h1 {
        font-size: 28px;
    }

    .kpi-body-dashboard .kpi-header p {
        font-size: 11.5px;
    }

    .kpi-body-dashboard .kpi-filter {
        grid-template-columns: 1fr;
    }

    .kpi-body-dashboard .kpi-filter label:nth-of-type(4),
    .kpi-body-dashboard .kpi-filter button {
        grid-column: auto;
    }

    .kpi-body-dashboard .kpi-top-nav a {
        min-width: 78px;
        font-size: 11.5px;
    }

    .ohi-score-value {
        font-size: 44px;
    }

    .ohi-meta {
        align-items: flex-start;
        flex-direction: column;
    }

    .score-class-row {
        grid-template-columns: 14px 68px 1fr;
        font-size: 10px;
    }

    .kpi-panel-title {
        font-size: 16px;
    }

    .trend-chart-wrap {
        height: 240px;
    }

    .trend-chart {
        min-width: 560px;
    }

    .issue-card {
        grid-template-columns: 38px minmax(0, 1fr);
        padding: 10px;
    }

    .issue-alert {
        width: 34px;
        height: 34px;
        font-size: 16px;
    }
}


/* ===== REVISION: score color follows KPI Score Classification, chart clean, focused area no inner scroll ===== */
.ohi-score-value.score-theme-very-good { color: #009b36; }
.ohi-score-value.score-theme-good { color: #08a83c; }
.ohi-score-value.score-theme-fair { color: #f6b10a; }
.ohi-score-value.score-theme-need { color: #fb8500; }
.ohi-score-value.score-theme-poor { color: #ed0b16; }
.ohi-score-value.score-theme-nodata { color: #64748b; }

.score-theme-text-very-good { color: #009b36 !important; }
.score-theme-text-good { color: #08a83c !important; }
.score-theme-text-fair { color: #f6b10a !important; }
.score-theme-text-need { color: #fb8500 !important; }
.score-theme-text-poor { color: #ed0b16 !important; }
.score-theme-text-nodata { color: #64748b !important; }

.ohi-progress-track span {
    background: var(--progress-fill, linear-gradient(90deg, #08a83c, #5fcf7a));
}

.trend-chart-wrap {
    overflow: hidden;
}

.trend-chart {
    filter: drop-shadow(0 10px 18px rgba(15, 23, 42, .04));
}

.trend-axis-label,
.trend-month-label,
.trend-score-label,
.trend-last-label {
    paint-order: stroke;
    stroke: #ffffff;
    stroke-width: 4px;
    stroke-linejoin: round;
}

.score-theme-svg-very-good { fill: #009b36; }
.score-theme-svg-good { fill: #08a83c; }
.score-theme-svg-fair { fill: #f6b10a; }
.score-theme-svg-need { fill: #fb8500; }
.score-theme-svg-poor { fill: #ed0b16; }
.score-theme-svg-nodata { fill: #64748b; }

.kpi-body-dashboard .kpi-progress-panel .kpi-panel-scroll {
    overflow-y: hidden;
}

.kpi-body-dashboard .kpi-progress-panel .kpi-area-table {
    table-layout: fixed;
}

.kpi-body-dashboard .kpi-progress-panel .kpi-area-table th:nth-child(1),
.kpi-body-dashboard .kpi-progress-panel .kpi-area-table td:nth-child(1) { width: 46px; }
.kpi-body-dashboard .kpi-progress-panel .kpi-area-table th:nth-child(2),
.kpi-body-dashboard .kpi-progress-panel .kpi-area-table td:nth-child(2) { width: 38%; }
.kpi-body-dashboard .kpi-progress-panel .kpi-area-table th:nth-child(3),
.kpi-body-dashboard .kpi-progress-panel .kpi-area-table td:nth-child(3) { width: 31%; }
.kpi-body-dashboard .kpi-progress-panel .kpi-area-table th:nth-child(4),
.kpi-body-dashboard .kpi-progress-panel .kpi-area-table td:nth-child(4) { width: 64px; }
.kpi-body-dashboard .kpi-progress-panel .kpi-area-table th:nth-child(5),
.kpi-body-dashboard .kpi-progress-panel .kpi-area-table td:nth-child(5) { width: 92px; }

.achievement-card.theme-very-good .achievement-avatar,
.achievement-card.theme-good .achievement-avatar {
    color: #078c35;
    background: linear-gradient(145deg, #dcfce7, #f9fffb);
    border-color: #c4f2d0;
}

.achievement-card.theme-fair .achievement-avatar {
    color: #a16207;
    background: linear-gradient(145deg, #fef3c7, #ffffff);
    border-color: #fde68a;
}

.achievement-card.theme-need .achievement-avatar {
    color: #c2410c;
    background: linear-gradient(145deg, #ffedd5, #ffffff);
    border-color: #fed7aa;
}

.achievement-card.theme-poor .achievement-avatar {
    color: #e11d28;
    background: linear-gradient(145deg, #fff1f1, #ffffff);
    border-color: #ffd1d1;
}

.achievement-copy b.score-very-good,
.achievement-copy b.score-good { color: #08a83c; }
.achievement-copy b.score-fair { color: #f6b10a; }
.achievement-copy b.score-need { color: #fb8500; }
.achievement-copy b.score-poor { color: #ff0000; }
.achievement-copy b.score-nodata { color: #64748b; }

@media (min-width: 1181px) and (max-height: 820px) {
    .kpi-body-dashboard .kpi-progress-panel .kpi-panel-scroll {
        overflow: hidden;
    }

    .kpi-body-dashboard .kpi-progress-panel .kpi-area-table th,
    .kpi-body-dashboard .kpi-progress-panel .kpi-area-table td {
        padding-top: 5px;
        padding-bottom: 5px;
    }
}

@media (max-width: 760px) {
    .kpi-body-dashboard .kpi-progress-panel .kpi-panel-scroll {
        overflow-x: auto;
        overflow-y: hidden;
    }
}



/* ===== REVISION V3: focused canvas wider + trend chart not cropped ===== */
@media (min-width: 1181px) {
    .kpi-body-dashboard .kpi-header {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(500px, 44vw);
        align-items: start;
    }

    .kpi-body-dashboard .kpi-header-left,
    .kpi-body-dashboard .kpi-header-right {
        min-width: 0;
        width: 100%;
    }

    .kpi-body-dashboard .kpi-header-right {
        justify-items: stretch;
    }

    .kpi-body-dashboard .kpi-filter {
        display: grid;
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 8px;
        width: 100%;
    }

    .kpi-body-dashboard .kpi-filter label,
    .kpi-body-dashboard .kpi-filter select,
    .kpi-body-dashboard .kpi-filter input,
    .kpi-body-dashboard .kpi-filter .area-select,
    .kpi-body-dashboard .kpi-filter button {
        width: 100%;
        min-width: 0;
    }

    .kpi-body-dashboard .kpi-top-nav {
        flex-wrap: nowrap;
        justify-content: flex-start;
        overflow-x: auto;
        overflow-y: hidden;
        padding-bottom: 2px;
        scrollbar-width: thin;
    }

    .kpi-body-dashboard .kpi-top-nav a {
        flex: 0 0 auto;
    }

    .kpi-body-dashboard .kpi-grid {
        grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr);
        grid-template-rows: minmax(220px, 1fr) minmax(238px, 1.08fr) minmax(128px, .58fr);
    }

    .kpi-body-dashboard .kpi-progress-panel {
        min-width: 0;
    }

    .kpi-body-dashboard .kpi-progress-panel .kpi-panel-scroll {
        height: calc(100% - 56px);
        padding: 0 18px 10px;
        overflow: hidden;
    }

    .kpi-body-dashboard .kpi-progress-panel .kpi-area-table {
        width: 100%;
        min-width: 0;
        table-layout: fixed;
        font-size: 13px;
    }

    .kpi-body-dashboard .kpi-progress-panel .kpi-area-table th,
    .kpi-body-dashboard .kpi-progress-panel .kpi-area-table td {
        padding: 7px 8px;
        white-space: normal;
        word-break: normal;
    }

    .kpi-body-dashboard .kpi-progress-panel .kpi-area-table th:nth-child(1),
    .kpi-body-dashboard .kpi-progress-panel .kpi-area-table td:nth-child(1) { width: 42px; }
    .kpi-body-dashboard .kpi-progress-panel .kpi-area-table th:nth-child(2),
    .kpi-body-dashboard .kpi-progress-panel .kpi-area-table td:nth-child(2) { width: 34%; }
    .kpi-body-dashboard .kpi-progress-panel .kpi-area-table th:nth-child(3),
    .kpi-body-dashboard .kpi-progress-panel .kpi-area-table td:nth-child(3) { width: 38%; }
    .kpi-body-dashboard .kpi-progress-panel .kpi-area-table th:nth-child(4),
    .kpi-body-dashboard .kpi-progress-panel .kpi-area-table td:nth-child(4) { width: 54px; }
    .kpi-body-dashboard .kpi-progress-panel .kpi-area-table th:nth-child(5),
    .kpi-body-dashboard .kpi-progress-panel .kpi-area-table td:nth-child(5) { width: 82px; }

    .kpi-body-dashboard .kpi-progress-panel .kpi-inline-bar {
        width: min(190px, 52%);
        height: 10px;
        margin-right: 8px;
    }

    .kpi-trend-panel {
        min-width: 0;
    }

    .trend-chart-wrap {
        height: calc(100% - 58px);
        padding: 0 12px 8px;
        overflow: visible;
    }

    .trend-chart {
        width: 100%;
        height: 100%;
        max-width: 100%;
        min-width: 0;
        min-height: 0;
        display: block;
    }

    .trend-last-label {
        font-size: 24px;
    }

    .trend-score-label,
    .trend-axis-label,
    .trend-month-label {
        font-size: 13px;
    }

    .kpi-body-dashboard .kpi-achievements .kpi-panel-scroll {
        height: calc(100% - 56px);
        padding: 0 18px 10px;
        overflow: hidden;
    }

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

    .achievement-card {
        min-height: 0;
        grid-template-columns: 48px 1fr;
        gap: 10px;
        padding: 6px;
    }

    .achievement-avatar {
        width: 46px;
        height: 46px;
        font-size: 12px;
    }
}

@media (min-width: 1181px) and (max-height: 820px) {
    .kpi-body-dashboard .kpi-header {
        grid-template-columns: minmax(0, 1fr) minmax(470px, 43vw);
    }

    .kpi-body-dashboard .kpi-header h1 {
        font-size: clamp(30px, 2.45vw, 42px);
    }

    .kpi-body-dashboard .kpi-filter {
        gap: 7px;
    }

    .kpi-body-dashboard .kpi-filter select,
    .kpi-body-dashboard .kpi-filter input,
    .kpi-body-dashboard .kpi-filter button {
        height: 40px;
        font-size: 12px;
        padding-left: 8px;
        padding-right: 8px;
    }

    .kpi-body-dashboard .kpi-top-nav {
        gap: 6px;
    }

    .kpi-body-dashboard .kpi-top-nav a {
        min-width: 78px;
        min-height: 30px;
        font-size: 11.5px;
        padding: 3px 9px;
    }

    .kpi-body-dashboard .kpi-grid {
        height: calc(100vh - 120px);
        grid-template-columns: minmax(0, 1.09fr) minmax(0, .91fr);
        grid-template-rows: minmax(205px, 1fr) minmax(220px, 1.08fr) minmax(112px, .5fr);
        gap: 10px 12px;
    }

    .kpi-panel-title {
        padding: 10px 14px 6px;
        font-size: 17px;
    }

    .kpi-panel-title-icon {
        width: 30px;
        height: 30px;
        font-size: 15px;
    }

    .kpi-body-dashboard .kpi-progress-panel .kpi-panel-scroll {
        height: calc(100% - 46px);
        padding: 0 12px 8px;
    }

    .kpi-body-dashboard .kpi-progress-panel .kpi-area-table {
        font-size: 11.5px;
    }

    .kpi-body-dashboard .kpi-progress-panel .kpi-area-table th,
    .kpi-body-dashboard .kpi-progress-panel .kpi-area-table td {
        padding: 5px 5px;
    }

    .kpi-body-dashboard .kpi-progress-panel .kpi-area-table th:nth-child(1),
    .kpi-body-dashboard .kpi-progress-panel .kpi-area-table td:nth-child(1) { width: 34px; }
    .kpi-body-dashboard .kpi-progress-panel .kpi-area-table th:nth-child(2),
    .kpi-body-dashboard .kpi-progress-panel .kpi-area-table td:nth-child(2) { width: 33%; }
    .kpi-body-dashboard .kpi-progress-panel .kpi-area-table th:nth-child(3),
    .kpi-body-dashboard .kpi-progress-panel .kpi-area-table td:nth-child(3) { width: 39%; }
    .kpi-body-dashboard .kpi-progress-panel .kpi-area-table th:nth-child(4),
    .kpi-body-dashboard .kpi-progress-panel .kpi-area-table td:nth-child(4) { width: 46px; }
    .kpi-body-dashboard .kpi-progress-panel .kpi-area-table th:nth-child(5),
    .kpi-body-dashboard .kpi-progress-panel .kpi-area-table td:nth-child(5) { width: 74px; }

    .kpi-body-dashboard .kpi-progress-panel .kpi-inline-bar {
        width: min(155px, 50%);
        height: 8px;
        margin-right: 6px;
    }

    .trend-chart-wrap {
        height: calc(100% - 46px);
        padding: 0 6px 4px;
        overflow: visible;
    }

    .trend-chart {
        min-width: 0;
        min-height: 0;
    }

    .trend-last-label {
        font-size: 20px;
    }

    .trend-score-label,
    .trend-axis-label,
    .trend-month-label {
        font-size: 11.5px;
    }

    .kpi-body-dashboard .kpi-achievements .kpi-panel-scroll {
        height: calc(100% - 46px);
        padding: 0 12px 8px;
    }

    .achievement-grid-v2 {
        gap: 7px;
    }

    .achievement-card {
        grid-template-columns: 38px 1fr;
        gap: 7px;
        padding: 4px;
    }

    .achievement-avatar {
        width: 36px;
        height: 36px;
        font-size: 10.5px;
    }

    .achievement-copy strong,
    .achievement-copy em {
        font-size: 11px;
    }

    .achievement-copy small {
        font-size: 9.8px;
    }
}

@media (max-width: 1180px) {
    .trend-chart-wrap {
        overflow-x: auto;
        overflow-y: hidden;
    }

    .trend-chart {
        min-width: 640px;
    }

    .kpi-body-dashboard .kpi-progress-panel .kpi-panel-scroll {
        overflow-x: auto;
        overflow-y: hidden;
    }

    .kpi-body-dashboard .kpi-progress-panel .kpi-area-table {
        min-width: 760px;
    }
}


/* ===== FINAL FIX: 100% browser zoom compact desktop layout =====
   Target: normal Chrome zoom 100%, 1366–1920px desktop/laptop.
   Prinsip: jangan memaksa poster raksasa di viewport kecil. Aneh memang harus ditulis, tapi CSS kadang keras kepala. */
@media (min-width: 1181px) {
    html,
    body.kpi-body-dashboard {
        overflow-x: hidden;
        overflow-y: auto;
    }

    .kpi-body-dashboard .kpi-page {
        padding: 0;
        min-height: 100vh;
        max-width: 100vw;
        overflow-x: hidden;
    }

    .kpi-body-dashboard .kpi-slide {
        width: 100%;
        max-width: 100vw;
        min-height: 100vh;
        height: auto;
        padding: 12px 16px 14px;
        border-radius: 18px;
        overflow: visible;
        box-shadow: 0 14px 36px rgba(15, 23, 42, .085);
    }

    .kpi-body-dashboard .kpi-header {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(410px, 38vw);
        align-items: start;
        gap: 12px;
        margin-bottom: 10px;
    }

    .kpi-body-dashboard .kpi-header-left {
        gap: 12px;
        min-width: 0;
    }

    .kpi-body-dashboard .kpi-blue-mark {
        width: 12px;
        height: 58px;
        box-shadow: 0 8px 18px rgba(37, 99, 235, .22);
    }

    .kpi-body-dashboard .kpi-header h1 {
        font-size: clamp(31px, 3vw, 46px);
        line-height: .98;
        letter-spacing: -1.35px;
        white-space: normal;
    }

    .kpi-body-dashboard .kpi-header p {
        margin-top: 7px;
        font-size: clamp(12px, .95vw, 15px);
        line-height: 1.25;
    }

    .kpi-body-dashboard .kpi-header p span {
        margin: 0 8px;
    }

    .kpi-body-dashboard .kpi-header-right {
        width: 100%;
        min-width: 0;
        gap: 7px;
        justify-items: stretch;
    }

    .kpi-body-dashboard .kpi-filter {
        display: grid;
        grid-template-columns: 1fr 1fr 1fr 1.15fr 74px;
        gap: 7px;
        width: 100%;
        align-items: end;
    }

    .kpi-body-dashboard .kpi-filter label {
        min-width: 0;
    }

    .kpi-body-dashboard .kpi-filter label span {
        font-size: 10.5px;
        line-height: 1;
        margin-bottom: 3px;
    }

    .kpi-body-dashboard .kpi-filter select,
    .kpi-body-dashboard .kpi-filter input,
    .kpi-body-dashboard .kpi-filter .area-select {
        width: 100%;
        min-width: 0;
        height: 38px;
        border-radius: 11px;
        font-size: 12px;
        padding: 0 9px;
    }

    .kpi-body-dashboard .kpi-filter button {
        width: 100%;
        min-width: 0;
        height: 38px;
        border-radius: 12px;
        font-size: 12px;
        padding: 0 8px;
    }

    .kpi-body-dashboard .kpi-top-nav {
        width: 100%;
        gap: 6px;
        flex-wrap: nowrap;
        justify-content: flex-start;
        overflow-x: auto;
        overflow-y: hidden;
        padding-bottom: 1px;
        scrollbar-width: none;
    }

    .kpi-body-dashboard .kpi-top-nav::-webkit-scrollbar {
        display: none;
    }

    .kpi-body-dashboard .kpi-top-nav a {
        flex: 1 0 72px;
        min-width: 72px;
        min-height: 29px;
        font-size: 11.5px;
        padding: 3px 8px;
        border-radius: 999px;
    }

    .kpi-body-dashboard .kpi-grid {
        height: calc(100vh - 116px);
        min-height: 590px;
        display: grid;
        grid-template-columns: minmax(0, 1.06fr) minmax(0, .94fr);
        grid-template-rows: minmax(205px, .92fr) minmax(232px, 1.04fr) minmax(132px, .58fr);
        grid-template-areas:
            "score trend"
            "progress issues"
            "achievements issues";
        gap: 10px 12px;
    }

    .kpi-body-dashboard .kpi-panel {
        border-radius: 16px;
        box-shadow: 0 8px 24px rgba(15, 23, 42, .055);
        min-width: 0;
    }

    .ohi-panel-inner {
        padding: 12px 14px 12px;
        min-height: 0;
    }

    .ohi-title {
        font-size: 13px;
        line-height: 1;
        margin-bottom: 8px;
    }

    .ohi-body {
        grid-template-columns: 108px minmax(0, 1fr) 190px;
        gap: 12px;
        align-items: center;
    }

    .ohi-icon-wrap {
        width: 104px;
        height: 104px;
        padding: 16px;
        box-shadow: 0 10px 22px rgba(15, 23, 42, .10);
    }

    .ohi-score-copy h2 {
        font-size: 18px;
        margin-bottom: 5px;
    }

    .ohi-score-value {
        font-size: clamp(46px, 4.15vw, 64px);
        letter-spacing: -2.4px;
        margin-bottom: 9px;
    }

    .ohi-meta {
        gap: 7px;
        font-size: 11.5px;
        line-height: 1.15;
    }

    .ohi-meta .kpi-status-badge {
        min-height: 19px;
        padding: 3px 7px;
        font-size: 10px;
    }

    .ohi-progress-row {
        grid-template-columns: 1fr auto auto;
        gap: 8px;
        margin-top: 14px;
    }

    .ohi-progress-track {
        height: 11px;
    }

    .ohi-progress-row b,
    .ohi-progress-row em {
        font-size: 13px;
    }

    .score-class-card {
        padding: 9px 10px;
        border-radius: 13px;
    }

    .score-class-card h3 {
        font-size: 12.5px;
        margin-bottom: 5px;
    }

    .score-class-row {
        grid-template-columns: 13px 57px 1fr;
        min-height: 20px;
        gap: 5px;
        font-size: 9px;
    }

    .score-dot {
        width: 7px;
        height: 7px;
    }

    .kpi-panel-title {
        padding: 10px 14px 6px;
        gap: 8px;
        font-size: 17px;
    }

    .kpi-panel-title-icon {
        width: 29px;
        height: 29px;
        border-radius: 9px;
        font-size: 14px;
        box-shadow: 0 8px 16px rgba(6, 44, 82, .16);
    }

    .trend-chart-wrap {
        height: calc(100% - 45px);
        padding: 0 6px 4px;
        overflow: hidden;
    }

    .trend-chart {
        width: 100%;
        height: 100%;
        min-width: 0;
        min-height: 0;
        max-width: 100%;
        display: block;
    }

    .trend-axis-label,
    .trend-month-label,
    .trend-score-label {
        font-size: 10.5px;
    }

    .trend-last-label {
        font-size: 18px;
    }

    .kpi-body-dashboard .kpi-progress-panel .kpi-panel-scroll {
        height: calc(100% - 45px);
        padding: 0 10px 8px;
        overflow: hidden;
    }

    .kpi-body-dashboard .kpi-progress-panel .kpi-area-table {
        min-width: 0;
        table-layout: fixed;
        font-size: 11px;
    }

    .kpi-body-dashboard .kpi-progress-panel .kpi-area-table th,
    .kpi-body-dashboard .kpi-progress-panel .kpi-area-table td {
        padding: 5px 5px;
        line-height: 1.12;
        white-space: normal;
    }

    .kpi-body-dashboard .kpi-progress-panel .kpi-area-table th {
        font-size: 9.2px;
    }

    .kpi-body-dashboard .kpi-num-dot {
        width: 21px;
        height: 21px;
        border-radius: 7px;
        font-size: 10px;
    }

    .kpi-body-dashboard .kpi-progress-panel .kpi-area-table th:nth-child(1),
    .kpi-body-dashboard .kpi-progress-panel .kpi-area-table td:nth-child(1) { width: 30px; }
    .kpi-body-dashboard .kpi-progress-panel .kpi-area-table th:nth-child(2),
    .kpi-body-dashboard .kpi-progress-panel .kpi-area-table td:nth-child(2) { width: 32%; }
    .kpi-body-dashboard .kpi-progress-panel .kpi-area-table th:nth-child(3),
    .kpi-body-dashboard .kpi-progress-panel .kpi-area-table td:nth-child(3) { width: 40%; }
    .kpi-body-dashboard .kpi-progress-panel .kpi-area-table th:nth-child(4),
    .kpi-body-dashboard .kpi-progress-panel .kpi-area-table td:nth-child(4) { width: 42px; }
    .kpi-body-dashboard .kpi-progress-panel .kpi-area-table th:nth-child(5),
    .kpi-body-dashboard .kpi-progress-panel .kpi-area-table td:nth-child(5) { width: 68px; }

    .kpi-body-dashboard .kpi-progress-panel .kpi-inline-bar {
        width: min(150px, 48%);
        height: 7px;
        margin-right: 5px;
    }

    .kpi-body-dashboard .kpi-issues .kpi-panel-scroll {
        height: calc(100% - 58px);
        margin: 0 10px 10px;
        border-radius: 14px;
        overflow-y: auto;
    }

    .issue-card {
        min-height: 62px;
        grid-template-columns: 44px minmax(0, 1fr) 142px 18px;
        gap: 9px;
        padding: 8px 10px;
    }

    .issue-alert {
        width: 36px;
        height: 36px;
        font-size: 17px;
    }

    .issue-copy strong,
    .issue-value strong {
        font-size: 13.5px;
        line-height: 1.12;
    }

    .issue-copy b {
        font-size: 11px;
        margin-top: 4px;
    }

    .issue-value small {
        font-size: 10.5px;
        margin-top: 3px;
    }

    .issue-arrow {
        font-size: 24px;
    }

    .kpi-body-dashboard .kpi-achievements .kpi-panel-scroll {
        height: calc(100% - 45px);
        padding: 0 10px 8px;
        overflow: hidden;
    }

    .achievement-grid-v2 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
    }

    .achievement-card {
        min-height: 0;
        grid-template-columns: 36px minmax(0, 1fr);
        gap: 7px;
        padding: 5px;
        border-right: 1px solid #e1e8f2;
    }

    .achievement-avatar {
        width: 34px;
        height: 34px;
        font-size: 10px;
    }

    .achievement-copy strong,
    .achievement-copy em {
        font-size: 10.8px;
        line-height: 1.1;
    }

    .achievement-copy em,
    .achievement-copy small {
        margin-top: 3px;
    }

    .achievement-copy small {
        font-size: 9.5px;
        line-height: 1.08;
    }
}

/* 1366x768 dan laptop pendek: paksa lebih padat, tapi jangan dipotong diam-diam. */
@media (min-width: 1181px) and (max-height: 790px) {
    .kpi-body-dashboard .kpi-slide {
        padding: 8px 12px 10px;
    }

    .kpi-body-dashboard .kpi-header {
        margin-bottom: 7px;
        gap: 9px;
        grid-template-columns: minmax(0, 1fr) minmax(390px, 37vw);
    }

    .kpi-body-dashboard .kpi-blue-mark {
        height: 48px;
        width: 10px;
    }

    .kpi-body-dashboard .kpi-header h1 {
        font-size: clamp(28px, 2.65vw, 38px);
    }

    .kpi-body-dashboard .kpi-header p {
        margin-top: 5px;
        font-size: 11.5px;
    }

    .kpi-body-dashboard .kpi-filter select,
    .kpi-body-dashboard .kpi-filter input,
    .kpi-body-dashboard .kpi-filter .area-select,
    .kpi-body-dashboard .kpi-filter button {
        height: 34px;
        font-size: 11px;
    }

    .kpi-body-dashboard .kpi-top-nav a {
        min-height: 26px;
        font-size: 10.5px;
    }

    .kpi-body-dashboard .kpi-grid {
        height: calc(100vh - 94px);
        min-height: 560px;
        grid-template-rows: minmax(188px, .9fr) minmax(218px, 1.08fr) minmax(118px, .55fr);
        gap: 8px 10px;
    }

    .ohi-panel-inner {
        padding: 10px 12px;
    }

    .ohi-title {
        font-size: 12px;
        margin-bottom: 6px;
    }

    .ohi-body {
        grid-template-columns: 90px minmax(0, 1fr) 178px;
        gap: 9px;
    }

    .ohi-icon-wrap {
        width: 86px;
        height: 86px;
        padding: 13px;
    }

    .ohi-score-copy h2 {
        font-size: 16px;
    }

    .ohi-score-value {
        font-size: clamp(40px, 3.65vw, 54px);
        margin-bottom: 7px;
    }

    .ohi-meta {
        font-size: 10.5px;
    }

    .score-class-card h3 {
        font-size: 11px;
    }

    .score-class-row {
        min-height: 18px;
        font-size: 8.5px;
    }

    .kpi-panel-title {
        padding: 8px 12px 5px;
        font-size: 15px;
    }

    .kpi-panel-title-icon {
        width: 26px;
        height: 26px;
        font-size: 12px;
    }

    .trend-chart-wrap {
        height: calc(100% - 37px);
    }

    .trend-last-label {
        font-size: 16px;
    }

    .trend-axis-label,
    .trend-month-label,
    .trend-score-label {
        font-size: 9.5px;
    }

    .kpi-body-dashboard .kpi-progress-panel .kpi-panel-scroll {
        height: calc(100% - 37px);
    }

    .kpi-body-dashboard .kpi-progress-panel .kpi-area-table {
        font-size: 10.2px;
    }

    .kpi-body-dashboard .kpi-progress-panel .kpi-area-table th,
    .kpi-body-dashboard .kpi-progress-panel .kpi-area-table td {
        padding: 4px 4px;
    }

    .kpi-body-dashboard .kpi-progress-panel .kpi-inline-bar {
        width: min(125px, 46%);
        height: 6px;
    }

    .kpi-body-dashboard .kpi-issues .kpi-panel-scroll {
        height: calc(100% - 48px);
        margin: 0 8px 8px;
    }

    .issue-card {
        min-height: 55px;
        grid-template-columns: 38px minmax(0, 1fr) 125px 16px;
        padding: 6px 8px;
    }

    .issue-alert {
        width: 32px;
        height: 32px;
        font-size: 15px;
    }

    .issue-copy strong,
    .issue-value strong {
        font-size: 12px;
    }

    .issue-copy b,
    .issue-value small {
        font-size: 9.5px;
    }

    .issue-arrow {
        font-size: 20px;
    }

    .kpi-body-dashboard .kpi-achievements .kpi-panel-scroll {
        height: calc(100% - 37px);
    }

    .achievement-card {
        grid-template-columns: 30px minmax(0, 1fr);
        gap: 5px;
        padding: 3px;
    }

    .achievement-avatar {
        width: 28px;
        height: 28px;
        font-size: 8.5px;
    }

    .achievement-copy strong,
    .achievement-copy em {
        font-size: 9.6px;
    }

    .achievement-copy small {
        font-size: 8.3px;
    }
}

/* Layar 1181–1320px: desktop sempit, jangan pura-pura jadi 4K. */
@media (min-width: 1181px) and (max-width: 1320px) {
    .kpi-body-dashboard .kpi-header {
        grid-template-columns: minmax(0, 1fr) minmax(360px, 35vw);
    }

    .kpi-body-dashboard .kpi-filter {
        grid-template-columns: repeat(2, minmax(0, 1fr)) 70px;
    }

    .kpi-body-dashboard .kpi-filter label:nth-of-type(3),
    .kpi-body-dashboard .kpi-filter label:nth-of-type(4) {
        grid-column: auto;
    }

    .kpi-body-dashboard .kpi-grid {
        grid-template-columns: minmax(0, 1.02fr) minmax(0, .98fr);
    }

    .ohi-body {
        grid-template-columns: 82px minmax(0, 1fr) 164px;
    }

    .ohi-icon-wrap {
        width: 78px;
        height: 78px;
        padding: 12px;
    }

    .score-class-row {
        grid-template-columns: 12px 50px 1fr;
    }

    .kpi-body-dashboard .kpi-progress-panel .kpi-area-table th:nth-child(2),
    .kpi-body-dashboard .kpi-progress-panel .kpi-area-table td:nth-child(2) { width: 30%; }
    .kpi-body-dashboard .kpi-progress-panel .kpi-area-table th:nth-child(3),
    .kpi-body-dashboard .kpi-progress-panel .kpi-area-table td:nth-child(3) { width: 42%; }
}



/* =========================================================
   TOTAL KPI DETAIL MODAL - FULLSCREEN EXECUTIVE VIEW
   Override section: taruh di bawah agar CSS lama tidak sok menang.
   ========================================================= */
.kpi-modal.total-kpi-fullscreen {
    width: 100vw;
    height: 100vh;
    max-width: 100vw;
    max-height: 100vh;
    border-radius: 0;
    padding: 0;
    overflow: hidden;
    background:
        radial-gradient(circle at 6% 8%, rgba(37, 99, 235, .16), transparent 360px),
        radial-gradient(circle at 95% 12%, rgba(22, 163, 74, .12), transparent 330px),
        linear-gradient(180deg, #f8fbff 0%, #eef4fb 100%);
}

.kpi-modal.total-kpi-fullscreen #modalContent {
    height: 100%;
    min-height: 0;
}

.total-kpi-modal {
    height: 100%;
    min-height: 0;
    display: grid;
    grid-template-rows: auto auto auto 1fr;
    gap: 12px;
    padding: 16px;
    color: #0f172a;
}

.kpi-modal.total-kpi-fullscreen .kpi-modal-close {
    position: fixed;
    top: 14px;
    right: 18px;
    z-index: 50;
    width: 42px;
    height: 42px;
    border-radius: 14px;
    background: rgba(255,255,255,.96);
    border: 1px solid #dbe4ef;
    box-shadow: 0 14px 34px rgba(15, 23, 42, .18);
    color: #0f172a;
    font-size: 28px;
    cursor: pointer;
}

.kpi-modal.total-kpi-fullscreen .kpi-modal-close:hover {
    background: #f1f5f9;
    transform: translateY(-1px);
}

.total-kpi-hero-v2 {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 18px;
    padding: 18px 22px;
    border-radius: 24px;
    background:
        radial-gradient(circle at 12% 16%, rgba(255,255,255,.18), transparent 260px),
        linear-gradient(135deg, #061a33 0%, #08245a 52%, #0f3b84 100%);
    color: #ffffff;
    box-shadow: 0 20px 46px rgba(6, 44, 82, .24);
    overflow: hidden;
}

.total-kpi-hero-left {
    min-width: 0;
}

.total-kpi-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 26px;
    padding: 5px 11px;
    border-radius: 999px;
    background: rgba(255,255,255,.13);
    border: 1px solid rgba(255,255,255,.18);
    color: rgba(255,255,255,.86);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.total-kpi-hero-v2 h2 {
    margin: 10px 0 8px;
    font-size: clamp(24px, 2.5vw, 38px);
    line-height: 1.02;
    letter-spacing: -.7px;
    font-weight: 950;
}

.total-kpi-hero-v2 p {
    margin: 0;
    max-width: 980px;
    color: rgba(255,255,255,.78);
    font-size: 13px;
    line-height: 1.45;
    font-weight: 700;
}

.total-kpi-hero-score-v2 {
    min-width: 220px;
    text-align: right;
}

.total-kpi-hero-score-v2 span {
    display: block;
    color: rgba(255,255,255,.72);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.total-kpi-hero-score-v2 strong {
    display: block;
    margin-top: 4px;
    font-size: clamp(44px, 4vw, 66px);
    line-height: .9;
    letter-spacing: -2px;
    font-weight: 950;
}

.total-kpi-hero-score-v2 small {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    min-height: 28px;
    padding: 6px 11px;
    border-radius: 999px;
    background: rgba(255,255,255,.14);
    border: 1px solid rgba(255,255,255,.16);
    color: #ffffff;
    font-size: 12px;
    font-weight: 900;
}

.total-kpi-summary-v2 {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.total-kpi-card-v2 {
    position: relative;
    overflow: hidden;
    border: 1px solid #dbe4ef;
    border-radius: 18px;
    padding: 13px 14px;
    background: linear-gradient(180deg, #ffffff, #f8fbff);
    box-shadow: 0 10px 24px rgba(15, 23, 42, .06);
}

.total-kpi-card-v2::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 5px;
    background: var(--card-accent, #2563eb);
}

.total-kpi-card-v2 span {
    display: block;
    color: #64748b;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.total-kpi-card-v2 strong {
    display: block;
    margin-top: 5px;
    color: #06164a;
    font-size: 25px;
    line-height: 1;
    font-weight: 950;
}

.total-kpi-card-v2 small {
    display: block;
    margin-top: 5px;
    color: #64748b;
    font-size: 11px;
    font-weight: 750;
}

.total-kpi-toolbar-v2 {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    border: 1px solid #dbe4ef;
    border-radius: 18px;
    background: rgba(255,255,255,.88);
    box-shadow: 0 8px 22px rgba(15, 23, 42, .045);
}

.total-kpi-toolbar-v2 h3 {
    margin: 0;
    color: #06164a;
    font-size: 17px;
    font-weight: 950;
}

.total-kpi-toolbar-v2 p {
    margin: 3px 0 0;
    color: #64748b;
    font-size: 12px;
    font-weight: 700;
}

.total-kpi-legend-v2 {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    justify-content: flex-end;
}

.total-kpi-legend-v2 span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 26px;
    padding: 5px 9px;
    border-radius: 999px;
    background: #ffffff;
    border: 1px solid #dbe4ef;
    color: #334155;
    font-size: 11px;
    font-weight: 850;
}

.total-kpi-dot {
    width: 9px;
    height: 9px;
    border-radius: 999px;
    display: inline-block;
}

.total-kpi-dot.vg { background: #009b36; }
.total-kpi-dot.good { background: #08a83c; }
.total-kpi-dot.fair { background: #f6b10a; }
.total-kpi-dot.need { background: #fb8500; }
.total-kpi-dot.poor { background: #ed0b16; }
.total-kpi-dot.na { background: #64748b; }

.total-kpi-table-shell {
    min-height: 0;
    border: 1px solid #cbd5e1;
    border-radius: 20px;
    background: #ffffff;
    box-shadow: 0 16px 40px rgba(15, 23, 42, .08);
    overflow: hidden;
}

.total-kpi-table-wrap {
    width: 100%;
    height: 100%;
    max-height: none !important;
    overflow: auto;
    border: 0 !important;
    border-radius: 0 !important;
    background: #ffffff;
}

.total-kpi-table-wrap::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

.total-kpi-table-wrap::-webkit-scrollbar-track {
    background: #e2e8f0;
}

.total-kpi-table-wrap::-webkit-scrollbar-thumb {
    background: #94a3b8;
    border-radius: 999px;
}

.total-kpi-table-wrap::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}

.total-kpi-table {
    min-width: 1680px;
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13px;
}

.total-kpi-table th {
    position: sticky;
    top: 0;
    z-index: 12;
    background: linear-gradient(180deg, #08245a, #061a33);
    color: #ffffff;
    border-right: 1px solid rgba(255,255,255,.14);
    border-bottom: 1px solid #0f3b84;
    padding: 12px 10px;
    text-align: center;
    font-size: 12px;
    line-height: 1.15;
    font-weight: 950;
    vertical-align: middle;
    white-space: nowrap;
}

.total-kpi-table th small {
    display: block;
    margin-top: 3px;
    color: rgba(255,255,255,.72);
    font-size: 10px;
    font-weight: 850;
}

.total-kpi-table td {
    border-right: 1px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
    padding: 10px 10px;
    vertical-align: middle;
    background: #ffffff;
    color: #0f172a;
}

.total-kpi-table tbody tr:hover td {
    background: #f8fbff;
}

.total-kpi-table th:nth-child(1),
.total-kpi-table td:nth-child(1) {
    position: sticky;
    left: 0;
    z-index: 10;
}

.total-kpi-table th:nth-child(2),
.total-kpi-table td:nth-child(2) {
    position: sticky;
    left: 54px;
    z-index: 10;
}

.total-kpi-table th:nth-child(3),
.total-kpi-table td:nth-child(3) {
    position: sticky;
    left: 194px;
    z-index: 10;
}

.total-kpi-table th:nth-child(1),
.total-kpi-table th:nth-child(2),
.total-kpi-table th:nth-child(3) {
    z-index: 18;
}

.total-kpi-table td:nth-child(1),
.total-kpi-table td:nth-child(2),
.total-kpi-table td:nth-child(3) {
    background: #ffffff;
}

.total-kpi-table tbody tr:hover td:nth-child(1),
.total-kpi-table tbody tr:hover td:nth-child(2),
.total-kpi-table tbody tr:hover td:nth-child(3) {
    background: #f8fbff;
}

.total-kpi-no {
    width: 54px;
    min-width: 54px;
    text-align: center;
    color: #ffffff !important;
    font-weight: 950;
}

.total-kpi-no span {
    display: inline-grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 10px;
    background: #061a33;
    color: #ffffff;
    font-size: 12px;
    box-shadow: 0 8px 18px rgba(6, 26, 51, .18);
}

.total-kpi-area {
    width: 140px;
    min-width: 140px;
    text-align: center;
    font-weight: 950;
    color: #06164a;
    line-height: 1.2;
}

.total-kpi-area strong {
    display: block;
    font-size: 13px;
}

.total-kpi-area small {
    display: block;
    margin-top: 5px;
    font-size: 10.5px;
    color: rgba(15, 23, 42, .68);
    font-weight: 850;
}

.total-kpi-name {
    width: 310px;
    min-width: 310px;
    color: #06164a;
    font-weight: 900;
    line-height: 1.28;
}

.total-kpi-name strong {
    display: block;
    font-size: 13.5px;
}

.total-kpi-name small {
    display: block;
    margin-top: 5px;
    color: #64748b;
    font-size: 11px;
    font-weight: 750;
}

.total-kpi-target,
.total-kpi-unit,
.total-kpi-weight,
.total-kpi-month,
.total-kpi-ytd,
.total-kpi-score {
    text-align: center;
    white-space: nowrap;
}

.total-kpi-target {
    font-weight: 900;
    color: #0f172a;
}

.total-kpi-unit {
    color: #475569;
    font-weight: 850;
}

.total-kpi-weight {
    color: #06164a;
    font-weight: 950;
}

.total-kpi-month {
    min-width: 112px;
}

.total-kpi-month .actual {
    display: block;
    color: #0f172a;
    font-weight: 950;
    line-height: 1.1;
}

.total-kpi-month .score {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 6px;
    min-height: 24px;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 950;
}

.total-kpi-month .note {
    display: block;
    margin-top: 5px;
    max-width: 160px;
    color: #64748b;
    font-size: 10.5px;
    line-height: 1.2;
    white-space: normal;
}

.total-kpi-ytd strong,
.total-kpi-score strong {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    min-height: 28px;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 950;
}

.total-kpi-ytd small,
.total-kpi-score small {
    display: block;
    margin-top: 5px;
    color: #64748b;
    font-size: 10.5px;
    font-weight: 750;
}

.total-theme-vg,
.total-theme-good {
    background: #dcfce7 !important;
    color: #166534 !important;
}

.total-theme-fair {
    background: #fef3c7 !important;
    color: #92400e !important;
}

.total-theme-need {
    background: #ffedd5 !important;
    color: #c2410c !important;
}

.total-theme-poor {
    background: #fee2e2 !important;
    color: #b91c1c !important;
}

.total-theme-na {
    background: #f1f5f9 !important;
    color: #64748b !important;
}

.total-area-productivity { background: #0b63ce !important; color: #ffffff !important; }
.total-area-quality { background: #19a64a !important; color: #ffffff !important; }
.total-area-plan { background: #f2b705 !important; color: #06164a !important; }
.total-area-material { background: #f97316 !important; color: #ffffff !important; }
.total-area-5s { background: #7c3aed !important; color: #ffffff !important; }
.total-area-bg-productivity { background: #eaf3ff !important; }
.total-area-bg-quality { background: #ecfdf3 !important; }
.total-area-bg-plan { background: #fff8db !important; }
.total-area-bg-material { background: #fff1e7 !important; }
.total-area-bg-5s { background: #f4edff !important; }

@media (max-width: 1024px) {
    .total-kpi-modal {
        padding: 12px;
        gap: 10px;
    }

    .total-kpi-hero-v2 {
        grid-template-columns: 1fr;
        padding: 16px;
    }

    .total-kpi-hero-score-v2 {
        text-align: left;
        min-width: 0;
    }

    .total-kpi-summary-v2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .total-kpi-toolbar-v2 {
        align-items: flex-start;
        flex-direction: column;
    }

    .total-kpi-legend-v2 {
        justify-content: flex-start;
    }
}

@media (max-width: 640px) {
    .total-kpi-modal {
        padding: 10px;
    }

    .total-kpi-hero-v2 h2 {
        font-size: 22px;
    }

    .total-kpi-hero-v2 p {
        font-size: 12px;
    }

    .total-kpi-summary-v2 {
        grid-template-columns: 1fr;
    }

    .total-kpi-card-v2 {
        padding: 11px 12px;
    }

    .total-kpi-card-v2 strong {
        font-size: 21px;
    }

    .total-kpi-table {
        min-width: 1520px;
        font-size: 12px;
    }

    .total-kpi-table th,
    .total-kpi-table td {
        padding: 9px 8px;
    }
}


/* =========================================================
   VISUAL POLISH V4 - FONT & READABILITY UPGRADE ONLY
   Tidak menambah elemen, tidak mengubah PHP logic, tidak mengubah rumus.
   Fokus: font lebih besar, panel lebih tegas, table lebih enak dibaca.
   ========================================================= */

html {
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

body {
    letter-spacing: .01px;
}

.kpi-panel,
.total-kpi-card-v2,
.kpi-modal-box,
.kpi-filter,
.kpi-top-nav a,
.kpi-input-table,
.total-kpi-table {
    font-feature-settings: "kern";
}

/* Dashboard polish */
.kpi-body-dashboard .kpi-slide {
    background:
        radial-gradient(circle at 10% 0%, rgba(37, 99, 235, .065), transparent 360px),
        radial-gradient(circle at 94% 12%, rgba(22, 163, 74, .055), transparent 330px),
        rgba(255, 255, 255, .98);
    border-color: rgba(203, 213, 225, .88);
}

.kpi-body-dashboard .kpi-panel {
    border-color: #d7e2ef;
    box-shadow:
        0 12px 30px rgba(15, 23, 42, .065),
        inset 0 1px 0 rgba(255,255,255,.80);
}

.kpi-body-dashboard .kpi-panel:hover {
    box-shadow:
        0 14px 34px rgba(15, 23, 42, .078),
        inset 0 1px 0 rgba(255,255,255,.86);
}

/* Title/header readability */
.kpi-body-dashboard .kpi-header h1 {
    font-weight: 950;
    color: #061326;
}

.kpi-body-dashboard .kpi-header p {
    color: #24364f;
    font-weight: 800;
}

/* Filter/input polish */
.kpi-body-dashboard .kpi-filter select,
.kpi-body-dashboard .kpi-filter input,
.kpi-body-dashboard .kpi-filter button {
    font-weight: 850;
}

.kpi-body-dashboard .kpi-filter select,
.kpi-body-dashboard .kpi-filter input {
    box-shadow: 0 4px 12px rgba(15, 23, 42, .035);
}

.kpi-body-dashboard .kpi-filter button {
    letter-spacing: .02em;
}

/* OHI panel */
.ohi-title {
    color: #24364f;
    letter-spacing: .045em;
}

.ohi-score-copy h2 {
    color: #06164a;
    letter-spacing: -.2px;
}

.ohi-score-value {
    text-shadow: 0 7px 18px rgba(8, 168, 60, .12);
}

.ohi-meta {
    color: #24364f;
}

.ohi-progress-track {
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, .12);
}

.score-class-card {
    background: linear-gradient(180deg, #ffffff, #f8fbff);
}

.score-class-card h3 {
    color: #06164a;
}

.score-class-row {
    color: #1f3556;
}

/* Panel title */
.kpi-panel-title {
    color: #06164a;
    letter-spacing: -.25px;
}

.kpi-panel-title-icon {
    box-shadow: 0 10px 20px rgba(6, 44, 82, .18);
}

/* Focused Area table */
.kpi-body-dashboard .kpi-area-table {
    color: #0f172a;
}

.kpi-body-dashboard .kpi-area-table th {
    color: #1f3556;
    letter-spacing: .025em;
}

.kpi-body-dashboard .kpi-area-table td {
    color: #102033;
    font-weight: 750;
}

.kpi-body-dashboard .kpi-area-table tbody tr:hover td {
    background: #f2f7ff;
}

/* Trend chart text */
.trend-axis-label,
.trend-month-label,
.trend-score-label,
.trend-last-label {
    font-weight: 950;
}

/* Main issues */
.issue-card {
    transition: background .16s ease, transform .16s ease;
}

.issue-card:hover {
    background: #fff3f3;
    transform: translateY(-1px);
}

.issue-copy strong,
.issue-value strong {
    color: #06164a;
    letter-spacing: -.15px;
}

.issue-copy b {
    letter-spacing: .02em;
}

.issue-value small {
    color: #314762;
    font-weight: 760;
}

/* Achievement cards */
.achievement-card {
    transition: background .16s ease, transform .16s ease, box-shadow .16s ease;
}

.achievement-card:hover {
    background: #f3f8ff;
    transform: translateY(-1px);
    box-shadow: inset 0 0 0 1px #dbeafe;
}

.achievement-copy strong {
    color: #06164a;
    letter-spacing: -.1px;
}

.achievement-copy em {
    letter-spacing: -.1px;
}

.achievement-copy small {
    color: #314762;
    font-weight: 760;
}

/* Modal and table polish */
.kpi-modal {
    font-size: 14px;
}

.kpi-modal-title h2 {
    letter-spacing: -.35px;
}

.kpi-modal-title p,
.kpi-modal-box,
.kpi-modal-footnote {
    font-size: 13.5px;
}

.kpi-modal-table th {
    font-size: 13px;
    letter-spacing: .015em;
}

.kpi-modal-table td {
    font-size: 13.5px;
    line-height: 1.35;
}

.total-kpi-hero-v2 h2 {
    letter-spacing: -.8px;
}

.total-kpi-hero-v2 p {
    font-weight: 760;
}

.total-kpi-toolbar-v2 h3 {
    letter-spacing: -.2px;
}

.total-kpi-table {
    letter-spacing: 0;
}

.total-kpi-table th {
    letter-spacing: .01em;
}

.total-kpi-table td {
    line-height: 1.32;
}

.total-kpi-name {
    font-weight: 950;
}

.total-kpi-area {
    font-weight: 950;
}

.total-kpi-score strong {
    font-weight: 950;
}

/* Input/master/method page readability, tetap desain lama */
.kpi-normal-header h1 {
    color: #061326;
}

.kpi-input-table th {
    letter-spacing: .025em;
}

.kpi-input-table td {
    font-weight: 700;
}

.kpi-input-table input {
    font-weight: 750;
}

/* Desktop normal: naikkan font beberapa tingkat, bukan bongkar layout */
@media (min-width: 1181px) {
    .kpi-body-dashboard .kpi-slide {
        padding: 16px 20px 18px;
        border-radius: 22px;
    }

    .kpi-body-dashboard .kpi-header {
        margin-bottom: 13px;
        gap: 16px;
        grid-template-columns: minmax(0, 1fr) minmax(440px, 39vw);
    }

    .kpi-body-dashboard .kpi-blue-mark {
        width: 13px;
        height: 64px;
    }

    .kpi-body-dashboard .kpi-header h1 {
        font-size: clamp(35px, 3.15vw, 54px);
        line-height: .99;
    }

    .kpi-body-dashboard .kpi-header p {
        margin-top: 9px;
        font-size: clamp(13.5px, 1.04vw, 17px);
        line-height: 1.32;
    }

    .kpi-body-dashboard .kpi-filter {
        gap: 9px;
    }

    .kpi-body-dashboard .kpi-filter label span {
        font-size: 11.8px;
    }

    .kpi-body-dashboard .kpi-filter select,
    .kpi-body-dashboard .kpi-filter input,
    .kpi-body-dashboard .kpi-filter .area-select,
    .kpi-body-dashboard .kpi-filter button {
        height: 42px;
        font-size: 13.5px;
        border-radius: 12px;
    }

    .kpi-body-dashboard .kpi-top-nav a {
        min-height: 33px;
        font-size: 12.6px;
    }

    .kpi-body-dashboard .kpi-grid {
        height: auto;
        min-height: calc(100vh - 132px);
        grid-template-rows: minmax(220px, .94fr) minmax(250px, 1.04fr) minmax(148px, .62fr);
        gap: 13px 15px;
    }

    .ohi-panel-inner {
        padding: 15px 18px 15px;
    }

    .ohi-title {
        font-size: 15.5px;
        margin-bottom: 9px;
    }

    .ohi-body {
        grid-template-columns: 116px minmax(0, 1fr) 214px;
        gap: 14px;
    }

    .ohi-icon-wrap {
        width: 112px;
        height: 112px;
        padding: 17px;
    }

    .ohi-score-copy h2 {
        font-size: 21px;
    }

    .ohi-score-value {
        font-size: clamp(54px, 4.55vw, 78px);
        letter-spacing: -2.8px;
        margin-bottom: 10px;
    }

    .ohi-meta {
        font-size: 13px;
        gap: 9px;
    }

    .ohi-meta .kpi-status-badge {
        min-height: 22px;
        font-size: 11px;
        padding: 4px 8px;
    }

    .ohi-progress-row {
        margin-top: 16px;
    }

    .ohi-progress-track {
        height: 13px;
    }

    .ohi-progress-row b,
    .ohi-progress-row em {
        font-size: 15px;
    }

    .score-class-card {
        padding: 11px 12px;
        border-radius: 15px;
    }

    .score-class-card h3 {
        font-size: 14px;
        margin-bottom: 7px;
    }

    .score-class-row {
        min-height: 23px;
        grid-template-columns: 15px 65px 1fr;
        font-size: 10.4px;
    }

    .score-dot {
        width: 8px;
        height: 8px;
    }

    .kpi-panel-title {
        padding: 13px 17px 8px;
        font-size: 20px;
        gap: 10px;
    }

    .kpi-panel-title-icon {
        width: 34px;
        height: 34px;
        font-size: 16px;
        border-radius: 10px;
    }

    .trend-chart-wrap {
        height: calc(100% - 54px);
        padding: 0 10px 8px;
    }

    .trend-axis-label,
    .trend-month-label,
    .trend-score-label {
        font-size: 12.3px;
    }

    .trend-last-label {
        font-size: 22px;
    }

    .kpi-body-dashboard .kpi-progress-panel .kpi-panel-scroll {
        height: calc(100% - 54px);
        padding: 0 14px 10px;
        overflow-y: auto;
    }

    .kpi-body-dashboard .kpi-progress-panel .kpi-area-table {
        font-size: 12.6px;
    }

    .kpi-body-dashboard .kpi-progress-panel .kpi-area-table th {
        font-size: 10.4px;
    }

    .kpi-body-dashboard .kpi-progress-panel .kpi-area-table th,
    .kpi-body-dashboard .kpi-progress-panel .kpi-area-table td {
        padding: 6px 6px;
        line-height: 1.18;
    }

    .kpi-body-dashboard .kpi-num-dot {
        width: 24px;
        height: 24px;
        font-size: 11px;
    }

    .kpi-body-dashboard .kpi-progress-panel .kpi-inline-bar {
        width: min(165px, 48%);
        height: 8px;
    }

    .kpi-body-dashboard .kpi-issues .kpi-panel-scroll {
        height: calc(100% - 64px);
        margin: 0 12px 12px;
        border-radius: 16px;
    }

    .issue-card {
        min-height: 70px;
        grid-template-columns: 48px minmax(0, 1fr) 154px 22px;
        gap: 10px;
        padding: 9px 12px;
    }

    .issue-alert {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }

    .issue-copy strong,
    .issue-value strong {
        font-size: 15px;
        line-height: 1.15;
    }

    .issue-copy b {
        font-size: 12px;
        margin-top: 5px;
    }

    .issue-value small {
        font-size: 11.2px;
        margin-top: 4px;
    }

    .issue-arrow {
        font-size: 27px;
    }

    .kpi-body-dashboard .kpi-achievements .kpi-panel-scroll {
        height: calc(100% - 54px);
        padding: 0 14px 10px;
        overflow-y: auto;
    }

    .achievement-grid-v2 {
        gap: 9px;
    }

    .achievement-card {
        grid-template-columns: 42px minmax(0, 1fr);
        gap: 9px;
        padding: 6px;
        border-radius: 14px;
    }

    .achievement-avatar {
        width: 40px;
        height: 40px;
        font-size: 11px;
    }

    .achievement-copy strong,
    .achievement-copy em {
        font-size: 12.3px;
        line-height: 1.16;
    }

    .achievement-copy small {
        font-size: 10.7px;
        line-height: 1.16;
    }
}

/* Laptop pendek: tetap readable, tidak sekecil semut pabrik lembur */
@media (min-width: 1181px) and (max-height: 790px) {
    .kpi-body-dashboard .kpi-slide {
        padding: 11px 14px 12px;
    }

    .kpi-body-dashboard .kpi-header h1 {
        font-size: clamp(31px, 2.75vw, 42px);
    }

    .kpi-body-dashboard .kpi-header p {
        font-size: 12.4px;
    }

    .kpi-body-dashboard .kpi-filter label span {
        font-size: 10.8px;
    }

    .kpi-body-dashboard .kpi-filter select,
    .kpi-body-dashboard .kpi-filter input,
    .kpi-body-dashboard .kpi-filter .area-select,
    .kpi-body-dashboard .kpi-filter button {
        height: 37px;
        font-size: 12.2px;
    }

    .kpi-body-dashboard .kpi-top-nav a {
        min-height: 28px;
        font-size: 11.3px;
    }

    .kpi-body-dashboard .kpi-grid {
        min-height: 565px;
        grid-template-rows: minmax(198px, .9fr) minmax(224px, 1.05fr) minmax(126px, .56fr);
        gap: 9px 10px;
    }

    .ohi-title {
        font-size: 13px;
    }

    .ohi-score-copy h2 {
        font-size: 17px;
    }

    .ohi-score-value {
        font-size: clamp(44px, 3.85vw, 60px);
    }

    .ohi-meta {
        font-size: 11.2px;
    }

    .score-class-row {
        font-size: 9.2px;
        min-height: 19px;
    }

    .kpi-panel-title {
        font-size: 16.2px;
    }

    .kpi-body-dashboard .kpi-progress-panel .kpi-area-table {
        font-size: 10.8px;
    }

    .kpi-body-dashboard .kpi-progress-panel .kpi-area-table th {
        font-size: 9.2px;
    }

    .issue-copy strong,
    .issue-value strong {
        font-size: 12.8px;
    }

    .issue-copy b,
    .issue-value small {
        font-size: 10px;
    }

    .achievement-copy strong,
    .achievement-copy em {
        font-size: 10.3px;
    }

    .achievement-copy small {
        font-size: 8.9px;
    }
}

/* Total KPI modal/table: naikkan readability tanpa nambah kolom */
.total-kpi-table-wrap {
    background: #ffffff;
}

.total-kpi-table th {
    font-size: 13.2px;
    padding: 12px 10px;
}

.total-kpi-table td {
    font-size: 13.8px;
    padding: 11px 10px;
}

.total-kpi-score strong {
    font-size: 15px;
}

.total-kpi-card-v2 span,
.total-kpi-legend-v2 span,
.total-kpi-toolbar-v2 p {
    font-size: 12px;
}

.total-kpi-card-v2 strong {
    font-size: 27px;
}

.total-kpi-toolbar-v2 h3 {
    font-size: 18px;
}

@media (max-width: 760px) {
    .kpi-modal {
        font-size: 13.5px;
    }

    .kpi-body-dashboard .kpi-header h1 {
        font-size: clamp(30px, 9vw, 38px);
    }

    .kpi-body-dashboard .kpi-header p {
        font-size: 13px;
    }

    .kpi-body-dashboard .kpi-filter label span {
        font-size: 11px;
    }

    .kpi-panel-title {
        font-size: 18px;
    }

    .ohi-score-copy h2 {
        font-size: 19px;
    }

    .issue-copy strong,
    .issue-value strong {
        font-size: 15.5px;
    }

    .achievement-copy strong,
    .achievement-copy em {
        font-size: 13.5px;
    }

    .achievement-copy small {
        font-size: 11.8px;
    }

    .total-kpi-table {
        font-size: 12.6px;
    }

    .total-kpi-table th,
    .total-kpi-table td {
        padding: 10px 9px;
    }
}



/* ===== Hamburger dashboard fix ===== */
.kpi-body-dashboard .kpi-sidebar-toggle {
    display: grid !important;
    place-items: center;
    left: 18px;
    top: 18px;
    z-index: 10040;
}

.kpi-body-dashboard .kpi-header-left {
    padding-left: 58px;
}

@media (max-width: 1200px) {
    .kpi-body-dashboard .kpi-header-left {
        padding-left: 0;
    }

    .kpi-body-dashboard .kpi-page {
        padding-top: 72px;
    }
}

/* Split-file sidebar grouping */
.kpi-drawer-group {
    margin: 12px 4px 4px;
    padding: 0 8px;
    color: rgba(255,255,255,.52);
    font-size: 10.5px;
    font-weight: 950;
    letter-spacing: .08em;
    text-transform: uppercase;
}
