:root {
    --primary: #0f172a;
    --accent: #e30613;
    --surface: #f1f5f9;
    --card: #ffffff;
    --text: #1e293b;
    --text-secondary: #64748b;
    --success: #16a34a;
    --warning: #d97706;
    --danger: #dc2626;
    --border: #e2e8f0;
    --radius: 6px;
    --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    background: var(--surface);
    color: var(--text);
    line-height: 1.5;
}

/* Nav */
header { background: var(--primary); border-bottom: 1px solid rgba(255,255,255,0.08); }
nav {
    display: flex; align-items: center; justify-content: space-between;
    max-width: 1400px; margin: 0 auto; padding: 0 1.5rem; height: 56px;
}
.nav-brand a { color: #fff; text-decoration: none; font-size: 1.25rem; font-weight: 700; letter-spacing: 0.3px; }
.nav-links { display: flex; gap: 0.25rem; }
.nav-links a {
    color: rgba(255,255,255,0.7); text-decoration: none; padding: 0.5rem 1rem;
    border-radius: var(--radius); font-size: 0.875rem; transition: all 0.15s;
}
.nav-links a:hover { color: #fff; background: rgba(255,255,255,0.08); }
.nav-links a.active { color: #fff; background: var(--accent); font-weight: 600; }

/* Main */
main { max-width: 1400px; margin: 0 auto; padding: 1.5rem; }
footer { text-align: center; padding: 2rem; color: var(--text-secondary); font-size: 0.75rem; border-top: 1px solid var(--border); margin-top: 2rem; }

/* Page header */
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.5rem; gap: 1rem; flex-wrap: wrap; }
.page-header h1 { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.01em; color: var(--primary); }
.page-title-row { display: flex; align-items: center; gap: 1rem; }
.back-link { color: var(--text-secondary); text-decoration: none; font-size: 0.875rem; }
.back-link:hover { color: var(--text); }

/* Buttons */
.btn {
    display: inline-flex; align-items: center; padding: 0.5rem 1rem;
    border: none; border-radius: var(--radius); font-size: 0.875rem;
    font-weight: 500; cursor: pointer; text-decoration: none; transition: all 0.15s;
}
.btn-primary { background: var(--accent); color: #fff; font-weight: 600; letter-spacing: 0.01em; }
.btn-primary:hover { background: #c20510; box-shadow: 0 2px 4px rgba(227,6,19,0.25); }
.btn-secondary { background: var(--card); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--surface); border-color: var(--text-secondary); }
.btn-success { background: var(--success); color: #fff; }
.btn-danger { background: transparent; color: var(--danger); border: 1px solid var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-small { padding: 0.25rem 0.5rem; font-size: 0.8rem; }

/* Stats */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; margin-bottom: 2rem; }
.stat-card {
    background: var(--card); padding: 1.5rem; border-radius: var(--radius);
    box-shadow: var(--shadow); text-align: center; border: 1px solid var(--border);
}
.stat-value { font-size: 2rem; font-weight: 800; color: var(--primary); letter-spacing: -0.02em; }
.stat-label { font-size: 0.8rem; color: var(--text-secondary); margin-top: 0.25rem; text-transform: uppercase; letter-spacing: 0.5px; }

/* Dashboard grid */
.dashboard-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
@media (max-width: 900px) { .dashboard-grid { grid-template-columns: 1fr; } }
.dashboard-section { background: var(--card); padding: 1.5rem; border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--border); }
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.section-header h2 { font-size: 1.1rem; }

/* Project cards */
.project-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1rem; }
.project-card {
    display: block; background: var(--card); padding: 1.25rem; border-radius: var(--radius);
    box-shadow: var(--shadow); text-decoration: none; color: var(--text);
    border: 1px solid var(--border); border-left: 4px solid var(--border); transition: all 0.15s;
}
.project-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.12); transform: translateY(-1px); }
.project-card h3 { font-size: 1rem; margin: 0.5rem 0 0.25rem; }
.card-header { display: flex; gap: 0.5rem; }
.card-customer { color: var(--text-secondary); font-size: 0.875rem; }
.card-deadline { font-size: 0.8rem; color: var(--warning); margin-top: 0.5rem; }
.card-footer { display: flex; gap: 0.5rem; margin-top: 0.75rem; }

/* Status badges */
.status-badge {
    display: inline-block; padding: 0.2rem 0.6rem; border-radius: 4px;
    font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
}
.status-intake, .status-staged { background: #fff3cd; color: #856404; }
.status-qualification, .status-analysis { background: #d1ecf1; color: #0c5460; }
.status-response, .status-review { background: #cce5ff; color: #004085; }
.status-published, .status-submitted { background: #d4edda; color: #155724; }
.status-won { background: var(--success); color: #fff; }
.status-lost, .status-archived { background: #f8d7da; color: #721c24; }
.status-no_bid, .status-withdrawn { background: var(--border); color: var(--text-secondary); }

.tier-badge { display: inline-block; padding: 0.2rem 0.6rem; border-radius: 12px; font-size: 0.7rem; font-weight: 600; }
.tier-core { background: #e2e3e5; color: #383d41; }
.tier-enhanced { background: #cce5ff; color: #004085; }
.tier-advanced { background: #d4edda; color: #155724; }

.relationship-tag, .model-tag {
    font-size: 0.7rem; padding: 0.15rem 0.5rem; border-radius: 10px;
    background: var(--surface); color: var(--text-secondary);
}

.status-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; }
.status-dot.published { background: var(--success); }
.status-dot.staged { background: var(--warning); }
.status-dot.archived { background: var(--border); }

.tag { display: inline-block; padding: 0.1rem 0.4rem; background: var(--surface); border-radius: 4px; font-size: 0.75rem; margin: 0.1rem; }

/* Tables */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
    text-align: left; padding: 0.75rem; font-size: 0.7rem; text-transform: uppercase;
    letter-spacing: 0.05em; color: var(--text-secondary); border-bottom: 2px solid var(--primary); font-weight: 700;
}
.data-table td { padding: 0.75rem; border-bottom: 1px solid var(--border); font-size: 0.875rem; }
.data-table tbody tr:hover { background: var(--surface); }
.data-table a { color: var(--primary); text-decoration: none; }
.data-table a:hover { text-decoration: underline; }
.clickable-row { cursor: pointer; }
.clickable-row:hover { background: var(--surface); }

/* Forms */
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-size: 0.875rem; font-weight: 500; margin-bottom: 0.25rem; }
.form-control {
    width: 100%; padding: 0.5rem 0.75rem; border: 1px solid var(--border);
    border-radius: var(--radius); font-size: 0.875rem; transition: border-color 0.15s;
}
.form-control:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(227,6,19,0.1); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-fieldset { border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; margin-bottom: 1rem; }
.form-fieldset legend { font-size: 0.875rem; font-weight: 600; padding: 0 0.5rem; }
.form-hint { color: var(--text-secondary); font-size: 0.85rem; margin-bottom: 1rem; }
.form-actions { display: flex; gap: 0.75rem; margin-top: 1rem; }
.input-prefix { display: flex; align-items: center; gap: 0.5rem; }
.input-prefix span { font-weight: 600; color: var(--text-secondary); }
.search-input { max-width: 400px; margin-bottom: 1rem; }

/* Radio cards */
.radio-group { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.radio-group.inline { flex-wrap: nowrap; }
.radio-card {
    display: flex; align-items: center; gap: 0.5rem; padding: 0.5rem 1rem;
    border: 1px solid var(--border); border-radius: var(--radius); cursor: pointer;
    font-size: 0.875rem; transition: all 0.15s;
}
.radio-card:has(input:checked) { border-color: var(--accent); background: rgba(233,69,96,0.05); }
.radio-card input { accent-color: var(--accent); }
.radio-card.small { padding: 0.35rem 0.75rem; font-size: 0.8rem; }

/* Wizard */
.wizard-container { max-width: 800px; }
.wizard-nav { display: flex; gap: 0.5rem; margin-bottom: 2rem; }
.wizard-step {
    display: flex; align-items: center; gap: 0.5rem; padding: 0.5rem 1rem;
    background: var(--card); border-radius: var(--radius); font-size: 0.875rem;
    color: var(--text-secondary); border: 1px solid var(--border); cursor: pointer;
}
.wizard-step.active { color: var(--primary); border-color: var(--accent); font-weight: 600; }
.wizard-step.completed { color: var(--success); }
.step-number {
    display: flex; align-items: center; justify-content: center;
    width: 24px; height: 24px; border-radius: 50%; background: var(--border);
    color: #fff; font-size: 0.75rem; font-weight: 700;
}
.wizard-step.active .step-number { background: var(--accent); }
.wizard-step.completed .step-number { background: var(--success); }
.wizard-panel { background: var(--card); padding: 1.5rem; border-radius: var(--radius); box-shadow: var(--shadow); }
.wizard-panel h2 { font-size: 1.15rem; margin-bottom: 1.25rem; }
.wizard-actions { display: flex; justify-content: flex-end; gap: 0.75rem; margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid var(--border); }

/* Upload zone */
.upload-container { max-width: 600px; }
.upload-zone {
    border: 2px dashed var(--border); border-radius: var(--radius); padding: 3rem 2rem;
    text-align: center; transition: all 0.2s; background: var(--card);
}
.upload-zone.drag-over { border-color: var(--accent); background: rgba(233,69,96,0.03); }
.upload-icon { font-size: 3rem; margin-bottom: 1rem; }
.upload-hint { color: var(--text-secondary); margin: 0.5rem 0; }
.upload-formats { font-size: 0.8rem; color: var(--text-secondary); margin-top: 1rem; }
.upload-zone-simple { margin: 1rem 0; }
.file-preview { text-align: left; }
.file-info { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.file-icon { font-size: 2rem; }
.file-name { font-weight: 500; }
.file-size { color: var(--text-secondary); font-size: 0.85rem; }

/* Detail panel */
.detail-panel { margin-top: 1rem; }
.detail-content { background: var(--card); padding: 1.5rem; border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--border); }
.detail-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.detail-header h3 { font-size: 1.1rem; }
.detail-meta { display: grid; grid-template-columns: 140px 1fr; gap: 0.5rem 1rem; }
.detail-meta dt { font-size: 0.8rem; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.3px; }
.detail-meta dd { font-size: 0.875rem; }
.detail-actions { display: flex; gap: 0.5rem; margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--border); }

/* Project detail */
.project-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.detail-section { background: var(--card); padding: 1.5rem; border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--border); }
.detail-section h2 { font-size: 1.1rem; margin-bottom: 1rem; }
.detail-section.full-width { grid-column: 1 / -1; }

/* Qualification */
.qual-result { display: flex; align-items: center; justify-content: space-between; padding: 1rem; border-radius: var(--radius); margin-bottom: 0.75rem; }
.qual-go { background: #d4edda; }
.qual-no_bid { background: #f8d7da; }
.qual-conditional_go { background: #fff3cd; }
.qual-decision { font-size: 1.25rem; font-weight: 700; }
.qual-score { font-size: 1.5rem; font-weight: 700; }
.qual-rationale { font-size: 0.875rem; color: var(--text-secondary); }
.qual-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0.75rem; margin-bottom: 1rem; }
.qual-score-group { display: flex; align-items: center; gap: 0.5rem; }
.qual-score-group input { width: 60px; text-align: center; }
.score-hint { color: var(--text-secondary); font-size: 0.8rem; }

/* Pagination */
.pagination { display: flex; gap: 0.25rem; margin-top: 1rem; justify-content: center; }
.page-link {
    padding: 0.4rem 0.75rem; border-radius: var(--radius); text-decoration: none;
    color: var(--text); font-size: 0.85rem; border: 1px solid var(--border);
}
.page-link.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.page-ellipsis { padding: 0.4rem; color: var(--text-secondary); }

/* Flash messages */
.flash-messages { margin-bottom: 1rem; }
.flash { padding: 0.75rem 1rem; border-radius: var(--radius); font-size: 0.875rem; margin-bottom: 0.5rem; }
.flash-success { background: #d4edda; color: #155724; }
.flash-error { background: #f8d7da; color: #721c24; }
.flash-warning { background: #fff3cd; color: #856404; }

/* Empty state */
.empty-state { color: var(--text-secondary); font-size: 0.875rem; padding: 1rem; text-align: center; }
.empty-state a { color: var(--accent); }

/* HTMX indicator */
.htmx-indicator { display: none; font-size: 0.85rem; color: var(--text-secondary); }
.htmx-request .htmx-indicator { display: inline; }

/* Filter bar */
.filter-bar { display: flex; gap: 0.75rem; margin-bottom: 1rem; flex-wrap: wrap; align-items: center; background: var(--card); padding: 1rem; border-radius: var(--radius); }
.filter-bar select, .filter-bar input[type="text"] { padding: 0.4rem 0.75rem; border: 1px solid var(--border); border-radius: var(--radius); font-size: 0.85rem; }

/* Search results dropdown */
.search-results { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); max-height: 200px; overflow-y: auto; }
.search-result { padding: 0.5rem 1rem; cursor: pointer; font-size: 0.875rem; }
.search-result:hover { background: var(--surface); }


/* Knowledge blocks (SP-RFQ-002) */
.search-bar { display: flex; gap: 0.75rem; margin-bottom: 1.5rem; flex-wrap: wrap; align-items: center; }
.search-input-lg { flex: 1; min-width: 300px; padding: 0.6rem 1rem; font-size: 1rem; border: 2px solid var(--border); border-radius: var(--radius); }
.search-input-lg:focus { border-color: var(--accent); outline: none; }
.search-summary { color: var(--text-secondary); font-size: 0.875rem; margin-bottom: 1rem; }

.block-list { display: flex; flex-direction: column; gap: 0.75rem; }
.block-card {
    background: var(--card); padding: 1rem 1.25rem; border-radius: var(--radius);
    box-shadow: var(--shadow); cursor: pointer; transition: all 0.15s;
    border-left: 3px solid var(--border);
}
.block-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.12); border-left-color: var(--accent); }
.block-header { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.25rem; }
.block-source { margin-left: auto; font-size: 0.75rem; color: var(--text-secondary); }
.block-section-ref { font-size: 0.8rem; color: var(--text-secondary); margin-bottom: 0.5rem; font-style: italic; }
.block-content-preview { font-size: 0.875rem; line-height: 1.5; color: var(--text); white-space: pre-line; }
.block-tags { display: flex; gap: 0.25rem; margin-top: 0.5rem; flex-wrap: wrap; }
.block-full-content { font-size: 0.9rem; line-height: 1.6; white-space: pre-line; margin-bottom: 1.5rem; padding: 1rem; background: var(--surface); border-radius: var(--radius); }

.content-type-badge {
    display: inline-block; padding: 0.15rem 0.5rem; border-radius: 10px;
    font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.3px;
}
.type-qa_pair { background: #d1ecf1; color: #0c5460; }
.type-paragraph { background: #e2e3e5; color: #383d41; }
.type-table { background: #fff3cd; color: #856404; }
.type-list { background: #d4edda; color: #155724; }
.type-heading { background: #cce5ff; color: #004085; }

.score-badge {
    display: inline-block; padding: 0.15rem 0.4rem; border-radius: 10px;
    font-size: 0.7rem; font-weight: 700; background: var(--success); color: #fff;
}
.text-secondary { color: var(--text-secondary); font-size: 0.875rem; }

/* Question Review (SP-RFQ-003) */
.question-review-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.25rem; flex-wrap: wrap; gap: 1rem; }
.review-stats { display: flex; gap: 0.75rem; align-items: center; flex-wrap: wrap; }
.stat-pill { display: flex; flex-direction: column; align-items: center; padding: 0.4rem 0.75rem; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 60px; }
.stat-num { font-size: 1.25rem; font-weight: 700; color: var(--text); }
.stat-label { font-size: 0.7rem; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.3px; }
.stat-approved .stat-num { color: var(--success); }
.stat-draft .stat-num { color: var(--warning, #e67e22); }
.progress-bar-wrap { width: 120px; height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; }
.progress-bar { height: 100%; background: var(--success); border-radius: 3px; transition: width 0.3s; }
.review-actions { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.inline-form { display: inline; }

.filter-bar { display: flex; gap: 0.5rem; margin-bottom: 1rem; flex-wrap: wrap; }
.filter-select { padding: 0.35rem 0.6rem; border: 1px solid var(--border); border-radius: var(--radius); font-size: 0.85rem; background: var(--card); color: var(--text); }

.question-table { width: 100%; }
.question-table th { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-secondary); padding: 0.5rem 0.6rem; text-align: left; }
.question-table td { padding: 0.5rem 0.6rem; font-size: 0.85rem; vertical-align: top; border-bottom: 1px solid var(--border); }
.col-ref { width: 60px; }
.col-section { width: 140px; }
.col-question { min-width: 250px; }
.col-category { width: 130px; }
.col-type { width: 45px; text-align: center; }
.col-conf { width: 50px; text-align: center; }
.col-status { width: 80px; }
.col-actions { width: 90px; white-space: nowrap; }

.question-text { line-height: 1.4; }
.extraction-badge { display: inline-block; font-size: 0.65rem; padding: 0.1rem 0.4rem; border-radius: 8px; margin-left: 0.3rem; vertical-align: middle; background: #e8e8e8; color: #666; }
.badge-ai_mapped { background: #d1ecf1; color: #0c5460; }
.badge-ai_detected { background: #fff3cd; color: #856404; }

.category-badge { font-size: 0.8rem; white-space: nowrap; }
.type-badge { display: inline-block; width: 22px; height: 22px; line-height: 22px; text-align: center; border-radius: 50%; font-size: 0.7rem; font-weight: 700; }
.type-question { background: #cce5ff; color: #004085; }
.type-requirement { background: #d4edda; color: #155724; }
.type-statement { background: #e2e3e5; color: #383d41; }
.type-information { background: #fff3cd; color: #856404; }

.conf-dot { font-size: 0.75rem; font-weight: 600; }
.conf-high { color: var(--success); }
.conf-med { color: var(--warning, #e67e22); }
.conf-low { color: var(--danger, #c0392b); }

.review-badge { display: inline-block; padding: 0.15rem 0.5rem; border-radius: 10px; font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.3px; }
.review-draft { background: #fff3cd; color: #856404; }
.review-approved { background: #d4edda; color: #155724; }
.review-rejected { background: #f8d7da; color: #721c24; }
.review-manual { background: #cce5ff; color: #004085; }

.btn-icon { background: none; border: none; cursor: pointer; font-size: 1rem; padding: 0.15rem 0.35rem; border-radius: 4px; color: var(--text-secondary); }
.btn-icon:hover { background: var(--border); }
.btn-approve:hover { color: var(--success); }
.btn-reject:hover { color: var(--danger, #c0392b); }

.question-row.status-approved { opacity: 0.85; }
.question-row.status-rejected { opacity: 0.5; }

/* Inline edit form */
.question-edit-row td { background: var(--surface, #f8f9fa); }
.edit-form { padding: 0.5rem 0; }
.edit-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 0.75rem; margin-bottom: 0.75rem; }
.edit-field label { display: block; font-size: 0.75rem; color: var(--text-secondary); margin-bottom: 0.2rem; font-weight: 600; }
.edit-field.full-width { margin-bottom: 0.75rem; }
.form-input-sm { padding: 0.3rem 0.5rem; font-size: 0.85rem; }
.form-input { width: 100%; padding: 0.4rem 0.6rem; border: 1px solid var(--border); border-radius: var(--radius); font-size: 0.9rem; background: var(--card); color: var(--text); font-family: inherit; }
.form-input:focus { border-color: var(--accent); outline: none; }
textarea.form-input { resize: vertical; }
.edit-actions { display: flex; gap: 0.5rem; }
.original-text { font-size: 0.75rem; color: var(--text-secondary); margin-bottom: 0.5rem; padding: 0.4rem; background: var(--card); border-radius: 4px; border-left: 2px solid var(--border); }
.checkbox-label { display: flex; align-items: center; gap: 0.4rem; padding-top: 1.2rem; font-size: 0.85rem; }

/* Add question / upload panel */
.add-question-panel { background: var(--card); padding: 1.25rem; border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 1.25rem; border-left: 3px solid var(--accent); }
.add-question-panel h3 { margin: 0 0 0.5rem; font-size: 1rem; }

/* Empty state */
.empty-state-box { text-align: center; padding: 3rem 2rem; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); }
.empty-state-box h3 { margin: 0 0 0.5rem; }
.empty-state-box p { color: var(--text-secondary); margin-bottom: 1rem; }

.extraction-status { text-align: center; padding: 2rem; }
.spinner { display: inline-block; width: 24px; height: 24px; border: 3px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; margin-bottom: 0.5rem; }
@keyframes spin { to { transform: rotate(360deg); } }

.section-header-row { display: flex; justify-content: space-between; align-items: center; }
.table-wrap { overflow-x: auto; }
.btn-sm { padding: 0.3rem 0.6rem; font-size: 0.8rem; }

/* Answer Engine (SP-RFQ-004) */
.answer-review-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.25rem; flex-wrap: wrap; gap: 1rem; }
.answer-table td { vertical-align: middle; }
.question-text-cell { max-width: 400px; }

.answer-card { background: var(--card); padding: 1.25rem; border-radius: var(--radius); box-shadow: var(--shadow); }
.answer-question-bar { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.answer-question-bar > div:first-child { flex: 1; line-height: 1.5; }
.answer-meta { display: flex; gap: 0.75rem; align-items: center; font-size: 0.85rem; color: var(--text-secondary); white-space: nowrap; }

.three-columns { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem; margin-bottom: 1rem; }
@media (max-width: 900px) { .three-columns { grid-template-columns: 1fr; } }

.answer-column { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; display: flex; flex-direction: column; transition: border-color 0.15s; }
.answer-column:hover { border-color: var(--text-secondary); }
.answer-column.column-selected { border-color: var(--success); background: #f0faf0; }
.answer-column.column-recommended { border-color: var(--accent); }
.column-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.75rem; }
.column-header h3 { margin: 0; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-secondary); }
.selected-mark { font-size: 0.7rem; padding: 0.15rem 0.4rem; background: var(--success); color: #fff; border-radius: 8px; font-weight: 600; }
.column-body { font-size: 0.875rem; line-height: 1.6; flex: 1; white-space: pre-line; margin-bottom: 0.75rem; }
.column-footer { margin-top: auto; }
.recommendation-reason { font-size: 0.75rem; color: var(--text-secondary); font-style: italic; padding: 0.4rem; background: var(--card); border-radius: 4px; margin-bottom: 0.5rem; }

.final-answer-section { margin-top: 1rem; padding: 1rem; background: var(--surface, #f8f9fa); border-radius: var(--radius); border-left: 3px solid var(--success); }
.final-answer-section h3 { margin: 0 0 0.5rem; font-size: 0.9rem; }
.final-answer-text { font-size: 0.875rem; line-height: 1.6; white-space: pre-line; }
.answer-type-badge { font-size: 0.65rem; padding: 0.1rem 0.4rem; border-radius: 8px; background: #e8e8e8; color: #666; vertical-align: middle; margin-left: 0.3rem; }

.answer-actions { display: flex; gap: 0.5rem; margin-top: 1rem; align-items: center; flex-wrap: wrap; }

.citations-panel { margin-top: 1rem; }
.citations-panel h3 { margin: 0 0 0.75rem; font-size: 0.95rem; }
.citation-card { background: var(--surface, #f8f9fa); padding: 0.75rem 1rem; border-radius: var(--radius); margin-bottom: 0.5rem; border-left: 3px solid var(--border); }
.citation-header { display: flex; gap: 0.5rem; align-items: center; margin-bottom: 0.35rem; font-size: 0.85rem; flex-wrap: wrap; }
.citation-num { font-weight: 700; color: var(--accent); }
.citation-section { color: var(--text-secondary); font-style: italic; margin-left: auto; }
.citation-content { font-size: 0.8rem; line-height: 1.5; color: var(--text); white-space: pre-line; }

/* Offering Configuration (SP-RFQ-006) */
.offering-grid { display: grid; grid-template-columns: 1fr 360px; gap: 1.5rem; align-items: start; }
@media (max-width: 900px) { .offering-grid { grid-template-columns: 1fr; } }
.offering-left { display: flex; flex-direction: column; gap: 1rem; }
.offering-right { position: relative; }
.sticky-card { position: sticky; top: 1rem; }

.offer-section { background: var(--card); padding: 1.25rem; border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--border); }
.offer-section h2 { margin: 0 0 0.75rem; font-size: 1rem; }
.offer-section h2 .hint { font-weight: 400; font-size: 0.8rem; color: var(--text-secondary); }
.offer-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }

.model-tabs { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.model-tab { display: flex; flex-direction: column; align-items: center; padding: 0.75rem 1.25rem; border: 2px solid var(--border); border-radius: var(--radius); cursor: pointer; text-align: center; transition: all 0.15s; flex: 1; min-width: 120px; }

.model-tab strong { font-size: 0.9rem; }
.model-tab small { font-size: 0.7rem; color: var(--text-secondary); margin-top: 0.2rem; }
.model-tab.active { border-color: var(--accent); background: #fff5f5; }

.included-list { display: flex; flex-direction: column; gap: 0.35rem; }
.included-item { display: flex; align-items: center; gap: 0.5rem; font-size: 0.85rem; padding: 0.3rem 0; }
.included-item .tick { color: var(--success); font-weight: 700; }

.bolton-group { font-size: 0.8rem; color: var(--text-secondary); margin: 0.75rem 0 0.3rem; text-transform: uppercase; letter-spacing: 0.3px; }
.bolton-item { display: flex; align-items: center; gap: 0.5rem; font-size: 0.85rem; padding: 0.3rem 0; cursor: pointer; }
.bolton-item .poa { margin-left: auto; font-size: 0.7rem; color: var(--text-secondary); font-style: italic; }

.summary-card { background: var(--card); padding: 1.25rem; border-radius: var(--radius); box-shadow: var(--shadow-md); border: 1px solid var(--border); border-top: 3px solid var(--accent); }
.summary-card h2 { margin: 0 0 1rem; font-size: 1rem; }
.summary-dl { margin: 0; }
.summary-dl dt { font-size: 0.8rem; color: var(--text-secondary); margin-top: 0.5rem; }
.summary-dl dd { font-size: 0.9rem; font-weight: 600; margin: 0.1rem 0 0; }
.summary-total { display: flex; justify-content: space-between; align-items: center; padding: 0.75rem 0; margin-top: 0.75rem; border-top: 2px solid var(--border); }
.total-amount { font-size: 1.5rem; font-weight: 800; color: var(--accent, #E30613); }
.summary-actions { display: flex; gap: 0.5rem; margin-top: 1rem; }
.summary-actions .btn { flex: 1; text-align: center; }

/* Log source table */
.ls-table-wrap { max-height: 500px; overflow-y: auto; }
.ls-platform-header { font-size: 0.85rem; color: var(--accent, #E30613); margin: 0.75rem 0 0.3rem; text-transform: uppercase; letter-spacing: 0.5px; }
.ls-table { font-size: 0.8rem; }
.ls-table th { font-size: 0.7rem; padding: 0.4rem 0.5rem; }
.ls-table td { padding: 0.3rem 0.5rem; }
.ls-row { opacity: 0.7; }
.ls-row.ls-selected { opacity: 1; background: #f0faf0; }
.ls-name { font-weight: 600; }
.ls-cat, .ls-coll, .ls-unit { color: var(--text-secondary); font-size: 0.75rem; }
.ls-gb { font-weight: 600; color: var(--accent); }
.ls-qty { width: 55px !important; padding: 0.2rem 0.3rem !important; font-size: 0.8rem !important; }
.ls-tier { width: 40px !important; padding: 0.15rem 0.2rem !important; font-size: 0.75rem !important; text-align: center; }
.ls-tier-hdr { font-size: 0.65rem !important; text-align: center; color: var(--text-secondary); }

/* Offering summary on project detail */
.offering-summary-mini { background: var(--surface, #f8f9fa); padding: 0.75rem 1rem; border-radius: var(--radius); margin-top: 0.5rem; border-left: 3px solid var(--accent); }
.offering-summary-mini dl { display: grid; grid-template-columns: auto 1fr; gap: 0.2rem 0.75rem; margin: 0; font-size: 0.85rem; }
.offering-summary-mini dt { color: var(--text-secondary); }
.offering-summary-mini dd { font-weight: 600; margin: 0; }

/* Rate Card (SP-RFQ-006) */
.rc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 900px) { .rc-grid { grid-template-columns: 1fr; } }
.rc-table { font-size: 0.85rem; }
.rc-table th { font-size: 0.7rem; padding: 0.4rem 0.6rem; }
.rc-table td { padding: 0.35rem 0.6rem; vertical-align: middle; }
.rc-name { font-weight: 600; }
.rc-note { font-size: 0.75rem; color: var(--text-secondary); font-style: italic; }
.rc-input { width: 80px !important; padding: 0.25rem 0.4rem !important; font-size: 0.85rem !important; text-align: right; }
.rc-actions { margin-top: 1.5rem; display: flex; gap: 0.5rem; }

/* Compliance Matrix + Export (SP-RFQ-005) */
.compliance-summary { display: flex; gap: 0.75rem; align-items: center; margin-bottom: 1.5rem; flex-wrap: wrap; }
.compliance-section { margin-bottom: 1.5rem; }
.compliance-section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.5rem; }
.compliance-section-header h2 { margin: 0; font-size: 1rem; }
.section-progress { display: flex; align-items: center; gap: 0.5rem; font-size: 0.8rem; color: var(--text-secondary); }
.compliance-table td { font-size: 0.85rem; }
.cm-dot { font-size: 1.1rem; }
.cm-done { color: var(--success); }
.cm-gen { color: var(--warning, #e67e22); }
.cm-none { color: var(--border); }
.diff-current { background: #fef2f2; font-size: 0.8rem; max-width: 250px; }
.diff-new { background: #f0fdf4; font-size: 0.8rem; max-width: 250px; }
