/* Quote Manager — ported from the "Quote Manager" Claude Design prototype. */
:root {
    --bg: #f4f5f7;
    --surface: #fff;
    --panel: #fbfbfc;
    --ink: #16191d;
    --ink-2: #3a414a;
    --ink-3: #4a525c;
    --muted: #5b636e;
    --faint: #8a929c;
    --line: #e3e5e8;
    --line-soft: #eceef1;
    --field: #d5d9de;
    --field-hover: #b5bcc5;
    --head: #f7f8f9;
    --hover-blue: #f3f6fa;
    --selected: #edf3fb;
    --primary: #2f5f9e;
    --primary-dark: #244c80;
    --success: #1f6b45;
    --danger: #8a2318;
    --disabled: #c3c9d1;
    --sans: 'IBM Plex Sans', system-ui, sans-serif;
    --mono: 'IBM Plex Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
    background: var(--bg);
    color: var(--ink);
    font-family: var(--sans);
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
}
a { color: var(--primary-dark); cursor: pointer; }
a:hover { color: var(--ink); }
input, select, textarea, button { font-family: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
[x-cloak] { display: none !important; }

/* ---------- Text helpers ---------- */
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.ink-2 { color: var(--ink-2); }
.danger-text { color: var(--danger); }
.warn-text { color: #7a4f06; }
.fs-11 { font-size: 11.5px; }
.fs-12 { font-size: 12px; }
.fs-125 { font-size: 12.5px; }
.fs-13 { font-size: 13px; }
.fw-5 { font-weight: 500; }
.fw-6 { font-weight: 600; }
.lh { line-height: 1.45; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.grow { flex: 1; }
.min0 { min-width: 0; }
.break { word-break: break-word; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pretty { text-wrap: pretty; }
.h1 { font-size: 22px; font-weight: 600; letter-spacing: -.015em; line-height: 1.2; }
.h2 { font-size: 16px; font-weight: 600; }
.h3 { font-size: 14px; font-weight: 600; }
.row { display: flex; align-items: center; gap: 8px; }
.row-wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.stack { display: flex; flex-direction: column; }
.gap-2 { gap: 2px; } .gap-4 { gap: 4px; } .gap-6 { gap: 6px; } .gap-8 { gap: 8px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; }

/* ---------- Shell ---------- */
.frame { min-height: 100vh; display: flex; justify-content: center; }
.shell { width: 100%; display: flex; min-height: 100vh; }
.sidebar {
    width: 232px; flex: none; height: 100vh; position: sticky; top: 0; z-index: 10; /* its inbox panel opens over the page, under drawers and modals */
    display: flex; flex-direction: column; gap: 2px; padding: 16px 10px;
    border-right: 1px solid var(--line); background: var(--panel);
}
.brand { display: flex; align-items: center; gap: 10px; padding: 0 6px 18px; }
.brand-mark {
    width: 22px; height: 22px; border-radius: 4px; background: var(--ink); color: #fff; flex: none;
    display: flex; align-items: center; justify-content: center;
    font-family: var(--mono); font-size: 11px; font-weight: 500;
}
.brand-name { font-size: 14px; font-weight: 600; letter-spacing: -.01em; }
.nav-link {
    display: flex; align-items: center; gap: 10px; border: 0; background: transparent; color: var(--ink);
    font-size: 13.5px; text-align: left; padding: 7px 10px; border-radius: 6px; text-decoration: none;
}
.nav-link:hover { background: #eef0f3; color: var(--ink); }
.nav-link.is-active { background: #e8ebef; font-weight: 600; }
.portal-link {
    display: block; border: 1px solid var(--line); background: #fff; border-radius: 6px; padding: 9px 10px;
    text-align: left; color: var(--muted); font-size: 12px; line-height: 1.4; text-decoration: none;
}
.portal-link:hover { border-color: var(--field-hover); color: var(--muted); }
.portal-link strong { display: block; font-size: 13px; font-weight: 600; color: var(--ink); }
.me { display: flex; align-items: center; gap: 10px; padding: 12px 6px 0; }
.me-name { font-size: 12px; line-height: 1.3; }
.mobile-bar { display: none; }
#qm-main { flex: 1; min-width: 0; min-height: 100vh; }

/* ---------- Avatars & pills ---------- */
.avatar {
    width: 28px; height: 28px; border-radius: 999px; flex: none; display: flex; align-items: center; justify-content: center;
    font-size: 11px; font-weight: 600; background: #dfe6ef; color: var(--primary-dark);
}
.avatar-26 { width: 26px; height: 26px; font-size: 10px; letter-spacing: .02em; box-shadow: 0 0 0 2px #fff; }
.avatar-30 { width: 30px; height: 30px; }
.avatar-36 { width: 36px; height: 36px; font-size: 12px; }
.avatar-more { background: #fff; color: var(--ink-2); border: 1px solid var(--field); }
.avatar-empty { border: 1.5px dashed #d9a79f; color: var(--danger); font-size: 13px; background: transparent; box-shadow: none; }
.avatars { display: flex; align-items: center; }
.avatars > * + * { margin-left: -6px; }

.pill { display: inline-block; font-size: 12px; padding: 1px 7px; border-radius: 4px; white-space: nowrap; }
.pill-sm { font-size: 11.5px; padding: 0 6px; }
.pill-strong { font-weight: 500; }
.tone-warn { background: #fbefd5; color: #7a4f06; }
.tone-ok { background: #e5f2ea; color: #1f5b3a; }
.tone-muted { background: #eef0f2; color: var(--muted); }
.tone-neutral { background: #eef0f2; color: var(--ink-3); }
.tone-slate { background: #eef0f2; color: var(--ink-2); }
.tone-info { background: #ebeefa; color: #34408a; }
.tone-danger { background: #fbe4e1; color: var(--danger); }
.tag-lowest { font-size: 11px; color: #1f5b3a; border: 1px solid #b9d9c5; padding: 0 5px; border-radius: 4px; }
.tag-differs { font-size: 11px; color: #7a4f06; background: #fdf6e7; padding: 0 5px; border-radius: 4px; }

/* ---------- Buttons & inputs ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    border: 1px solid var(--field); background: #fff; color: var(--ink); border-radius: 6px;
    padding: 5px 10px; font-size: 12.5px; white-space: nowrap; text-decoration: none; line-height: 1.4;
}
.btn:hover { border-color: var(--field-hover); color: var(--ink); }
.btn:disabled, .btn:disabled:hover { opacity: .5; border-color: var(--field); }
.btn-lg { height: 34px; padding: 0 14px; font-size: 13px; }
.btn-md { height: 32px; padding: 0 12px; }
.btn-primary { border-color: var(--primary); background: var(--primary); color: #fff; font-weight: 600; }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; }
.btn-dark { border-color: var(--ink); background: var(--ink); color: #fff; font-weight: 600; }
.btn-dark:hover { color: #fff; }
.btn-danger { border-color: var(--danger); background: var(--danger); color: #fff; font-weight: 600; }
.btn-danger:hover { color: #fff; border-color: var(--danger); }
.btn-danger-outline { color: var(--danger); }
.btn-danger-outline:hover { border-color: #c98f87; color: var(--danger); }
.btn-disabled, .btn-disabled:hover { border-color: var(--disabled); background: var(--disabled); color: #fff; font-weight: 600; cursor: not-allowed; }
.btn-text { border: 0; background: transparent; padding: 0; color: var(--primary); font-size: 12.5px; }
.btn-text:hover { color: var(--primary-dark); }
.btn-icon { width: 28px; height: 28px; padding: 0; }
.btn-close { width: 28px; height: 28px; border: 0; background: transparent; border-radius: 6px; font-size: 16px; color: var(--muted); }
.btn-close:hover { background: #eef0f2; }

.field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 500; color: var(--muted); }
.field-hint { font-weight: 400; color: var(--faint); }
.input, .select, .textarea {
    height: 34px; border: 1px solid var(--field); border-radius: 6px; padding: 0 10px; font-size: 13px;
    color: var(--ink); background: #fff; font-weight: 400; min-width: 0;
}
.select { padding: 0 8px; }
.textarea { height: auto; padding: 8px 10px; resize: vertical; line-height: 1.45; }
.input:focus, .select:focus, .textarea:focus { outline: 2px solid rgba(47, 95, 158, .25); outline-offset: 0; border-color: var(--primary); }
.input:disabled, .select:disabled, .textarea:disabled { background: var(--head); color: var(--ink-2); }
.input-group { display: flex; height: 34px; border: 1px solid var(--field); border-radius: 6px; overflow: hidden; background: #fff; }
.input-group:focus-within { border-color: var(--primary); }
.input-group > input, .input-group > select { flex: 1; min-width: 0; border: 0; padding: 0 10px; font-size: 13px; outline: none; background: transparent; }
.input-group > select { flex: none; border-left: 1px solid var(--field); background: var(--head); padding: 0 8px; }
.addon { padding: 0 10px; display: flex; align-items: center; background: var(--head); color: var(--ink-2); font-size: 13px; }
.addon:first-child { border-right: 1px solid var(--field); }
.addon:last-child { border-left: 1px solid var(--field); }
.input-sm { height: 32px; }
.input-sm > input { padding: 0 6px; font-size: 12.5px; }
.input-sm .addon { padding: 0 7px; font-size: 12px; }

.check {
    width: 16px; height: 16px; border-radius: 3px; border: 1.5px solid var(--field-hover); background: #fff; flex: none;
    color: #fff; font-size: 11px; display: inline-flex; align-items: center; justify-content: center;
}
.check.is-on { background: var(--primary); border-color: var(--primary); }
.check-row { display: flex; gap: 8px; align-items: center; border: 0; background: transparent; padding: 4px 0; font-size: 13px; text-align: left; }

.switch { width: 34px; height: 20px; border-radius: 999px; border: 0; background: var(--disabled); position: relative; padding: 0; flex: none; }
.switch::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 999px; background: #fff; transition: left .15s; }
.switch.is-on { background: var(--primary); }
.switch.is-on::after { left: 16px; }

.seg { display: inline-flex; border: 1px solid var(--field); border-radius: 6px; overflow: hidden; align-self: flex-start; }
.seg > button { border: 0; border-right: 1px solid var(--field); background: #fff; color: var(--ink); padding: 7px 10px; font-size: 12.5px; white-space: nowrap; }
.seg > button:last-child { border-right: 0; }
.seg > button.is-on { background: var(--ink); color: #fff; }
.seg-sm > button { padding: 5px 10px; font-size: 12px; }
.seg-md > button { padding: 6px 12px; }

.chip {
    display: inline-flex; gap: 6px; align-items: center; border: 1px solid var(--field); background: #fff; color: var(--ink);
    border-radius: 6px; padding: 4px 10px; font-size: 12.5px; white-space: nowrap;
}
.chip .n { opacity: .6; font-family: var(--mono); }
.chip.is-on { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip-lg { padding: 5px 10px; }
.opt { border: 1px solid var(--field); background: #fff; color: var(--ink); border-radius: 6px; padding: 7px 12px; font-size: 13px; min-height: 36px; }
.opt.is-on { background: var(--ink); color: #fff; border-color: var(--ink); }

/* ---------- Cards & tables ---------- */
.card { background: #fff; border: 1px solid var(--line); border-radius: 8px; }
.card-clip { overflow: hidden; }
.card-head { padding: 12px 16px; border-bottom: 1px solid var(--line-soft); display: flex; align-items: center; gap: 8px; }
.card-body { padding: 14px 16px; }
.card-dashed { background: #fff; border: 1px dashed var(--disabled); border-radius: 8px; }
.list-row { padding: 11px 16px; border-bottom: 1px solid var(--line-soft); display: flex; gap: 12px; align-items: center; text-decoration: none; color: var(--ink); }
.list-row:last-child { border-bottom: 0; }
a.list-row:hover, .list-row.is-link:hover { background: var(--head); color: var(--ink); cursor: pointer; }
.list-code { font-family: var(--mono); font-size: 12.5px; min-width: 54px; flex: none; white-space: nowrap; }

.scroll-x { overflow: auto; }
.gt { display: grid; grid-template-columns: var(--cols); gap: 12px; }
.gt-head { padding: 8px 16px; background: var(--head); border-bottom: 1px solid var(--line); font-size: 12px; font-weight: 500; color: var(--muted); align-items: center; }
.gt-row { padding: 12px 16px; border-bottom: 1px solid var(--line-soft); align-items: center; font-size: 13px; color: var(--ink); text-decoration: none; }
.gt-row:last-child { border-bottom: 0; }
.gt-row.top { align-items: start; }
a.gt-row:hover, .gt-row.is-link:hover { background: var(--head); color: var(--ink); cursor: pointer; }

.stat { text-align: left; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; text-decoration: none; color: var(--ink); }
.stat:hover { border-color: var(--field-hover); color: var(--ink); }
.stat-label { font-size: 12.5px; color: var(--muted); }
.stat-value { font-size: 26px; font-weight: 600; font-family: var(--mono); }
.stat-sub { font-size: 12px; color: var(--muted); }

.grid-auto { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.grid-panels { display: grid; gap: 16px; align-items: start; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); }
.grid-cats { display: grid; gap: 16px; align-items: start; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); }
.grid-fields { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }

.notice { border-radius: 8px; padding: 10px 14px; font-size: 13px; line-height: 1.45; }
.notice-warn { background: #fdf6e7; border: 1px solid #f1dfb4; color: #5a3b05; }
.notice-danger { background: #fbe4e1; border: 1px solid #f0c7c1; color: #5e1a12; }
.notice-ok { background: #e5f2ea; border: 1px solid #b9d9c5; color: #15452b; }
.notice-plain { background: #fff; border: 1px solid var(--line); color: var(--ink-2); }
.flag-box { display: flex; flex-direction: column; gap: 2px; background: #fdf6e7; border: 1px solid #f1dfb4; border-radius: 6px; padding: 8px 10px; font-size: 12.5px; line-height: 1.45; color: #5a3b05; }

/* ---------- Pages ---------- */
.page { padding: 24px; display: flex; flex-direction: column; gap: 16px; max-width: 1280px; }
.page-gap-20 { gap: 20px; }
.page-narrow { max-width: 880px; }
.page-project { padding: 20px 24px; display: flex; flex-direction: column; gap: 14px; }
.page-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.page-head-end { align-items: flex-end; gap: 10px 16px; }

.project-head {
    padding: 18px 24px 0; display: flex; flex-direction: column; gap: 12px; border-bottom: 1px solid var(--line);
    background: #fff; position: sticky; top: 0; z-index: 4;
}
.crumbs { display: flex; gap: 8px; align-items: center; font-size: 12px; color: var(--muted); }
.crumbs a { color: var(--muted); text-decoration: none; }
.tabs { display: flex; gap: 4px; overflow-x: auto; margin-bottom: -1px; }
.tab {
    white-space: nowrap; flex: none; border: 0; background: transparent; border-bottom: 2px solid transparent; color: var(--muted);
    font-size: 13.5px; padding: 8px 10px 10px; display: flex; gap: 6px; align-items: center; text-decoration: none;
}
.tab:hover { color: var(--ink); }
.tab.is-active { border-bottom-color: var(--ink); color: var(--ink); font-weight: 600; }

/* ---------- Overview: category blocks ---------- */
.blocks { display: flex; flex-direction: column; gap: 12px; }
.block { background: #fff; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; transition: box-shadow .12s; }
.block.is-over { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(47, 95, 158, .15); }
.block-head { padding: 12px 14px; border-bottom: 1px solid var(--line); display: flex; gap: 8px; align-items: baseline; }
.item {
    padding: 10px 14px; border-bottom: 1px solid var(--line-soft); display: grid;
    grid-template-columns: 16px var(--pos, 36px) minmax(0, 1fr) minmax(150px, 200px) 120px; gap: 4px 10px; align-items: start; cursor: pointer;
}
.item-check { width: 16px; height: 16px; margin: 1px 0 0; accent-color: var(--primary); cursor: pointer; }
.attention-icon { color: var(--danger); vertical-align: -3px; margin-right: 2px; }
.flag-open { background: #fbe4e1; border-color: #f0c7c1; color: #5e1a12; }
.flag-resolved { background: var(--head); border-color: var(--line); color: var(--muted); }
.flag-resolved .icon { color: #1f6b45; }
.bulk-bar {
    position: sticky; bottom: 12px; z-index: 6; display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    background: var(--ink); color: #fff; border-radius: 8px; padding: 10px 14px; box-shadow: 0 8px 24px rgba(22, 25, 29, .2);
}
.item:last-child { border-bottom: 0; }
.item:hover { background: var(--hover-blue); }
.item.is-selected { background: var(--selected); box-shadow: inset 3px 0 0 var(--primary); }
.item.is-excluded { opacity: .6; }
.item.is-dragging { opacity: .4; }

/* ---------- Documents ---------- */
.dropzone {
    border: 1.5px dashed var(--field-hover); border-radius: 8px; background: #fff; padding: 20px;
    display: flex; flex-wrap: wrap; gap: 12px; align-items: center; cursor: pointer;
}
.dropzone.is-over { border-color: var(--primary); background: #f3f7fc; }
.progress { display: block; height: 3px; background: #eef0f2; border-radius: 2px; margin-top: 4px; max-width: 260px; }
.progress > span { display: block; height: 3px; background: var(--primary); border-radius: 2px; transition: width .6s; }
.diff { display: grid; grid-template-columns: 110px minmax(0, 1fr) minmax(0, 1fr); font-size: 13px; }
.diff > span { padding: 9px 12px; border-bottom: 1px solid var(--line-soft); border-left: 1px solid var(--line-soft); line-height: 1.4; color: var(--ink-2); }
.diff > span:nth-child(3n+1) { border-left: 0; padding-left: 16px; font-size: 12px; color: var(--muted); }
.diff > span:nth-child(3n) { background: #fdf8ec; font-weight: 500; color: var(--ink); }
.diff > .diff-head { padding-top: 8px; padding-bottom: 8px; background: var(--head) !important; font-size: 12px; color: var(--muted) !important; font-weight: 400 !important; }
.sticky-foot { position: sticky; bottom: 0; background: var(--bg); border-top: 1px solid var(--line); padding: 12px 0; display: flex; gap: 8px; align-items: center; justify-content: flex-end; }

/* ---------- Overlays ---------- */
.backdrop { position: fixed; inset: 0; background: rgba(22, 25, 29, .35); display: flex; align-items: center; justify-content: center; z-index: 40; padding: 16px; }
.modal { background: #fff; border-radius: 8px; box-shadow: 0 8px 24px rgba(22, 25, 29, .16); padding: 20px; max-width: 460px; width: 100%; display: flex; flex-direction: column; gap: 12px; max-height: calc(100vh - 32px); overflow-y: auto; }
.modal-wide { max-width: 560px; }
.modal-title { font-weight: 600; font-size: 15px; word-break: break-word; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; }
.drawer-backdrop { position: fixed; inset: 0; background: rgba(22, 25, 29, .28); z-index: 30; display: flex; justify-content: flex-end; }
.drawer { width: 480px; max-width: 100%; height: 100vh; background: #fff; box-shadow: -8px 0 24px rgba(22, 25, 29, .14); display: flex; flex-direction: column; }
.drawer-head { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.drawer-body { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.drawer-foot { display: flex; flex-wrap: wrap; gap: 6px; padding: 12px 16px; border-top: 1px solid var(--line); background: var(--panel); }
.drawer-foot .btn, .drawer-confirm .btn { padding: 7px 12px; font-size: 13px; }
.drawer-confirm { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 12px 16px; border-top: 1px solid #f0c7c1; background: #fbe4e1; font-size: 13px; color: #5e1a12; }
.source-link { display: flex; flex-direction: column; gap: 3px; text-decoration: none; color: var(--ink); border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; }
.source-link:hover { border-color: var(--field-hover); color: var(--ink); }
.sup-row { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-bottom: 1px solid var(--line-soft); }
.btn-remove { width: 26px; height: 26px; border: 0; background: transparent; border-radius: 6px; color: var(--muted); font-size: 15px; }
.btn-remove:hover { background: #fbe4e1; color: var(--danger); }

.toast {
    position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: #fff;
    padding: 10px 16px; border-radius: 6px; font-size: 13px; font-weight: 600; box-shadow: 0 8px 24px rgba(22, 25, 29, .16);
    z-index: 50; max-width: 90vw; display: flex; gap: 14px; align-items: center;
}
.toast button { border: 0; background: transparent; color: #9ec1ee; font-weight: 600; font-size: 13px; padding: 0; }

/* ---------- Supplier quotes & portal ---------- */
.quote-head { padding: 14px 16px; display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; border-bottom: 1px solid var(--line-soft); }
.quote-total { display: flex; flex-direction: column; align-items: flex-end; gap: 1px; min-width: 120px; padding-left: 16px; border-left: 1px solid var(--line-soft); }
.quote-link { padding: 10px 16px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; background: var(--panel); border-bottom: 1px solid var(--line-soft); }
.link-box { flex: 1; min-width: 240px; display: flex; height: 32px; border: 1px solid var(--field); border-radius: 6px; overflow: hidden; background: #fff; }
.link-box input { flex: 1; min-width: 0; border: 0; padding: 0 10px; font-family: var(--mono); font-size: 12px; color: var(--ink-2); outline: none; background: transparent; }
.link-box button { border: 0; border-left: 1px solid var(--field); background: var(--head); padding: 0 14px; font-size: 12.5px; font-weight: 500; min-width: 72px; }
.quote-changed { padding: 9px 16px; display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; background: #fdf6e7; border-bottom: 1px solid #f1dfb4; font-size: 12.5px; color: #5a3b05; }
.quote-toggle { width: 100%; border: 0; background: transparent; padding: 9px 16px; text-align: left; font-size: 12.5px; font-weight: 500; color: var(--primary); }
.quote-toggle:hover { background: #f7f9fc; }
.quote-foot { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px 28px; padding: 12px 16px; font-size: 12.5px; color: var(--muted); background: var(--panel); border-bottom: 1px solid var(--line-soft); }
.quote-foot strong { color: var(--ink); font-weight: 500; }

.portal-page { min-height: 100vh; background: var(--bg); transition: padding-right .15s ease; }
.p-table { min-width: 1000px; }
.portal-top { background: #fff; border-bottom: 1px solid var(--line); padding: 12px 20px; display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.portal-wrap { max-width: 1320px; margin: 0 auto; padding: 20px 24px 40px; display: flex; flex-direction: column; gap: 14px; }
.p-item { border-bottom: 1px solid var(--line-soft); }
.p-item.is-missing { box-shadow: inset 3px 0 0 #c4574a; }
.p-row { display: grid; grid-template-columns: 40px minmax(200px, 2fr) 100px 150px 130px 100px 90px 120px 32px; gap: 10px; padding: 10px 16px; align-items: center; font-size: 13px; }
.p-head { padding: 8px 16px; background: var(--head); border-bottom: 1px solid var(--line-soft); font-size: 12px; font-weight: 500; color: var(--muted); }
.p-details { padding: 4px 16px 14px 66px; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; background: var(--panel); border-top: 1px dashed var(--line); }
.p-cannot { grid-column: 4 / span 5; font-size: 12.5px; color: #7a4f06; background: #fdf6e7; border-radius: 6px; padding: 7px 10px; display: flex; gap: 10px; align-items: center; }
.p-toggle { width: 30px; height: 30px; border: 1px solid var(--field); background: #fff; border-radius: 6px; font-size: 12px; color: var(--ink-2); }
.p-toggle.is-on { background: #eef0f2; }
.p-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; position: sticky; bottom: 0; background: var(--bg); padding: 10px 0; border-top: 1px solid var(--line); }
.p-actions .btn { height: 40px; }

/* ---------- Mobile ---------- */
@media (max-width: 760px) {
    .shell { flex-direction: column; }
    .sidebar { display: none; }
    .mobile-bar { display: flex; flex-direction: column; border-bottom: 1px solid var(--line); background: var(--panel); position: sticky; top: 0; z-index: 5; }
    .mobile-bar .top { display: flex; align-items: center; gap: 10px; padding: 12px 16px; }
    .mobile-bar nav { display: flex; gap: 4px; overflow-x: auto; padding: 0 12px 10px; }
    .mobile-bar .nav-link { white-space: nowrap; flex: none; font-size: 13px; padding: 8px 12px; min-height: 36px; }
    .page, .page-project { padding: 16px; }
    .project-head { padding: 14px 16px 0; position: static; }
    .item { grid-template-columns: 16px var(--pos, 36px) minmax(0, 1fr); }
    .item > :nth-child(4) { grid-column: 3; }
    .item > :nth-child(5) { grid-column: 3; align-items: flex-start !important; }
    .portal-wrap { padding: 16px 12px 32px; }
    .p-details { padding-left: 16px; }
}

/* ---------- Auth & onboarding ---------- */
.auth { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px 16px; gap: 18px; }
.auth-brand { display: flex; align-items: center; gap: 10px; }
.auth-card { width: 100%; max-width: 400px; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 24px; display: flex; flex-direction: column; gap: 14px; }
.auth-card.wide { max-width: 460px; }
.auth-title { font-size: 18px; font-weight: 600; letter-spacing: -.01em; }
.auth-foot { font-size: 12.5px; color: var(--muted); text-align: center; }
.field-error { font-size: 12px; font-weight: 400; color: var(--danger); }
.btn-block { width: 100%; height: 38px; font-size: 13.5px; }
.divider { height: 1px; background: var(--line-soft); }

/* ---------- Menus ---------- */
.menu { position: absolute; z-index: 20; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 24px rgba(22, 25, 29, .12); padding: 4px; min-width: 220px; display: flex; flex-direction: column; }
.menu-item { display: flex; align-items: center; gap: 8px; width: 100%; border: 0; background: transparent; text-align: left; padding: 7px 10px; border-radius: 6px; font-size: 13px; color: var(--ink); text-decoration: none; }
.menu-item:hover { background: #eef0f3; color: var(--ink); }
.menu-label { padding: 6px 10px 4px; font-size: 11.5px; color: var(--faint); }
.org-switch { display: flex; align-items: center; gap: 8px; width: 100%; border: 1px solid var(--line); background: #fff; border-radius: 6px; padding: 7px 10px; font-size: 13px; text-align: left; margin-bottom: 12px; }
.org-switch:hover { border-color: var(--field-hover); }
.me-button { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: transparent; padding: 8px 6px; border-radius: 6px; text-align: left; margin-top: 8px; }
.me-button:hover { background: #eef0f3; }

/* ---------- Settings tabs ---------- */
.settings-tabs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.readonly-note { font-size: 12.5px; color: var(--muted); background: #fff; border: 1px dashed var(--disabled); border-radius: 8px; padding: 10px 14px; }

/* ---------- Icons (Heroicons via blade-ui-kit/blade-heroicons) ---------- */
.icon { width: 16px; height: 16px; flex: none; }
.icon-sm { width: 14px; height: 14px; flex: none; }
.icon-lg { width: 20px; height: 20px; flex: none; }
.icon-xl { width: 32px; height: 32px; flex: none; }
.nav-link .icon { width: 18px; height: 18px; color: var(--muted); }
.nav-link:hover .icon, .nav-link.is-active .icon { color: var(--ink); }
.tab .icon { opacity: .75; }
.tab.is-active .icon { opacity: 1; }
.menu-item .icon { color: var(--muted); }
.stat-label { display: flex; align-items: center; gap: 6px; }
.stat-label .icon { color: var(--faint); }
.check .icon-sm { width: 12px; height: 12px; }
.icon-muted { color: var(--muted); }
.icon-faint { color: var(--faint); }
.inline-icon { display: inline-flex; align-items: center; gap: 4px; }
.dropzone-icon { width: 40px; height: 40px; border-radius: 8px; background: #eef3fa; color: var(--primary); display: flex; align-items: center; justify-content: center; flex: none; }

/* ---------- Supplier portal: defaults, alternatives, submitted ---------- */
.defaults-box { background: var(--panel); border: 1px solid var(--line-soft); border-radius: 8px; padding: 12px 14px; }
.alt-box { background: #fff; border: 1px solid var(--line); border-left: 3px solid #b8c4ef; border-radius: 6px; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.alt-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.submitted-banner { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; background: #e5f2ea; border: 1px solid #b9d9c5; color: #15452b; border-radius: 8px; padding: 16px 18px; }

/* ---------- Offer options modal ---------- */
.modal-xl { max-width: 980px; }
.options-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.option-card { border: 1px solid var(--line); border-radius: 8px; padding: 12px; display: flex; flex-direction: column; gap: 8px; background: #fff; }
.option-card.is-shown { border-color: #2f8a58; box-shadow: inset 0 0 0 1px #2f8a58; background: #f6fbf8; }
.option-facts { display: grid; grid-template-columns: auto 1fr; gap: 3px 10px; margin: 0; font-size: 12.5px; }
.option-facts dt { color: var(--muted); }
.option-facts dd { margin: 0; text-align: right; }
.quote-attention { padding: 9px 16px; display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; background: #fbe4e1; border-bottom: 1px solid #f0c7c1; font-size: 12.5px; color: #5e1a12; }
.quote-attention > .icon { color: var(--danger); }
.tab-badge { background: var(--danger); color: #fff; font-size: 11px; font-weight: 600; padding: 0 6px; border-radius: 999px; line-height: 16px; }

/* ---------- Compare offers ---------- */
.cmp-head { align-items: end; position: sticky; top: 0; z-index: 2; }
.cmp-group { padding: 8px 16px; background: var(--panel); border-bottom: 1px solid var(--line-soft); font-size: 12px; font-weight: 600; color: var(--muted); }
.cmp-row { padding: 8px 16px; border-bottom: 1px solid var(--line-soft); align-items: stretch; font-size: 13px; }
.cmp-cell { display: flex; flex-direction: column; gap: 3px; border: 1px solid transparent; border-radius: 6px; padding: 7px 9px; min-width: 0; }
.cmp-cell.is-empty { color: var(--faint); font-size: 12px; justify-content: center; }
.cmp-cell.is-clickable { cursor: pointer; border-color: var(--line-soft); }
.cmp-cell.is-clickable:hover { border-color: var(--field-hover); background: var(--hover-blue); }
.cmp-cell.is-lowest { background: #f7fbf8; }
.cmp-cell.is-selected, .cmp-cell.is-selected:hover { background: #e5f2ea; border-color: #2f8a58; box-shadow: inset 0 0 0 1px #2f8a58; }
.cmp-foot { padding: 10px 16px; background: var(--panel); align-items: start; }
.file-chip { display: inline-flex; align-items: center; gap: 3px; max-width: 150px; font-size: 11px; color: var(--primary-dark); border: 1px solid var(--line); border-radius: 999px; padding: 0 7px; background: #fff; text-decoration: none; }
.file-chip:hover { border-color: var(--field-hover); }
.order-summary { position: sticky; bottom: 10px; z-index: 3; box-shadow: 0 8px 24px rgba(22, 25, 29, .08); }
.category-picks { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 2px 12px; max-height: 280px; overflow-y: auto; border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; background: #fff; }

/* Required fields left empty */
.select.is-invalid, .input.is-invalid, .input-group.is-invalid { border-color: var(--danger); box-shadow: 0 0 0 1px var(--danger); }
.quote-foot-note { flex-basis: 100%; display: inline-flex; gap: 6px; align-items: flex-start; color: var(--ink-2); white-space: pre-line; }

/* Supplier import preview */
.import-rows { max-height: 360px; overflow-y: auto; border: 1px solid var(--line); border-radius: 6px; }
.import-row { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 8px 12px; border-bottom: 1px solid var(--line-soft); font-size: 13px; }
.import-row:last-child { border-bottom: 0; }

/* Offer chat (supplier portal and team preview) */
.chat-fab { position: fixed; right: 20px; bottom: 20px; z-index: 40; display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 16px 0 14px; border: 0; border-radius: 999px; background: var(--primary); color: #fff; font-size: 13.5px; font-weight: 600; box-shadow: 0 8px 24px rgba(22, 25, 29, .18); cursor: pointer; }
.chat-fab:hover { background: var(--primary-dark); }
.chat-badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: #c4574a; color: #fff; font-size: 11.5px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.chat-panel { position: fixed; top: 0; right: 0; bottom: 0; z-index: 45; width: min(var(--chat-width), 100vw); display: flex; flex-direction: column; background: #fff; border-left: 1px solid var(--line); box-shadow: -12px 0 32px rgba(22, 25, 29, .10); }
.chat-head { display: flex; gap: 10px; align-items: flex-start; padding: 14px 14px 12px 16px; border-bottom: 1px solid var(--line); }
.chat-contact { display: flex; flex-direction: column; gap: 10px; padding: 16px; }
.chat-messages { flex: 1; overflow-y: auto; padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; background: var(--bg); }
.chat-msg { display: flex; flex-direction: column; align-items: flex-start; max-width: 88%; }
.chat-msg.is-mine { align-self: flex-end; align-items: flex-end; }
.chat-meta { font-size: 11px; color: var(--muted); margin-bottom: 3px; }
.chat-bubble { padding: 8px 11px; border-radius: 10px; background: #fff; border: 1px solid var(--line); font-size: 13px; line-height: 1.45; overflow-wrap: anywhere; }
.chat-msg.is-mine .chat-bubble { background: #e5eefa; border-color: #c9daf1; }
.chat-empty { margin: auto; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; max-width: 260px; }
.chat-compose { display: flex; flex-direction: column; gap: 6px; padding: 10px 14px 14px; border-top: 1px solid var(--line); }
.chat-fab-raised { bottom: 84px; }
/* Wide screens: the offer and the chat side by side instead of the chat covering the form. */
:root { --chat-width: 380px; }
@media (max-width: 1439px) { :root { --chat-width: 330px; } }
@media (max-width: 760px) { :root { --chat-width: 100vw; } }
@media (min-width: 1100px) {
    body:has(.chat-panel) .portal-page { padding-right: var(--chat-width); }
    body:has(.chat-panel) .portal-wrap { padding-left: 16px; padding-right: 16px; }
    body:has(.chat-panel) .p-table { min-width: 900px; }
    body:has(.chat-panel) .p-row { grid-template-columns: 40px minmax(140px, 2fr) 85px 130px 110px 90px 75px 110px 28px; gap: 8px; }
}
@media (max-width: 640px) { .chat-fab span:not(.chat-badge) { display: none; } .chat-fab { padding: 0 12px; } }

/* Team inbox (sidebar) */
.inbox { margin-bottom: 6px; }
.inbox-button { width: 100%; cursor: pointer; }
.inbox-button.has-unread { border-color: #e2b4ae; background: #fff7f5; }
.inbox-button.is-open { border-color: var(--primary); }
.inbox-panel { position: fixed; left: 242px; bottom: 16px; z-index: 40; width: 360px; max-height: min(520px, calc(100vh - 32px)); display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 12px 32px rgba(22, 25, 29, .16); overflow: hidden; }
.inbox-list { overflow-y: auto; }
.inbox-row { display: flex; flex-direction: column; gap: 2px; padding: 10px 14px; border-bottom: 1px solid var(--line-soft); color: inherit; text-decoration: none; font-size: 13px; }
.inbox-row:hover { background: var(--panel); }
.inbox-row.is-unread { background: #f3f7fd; box-shadow: inset 3px 0 0 var(--primary); }
.mobile-messages { position: relative; display: inline-flex; color: var(--ink-2); padding: 4px; }
.mobile-messages .chat-badge { position: absolute; top: -4px; right: -8px; transform: scale(.85); }
.btn-attention { border-color: #e2b4ae; }

/* Search boxes, bulk "Move to", product files, split button */
.search-box { display: flex; align-items: center; gap: 6px; height: 34px; padding: 0 4px 0 10px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.search-box:focus-within { outline: 2px solid rgba(47, 95, 158, .25); border-color: var(--primary); }
.search-box input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 13px; }
.search-box input::-webkit-search-cancel-button { display: none; }
.bulk-move { height: 30px; max-width: 220px; font-size: 13px; }
.file-thumb { width: 36px; height: 36px; flex: none; border-radius: 4px; border: 1px solid var(--line); background: var(--panel); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.file-thumb img { width: 100%; height: 100%; object-fit: cover; }
.file-add { display: block; padding: 9px 10px; font-size: 13px; color: var(--primary-dark); cursor: pointer; }
.file-add:hover { background: var(--panel); }
.split-btn { position: relative; display: inline-flex; }
.split-btn > .btn:first-child { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.split-btn .split-caret { border-top-left-radius: 0; border-bottom-left-radius: 0; border-left: 1px solid rgba(255, 255, 255, .35); padding: 7px 8px; }
.menu-item > span { text-align: left; line-height: 1.3; }
