/* UnityReal - visual layer for Cashflow / Partner Balances (insights-pages.js) */
.ix {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.25rem;
}
.ix-loading {
    padding: 2rem;
    text-align: center;
    color: var(--text-muted, #64748b);
}
.ix-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 0.9rem;
}
.ix-kpi {
    display: flex;
    gap: 0.85rem;
    align-items: center;
    padding: 1rem 1.1rem;
    border-radius: 14px;
    background: var(--bg-card, #fff);
    border: 1px solid var(--border-light, #e2e8f0);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.ix-kpi-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    color: #fff;
    flex-shrink: 0;
    font-size: 1.05rem;
}
.ix-kpi-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted, #64748b);
}
.ix-kpi-value {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary, #0f172a);
    line-height: 1.25;
}
.ix-kpi-sub {
    font-size: 0.74rem;
    color: var(--text-muted, #64748b);
}
.ix-card {
    background: var(--bg-card, #fff);
    border: 1px solid var(--border-light, #e2e8f0);
    border-radius: 14px;
    padding: 1rem 1.1rem;
    min-width: 0;
}
.ix-card-title {
    font-weight: 600;
    font-size: 0.92rem;
    margin-bottom: 0.8rem;
    display: flex;
    gap: 0.5rem;
    align-items: center;
    color: var(--text-primary, #0f172a);
}
.ix-card-title i {
    color: var(--ds-primary, #6366f1);
}
.ix-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}
.ix-span2 {
    grid-column: span 2;
}
.ix-chart {
    position: relative;
    height: 260px;
}
.ix-chart-lg {
    height: 330px;
}
/* pipeline */
.ix-pipeline {
    display: flex;
    align-items: stretch;
    gap: 0.4rem;
    overflow-x: auto;
}
.ix-stage {
    flex: 1 1 0;
    min-width: 120px;
    border-radius: 12px;
    padding: 0.8rem;
    text-align: center;
    border: 1px solid var(--border-light, #e2e8f0);
    --c: #6366f1;
    background: color-mix(in srgb, var(--c) 9%, transparent);
}
.ix-stage.overdue {
    --c: #ef4444;
}
.ix-stage.soon {
    --c: #f59e0b;
}
.ix-stage.mid {
    --c: #06b6d4;
}
.ix-stage.later {
    --c: #6366f1;
}
.ix-stage.done {
    --c: #22c55e;
}
.ix-stage-icon {
    width: 34px;
    height: 34px;
    margin: 0 auto 0.35rem;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--c);
    color: #fff;
}
.ix-stage-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted, #64748b);
}
.ix-stage-value {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--c);
}
.ix-stage-sub {
    font-size: 0.72rem;
    color: var(--text-muted, #64748b);
}
.ix-arrow {
    align-self: center;
    color: var(--text-muted, #94a3b8);
    font-size: 0.8rem;
}
/* bars */
.ix-bars {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}
.ix-bar-row {
    display: grid;
    grid-template-columns: 8.5rem 1fr auto;
    gap: 0.5rem;
    align-items: center;
    font-size: 0.78rem;
}
.ix-bar-row span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ix-bar {
    height: 9px;
    border-radius: 999px;
    background: var(--border-light, #e2e8f0);
    overflow: hidden;
}
.ix-bar i {
    display: block;
    height: 100%;
    border-radius: 999px;
}
/* timeline */
.ix-timeline {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 0.75rem;
}
.ix-month {
    border: 1px solid var(--border-light, #e2e8f0);
    border-radius: 12px;
    padding: 0.6rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}
.ix-month-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 0.82rem;
    padding-bottom: 0.35rem;
    border-bottom: 1px dashed var(--border-light, #e2e8f0);
}
.ix-month-head span {
    font-weight: 700;
    color: var(--ds-primary, #6366f1);
}
.ix-due {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    column-gap: 0.4rem;
    padding: 0.35rem 0.45rem;
    border-radius: 8px;
    background: rgba(99, 102, 241, 0.06);
    cursor: pointer;
    font-size: 0.78rem;
}
.ix-due:hover {
    background: rgba(99, 102, 241, 0.14);
}
.ix-due small {
    grid-column: 1;
    color: var(--text-muted, #64748b);
    font-size: 0.7rem;
}
.ix-due b {
    grid-row: 1 / 3;
    grid-column: 2;
    align-self: center;
}
.ix-due.late {
    background: rgba(239, 68, 68, 0.1);
}
/* settlements */
.ix-settle {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
}
.ix-transfer {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 0.4rem;
    align-items: center;
}
.ix-person {
    --c: #6366f1;
    padding: 0.45rem 0.55rem;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 600;
    text-align: center;
    border: 1px solid color-mix(in srgb, var(--c) 45%, transparent);
    background: color-mix(in srgb, var(--c) 10%, transparent);
}
.ix-flow {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 0.75rem;
    color: #f59e0b;
}
.ix-flow i {
    font-size: 1.2rem;
}
.ix-note {
    font-size: 0.72rem;
    color: var(--text-muted, #64748b);
}
.ix-empty {
    color: #16a34a;
    font-weight: 600;
    text-align: center;
    padding: 1rem;
}
/* people */
.ix-people {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 0.75rem;
}
.ix-person-card {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    padding: 0.7rem;
    border-radius: 12px;
    border: 1px solid var(--border-light, #e2e8f0);
    cursor: pointer;
    transition:
        transform 0.15s,
        box-shadow 0.15s;
}
.ix-person-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
}
.ix-ring {
    width: 58px;
    height: 58px;
    flex-shrink: 0;
}
.ix-ring circle {
    fill: none;
    stroke-width: 7;
    stroke-linecap: round;
}
.ix-ring-bg {
    stroke: var(--border-light, #e2e8f0);
}
.ix-ring text {
    font-size: 13px;
    font-weight: 700;
    fill: var(--text-primary, #0f172a);
}
.ix-person-main {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
    flex: 1;
}
.ix-person-main b {
    font-size: 0.85rem;
}
.ix-person-main small {
    font-size: 0.72rem;
    color: var(--text-muted, #64748b);
}
.ix-bal {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted, #64748b);
}
.ix-bal.pos {
    color: #16a34a;
}
.ix-bal.neg {
    color: #dc2626;
}
.ix-person-actions {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}
@media (max-width: 1100px) {
    .ix-grid {
        grid-template-columns: 1fr;
    }
    .ix-span2 {
        grid-column: auto;
    }
}
@media (max-width: 560px) {
    .ix-chart-lg {
        height: 280px;
    }
    .ix-kpis {
        grid-template-columns: 1fr 1fr;
    }
    .ix-kpi {
        padding: 0.7rem;
        gap: 0.5rem;
    }
    .ix-kpi-icon {
        width: 34px;
        height: 34px;
    }
    .ix-kpi-value {
        font-size: 1rem;
    }
}

/* System parameters (system-settings.js) */
.sys-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
}
.sys-group {
    border: 1px solid var(--border-light, #e2e8f0);
    border-radius: 12px;
    padding: 0.75rem 0.9rem;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
}
.sys-group legend {
    font-weight: 600;
    font-size: 0.85rem;
    padding: 0 0.35rem;
}
.sys-group legend i {
    color: var(--ds-primary, #6366f1);
}
.sys-field {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
.sys-label {
    font-size: 0.82rem;
    font-weight: 600;
}
.sys-changed {
    font-size: 0.65rem;
    color: #f59e0b;
}
.sys-field small {
    font-size: 0.72rem;
    color: var(--text-muted, #64748b);
}
.sys-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 1rem;
}
.sys-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 0.4rem 1.5rem;
}
.sys-info div {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    font-size: 0.8rem;
    padding: 0.35rem 0;
    border-bottom: 1px dashed var(--border-light, #e2e8f0);
}
.sys-info span {
    color: var(--text-muted, #64748b);
}
.sys-info b {
    text-align: right;
    font-weight: 600;
}

/* Handovers page (handovers.js) */
.ho-legend {
    margin-left: auto;
    display: inline-flex;
    gap: 0.6rem;
    align-items: center;
    font-size: 0.72rem;
    font-weight: 400;
    color: var(--text-muted, #64748b);
}
.ho-legend .ho-dot {
    position: static;
    transform: none;
}
.ho-today-l {
    display: inline-block;
    width: 2px;
    height: 12px;
    background: #ef4444;
}
.ho-axis {
    position: relative;
    height: 1.2rem;
    margin: 0 7.5rem 0 13rem;
    font-size: 0.68rem;
    color: var(--text-muted, #64748b);
}
.ho-axis span {
    position: absolute;
    transform: translateX(-50%);
}
.ho-rows {
    display: flex;
    flex-direction: column;
}
.ho-row {
    display: grid;
    grid-template-columns: 12.5rem 1fr 7rem;
    gap: 0.5rem;
    align-items: center;
    padding: 0.45rem 0;
    border-top: 1px dashed var(--border-light, #e2e8f0);
    cursor: pointer;
}
.ho-row:hover,
.ho-row.focus {
    background: rgba(99, 102, 241, 0.06);
}
.ho-label {
    display: flex;
    flex-direction: column;
    min-width: 0;
    font-size: 0.8rem;
}
.ho-label small {
    color: var(--text-muted, #64748b);
    font-size: 0.7rem;
}
.ho-track {
    position: relative;
    height: 18px;
}
.ho-bar {
    position: absolute;
    top: 6px;
    height: 6px;
    border-radius: 999px;
    background: rgba(99, 102, 241, 0.45);
}
.ho-bar.late {
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.45), rgba(239, 68, 68, 0.7));
}
.ho-bar.done {
    background: rgba(34, 197, 94, 0.6);
}
.ho-dot {
    position: absolute;
    top: 3px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    transform: translateX(-50%);
    border: 2px solid var(--bg-card, #fff);
    display: inline-block;
}
.ho-dot.orig {
    background: #94a3b8;
}
.ho-dot.est {
    background: #6366f1;
}
.ho-dot.act {
    background: #22c55e;
}
.ho-today {
    position: absolute;
    top: -2px;
    bottom: -2px;
    width: 2px;
    background: #ef4444;
    opacity: 0.6;
}
.ho-when {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.15rem;
    font-size: 0.8rem;
}
.ho-badge {
    font-size: 0.66rem;
    font-weight: 600;
    padding: 1px 7px;
    border-radius: 999px;
    white-space: nowrap;
}
.ho-badge.ok {
    background: rgba(34, 197, 94, 0.15);
    color: #16a34a;
}
.ho-badge.late {
    background: rgba(239, 68, 68, 0.12);
    color: #dc2626;
}
.ho-badge.done {
    background: rgba(34, 197, 94, 0.15);
    color: #16a34a;
}
.ho-badge.unknown {
    background: rgba(100, 116, 139, 0.12);
    color: var(--text-muted, #64748b);
}
.ho-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 0.9rem;
}
.ho-card {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    scroll-margin: 80px;
}
.ho-card.focus {
    box-shadow: 0 0 0 2px var(--ds-primary, #6366f1);
}
.ho-card-head {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    align-items: flex-start;
}
.ho-card-head small {
    display: block;
    color: var(--text-muted, #64748b);
    font-size: 0.72rem;
}
.ho-facts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.45rem 0.9rem;
}
.ho-facts div {
    display: flex;
    flex-direction: column;
    font-size: 0.82rem;
}
.ho-facts span,
.ho-facts small {
    font-size: 0.68rem;
    color: var(--text-muted, #64748b);
}
.ho-hist,
.ho-src,
.ho-notes {
    font-size: 0.74rem;
    color: var(--text-muted, #64748b);
}
.ho-hist em {
    font-style: normal;
    color: var(--text-primary, #0f172a);
}
.ho-src.muted {
    font-style: italic;
}
.ho-actions {
    display: flex;
    gap: 0.4rem;
    margin-top: auto;
}
.ho-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
}
.ho-form label {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    font-size: 0.8rem;
    font-weight: 600;
}
.ho-form .wide {
    grid-column: 1 / -1;
}
.ho-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}
@media (max-width: 760px) {
    .ho-axis {
        display: none;
    }
    .ho-row {
        grid-template-columns: 1fr auto;
    }
    .ho-track {
        grid-column: 1 / -1;
        grid-row: 2;
    }
}
.ho-dot.real {
    background: #f97316;
}
.ho-real {
    color: #ea580c;
}
.ho-when small {
    font-size: 0.68rem;
    color: var(--text-muted, #64748b);
}
.ho-table td {
    vertical-align: top;
    font-size: 0.78rem;
}
.ho-table tbody tr {
    cursor: pointer;
}
.ho-method {
    max-width: 30rem;
    font-size: 0.72rem !important;
    color: var(--text-muted, #64748b);
    white-space: normal;
}
.ho-method-box {
    font-size: 0.74rem;
    line-height: 1.45;
    padding: 0.5rem 0.6rem;
    border-radius: 8px;
    background: rgba(249, 115, 22, 0.07);
    border-left: 3px solid #f97316;
}
.ho-facts.ho-facts3 {
    grid-template-columns: repeat(3, 1fr);
}
