/**
 * Storefront Requisition Modals - Shared Styles
 * Used across all requisition modal views (submit, approve, dispense, etc.)
 */

#req-submit-modal-container {
    font-family: inherit;
}

.req-header-info {
    background: #f9f9f9;
    padding: 8px 0;
    margin-bottom: 12px;
    border-bottom: 1px solid #e5e5e5;
    font-size: 12px;
}

.req-options-row {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
    align-items: flex-end;
}

.req-options-col {
    flex: 1;
}

.req-options-col label {
    margin-bottom: 6px;
    font-weight: 600;
    display: block;
    font-size: 13px;
}

.req-options-col .form-control {
    font-size: 13px;
}

.req-two-panel {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

.req-product-browser,
.req-cart-panel {
    flex: 1;
    min-width: 0;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    background: #fff;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.req-product-browser {
    max-height: 420px;
}

.req-cart-panel {
    max-height: 420px;
}

.req-search-box {
    padding: 8px;
    border-bottom: 1px solid #e5e5e5;
    flex-shrink: 0;
}

.req-search-box .form-control {
    margin-bottom: 0;
}

.req-product-grid {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.req-product-card {
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 6px;
    text-align: center;
    cursor: pointer;
    transition: box-shadow 0.2s, background-color 0.2s;
}

.req-product-card:hover {
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.req-product-card.req-card-out-of-stock {
    opacity: 0.6;
    background: #f9f9f9;
}

.req-product-thumb {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 3px;
    background: #f5f5f5;
    margin-bottom: 6px;
    display: block;
}

.req-thumb-placeholder {
    width: 100%;
    aspect-ratio: 1 / 1;
    background: #f5f5f5;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 6px;
    color: #ccc;
    font-size: 32px;
}

.req-product-name {
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 3px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.req-product-sku {
    font-size: 11px;
    color: #999;
    margin-bottom: 4px;
}

.req-stock-badge {
    display: inline-block;
    padding: 2px 6px;
    font-size: 11px;
    border-radius: 3px;
    margin-bottom: 4px;
    font-weight: 500;
}

.req-stock-badge.in-stock {
    background: #d4edda;
    color: #155724;
}

.req-stock-badge.out-of-stock {
    background: #f8d7da;
    color: #721c24;
}

.req-add-btn {
    width: 100%;
    padding: 4px 6px;
    font-size: 12px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.2s;
}

.req-add-btn.btn-primary {
    background: #007bff;
    color: white;
}

.req-add-btn.btn-primary:hover {
    background: #0056b3;
}

.req-add-btn.btn-default {
    background: #e9ecef;
    color: #6c757d;
    cursor: not-allowed;
}

.req-cart-header {
    padding: 8px;
    border-bottom: 1px solid #e5e5e5;
    background: #f9f9f9;
    font-size: 12px;
    font-weight: 600;
    flex-shrink: 0;
}

.req-cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

.req-cart-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.req-cart-table thead {
    position: sticky;
    top: 0;
    background: #f9f9f9;
    border-bottom: 1px solid #e5e5e5;
}

.req-cart-table thead th {
    padding: 8px;
    text-align: left;
    font-weight: 600;
    font-size: 11px;
    color: #666;
}

.req-cart-table tbody tr {
    border-bottom: 1px solid #eee;
}

.req-cart-table tbody tr:last-child {
    border-bottom: none;
}

.req-cart-table td {
    padding: 8px;
    vertical-align: middle;
}

.req-item-details {
    flex: 1;
}

.req-item-name {
    font-weight: 600;
    margin-bottom: 2px;
    word-break: break-word;
}

.req-item-sku {
    font-size: 11px;
    color: #999;
    margin-bottom: 3px;
}

.req-item-warnings {
    font-size: 11px;
    color: #f57c00;
    margin-top: 2px;
}

.req-qty-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    white-space: nowrap;
}

.req-qty-btn {
    width: 26px;
    height: 26px;
    padding: 0;
    border: 1px solid #d0d0d0;
    background: #fff;
    border-radius: 3px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    color: #333;
    transition: background-color 0.2s;
}

.req-qty-btn:hover:not(:disabled) {
    background: #f0f0f0;
}

.req-qty-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f9f9f9;
}

.req-qty-display {
    min-width: 30px;
    text-align: center;
    font-weight: 600;
}

.req-remove-btn {
    background: none;
    border: none;
    color: #dc3545;
    cursor: pointer;
    font-size: 16px;
    font-weight: 700;
    padding: 2px 4px;
    transition: color 0.2s;
}

.req-remove-btn:hover {
    color: #c82333;
}

.req-empty-cart {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    color: #999;
    font-size: 12px;
}

.req-notes-section {
    margin-bottom: 12px;
}

.req-notes-section label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 13px;
}

.req-notes-section .form-control {
    min-height: 80px;
}

/**
 * Timeline Styles (for activity log in view requisition modal)
 */
.timeline {
    position: relative;
    padding-left: 20px;
}

.timeline-item {
    position: relative;
    padding-bottom: 15px;
    border-left: 2px solid #e3e6f0;
    padding-left: 20px;
}

.timeline-item:last-child {
    border-left: none;
}

.timeline-item:first-child .timeline-marker {
    top: 2px;
}

.timeline-marker {
    position: absolute;
    left: -11px;
    top: 5px;
    width: 20px;
    height: 20px;
    background: white;
    border: 2px solid #e3e6f0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.timeline-content {
    margin-top: -5px;
}

/**
 * Status & Approval Info Panels
 */
.border-left-2 {
    border-left: 4px solid !important;
}

.bg-warning-light {
    background-color: #fffbf0 !important;
}

.bg-success-light {
    background-color: #f0fdf4 !important;
}

/**
 * Thumbnail Styles for Requisition Item Tables
 * Used in approve, dispense, view, and object requisition modals
 */
.req-item-thumb {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #ddd;
    display: block;
    flex-shrink: 0;
}

.req-item-thumb-placeholder {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
    border-radius: 4px;
    border: 1px solid #ddd;
    color: #aaa;
    font-size: 18px;
    flex-shrink: 0;
}

/**
 * Thumbnail Styles for POS Terminal Cart
 * Used in pos_terminal.php cart display
 */
.pos-cart-item-thumb {
    width: 35px;
    height: 35px;
    object-fit: cover;
    border-radius: 3px;
    border: 1px solid #ddd;
    display: block;
    flex-shrink: 0;
}

.pos-cart-item-thumb-placeholder {
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
    border-radius: 3px;
    border: 1px solid #ddd;
    color: #999;
    font-size: 14px;
    flex-shrink: 0;
}

/**
 * Thumbnail Styles for Requisition Submission Form Cart
 * Used in modal_submit_requisition.php
 */
.req-cart-thumb {
    width: 35px;
    height: 35px;
    object-fit: cover;
    border-radius: 3px;
    border: 1px solid #ddd;
    display: block;
    flex-shrink: 0;
    margin-right: 8px;
}

.req-cart-thumb-placeholder {
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
    border-radius: 3px;
    border: 1px solid #ddd;
    color: #aaa;
    font-size: 14px;
    flex-shrink: 0;
    margin-right: 8px;
}

/* Cart item details container (flex wrapper for thumbnail + product info) */
.req-item-details {
    display: flex;
    align-items: center;
    gap: 8px;
}
