/* Isolated Purchases Cash Book. Rollback: delete this file and revert index/app-shell links. */

.pcb-root {
    --pcb-blue: #337ab7;
    --pcb-navy: #001d6c;
    --pcb-border: #cbd5e1;
    --pcb-note: #15803d;
    display: flex;
    flex-direction: column;
    min-height: 70vh;
    background: #f8fafc;
    color: #0f172a;
}

.pcb-root .pcb-header {
    background: var(--pcb-blue);
    color: #fff;
    padding: 10px 14px;
}

.pcb-root .pcb-title {
    margin: 0;
    font-size: 17px;
    font-weight: 600;
    color: #fff;
}

.pcb-root .pcb-toolbar,
.pcb-root .pcb-menubar {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 8px 10px;
    background: #fff;
    border-bottom: 1px solid var(--pcb-border);
}

.pcb-root .pcb-menubar .dropdown-menu {
    font-size: 14px;
}

.pcb-root .pcb-toolbar .btn,
.pcb-root .pcb-menubar > .btn,
.pcb-root .pcb-menubar > .dropdown > .btn {
    min-height: 44px;
    min-width: 44px;
}

.pcb-root .pcb-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 12px;
    flex: 1 1 auto;
    min-width: 0;
}

.pcb-root .pcb-search {
    background: #fff;
    border: 1px solid var(--pcb-border);
    border-radius: 4px;
    padding: 12px;
}

.pcb-root .pcb-search-label {
    display: block;
    color: var(--pcb-navy);
    font-weight: 600;
    margin-bottom: 8px;
}

.pcb-root .pcb-field {
    margin-bottom: 10px;
}

.pcb-root .pcb-field label,
.pcb-root .pcb-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #475569;
    margin-bottom: 4px;
}

.pcb-root .inputSelect.im-entity-list-input,
.pcb-root select.im-entity-list-input {
    width: 100%;
    background: #fff;
    border: 1px solid var(--pcb-border);
    font-size: 16px;
    min-height: 44px;
    padding: 6px 8px;
}

.pcb-root .pcb-id-input {
    max-width: 16em;
}

.pcb-root .pcb-find {
    min-height: 44px;
    min-width: 88px;
}

.pcb-root .pcb-list {
    max-height: 220px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--pcb-border);
    border-radius: 4px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.pcb-root .pcb-list button {
    display: block;
    width: 100%;
    text-align: left;
    background: transparent;
    border: 0;
    border-bottom: 1px solid #e2e8f0;
    padding: 10px 12px;
    min-height: 44px;
    font-size: 14px;
}

.pcb-root .pcb-list button.is-active {
    background: #e0f2fe;
    font-weight: 600;
}

.pcb-root .pcb-main {
    background: #fff;
    border: 1px solid var(--pcb-border);
    border-radius: 4px;
    padding: 12px;
    min-width: 0;
}

.pcb-root .pcb-top-row {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 10px;
}

.pcb-root .pcb-flags {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: center;
}

.pcb-root .pcb-flags label {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    margin: 0;
    font-weight: 500;
}

.pcb-root .pcb-note {
    color: var(--pcb-note);
    font-weight: 600;
    margin: 0 0 10px 0;
    font-size: 14px;
}

.pcb-root .pcb-grid-wrap {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    min-height: 280px;
}

.pcb-root .pcb-grid {
    min-width: 640px;
    height: 320px;
}

.pcb-root .pcb-grid .ui-grid-cell-contents {
    font-size: 13px;
}

.pcb-root .pcb-grid .ui-grid-row.pcb-locked-row .ui-grid-cell {
    background: #f1f5f9;
}

.pcb-root .pcb-totals {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
    align-items: stretch;
}

.pcb-root .pcb-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.pcb-root .pcb-total-row label {
    margin: 0;
    font-weight: 600;
}

.pcb-root .pcb-total-row input {
    max-width: 11em;
    text-align: right;
    font-weight: 600;
}

.pcb-root .pcb-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
    justify-content: flex-end;
}

.pcb-root .pcb-actions .btn {
    min-height: 44px;
    min-width: 110px;
}

.pcb-root .pcb-save {
    background: #86efac;
    border-color: #4ade80;
    color: #14532d;
    font-weight: 700;
}

.pcb-root .pcb-save:disabled {
    opacity: 0.6;
}

.pcb-lookup-modal .modal-dialog {
    width: calc(100% - 16px);
    max-width: 520px;
    margin: 8px auto;
}

@media (min-width: 768px) {
    .pcb-root .pcb-body {
        flex-direction: row;
        align-items: stretch;
    }

    .pcb-root .pcb-search {
        flex: 0 0 240px;
        max-width: 260px;
    }

    .pcb-root .pcb-main {
        flex: 1 1 auto;
    }

    .pcb-root .pcb-top-row {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: space-between;
        align-items: flex-end;
    }

    .pcb-root .pcb-pay {
        display: flex;
        flex-wrap: wrap;
        gap: 12px;
        align-items: flex-end;
    }

    .pcb-root .pcb-pay .pcb-field {
        min-width: 160px;
        margin-bottom: 0;
    }

    .pcb-root .inputSelect.im-entity-list-input,
    .pcb-root select.im-entity-list-input {
        font-size: 14px;
        min-height: 36px;
    }

    .pcb-root .pcb-list {
        max-height: 420px;
    }

    .pcb-root .pcb-grid {
        height: 380px;
    }

    .pcb-root .pcb-totals {
        align-items: flex-end;
        max-width: 360px;
        margin-left: auto;
    }
}

@media (min-width: 992px) {
    .pcb-root .pcb-grid {
        height: 440px;
    }
}
