/* Material Issue — block store, stock picker, lines table, recipient pad */

.mi-block-badge {
    display: inline-block;
    margin-top: 6px;
    padding: 4px 10px;
    border-radius: 6px;
    background: #ecfdf5;
    border: 1px solid #86efac;
    color: #166534;
    font-size: 0.8rem;
    font-weight: 700;
}

.mi-table-wrap {
    overflow-x: auto;
}
.mi-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}
.mi-table th,
.mi-table td {
    border: 1px solid #e2e8f0;
    padding: 6px;
    vertical-align: top;
}
.mi-table th {
    background: #0C1248;
    color: #fff;
    font-weight: 700;
    text-align: left;
    font-size: 0.75rem;
    white-space: nowrap;
}
.mi-table input {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 6px 8px;
    font: inherit;
}
.mi-table input[readonly] {
    background: #f8fafc;
    color: #334155;
}
.mi-table td.mi-qty {
    width: 5.5rem;
}
.mi-table td.mi-pool-cell {
    width: 4.5rem;
    text-align: center;
    vertical-align: middle;
}
.mi-table td.mi-actions {
    width: 3.5rem;
    text-align: center;
}
.mi-src {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    padding: 3px 7px;
    border-radius: 4px;
}
.mi-src-stock {
    background: #e0e7ff;
    color: #3730a3;
}
.mi-src-adhoc {
    background: #fef3c7;
    color: #92400e;
}
.mi-code {
    font-size: 0.78rem;
    font-weight: 700;
    color: #0c1248;
}
.mi-pool {
    font-weight: 700;
    color: #334155;
}
.mi-muted {
    color: #94a3b8;
}

.mi-sig-wrap canvas {
    width: 100%;
    max-width: 640px;
    height: 140px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #fff;
    touch-action: none;
}
.mi-sig-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
@media (max-width: 720px) {
    .mi-sig-grid { grid-template-columns: 1fr; }
}

/* Stock picker modal */
.mi-picker {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 5vh 16px;
}
.mi-picker[hidden] {
    display: none !important;
}
.mi-picker-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
}
.mi-picker-card {
    position: relative;
    z-index: 1;
    width: min(640px, 100%);
    max-height: 85vh;
    overflow: auto;
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.25);
    padding: 16px;
}
.mi-picker-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}
.mi-picker-head h2 {
    margin: 0;
    font-size: 1.1rem;
    color: #0c1248;
}
.mi-picker-search {
    display: block;
    margin: 10px 0 12px;
    font-weight: 600;
    font-size: 0.85rem;
}
.mi-picker-search input {
    display: block;
    width: 100%;
    margin-top: 4px;
    box-sizing: border-box;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 8px 10px;
    font: inherit;
}
.mi-picker-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.mi-stock-row {
    display: grid;
    grid-template-columns: 7rem 1fr auto;
    gap: 10px;
    align-items: center;
    text-align: left;
    width: 100%;
    border: 1px solid #e2e8f0;
    background: #fff;
    border-radius: 8px;
    padding: 10px 12px;
    cursor: pointer;
    font: inherit;
}
.mi-stock-row:hover:not(:disabled) {
    border-color: #0c1248;
    background: #f8fafc;
}
.mi-stock-row:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}
.mi-stock-code {
    font-weight: 800;
    color: #0c1248;
    font-size: 0.85rem;
}
.mi-stock-desc {
    color: #334155;
    font-size: 0.88rem;
}
.mi-stock-qty {
    font-size: 0.78rem;
    font-weight: 700;
    color: #64748b;
    white-space: nowrap;
}
@media (max-width: 560px) {
    .mi-stock-row {
        grid-template-columns: 1fr;
        gap: 2px;
    }
}
