/* JLT RFQ Review — Brand: Navy #023f85, Orange #f15d22 */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --navy: #023f85;
    --navy-light: #0a4f9e;
    --orange: #f15d22;
    --orange-light: #f4783f;
    --bg: #f9f9fb;
    --white: #ffffff;
    --text: #434549;
    --text-dark: #212326;
    --border: #e2e4e8;
    --gray-100: #f2f3f5;
    --gray-300: #c1c5cc;
    --gray-500: #6b7280;
    --green: #2a9615;
    --red: #dc2626;
    --font: "PT Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --radius: 4px;
}

body {
    font-family: var(--font);
    color: var(--text);
    background: var(--bg);
    line-height: 1.5;
    font-size: 14px;
}

/* Navbar */
.navbar {
    background: var(--white);
    border-bottom: 2px solid var(--navy);
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 100;
}
.nav-inner {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
}
.nav-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text-dark);
}
.nav-logo { height: 36px; }
.nav-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}
.nav-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--navy);
}

/* Container */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 24px;
}

/* Page header */
.page-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}
.page-header h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-dark);
}

/* Badge */
.badge {
    background: var(--gray-100);
    color: var(--gray-500);
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 500;
}

/* Table */
.table {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.table th {
    background: var(--navy);
    color: var(--white);
    font-weight: 600;
    text-align: left;
    padding: 10px 12px;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}
.table tbody tr:hover { background: var(--gray-100); }
.table tbody tr { transition: background 0.15s; }
.table-compact th, .table-compact td { padding: 6px 10px; font-size: 13px; }
.table-scroll { overflow-x: auto; }
.td-date { white-space: nowrap; color: var(--gray-500); font-size: 13px; }

/* Tags */
.tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}
.tag-blue { background: #e0ecf8; color: var(--navy); }
.tag-orange { background: #fde8de; color: #c44a15; }
.tag-green { background: #e5f5e0; color: var(--green); }
.tag-gray { background: var(--gray-100); color: var(--gray-500); }

/* Buttons */
.btn {
    display: inline-block;
    padding: 8px 16px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    border: 2px solid var(--navy);
    color: var(--navy);
    background: var(--white);
    cursor: pointer;
    transition: opacity 0.15s;
}
.btn:hover { opacity: 0.8; }
.btn-sm { padding: 4px 12px; font-size: 13px; }
.btn-primary {
    background: var(--navy);
    color: var(--white);
}
.btn-danger {
    background: var(--red);
    color: var(--white);
    border-color: var(--red);
}
.btn-danger:hover { opacity: 0.85; }

.btn-secondary {
    background: transparent;
    color: var(--navy);
    border-color: var(--navy);
}
.btn-disabled {
    background: var(--gray-100);
    color: var(--gray-500);
    border-color: var(--border);
    cursor: not-allowed;
}

/* Cards */
.card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.card h2 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--navy);
}
.card h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
    margin: 16px 0 8px;
}
.card-warn { border-left: 3px solid var(--orange); }
.card-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

/* Detail list */
.detail-list { display: grid; grid-template-columns: auto 1fr; gap: 4px 16px; }
.detail-list dt { font-weight: 600; color: var(--gray-500); font-size: 13px; text-transform: capitalize; }
.detail-list dd { font-size: 14px; }

/* Actions row */
.actions-row {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

/* Prompt block */
.prompt-block {
    background: var(--gray-100);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    font-family: "SF Mono", "Fira Code", monospace;
    font-size: 12px;
    line-height: 1.6;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 500px;
    overflow-y: auto;
}

/* Upload row */
.upload-row {
    display: flex;
    align-items: center;
    gap: 12px;
}
.upload-row input[type="file"] {
    font-size: 14px;
}

/* Diff styles */
.diff-proposed { background: #fde8e8; }
.diff-actual { background: #dcf5dc; }

/* Diff grid: side-by-side row display */
.diff-grid td { white-space: nowrap; }
.diff-grid-rownum {
    font-weight: 700;
    text-align: center;
    vertical-align: middle;
    background: var(--gray-100);
    border-right: 2px solid var(--border);
    width: 40px;
}
.diff-grid-tag {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    width: 70px;
    white-space: nowrap;
}
.diff-grid-tag-actual { color: #1a7a0a; }
.diff-grid-tag-proposed { color: var(--red); }
.diff-grid-actual td { border-bottom: none; }
.diff-grid-proposed td { border-bottom: 2px solid var(--border); }
.diff-grid-label { width: 40px; }

/* Diff legend */
.diff-legend-actual {
    display: inline-block;
    background: #dcf5dc;
    color: #1a7a0a;
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 600;
}
.diff-legend-proposed {
    display: inline-block;
    background: #fde8e8;
    color: var(--red);
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 600;
}

.grid-section-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-500);
    margin: 16px 0 8px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.diff-edit-section {
    margin-top: 16px;
}
.diff-edit-section label {
    display: block;
    font-weight: 600;
    margin-bottom: 4px;
    font-size: 13px;
    color: var(--gray-500);
}
.diff-textarea {
    width: 100%;
    font-family: var(--font);
    font-size: 14px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    resize: vertical;
    line-height: 1.5;
    margin-bottom: 8px;
}
.diff-textarea:focus {
    outline: none;
    border-color: var(--navy);
    box-shadow: 0 0 0 2px rgba(2, 63, 133, 0.15);
}

/* Spinner */
.spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid var(--gray-300);
    border-top-color: var(--navy);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}
.htmx-indicator { display: none; }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Muted text */
.text-muted { color: var(--gray-500); font-size: 13px; margin-bottom: 12px; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 3px; }

/* Responsive */
@media (max-width: 768px) {
    .card-grid { grid-template-columns: 1fr; }
    .container { padding: 16px; }
}

/* Sign-in */
.login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.login-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-top: 3px solid var(--navy);
    border-radius: var(--radius);
    padding: 32px;
    width: 100%;
    max-width: 380px;
    text-align: center;
}
.login-logo { height: 44px; margin-bottom: 16px; }
.login-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--navy);
    margin-bottom: 8px;
}
.login-hint { color: var(--gray-500); margin-bottom: 20px; }
.login-error {
    background: #fef2f2;
    border-left: 3px solid var(--red);
    color: var(--red);
    text-align: left;
    padding: 8px 12px;
    border-radius: var(--radius);
    margin-bottom: 16px;
}
.login-form { text-align: left; }
.login-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 6px;
}
.login-input {
    width: 100%;
    padding: 8px 12px;
    font-family: var(--font);
    font-size: 14px;
    color: var(--text-dark);
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
}
.login-input:focus { outline: 2px solid var(--navy); outline-offset: -1px; }
.login-code {
    font-family: monospace;
    font-size: 22px;
    letter-spacing: 6px;
    text-align: center;
}
.login-btn { width: 100%; margin-top: 16px; justify-content: center; }
.login-link {
    display: block;
    width: 100%;
    margin-top: 12px;
    background: none;
    border: none;
    color: var(--navy);
    font-family: var(--font);
    font-size: 13px;
    text-decoration: underline;
    cursor: pointer;
}
.nav-user { color: var(--gray-500); font-size: 13px; }
