/* === VARIABLES === */
:root {
    --brand:        #7c3aed;
    --brand-dark:   #6d28d9;
    --brand-light:  #ede9fe;
    --sidebar-bg:   #1e1248;
    --border:       #e5e7eb;
    --text-muted:   #6b7280;
    --bg-page:      #f5f6fa;
}

/* === RESET === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; font-size: 13.5px; color: #1f2937; background: var(--bg-page); }
a { text-decoration: none; color: inherit; }

/* === LOGIN === */
.login-body {
    min-height: 100vh;
    background: linear-gradient(135deg, #1e1248 0%, #4c1d95 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}
.login-card {
    background: white;
    border-radius: 14px;
    padding: 44px 48px;
    width: 420px;
    box-shadow: 0 24px 64px rgba(0,0,0,0.35);
}
.login-brand { text-align: center; margin-bottom: 32px; }
.login-brand h1 { font-size: 22px; font-weight: 700; color: var(--sidebar-bg); letter-spacing: -0.5px; }
.login-brand p  { font-size: 13px; color: var(--text-muted); margin-top: 5px; }
.field { margin-bottom: 18px; }
.field label { display: block; font-size: 13px; font-weight: 500; color: #374151; margin-bottom: 6px; }
.field input {
    width: 100%; padding: 10px 13px; border: 1px solid var(--border);
    border-radius: 8px; font-size: 14px; color: #1f2937; outline: none;
    transition: border-color .15s, box-shadow .15s;
}
.field input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(124,58,237,.12); }
.error-msg {
    color: #dc2626; font-size: 13px; margin-bottom: 14px;
    padding: 9px 13px; background: #fef2f2; border-radius: 7px; border: 1px solid #fecaca;
}
.hidden { display: none !important; }

/* === BUTTONS === */
.btn-primary {
    background: var(--brand); color: white; border: none;
    padding: 9px 18px; border-radius: 7px; cursor: pointer;
    font-size: 13.5px; font-weight: 500; transition: background .15s;
    display: inline-flex; align-items: center; gap: 6px;
}
.btn-primary:hover:not(:disabled) { background: var(--brand-dark); }
.btn-primary:disabled { background: #c4b5fd; cursor: not-allowed; }
.btn-full { width: 100%; justify-content: center; padding: 11px; font-size: 15px; }
.btn-secondary {
    background: white; color: #374151; border: 1px solid var(--border);
    padding: 7px 14px; border-radius: 7px; cursor: pointer; font-size: 13px; font-weight: 500;
    transition: background .15s;
}
.btn-secondary:hover { background: #f9fafb; }
.btn-danger {
    background: #fff; color: #b91c1c; border: 1px solid #fecaca;
    padding: 7px 14px; border-radius: 7px; cursor: pointer; font-size: 13px; font-weight: 500;
    margin-right: auto;
}
.btn-danger:hover { background: #fef2f2; }
.header-actions .btn-danger { margin-right: 0; }
.btn-icon {
    background: white; border: 1px solid var(--border); border-radius: 7px;
    padding: 7px 9px; cursor: pointer; color: var(--text-muted);
    display: inline-flex; align-items: center; transition: background .15s;
}
.btn-icon:hover { background: #f9fafb; color: #374151; }

/* === APP SHELL === */
.app { display: flex; height: 100vh; overflow: hidden; }

/* === SIDEBAR === */
.sidebar {
    width: 225px; flex-shrink: 0;
    background: var(--sidebar-bg); color: rgba(255,255,255,.82);
    display: flex; flex-direction: column; overflow-y: auto;
}
.sidebar-brand { padding: 21px 18px 18px; border-bottom: 1px solid rgba(255,255,255,.14); }
.sidebar-brand .b-name { font-size: 18px; font-weight: 800; color: white; letter-spacing: -.3px; }
.sidebar-brand .b-sub  { font-size: 11px; color: rgba(255,255,255,.58); text-transform: uppercase; letter-spacing: .7px; margin-top: 3px; }

.nav { padding: 12px 0; flex: 1; }
.nav-item {
    display: flex; align-items: center; gap: 11px; min-height: 44px;
    padding: 10px 13px; margin: 3px 10px; border: 1px solid transparent; border-radius: 9px;
    cursor: pointer; color: rgba(255,255,255,.84); font-size: 15px; font-weight: 650;
    transition: background .12s, border-color .12s, color .12s; user-select: none;
}
.nav-item:hover { background: rgba(255,255,255,.11); border-color: rgba(255,255,255,.12); color: white; }
.nav-item.active { background: var(--brand); border-color: rgba(255,255,255,.2); color: white; box-shadow: 0 4px 12px rgba(0,0,0,.14); }
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; opacity: .82; }
.nav-item.active svg { opacity: 1; }
.nav-arrow { margin-left: auto; font-size: 10px; opacity: .45; transition: transform .2s; }
.nav-item.open .nav-arrow { transform: rotate(180deg); }

.nav-sub { padding-left: 43px; overflow: hidden; max-height: 0; transition: max-height .25s ease; }
.nav-sub.open { max-height: 260px; }
.nav-sub a {
    display: flex; align-items: center; min-height: 38px; padding: 8px 11px; margin: 2px 7px 2px 0; border-radius: 7px;
    color: rgba(255,255,255,.7); font-size: 14px; font-weight: 550; cursor: pointer; transition: color .12s, background .12s;
}
.nav-sub a:hover { color: white; background: rgba(255,255,255,.06); }

.nav-divider { border: none; border-top: 1px solid rgba(255,255,255,.1); margin: 8px 0; }
.sidebar-bottom { padding-bottom: 8px; }

/* === MAIN === */
.main { flex: 1; display: flex; flex-direction: column; overflow: hidden; }

/* === TABS === */
.tabs-bar {
    background: white; border-bottom: 1px solid var(--border);
    padding: 0 16px; display: flex; gap: 1px;
    overflow-x: auto; flex-shrink: 0;
}
.tabs-bar::-webkit-scrollbar { height: 3px; }
.tabs-bar::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 2px; }
.tab {
    padding: 11px 12px; border: none; border-bottom: 2.5px solid transparent;
    background: none; cursor: pointer; font-size: 12.5px; color: var(--text-muted);
    white-space: nowrap; display: flex; align-items: center; gap: 5px;
    transition: color .1s; margin-bottom: -1px;
}
.tab:hover { color: #374151; }
.tab.active { color: var(--brand); border-bottom-color: var(--brand); font-weight: 500; }
.tab-badge {
    background: #e5e7eb; color: var(--text-muted);
    border-radius: 10px; padding: 1px 6px; font-size: 11px; font-weight: 600;
    min-width: 20px; text-align: center;
}
.tab.active .tab-badge { background: var(--brand-light); color: var(--brand); }

/* === TOOLBAR === */
.toolbar {
    background: white; border-bottom: 1px solid var(--border);
    padding: 10px 16px; display: flex; align-items: center; gap: 10px; flex-shrink: 0;
}
.search-box {
    padding: 7px 10px 7px 32px; border: 1px solid var(--border); border-radius: 7px;
    font-size: 13px; width: 220px; outline: none;
    background: #f9fafb url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E") 9px center no-repeat;
    transition: border-color .15s;
}
.search-box:focus { border-color: var(--brand); background-color: white; outline: none; }
.toolbar-right { margin-left: auto; display: flex; gap: 8px; align-items: center; }

/* === TABLE === */
.table-wrap { flex: 1; overflow: auto; }
.projects-table { width: 100%; border-collapse: collapse; background: white; min-width: 1540px; }
.projects-table thead th {
    background: #f9fafb; border-bottom: 2px solid var(--border);
    padding: 11px 12px; text-align: center; font-weight: 700;
    font-size: 12px; color: #475569; text-transform: uppercase;
    letter-spacing: .3px; white-space: nowrap;
    position: sticky; top: 0; z-index: 2;
}
.projects-table thead th:first-child,
.projects-table tbody td:first-child { padding-left: 16px; width: 38px; }
.projects-table thead th:nth-child(2),
.projects-table tbody td:nth-child(2) { width: 36px; color: var(--text-muted); font-size: 12px; }
.projects-table tbody tr { border-bottom: 1px solid #f3f4f6; transition: background .1s; }
.projects-table tbody tr:hover { background: #faf8ff; }
.projects-table tbody td { padding: 11px 12px; text-align: center; vertical-align: middle; font-size: 13.5px; line-height: 1.4; }

.proj-num { color: #5b21b6; font-weight: 750; font-size: 13.5px; cursor: pointer; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.proj-num:hover { color: #4c1d95; text-decoration-thickness: 2px; }

.sort-header { display: inline-flex; align-items: center; gap: 5px; border: 0; padding: 2px 0; background: transparent; color: inherit; font: inherit; font-weight: inherit; text-transform: inherit; letter-spacing: inherit; cursor: pointer; }
.sort-header:hover,.sort-header.active { color: #5b21b6; }
.sort-header:focus-visible { outline: 2px solid #8b5cf6; outline-offset: 3px; border-radius: 2px; }
.sort-indicator { display: inline-flex; align-items: center; justify-content: center; min-width: 12px; color: #94a3b8; font-size: 11px; }
.sort-header.active .sort-indicator { color: #6d28d9; }

.customer-main { font-weight: 500; font-size: 12.5px; color: #1f2937; }
.customer-sub  { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }

.lang-pair { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.lang-row  { display: flex; align-items: center; justify-content: center; gap: 5px; font-size: 12px; color: #374151; }
.lang-flag { font-size: 14px; line-height: 1; }

.deadline-normal  { font-size: 12.5px; color: #374151; }
.deadline-today   { font-size: 12.5px; color: #f97316; font-weight: 500; }
.deadline-overdue { font-size: 12.5px; color: #dc2626; font-weight: 700; }

.status-badge { font-size: 12px; font-weight: 500; color: #4b5563; }

.comment-btn {
    background: none; border: none; cursor: pointer; color: #d1d5db;
    padding: 3px; border-radius: 4px; display: flex; align-items: center;
    transition: color .1s, background .1s;
}
.comment-btn:hover { color: var(--brand); background: var(--brand-light); }

.price-cell  { text-align: right; font-size: 12.5px; white-space: nowrap; }
.margin-cell { text-align: right; font-size: 12px; color: var(--text-muted); white-space: nowrap; }
.margin-cell .margin-value,.margin-cell .margin-percent { color: #172033; font-size: 12.5px; font-weight: 700; }
.margin-cell .margin-separator { color: #94a3b8; padding: 0 3px; }
.profit-cell,.margin-percent-cell { text-align: right; color: #172033; font-size: 13.5px; font-weight: 750; white-space: nowrap; }

.state-row td { text-align: center; padding: 60px 20px; color: #9ca3af; font-size: 14px; }

input[type="checkbox"] { width: 14px; height: 14px; cursor: pointer; accent-color: var(--brand); }

/* === MODAL === */
.modal-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,.45);
    display: flex; align-items: center; justify-content: center; z-index: 1000;
}
.modal {
    background: white; border-radius: 12px; width: 760px; max-width: 95vw;
    max-height: 90vh; display: flex; flex-direction: column;
    box-shadow: 0 24px 64px rgba(0,0,0,.3);
}
.modal-header {
    padding: 18px 24px; border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between; flex-shrink: 0;
}
.modal-header h3 { font-size: 16px; font-weight: 600; }
.modal-close {
    background: none; border: none; font-size: 22px; cursor: pointer;
    color: var(--text-muted); line-height: 1; padding: 2px 6px; border-radius: 4px;
}
.modal-close:hover { background: #f3f4f6; color: #374151; }
.modal-body { padding: 20px 24px; overflow-y: auto; flex: 1; }
.modal-footer {
    padding: 14px 24px; border-top: 1px solid var(--border);
    display: flex; justify-content: flex-end; gap: 10px; flex-shrink: 0;
}
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 20px; }
.form-grid .field-full { grid-column: 1 / -1; }
.field select {
    width: 100%; padding: 9px 12px; border: 1px solid var(--border);
    border-radius: 7px; font-size: 13.5px; color: #1f2937; outline: none;
    background: white; transition: border-color .15s;
}
.field select:focus { border-color: var(--brand); }
.field textarea {
    width: 100%; padding: 9px 12px; border: 1px solid var(--border);
    border-radius: 7px; font-size: 13.5px; color: #1f2937; outline: none;
    resize: vertical; min-height: 72px; transition: border-color .15s;
}
.field textarea:focus { border-color: var(--brand); }
.field input[type="datetime-local"],
.field input[type="date"],
.field input[type="number"] {
    width: 100%; padding: 9px 12px; border: 1px solid var(--border);
    border-radius: 7px; font-size: 13.5px; color: #1f2937; outline: none;
}
.field input[type="datetime-local"]:focus,
.field input[type="date"]:focus,
.field input[type="number"]:focus { border-color: var(--brand); }
.checkbox-row { display: flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; }
.checkbox-row input[type="checkbox"] { width: 15px; height: 15px; }
.flags-row { display: flex; gap: 20px; flex-wrap: wrap; }

/* === RESOURCES === */
.resource-filter-panel { background: white; border-bottom: 1px solid var(--border); padding: 10px 16px; flex-shrink: 0; }
.resource-filter-row { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.resource-filter-row.secondary { margin-top: 8px; }
.resource-search { width: 290px; }
.toolbar-select { padding: 7px 10px; border: 1px solid var(--border); border-radius: 7px; background: white; color: #374151; font-size: 12.5px; min-width: 145px; }
.approved-only { padding: 6px 3px; white-space: nowrap; }
.resources-list-table { min-width: 1480px; }
.resources-list-table th:nth-child(2) { min-width: 220px; }
.resources-list-table th:nth-child(3) { min-width: 240px; }
.resources-list-table th:nth-child(4) { min-width: 250px; }
.resources-list-table th:nth-child(5), .resources-list-table th:nth-child(6) { min-width: 220px; }
.resource-linkedin { display: inline-block; margin-top: 4px; font-size: 11.5px; color: #2563eb; }
.resource-pairs { display: grid; grid-template-columns: minmax(70px,1fr) 18px minmax(90px,1.3fr); align-items: center; gap: 5px; }
.resource-pairs > span, .chip-list { display: flex; gap: 4px; flex-wrap: wrap; }
.mini-chip { display: inline-block; padding: 2px 6px; border-radius: 10px; background: #f3f4f6; color: #4b5563; font-size: 10.5px; line-height: 1.4; }
.more-chip { background: var(--brand-light); color: var(--brand-dark); }
.pagination-bar { background: white; border-top: 1px solid var(--border); padding: 9px 16px; display: flex; justify-content: flex-end; align-items: center; gap: 12px; flex-shrink: 0; }
.pagination-bar span { min-width: 130px; text-align: center; color: var(--text-muted); }
.resource-tabs { overflow-x: auto; }
.resource-summary { display: grid; grid-template-columns: repeat(4,minmax(150px,1fr)); gap: 12px; margin-bottom: 16px; }
.resource-summary > div { background: white; border: 1px solid var(--border); border-radius: 9px; padding: 13px 15px; }
.resource-summary span, .resource-summary small { display: block; color: var(--text-muted); font-size: 11.5px; }
.resource-summary strong { display: block; margin: 5px 0 3px; font-size: 16px; color: #1f2937; }
.two-column-pane { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.action-title { display: flex; align-items: center; justify-content: space-between; }
.data-card-list { display: flex; flex-direction: column; gap: 8px; }
.data-card { border: 1px solid var(--border); border-radius: 8px; padding: 11px 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.data-card strong, .data-card small { display: block; }
.data-card small { color: var(--text-muted); margin-top: 3px; }
.info-banner { background: #f5f3ff; color: #5b21b6; border: 1px solid #ddd6fe; border-radius: 8px; padding: 11px 13px; margin-top: 14px; }
.privacy-label { margin-left: 8px; padding: 2px 7px; border-radius: 10px; color: #991b1b; background: #fee2e2; font-size: 10.5px; font-weight: 500; }
.notes-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.private-note { border-left: 3px solid #ef4444; background: #fff7f7; padding: 10px 12px; border-radius: 0 7px 7px 0; }
.private-note strong { margin-right: 8px; }.private-note span,.private-note small { color: var(--text-muted); font-size: 11px; }.private-note p { margin: 5px 0; white-space: pre-wrap; }
.button-row { margin-top: 16px; display: flex; gap: 8px; }
.blind-cv-modal { width: 850px; }
.blind-cv-preview { background: white; border: 1px solid #dbe4e8; padding: 34px 42px; max-width: 760px; margin: auto; color: #17324a; box-shadow: 0 4px 18px rgba(15,23,42,.08); }
.cv-brand { border-bottom: 4px solid #13a8d3; padding-bottom: 10px; display: flex; justify-content: space-between; align-items: center; }
.cv-brand strong { font-size: 18px; color: #0f2740; }.cv-brand span { color: #64748b; text-transform: uppercase; letter-spacing: .6px; font-size: 11px; }
.blind-cv-preview h2 { font-size: 24px; margin: 24px 0 10px; }.blind-cv-preview h3 { color: #0f2740; margin: 21px 0 7px; font-size: 14px; border-bottom: 1px solid #dbe4e8; padding-bottom: 5px; }
.blind-cv-preview p,.blind-cv-preview li { line-height: 1.55; }.blind-cv-preview ul { padding-left: 20px; }.cv-meta { display: flex; gap: 20px; flex-wrap: wrap; color: #475569; }.cv-footer { border-top: 1px solid #dbe4e8; margin-top: 25px; padding-top: 9px; color: #64748b; font-size: 10.5px; text-align: center; }

@media (max-width: 1050px) {
    .resource-summary { grid-template-columns: repeat(2,1fr); }
    .two-column-pane { grid-template-columns: 1fr; }
}

/* === PROJECT PAGE === */
.proj-header {
    background: white; border-bottom: 1px solid var(--border);
    padding: 12px 20px; display: flex; align-items: center;
    gap: 16px; flex-shrink: 0;
}
.proj-header-title { font-size: 14px; font-weight: 600; color: #1f2937; }
.proj-header-right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.proj-tabs {
    background: white; border-bottom: 1px solid var(--border);
    padding: 0 20px; display: flex; gap: 4px; flex-shrink: 0;
}
.proj-tab {
    padding: 11px 18px; border: none; border-bottom: 2.5px solid transparent;
    background: none; cursor: pointer; font-size: 13.5px; font-weight: 500;
    color: var(--text-muted); transition: color .1s; margin-bottom: -1px;
}
.proj-tab:hover { color: #374151; }
.proj-tab.active { color: var(--brand); border-bottom-color: var(--brand); }
.proj-body { flex: 1; overflow: auto; padding: 20px; }
.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* General tab form */
.section-card {
    background: white; border: 1px solid var(--border);
    border-radius: 10px; padding: 20px; margin-bottom: 16px;
}
.section-title {
    font-size: 13px; font-weight: 600; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: .4px; margin-bottom: 16px;
}

/* Scoop tab */
.scoop-layout { display: grid; grid-template-columns: 1fr 320px; gap: 16px; }
.scoop-main {}
.scoop-sidebar {}
.scoop-header-bar {
    background: white; border: 1px solid var(--border); border-radius: 10px;
    padding: 14px 18px; margin-bottom: 12px;
    display: flex; align-items: center; gap: 16px;
}
.scoop-id { font-size: 13px; font-weight: 600; color: #374151; }
.scoop-name { font-size: 13px; color: var(--text-muted); }
.scoop-amount { margin-left: auto; font-size: 13px; font-weight: 600; color: #1f2937; }
.line-items-card {
    background: white; border: 1px solid var(--border);
    border-radius: 10px; overflow: hidden; margin-bottom: 12px;
}
.line-items-table { width: 100%; border-collapse: collapse; }
.line-items-table th {
    background: #f9fafb; padding: 9px 12px; text-align: left;
    font-size: 12px; font-weight: 600; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: .3px; border-bottom: 1px solid var(--border);
}
.line-items-table td { padding: 10px 12px; border-bottom: 1px solid #f3f4f6; vertical-align: middle; }
.line-items-table td input {
    width: 100%; padding: 6px 8px; border: 1px solid var(--border);
    border-radius: 5px; font-size: 13px; outline: none;
}
.line-items-table td input:focus { border-color: var(--brand); }
.line-items-table td select {
    width: 100%; padding: 6px 8px; border: 1px solid var(--border);
    border-radius: 5px; font-size: 13px; outline: none; background: white;
}
.add-line-btn {
    padding: 8px 14px; background: none; border: none; cursor: pointer;
    color: var(--brand); font-size: 13px; font-weight: 500;
    display: flex; align-items: center; gap: 5px;
}
.add-line-btn:hover { text-decoration: underline; }
.del-line-btn {
    background: none; border: none; cursor: pointer; color: #ef4444;
    padding: 4px; border-radius: 4px; display: flex; align-items: center;
}
.del-line-btn:hover { background: #fef2f2; }
.info-label {
    font-size: 11.5px; font-weight: 600; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: .3px; margin-bottom: 5px;
    margin-top: 14px;
}
.info-label:first-child { margin-top: 0; }
.save-bar {
    padding: 14px 20px; background: white; border-top: 1px solid var(--border);
    display: flex; align-items: center; gap: 10px; flex-shrink: 0;
}
.editing-badge {
    font-size: 12px; color: #16a34a; font-weight: 500;
    display: flex; align-items: center; gap: 5px;
}
.badge-urgent  { background: #fef2f2; color: #dc2626; border-radius: 5px; padding: 2px 8px; font-size: 11.5px; font-weight: 600; }
.badge-upcoming{ background: #eff6ff; color: #2563eb; border-radius: 5px; padding: 2px 8px; font-size: 11.5px; font-weight: 600; }
.badge-onhold  { background: #f3f4f6; color: #6b7280; border-radius: 5px; padding: 2px 8px; font-size: 11.5px; font-weight: 600; }

/* === SCROLLBARS === */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #9ca3af; }
.auth-link {
    display: block;
    width: 100%;
    margin-top: 14px;
    padding: 4px;
    border: 0;
    background: transparent;
    color: #6d28d9;
    cursor: pointer;
    font: inherit;
    text-align: center;
}

.auth-link:hover,
.auth-link:focus-visible {
    text-decoration: underline;
}

.auth-message {
    margin: 12px 0;
    font-size: 13px;
    line-height: 1.45;
}

.auth-message.success {
    color: #047857;
}

.field-help {
    display: block;
    margin-top: 6px;
    color: #64748b;
    font-size: 12px;
}

/* === OPERATIONAL MODULES === */
.module-header {
    min-height: 76px; padding: 15px 20px; background: white;
    border-bottom: 1px solid var(--border); display: flex;
    align-items: center; justify-content: space-between; gap: 20px; flex-shrink: 0;
}
.module-header h1 { font-size: 19px; line-height: 1.25; color: #111827; }
.module-header p { margin-top: 4px; color: var(--text-muted); font-size: 12.5px; }
.header-actions { display: flex; align-items: center; gap: 12px; }
.save-message { color: #15803d; font-size: 12.5px; }
.toolbar-select {
    padding: 7px 30px 7px 10px; border: 1px solid var(--border); border-radius: 7px;
    background: white; color: #374151; font-size: 13px; outline: none;
}
.toolbar-select:focus { border-color: var(--brand); }
.record-count, .muted { color: var(--text-muted); font-size: 12.5px; }
.module-table { width: 100%; border-collapse: collapse; background: white; }
.module-table thead th {
    padding: 10px 12px; text-align: left; color: var(--text-muted); font-size: 11.5px;
    font-weight: 600; text-transform: uppercase; letter-spacing: .3px;
    background: #f9fafb; border-bottom: 1px solid var(--border); white-space: nowrap;
}
.module-table tbody td { padding: 11px 12px; border-bottom: 1px solid #f3f4f6; vertical-align: top; }
.module-table tbody tr:last-child td { border-bottom: none; }
.module-table tbody tr:hover { background: #faf8ff; }
.clients-list-table { min-width: 900px; }
.clickable-row { cursor: pointer; }
.code-badge {
    display: inline-flex; padding: 3px 7px; border-radius: 5px; background: #f3f4f6;
    color: #374151; font: 600 11.5px ui-monospace, SFMono-Regular, Menlo, monospace;
}
.pill {
    display: inline-flex; align-items: center; border-radius: 999px; padding: 3px 8px;
    background: #f3f4f6; color: #4b5563; font-size: 11.5px; font-weight: 600; white-space: nowrap;
}
.pill-green { background: #ecfdf5; color: #047857; }
.pill-amber { background: #fffbeb; color: #b45309; }
.pill-red { background: #fef2f2; color: #b91c1c; }
.pill-blue { background: #eff6ff; color: #1d4ed8; }
.modal-small { width: 590px; }
.modal-wide { width: 940px; }
.project-name-preview {
    display: flex; align-items: center; gap: 14px; padding: 11px 14px;
    margin-bottom: 16px; border: 1px solid #c4b5fd; border-radius: 8px;
    background: #faf8ff;
}
.project-name-preview span { color: var(--text-muted); font-size: 11.5px; text-transform: uppercase; }
.project-name-preview strong { color: var(--brand-dark); font: 600 13px ui-monospace, SFMono-Regular, Menlo, monospace; }
.breadcrumbs { display: flex; gap: 8px; color: var(--text-muted); font-size: 11.5px; margin-bottom: 5px; }
.breadcrumbs a { color: #2563eb; }
.record-tabs {
    display: flex; align-items: flex-end; gap: 2px; padding: 0 20px; background: white;
    border-bottom: 1px solid var(--border); flex-shrink: 0; overflow-x: auto;
}
.record-tab {
    border: 0; border-bottom: 2.5px solid transparent; background: transparent;
    padding: 11px 15px; margin-bottom: -1px; color: var(--text-muted); cursor: pointer;
    font-size: 13px; display: flex; align-items: center; gap: 7px; white-space: nowrap;
}
.record-tab.active { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }
.record-body { flex: 1; overflow: auto; padding: 20px; }
.record-pane { display: none; }
.record-pane.active { display: block; }
.form-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid .field-span-2 { grid-column: span 2; }
.pane-toolbar {
    display: flex; align-items: center; justify-content: space-between; gap: 20px;
    margin: 0 0 14px;
}
.pane-toolbar h2 { font-size: 17px; color: #111827; }
.pane-toolbar p { margin-top: 4px; color: var(--text-muted); font-size: 12.5px; }
.table-card { padding: 0; overflow: hidden; }
.tag-list { display: flex; flex-wrap: wrap; gap: 4px; max-width: 360px; }
.tag { display: inline-flex; padding: 2px 6px; border-radius: 4px; background: var(--brand-light); color: var(--brand-dark); font-size: 10.5px; }
.checkbox-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px 16px; padding: 11px; border: 1px solid var(--border); border-radius: 7px; background: #fafafa; }
.language-checkbox-grid { max-height: 210px; overflow-y: auto; align-content: start; }
.inline-check { min-height: 39px; margin-top: 22px; }
.table-link { color: #5b21b6; font-weight: 700; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.table-link:hover { color: #4c1d95; text-decoration-thickness: 2px; }
.price-card-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 16px; }
.rate-card-list { display: flex; flex-direction: column; gap: 7px; }
.rate-card-choice {
    width: 100%; border: 1px solid var(--border); background: white; border-radius: 8px;
    padding: 10px 11px; display: flex; justify-content: space-between; gap: 10px;
    text-align: left; cursor: pointer; color: #374151;
}
.rate-card-choice:hover { border-color: #c4b5fd; }
.rate-card-choice.active { border-color: var(--brand); background: #faf8ff; box-shadow: 0 0 0 2px rgba(124,58,237,.08); }
.rate-card-choice span { display: flex; flex-direction: column; gap: 3px; }
.rate-card-choice span:last-child { align-items: flex-end; }
.rate-card-choice strong { font-size: 12.5px; font-weight: 600; }
.rate-card-choice small { color: var(--text-muted); font-size: 10.5px; }
.price-lines-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.price-lines-header .section-title { margin-bottom: 3px; }
.table-scroll { overflow: auto; margin: 0 -20px -20px; }
.compact-table { min-width: 760px; }
.compact-table td, .compact-table th { padding-left: 10px; padding-right: 10px; }
.number-cell { text-align: right; white-space: nowrap; }
.empty-compact { padding: 18px 8px; color: #9ca3af; text-align: center; }
.quotes-table { min-width: 1050px; }
.quote-totals {
    display: flex; justify-content: flex-end; gap: 24px; padding: 16px 20px;
    background: white; border: 1px solid var(--border); border-radius: 10px;
}
.quote-totals > div { min-width: 125px; display: flex; flex-direction: column; gap: 5px; }
.quote-totals span { color: var(--text-muted); font-size: 11.5px; text-transform: uppercase; }
.quote-totals strong { font-size: 15px; text-align: right; }
.quote-total-final { padding-left: 22px; border-left: 1px solid var(--border); }
.quote-total-final strong { color: var(--brand-dark); font-size: 18px; }
.input-action { display: flex; gap: 6px; }
.input-action input { flex: 1; min-width: 0; }
.input-action .btn-secondary { white-space: nowrap; }
.financial-summary {
    display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px;
    margin-bottom: 16px;
}
.financial-summary > div {
    background: white; border: 1px solid var(--border); border-radius: 10px;
    padding: 14px 16px; display: flex; flex-direction: column; gap: 5px;
}
.financial-summary span { color: var(--text-muted); font-size: 11.5px; text-transform: uppercase; }
.financial-summary strong { font-size: 17px; color: #111827; }
.financial-summary small { color: var(--text-muted); }

@media (max-width: 1050px) {
    .form-grid-3 { grid-template-columns: 1fr 1fr; }
    .price-card-layout { grid-template-columns: 1fr; }
    .checkbox-grid { grid-template-columns: 1fr 1fr; }
    .financial-summary { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 760px) {
    .sidebar { width: 195px; }
    .module-header { align-items: flex-start; }
    .form-grid, .form-grid-3 { grid-template-columns: 1fr; }
    .form-grid .field-span-2, .form-grid .field-full { grid-column: 1; }
    .checkbox-grid { grid-template-columns: 1fr; }
}

/* === JOB OFFERS & SUPPLIER PO === */
.job-summary {
    display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px;
    margin-bottom: 16px;
}
.job-summary > div {
    background: white; border: 1px solid var(--border); border-radius: 10px;
    padding: 14px 16px; display: flex; flex-direction: column; gap: 7px;
}
.job-summary span:first-child { color: var(--text-muted); font-size: 11.5px; text-transform: uppercase; }
.job-summary strong { font-size: 14px; color: #111827; }
.candidate-search-row { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.candidate-results {
    border: 1px solid var(--border); border-radius: 8px; overflow: auto;
    max-height: 310px; margin: 14px 0 18px;
}
.candidate-row {
    display: grid; grid-template-columns: 20px minmax(0,1fr) auto; align-items: center;
    gap: 10px; padding: 11px 13px; border-bottom: 1px solid #f3f4f6;
    cursor: pointer; background: white;
}
.candidate-row:last-child { border-bottom: 0; }
.candidate-row:hover { background: #faf8ff; }
.candidate-row:has(input:checked) { background: #f5f3ff; box-shadow: inset 3px 0 var(--brand); }
.candidate-row > span:nth-child(2) { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.candidate-row strong { font-size: 12.5px; }
.candidate-row small { color: var(--text-muted); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.candidate-warning { background: #fffdf7; }
.offer-terms-card { background: #fafafa; margin-bottom: 0; }
.warning-text { color: #b45309; font-size: 10.5px; margin-top: 4px; }
.table-actions { display: flex; flex-wrap: wrap; gap: 5px; min-width: 165px; }
.table-action { border: 0; background: transparent; color: #2563eb; cursor: pointer; font-size: 11.5px; padding: 2px 3px; }
.table-action:hover { text-decoration: underline; }
.table-action.success { color: #047857; }
.table-action.danger { color: #b91c1c; }
.po-lines-table input,.po-lines-table select {
    width: 100%; min-width: 80px; padding: 6px 7px; border: 1px solid var(--border);
    border-radius: 5px; background: white; font-size: 12px;
}
.po-lines-table td:first-child input { min-width: 240px; }
.project-price-lines-card { overflow-x: auto; }
.project-price-lines-table { min-width: 1120px; }
.project-price-lines-table .scope-description { min-width: 250px; }
.project-price-lines-table .scope-quantity { min-width: 105px; }
.project-price-lines-table .scope-unit { min-width: 125px; }
.project-price-lines-table .scope-unit-price,
.project-price-lines-table .scope-amount { min-width: 105px; text-align: right; }
.project-price-lines-table .scope-source { min-width: 105px; }
.project-price-lines-table .scope-reason { min-width: 150px; margin-top: 5px; font-size: 11px; }
.project-price-lines-table .scope-adjustment { min-width: 120px; }
.project-price-lines-table input:disabled,
.project-price-lines-table select:disabled { background: #f8fafc; color: #64748b; }
.project-price-lines-table .scope-total-row td { background: #f5f3ff; }
.project-price-lines-table .del-line-btn { justify-content: center; font-size: 16px; }
.po-totals {
    display: flex; justify-content: flex-end; gap: 24px; background: white;
    border: 1px solid var(--border); border-radius: 10px; padding: 15px 18px;
    margin: 12px 0 16px;
}
.po-totals > div { min-width: 130px; display: flex; flex-direction: column; gap: 4px; text-align: right; }
.po-totals span { color: var(--text-muted); font-size: 11px; text-transform: uppercase; }
.po-totals strong { font-size: 15px; }
.po-totals > div:last-child { border-left: 1px solid var(--border); padding-left: 22px; }
.po-totals > div:last-child strong { color: var(--brand-dark); font-size: 18px; }
.version-list { display: flex; flex-direction: column; gap: 7px; }
.version-row { display: grid; grid-template-columns: minmax(180px,.8fr) minmax(220px,1fr) minmax(240px,1.2fr); gap: 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 7px; }
.version-row span { color: var(--text-muted); font-size: 12px; }
.version-row-button { width: 100%; background: white; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.version-row-button:hover { border-color: #a78bfa; background: #faf9ff; }
.version-row-button:focus-visible { outline: 3px solid rgba(109,40,217,.22); outline-offset: 2px; }
.version-row-button.selected { border-color: #7c3aed; background: #f5f3ff; box-shadow: 0 0 0 1px #7c3aed; }
.version-row-button span strong { color: #2e1065; font-size: 13px; }
.po-version-preview { margin-top: 16px; overflow-x: auto; border-top: 2px solid #7c3aed; padding-top: 16px; }
.po-version-preview-head { display: flex; justify-content: space-between; gap: 20px; margin-bottom: 12px; }
.po-version-preview-head > div { display: flex; flex-direction: column; gap: 3px; }
.po-version-preview-head > div:last-child { text-align: right; }
.po-version-preview-head span { color: var(--text-muted); font-size: 11px; font-weight: 700; letter-spacing: .25px; text-transform: uppercase; }
.po-version-preview-head strong { color: #2e1065; font-size: 16px; }
.po-version-preview-total { display: flex; justify-content: flex-end; gap: 20px; align-items: baseline; padding: 12px 4px 2px; color: var(--text-muted); }
.po-version-preview-total strong { color: #2e1065; font-size: 17px; }
.history-version-row td:first-child { font-weight: 700; color: #4c1d95; }
.jobs-rollup { display: flex; justify-content: flex-end; align-items: baseline; gap: 14px; padding: 14px 16px; border-top: 3px solid #6d28d9; background: #f5f3ff; color: #64748b; }
.jobs-rollup span { font-size: 12px; font-weight: 800; letter-spacing: .2px; text-transform: uppercase; }
.jobs-rollup strong { color: #2e1065; font-size: 18px; }
.jobs-rollup small { color: #64748b; }
.jobs-table { min-width: 1080px; }
.jobs-table thead th { padding-top: 13px; padding-bottom: 13px; font-size: 12.5px; }
.jobs-table tbody td { padding-top: 15px; padding-bottom: 15px; font-size: 14px; }
.jobs-table tbody tr:nth-child(even) { background: #fcfcfe; }
.jobs-table tbody tr:hover { background: #f5f3ff; }
.table-link.job-name-link { display: inline-block; color: #4c1d95; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 15px; font-weight: 800; letter-spacing: .1px; white-space: nowrap; }
.table-link.resource-name-link,.table-link.po-link { font-size: 14px; }
.supplier-cost-header,.supplier-cost-cell { text-align: center !important; }
.supplier-cost-cell { color: #172033; font-size: 14px !important; font-weight: 750; white-space: nowrap; }
@media (max-width: 850px) { .version-row { grid-template-columns: 1fr; gap: 5px; } .po-version-preview-head { align-items: flex-start; flex-direction: column; } .po-version-preview-head > div:last-child { text-align: left; } }
.po-document {
    background: white; color: #111827; padding: 38px; border: 1px solid var(--border);
    border-radius: 10px; margin-top: 16px;
}
.po-doc-head { display: flex; justify-content: space-between; border-bottom: 3px solid var(--sidebar-bg); padding-bottom: 18px; margin-bottom: 22px; }
.po-doc-head > div { display: flex; flex-direction: column; gap: 4px; }
.po-doc-head strong { font-size: 19px; color: var(--sidebar-bg); }
.po-doc-head h2 { color: var(--brand-dark); }
.po-doc-head > div:last-child { text-align: right; }
.po-doc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; margin-bottom: 24px; }
.po-doc-grid > div { display: flex; flex-direction: column; gap: 4px; }
.po-doc-grid small { color: var(--text-muted); text-transform: uppercase; }
.po-document table { width: 100%; border-collapse: collapse; margin: 10px 0 20px; }
.po-document th,.po-document td { padding: 9px; border-bottom: 1px solid var(--border); text-align: left; }
.po-document th:last-child,.po-document td:last-child { text-align: right; }
.po-doc-total { display: flex; justify-content: flex-end; gap: 22px; align-items: baseline; }
.po-doc-total strong { font-size: 17px; color: var(--brand-dark); }
.po-doc-note { margin-top: 30px; padding-top: 14px; border-top: 1px solid var(--border); color: var(--text-muted); font-size: 11px; line-height: 1.5; }

/* === RESOURCE RATE CARDS === */
.compact-rate-table { margin-top: 8px; }
.compact-rate-table input { width: 120px; padding: 7px 8px; border: 1px solid var(--border); border-radius: 6px; }
.compact-rate-table .cat-calculated { font-weight: 600; color: var(--brand-dark); }
.rate-base-row { background: #faf8ff; }
.rate-base-row td { border-top: 2px solid #ddd6fe; }
.rate-band-row td { color: #4b5563; }
.rate-band-row td:nth-child(3) { padding-left: 28px; }
.rate-source-label { display: inline-block; max-width: 170px; color: #5b6472; font-size: 12px; line-height: 1.25; }

@media (max-width: 1050px) { .job-summary { grid-template-columns: 1fr 1fr; } }
@media (max-width: 760px) { .job-summary { grid-template-columns: 1fr; } .candidate-search-row { align-items: stretch; flex-direction: column; } }

@media print {
    body.printing-po * { visibility: hidden !important; }
    body.printing-po #poPrintArea, body.printing-po #poPrintArea * { visibility: visible !important; }
    body.printing-po #poPrintArea { position: absolute; inset: 0; border: 0; margin: 0; padding: 20mm; }
}

/* === QUICK NAVIGATION + READABILITY (014) === */
body { font-size: 14.5px; line-height: 1.45; color: #182230; }
.quick-nav { position: relative; z-index: 90; flex-shrink: 0; padding: 10px 20px; background: #ffffff; border-bottom: 1px solid #d8dee8; }
.quick-nav-shell { height: 42px; max-width: 780px; margin: 0 auto; display: flex; align-items: center; gap: 10px; padding: 0 12px; background: #f8fafc; border: 1px solid #cbd5e1; border-radius: 10px; box-shadow: 0 1px 2px rgba(15,23,42,.04); }
.quick-nav-shell:focus-within { background: #fff; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(124,58,237,.14); }
.quick-nav-icon { color: #64748b; font-size: 23px; line-height: 1; transform: rotate(-15deg); }
.quick-nav-shell input { flex: 1; min-width: 0; height: 38px; padding: 0; border: 0; outline: 0; background: transparent; color: #111827; font-size: 14.5px; }
.quick-nav-shell input::placeholder { color: #64748b; }
.quick-nav-shell kbd { padding: 2px 6px; border: 1px solid #cbd5e1; border-bottom-width: 2px; border-radius: 5px; background: #fff; color: #64748b; font: 11px ui-monospace,monospace; }
.quick-nav-results { position: absolute; top: 58px; left: 50%; transform: translateX(-50%); width: min(780px,calc(100% - 40px)); max-height: min(520px,70vh); overflow-y: auto; background: #fff; border: 1px solid #cbd5e1; border-radius: 11px; box-shadow: 0 18px 44px rgba(15,23,42,.18); }
.quick-nav-caption { padding: 10px 13px 7px; color: #64748b; font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.quick-nav-result { display: grid; grid-template-columns: 64px minmax(0,1fr); gap: 11px; align-items: center; padding: 11px 13px; border-top: 1px solid #eef2f7; }
.quick-nav-result:hover,.quick-nav-result.active { background: #f5f3ff; }
.quick-nav-kind { color: #6d28d9; font-size: 11px; font-weight: 800; text-transform: uppercase; }
.quick-nav-copy { display: flex; min-width: 0; flex-direction: column; gap: 2px; }
.quick-nav-copy strong { overflow: hidden; color: #111827; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.quick-nav-copy small { overflow: hidden; color: #64748b; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.quick-nav-empty { padding: 24px 14px; color: #64748b; text-align: center; }

.section-card { border-color: #d8dee8; box-shadow: 0 1px 2px rgba(15,23,42,.025); }
.section-title { color: #475569; font-size: 12.5px; font-weight: 750; }
.field label { color: #253247; font-size: 13px; font-weight: 650; }
.field input,.field select,.field textarea,.toolbar-select { min-height: 41px; border-color: #cbd5e1; color: #111827; font-size: 14px; }
.field textarea { line-height: 1.5; }
.field input:focus,.field select:focus,.field textarea:focus,.toolbar-select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(124,58,237,.12); outline: none; }
.module-header h1 { font-size: 21px; }
.module-header p,.record-count,.muted { font-size: 13px; }
.module-table thead th { padding: 11px 12px; color: #475569; font-size: 12px; font-weight: 750; background: #f1f5f9; }
.module-table tbody td { padding: 12px; border-bottom-color: #e8edf3; font-size: 13.5px; vertical-align: middle; }
.module-table tbody tr:hover { background: #f8f7ff; }
.table-card { overflow-x: auto; }
.table-link { border: 0; padding: 0; background: transparent; color: #5b21b6; font: inherit; font-weight: 650; cursor: pointer; text-align: left; }
.table-link:hover { text-decoration: underline; }
.inline-number,.inline-quantity { width: 116px; min-height: 38px; padding: 7px 9px; border: 1px solid #94a3b8; border-radius: 7px; background: #fff; color: #111827; font-size: 14px; text-align: right; }
.inline-number:focus,.inline-quantity:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(124,58,237,.13); outline: none; }
.scope-line-amount { font-weight: 650; }
.scope-total-row td { padding-top: 16px !important; padding-bottom: 16px !important; border-top: 3px solid #6d28d9 !important; background: #f5f3ff; color: #2e1065; font-size: 14px !important; font-weight: 800; }
.scope-total-row #scopeInlineTotal { font-size: 17px !important; white-space: nowrap; }
.project-result-bar { display: grid; grid-template-columns: repeat(4,minmax(145px,1fr)); gap: 1px; border-top: 1px solid #ddd6fe; background: #ddd6fe; }
.project-result-bar > div { display: flex; flex-direction: column; gap: 4px; padding: 12px 16px; background: #faf9ff; text-align: right; }
.project-result-bar span { color: #64748b; font-size: 11px; font-weight: 700; letter-spacing: .25px; text-transform: uppercase; }
.project-result-bar strong { color: #2e1065; font-size: 15px; white-space: nowrap; }
.project-result-bar > div:nth-child(3) strong,.project-result-bar > div:nth-child(4) strong { color: #6d28d9; font-size: 17px; }
.cat-entry-table { min-width: 650px; }
.cat-entry-table thead th { background: #f1f5f9; color: #475569; font-size: 12px; }
.cat-entry-table tbody td { padding: 10px 11px; border-bottom: 1px solid #e8edf3; }
.cat-grid-total { display: flex; justify-content: flex-end; align-items: baseline; gap: 14px; padding: 15px 16px; border-top: 3px solid #6d28d9; background: #f5f3ff; color: #2e1065; font-weight: 800; }
.cat-grid-total strong { font-size: 18px; }
.financial-summary strong { font-size: 17px; color: #172033; }
@media (max-width: 900px) { .project-result-bar { grid-template-columns: 1fr 1fr; } }
.po-email-status { margin-bottom: 14px; padding: 12px 15px; border: 1px solid var(--border); border-radius: 9px; display: flex; align-items: center; justify-content: space-between; gap: 12px; background: white; }
.po-email-status > div { display: flex; flex-direction: column; gap: 4px; }
.po-email-status strong { font-size: 13px; }
.po-email-status span { font-size: 12px; color: var(--text-muted); }
.po-email-status.email-sent { border-color: #86efac; background: #f0fdf4; }
.po-email-status.email-sent strong { color: #166534; }
.po-email-status.email-failed { border-color: #fecaca; background: #fef2f2; }
.po-email-status.email-failed strong { color: #b91c1c; }
.po-email-status.email-pending { border-color: #fde68a; background: #fffbeb; }
.po-email-status.email-pending strong { color: #92400e; }

/* Update 028: denser, visually grouped operational forms. */
.summary-section-title { display: flex; align-items: baseline; gap: 8px; max-width: 1240px; margin: 2px 0 8px; color: #334155; font-size: 12px; font-weight: 800; letter-spacing: .35px; text-transform: uppercase; }
.summary-section-title small { color: #64748b; font-size: 11px; font-weight: 500; letter-spacing: 0; text-transform: none; }
.compact-financial-summary { grid-template-columns: repeat(4,minmax(175px,270px)); justify-content: start; max-width: 1240px; gap: 10px; }
.compact-financial-summary > div { min-height: 76px; border-color: #cbd5e1; box-shadow: 0 1px 2px rgba(15,23,42,.04); }
.project-total-preview > div { border-color: #c4b5fd; background: #faf9ff; }
.project-total-preview strong { color: #4c1d95; }
.job-summary { max-width: 1240px; }
.job-overview-card { max-width: 1320px; }
.job-form-grid { display: grid; grid-template-columns: repeat(4,minmax(190px,280px)); justify-content: start; gap: 12px; }
.job-form-grid .field,.compact-form-grid .field { margin-bottom: 0; padding: 10px; border: 1px solid #e2e8f0; border-radius: 9px; background: #f8fafc; }
.job-form-grid .field-full { grid-column: 1 / -1; max-width: 1156px; }
.job-form-grid .inline-check { margin-top: 0; align-self: stretch; display: flex; align-items: center; }
.inherited-value { min-height: 41px; display: flex; align-items: center; padding: 9px 12px; border: 1px solid #c4b5fd; border-radius: 7px; background: #f5f3ff; color: #4c1d95; font-size: 14px; font-weight: 750; }
.job-create-modal { width: 820px; }
.rate-card-modal { width: 920px; }
.compact-form-grid { gap: 10px; }
.compact-form-grid .checkbox-grid { background: white; }
.field input[readonly] { border-color: #d8dee8; background: #f1f5f9; color: #475569; }
@media (max-width: 1250px) { .job-form-grid { grid-template-columns: repeat(3,minmax(190px,1fr)); } .job-form-grid .field-full { grid-column: 1 / -1; } }
@media (max-width: 900px) { .job-form-grid,.compact-financial-summary { grid-template-columns: 1fr 1fr; } }
@media (max-width: 650px) { .job-form-grid,.compact-financial-summary { grid-template-columns: 1fr; } }

@media (max-width: 760px) {
    .quick-nav { padding: 8px 12px; }
    .quick-nav-results { top: 54px; width: calc(100% - 24px); }
    .quick-nav-shell kbd { display: none; }
    .quick-nav-result { grid-template-columns: 52px minmax(0,1fr); }
}

/* Update 029: accessible hierarchy, consistent alignment and Settings. */
:where(a,button,input,select,textarea,[tabindex]):focus-visible {
    outline: 3px solid #7c3aed;
    outline-offset: 2px;
    box-shadow: none;
}
.field label { color: #334155; font-weight: 650; line-height: 1.35; }
.field-help { display: block; margin-top: 6px; color: #64748b; font-size: 12px; line-height: 1.45; }
.field-help a { color: #5b21b6; font-weight: 650; text-decoration: underline; text-underline-offset: 2px; }
.field input,.field select,.field textarea { min-height: 42px; border-color: #8793a3; color: #172033; background: #fff; font-size: 14px; }
.field textarea { min-height: 88px; line-height: 1.5; }
.checkbox-row { min-height: 32px; gap: 9px; color: #334155; }
.checkbox-row input { width: 18px; height: 18px; min-height: 18px; accent-color: #7c3aed; }
.btn-primary,.btn-secondary,.btn-danger,.table-action,.modal-close { min-height: 36px; }

#pane-overview { max-width: 1180px; }
.job-summary { width: 100%; max-width: 1180px; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 0; overflow: hidden; border: 1px solid #d7dee8; border-radius: 12px; background: #fff; }
.job-summary > div { min-height: 82px; border: 0; border-right: 1px solid #e2e8f0; border-radius: 0; padding: 16px 18px; background: transparent; box-shadow: none; }
.job-summary > div:last-child { border-right: 0; }
.job-summary span,.compact-financial-summary span { color: #64748b; font-size: 11px; font-weight: 750; letter-spacing: .35px; }
.job-summary strong { color: #172033; font-size: 15px; line-height: 1.35; }
.summary-section-title { max-width: 1180px; margin: 22px 0 9px; color: #334155; font-size: 14px; letter-spacing: 0; text-transform: none; }
.summary-section-title small { margin-left: auto; color: #64748b; font-size: 12px; }
.compact-financial-summary { width: 100%; max-width: 1180px; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 0; overflow: hidden; border: 1px solid #d7dee8; border-radius: 12px; background: #fff; }
.compact-financial-summary > div { min-height: 82px; border: 0; border-right: 1px solid #e2e8f0; border-radius: 0; padding: 16px 18px; background: transparent; box-shadow: none; }
.compact-financial-summary > div:last-child { border-right: 0; }
.compact-financial-summary strong { margin-top: 8px; color: #172033; font-size: 18px; line-height: 1.25; }
.project-total-preview { border-color: #c4b5fd; background: #faf9ff; }
.project-total-preview > div { border-right-color: #ddd6fe; }
.project-total-preview strong { color: #5b21b6; }

.job-overview-card { width: 100%; max-width: 1180px; margin-top: 24px; padding: 0; overflow: hidden; border-color: #cbd5e1; border-radius: 12px; background: #fff; }
.section-card-heading { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px; border-bottom: 1px solid #e2e8f0; background: #fff; }
.section-card-heading h2 { color: #172033; font-size: 18px; line-height: 1.3; }
.section-card-heading p { margin-top: 4px; color: #64748b; font-size: 13px; }
.job-form-sections { padding: 0 24px 24px; }
.job-fieldset,.rate-fieldset { min-width: 0; margin: 0; padding: 22px 0; border: 0; border-bottom: 1px solid #e2e8f0; }
.job-fieldset:last-child,.rate-fieldset:last-of-type { border-bottom: 0; }
.job-fieldset legend,.rate-fieldset legend { padding: 0 0 14px; color: #334155; font-size: 13px; font-weight: 800; letter-spacing: .15px; }
.job-field-grid { display: grid; gap: 18px; align-items: start; }
.job-field-grid-4 { grid-template-columns: 1.45fr .9fr 1fr .8fr; }
.job-field-grid-3 { grid-template-columns: repeat(3,minmax(0,1fr)); }
.job-fieldset .field,.rate-fieldset .field { min-width: 0; margin: 0; padding: 0; border: 0; border-radius: 0; background: transparent; }
.job-fieldset .field input,.job-fieldset .field select { width: 100%; }
.job-assignment-grid { display: grid; grid-template-columns: repeat(12,minmax(0,1fr)); gap: 18px; align-items: start; }
.job-assignment-grid .assignment-resource,.job-assignment-grid .assignment-rate { grid-column: span 6; }
.job-assignment-grid > .field:not(.assignment-resource):not(.assignment-rate) { grid-column: span 3; }
.input-inline { display: grid; grid-template-columns: minmax(0,1fr) 92px; gap: 8px; }
.po-required-field .checkbox-row { min-height: 42px; padding: 8px 10px; border: 1px solid #cbd5e1; border-radius: 7px; background: #f8fafc; }
.assignment-action .btn-primary { width: 100%; min-height: 42px; justify-content: center; white-space: normal; text-align: center; }
.inherited-value { min-height: 42px; border-color: #a78bfa; background: #f5f3ff; color: #4c1d95; font-size: 14px; }
.notes-field { max-width: 100%; }
.notes-field textarea { width: 100%; min-height: 96px; resize: vertical; }

.modal-subtitle { margin-top: 3px; color: #64748b; font-size: 12px; }
.rate-card-modal { width: min(1040px,calc(100vw - 32px)); max-height: calc(100vh - 32px); }
.rate-modal-body { padding: 0 24px 20px; overflow-y: auto; }
.rate-language-grid { display: grid; grid-template-columns: 1fr 1fr 280px; gap: 18px; align-items: start; }
.rate-language-grid .checkbox-grid { min-height: 104px; max-height: 160px; padding: 12px; border-color: #cbd5e1; background: #f8fafc; }
.rate-pricing-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 18px; }
.rate-table-shell { overflow: hidden; border: 1px solid #d7dee8; border-radius: 9px; }
.rate-table-shell .module-table { margin: 0; }
.compact-rate-table th { color: #475569; font-size: 12px; }
.compact-rate-table td { padding-top: 9px; padding-bottom: 9px; }
.compact-rate-table input { min-height: 38px; }

.settings-main { overflow-y: auto; background: #f6f7fb; }
.settings-header { padding-bottom: 20px; background: #fff; }
.eyebrow { margin-bottom: 5px; color: #6d28d9; font-size: 11px; font-weight: 800; letter-spacing: .65px; text-transform: uppercase; }
.settings-layout { display: grid; grid-template-columns: 230px minmax(0,920px); gap: 24px; align-items: start; max-width: 1230px; padding: 24px; }
.settings-nav { position: sticky; top: 24px; overflow: hidden; border: 1px solid #d7dee8; border-radius: 12px; background: #fff; }
.settings-nav-item { display: flex; min-height: 66px; flex-direction: column; justify-content: center; gap: 3px; padding: 12px 15px; border-bottom: 1px solid #e2e8f0; color: #334155; }
.settings-nav-item:last-child { border-bottom: 0; }
.settings-nav-item strong { font-size: 14px; }
.settings-nav-item span { color: #64748b; font-size: 12px; }
.settings-nav-item.active { border-left: 4px solid #7c3aed; padding-left: 11px; background: #f5f3ff; color: #4c1d95; }
.settings-nav-item.future { opacity: .62; cursor: default; }
.settings-content { overflow: hidden; border: 1px solid #d7dee8; border-radius: 12px; background: #fff; box-shadow: 0 1px 2px rgba(15,23,42,.04); }
.settings-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 22px 24px; border-bottom: 1px solid #e2e8f0; }
.settings-panel-head h2 { color: #172033; font-size: 19px; }
.settings-panel-head p { margin-top: 5px; color: #64748b; font-size: 13px; }
.settings-info { display: flex; gap: 10px; margin: 18px 24px; padding: 12px 14px; border: 1px solid #c4b5fd; border-radius: 9px; background: #faf9ff; color: #475569; font-size: 13px; line-height: 1.45; }
.settings-info strong { flex: 0 0 auto; color: #5b21b6; }
.settings-table-wrap { margin: 0 24px 24px; border: 1px solid #d7dee8; border-radius: 9px; }
.settings-table th { color: #475569; font-size: 12px; }
.settings-table td { padding-top: 12px; padding-bottom: 12px; vertical-align: middle; }
.settings-order { width: 72px; color: #64748b; font-variant-numeric: tabular-nums; }
.service-code { display: inline-flex; min-width: 46px; justify-content: center; padding: 4px 7px; border-radius: 6px; background: #ede9fe; color: #5b21b6; font-family: ui-monospace,SFMono-Regular,Consolas,monospace; font-size: 12px; font-weight: 800; }
.settings-description { max-width: 280px; color: #475569; line-height: 1.4; }
.settings-modal .field input[readonly] { border-style: dashed; }

@media (max-width: 1100px) {
    .job-summary,.compact-financial-summary { grid-template-columns: 1fr 1fr; }
    .job-summary > div:nth-child(2),.compact-financial-summary > div:nth-child(2) { border-right: 0; }
    .job-summary > div,.compact-financial-summary > div { border-bottom: 1px solid #e2e8f0; }
    .job-summary > div:nth-last-child(-n+2),.compact-financial-summary > div:nth-last-child(-n+2) { border-bottom: 0; }
    .job-field-grid-4 { grid-template-columns: 1fr 1fr; }
    .job-assignment-grid .assignment-resource,.job-assignment-grid .assignment-rate { grid-column: span 12; }
    .job-assignment-grid > .field:not(.assignment-resource):not(.assignment-rate) { grid-column: span 6; }
    .rate-language-grid { grid-template-columns: 1fr 1fr; }
    .rate-account-field { grid-column: 1 / -1; max-width: 360px; }
    .rate-pricing-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
}
@media (max-width: 780px) {
    #pane-overview { max-width: none; }
    .job-summary,.compact-financial-summary { grid-template-columns: 1fr 1fr; }
    .job-summary > div:nth-child(2),.compact-financial-summary > div:nth-child(2) { border-right: 0; }
    .job-summary > div,.compact-financial-summary > div { border-bottom: 1px solid #e2e8f0; }
    .job-summary > div:nth-last-child(-n+2),.compact-financial-summary > div:nth-last-child(-n+2) { border-bottom: 0; }
    .summary-section-title { align-items: flex-start; flex-direction: column; }
    .summary-section-title small { margin-left: 0; }
    .job-field-grid-3,.job-field-grid-4,.rate-language-grid,.rate-pricing-grid { grid-template-columns: 1fr; }
    .job-assignment-grid > .field:not(.assignment-resource):not(.assignment-rate) { grid-column: span 12; }
    .job-form-sections,.rate-modal-body { padding-left: 16px; padding-right: 16px; }
    .settings-layout { grid-template-columns: 1fr; padding: 16px; }
    .settings-nav { position: static; display: grid; grid-template-columns: 1fr 1fr; }
    .settings-nav-item { border-right: 1px solid #e2e8f0; }
    .settings-panel-head { align-items: flex-start; flex-direction: column; }
}

/* Update 030: Project → Scoops → Jobs hierarchy. */
.project-record-body #pane-general,
.project-record-body #pane-financials,
.project-record-body #pane-scoops { max-width: 1240px; }
.project-overview-card { width: 100%; max-width: 1180px; }
.project-overview-card .flags-row { min-height: 42px; align-items: center; }
.project-name-preview { display: flex; flex-direction: column; gap: 5px; margin-bottom: 18px; padding: 13px 15px; border: 1px solid #c4b5fd; border-radius: 9px; background: #faf9ff; }
.project-name-preview span { color: #64748b; font-size: 11px; font-weight: 750; letter-spacing: .35px; text-transform: uppercase; }
.project-name-preview strong { color: #4c1d95; font-family: ui-monospace,SFMono-Regular,Consolas,monospace; font-size: 14px; overflow-wrap: anywhere; }
.scoop-edit-note { margin: 18px 0 0; line-height: 1.45; }
.scoops-list { display: grid; gap: 18px; }
.scoop-card { overflow: hidden; padding: 0; border-color: #cbd5e1; border-radius: 12px; box-shadow: 0 1px 2px rgba(15,23,42,.04); }
.scoop-card:focus { outline: 3px solid #c4b5fd; outline-offset: 3px; }
.scoop-card-head { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 19px 20px; border-bottom: 1px solid #e2e8f0; background: linear-gradient(90deg,#faf9ff 0,#fff 48%); }
.scoop-card-head h3 { margin-top: 5px; color: #172033; font-size: 18px; line-height: 1.3; }
.scoop-card-head h3 span { padding: 0 4px; color: #7c3aed; }
.scoop-card-head p { margin-top: 5px; color: #64748b; font-size: 12px; }
.scoop-number { color: #5b21b6; font-family: ui-monospace,SFMono-Regular,Consolas,monospace; font-size: 14px; font-weight: 800; overflow-wrap: anywhere; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.scoop-number:hover { color: #4c1d95; text-decoration-thickness: 2px; }
.scoop-number-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.scoop-actions { display: flex; align-items: center; justify-content: flex-end; gap: 9px; flex-wrap: wrap; }
.scoop-financials { display: grid; grid-template-columns: repeat(4,minmax(112px,1fr)); border: 1px solid #ddd6fe; border-radius: 9px; overflow: hidden; background: white; }
.scoop-financials > div { min-width: 0; padding: 9px 11px; border-right: 1px solid #ede9fe; text-align: center; }
.scoop-financials > div:last-child { border-right: 0; }
.scoop-financials span { display: block; color: #64748b; font-size: 9.5px; font-weight: 750; letter-spacing: .25px; text-transform: uppercase; }
.scoop-financials strong { display: block; margin-top: 4px; color: #2e1065; font-size: 14px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.scoop-card .table-card { overflow-x: auto; border: 0; border-radius: 0; }
.scoop-card .module-table { min-width: 900px; margin: 0; }
.scoop-card .module-table th { color: #475569; font-size: 11px; text-align: center; }
.scoop-card .module-table td { padding-top: 12px; padding-bottom: 12px; text-align: center; vertical-align: middle; }
.input-suffix { display: flex; align-items: stretch; }
.input-suffix input { border-radius: 7px 0 0 7px; }
.input-suffix span { display: inline-flex; align-items: center; padding: 0 13px; border: 1px solid var(--border); border-left: 0; border-radius: 0 7px 7px 0; background: #f8fafc; color: #475569; font-size: 13px; font-weight: 700; }
.job-name-link { font-size: 14px; font-weight: 800; }
.supplier-cost-header,.supplier-cost-cell { text-align: center !important; }
.supplier-cost-cell { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Update 032 — catalogue dropdowns and Scoop financial editor */
.catalog-dropdown { position: relative; width: 100%; }
.catalog-dropdown > summary { display: flex; align-items: center; justify-content: space-between; min-height: 40px; padding: 9px 34px 9px 12px; border: 1px solid #94a3b8; border-radius: 7px; background: #fff; color: #172033; cursor: pointer; font-size: 13px; list-style: none; text-align: left; }
.catalog-dropdown > summary::-webkit-details-marker { display: none; }
.catalog-dropdown > summary::after { content: "⌄"; position: absolute; right: 13px; color: #475569; font-size: 17px; }
.catalog-dropdown[open] > summary { border-color: #7c3aed; box-shadow: 0 0 0 2px rgba(124,58,237,.14); }
.catalog-dropdown-menu { position: absolute; z-index: 60; top: calc(100% + 5px); left: 0; right: 0; display: grid; gap: 3px; max-height: 250px; overflow-y: auto; padding: 8px; border: 1px solid #cbd5e1; border-radius: 8px; background: #fff; box-shadow: 0 14px 30px rgba(15,23,42,.16); }
.catalog-dropdown-menu .checkbox-row { min-height: 34px; padding: 7px 9px; border-radius: 6px; text-align: left; }
.catalog-dropdown-menu .checkbox-row:hover { background: #f5f3ff; }
.settings-content + .settings-content { margin-top: 20px; }
.settings-content-stack { min-width: 0; }
.scoop-editor-modal { width: min(1120px,calc(100vw - 32px)); max-height: calc(100vh - 32px); }
.scoop-financial-editor { margin-top: 20px; }
.scoop-financial-editor .button-row { justify-content: flex-start; margin: 12px 0; }
.scoop-financial-table { min-width: 900px; }
.scoop-financial-table th,.scoop-financial-table td { text-align: center; vertical-align: middle; }
.scoop-financial-table input,.scoop-financial-table select { min-width: 105px; }
.scoop-financial-table .scp-line-description { min-width: 190px; }
.scoop-financial-table .scp-line-reason { margin-top: 5px; min-width: 150px; }
.scoop-fin-total { display: flex; align-items: center; justify-content: flex-end; gap: 16px; padding: 13px 8px 2px; color: #475569; font-weight: 700; }
.scoop-fin-total strong { color: #4c1d95; font-size: 17px; font-variant-numeric: tabular-nums; }

@media (max-width: 900px) {
    .scoop-card-head { align-items: flex-start; flex-direction: column; }
    .scoop-actions { width: 100%; justify-content: flex-start; }
    .scoop-financials { width: 100%; grid-template-columns: repeat(2,minmax(0,1fr)); }
    .scoop-financials > div:nth-child(2) { border-right: 0; }
    .scoop-financials > div:nth-child(-n+2) { border-bottom: 1px solid #ede9fe; }
}
@media (max-width: 650px) {
    .scoop-actions .btn-primary,.scoop-actions .btn-secondary { flex: 1 1 150px; }
    .scoop-financials { flex: 1 0 100%; margin-bottom: 5px; }
}

/* Update 039 — role-aware UI and least-privilege External Resource portal. */
.role-readonly-banner {
    margin: 12px 18px 0;
    padding: 10px 13px;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    background: #eff6ff;
    color: #1e40af;
    font-size: 12.5px;
    font-weight: 700;
}
.role-qa-readonly [data-qa-read-only="true"] { cursor: not-allowed !important; }
.role-qa-readonly input:disabled,
.role-qa-readonly select:disabled,
.role-qa-readonly textarea:disabled { opacity: 1; background: #f8fafc; color: #475569; }

.portal-link-card {
    margin-top: 16px;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.portal-link-card > div { display: grid; gap: 4px; }
.portal-link-card span { color: var(--text-muted); font-size: 13px; }
.portal-link-card.portal-link-ready { border-color: #86efac; background: #f0fdf4; }
.portal-link-card.portal-link-warning { border-color: #fde68a; background: #fffbeb; }
.portal-link-card.portal-link-error { border-color: #fecaca; background: #fef2f2; }

.resource-portal-main {
    overflow-y: auto;
    background: #f6f7fb;
}
.resource-portal-sidebar .b-sub { text-transform: none; }
.resource-portal-header { min-height: 92px; }
.resource-portal-header .header-actions { align-items: center; }
.portal-identity-separator { padding: 0 6px; color: #cbd5e1; }
.portal-notice {
    margin: 16px 20px 0;
    padding: 13px 15px;
    border: 1px solid #fcd34d;
    border-radius: 9px;
    background: #fffbeb;
    color: #92400e;
    line-height: 1.5;
}
.portal-summary,
.portal-job-context {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin: 18px 20px 0;
    overflow: hidden;
    border: 1px solid #ddd6fe;
    border-radius: 11px;
    background: #fff;
}
.portal-summary > div,
.portal-job-context > div {
    min-width: 0;
    padding: 16px 18px;
    border-right: 1px solid #ede9fe;
}
.portal-summary > div:last-child,
.portal-job-context > div:last-child { border-right: 0; }
.portal-summary span,
.portal-job-context span {
    display: block;
    color: #64748b;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .35px;
    text-transform: uppercase;
}
.portal-summary strong,
.portal-job-context strong {
    display: block;
    margin-top: 7px;
    color: #2e1065;
    font-size: 17px;
    overflow-wrap: anywhere;
}
.portal-section { margin: 18px 20px 0; flex: 0 0 auto; }
.portal-section:last-child { margin-bottom: 24px; }
.portal-search {
    width: min(260px, 100%);
    padding: 9px 11px;
    border: 1px solid #cbd5e1;
    border-radius: 7px;
    outline: none;
}
.portal-search:focus { border-color: #7c3aed; box-shadow: 0 0 0 3px rgba(124,58,237,.12); }
.portal-table { min-width: 920px; }
.portal-table th { background: #f8fafc; color: #475569; font-size: 11px; }
.portal-table td { vertical-align: middle; }
.portal-primary-link { font-weight: 800; }
.portal-detail-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0;
    padding: 0 24px;
}
.portal-detail-grid > div { min-width: 0; padding: 18px 16px; border-bottom: 1px solid #e2e8f0; }
.portal-detail-grid dt { color: #64748b; font-size: 10px; font-weight: 800; letter-spacing: .3px; text-transform: uppercase; }
.portal-detail-grid dd { margin-top: 7px; color: #172033; font-size: 14px; font-weight: 700; overflow-wrap: anywhere; }
.portal-instructions { margin: 20px 24px 24px; padding: 16px; border: 1px solid #ddd6fe; border-radius: 9px; background: #faf9ff; }
.portal-instructions span { color: #5b21b6; font-size: 10px; font-weight: 800; letter-spacing: .3px; text-transform: uppercase; }
.portal-instructions p { margin-top: 8px; color: #334155; line-height: 1.6; white-space: pre-wrap; }

.portal-po-layout {
    display: grid;
    grid-template-columns: 250px minmax(0, 1fr);
    align-items: start;
    gap: 18px;
    margin: 18px 20px 24px;
}
.portal-version-card { position: sticky; top: 18px; padding-bottom: 10px; }
.portal-version-card .section-title { padding: 17px 18px 11px; }
.portal-version-list { display: grid; gap: 8px; padding: 0 10px 8px; }
.portal-version-list button {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 3px 8px;
    width: 100%;
    padding: 11px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    color: #334155;
    cursor: pointer;
    text-align: left;
}
.portal-version-list button:hover,
.portal-version-list button.selected { border-color: #8b5cf6; background: #faf9ff; box-shadow: 0 0 0 2px rgba(124,58,237,.09); }
.portal-version-list button strong { color: #5b21b6; }
.portal-version-list button span { justify-self: end; font-size: 11px; }
.portal-version-list button small { color: #64748b; }
.portal-version-list button b { justify-self: end; color: #172033; font-size: 11px; }
.portal-po-document { overflow: hidden; }
.portal-po-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    padding: 24px;
    border-bottom: 1px solid #ddd6fe;
    background: linear-gradient(100deg, #f5f3ff 0, #fff 55%);
}
.portal-po-heading > div:last-child { text-align: right; }
.portal-po-heading span { display: block; color: #6d28d9; font-size: 10px; font-weight: 850; letter-spacing: .5px; text-transform: uppercase; }
.portal-po-heading h2 { margin-top: 6px; color: #24124d; font-size: 21px; }
.portal-po-heading strong { display: block; margin-top: 7px; color: #2e1065; font-size: 19px; }
.portal-po-meta { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.portal-po-lines { min-width: 800px; }
.portal-po-totals { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 18px; padding: 17px 24px; border-top: 1px solid #e2e8f0; color: #475569; }
.portal-po-totals span:last-child { color: #4c1d95; font-size: 16px; }
.portal-po-note { display: flex; gap: 12px; margin: 0 24px 18px; padding: 12px 14px; border-radius: 7px; background: #f8fafc; color: #475569; }
.portal-po-note strong { flex: 0 0 auto; color: #334155; }
.portal-confidentiality-note { margin: 0 24px 24px; color: #64748b; font-size: 11.5px; line-height: 1.5; }

@media (max-width: 920px) {
    .resource-portal-sidebar { width: 190px; }
    .portal-detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .portal-po-layout { grid-template-columns: 1fr; }
    .portal-version-card { position: static; }
    .portal-version-list { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
}
@media (max-width: 680px) {
    .portal-link-card { align-items: stretch; flex-direction: column; }
    .resource-portal-body .app { height: auto; min-height: 100vh; overflow: visible; }
    .resource-portal-sidebar { width: 72px; }
    .resource-portal-sidebar .sidebar-brand { padding: 17px 8px; }
    .resource-portal-sidebar .b-name { font-size: 12px; }
    .resource-portal-sidebar .b-sub { display: none; }
    .resource-portal-sidebar .nav-item { justify-content: center; min-height: 54px; margin: 4px 6px; padding: 7px; font-size: 10px; text-align: center; }
    .resource-portal-main { min-width: 0; overflow: visible; }
    .portal-summary,.portal-job-context { grid-template-columns: 1fr; }
    .portal-summary > div,.portal-job-context > div { border-right: 0; border-bottom: 1px solid #ede9fe; }
    .portal-summary > div:last-child,.portal-job-context > div:last-child { border-bottom: 0; }
    .section-card-heading { align-items: flex-start; flex-direction: column; gap: 12px; }
    .portal-detail-grid,.portal-po-meta { grid-template-columns: 1fr; }
    .portal-po-heading { flex-direction: column; }
    .portal-po-heading > div:last-child { text-align: left; }
}

@media print {
    .printing-resource-po .resource-portal-sidebar,
    .printing-resource-po .resource-portal-header,
    .printing-resource-po #poContext,
    .printing-resource-po .portal-version-card,
    .printing-resource-po #portalError { display: none !important; }
    .printing-resource-po .app,
    .printing-resource-po .resource-portal-main,
    .printing-resource-po .portal-po-layout { display: block; height: auto; overflow: visible; margin: 0; background: #fff; }
    .printing-resource-po .portal-po-document { border: 0; box-shadow: none; }
}

/* Update 036 — compact financial grouping, CAT visibility and Scoop status. */
.project-price-lines-table .scoop-cell { min-width: 190px; vertical-align: top; text-align: left; }
.scoop-status-override { margin-top: 12px; }
.scoop-editor-modal .field-help { line-height: 1.4; }
/* Update 037 — Internal Resources are an employee/access register, not a
   linguist capability profile. */
.internal-resource-mode .resource-tabs,
.internal-resource-mode .record-pane { display: none; }
.internal-resource-mode #internalOverviewCard { display: block; }
.internal-resource-filters .resource-filter-row:first-child { grid-template-columns: minmax(280px, 520px); }
.internal-resource-filters .resource-search { width: 100%; max-width: 520px; }
