/* Purchase Request Detail Styles */

.request-detail,
.order-detail {
    background: var(--bg-secondary);
    min-height: 100vh;
    padding-bottom: 2rem;
}

/* Back Button */
.back-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    margin: 1rem;
    background: white;
    border: none;
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.875rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.2s;
}

.back-button:active {
    transform: scale(0.95);
}

/* Detail Header */
.detail-header {
    background: white;
    padding: 1.5rem;
    margin: 0 1rem 1rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.detail-header h2 {
    font-size: 1.25rem;
    color: var(--text-primary);
    margin: 0 0 0.5rem 0;
}

/* Info Section */
.info-section {
    background: white;
    padding: 1.5rem;
    margin: 0 1rem 1rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.info-section h3 {
    font-size: 1.125rem;
    color: var(--text-primary);
    margin: 0 0 1rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.info-item label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.info-item p {
    font-size: 0.875rem;
    color: var(--text-primary);
    margin: 0;
    font-weight: 500;
}

.notes-section {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.notes-section label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    display: block;
    margin-bottom: 0.5rem;
}

.notes-section p {
    font-size: 0.875rem;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.5;
    white-space: pre-wrap;
}

/* Contact Info Section */
.contact-info-section {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.contact-info-section h4 {
    font-size: 1rem;
    color: var(--text-primary);
    margin: 0 0 0.75rem 0;
}

.contact-grid {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.875rem;
}

.contact-item i {
    width: 20px;
    color: var(--primary-color);
}

.contact-item a {
    color: var(--primary-color);
    text-decoration: none;
}

/* Delivery Info Section */
.delivery-info-section {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.delivery-info-section h4 {
    font-size: 1rem;
    color: var(--text-primary);
    margin: 0 0 0.75rem 0;
}

.delivery-details p {
    font-size: 0.875rem;
    margin: 0.5rem 0;
}

/* Items Section */
.items-section {
    background: white;
    padding: 1.5rem;
    margin: 0 1rem 1rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.items-section h3 {
    font-size: 1.125rem;
    color: var(--text-primary);
    margin: 0 0 1rem 0;
}

/* Item Cards */
.item-card,
.order-item-card {
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 0.75rem;
}

.item-card:last-child,
.order-item-card:last-child {
    margin-bottom: 0;
}

.item-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 0.75rem;
}

.item-header h4 {
    font-size: 1rem;
    color: var(--text-primary);
    margin: 0;
    flex: 1;
}

.item-details {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.detail-row {
    display: flex;
    align-items: center;
    font-size: 0.875rem;
}

.detail-label {
    color: var(--text-secondary);
    margin-right: 0.5rem;
}

.detail-value {
    color: var(--text-primary);
    font-weight: 500;
}

.detail-value.total {
    color: var(--primary-color);
}

.detail-row.full-width {
    flex-direction: column;
    align-items: flex-start;
}

.detail-row.full-width .detail-value {
    margin-top: 0.25rem;
    font-weight: normal;
}

/* Priority Badge */
.priority-badge {
    padding: 0.25rem 0.5rem;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 500;
}

.priority-high {
    background: #ffebee;
    color: #c62828;
}

.priority-medium {
    background: #fff3e0;
    color: #ef6c00;
}

.priority-low {
    background: #e8f5e9;
    color: #2e7d32;
}

/* Order Specific */
.order-items-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.order-item-card.item-received {
    background: #e8f5e9;
}

.item-status-icons {
    display: flex;
    gap: 0.5rem;
}

.status-icon {
    font-size: 1rem;
}

.status-icon.dispatched {
    color: #1976d2;
}

.status-icon.received {
    color: #388e3c;
}

/* Item Actions */
.item-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
}

.item-action-btn {
    flex: 1;
    padding: 0.5rem;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.75rem;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
}

.item-action-btn.mark-received {
    border-color: var(--success-color);
    color: var(--success-color);
}

.item-action-btn:active {
    transform: scale(0.95);
}

/* Items Summary */
.items-summary {
    margin-top: 1rem;
    padding: 1rem;
    background: white;
    border-radius: 8px;
    text-align: center;
}

.items-summary p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0 0 0.5rem 0;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--bg-secondary);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--success-color);
    transition: width 0.3s;
}

/* Actions Section */
.actions-section {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.action-btn {
    width: 100%;
    padding: 1rem;
    background: white;
    border: none;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.action-btn.approve {
    background: var(--success-color);
    color: white;
}

.action-btn.reject {
    background: var(--danger-color);
    color: white;
}

.action-btn.cancel {
    background: var(--warning-color);
    color: white;
}

.action-btn.receive-all {
    background: var(--primary-color);
    color: white;
}

.action-btn.view-pdf {
    background: #dc3545;
    color: white;
    text-decoration: none;
}

.action-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.action-btn:active:not(:disabled) {
    transform: scale(0.95);
}

/* History Section */
.history-section {
    background: white;
    padding: 1.5rem;
    margin: 0 1rem 1rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.history-section h3 {
    font-size: 1.125rem;
    color: var(--text-primary);
    margin: 0 0 1rem 0;
}

.history-timeline,
.reception-timeline {
    position: relative;
    padding-left: 2rem;
}

.history-timeline::before,
.reception-timeline::before {
    content: '';
    position: absolute;
    left: 10px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border-color);
}

.history-entry {
    position: relative;
    margin-bottom: 1.5rem;
}

.history-entry:last-child {
    margin-bottom: 0;
}

.history-marker {
    position: absolute;
    left: -22px;
    top: 0;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: white;
    border: 2px solid var(--border-color);
}

.history-marker.status-pending {
    border-color: #ffc107;
}

.history-marker.status-approved {
    border-color: #28a745;
}

.history-marker.status-rejected {
    border-color: #dc3545;
}

.history-marker.received {
    border-color: var(--success-color);
}

.history-content {
    background: var(--bg-secondary);
    padding: 0.75rem;
    border-radius: 8px;
}

.history-status,
.history-title {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    margin: 0 0 0.25rem 0;
}

.history-meta {
    font-size: 0.75rem;
    color: var(--text-secondary);
    display: flex;
    justify-content: space-between;
}

.history-comment,
.history-notes {
    font-size: 0.875rem;
    color: var(--text-primary);
    margin: 0.5rem 0 0 0;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border-color);
}

.empty-message {
    text-align: center;
    color: var(--text-secondary);
    padding: 2rem;
    font-style: italic;
}

/* Total Amount */
.total-amount {
    font-size: 1.125rem !important;
    font-weight: 600 !important;
    color: var(--primary-color) !important;
}


/* Order type info */
.order-type-info {
    background: #e3f2fd;
    color: #1565c0;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin: 1rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.order-type-info strong {
    font-weight: 600;
}