/* Local refinements for the supplies decision dashboard. */

.refined-period-control {
    align-items: flex-end;
}

.inventory-date-range-editor {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    padding-left: 10px;
    border-left: 1px solid var(--border-color, #e4e7ec);
}

.inventory-date-range-editor label {
    display: grid;
    gap: 4px;
    min-width: 145px;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 700;
}

.inventory-date-range-editor .form-input {
    min-height: 40px;
    font-size: 14px;
    font-variant-numeric: tabular-nums;
}

.inventory-stock-summary-strip,
.inventory-reconciliation-panel {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 20px;
    overflow: hidden;
    background: var(--bg-card, #fff);
    border: 1px solid var(--border-color, #e4e7ec);
    border-radius: 14px;
}

.inventory-stock-summary-strip > div,
.inventory-reconciliation-panel > div {
    display: grid;
    gap: 3px;
    min-height: 92px;
    padding: 17px 20px;
    border-right: 1px solid var(--border-color, #e4e7ec);
}

.inventory-stock-summary-strip > div:last-child,
.inventory-reconciliation-panel > div:last-child {
    border-right: 0;
}

.inventory-stock-summary-strip span,
.inventory-reconciliation-panel span {
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .035em;
}

.inventory-stock-summary-strip strong,
.inventory-reconciliation-panel strong {
    color: var(--text-primary);
    font-size: 22px;
    line-height: 1.15;
    font-variant-numeric: tabular-nums;
}

.inventory-stock-summary-strip small,
.inventory-reconciliation-panel small {
    color: var(--text-secondary);
    font-size: 12px;
}

.inventory-stock-summary-strip .danger strong { color: #c93636; }
.inventory-stock-summary-strip .warning strong,
.inventory-reconciliation-panel .needs-attention strong { color: #b66b00; }

.refined-stock-toolbar {
    margin-top: 20px;
}

.refined-category-tabs {
    margin-bottom: 14px;
}

.inventory-stock-table-wrap {
    background: var(--bg-card, #fff);
    border: 1px solid var(--border-color, #e4e7ec);
    border-radius: 14px;
}

.inventory-stock-table {
    min-width: 1040px;
}

.inventory-stock-table th {
    white-space: nowrap;
}

.inventory-stock-table td {
    vertical-align: middle;
}

.inventory-stock-row.danger {
    background: rgba(220, 53, 69, .035);
}

.inventory-stock-row.warning {
    background: rgba(245, 158, 11, .045);
}

.inventory-stock-identity {
    display: flex;
    align-items: center;
    gap: 11px;
    min-width: 230px;
}

.inventory-stock-identity > div,
.inventory-stock-table td:nth-child(3) {
    display: grid;
    gap: 3px;
}

.inventory-stock-identity small,
.inventory-stock-table td:nth-child(3) small {
    color: var(--text-secondary);
    font-size: 12px;
}

.inventory-stock-icon {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    border-radius: 10px;
    color: var(--brand-blue, #3389de);
    background: rgba(51, 137, 222, .09);
}

.inventory-stock-icon svg {
    width: 19px;
    height: 19px;
}

.inventory-stock-state {
    display: inline-flex;
    width: max-content;
    padding: 5px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 750;
}

.inventory-stock-state.success { color: #087c77; background: #e8f7f5; }
.inventory-stock-state.warning { color: #9b5d00; background: #fff3d7; }
.inventory-stock-state.danger { color: #bd3030; background: #fee9e9; }

.inventory-row-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.inventory-row-actions .btn {
    min-height: 34px;
}

.inventory-reconciliation-panel {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.inventory-reconciliation-explanation,
.inventory-reconciliation-note {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 20px;
    padding: 14px 16px;
    border: 1px solid #b9d9f7;
    border-radius: 12px;
    color: #24527d;
    background: #f1f7fd;
}

.inventory-reconciliation-explanation svg,
.inventory-reconciliation-note > svg {
    width: 20px;
    height: 20px;
    flex: 0 0 20px;
    margin-top: 1px;
}

.inventory-reconciliation-explanation p,
.inventory-reconciliation-note p {
    margin: 0;
    line-height: 1.55;
}

.inventory-reconciliation-note {
    margin-top: 12px;
}

.inventory-reconciliation-note strong {
    display: block;
    margin-bottom: 3px;
}

@media (max-width: 1050px) {
    .refined-period-control {
        align-items: stretch;
    }

    .inventory-date-range-editor {
        width: 100%;
        padding: 10px 0 0;
        border-left: 0;
        border-top: 1px solid var(--border-color, #e4e7ec);
    }
}

@media (max-width: 760px) {
    .inventory-date-range-editor {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .inventory-date-range-editor label {
        min-width: 0;
    }

    .inventory-date-range-editor .btn {
        grid-column: 1 / -1;
    }

    .inventory-stock-summary-strip,
    .inventory-reconciliation-panel {
        grid-template-columns: 1fr 1fr;
    }

    .inventory-stock-summary-strip > div,
    .inventory-reconciliation-panel > div {
        border-bottom: 1px solid var(--border-color, #e4e7ec);
    }

    .inventory-stock-summary-strip > div:nth-child(2n),
    .inventory-reconciliation-panel > div:nth-child(2n) {
        border-right: 0;
    }
}
