/* Deal sheets extras (2026-10): balance pills, alerts, approvals, overview, PDF dialog, phone tables */
.ds-bal-pos,
.ds-bal-neg,
.ds-bal-zero {
    display: inline-block;
    border-radius: 999px;
    padding: 0.12rem 0.55rem;
    font-size: 0.82rem;
}
.ds-bal-pos {
    background: #ffedd5;
    color: #c2410c;
}
.ds-bal-neg {
    background: #fee2e2;
    color: #b91c1c;
}
.ds-bal-zero {
    background: #dcfce7;
    color: #166534;
    font-weight: 600;
}
.ds-tip {
    cursor: help;
}
.ds-q {
    font-size: 0.7rem;
    color: #94a3b8;
}
.ds-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
}
.ds-dot-green {
    background: #16a34a;
}
.ds-dot-amber {
    background: #f59e0b;
}
.ds-dot-red {
    background: #dc2626;
}
.ds-open-chip {
    border: 1px solid var(--ds-border, #e2e8f0);
    background: none;
    border-radius: 999px;
    padding: 0.2rem 0.7rem;
    font-size: 0.76rem;
    cursor: pointer;
    margin-bottom: 0.5rem;
    color: inherit;
}
.ds-open-chip.active {
    background: #6366f1;
    border-color: #6366f1;
    color: #fff;
}
.ds-sortable {
    cursor: pointer;
    user-select: none;
}
.ds-scroll {
    overflow-x: auto;
}
.ds-ov-table tbody tr {
    cursor: pointer;
}
.ds-alert {
    display: flex;
    gap: 0.6rem;
    align-items: flex-start;
    border-radius: 10px;
    padding: 0.55rem 0.8rem;
    margin-top: 0.6rem;
    font-size: 0.84rem;
}
.ds-alert-warn {
    background: #fef3c7;
    color: #92400e;
}
.ds-alert-danger {
    background: #fee2e2;
    color: #991b1b;
}
.ds-done-btn {
    border: 0;
    background: #16a34a;
    color: #fff;
    border-radius: 999px;
    padding: 0.1rem 0.6rem;
    font-size: 0.72rem;
    cursor: pointer;
    margin-left: 0.4rem;
}
.ds-hint {
    font-size: 0.74rem;
    color: #64748b;
    align-self: center;
}
.ds-exp-form .ds-hint {
    flex-basis: 100%;
}
.ds-personal {
    font-size: 0.8rem;
    display: inline-flex;
    gap: 0.35rem;
    align-items: center;
    white-space: nowrap;
}
.ds-nowrap {
    white-space: nowrap;
}
.ds-plus {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}
.ds-wf-sel {
    max-width: 220px;
}
.ds-approval {
    border-radius: 10px;
    padding: 0.6rem 0.85rem;
    margin-top: 0.6rem;
    font-size: 0.84rem;
    background: #eef2ff;
    color: #3730a3;
}
.ds-ap-locked {
    background: #dcfce7;
    color: #166534;
}
.ds-ap-changed,
.ds-ap-stale {
    background: #fef3c7;
    color: #92400e;
}
.ds-ap-head {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
}
.ds-ap-list {
    display: flex;
    gap: 0.5rem 1rem;
    flex-wrap: wrap;
    margin-top: 0.4rem;
}
.ds-ap-who.ok {
    font-weight: 600;
}
.ds-ap-hist {
    margin-top: 0.4rem;
    font-size: 0.78rem;
}
.ds-pdf-dlg {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100000;
}
.ds-pdf-box {
    background: var(--ds-bg-card, #fff);
    color: inherit;
    border-radius: 14px;
    padding: 1.25rem 1.5rem;
    width: min(92vw, 380px);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.ds-pdf-box h3 {
    margin: 0;
}
.ds-pdf-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

/* Wide tables on a phone: horizontal scroll, header row and first column stay in view */
@media (max-width: 768px) {
    .ds-scroll,
    #ds-sheet .ds-pane,
    #ds-sheet .unified-card-body > div[style*='overflow-x'] {
        max-height: 70vh;
        overflow: auto;
        -webkit-overflow-scrolling: touch;
    }
    .ds-table th {
        position: sticky;
        top: 0;
        z-index: 2;
        background: var(--ds-bg-card, #fff);
    }
    .ds-table td:first-child,
    .ds-table th:first-child {
        position: sticky;
        left: 0;
        z-index: 1;
        background: var(--ds-bg-card, #fff);
    }
    .ds-table th:first-child {
        z-index: 3;
    }
    .ds-table {
        min-width: 640px;
    }
    .ds-plus .ds-kpis {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}
