:root {
    /* Brand */
    --navy: #0F2744;
    --navy-700: #17355A;
    --navy-800: #0B1C31;
    --accent: #0F766E;
    --accent-soft: #E7F4F2;
    --accent-ring: rgba(15, 118, 110, 0.22);

    /* Surfaces & text */
    --bg: #F3F5F8;
    --surface: #FFFFFF;
    --surface-subtle: #F8FAFC;
    --text: #0B1220;
    --text-secondary: #3D4A5C;
    --text-muted: #5B677A;
    --muted: #5B677A;
    --border: #E4E9F0;
    --border-strong: #D0D7E2;
    --line: #E4E9F0;

    /* Semantic */
    --success: #0F7B4A;
    --success-bg: #E8F7EF;
    --warning: #B45309;
    --warning-bg: #FFF6E8;
    --danger: #B42318;
    --danger-bg: #FDECEC;
    --info: #175CD3;
    --info-bg: #E8F0FE;

    /* Elevation */
    --shadow: 0 1px 2px rgba(15, 39, 68, 0.05);
    --shadow-md: 0 2px 8px rgba(15, 39, 68, 0.06);

    /* Radius */
    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 12px;
    --radius-pill: 999px;

    /* Shell */
    --sidebar: 252px;
    --topbar: 54px;
    --content-pad-x: 20px;
    --content-pad-y: 16px;

    /* Controls */
    --control-h: 36px;
    --btn-h: 34px;
    --btn-h-lg: 38px;

    /* Spacing scale */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 28px;
    --space-7: 40px;

    /* Typography */
    --font: "Plus Jakarta Sans", Inter, system-ui, -apple-system, sans-serif;
    --fs-page: 20px;
    --lh-page: 28px;
    --fs-section: 15px;
    --lh-section: 22px;
    --fs-body: 13px;
    --lh-body: 20px;
    --fs-secondary: 12px;
    --lh-secondary: 16px;
    --fs-label: 11.5px;
    --lh-label: 16px;
    --fs-table: 12.5px;
    --lh-table: 18px;
    --fs-nav: 12.5px;
    --lh-nav: 18px;
    --fs-badge: 11px;
    --lh-badge: 14px;
    --fs-kpi-label: 11.5px;
    --fs-kpi-value: 21px;
    --lh-kpi-value: 28px;
    --fw-regular: 400;
    --fw-medium: 500;
    --fw-semibold: 600;
    --fw-bold: 700;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
@media screen {
    html, body { overflow-x: hidden; }
}
body {
    font-family: var(--font);
    font-size: var(--fs-body);
    line-height: var(--lh-body);
    font-weight: var(--fw-regular);
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    max-width: 100%;
}
img { max-width: 100%; height: auto; }
.avatar, .member-photo, .kpi-motif img { max-width: none; }
h1, h2, h3 { margin: 0; color: var(--text); }
h1 {
    font-size: var(--fs-page);
    line-height: var(--lh-page);
    font-weight: var(--fw-bold);
    letter-spacing: -0.01em;
}
h2 {
    font-size: var(--fs-section);
    line-height: var(--lh-section);
    font-weight: var(--fw-semibold);
}
h3 {
    font-size: var(--fs-body);
    line-height: var(--lh-body);
    font-weight: var(--fw-semibold);
}
p { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
.muted { color: var(--text-muted); }
.icon { width: 16px; height: 16px; flex: 0 0 16px; }
.icon-chevron { width: 12px; height: 12px; margin-left: auto; }

/* ?? Shell ?? */
.app-shell { display: flex; align-items: stretch; min-height: 100vh; max-width: 100%; overflow-x: hidden; }
.sidebar {
    width: var(--sidebar);
    background:
        radial-gradient(120% 70% at 50% -10%, rgba(90, 140, 210, 0.35) 0%, transparent 58%),
        linear-gradient(180deg, #1A365C 0%, #0F2744 42%, #0B1C31 100%);
    color: #D7E0EA;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    align-self: stretch;
    min-height: 100vh;
    height: auto;
    flex-shrink: 0;
    z-index: 30;
}
.sidebar-brand {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 14px 12px 12px;
    border-bottom: 1px solid rgba(255,255,255,.08);
    min-height: var(--topbar);
}
.brand-mark {
    width: 32px; height: 32px; border-radius: 9px;
    background: linear-gradient(180deg, #2AA390 0%, #0F766E 48%, #0A524C 100%);
    color: #fff;
    display: grid; place-items: center;
    font-size: 13px;
    font-weight: var(--fw-bold); letter-spacing: .02em;
    position: relative;
    isolation: isolate;
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,.5),
        inset 0 -6px 10px rgba(0,0,0,.22),
        0 4px 8px rgba(0,0,0,.28);
}
.brand-mark::before {
    content: "";
    position: absolute;
    inset: 2px 4px auto;
    height: 42%;
    border-radius: 7px 7px 40% 40%;
    background: linear-gradient(180deg, rgba(255,255,255,.48), rgba(255,255,255,.04));
    pointer-events: none;
}
.brand-mark-lg { width: 48px; height: 48px; font-size: 20px; }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-text strong {
    color: #fff;
    font-size: 12px;
    letter-spacing: .1em;
    font-weight: var(--fw-bold);
    line-height: 16px;
}
.brand-text small {
    color: #8AA0B5;
    font-size: 10px;
    line-height: 13px;
    margin-top: 1px;
    white-space: normal;
}
.sidebar-nav {
    padding: 12px 10px 10px;
    overflow: visible;
    flex: 1 1 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-auto-rows: auto;
    align-content: start;
    justify-items: stretch;
    gap: 10px 8px;
}
.nav-section { display: none; }
.nav-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 0;
    width: 100%;
    position: relative;
}
.nav-group.is-open { z-index: 6; }
.nav-link, .nav-group-toggle {
    width: 100%;
    min-width: 0;
    height: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 6px;
    padding: 4px 2px 2px;
    border: 0;
    background: transparent;
    color: #E8EEF5;
    border-radius: 10px;
    text-align: center;
    cursor: pointer;
    font-size: 11px;
    line-height: 14px;
    font-weight: var(--fw-semibold);
}
.nav-link > span:not(.launcher-icon),
.nav-group-toggle > span:not(.launcher-icon) {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-shadow: 0 1px 2px rgba(0,0,0,.45);
}
.nav-link .icon-chevron { display: none; }
.launcher-icon {
    width: 52px;
    height: 52px;
    flex: 0 0 52px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    position: relative;
    isolation: isolate;
    background: linear-gradient(180deg, #3A5B8C 0%, #1A3A68 52%, #0B1C31 100%);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,.62),
        inset 0 -10px 14px rgba(0,0,0,.28),
        0 8px 12px rgba(0,0,0,.32),
        0 2px 0 rgba(0,0,0,.22);
    transition: transform .16s ease, box-shadow .16s ease;
}
.launcher-icon::before {
    content: "";
    position: absolute;
    z-index: 1;
    top: 3px;
    left: 8%;
    right: 8%;
    height: 46%;
    border-radius: 12px 12px 45% 45%;
    background: linear-gradient(180deg, rgba(255,255,255,.58) 0%, rgba(255,255,255,.12) 70%, rgba(255,255,255,0) 100%);
    pointer-events: none;
}
.launcher-icon .icon {
    width: 26px;
    height: 26px;
    flex: 0 0 26px;
    color: #fff;
    position: relative;
    z-index: 2;
    filter: drop-shadow(0 1px 1px rgba(0,0,0,.4));
}
.nav-group-toggle .launcher-icon::after {
    content: "";
    position: absolute;
    z-index: 2;
    left: 50%;
    bottom: 5px;
    width: 16px;
    height: 3px;
    margin-left: -8px;
    border-radius: 99px;
    background: rgba(255,255,255,.45);
    box-shadow: 0 0 0 3px rgba(255,255,255,.08);
}
.nav-link:hover, .nav-group-toggle:hover {
    background: transparent;
    color: #fff;
}
.nav-link:hover .launcher-icon,
.nav-group-toggle:hover .launcher-icon {
    transform: scale(1.06);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,.72),
        inset 0 -10px 14px rgba(0,0,0,.24),
        0 12px 16px rgba(0,0,0,.36),
        0 2px 0 rgba(0,0,0,.2);
}
.nav-link.is-active, .nav-group-toggle.is-active {
    background: transparent;
    color: #fff;
    font-weight: var(--fw-semibold);
    box-shadow: none;
}
.nav-link.is-active .launcher-icon,
.nav-group-toggle.is-active .launcher-icon {
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,.7),
        inset 0 -10px 14px rgba(0,0,0,.24),
        0 0 0 2px rgba(246, 226, 168, .85),
        0 8px 14px rgba(0,0,0,.34);
}
.nav-link.is-muted,
.nav-group.is-muted .nav-group-toggle {
    opacity: .62;
    color: #B7C4D2;
}
.nav-link.is-muted .launcher-icon,
.nav-group.is-muted .launcher-icon {
    filter: grayscale(.35);
}
.nav-link.is-muted:hover,
.nav-group.is-muted .nav-group-toggle:hover {
    opacity: .85;
}
.launcher-tone-azure .launcher-icon { background: linear-gradient(180deg, #5BA4FF 0%, #1E63D4 52%, #12408C 100%); }
.launcher-tone-teal .launcher-icon { background: linear-gradient(180deg, #3CC4B7 0%, #0F766E 52%, #08554F 100%); }
.launcher-tone-emerald .launcher-icon { background: linear-gradient(180deg, #4FD08A 0%, #15803D 52%, #0B4A24 100%); }
.launcher-tone-amber .launcher-icon { background: linear-gradient(180deg, #F0C14B 0%, #C4841A 52%, #7A4E0C 100%); }
.launcher-tone-violet .launcher-icon { background: linear-gradient(180deg, #9B7BFF 0%, #5B3CC4 52%, #3A2084 100%); }
.launcher-tone-orange .launcher-icon { background: linear-gradient(180deg, #FF9A4A 0%, #D05A12 52%, #7A2F08 100%); }
.launcher-tone-cyan .launcher-icon { background: linear-gradient(180deg, #5ED4E8 0%, #0E7490 52%, #0A4A5C 100%); }
.launcher-tone-lime .launcher-icon { background: linear-gradient(180deg, #A3E04A 0%, #4D7C0F 52%, #2F4A0A 100%); }
.launcher-tone-sky .launcher-icon { background: linear-gradient(180deg, #7DD3FC 0%, #0284C7 52%, #075985 100%); }
.launcher-tone-slate .launcher-icon { background: linear-gradient(180deg, #94A3B8 0%, #475569 52%, #1E293B 100%); }
.nav-sub {
    display: none;
    position: absolute;
    top: calc(100% - 6px);
    left: 50%;
    transform: translateX(-50%);
    width: calc(var(--sidebar) - 24px);
    padding: 8px;
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(32, 58, 96, 0.96), rgba(11, 28, 49, 0.96));
    border: 1px solid rgba(255, 232, 180, 0.22);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.2), 0 12px 24px rgba(0,0,0,.35);
}
.nav-group.is-open .nav-sub { display: grid; gap: 4px; }
.sidebar-nav > .nav-group:nth-last-child(-n+2).is-open .nav-sub {
    top: auto;
    bottom: calc(100% - 6px);
}
.nav-group.is-open .icon-chevron { transform: rotate(180deg); }
.nav-sublink {
    display: block;
    padding: 7px 10px;
    color: #E8EEF5;
    border-radius: 8px;
    font-size: 12px;
    line-height: 16px;
    font-weight: var(--fw-medium);
    background: linear-gradient(180deg, rgba(255,255,255,.1), rgba(255,255,255,.03));
    box-shadow: inset 0 1px 0 rgba(255,255,255,.16);
}
.nav-sublink:hover { color: #fff; background: linear-gradient(180deg, rgba(255,255,255,.2), rgba(255,255,255,.06)); }
.nav-sublink.is-active {
    color: #fff;
    background: linear-gradient(180deg, rgba(15,118,110,.55), rgba(15,118,110,.28));
    font-weight: var(--fw-semibold);
}
.nav-sublink.is-muted { opacity: .6; }
.nav-sublink.is-soon {
    opacity: .62;
    cursor: default;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    pointer-events: none;
}
.nav-soon {
    font-size: 9px;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #F6E2A8;
    font-weight: var(--fw-semibold);
}
.sidebar-foot {
    margin-top: auto;
    padding: 10px 14px;
    color: #7E93A8;
    font-size: 11px;
    border-top: 1px solid rgba(255,255,255,.08);
}

.app-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
    min-height: var(--topbar);
    height: auto;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px var(--content-pad-x);
    position: sticky;
    top: 0;
    z-index: 20;
    min-width: 0;
}
.icon-btn {
    width: 32px; height: 32px; border: 0; background: transparent;
    border-radius: 7px; color: var(--text-muted); display: grid; place-items: center; cursor: pointer;
}
.icon-btn:hover { background: var(--bg); color: var(--text); }
.breadcrumbs {
    display: flex; align-items: center; gap: 6px;
    color: var(--text-muted); font-size: var(--fs-secondary);
    white-space: nowrap; min-width: 0;
    overflow: hidden;
    flex: 1 1 auto;
}
.breadcrumbs a, .crumb-current {
    overflow: hidden;
    text-overflow: ellipsis;
}
.crumb-sep { color: #C5CED8; }
.crumb-current { color: var(--text); font-weight: var(--fw-medium); }
.topbar-search { margin-left: auto; position: relative; width: min(280px, 28vw); }
.topbar-search input {
    width: 100%; height: 32px; border: 1px solid var(--border); border-radius: 7px;
    padding: 0 10px 0 32px; background: var(--surface-subtle); color: var(--text-muted);
    font-size: var(--fs-secondary);
}
.search-affordance { position: absolute; left: 9px; top: 8px; color: var(--text-muted); }
.topbar-actions { display: flex; align-items: center; gap: 4px; }
.user-chip { display: flex; align-items: center; gap: 8px; padding: 2px 6px; }
.user-avatar {
    width: 28px; height: 28px; border-radius: 50%;
    background: var(--navy); color: #fff; display: grid; place-items: center;
    font-size: 12px; font-weight: var(--fw-semibold);
}
.user-meta { display: flex; flex-direction: column; min-width: 0; }
.user-meta strong, .user-meta small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 140px;
}
.user-meta strong { font-size: 12px; line-height: 15px; font-weight: var(--fw-semibold); }
.user-meta small { color: var(--text-muted); font-size: 11px; line-height: 14px; }
.logout-form { margin: 0; }
.content {
    padding: var(--content-pad-y) var(--content-pad-x);
    width: 100%;
    min-width: 0;
    max-width: none;
}
.member-form {
    max-width: 1120px;
}

/* ?? Page header ?? */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 14px;
}
.page-header p {
    color: var(--text-muted);
    margin-top: 2px;
    font-size: var(--fs-secondary);
    line-height: var(--lh-secondary);
}
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.module-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0 0 12px;
}
.module-nav-btn {
    display: inline-flex;
    align-items: center;
    height: 30px;
    padding: 0 12px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border);
    background: linear-gradient(180deg, #FFFFFF 0%, #F3F6FA 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
    color: var(--text);
    font-size: 12px;
    font-weight: var(--fw-semibold);
    line-height: 1;
}
.module-nav-btn:hover {
    border-color: var(--border-strong);
    background: linear-gradient(180deg, #FFFFFF 0%, #EAF0F7 100%);
}
.module-nav-btn.is-active {
    color: #F7F1E3;
    border-color: rgba(255, 232, 180, 0.28);
    background: linear-gradient(180deg, #2A4A78 0%, #17355A 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28);
}
.module-nav-btn.is-muted { opacity: .62; }

.module-launcher-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
    gap: 14px;
    max-width: 1120px;
    min-width: 0;
}
.module-launcher-grid[data-count="2"] { max-width: 480px; }
.module-launcher-grid[data-count="3"] { max-width: 720px; }
@media (min-width: 1100px) {
    .module-launcher-grid[data-count="5"] {
        grid-template-columns: repeat(5, minmax(0, 1fr));
        max-width: 1120px;
    }
}
.module-launcher {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    text-align: center;
    gap: 8px;
    min-width: 0;
    padding: 22px 14px 18px;
    background: linear-gradient(180deg, #FFFFFF 0%, #F7FAFC 100%);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow);
    color: var(--text);
}
.module-launcher:hover {
    border-color: var(--border-strong);
    box-shadow: var(--shadow-md);
}
.module-launcher:hover .launcher-icon {
    transform: scale(1.06);
}
.module-launcher strong {
    font-size: 13px;
    line-height: 18px;
    font-weight: var(--fw-semibold);
    max-width: 100%;
}
.module-launcher small {
    color: var(--text-muted);
    font-size: 11.5px;
    line-height: 16px;
    max-width: 100%;
}
.module-launcher-badge {
    margin-top: 2px;
    font-size: 10px;
    letter-spacing: .08em;
    text-transform: uppercase;
    font-weight: var(--fw-semibold);
    color: #8A6A24;
    background: #FFF6E8;
    border: 1px solid rgba(148, 113, 48, 0.22);
    border-radius: 999px;
    padding: 3px 8px;
}
.module-launcher.is-soon {
    opacity: .78;
    cursor: default;
    pointer-events: none;
}
@media (max-width: 1023px) {
    .module-launcher-grid,
    .module-launcher-grid[data-count="5"],
    .module-launcher-grid[data-count="3"],
    .module-launcher-grid[data-count="2"] {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        max-width: none;
    }
}
@media (max-width: 420px) {
    .module-launcher-grid,
    .module-launcher-grid[data-count="5"],
    .module-launcher-grid[data-count="3"],
    .module-launcher-grid[data-count="2"] {
        grid-template-columns: minmax(0, 1fr);
    }
}
@media (max-width: 430px) {
    html, body.app-body { overflow-x: hidden; }
}
@media (max-width: 390px) {
    html, body.app-body { overflow-x: hidden; }
    .kpi-grid-primary,
    .kpi-grid-secondary,
    .kpi-grid-exec { grid-template-columns: 1fr; }
}
@media (min-width: 768px) {
    .app-shell { max-width: 100%; }
}
@media (min-width: 1024px) {
    .app-shell { max-width: 100%; }
}
@media (min-width: 1440px) {
    .app-shell { max-width: 100%; }
}

/* ?? KPI / panels ?? */
.kpi-grid { display: grid; gap: 12px; margin-bottom: 12px; }
.kpi-grid-primary { grid-template-columns: repeat(4, 1fr); }
.kpi-grid-secondary { grid-template-columns: repeat(4, 1fr); }
.kpi-grid-exec {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}
.kpi-card, .chart-card, .panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.kpi-card {
    min-width: 0;
    overflow: hidden;
    padding: 12px 14px 11px;
    border-left-width: 4px;
    box-shadow: 0 1px 2px rgba(15, 39, 68, 0.05), 0 8px 18px rgba(15, 39, 68, 0.04);
}
.kpi-label {
    color: var(--text-muted);
    font-size: 10.5px;
    line-height: 14px;
    font-weight: var(--fw-semibold);
    letter-spacing: .04em;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.kpi-value {
    margin-top: 6px;
    font-size: 18px;
    line-height: 22px;
    font-weight: var(--fw-bold);
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.03em;
    color: var(--text);
    min-width: 0;
}
.kpi-value.kpi-money {
    display: flex;
    align-items: baseline;
    gap: 5px;
}
.kpi-currency {
    flex: 0 0 auto;
    font-size: 11px;
    line-height: 1;
    font-weight: var(--fw-semibold);
    letter-spacing: 0;
    opacity: .72;
}
.kpi-amount {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: clamp(13px, 1.05vw, 18px);
    line-height: 1.15;
}
.kpi-hint {
    margin-top: 5px;
    color: var(--text-muted);
    font-size: 11px;
    line-height: 14px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-clamp: 2;
    overflow: hidden;
}
.kpi-card.tone-primary {
    background: linear-gradient(180deg, #D7E3F2 0%, #EEF3F9 100%);
    border-color: #B7C9DE;
    border-left-color: var(--navy-700);
}
.kpi-card.tone-primary .kpi-label,
.kpi-card.tone-primary .kpi-value { color: var(--navy); }
.kpi-card.tone-navy {
    background: linear-gradient(180deg, #D2DEEE 0%, #EDF2F8 100%);
    border-color: #B0C2D8;
    border-left-color: var(--navy);
}
.kpi-card.tone-navy .kpi-label,
.kpi-card.tone-navy .kpi-value { color: var(--navy); }
.kpi-card.tone-accent {
    background: linear-gradient(180deg, #CDEAD6 0%, #EAF6F3 100%);
    border-color: #A9D8CF;
    border-left-color: var(--accent);
}
.kpi-card.tone-accent .kpi-label,
.kpi-card.tone-accent .kpi-value { color: #0B5E58; }
.kpi-card.tone-success {
    background: linear-gradient(180deg, #CDEAD6 0%, #EEF8F1 100%);
    border-color: #B3DCC2;
    border-left-color: var(--success);
}
.kpi-card.tone-success .kpi-label,
.kpi-card.tone-success .kpi-value { color: #0C6840; }
.kpi-card.tone-danger {
    background: linear-gradient(180deg, #F8D4D1 0%, #FDF1F0 100%);
    border-color: #EBB7B2;
    border-left-color: var(--danger);
}
.kpi-card.tone-danger .kpi-label,
.kpi-card.tone-danger .kpi-value { color: #9B1C14; }
.kpi-card.tone-warning {
    background: linear-gradient(180deg, #FDE3B8 0%, #FFF6E8 100%);
    border-color: #E8C58A;
    border-left-color: var(--warning);
}
.kpi-card.tone-warning .kpi-label,
.kpi-card.tone-warning .kpi-value { color: #9A4A0A; }
.kpi-card.tone-info {
    background: linear-gradient(180deg, #C9DBF8 0%, #EAF1FC 100%);
    border-color: #A9C3EE;
    border-left-color: var(--info);
}
.kpi-card.tone-info .kpi-label,
.kpi-card.tone-info .kpi-value { color: #144BB3; }
.kpi-card.tone-muted {
    background: linear-gradient(180deg, #E6EAF0 0%, #F7F8FA 100%);
    border-color: #C9D1DB;
    border-left-color: #7E8B9A;
}

/* Executive dashboard KPI — scoped; do not affect other .kpi-card pages */
.kpi-exec {
    --kpi-gap: 10px;
    margin-bottom: 16px;
}
.kpi-exec .kpi-asof {
    margin: -6px 0 12px;
    color: var(--text-muted);
    font-size: 11.5px;
    line-height: 16px;
    font-weight: var(--fw-medium);
    letter-spacing: 0;
}
.kpi-exec .kpi-exec-board {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: var(--kpi-gap);
    width: 100%;
    margin-bottom: 0;
}
.kpi-exec .kpi-exec-board > .kpi-card:nth-child(-n+4) { grid-column: span 3; }
.kpi-exec .kpi-exec-board > .kpi-card:nth-child(n+5) { grid-column: span 4; }
.kpi-exec .kpi-card,
.kpi-exec .kpi-card.tone-primary,
.kpi-exec .kpi-card.tone-navy,
.kpi-exec .kpi-card.tone-accent,
.kpi-exec .kpi-card.tone-success,
.kpi-exec .kpi-card.tone-danger,
.kpi-exec .kpi-card.tone-warning,
.kpi-exec .kpi-card.tone-info,
.kpi-exec .kpi-card.tone-muted {
    position: relative;
    isolation: isolate;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    min-width: 0;
    overflow: hidden;
    padding: 12px 12px 11px;
    color: #F7F1E3;
    border: 1px solid rgba(255, 232, 180, 0.28);
    border-left-width: 1px;
    border-radius: 12px;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.42),
        inset 0 -10px 18px rgba(0, 0, 0, 0.18),
        0 10px 22px rgba(11, 28, 49, 0.18);
}
.kpi-exec .kpi-card::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background: linear-gradient(165deg, rgba(255, 255, 255, 0.38) 0%, rgba(255, 255, 255, 0.08) 36%, rgba(255, 255, 255, 0) 62%);
}
.kpi-exec .kpi-card > * {
    position: relative;
    z-index: 1;
}
.kpi-exec .kpi-card.tone-primary,
.kpi-exec .kpi-card.tone-navy {
    background: linear-gradient(180deg, #2A4A78 0%, #17355A 48%, #0B1C31 100%);
}
.kpi-exec .kpi-card.tone-accent,
.kpi-exec .kpi-card.tone-success {
    background: linear-gradient(180deg, #1C7A5A 0%, #0F5C44 48%, #08382A 100%);
}
.kpi-exec .kpi-card.tone-info {
    background: linear-gradient(180deg, #2B5EA8 0%, #173F7A 48%, #0C274C 100%);
}
.kpi-exec .kpi-card.tone-warning {
    background: linear-gradient(180deg, #C4841A 0%, #8E5A0C 48%, #4E3208 100%);
}
.kpi-exec .kpi-card.tone-danger {
    background: linear-gradient(180deg, #B33A32 0%, #7A1F1C 48%, #3E1010 100%);
}
.kpi-exec .kpi-card.tone-muted {
    background: linear-gradient(180deg, #5B677A 0%, #3D4A5C 48%, #1C2533 100%);
}
.kpi-exec .kpi-card:hover {
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.55),
        inset 0 -10px 18px rgba(0, 0, 0, 0.16),
        0 12px 24px rgba(11, 28, 49, 0.22);
}
.kpi-exec .kpi-icon-chip {
    flex: 0 0 28px;
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    border: 1px solid rgba(255, 232, 180, 0.4);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.06));
    color: #F6E2A8;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.kpi-exec .kpi-icon {
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
}
.kpi-exec .kpi-card.tone-accent .kpi-icon-chip,
.kpi-exec .kpi-card.tone-success .kpi-icon-chip,
.kpi-exec .kpi-card.tone-info .kpi-icon-chip,
.kpi-exec .kpi-card.tone-warning .kpi-icon-chip,
.kpi-exec .kpi-card.tone-danger .kpi-icon-chip,
.kpi-exec .kpi-card.tone-muted .kpi-icon-chip {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.06));
    border-color: rgba(255, 232, 180, 0.4);
    color: #F6E2A8;
}
.kpi-exec .kpi-body { min-width: 0; width: 100%; flex: 1; }
.kpi-exec .kpi-label,
.kpi-exec .kpi-card.tone-primary .kpi-label,
.kpi-exec .kpi-card.tone-navy .kpi-label,
.kpi-exec .kpi-card.tone-accent .kpi-label,
.kpi-exec .kpi-card.tone-success .kpi-label,
.kpi-exec .kpi-card.tone-danger .kpi-label,
.kpi-exec .kpi-card.tone-warning .kpi-label,
.kpi-exec .kpi-card.tone-info .kpi-label,
.kpi-exec .kpi-card.tone-muted .kpi-label {
    color: #F6E2A8;
    font-size: 13px;
    line-height: 16px;
    font-weight: var(--fw-bold);
    letter-spacing: .01em;
    text-transform: none;
    white-space: normal;
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    text-overflow: ellipsis;
    text-shadow: 0 1px 0 rgba(0, 0, 0, .45);
    -webkit-font-smoothing: antialiased;
}
.kpi-exec .kpi-value,
.kpi-exec .kpi-card.tone-primary .kpi-value,
.kpi-exec .kpi-card.tone-navy .kpi-value,
.kpi-exec .kpi-card.tone-accent .kpi-value,
.kpi-exec .kpi-card.tone-success .kpi-value,
.kpi-exec .kpi-card.tone-danger .kpi-value,
.kpi-exec .kpi-card.tone-warning .kpi-value,
.kpi-exec .kpi-card.tone-info .kpi-value,
.kpi-exec .kpi-card.tone-muted .kpi-value {
    margin-top: 3px;
    color: #FFFFFF;
    font-size: 15px;
    line-height: 18px;
}
.kpi-exec .kpi-currency {
    font-size: 10px;
    font-weight: var(--fw-medium);
    color: #FFFFFF;
    opacity: .78;
}
.kpi-exec .kpi-amount {
    overflow: visible;
    text-overflow: clip;
    white-space: nowrap;
    font-size: clamp(14px, 1.05vw, 18px);
    line-height: 1.2;
    color: #FFFFFF;
    text-shadow: 0 1px 0 rgba(0, 0, 0, .35);
}
.kpi-exec .kpi-hint {
    margin-top: 4px;
    font-size: 10px;
    line-height: 13px;
    color: rgba(247, 241, 227, 0.78);
}
.kpi-exec .kpi-card > .kpi-motif {
    position: absolute;
    right: 6px;
    bottom: 6px;
    width: 28px;
    height: 28px;
    z-index: 0;
    pointer-events: none;
    color: #F6E2A8;
    opacity: .34;
    filter: drop-shadow(0 3px 6px rgba(0, 0, 0, .22));
}
.kpi-exec .kpi-motif svg {
    display: block;
    width: 100%;
    height: 100%;
}
.kpi-exec .kpi-icon {
    animation: kpi-icon-breathe 3.6s ease-in-out infinite;
}
.kpi-exec .kpi-motif-users .kpi-motif {
    animation: kpi-float 4.2s ease-in-out infinite;
}
.kpi-exec .kpi-motif-wallet .kpi-motif {
    animation: kpi-float 3.4s ease-in-out infinite;
}
.kpi-exec .kpi-motif-wallet .kpi-motif-coin {
    transform-box: fill-box;
    transform-origin: center;
    animation: kpi-coin-bounce 2.4s ease-in-out infinite;
}
.kpi-exec .kpi-motif-credit .kpi-motif {
    animation: kpi-slide 3.4s ease-in-out infinite;
}
.kpi-exec .kpi-motif-calendar .kpi-motif {
    transform-origin: 70% 80%;
    animation: kpi-flip 3.8s ease-in-out infinite;
}
.kpi-exec .kpi-motif-calendar .kpi-motif-day {
    transform-box: fill-box;
    transform-origin: center;
    animation: kpi-day-pulse 2.2s ease-in-out infinite;
}
.kpi-exec .kpi-motif-check .kpi-motif {
    animation: kpi-ok 2.8s ease-in-out infinite;
}
.kpi-exec .kpi-motif-alert-circle .kpi-motif {
    animation: kpi-alert 1.8s ease-in-out infinite;
}
.kpi-exec .kpi-motif-finance .kpi-motif {
    animation: kpi-rise 2.6s ease-in-out infinite;
}
.kpi-exec .kpi-motif-report .kpi-motif {
    animation: kpi-paper 3.2s ease-in-out infinite;
}
.kpi-exec .kpi-motif-report .kpi-motif-clock {
    transform-box: fill-box;
    transform-origin: center;
    animation: kpi-clock 6s linear infinite;
}
.kpi-exec .kpi-card:hover > .kpi-motif {
    opacity: .48;
}
@keyframes kpi-icon-breathe {
    0%, 100% { transform: scale(1); opacity: .92; }
    50% { transform: scale(1.08); opacity: 1; }
}
@keyframes kpi-float {
    0%, 100% { transform: translateY(2px); }
    50% { transform: translateY(-2px); }
}
@keyframes kpi-coin-bounce {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-2px) scale(1.06); }
}
@keyframes kpi-slide {
    0%, 100% { transform: translateX(1px) rotate(-4deg); }
    50% { transform: translateX(-2px) rotate(3deg); }
}
@keyframes kpi-flip {
    0%, 100% { transform: rotateX(0deg); }
    45% { transform: rotateX(16deg); }
}
@keyframes kpi-day-pulse {
    0%, 100% { opacity: .7; }
    50% { opacity: 1; }
}
@keyframes kpi-ok {
    0%, 100% { transform: scale(1); opacity: .34; }
    50% { transform: scale(1.08); opacity: .5; }
}
@keyframes kpi-alert {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.12); }
}
@keyframes kpi-rise {
    0%, 100% { transform: translateY(2px); }
    50% { transform: translateY(-2px); }
}
@keyframes kpi-paper {
    0%, 100% { transform: rotate(-3deg) translateY(1px); }
    50% { transform: rotate(3deg) translateY(-2px); }
}
@keyframes kpi-clock {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
    .kpi-exec .kpi-icon,
    .kpi-exec .kpi-motif,
    .kpi-exec .kpi-motif-coin,
    .kpi-exec .kpi-motif-day,
    .kpi-exec .kpi-motif-clock {
        animation: none !important;
    }
}

.chart-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 4px 0 16px; }
.chart-card { padding: 14px 16px; }
.chart-card-head p { color: var(--text-muted); font-size: 12px; margin-top: 2px; }
.chart-empty { margin-top: 12px; text-align: center; color: var(--text-muted); }
.chart-placeholder {
    height: 140px;
    border: 1px dashed var(--border);
    border-radius: 8px;
    background:
        linear-gradient(180deg, rgba(15,118,110,.03), transparent 70%),
        repeating-linear-gradient(90deg, transparent, transparent 39px, var(--border) 40px);
    margin-bottom: 10px;
}

.panel { padding: 14px 16px; margin-bottom: 12px; min-width: 0; max-width: 100%; }
.panel-head { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 12px; align-items: flex-start; }
.panel-head p { color: var(--text-muted); font-size: var(--fs-secondary); }

.empty-state { text-align: center; padding: 28px 16px; color: var(--text-muted); }
.empty-icon { margin: 0 auto 10px; width: 36px; height: 36px; color: #9AA8B6; display: grid; place-items: center; }
.empty-icon .icon { width: 28px; height: 28px; flex: 0 0 28px; }
.empty-state h3 { color: var(--text); margin-bottom: 4px; }
.empty-state p { max-width: 420px; margin: 0 auto; }
.empty-state-actions { margin-top: 16px; display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }
.empty-state.panel { padding: 36px 20px; }

.alert {
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
    font-size: var(--fs-body);
    line-height: var(--lh-body);
}
.alert-success { background: var(--success-bg); color: var(--success); }
.alert-danger { background: var(--danger-bg); color: var(--danger); }
.alert-warning { background: var(--warning-bg); color: var(--warning); }
.alert-info { background: var(--info-bg); color: var(--info); }

/* ?? Badges ?? */
.badge {
    display: inline-flex; align-items: center;
    padding: 1px 7px; border-radius: var(--radius-pill);
    font-size: var(--fs-badge); line-height: var(--lh-badge);
    font-weight: var(--fw-semibold);
    letter-spacing: .01em;
    white-space: nowrap;
}
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-muted { background: var(--surface-subtle); color: var(--text-muted); border: 1px solid var(--border); }
.badge-positive { background: var(--success-bg); color: var(--success); }
.badge-attention { background: var(--warning-bg); color: var(--warning); }
.badge-negative { background: var(--danger-bg); color: var(--danger); }
.badge-neutral { background: var(--surface-subtle); color: var(--text-secondary); border: 1px solid var(--border); }

/* ?? Tables ?? */
.table-shell, .table-responsive {
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    box-shadow: var(--shadow);
}
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--fs-table);
    line-height: var(--lh-table);
}
.data-table th, .data-table td {
    padding: 8px 11px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
.data-table th {
    color: var(--text-muted);
    font-weight: var(--fw-semibold);
    font-size: 11px;
    line-height: 14px;
    letter-spacing: .04em;
    text-transform: uppercase;
    background: var(--surface-subtle);
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 1;
}
.data-table tbody tr:hover { background: rgba(15, 39, 68, 0.018); }
.data-table tbody tr:last-child td { border-bottom: 0; }
.table-empty { text-align: center !important; color: var(--text-muted); padding: 20px !important; }
.money-cell, td.money-cell, th.money-cell {
    text-align: right;
    font-variant-numeric: tabular-nums;
    font-weight: var(--fw-semibold);
    white-space: nowrap;
}
.tabular { font-variant-numeric: tabular-nums; }
input[data-money] {
    font-variant-numeric: tabular-nums;
}
.money-emphasis { font-weight: var(--fw-bold); color: var(--text); }
.money-emphasis.is-danger { color: var(--danger); }
.ref-mono { font-variant-numeric: tabular-nums; letter-spacing: .01em; }

/* ?? Filters / pagination ?? */
.filter-bar, .pagination-shell {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin: 8px 0;
    min-width: 0;
    max-width: 100%;
}
.filter-bar-wrap {
    flex-wrap: wrap;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 12px;
    margin-bottom: 12px;
    gap: 8px;
}
.filter-bar input,
.filter-bar select,
.field input,
.field select,
.field textarea {
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
    height: var(--control-h);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0 10px;
    background: #fff;
    font-size: var(--fs-body);
    color: var(--text);
}
.field input, .field select, .field textarea { width: 100%; }
.field textarea {
    height: auto;
    min-height: 72px;
    padding: 8px 10px;
    resize: vertical;
}
.filter-bar input,
.filter-bar select {
    flex: 1 1 160px;
    width: auto;
}
.filter-bar input[type="search"] { min-width: 200px; flex: 1 1 220px; }
.filter-bar input:focus,
.filter-bar select:focus,
.field input:focus,
.field select:focus,
.field textarea:focus {
    outline: 2px solid var(--accent-ring);
    border-color: var(--accent);
}
.pagination-shell {
    justify-content: space-between;
    color: var(--text-muted);
    font-size: 12px;
    margin-top: 10px;
}
.pagination-btns { display: flex; gap: 6px; }

/* ?? Tabs ?? */
.tabs {
    display: flex;
    gap: 2px;
    border-bottom: 1px solid var(--border);
    margin: 10px 0 14px;
    max-width: 100%;
    min-width: 0;
}
.tabs-scroll {
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}
.tab {
    border: 0;
    background: none;
    padding: 8px 12px;
    color: var(--text-muted);
    cursor: pointer;
    font-size: var(--fs-nav);
    line-height: var(--lh-nav);
    font-weight: var(--fw-medium);
    border-radius: 6px 6px 0 0;
    display: inline-block;
}
a.tab { color: var(--text-muted); }
.tab:hover { color: var(--text); background: rgba(15, 39, 68, 0.03); }
.tab.is-active {
    color: var(--navy);
    font-weight: var(--fw-semibold);
    box-shadow: inset 0 -2px 0 var(--accent);
    background: transparent;
}

.skeleton-grid { display: grid; gap: 8px; margin-top: 12px; }
.skeleton {
    height: 10px; border-radius: 6px;
    background: linear-gradient(90deg, #EEF1F4, #F7F9FB, #EEF1F4);
    background-size: 200% 100%;
    animation: pulse 1.4s ease infinite;
}
@keyframes pulse { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }

/* ?? Buttons ?? */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: var(--btn-h);
    padding: 0 12px;
    border-radius: 8px;
    border: 1px solid transparent;
    cursor: pointer;
    font-size: 12.5px;
    line-height: 1;
    font-weight: var(--fw-semibold);
    white-space: nowrap;
}
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-700); }
.btn-secondary {
    background: var(--accent-soft);
    color: var(--accent);
    border-color: transparent;
}
.btn-secondary:hover { background: #d9efeb; }
.btn-ghost { background: #fff; border-color: var(--border); color: var(--text); }
.btn-ghost:hover { background: var(--surface-subtle); border-color: var(--border-strong); }
.btn-danger { background: var(--danger); color: #fff; border: none; }
.btn-danger:hover { filter: brightness(0.95); }
.btn-lg { height: var(--btn-h-lg); padding: 0 14px; }
.btn-block { width: 100%; }
.btn-sm { height: 28px; padding: 0 8px; font-size: 12px; border-radius: 7px; }
.btn-icon {
    width: 32px; height: 32px; padding: 0;
    border-radius: 7px;
}
.btn.is-loading .btn-label { display: none; }
.btn .btn-loading { display: none; }
.btn.is-loading .btn-loading { display: inline; }
.btn:disabled, .btn.is-disabled { opacity: .55; cursor: not-allowed; }
.btn.is-disabled { pointer-events: none; }

/* ?? Forms ?? */
.form { display: grid; gap: 8px; min-width: 0; max-width: 100%; }
.field { display: grid; gap: 4px; min-width: 0; }
.field span, .field > label {
    font-size: 10.5px;
    line-height: 14px;
    font-weight: var(--fw-semibold);
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--text-muted);
}
.field input, .field select {
    width: 100%;
    min-width: 0;
    height: var(--control-h);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0 10px;
    background: #fff;
    font-size: var(--fs-body);
}
.check { display: flex; gap: 8px; align-items: center; color: var(--text-muted); font-size: var(--fs-secondary); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; min-width: 0; }
.form-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.field-span-2 { grid-column: span 2; }
.field.is-required span::after {
    content: ' *';
    color: var(--danger);
    font-weight: var(--fw-semibold);
}
.field-hint {
    margin: 0;
    font-size: 11.5px;
    color: var(--text-muted);
}
.member-form { min-width: 0; overflow-x: hidden; }
.member-form .form-section.panel { padding: 14px 16px 12px; }
.member-form .form-section-title { margin-bottom: 8px; }
.member-form .form-section-hint { margin-bottom: 8px; }
.member-form .address-details { margin-top: 6px; }
.form-actions-wrap { max-width: 1120px; }
.form-actions-hint {
    margin: 0 0 8px;
    font-size: 12px;
    line-height: 16px;
    color: var(--text-muted);
}
.region-cascade {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    margin-top: 8px;
}
.village-picker {
    display: grid;
    gap: 6px;
    min-width: 0;
}
.village-picker input[type="search"] {
    height: var(--control-h);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0 10px;
    min-width: 0;
}
.same-as-ktp { margin: 4px 0 12px; }
.domicile-block { min-width: 0; }
.doc-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}
.doc-summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 8px 10px;
}
.doc-checklist { display: grid; gap: 8px; }
.doc-card {
    display: grid;
    grid-template-columns: 76px minmax(0, 1fr) auto;
    gap: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    align-items: center;
}
.doc-card-main { display: grid; gap: 4px; min-width: 0; }
.doc-card-side { display: grid; gap: 8px; justify-items: end; align-content: center; min-width: 0; }
.doc-thumb {
    width: 76px;
    height: 76px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--surface-subtle);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 0;
    margin: 0;
    overflow: hidden;
    color: var(--text-muted);
    text-decoration: none;
    cursor: default;
}
button.doc-thumb,
a.doc-thumb {
    cursor: pointer;
}
.doc-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.doc-thumb.is-empty {
    border-style: dashed;
    background: #f7f8fa;
    font-size: 10px;
    font-weight: var(--fw-medium);
    letter-spacing: .02em;
    text-transform: uppercase;
}
.doc-thumb.is-pdf {
    background: #eef3f8;
    color: var(--navy);
    font-size: 10px;
    font-weight: var(--fw-semibold);
    letter-spacing: .04em;
}
.doc-thumb-icon { width: 20px; height: 20px; }
.doc-thumb.is-image:hover { border-color: var(--border-strong); }
.doc-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-end;
    align-items: center;
}
.doc-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.doc-upload-inline {
    display: inline-flex;
    margin: 0;
    min-width: 0;
}
.doc-upload-inline input[type="file"] { max-width: 220px; }
.doc-upload-inline .photo-replace-file { max-width: none; }
.doc-verify-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-end;
    align-items: center;
}
.doc-reject-form { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.doc-reject-reason {
    height: 28px;
    min-width: 140px;
    max-width: 220px;
    border: 1px solid var(--border);
    border-radius: 7px;
    padding: 0 8px;
    font-size: 12px;
}
.field-span { grid-column: 1 / -1; }
.field-error { color: var(--danger); font-size: 11.5px; }
.form-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; margin: 8px 0 20px; }
.mini-title {
    margin: 12px 0 6px;
    color: var(--text-muted);
    font-size: 11px;
    letter-spacing: .05em;
    text-transform: uppercase;
    font-weight: var(--fw-semibold);
}
textarea {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 8px 10px;
    min-height: 72px;
    font-size: var(--fs-body);
    line-height: var(--lh-body);
    resize: vertical;
}

/* ?? Auth (slightly more spacious) ?? */
.auth-body { background: var(--bg); overflow-x: hidden; }
.auth-shell { min-height: 100vh; display: grid; grid-template-columns: 1.05fr .95fr; max-width: 100%; }
.auth-brand-mobile { display: none; }
.auth-panel {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    background: var(--navy);
    color: #D5DEE8;
    padding: 48px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
/* Login visual fills left panel without remote/missing media files */
.auth-video-wrap {
    position: absolute;
    inset: 0;
    z-index: 0;
}
.auth-panel-visual {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(1100px 820px at 12% 0%, rgba(255, 255, 255, .12), transparent 58%),
        radial-gradient(820px 640px at 100% 100%, rgba(0, 0, 0, .22), transparent 54%);
}
.auth-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: none;
}
.auth-video-scrim {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(180deg, rgba(11, 28, 49, .62) 0%, rgba(15, 39, 68, .18) 48%, rgba(11, 28, 49, .7) 100%);
}
.auth-brand,
.auth-points { position: relative; z-index: 1; }
.auth-brand h1 {
    color: #fff;
    letter-spacing: .12em;
    font-size: 26px;
    line-height: 34px;
    margin-top: 16px;
    font-weight: var(--fw-bold);
}
.auth-brand p { max-width: 420px; margin-top: 12px; color: #D5DEE8; font-size: 14px; line-height: 22px; }
.auth-points { padding-left: 18px; color: #E2EAF1; font-size: 13px; }
.auth-points li { margin: 8px 0; }

@media (prefers-reduced-motion: reduce) {
    .auth-video { visibility: hidden; }
}
.auth-form-wrap { display: grid; place-items: center; padding: 40px 32px; min-width: 0; max-width: 100%; }
.auth-card {
    width: min(520px, 100%);
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    padding: 36px 36px 32px;
}
.eyebrow {
    color: var(--accent);
    font-size: 11px;
    font-weight: var(--fw-semibold);
    letter-spacing: .08em;
    text-transform: uppercase;
}
.auth-card .eyebrow { font-size: 12px; }
.auth-card h2 {
    font-size: 26px;
    line-height: 34px;
    font-weight: var(--fw-bold);
    letter-spacing: -0.02em;
    margin-top: 4px;
}
.auth-subtitle { color: var(--text-muted); margin: 10px 0 22px; font-size: 14px; line-height: 22px; }
.auth-card .form { gap: 14px; }
.auth-card .field span { font-size: 11.5px; line-height: 16px; }
.auth-card .field input { height: 46px; font-size: 15px; padding: 0 12px; border-radius: 10px; }
.auth-card .btn-primary {
    height: 48px;
    font-size: 15px;
    border-radius: 10px;
}
.auth-card .check { font-size: 13px; gap: 10px; }
.auth-card .check input { width: 16px; height: 16px; }
.auth-foot {
    margin-top: 18px;
    color: var(--text-muted);
    font-size: 13px;
    text-align: center;
    width: min(520px, 100%);
    box-sizing: border-box;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: baseline;
    gap: 0 6px;
    line-height: 1.45;
    padding-inline: 12px;
}
.auth-foot-sep { flex: 0 0 auto; }
.auth-alt {
    margin: 16px 0 0;
    text-align: center;
    font-size: 13px;
}
.auth-alt a { color: var(--accent); font-weight: 600; }
.auth-shell.is-portal .eyebrow { color: var(--accent); }
.auth-card .field { overflow: visible; }
.auth-card .password-toggle { color: var(--navy); }
.password-field { position: relative; display: block; }
.password-field input,
.auth-card .password-field input { padding-right: 46px; }
.password-toggle {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--text-muted);
    display: grid;
    place-items: center;
    cursor: pointer;
}
.password-toggle:hover,
.password-toggle:focus-visible {
    color: var(--navy);
    background: rgba(15, 39, 68, 0.06);
    outline: none;
}
.password-toggle .icon { width: 18px; height: 18px; flex: 0 0 18px; }

.error-body { min-height: 100vh; display: grid; place-items: center; background: var(--bg); }
.error-card {
    background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
    padding: 28px; width: min(480px, calc(100% - 32px)); box-shadow: var(--shadow);
}
.error-card p { color: var(--text-muted); margin: 8px 0 18px; }

/* ?? Overlays ?? */
.toast-stack { position: fixed; right: 16px; bottom: 16px; display: grid; gap: 8px; z-index: 80; max-width: calc(100vw - 24px); }
.toast {
    background: var(--navy); color: #fff;
    padding: 10px 14px; border-radius: 8px;
    box-shadow: var(--shadow-md);
    font-size: var(--fs-body);
    max-width: min(360px, 100%);
}

.modal-root, .drawer-root { position: fixed; inset: 0; z-index: 70; }
.modal-backdrop, .drawer-backdrop { position: absolute; inset: 0; background: rgba(11,18,32,.35); }
.modal {
    position: relative;
    margin: max(16px, 6vh) auto 16px;
    width: min(440px, calc(100vw - 24px));
    max-height: calc(100vh - 32px);
    overflow: auto;
    background: #fff; border-radius: var(--radius-lg); padding: 18px 18px 16px; box-shadow: var(--shadow-md);
}
.modal h2 { font-size: 16px; line-height: 22px; }
.modal-body { margin-top: 10px; font-size: var(--fs-body); color: var(--text-secondary); }
.modal-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.photo-preview-root {
    z-index: 80;
    padding: 12px;
}
.photo-preview-root[hidden] {
    display: none !important;
}
.photo-preview-root:not([hidden]) {
    display: grid;
    place-items: center;
}
.photo-preview-root .modal-backdrop {
    z-index: 0;
    background: rgba(11, 18, 32, .62);
}
.photo-preview-modal {
    position: relative;
    z-index: 1;
    margin: 0;
    width: min(420px, calc(100vw - 24px));
    max-height: min(86dvh, 620px);
    overflow: hidden;
    text-align: left;
    padding: 12px 14px 14px;
}
.photo-preview-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin: 0 0 10px;
}
.photo-preview-head > div { min-width: 0; }
.photo-preview-modal .eyebrow {
    margin: 0 0 2px;
    font-size: 11px;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--text-muted);
}
.photo-preview-modal h2 {
    margin: 0;
    font-size: 16px;
    line-height: 20px;
}
.photo-preview-head .btn {
    flex: 0 0 auto;
    min-height: 36px;
    padding-inline: 12px;
}
.photo-preview-frame {
    display: grid;
    place-items: center;
    min-height: 0;
    max-height: min(52dvh, 380px);
    background: #0b1220;
    border-radius: 12px;
    overflow: hidden;
}
.photo-preview-modal.is-pdf {
    width: min(640px, calc(100vw - 20px));
}
.photo-preview-modal.is-pdf .photo-preview-frame {
    max-height: min(58dvh, 420px);
}
.photo-preview-frame iframe,
.photo-preview-frame img {
    display: none;
    width: 100%;
    border: 0;
}
.photo-preview-frame iframe:not([hidden]) {
    display: block;
    height: min(52dvh, 380px);
    background: #fff;
}
.photo-preview-frame img:not([hidden]) {
    display: block;
    height: auto;
    max-height: min(52dvh, 380px);
    object-fit: contain;
    background: #0b1220;
}
.photo-preview-fallback[hidden] { display: none !important; }
.photo-preview-fallback {
    width: 120px;
    height: 120px;
    flex-basis: 120px;
    font-size: 36px;
    border-radius: 50%;
}
.photo-preview-hint { display: none; }
.photo-preview-modal .modal-actions { display: none; }
.drawer {
    position: absolute; right: 0; top: 0; height: 100%; width: min(400px, 100%);
    background: #fff; padding: 16px; box-shadow: var(--shadow-md);
    display: flex; flex-direction: column;
}
.drawer-head {
    display: flex; justify-content: space-between; align-items: center;
    gap: 8px; margin-bottom: 12px; padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}
.drawer-head h2 { font-size: 15px; }
.drawer-body { flex: 1; overflow: auto; }
.overlay {
    display: none; position: fixed; inset: 0; background: rgba(11,18,32,.35); z-index: 25;
}

/* ?? Domain helpers (global density only) ?? */
.person-cell { display: flex; align-items: center; gap: 10px; }
.person-cell small { display: block; color: var(--text-muted); font-size: 11.5px; }
.avatar {
    width: 32px; height: 32px; border-radius: 50%; object-fit: cover; background: var(--navy);
}
.avatar-lg { width: 48px; height: 48px; }
.avatar-dossier { width: 44px; height: 44px; flex: 0 0 44px; }
.avatar-fallback { display: grid; place-items: center; color: #fff; font-weight: var(--fw-semibold); font-size: 12px; }
.row-actions { display: flex; gap: 4px; justify-content: flex-end; flex-wrap: wrap; white-space: normal; align-items: center; }
.compact-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.reference-number {
    font-variant-numeric: tabular-nums;
    font-weight: var(--fw-semibold);
    letter-spacing: .01em;
    color: var(--text);
}
.financial-value {
    font-variant-numeric: tabular-nums;
    font-weight: var(--fw-bold);
    letter-spacing: -0.01em;
    white-space: nowrap;
}
.financial-value.is-danger { color: var(--danger); }
.secondary-cell { color: var(--text-secondary); font-size: 12.5px; }
.member-name { font-size: 13px; font-weight: var(--fw-semibold); overflow-wrap: break-word; min-width: 0; }
.col-actions { text-align: right; width: 1%; }
.member-table {
    width: 100%;
    min-width: 0;
    table-layout: fixed;
}
.member-table th, .member-table td {
    padding: 7px 10px;
}
.member-table .col-seq {
    width: 44px;
    text-align: center;
    color: var(--text-muted);
    font-weight: var(--fw-semibold);
}
.member-table .col-member { width: 24%; }
.member-table .col-address { width: 26%; }
.member-table .col-phone { width: 13%; }
.member-table .col-nik { width: 14%; }
.member-table .col-optional { width: 11%; }
.member-table .col-status { width: 104px; }
.member-table .col-actions { width: 78px; }
.nasabah-list-table { table-layout: auto; min-width: 1080px; }
.nasabah-list-table .col-seq {
    width: 52px;
    text-align: center;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}
.nasabah-list-table .col-photo {
    width: 64px;
    text-align: center;
}
.nasabah-list-table .col-no { width: 118px; }
.nasabah-list-table .col-name { width: 18%; min-width: 150px; }
.nasabah-list-table .col-category { width: 128px; }
.nasabah-list-table .col-nik { width: 140px; }
.nasabah-list-table .col-phone { width: 120px; }
.nasabah-list-table .col-job { min-width: 120px; }
.nasabah-list-table .col-joined { width: 128px; }
.nasabah-list-table .col-status { width: 120px; }
.nasabah-list-table th.col-actions,
.nasabah-list-table td.col-actions {
    width: 148px;
    min-width: 148px;
    text-align: center;
    vertical-align: middle;
    white-space: nowrap;
    overflow: visible;
    padding: 8px 12px;
    line-height: 1;
}
.nasabah-list-table th,
.nasabah-list-table td {
    vertical-align: middle;
}
.nasabah-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
}
.nasabah-list-table td.col-actions .nasabah-profile-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 30px;
    padding: 0 12px;
    margin: 0;
    min-width: 0;
    box-sizing: border-box;
    flex: 0 0 auto;
}
.member-photo-link-dossier {
    flex: 0 0 44px;
}
.member-person {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}
.member-person-text {
    min-width: 0;
    overflow: hidden;
}
.member-person-text .member-name,
.member-person-text .reference-number {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.member-photo {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--navy);
    display: grid;
    place-items: center;
    box-shadow: inset 0 0 0 1px rgba(15, 39, 68, 0.08);
}
.member-photo-fallback {
    color: #fff;
    font-weight: var(--fw-semibold);
    font-size: 11px;
}
.member-address-cell {
    min-width: 0;
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 16px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.member-phone-cell,
.member-table .col-nik,
.member-table .col-optional {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.member-phone-cell {
    font-weight: var(--fw-semibold);
    color: var(--text);
}
.member-table .col-status,
.member-table .col-actions {
    white-space: nowrap;
}
.member-table tbody tr:nth-child(even) td {
    background: #F4F7FB;
}
.member-table tbody tr:hover td {
    background: #EAF0F7;
}

.member-hero, .dossier-header {
    display: flex; justify-content: space-between; gap: 12px; align-items: flex-start;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 12px 14px; margin-bottom: 10px; box-shadow: var(--shadow);
}
.member-hero-main, .dossier-identity { display: flex; gap: 12px; align-items: center; min-width: 0; }
.member-hero-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.photo-replace-inline { display: inline-flex; margin: 0; }
.photo-replace-label {
    position: relative;
    overflow: hidden;
    cursor: pointer;
    margin: 0;
}
.photo-replace-file {
    position: absolute;
    inset: 0;
    z-index: 2;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    font-size: 0;
    border: 0;
}
.dossier-identity-body { min-width: 0; }
.dossier-title-row {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.dossier-title-row h1 {
    font-size: 18px;
    line-height: 24px;
    font-weight: var(--fw-bold);
    overflow-wrap: break-word;
    min-width: 0;
}
.dossier-meta { margin-top: 2px; font-size: 12px; line-height: 16px; }

/* Member profile — compact glossy dossier; scoped so other pages stay unchanged */
.member-profile { min-width: 0; }
.member-profile > .member-hero.dossier-header {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    padding: 14px 16px 14px;
    margin-bottom: 10px;
    color: #F7F1E3;
    border: 1px solid rgba(255, 232, 180, 0.28);
    border-radius: 14px;
    background: linear-gradient(180deg, #2A4A78 0%, #17355A 48%, #0B1C31 100%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.42),
        inset 0 -12px 22px rgba(0, 0, 0, 0.22),
        0 12px 26px rgba(11, 28, 49, 0.16);
}
.member-profile > .member-hero.dossier-header::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        linear-gradient(165deg, rgba(255, 255, 255, 0.38) 0%, rgba(255, 255, 255, 0.08) 36%, rgba(255, 255, 255, 0) 62%),
        radial-gradient(1200px 180px at 100% -20%, rgba(15, 118, 110, 0.28), transparent 60%);
}
.member-profile > .member-hero.dossier-header > * { position: relative; z-index: 1; }
.member-profile .member-hero-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    min-width: 0;
}
.member-profile .member-hero-main { align-items: center; }
.member-profile .avatar-dossier {
    width: 56px;
    height: 56px;
    flex: 0 0 56px;
    border-radius: 50%;
    border: 2px solid rgba(246, 226, 168, 0.72);
    box-shadow:
        0 0 0 3px rgba(15, 39, 68, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.member-profile .avatar-fallback { font-size: 15px; background: linear-gradient(180deg, #1C7A5A, #08382A); }
.member-profile .dossier-title-row h1 {
    color: #F7F1E3;
    font-size: 20px;
    line-height: 24px;
    letter-spacing: -0.02em;
}
.member-profile .member-hero .reference-number {
    color: #F6E2A8;
    margin-top: 2px;
    font-size: 12px;
    letter-spacing: .06em;
}
.member-profile .member-hero-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}
.member-profile .hero-chip {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: var(--radius-pill);
    font-size: 11px;
    line-height: 14px;
    font-weight: var(--fw-medium);
    color: #F7F1E3;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.06));
    border: 1px solid rgba(255, 232, 180, 0.28);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28);
}
.member-profile .member-hero .btn-primary {
    background: linear-gradient(180deg, #2A6B62 0%, #0F766E 52%, #0A524C 100%);
    color: #F7F1E3;
    border-color: rgba(255, 232, 180, 0.32);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.32);
}
.member-profile .member-hero .btn-primary:hover {
    background: linear-gradient(180deg, #318076 0%, #12867D 52%, #0C5E57 100%);
}
.member-profile .member-hero .btn-ghost {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.06));
    color: #F7F1E3;
    border-color: rgba(255, 232, 180, 0.32);
}
.member-profile .member-hero .btn-ghost:hover {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.26), rgba(255, 255, 255, 0.1));
}
.member-profile .member-hero .badge-success {
    background: linear-gradient(180deg, #CDEAD6, #8ED4B0);
    color: #08382A;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
}
.member-profile .member-profile-kpis {
    margin: 0;
    gap: 8px;
}
.member-profile .member-profile-kpis .summary-item {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    padding: 9px 11px 8px;
    border-radius: 11px;
    border: 1px solid rgba(255, 232, 180, 0.28);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.42),
        inset 0 -8px 14px rgba(0, 0, 0, 0.18),
        0 6px 14px rgba(11, 28, 49, 0.16);
}
.member-profile .member-profile-kpis .summary-item::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background: linear-gradient(165deg, rgba(255, 255, 255, 0.38) 0%, rgba(255, 255, 255, 0.08) 36%, rgba(255, 255, 255, 0) 62%);
}
.member-profile .member-profile-kpis .summary-item > * { position: relative; z-index: 1; }
.member-profile .member-profile-kpis .summary-label,
.member-profile .member-profile-kpis .summary-value,
.member-profile .member-profile-kpis .summary-hint { color: #F7F1E3; }
.member-profile .member-profile-kpis .summary-label { letter-spacing: .05em; opacity: .86; }
.member-profile .member-profile-kpis .summary-value { margin-top: 3px; font-size: 15px; line-height: 18px; }
.member-profile .member-profile-kpis .summary-hint { opacity: .78; }
.member-profile .member-profile-kpis .tone-accent {
    background: linear-gradient(180deg, #1C7A5A 0%, #0F5C44 48%, #08382A 100%);
}
.member-profile .member-profile-kpis .tone-info {
    background: linear-gradient(180deg, #2B5EA8 0%, #173F7A 48%, #0C274C 100%);
}
.member-profile .member-profile-kpis .tone-navy {
    background: linear-gradient(180deg, #3A5B8C 0%, #1A3A68 48%, #0B1C31 100%);
}
.member-profile .member-profile-kpis .tone-success {
    background: linear-gradient(180deg, #1C7A5A 0%, #0F5C44 48%, #08382A 100%);
}
.member-profile .member-profile-kpis .tone-warning {
    background: linear-gradient(180deg, #C4841A 0%, #8E5A0C 48%, #4E3208 100%);
}
.member-profile .member-profile-kpis .tone-danger,
.member-profile .member-profile-kpis .is-danger {
    background: linear-gradient(180deg, #B33A32 0%, #7A1F1C 48%, #3E1010 100%);
}
.member-profile .photo-upload-compact { gap: 6px; }
.member-profile .photo-upload-compact .btn { width: 100%; margin-top: 2px; }

.member-profile .member-360-tabs {
    gap: 6px;
    margin: 0 0 12px;
    padding: 6px;
    border: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface-subtle);
    box-shadow: none;
}
.member-profile .member-360-tabs .tab {
    border-radius: 8px;
    padding: 8px 14px;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text-secondary);
    font-weight: var(--fw-medium);
    box-shadow: none;
    line-height: 1.2;
}
.member-profile .member-360-tabs .tab:hover {
    color: var(--navy);
    background: #f3f6fa;
    border-color: var(--border-strong);
}
.member-profile .member-360-tabs .tab.is-active {
    color: var(--navy);
    background: #e8eef5;
    border-color: #c5d0dc;
    font-weight: var(--fw-semibold);
    box-shadow: none;
}
.member-profile .member-360-tabs .tab.is-active:hover {
    color: var(--navy);
    background: #e8eef5;
}
.member-profile .panel {
    position: relative;
    overflow: hidden;
    padding: 12px 14px;
    margin-bottom: 0;
    border-radius: 12px;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.88),
        0 8px 18px rgba(15, 39, 68, 0.05);
}
.member-profile .panel::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 38%;
    pointer-events: none;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.55), transparent);
}
.member-profile .panel > * { position: relative; z-index: 1; }
.member-profile .panel-head { margin-bottom: 8px; }
.member-profile .dossier-overview { gap: 10px; }
.member-profile .dossier-main,
.member-profile .dossier-side { gap: 10px; }
.member-profile .detail-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
}
.member-profile .detail-grid dt { font-size: 10px; letter-spacing: .04em; text-transform: uppercase; }
.member-profile .detail-grid dd { font-weight: var(--fw-semibold); font-size: 12.5px; line-height: 16px; }
.member-profile .side-card {
    padding: 11px 12px;
}
.member-profile .side-card .form-section-title {
    color: var(--navy);
    letter-spacing: .07em;
    margin-bottom: 6px;
}
.member-profile .side-actions { margin-top: 8px; }
.member-profile .side-actions .btn {
    background: linear-gradient(180deg, #fff, #F4F7FB);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}
.member-profile .side-card > .btn { margin-top: 6px; }
.member-profile .meta-list { margin-top: 0; }
.member-profile .timeline-compact { gap: 6px; }
.member-profile .timeline li {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    border: 1px solid rgba(15, 39, 68, 0.08);
    border-left: 0;
    border-radius: 9px;
    padding: 7px 10px 7px 13px;
    background: linear-gradient(180deg, #F6F9FC 0%, #E8EEF6 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
}
.member-profile .timeline li::after {
    content: "";
    position: absolute;
    left: 0;
    top: 6px;
    bottom: 6px;
    width: 3px;
    border-radius: 99px;
    background: linear-gradient(180deg, #4A6FA0, #17355A);
}
.member-profile .timeline li:nth-child(3n+2) {
    background: linear-gradient(180deg, #F3FAF8 0%, #DCEFEA 100%);
}
.member-profile .timeline li:nth-child(3n+2)::after { background: linear-gradient(180deg, #2A9B8F, #0F5C44); }
.member-profile .timeline li:nth-child(3n+3) {
    background: linear-gradient(180deg, #FBF8F1 0%, #F0E6D2 100%);
}
.member-profile .timeline li:nth-child(3n+3)::after { background: linear-gradient(180deg, #D4B46A, #8A6A24); }
.member-profile .timeline li strong { display: block; font-size: 12.5px; color: var(--navy); }
.member-profile .timeline li p { margin: 2px 0 0; font-size: 12px; line-height: 16px; }

.summary-strip {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 12px;
}
.summary-strip-secondary { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.summary-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    box-shadow: var(--shadow);
}
.summary-item.is-danger { border-color: #f0c7c3; }
.summary-label {
    display: block;
    font-size: 10.5px;
    line-height: 14px;
    font-weight: var(--fw-semibold);
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--text-muted);
}
.summary-value {
    display: block;
    margin-top: 4px;
    font-size: 15px;
    line-height: 20px;
    font-weight: var(--fw-bold);
    color: var(--text);
}
.summary-hint {
    display: block;
    margin-top: 2px;
    font-size: 11px;
    line-height: 14px;
    color: var(--text-muted);
}

.member-360-tabs .tab-finance { font-weight: var(--fw-semibold); }
.dossier-overview {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(240px, .85fr);
    gap: 12px;
    align-items: start;
}
.dossier-main, .dossier-side { display: grid; gap: 12px; min-width: 0; }
.side-card .form-section-title { margin-bottom: 8px; }
.side-note { margin-top: 8px; font-size: 12px; line-height: 16px; }
.side-actions { display: grid; gap: 6px; }
.side-actions .btn { justify-content: flex-start; width: 100%; }

.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}
.detail-grid > div { display: grid; gap: 2px; align-content: start; }
.detail-grid dt { color: var(--text-muted); font-size: 10px; font-weight: var(--fw-semibold); letter-spacing: .04em; text-transform: uppercase; }
.detail-grid dd { font-size: 12.5px; line-height: 16px; font-weight: var(--fw-semibold); color: var(--navy); overflow-wrap: anywhere; }
.detail-span { grid-column: 1 / -1; }

.form-section { margin-bottom: 12px; }
.form-section-title {
    margin: 0 0 4px;
    font-size: 11px;
    line-height: 14px;
    font-weight: var(--fw-semibold);
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--text-muted);
}
.form-section-hint {
    margin: 0 0 10px;
    font-size: 12px;
    color: var(--text-muted);
}
.form-section-grid { margin-top: 4px; }
.form-inline-row {
    display: flex;
    gap: 10px;
    align-items: end;
    flex-wrap: wrap;
}
.form-inline-row .field { flex: 1 1 240px; min-width: 0; }
.timeline-compact { gap: 10px; }
.audit-action {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 11.5px;
    background: var(--surface-subtle);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 1px 6px;
}
.account-balance {
    font-size: 18px; font-weight: var(--fw-bold);
    font-variant-numeric: tabular-nums; margin: 6px 0;
    letter-spacing: -0.01em;
}
.member-kpi-strip { margin-bottom: 10px; gap: 10px; }
.member-kpi-strip .kpi-card { padding: 10px 12px 9px; }
.member-table-wrap { overflow-x: auto; max-width: 100%; }

.info-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.meta-list { display: grid; gap: 6px; margin-top: 8px; }
.meta-list > div { display: grid; gap: 2px; align-content: start; }
.meta-list dt { color: var(--text-muted); font-size: 10px; font-weight: var(--fw-semibold); letter-spacing: .04em; text-transform: uppercase; }
.meta-list dd { font-size: 12.5px; line-height: 16px; font-weight: var(--fw-semibold); color: var(--navy); overflow-wrap: anywhere; }

/* Compact luxury field cells — read-only + form, app-wide */
.detail-grid > div,
.meta-list > div,
.field,
.receipt-grid > div {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    min-width: 0;
    padding: 7px 10px 7px 13px;
    border-radius: 9px;
    border: 1px solid rgba(15, 39, 68, 0.08);
    background: linear-gradient(180deg, #F6F9FC 0%, #E8EEF6 100%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.82),
        0 1px 2px rgba(15, 39, 68, 0.04);
}
.detail-grid > div::before,
.meta-list > div::before,
.field::before,
.receipt-grid > div::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background: linear-gradient(165deg, rgba(255, 255, 255, 0.55) 0%, rgba(255, 255, 255, 0.08) 40%, transparent 68%);
}
.detail-grid > div::after,
.meta-list > div::after,
.field::after,
.receipt-grid > div::after {
    content: "";
    position: absolute;
    left: 0;
    top: 6px;
    bottom: 6px;
    width: 3px;
    border-radius: 99px;
    z-index: 1;
    pointer-events: none;
    background: linear-gradient(180deg, #4A6FA0, #17355A);
}
.detail-grid > div > *,
.meta-list > div > *,
.field > *,
.receipt-grid > div > * { position: relative; z-index: 1; }

.detail-grid > div:nth-child(3n+2),
.meta-list > div:nth-child(3n+2),
.field:nth-of-type(3n+2),
.receipt-grid > div:nth-child(3n+2) {
    background: linear-gradient(180deg, #F3FAF8 0%, #DCEFEA 100%);
    border-color: rgba(15, 118, 110, 0.14);
}
.detail-grid > div:nth-child(3n+2)::after,
.meta-list > div:nth-child(3n+2)::after,
.field:nth-of-type(3n+2)::after,
.receipt-grid > div:nth-child(3n+2)::after {
    background: linear-gradient(180deg, #2A9B8F, #0F5C44);
}

.detail-grid > div:nth-child(3n+3),
.meta-list > div:nth-child(3n+3),
.field:nth-of-type(3n+3),
.receipt-grid > div:nth-child(3n+3) {
    background: linear-gradient(180deg, #FBF8F1 0%, #F0E6D2 100%);
    border-color: rgba(148, 113, 48, 0.16);
}
.detail-grid > div:nth-child(3n+3)::after,
.meta-list > div:nth-child(3n+3)::after,
.field:nth-of-type(3n+3)::after,
.receipt-grid > div:nth-child(3n+3)::after {
    background: linear-gradient(180deg, #D4B46A, #8A6A24);
}

.field input,
.field select,
.field textarea {
    background: rgba(255, 255, 255, 0.86);
    border-color: rgba(15, 39, 68, 0.12);
}
.timeline { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.timeline li { border-left: 2px solid var(--border); padding: 0 0 6px 14px; }
.inline-form { display: inline; }
.heir-row { margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.checkbox-field { display: flex; align-items: center; gap: 8px; }
.checkbox-field input { width: auto; }
.account-card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 12px; }
.account-card, .success-panel, .confirm-summary {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px;
}
.success-panel { margin-bottom: 12px; }
.print-body { background: #fff; padding: 28px; }
.receipt-sheet {
    max-width: 720px; margin: 0 auto; background: #fff;
    border: 1px solid var(--border); border-radius: var(--radius); padding: 28px;
}
.receipt-head { display: flex; justify-content: space-between; gap: 14px; align-items: flex-start; margin-bottom: 20px; }
.brand-mark-text { letter-spacing: .16em; font-weight: var(--fw-bold); color: var(--navy); font-size: 13px; }
.receipt-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.receipt-grid > div { display: grid; gap: 2px; }
.receipt-emphasis { font-size: 1.15rem; font-weight: var(--fw-bold); color: var(--navy); font-variant-numeric: tabular-nums; }
.type-pill {
    display: inline-block; padding: 2px 8px; border-radius: var(--radius-pill);
    font-size: 11px; font-weight: var(--fw-semibold);
    background: #eef2f7; color: var(--navy); white-space: nowrap;
}
.type-pill.type-loan_disbursement { background: #e8f5ef; color: #0f6b4c; }
.type-pill.type-loan { background: #eef2f7; color: var(--navy); }
.decision-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.callout-warn { border-left: 3px solid #c47b1a; }

.origination-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(280px, .9fr);
    gap: 12px; align-items: start;
}
.member-snapshot {
    display: flex; gap: 12px; align-items: flex-start;
    background: var(--surface-subtle); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 12px 14px; margin-bottom: 12px;
}
.member-snapshot-body { flex: 1; min-width: 0; }
.member-snapshot h3 { margin: 2px 0 6px; }
.snapshot-meta { grid-template-columns: 1fr 1fr; margin-top: 10px; }
.sim-card { position: sticky; top: 12px; }
.sim-list div { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.sim-list dt { color: var(--text-muted); }
.sim-emphasis { font-weight: var(--fw-bold); font-size: 16px; font-variant-numeric: tabular-nums; }
.sim-note { margin-top: 12px; font-size: 12px; }
.callout {
    border-radius: var(--radius); padding: 12px 14px; margin-bottom: 12px;
    border: 1px solid var(--border);
}
.callout-warn { background: var(--warning-bg); border-color: #f0d9a8; }
.callout-info { background: #eef5fb; border-color: #c5d8ea; }
.profile-edit-banner p { margin: 4px 0 0; color: var(--text-secondary); }
.member-form-embedded { margin-top: 4px; }
.callout-warn ul { margin: 6px 0 0; padding-left: 18px; }
.origination-actions { flex-wrap: wrap; }
.origination-step-label { width: 100%; margin: 0; }

.score-meter, .dti-meter {
    height: 8px; background: var(--border); border-radius: var(--radius-pill);
    overflow: hidden; margin: 10px 0;
}
.score-meter-bar, .dti-meter-bar { height: 100%; background: var(--navy); border-radius: var(--radius-pill); }
.dti-meter-bar { background: var(--accent); }
.score-components { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.score-component {
    border: 1px solid var(--border); border-radius: var(--radius);
    padding: 10px 12px; background: var(--surface-subtle);
}
.score-component header { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.mini-meter { height: 5px; background: #e8edf3; border-radius: var(--radius-pill); overflow: hidden; margin-bottom: 6px; }
.mini-meter span { display: block; height: 100%; background: var(--accent); }
.assessment-form .fieldset {
    border: 1px solid var(--border); border-radius: var(--radius);
    padding: 12px 14px; margin: 0 0 12px;
}
.assessment-form legend { padding: 0 4px; font-weight: var(--fw-semibold); font-size: var(--fs-secondary); }
.repeat-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 10px; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.mini-card {
    border: 1px solid var(--border); border-radius: var(--radius);
    padding: 12px; background: var(--surface-subtle);
}
.action-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.action-list li {
    display: flex; gap: 12px; align-items: center; justify-content: space-between;
    border: 1px solid var(--border); border-radius: var(--radius);
    padding: 10px 12px; background: var(--surface);
}
.checkbox-field label { display: flex; gap: 8px; align-items: center; margin-top: 18px; }

/* ?? UI-P2 Executive Dashboard ?? */
.dash-main-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(300px, 1fr);
    gap: 12px;
    margin-bottom: 12px;
    align-items: start;
}
.dash-main-col, .dash-side-col { display: grid; gap: 12px; min-width: 0; }
.dash-panel { margin-bottom: 0; }
.exec-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}
.exec-metric {
    background: var(--surface-subtle);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    min-width: 0;
    border-left: 3px solid var(--border-strong);
}
.exec-metric.tone-primary {
    background: #F3F6FA;
    border-color: #D3DCE8;
    border-left-color: var(--navy-700);
}
.exec-metric.tone-navy {
    background: #F2F5F9;
    border-color: #D0DBE8;
    border-left-color: var(--navy);
}
.exec-metric.tone-warning {
    background: #FFF8EE;
    border-color: #F0D7B0;
    border-left-color: var(--warning);
}
.exec-metric.tone-accent {
    background: #F2F9F7;
    border-color: #C5E4DE;
    border-left-color: var(--accent);
}
.exec-metric-label {
    display: block;
    font-size: 11px;
    line-height: 14px;
    font-weight: var(--fw-semibold);
    color: var(--text-muted);
    letter-spacing: .02em;
}
.exec-metric-value {
    display: block;
    margin-top: 4px;
    font-size: 18px;
    line-height: 24px;
    font-weight: var(--fw-bold);
    color: var(--text);
}
.exec-metric-hint {
    display: block;
    margin-top: 2px;
    font-size: 11px;
    color: var(--text-muted);
}
.exposure-block { display: grid; gap: 10px; }
.exposure-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: baseline;
    flex-wrap: wrap;
    font-size: 12px;
    font-weight: var(--fw-semibold);
    color: var(--text-secondary);
}
.exposure-note { font-weight: var(--fw-regular); color: var(--text-muted); }
.exposure-row { display: grid; gap: 6px; }
.exposure-meta {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: baseline;
    font-size: 12px;
    color: var(--text-muted);
    min-width: 0;
}
.exposure-meta span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.exposure-meta strong {
    flex: 0 0 auto;
    white-space: nowrap;
    letter-spacing: -0.02em;
}
.exposure-meta.secondary { margin-top: 2px; }
.exposure-track, .portfolio-track {
    height: 6px;
    background: #E8EDF3;
    border-radius: var(--radius-pill);
    overflow: hidden;
}
.exposure-fill, .portfolio-fill {
    display: block;
    height: 100%;
    border-radius: var(--radius-pill);
    background: var(--navy);
}
.exposure-fill.tone-accent { background: var(--accent); }
.exposure-fill.tone-navy { background: var(--navy); }
.portfolio-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.portfolio-meta {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 12.5px;
    margin-bottom: 4px;
}
.portfolio-meta span { color: var(--text-secondary); }
.action-list-dense { gap: 6px; }
.action-list-dense .action-item {
    align-items: flex-start;
    padding: 8px 10px;
    border-left: 3px solid var(--border-strong);
    gap: 10px;
}
.action-item.tone-danger { border-left-color: var(--danger); }
.action-item.tone-warning { border-left-color: var(--warning); }
.action-item.tone-info { border-left-color: var(--info); }
.action-item.tone-accent { border-left-color: var(--accent); }
.action-item.tone-muted { border-left-color: var(--border-strong); }
.action-item-main { min-width: 0; flex: 1; }
.action-item-top {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: baseline;
}
.action-item-top strong { font-size: 12.5px; line-height: 18px; }
.action-metric {
    font-size: 12px;
    font-weight: var(--fw-bold);
    color: var(--text);
    white-space: nowrap;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
}
.action-text {
    margin-top: 2px;
    font-size: 12px;
    line-height: 16px;
    color: var(--text-secondary);
}
.action-why {
    margin-top: 2px;
    font-size: 11px;
    line-height: 15px;
    color: var(--text-muted);
}
.action-center .empty-state { padding: 20px 12px; }
.activity-table td { font-size: 12.5px; }

/* ?? UI-P4 ? Savings & credit operations ?? */
.finance-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 12px;
}
.finance-summary-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    box-shadow: var(--shadow);
}
.finance-summary-item .summary-label { display: block; }
.finance-summary-item .summary-value {
    display: block;
    margin-top: 4px;
    font-size: 15px;
    line-height: 20px;
    font-weight: var(--fw-bold);
    font-variant-numeric: tabular-nums;
}
.finance-summary-item.is-emphasis {
    border-color: #c5d4e0;
    background: #f7fafc;
}
.finance-summary-item.is-emphasis .summary-value { color: var(--navy); }

.workstation-grid {
    display: grid;
    grid-template-columns: minmax(260px, .9fr) minmax(0, 1.35fr);
    gap: 12px;
    align-items: start;
}
.workstation-side {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 14px;
    box-shadow: var(--shadow);
}
.workstation-side .account-balance {
    font-size: 20px;
    margin: 8px 0 4px;
    color: var(--navy);
}
.workstation-product {
    margin: 4px 0 0;
    font-size: 16px;
    line-height: 22px;
}
.workstation-balance-label { margin-top: 14px; }
.workstation-meta { margin-top: 14px; }

.transaction-ledger .data-table td,
.transaction-ledger .data-table th { font-size: 12.5px; }
.transaction-ledger .ref-mono,
.ledger-ref {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12px;
    letter-spacing: .01em;
    color: var(--text);
}
.ledger-amount { text-align: right; font-variant-numeric: tabular-nums; font-weight: var(--fw-semibold); }
.ledger-amount.is-deposit { color: var(--success); }
.ledger-amount.is-withdrawal { color: var(--text); }
.ledger-amount.is-reversal { color: var(--warning); }
.trx-badge {
    display: inline-block;
    padding: 1px 7px;
    border-radius: var(--radius-pill);
    font-size: 11px;
    font-weight: var(--fw-semibold);
    border: 1px solid var(--border);
    background: var(--surface-subtle);
    color: var(--text-secondary);
    white-space: nowrap;
}
.trx-badge.is-deposit { color: #0f6b4c; background: #eef7f2; border-color: #cfe6d9; }
.trx-badge.is-withdrawal { color: var(--navy); background: #eef2f7; border-color: #d5dde8; }
.trx-badge.is-reversal { color: #8a5a12; background: #faf4e8; border-color: #ead9b4; }

.product-cell { display: grid; gap: 1px; }
.product-cell strong { font-size: 13px; }
.product-cell .muted { font-size: 11.5px; }
.allow-chip {
    display: inline-block;
    min-width: 2.2em;
    text-align: center;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: var(--fw-semibold);
    background: var(--surface-subtle);
    color: var(--text-muted);
}
.allow-chip.is-yes { background: #eef7f2; color: #0f6b4c; }
.allow-chip.is-no { background: #f4f5f7; color: var(--text-muted); }
.row-inactive { opacity: .72; }
.row-inactive td { color: var(--text-secondary); }

.credit-dossier .dossier-header { margin-bottom: 10px; }
.credit-pipeline .data-table td { vertical-align: middle; }
.workflow-status { display: inline-flex; align-items: center; gap: 6px; }

.calculation-breakdown {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 14px;
    box-shadow: var(--shadow);
}
.calculation-breakdown h2 {
    margin: 0 0 10px;
    font-size: 13px;
    font-weight: var(--fw-semibold);
    color: var(--navy);
}
.calc-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: baseline;
    padding: 5px 0;
    font-size: 13px;
    border-bottom: 1px solid var(--border-subtle, #eef1f5);
}
.calc-row:last-child { border-bottom: 0; }
.calc-row.is-sub { color: var(--text-secondary); padding-left: 8px; }
.calc-row.is-total {
    margin-top: 4px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
    border-bottom: 0;
    font-weight: var(--fw-bold);
}
.calc-row.is-total .calc-value {
    font-size: 16px;
    color: var(--navy);
    font-variant-numeric: tabular-nums;
}
.calc-label { color: var(--text-muted); }
.calc-value { font-variant-numeric: tabular-nums; font-weight: var(--fw-semibold); }
.calc-intro { margin-bottom: 10px; }

.risk-summary {
    display: grid;
    grid-template-columns: minmax(160px, .7fr) minmax(0, 1.3fr);
    gap: 12px;
    margin-bottom: 12px;
    align-items: stretch;
}
.risk-score-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px;
    box-shadow: var(--shadow);
    text-align: center;
}
.risk-score-value {
    font-size: 32px;
    line-height: 1;
    font-weight: var(--fw-bold);
    color: var(--navy);
    font-variant-numeric: tabular-nums;
}
.risk-score-card .muted { margin-top: 6px; font-size: 12px; }
.risk-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}
.confirm-summary .meta-list,
.confirm-summary.calculation-breakdown { max-width: 520px; }

.approval-queue tr.is-awaiting-me {
    background: rgba(15, 118, 110, 0.04);
}
.approval-queue tr.is-awaiting-me td:first-child {
    box-shadow: inset 3px 0 0 var(--accent);
}
.decision-panel {
    border-color: #c5d4e0;
}
.decision-panel .panel-head h2 { color: var(--navy); }
.decision-panel .btn-danger { min-width: 110px; }
.decision-panel .btn-primary { min-width: 110px; }
.approval-timeline.timeline li strong { font-size: 12.5px; }

.schedule-summary { margin-bottom: 12px; }
.amortization-table th.money-cell,
.amortization-table td.money-cell { white-space: nowrap; }
.amortization-table tfoot td {
    background: var(--surface-subtle);
    font-weight: var(--fw-semibold);
}

.sim-highlights {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 12px;
}
.sim-highlight {
    background: var(--surface-subtle);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 8px 10px;
}
.sim-highlight .summary-label { display: block; }
.sim-highlight .summary-value {
    display: block;
    margin-top: 2px;
    font-size: 14px;
    font-weight: var(--fw-bold);
    font-variant-numeric: tabular-nums;
}
.sim-highlight.is-primary .summary-value { color: var(--navy); font-size: 16px; }

/* Teller workstation + receipts */
.teller-workstation {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(280px, .85fr);
    gap: 12px;
    align-items: start;
}
.teller-primary, .teller-sidebar { display: grid; gap: 12px; min-width: 0; }
.teller-actions-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.teller-txn-block { display: grid; gap: 8px; min-width: 0; }
.teller-seg {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(15, 39, 68, 0.08);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72), 0 8px 18px rgba(15, 39, 68, 0.05);
}
.teller-seg::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 5px;
    pointer-events: none;
}
.teller-seg.is-navy { background: linear-gradient(180deg, #F6F9FC, #E8EEF6); }
.teller-seg.is-navy::before { background: linear-gradient(180deg, #4A6FA0, #17355A); }
.teller-seg.is-teal { background: linear-gradient(180deg, #F3FAF8, #DCEFEA); }
.teller-seg.is-teal::before { background: linear-gradient(180deg, #2A9B8F, #0F5C44); }
.teller-seg.is-green { background: linear-gradient(180deg, #F4FBF6, #DCEFDF); }
.teller-seg.is-green::before { background: linear-gradient(180deg, #4CAF7A, #0F7B4A); }
.teller-seg.is-gold { background: linear-gradient(180deg, #FBF8F1, #F0E6D2); }
.teller-seg.is-gold::before { background: linear-gradient(180deg, #D4B46A, #8A6A24); }
.teller-seg.is-ivory { background: linear-gradient(180deg, #FBF8F1, #F4EFE4); }
.teller-seg.is-ivory::before { background: linear-gradient(180deg, #C4A35A, #8A6A24); }
.teller-seg.is-warn { background: linear-gradient(180deg, #FFF8EE, #F6E3C4); }
.teller-seg.is-warn::before { background: linear-gradient(180deg, #E0A04A, #8E5A0C); }
.teller-seg-kicker {
    margin: 0 0 4px;
    font-size: 10px;
    line-height: 14px;
    font-weight: var(--fw-semibold);
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--navy);
}
.teller-flow {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin: 0 0 12px;
    padding: 0;
}
.teller-flow li {
    display: flex;
    gap: 8px;
    align-items: center;
    min-width: 0;
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid rgba(15, 39, 68, 0.08);
    background: linear-gradient(180deg, #F6F9FC, #E8EEF6);
}
.teller-flow .teller-flow-num {
    flex: 0 0 24px;
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 12px;
    font-weight: var(--fw-bold);
    color: #F7F1E3;
    background: linear-gradient(180deg, #3A5B8C, #17355A);
}
.teller-flow-copy { display: grid; gap: 1px; min-width: 0; }
.teller-flow-copy strong { font-size: 12.5px; color: var(--navy); }
.teller-flow-copy small { color: var(--text-muted); font-size: 11px; line-height: 14px; }
.teller-flow li.is-active {
    background: linear-gradient(180deg, #F3FAF8, #DCEFEA);
    border-color: rgba(15, 118, 110, 0.18);
}
.teller-flow li.is-active .teller-flow-num { background: linear-gradient(180deg, #2A9B8F, #0F5C44); }
.teller-flow li.is-done {
    background: linear-gradient(180deg, #F4FBF6, #DCEFDF);
    border-color: rgba(15, 123, 74, 0.16);
}
.teller-flow li.is-done .teller-flow-num { background: linear-gradient(180deg, #4CAF7A, #0F7B4A); }
.teller-action-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.teller-action-item {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
    padding: 8px 10px;
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(15, 39, 68, 0.08);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}
.teller-action-item > div:first-child { display: grid; gap: 1px; min-width: 0; }
.teller-action-item .financial-value { font-weight: var(--fw-bold); color: var(--navy); }
.teller-member-facts { margin-top: 10px; }
.teller-member-facts .is-overdue dd { color: var(--danger); }
.cash-session-bar {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    border-radius: var(--radius);
    padding: 12px 14px 12px 16px;
    margin-bottom: 12px;
}
.cash-session-identity { display: grid; gap: 2px; min-width: 160px; }
.cash-session-metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 14px 20px;
    justify-content: flex-end;
}
.cash-session-metrics > div { display: grid; gap: 2px; }
.cash-session-empty {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
}
.cash-session-empty p { margin: 0; color: var(--text-secondary); font-size: 13px; }
.teller-member-head {
    margin: 0 0 4px !important;
    padding: 0 !important;
    border: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
}
.teller-member-strip { margin-top: 4px; margin-bottom: 0; }
.cash-reconciliation .calculation-breakdown { margin-bottom: 12px; box-shadow: none; }

.payment-workstation {
    display: grid;
    grid-template-columns: minmax(260px, .85fr) minmax(0, 1.5fr);
    gap: 12px;
    align-items: start;
}
.payment-side, .payment-main { display: grid; gap: 12px; min-width: 0; }
.payment-allocation .calculation-breakdown { margin-bottom: 12px; }

.receipt-document { max-width: 820px; margin: 0 auto; }
.screen-actions {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}
.receipt-header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
    margin-bottom: 18px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.receipt-header h1 {
    margin: 4px 0 0;
    font-size: 18px;
    line-height: 24px;
    color: var(--navy);
}
.receipt-total-block {
    margin: 16px 0;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-subtle);
}
.receipt-total {
    margin: 4px 0 0;
    font-size: 22px;
    line-height: 28px;
    font-weight: var(--fw-bold);
    font-variant-numeric: tabular-nums;
    color: var(--navy);
}
.receipt-signatures {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-top: 28px;
}
.receipt-signatures p { margin: 0; font-size: 12px; color: var(--text-muted); }
.sign-line {
    margin-top: 36px !important;
    border-top: 1px solid #222;
    padding-top: 6px;
    min-height: 1.2em;
    color: var(--text) !important;
    font-size: 13px !important;
}
.receipt-footnote {
    margin-top: 16px;
    font-size: 11px;
    color: var(--text-muted);
}
.receipt-table { margin-top: 16px; }
.receipt-calc { box-shadow: none; margin: 12px 0; }
.receipt-print .sidebar,
.receipt-print .topbar,
.receipt-print .app-shell > aside { display: none !important; }

@media print {
    html { overflow-x: visible; }
    .no-print { display: none !important; }
    .screen-actions { display: none !important; }
    .print-body, .receipt-print {
        padding: 12mm !important;
        background: #fff !important;
        color: #000 !important;
    }
    .receipt-sheet, .receipt-document {
        max-width: none;
        border: none !important;
        box-shadow: none !important;
        border-radius: 0 !important;
        background: #fff !important;
    }
    .receipt-header { border-bottom-color: #000 !important; }
    .receipt-header h1,
    .brand-mark-text,
    .receipt-total { color: #000 !important; }
    .receipt-total-block {
        background: #fff !important;
        border-color: #000 !important;
    }
    .sign-line { border-top-color: #000 !important; }
    .data-table th, .data-table td {
        color: #000 !important;
        border-color: #999 !important;
        background: #fff !important;
    }
    .badge, .status-badge { border: 1px solid #000 !important; background: #fff !important; color: #000 !important; }
    .detail-grid > div,
    .meta-list > div,
    .field,
    .receipt-grid > div,
    .member-profile .timeline li {
        background: #fff !important;
        border: 0 !important;
        box-shadow: none !important;
        padding: 2px 0 !important;
    }
    .detail-grid > div::before,
    .detail-grid > div::after,
    .meta-list > div::before,
    .meta-list > div::after,
    .field::before,
    .field::after,
    .receipt-grid > div::before,
    .receipt-grid > div::after,
    .member-profile .timeline li::after {
        display: none !important;
    }
}

@media (min-width: 1600px) {
    .content { max-width: 1920px; margin-inline: auto; }
    .member-form { max-width: 1120px; }
}

@media (max-width: 1366px) {
    .content { max-width: none; }
    .topbar-search { width: min(220px, 22vw); }
    .kpi-grid-exec { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .dash-main-grid { grid-template-columns: minmax(0, 1.35fr) minmax(280px, 1fr); }
    .summary-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .summary-strip-secondary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .form-grid-3 { grid-template-columns: 1fr 1fr; }
    .field-span-2 { grid-column: 1 / -1; }
    .region-cascade { grid-template-columns: 1fr 1fr; }
    .doc-summary { grid-template-columns: 1fr 1fr; }
    .finance-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .risk-metrics { grid-template-columns: 1fr 1fr; }
    .teller-workstation { grid-template-columns: minmax(0, 1.45fr) minmax(260px, .9fr); }
    .teller-actions-grid { grid-template-columns: 1fr; }
    .member-table .col-optional { display: none; }
}

@media (max-width: 1199px) {
    .kpi-grid-primary, .kpi-grid-secondary { grid-template-columns: 1fr 1fr; }
    .kpi-grid-exec { grid-template-columns: 1fr 1fr; }
    .kpi-exec .kpi-card { padding: 10px 9px 9px; }
    .chart-grid { grid-template-columns: 1fr; }
    .topbar-search { width: 180px; }
    .info-grid, .form-grid, .form-grid-3 { grid-template-columns: 1fr 1fr; }
    .field-span-2 { grid-column: 1 / -1; }
    .region-cascade { grid-template-columns: 1fr 1fr; }
    .doc-card { grid-template-columns: 64px minmax(0, 1fr); }
    .doc-card-side { grid-column: 2; justify-items: start; }
    .doc-thumb { width: 64px; height: 64px; }
    .doc-toolbar, .doc-actions, .doc-upload-inline, .doc-verify-row { justify-content: flex-start; }
    .account-card-grid { grid-template-columns: 1fr 1fr; }
    .origination-grid { grid-template-columns: 1fr; }
    .sim-card { position: static; }
    .dash-main-grid { grid-template-columns: 1fr; }
    .exec-metrics { grid-template-columns: 1fr 1fr; }
    .dossier-overview { grid-template-columns: 1fr; }
    .member-profile .detail-grid { grid-template-columns: 1fr 1fr; }
    .member-profile .member-hero-top { flex-wrap: wrap; }
    .summary-strip, .summary-strip-secondary { grid-template-columns: 1fr 1fr; }
    .workstation-grid { grid-template-columns: 1fr; }
    .finance-summary { grid-template-columns: 1fr 1fr; }
    .risk-summary { grid-template-columns: 1fr; }
    .risk-metrics { grid-template-columns: 1fr 1fr; }
    .teller-workstation, .payment-workstation { grid-template-columns: 1fr; }
    .teller-flow { grid-template-columns: 1fr; }
    .cash-session-bar { flex-direction: column; align-items: stretch; }
    .cash-session-metrics { justify-content: flex-start; }
}

@media (max-width: 1023px) {
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        min-height: 100vh;
        transform: translateX(-100%);
        transition: transform .2s ease;
        z-index: 40;
    }
    .app-shell.is-nav-open .sidebar { transform: none; }
    .app-shell.is-nav-open .overlay { display: block; }
    .user-meta, .topbar-search { display: none; }
    .kpi-exec .kpi-exec-board {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .kpi-exec .kpi-exec-board > .kpi-card { grid-column: auto; }
    .kpi-exec .kpi-amount { font-size: 16px; }
    .auth-form-wrap { padding: 24px 16px; }
    .auth-card { padding: 28px 20px; }
    .page-header { flex-wrap: wrap; }
    .panel-head { flex-wrap: wrap; }
    .screen-actions { flex-wrap: wrap; }
    .member-table, .amortization-table, .transaction-ledger .data-table, .approval-queue .data-table, .credit-pipeline .data-table, .activity-table {
        min-width: 720px;
    }
    .member-table {
        min-width: 640px;
        table-layout: auto;
    }
    .member-table .col-nik { display: none; }
}

@media (max-width: 900px) {
    .score-components, .decision-grid, .repeat-row { grid-template-columns: 1fr; }
}

@media (max-width: 767px) {
    .auth-brand-mobile {
        display: grid;
        justify-items: center;
        gap: 8px;
        width: min(520px, 100%);
        padding: 8px 8px 4px;
        text-align: center;
    }
    .auth-brand-mobile strong {
        letter-spacing: .12em;
        font-size: 18px;
        line-height: 24px;
        color: var(--navy);
    }
    .auth-brand-mobile p {
        margin: 0;
        color: var(--text-muted);
        font-size: 13px;
        line-height: 18px;
        overflow-wrap: anywhere;
    }
    .auth-foot { padding-inline: 12px; flex-direction: column; gap: 2px; }
    .auth-foot-sep { display: none; }
    .kpi-grid-primary, .kpi-grid-secondary, .kpi-grid-exec { grid-template-columns: 1fr; }
    .kpi-exec .kpi-exec-board {
        grid-template-columns: 1fr;
        width: 100%;
    }
    .kpi-exec .kpi-exec-board > .kpi-card { grid-column: auto; }
    .kpi-exec .kpi-amount { font-size: 18px; }
    .exec-metrics { grid-template-columns: 1fr; }
    .auth-shell { grid-template-columns: 1fr; }
    .auth-panel { display: none; }
    .content, .topbar { padding-left: 14px; padding-right: 14px; }
    .form-grid, .form-grid-3, .info-grid, .account-card-grid, .receipt-grid, .detail-grid { grid-template-columns: 1fr; }
    .field-span-2, .region-cascade .field-span { grid-column: 1 / -1; }
    .region-cascade, .doc-summary { grid-template-columns: 1fr; }
    .doc-card { grid-template-columns: 64px minmax(0, 1fr); }
    .doc-card-side { grid-column: 2; justify-items: stretch; }
    .doc-upload-inline input[type="file"] { max-width: 100%; }
    .member-hero, .dossier-header { flex-direction: column; }
    .member-profile .member-hero-top { flex-direction: column; align-items: stretch; }
    .member-profile .member-hero-actions { width: 100%; }
    .member-profile .detail-grid { grid-template-columns: 1fr; }
    .member-table-wrap { overflow-x: auto; }
    .member-table { min-width: 540px; }
    .member-table .col-address { display: none; }
    .page-header { flex-direction: column; align-items: stretch; }
    .filter-bar-wrap { flex-direction: column; align-items: stretch; }
    .filter-bar input, .filter-bar select { min-width: 0; width: 100%; flex: 1 1 auto; }
    .filter-bar .btn { width: 100%; }
    .action-item { flex-direction: column; align-items: stretch; }
    .summary-strip, .summary-strip-secondary { grid-template-columns: 1fr; }
    .dossier-overview { grid-template-columns: 1fr; }
    .finance-summary, .risk-metrics, .sim-highlights { grid-template-columns: 1fr; }
    .receipt-signatures { grid-template-columns: 1fr; }
    .receipt-header { flex-direction: column; }
    .form-actions { justify-content: stretch; }
    .form-actions .btn { flex: 1 1 auto; }
    .member-form .form-grid,
    .member-form .form-grid-3,
    .member-form .region-cascade {
        grid-template-columns: 1fr;
    }
    .member-form .field-span-2,
    .member-form .field-span {
        grid-column: 1 / -1;
    }
    .member-form input,
    .member-form select,
    .member-form textarea {
        width: 100%;
        max-width: 100%;
    }
    .pagination-shell { flex-direction: column; align-items: stretch; }
    .pagination-btns { width: 100%; }
    .pagination-btns .btn { flex: 1 1 auto; }
}

@media (max-width: 1366px) {
    .nasabah-list-table .col-job,
    .nasabah-list-table .col-optional { display: table-cell; }
}
@media (max-width: 1023px) {
    .nasabah-list-table,
    .nasabah-list-table.member-table {
        min-width: 1080px;
        table-layout: auto;
    }
    .nasabah-list-table .col-nik { display: table-cell; }
    .nasabah-list-table .col-category { display: table-cell; }
}
@media (max-width: 767px) {
    .member-kpi-strip.kpi-grid-primary { grid-template-columns: 1fr 1fr; }
    .page-header .page-actions .btn { width: auto; }
    .nasabah-list-wrap { overflow-x: auto; max-width: 100%; }
    .nasabah-list-table,
    .nasabah-list-table.member-table {
        min-width: 920px;
    }
    .nasabah-list-table .col-job { display: table-cell; }
    .nasabah-list-table .col-category { display: table-cell; }
}

@media print {
    html { overflow-x: visible; }
    .app-shell { overflow: visible; }
    .table-shell, .table-responsive { overflow: visible; }
    .member-table, .amortization-table, .transaction-ledger .data-table, .approval-queue .data-table, .credit-pipeline .data-table, .activity-table {
        min-width: 0;
    }
    .member-profile > .member-hero.dossier-header,
    .member-profile .member-profile-kpis .summary-item,
    .member-profile .member-360-tabs .tab.is-active {
        background: #fff !important;
        color: #000 !important;
        box-shadow: none !important;
        border-color: #999 !important;
    }
    .member-profile .dossier-title-row h1,
    .member-profile .member-hero .reference-number,
    .member-profile .hero-chip,
    .member-profile .member-profile-kpis .summary-label,
    .member-profile .member-profile-kpis .summary-value,
    .member-profile .member-profile-kpis .summary-hint {
        color: #000 !important;
    }
}
