/* ==========================================================================
   Inventory Control
   The store's masters, the Demand / GRN / GDN entry screens and their
   status / verification / approval / printing desks. Grids reuse the
   pharmacy grid (ph-grid / ph-row / ph-col); only the layout and the
   inventory-specific columns live here.
   ========================================================================== */

.inv-grid-top { margin-top: 10px; min-height: 280px; }

.inv-col-no { width: 64px; flex: none; text-align: right; }
.inv-col-cat { width: 120px; flex: none; }
.inv-col-unit { width: 64px; flex: none; }
.inv-col-loc { width: 170px; flex: none; }
.inv-col-party { width: 170px; flex: none; }
.inv-col-floor { width: 130px; flex: none; }

.inv-select { width: 190px; }
.inv-input-mid { width: 150px; }
.inv-textarea { width: 100%; min-height: 54px; resize: vertical; }

/* -- Category Management (the code tree) --------------------------------- */

.inv-tree-screen { display: flex; gap: 10px; align-items: stretch; }
.inv-tree-left { width: 470px; flex: 0 0 470px; display: flex; flex-direction: column; gap: 8px; }
.inv-tree-panel { flex: 1; min-width: 0; }

.inv-tree {
    min-height: 420px;
    max-height: 640px;
    overflow: auto;
    background: #fff;
    border: 1px solid #c9d6e2;
    padding: 6px;
    font-size: 12px;
}

.inv-node-line { display: flex; align-items: center; gap: 4px; padding: 1px 0; white-space: nowrap; }
.inv-node-toggle {
    width: 14px;
    height: 14px;
    flex: none;
    border: 1px solid #9fb0c0;
    font-size: 11px;
    line-height: 12px;
    text-align: center;
    cursor: pointer;
    background: #f7fafc;
}
.inv-node-toggle:empty { border-color: transparent; background: none; cursor: default; }
.inv-node-text { cursor: pointer; padding: 1px 4px; border-radius: 2px; }
.inv-node-text:hover { background: #eaf3fa; }
.inv-node-selected .inv-node-text { background: #1d4f91; color: #fff; }
.inv-node-code { font-size: 10px; color: #7b8a99; margin-left: 4px; }
.inv-node-selected .inv-node-code { color: #d6e4f5; }
.inv-node-children { margin-left: 18px; border-left: 1px dotted #b7c5d3; padding-left: 4px; }

.inv-node-icon {
    width: 12px;
    height: 14px;
    flex: none;
    display: inline-block;
    border-radius: 1px 3px 3px 1px;
    box-shadow: inset 2px 0 0 rgba(0, 0, 0, .25);
}
.inv-level-1 { background: #2f6ea5; }
.inv-level-2 { background: #e67e22; }
.inv-level-3 { background: #f1c40f; }
.inv-level-4 { background: #27ae60; }
.inv-level-5 { background: #8e44ad; }

.inv-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; }
.inv-legend-item { display: inline-flex; align-items: center; gap: 5px; }

/* -- document entry ------------------------------------------------------- */

.inv-doc { display: flex; gap: 10px; align-items: stretch; margin-top: 8px; }
.inv-doc-left { width: 390px; flex: 0 0 390px; display: flex; flex-direction: column; gap: 8px; }
.inv-doc-left .entry-label { width: 150px; }
.inv-doc-right { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.inv-doc-right .ph-grid-body { min-height: 220px; }

.inv-clock-row { display: flex; gap: 8px; align-items: flex-start; }
.inv-clock { width: 130px; height: 130px; flex: none; }
.inv-queue-left .inv-clock { width: 150px; height: 150px; margin: 4px auto 8px; }

.inv-add {
    width: 34px;
    height: 26px;
    margin-left: 8px;
    border: 1px solid #5a8fbd;
    border-radius: 13px;
    background: linear-gradient(#ffffff, #d4e6f7);
    color: #1d4f91;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
}
.inv-add:disabled { opacity: .45; cursor: default; }

.inv-remove {
    border: none;
    background: none;
    color: #c0392b;
    cursor: pointer;
    font-size: 11px;
    padding: 0;
}

.inv-grid-foot { font-weight: 700; background: linear-gradient(#e8eef4, #d3dde8); border-top: 1px solid #9fb0c0; }

.inv-grn-source { display: flex; gap: 10px; }
.inv-grn-demand { width: 420px; flex: 0 0 420px; }
.inv-grn-hint {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 4px 8px;
    font-size: 11px;
    color: #3d5266;
    background: #f2f6fa;
    border-top: 1px solid #c9d6e2;
}
.inv-grn-hint .ph-go { width: auto; padding: 0 8px; font-size: 11px; }

/* -- the desks ------------------------------------------------------------ */

.inv-queue { display: flex; gap: 10px; align-items: stretch; }
.inv-queue-left { width: 270px; flex: 0 0 270px; display: flex; flex-direction: column; gap: 8px; }
.inv-queue-right { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }

.inv-criteria-caption { font-weight: 700; font-size: 12px; margin: 6px 0 4px; }
.inv-radio { display: flex; align-items: center; gap: 6px; font-size: 12px; padding: 2px 0; cursor: pointer; }
.inv-find { margin-top: 10px; width: 100%; }

.inv-remarks { display: flex; flex-direction: column; gap: 3px; font-size: 12px; }
.inv-remarks label { font-weight: 600; margin-top: 4px; }

.inv-info .entry-label { width: 110px; }
.inv-value { font-weight: 600; color: #1d4f91; font-size: 12px; overflow-wrap: anywhere; }

.inv-count { font-size: 11px; color: var(--ink-muted); white-space: nowrap; }

.inv-detail-row { display: flex; flex-direction: column; gap: 8px; }
.inv-detail-total {
    text-align: right;
    padding: 3px 10px;
    font-size: 15px;
    font-weight: 700;
    background: #f2f6fa;
    border-top: 1px solid #c9d6e2;
}

.inv-band-demand { background: linear-gradient(#5fae6a, #2e7d3a); }
.inv-row-demand { background: #e8f5e9; }
.inv-row-demand:nth-child(even) { background: #dcefdd; }
.inv-row-differs { background: #fff3cd !important; }

.inv-qty-input { width: 100%; height: 18px; font-size: 11px; text-align: right; border: 1px solid #88b0e4; }

.inv-history-bar {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 4px 8px;
    background: linear-gradient(#5fae6a, #2e7d3a);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
}
.inv-history-bar span:first-child { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inv-history-btn {
    border: 1px solid #1e5a28;
    background: linear-gradient(#ffffff, #e0efe2);
    color: #1e5a28;
    font-weight: 700;
    font-size: 11px;
    padding: 2px 10px;
    cursor: pointer;
}
.inv-history-btn:disabled { opacity: .5; cursor: default; }

/* -- reports -------------------------------------------------------------- */

.inv-criteria-input { width: 100%; margin: 2px 0 6px 22px; max-width: calc(100% - 22px); }
.criteria-row-stack { flex-direction: column; align-items: stretch; }
