* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: #f8f9fa;
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background-color: #000000;
    color: #ffffff;
    padding: 20px 0;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo h1 {
    font-size: 20px;
    font-weight: 700;
}

.portal-label {
    font-size: 12px;
    color: #cccccc;
    font-weight: 400;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Navigation */
.nav {
    background-color: #ffffff;
    border-bottom: 1px solid #e5e5e5;
    padding: 0;
}

.nav-tabs {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-link {
    display: block;
    padding: 15px 25px;
    text-decoration: none;
    color: #666;
    font-weight: 500;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
}

.nav-link:hover {
    color: #333;
    background-color: #f8f9fa;
}

.nav-link.active {
    color: #000;
    border-bottom-color: #000;
}

/* Main Content */
.main-content {
    padding: 40px 0;
    min-height: calc(100vh - 200px);
}

.view {
    display: none;
}

.view.active {
    display: block;
}

.view-header {
    margin-bottom: 40px;
}

.view-header h2 {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 10px;
}

.view-header p {
    font-size: 16px;
    color: #666;
    max-width: 800px;
}

/* Buttons */
.btn-primary {
    background-color: #000;
    color: #fff;
    border: none;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

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

.btn-primary:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

.btn-secondary {
    background-color: transparent;
    color: #666;
    border: 1px solid #ddd;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background-color: #f8f9fa;
    border-color: #666;
    color: #333;
}

/* Upload Section */
.upload-section {
    max-width: 600px;
    margin: 0 auto;
}

.upload-area {
    border: 2px dashed #ddd;
    border-radius: 12px;
    padding: 60px 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background-color: #fff;
}

.upload-area:hover {
    border-color: #000;
    background-color: #f8f9fa;
}

.upload-area.dragover {
    border-color: #000;
    background-color: #f0f0f0;
}

.upload-icon {
    font-size: 48px;
    margin-bottom: 20px;
}

.upload-area h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
}

.upload-area p {
    color: #666;
    margin-bottom: 25px;
}

.document-type-selection {
    margin-top: 30px;
    padding: 30px;
    background-color: #fff;
    border-radius: 12px;
    border: 1px solid #e5e5e5;
}

.document-type-selection h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 20px;
}

.radio-group {
    display: flex;
    gap: 20px;
    margin-bottom: 25px;
}

.radio-option {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.radio-option input[type="radio"] {
    margin-right: 8px;
}

.radio-label {
    font-weight: 500;
}

/* Jobs List */
.jobs-list {
    display: grid;
    gap: 20px;
}

.job-card {
    background-color: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 12px;
    padding: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.job-card:hover {
    border-color: #000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.job-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.job-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 5px;
}

.job-type {
    font-size: 14px;
    color: #666;
}

.job-status {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
}

.job-status.queued {
    background-color: #f3f4f6;
    color: #6b7280;
}

.job-status.running {
    background-color: #dbeafe;
    color: #1d4ed8;
}

.job-status.needs_review {
    background-color: #fef3c7;
    color: #d97706;
}

.job-status.approved {
    background-color: #d1fae5;
    color: #065f46;
}

.job-status.failed {
    background-color: #fee2e2;
    color: #dc2626;
}

.job-meta {
    font-size: 14px;
    color: #666;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: #fff;
    border-radius: 12px;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    margin: 20px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

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

.modal-header h3 {
    font-size: 20px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
}

.modal-body {
    padding: 30px;
}

.modal-footer {
    padding: 25px 30px;
    border-top: 1px solid #e5e5e5;
    background-color: #f8f9fa;
    display: flex;
    justify-content: flex-end;
    gap: 15px;
}

/* Approval Section */
.approval-section {
    background-color: #f8f9fa;
    padding: 25px;
    border-radius: 8px;
    margin-top: 20px;
}

.disclaimer-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 20px;
}

.disclaimer-checkbox input[type="checkbox"] {
    margin-top: 4px;
}

.disclaimer-text {
    font-size: 14px;
    line-height: 1.5;
    color: #333;
}

.approval-actions {
    display: flex;
    gap: 15px;
}

/* Standards Section */
.standards-section {
    max-width: 1000px;
}

.standard-type-tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 25px;
    border-bottom: 1px solid #e5e5e5;
}

.tab-btn {
    padding: 12px 20px;
    border: none;
    background-color: transparent;
    color: #666;
    font-weight: 500;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
}

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

.tab-btn:hover {
    color: #333;
}

.standard-content {
    background-color: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 12px;
    padding: 30px;
}

.standard-editor textarea {
    width: 100%;
    height: 400px;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 14px;
    line-height: 1.5;
    resize: vertical;
}

.editor-actions {
    margin-top: 20px;
    display: flex;
    gap: 15px;
}

/* Loading */
.loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.9);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.loading-overlay.active {
    display: flex;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #000;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

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

/* Footer */
.footer {
    background-color: #000;
    color: #666;
    text-align: center;
    padding: 20px 0;
}

.footer p {
    font-size: 12px;
}

/* Draft Watermark */
.draft-watermark {
    background-color: #fef3c7;
    color: #d97706;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-weight: 500;
    text-align: center;
    border: 1px solid #fbbf24;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }

    .header .container {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .nav-tabs {
        flex-direction: column;
    }

    .upload-area {
        padding: 40px 20px;
    }

    .job-header {
        flex-direction: column;
        gap: 10px;
    }

    .modal-content {
        margin: 10px;
    }

    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 20px;
    }

    .process-steps {
        grid-template-columns: 1fr;
    }

    .radio-group {
        flex-direction: column;
        gap: 10px;
    }

    .approval-actions {
        flex-direction: column;
    }

    .standard-type-tabs {
        flex-direction: column;
    }

    .editor-actions {
        flex-direction: column;
    }
}

/* Admin Dashboard */
.admin-section {
    margin-top: 30px;
}

.admin-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 10px;
}

.admin-tabs .tab-btn {
    background: none;
    border: none;
    padding: 12px 24px;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    border-radius: 6px;
    transition: all 0.3s ease;
    color: #6c757d;
}

.admin-tabs .tab-btn:hover {
    background-color: #f8f9fa;
    color: #495057;
}

.admin-tabs .tab-btn.active {
    background-color: #007bff;
    color: white;
}

.admin-tab-content {
    display: none;
}

.admin-tab-content.active {
    display: block;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.admin-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.admin-header h3 {
    font-size: 20px;
    color: #333;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.admin-table th {
    background-color: #f8f9fa;
    padding: 15px;
    text-align: left;
    font-weight: 600;
    color: #495057;
    border-bottom: 2px solid #dee2e6;
}

.admin-table td {
    padding: 15px;
    border-bottom: 1px solid #dee2e6;
    vertical-align: middle;
}

.admin-table tr:hover {
    background-color: #f8f9fa;
}

.role-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.role-admin {
    background-color: #dc3545;
    color: white;
}

.role-member {
    background-color: #28a745;
    color: white;
}

.btn-small {
    padding: 6px 12px;
    font-size: 12px;
    margin-right: 5px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
}

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

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

.error-text, .loading-text {
    text-align: center;
    padding: 40px;
    color: #6c757d;
    font-style: italic;
}

/* SAM Opportunities Styling */
.filter-select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
}

.opportunity-card {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: box-shadow 0.3s ease;
}

.opportunity-card:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.opportunity-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.opportunity-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin: 0 0 5px 0;
    flex: 1;
    padding-right: 15px;
}

.opportunity-score {
    background-color: #28a745;
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    min-width: 50px;
    text-align: center;
}

.opportunity-score.medium {
    background-color: #ffc107;
    color: #333;
}

.opportunity-score.low {
    background-color: #6c757d;
}

.opportunity-meta {
    display: flex;
    gap: 20px;
    margin-bottom: 10px;
    font-size: 14px;
    color: #666;
}

.opportunity-agency {
    font-weight: 500;
}

.opportunity-deadline {
    color: #dc3545;
    font-weight: 500;
}

.opportunity-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.btn-small-primary {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    font-weight: 500;
}

.btn-small-primary:hover {
    background-color: #0056b3;
}

.opportunity-reasons {
    background-color: #f8f9fa;
    border-radius: 4px;
    padding: 10px;
    margin-top: 10px;
    font-size: 13px;
}

.opportunity-reasons ul {
    margin: 0;
    padding-left: 20px;
    list-style-type: disc;
}

.opportunity-reasons li {
    margin-bottom: 3px;
    color: #495057;
}

/* Lead Management */
.lead-card {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
}

.lead-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.lead-company {
    font-weight: 600;
    font-size: 16px;
    color: #333;
}

.lead-status {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.lead-status.to_contact {
    background-color: #ffc107;
    color: #333;
}

.lead-status.contacted {
    background-color: #17a2b8;
    color: white;
}

.lead-status.replied {
    background-color: #28a745;
    color: white;
}

.lead-status.won {
    background-color: #6610f2;
    color: white;
}

.lead-contact {
    color: #666;
    font-size: 14px;
    margin-bottom: 8px;
}

.lead-source {
    font-size: 12px;
    color: #999;
    font-style: italic;
}

/* Modal styles for opportunity details */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 20px;
    border-radius: 8px;
    width: 80%;
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.modal-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

.close {
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #999;
}

.close:hover {
    color: #333;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #333;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

/* Mode Tags for SAM Opportunities */
.mode-tag {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    margin-right: 8px;
    display: inline-block;
}

.mode-blue {
    background-color: #3b82f6;
    color: white;
}

.mode-green {
    background-color: #10b981;
    color: white;
}

.mode-gray {
    background-color: #6b7280;
    color: white;
}

/* Opportunity Title Row Layout */
.opportunity-title-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    width: 100%;
}

.opportunity-badges {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.opportunity-title {
    flex: 1;
    margin-right: 16px;
}

/* Sorting Controls */
.sorting-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 16px;
}

.sorting-controls label {
    font-size: 14px;
    font-weight: 500;
    color: #555;
}

.sorting-controls select {
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    background-color: white;
    font-size: 14px;
    cursor: pointer;
}

.sam-opportunities-controls {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

/* Opportunity Actions Layout */
.opportunity-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-top: 12px;
}

.actions-left {
    display: flex;
    gap: 8px;
    align-items: center;
}

.actions-right {
    display: flex;
    align-items: center;
}

/* Decline Button Styling */
.btn-decline {
    background-color: #dc2626;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-decline:hover {
    background-color: #b91c1c;
}

.btn-decline:active {
    background-color: #991b1b;
}