/* frontend/approvals.css - Phase 3: Approval Workflow Styles */

/* === APPROVAL STATUS BADGES === */
.approval-badge {
    display: inline-block;
    padding: 0.3rem 0.7rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.approval-status-pending {
    background: rgba(251, 191, 36, 0.2);
    color: #fbbf24;
    border: 1px solid rgba(251, 191, 36, 0.4);
}

.approval-status-approved {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.4);
}

.approval-status-rejected {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.4);
}

.approval-status-cancelled {
    background: rgba(148, 163, 184, 0.2);
    color: #94a3b8;
    border: 1px solid rgba(148, 163, 184, 0.4);
}

/* === PRIORITY PILLS === */
.priority-pill {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
}

.priority-urgent {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.4);
}

.priority-high {
    background: rgba(251, 146, 60, 0.2);
    color: #fb923c;
    border: 1px solid rgba(251, 146, 60, 0.4);
}

.priority-normal {
    background: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
    border: 1px solid rgba(59, 130, 246, 0.4);
}

.priority-low {
    background: rgba(148, 163, 184, 0.2);
    color: #94a3b8;
    border: 1px solid rgba(148, 163, 184, 0.4);
}

/* === APPROVAL ACTIONS === */
.approval-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(148, 163, 184, 0.2);
}

.approval-actions .btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.8rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
}

.approval-actions .btn-success {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    border-color: #16a34a;
}

.approval-actions .btn-success:hover {
    background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.4);
}

.approval-actions .btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    border-color: #dc2626;
}

.approval-actions .btn-danger:hover {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

/* === QUOTE PREVIEW === */
.quote-preview-container {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-radius: 10px;
    padding: 1rem;
    margin-top: 1rem;
}

.quote-preview-container iframe {
    width: 100%;
    height: 500px;
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-radius: 8px;
    margin-top: 0.5rem;
    background: white;
}

/* === APPROVAL HISTORY === */
.approval-history {
    margin-top: 1rem;
}

.history-item {
    padding: 0.8rem;
    background: rgba(15, 23, 42, 0.4);
    border-left: 3px solid #3b82f6;
    border-radius: 6px;
    margin-bottom: 0.8rem;
}

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

.history-time {
    font-size: 0.75rem;
    color: #94a3b8;
    margin-bottom: 0.3rem;
}

.history-action {
    font-size: 0.9rem;
    color: #e2e8f0;
    margin-bottom: 0.3rem;
}

.history-action strong {
    color: #60a5fa;
}

.history-comments {
    font-size: 0.85rem;
    color: #cbd5e1;
    font-style: italic;
    margin-top: 0.3rem;
    padding-left: 0.5rem;
    border-left: 2px solid rgba(148, 163, 184, 0.3);
}

/* === PENDING APPROVALS BADGE (NOTIFICATION) === */
.badge-notification,
#pendingApprovalBadge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #ef4444;
    color: white;
    border-radius: 50%;
    min-width: 20px;
    height: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 20px;
    text-align: center;
    border: 2px solid #020617;
    padding: 0 5px;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.5);
}

.badge-notification.hidden,
#pendingApprovalBadge.hidden {
    display: none;
}

/* === APPROVAL DETAIL HEADER === */
.approval-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid rgba(148, 163, 184, 0.2);
}

.approval-detail-header h3 {
    margin: 0;
    font-size: 1.4rem;
    color: #e2e8f0;
}

/* === APPROVALS TABLE ROWS === */
#approvalsTable table tbody tr {
    cursor: pointer;
    transition: background-color 0.2s ease;
}

#approvalsTable table tbody tr:hover {
    background: rgba(59, 130, 246, 0.1);
}

#approvalsTable table tbody tr[data-status="pending"] {
    border-left: 3px solid #fbbf24;
}

#approvalsTable table tbody tr[data-status="approved"] {
    border-left: 3px solid #22c55e;
}

#approvalsTable table tbody tr[data-status="rejected"] {
    border-left: 3px solid #ef4444;
}

/* === DIALOG BOXES === */
.dialog-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 1rem;
}

.dialog-box {
    background: #020617;
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-radius: 16px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 2rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

.dialog-box h3 {
    margin: 0 0 1rem 0;
    font-size: 1.5rem;
    color: #e2e8f0;
}

.dialog-box p {
    color: #cbd5e1;
    margin-bottom: 1.5rem;
}

.dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.8rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(148, 163, 184, 0.2);
}

/* === APPROVAL DETAIL PANEL === */
#approvalDetailPanel {
    position: fixed;
    top: 0;
    right: 0;
    width: 600px;
    height: 100vh;
    background: #020617;
    border-left: 1px solid rgba(148, 163, 184, 0.3);
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.4);
    z-index: 1000;
    overflow-y: auto;
    transform: translateX(0);
    transition: transform 0.3s ease;
}

#approvalDetailPanel.hidden {
    transform: translateX(100%);
}

#approvalDetailPanel .side-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
    background: rgba(15, 23, 42, 0.8);
    position: sticky;
    top: 0;
    z-index: 10;
}

#approvalDetailPanel .side-panel-header h3 {
    margin: 0;
    font-size: 1.3rem;
    color: #e2e8f0;
}

#approvalDetailPanel .side-panel-body {
    padding: 1.5rem;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    #approvalDetailPanel {
        width: 100%;
    }
    
    .dialog-box {
        max-width: 95vw;
        padding: 1.5rem;
    }
    
    .approval-actions {
        flex-direction: column;
    }
    
    .approval-actions .btn {
        width: 100%;
    }
    
    .quote-preview-container iframe {
        height: 300px;
    }
}

@media (max-width: 480px) {
    .dialog-box {
        padding: 1rem;
    }
    
    .dialog-box h3 {
        font-size: 1.2rem;
    }
    
    .approval-detail-header h3 {
        font-size: 1.2rem;
    }
}
