/* Loading Spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #E8F4F8;
    border-top: 4px solid #1E3A5F;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.spinner-sm {
    width: 20px;
    height: 20px;
    border-width: 2px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Toast Notifications */
.toast {
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    animation: slideIn 0.3s ease-out;
    max-width: 400px;
}

.toast-success {
    background-color: #10B981;
    color: white;
}

.toast-error {
    background-color: #EF4444;
    color: white;
}

.toast-warning {
    background-color: #F59E0B;
    color: white;
}

.toast-info {
    background-color: #3B82F6;
    color: white;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* File Upload Drop Zone */
.drop-zone {
    border: 2px dashed #CBD5E1;
    border-radius: 0.5rem;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.drop-zone:hover {
    border-color: #1E3A5F;
    background-color: #E8F4F8;
}

.drop-zone.drag-over {
    border-color: #1E3A5F;
    background-color: #E8F4F8;
    transform: scale(1.02);
}

/* Status Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-draft {
    background-color: #E5E7EB;
    color: #374151;
}

.badge-sent {
    background-color: #DBEAFE;
    color: #1D4ED8;
}

.badge-accepted {
    background-color: #D1FAE5;
    color: #047857;
}

.badge-won {
    background-color: #10B981;
    color: white;
}

.badge-lost {
    background-color: #FEE2E2;
    color: #DC2626;
}

.badge-requoted {
    background-color: #FEF3C7;
    color: #92400E;
}

.badge-pending-signature {
    background-color: #FEF3C7;
    color: #B45309;
}

/* Card Styles */
.card {
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

.card-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #E5E7EB;
}

.card-body {
    padding: 1.5rem;
}

/* Table Styles */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    background-color: #F9FAFB;
    padding: 0.75rem 1rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: #6B7280;
    border-bottom: 1px solid #E5E7EB;
}

.data-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #E5E7EB;
}

.data-table tr:hover {
    background-color: #F9FAFB;
}

/* Button Styles */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-weight: 500;
    font-size: 0.875rem;
    transition: all 0.2s;
    cursor: pointer;
    border: none;
}

.btn-primary {
    background-color: #1E3A5F;
    color: white;
}

.btn-primary:hover {
    background-color: #2d4a6f;
}

.btn-secondary {
    background-color: #4A90A4;
    color: white;
}

.btn-secondary:hover {
    background-color: #5aa0b4;
}

.btn-outline {
    background-color: transparent;
    border: 1px solid #D1D5DB;
    color: #374151;
}

.btn-outline:hover {
    background-color: #F3F4F6;
}

.btn-danger {
    background-color: #EF4444;
    color: white;
}

.btn-danger:hover {
    background-color: #DC2626;
}

.btn-success {
    background-color: #10B981;
    color: white;
}

.btn-success:hover {
    background-color: #059669;
}

.btn-warning {
    background-color: #F59E0B;
    color: white;
}

.btn-warning:hover {
    background-color: #D97706;
}

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

/* Form Styles */
.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.25rem;
}

.form-input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #D1D5DB;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: #1E3A5F;
    box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.1);
}

.form-input.error {
    border-color: #EF4444;
}

.form-error {
    color: #EF4444;
    font-size: 0.75rem;
    margin-top: 0.25rem;
}

.form-select {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #D1D5DB;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    background-color: white;
}

/* Stat Card */
.stat-card {
    background: white;
    border-radius: 0.5rem;
    padding: 1.5rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #1E3A5F;
}

.stat-label {
    font-size: 0.875rem;
    color: #6B7280;
}

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.modal-content {
    background: white;
    border-radius: 0.5rem;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-content.max-w-5xl {
    max-width: 64rem;
}

.modal-content.max-w-6xl {
    max-width: 72rem;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #E5E7EB;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid #E5E7EB;
    background-color: #F9FAFB;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #6B7280;
    cursor: pointer;
    line-height: 1;
    padding: 0;
}

.modal-close:hover {
    color: #1F2937;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: #6B7280;
}

.empty-state svg {
    width: 64px;
    height: 64px;
    margin: 0 auto 1rem;
    color: #D1D5DB;
}

/* Active nav link */
.nav-link.active {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Tab Navigation */
.tab-btn {
    padding: 0.75rem 1rem;
    border-bottom: 2px solid transparent;
    font-weight: 500;
    color: #6B7280;
    transition: all 0.2s;
}

.tab-btn:hover {
    color: #1E3A5F;
    border-bottom-color: #E5E7EB;
}

.tab-btn.active {
    color: #1E3A5F;
    border-bottom-color: #1E3A5F;
}

/* Sortable Table Headers */
.data-table th.sortable {
    cursor: pointer;
    user-select: none;
    position: relative;
    padding-right: 1.5rem;
    transition: background-color 0.15s;
}

.data-table th.sortable:hover {
    background-color: #EDF2F7;
}

.data-table th.sortable .sort-icon {
    position: absolute;
    right: 0.35rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.65rem;
    color: #CBD5E0;
    line-height: 1;
}

.data-table th.sortable.sort-asc .sort-icon,
.data-table th.sortable.sort-desc .sort-icon {
    color: #1E3A5F;
}

/* Recommendation cards */
.recommendation-card {
    transition: all 0.2s;
}

.recommendation-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Waived NRC items — strikethrough with reduced opacity */
.nrc-waived td { text-decoration: line-through; opacity: 0.6; }
.nrc-waived td:last-child { text-decoration: none; opacity: 1; }
