:root {
  /* ELUS brand (from elus.com) */
  --navy: #002954; --blue: #1c3876; --orange: #f79220; --orange-ink: #d97b0e; --gold: #daa350;
  --ink: #141617; --ink-2: #2a3a56; --paper: #f2f3f5; --panel: #fff; --line: #dde1e8; --line-2: #eceef2;
  --muted: #5b6577; --accent: var(--blue); --accent-ink: #13295a; --accent-soft: #e7ecf6;
  --err: #b42318; --err-bg: #fdecea; --ok: #1f7a4d; --ok-bg: #e4f3eb;
  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --head: var(--sans);
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --r: 11px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 15px/1.55 var(--sans); color: var(--ink); background: var(--paper); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); }
a:hover { color: var(--accent-ink); }
h1, h2, h3 { line-height: 1.2; margin: 0; font-family: var(--head); font-weight: 600; letter-spacing: -0.01em; color: var(--blue); }
h3 { color: var(--ink-2); }
.mono { font-family: var(--mono); letter-spacing: 0.02em; }
.muted { color: var(--muted); }
.right { text-align: right; }
.nowrap { white-space: nowrap; }

/* Controls */
label { display: block; font-weight: 600; font-size: 14px; margin: 16px 0 0; }
.opt { font-weight: 400; color: var(--muted); font-size: 13px; margin-left: 4px; }
input, select, textarea {
  display: block; width: 100%; margin-top: 6px; padding: 10px 12px; font: inherit; color: var(--ink);
  background: #fff; border: 1px solid var(--line); border-radius: 8px; transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input.locked { background: var(--paper); color: var(--ink-2); border-style: dashed; }
textarea { resize: vertical; }
button, .button {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 16px; font: inherit; font-weight: 600; font-size: 14px;
  color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: var(--r); cursor: pointer; text-decoration: none; white-space: nowrap; font-family: var(--sans);
}
button:hover, .button:hover { border-color: #b9c3be; color: var(--ink); }
button:focus-visible, .button:focus-visible, a:focus-visible { outline: 3px solid var(--accent-soft); outline-offset: 2px; }
.primary { background: var(--orange); border-color: var(--orange); color: #fff; }
.primary:hover { background: var(--orange-ink); border-color: var(--orange-ink); color: #fff; }
.block { width: 100%; margin-top: 22px; padding: 12px; font-size: 15px; }
.ghost { background: transparent; }
.sm { padding: 6px 12px; font-size: 13px; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 400; }
.check input { width: auto; margin: 0; }
.msg { padding: 11px 14px; border-radius: 8px; margin: 16px 0 0; font-size: 14px; }
.msg.error { background: var(--err-bg); color: var(--err); }
.msg.ok { background: var(--ok-bg); color: var(--ok); }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 560px) { .row { grid-template-columns: 1fr; } }

/* Public pages */
.pub-top { padding: 18px 28px; }
.wordmark { font-weight: 700; font-size: 17px; color: var(--ink); text-decoration: none; letter-spacing: -0.01em; }
.pub-main { padding: 12px 20px 60px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 32px; box-shadow: 0 1px 2px rgba(19,33,46,.04), 0 8px 24px rgba(19,33,46,.05); }
.narrow { max-width: 520px; margin: 4vh auto 0; }
.card h1 { font-size: 24px; }
.lead { color: var(--muted); margin: 6px 0 0; }
.fine { color: var(--muted); font-size: 13px; margin: 18px 0 0; }
.center { text-align: center; }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.tick { width: 56px; height: 56px; margin: 0 auto 16px; border-radius: 50%; display: grid; place-items: center; background: var(--ok-bg); color: var(--ok); }
.ref { font-size: 26px; font-weight: 500; margin: 6px 0 0; color: var(--ink); }
.center .button { margin-top: 24px; }

/* Sign-in split */
.split { max-width: 940px; margin: 3vh auto 0; display: grid; grid-template-columns: 1.05fr 1fr; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; box-shadow: 0 10px 30px rgba(19,33,46,.07); }
.brand-panel { background-color: var(--navy); color: #dfe7ea; padding: 48px 44px; display: flex; flex-direction: column; justify-content: flex-end; min-height: 440px;
  background-image: repeating-linear-gradient(0deg, rgba(255,255,255,.035) 0 1px, transparent 1px 28px), linear-gradient(160deg, #000 0%, var(--navy) 55%, var(--blue) 100%); }
.brand-name { margin: 0 0 auto; font-weight: 600; color: #9fb4bd; }
.brand-panel h1 { font-size: 44px; color: #fff; font-weight: 700; letter-spacing: -0.02em; }
.brand-panel h1::after { content: ""; display: block; width: 72px; height: 3px; background: var(--orange); margin-top: 16px; }
.brand-panel p:last-child { margin: 14px 0 0; max-width: 34ch; color: #b8c7cd; }
.form-panel { padding: 48px 44px; display: flex; flex-direction: column; justify-content: center; }
.form-panel h2 { font-size: 22px; }
.aside-link { margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line-2); font-size: 14px; color: var(--muted); }
@media (max-width: 760px) {
  .split { grid-template-columns: 1fr; }
  .brand-panel { min-height: 0; padding: 32px 28px; }
  .brand-panel h1 { font-size: 34px; }
  .form-panel { padding: 32px 28px; }
}

/* Upload drop zone */
.for-drop { margin-bottom: 6px; }
.drop { position: relative; border: 1.5px dashed #b7c2bd; border-radius: 10px; background: #fafbfa; padding: 26px 18px; text-align: center; transition: border-color .15s, background .15s; }
.drop input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.drop-text { color: var(--muted); font-size: 14px; }
.drop-text strong { color: var(--accent); }
.drop-text span { display: block; font-size: 12.5px; margin-top: 4px; }
.drop-name { font-weight: 600; margin-top: 8px; word-break: break-all; }
.drop-name:empty { display: none; }
.drop.over, .drop:focus-within { border-color: var(--accent); background: var(--accent-soft); }
.drop.has-file { border-style: solid; border-color: var(--accent); background: var(--accent-soft); }

/* Team layout */
.team-top { display: flex; align-items: center; gap: 28px; padding: 0 28px; height: 64px; background: linear-gradient(180deg, #000 0%, var(--navy) 100%); color: #fff; position: sticky; top: 0; z-index: 5; }
.team-top .wordmark { color: #fff; display: flex; align-items: baseline; gap: 10px; }
.team-top .wordmark span { font-weight: 400; font-size: 13px; color: #9fb4bd; }
.tabs { display: flex; gap: 4px; height: 100%; }
.tabs a { display: flex; align-items: center; padding: 0 12px; color: #c7d2e3; text-transform: uppercase; letter-spacing: .04em; font-size: 13px; text-decoration: none; font-size: 14px; font-weight: 500; border-bottom: 2px solid transparent; }
.tabs a:hover { color: #fff; }
.tabs a.on { color: #fff; border-bottom-color: var(--orange); }
.who { margin-left: auto; display: flex; align-items: center; gap: 12px; font-size: 14px; color: #b8c7cd; }
.who .ghost { color: #fff; border-color: #3a5063; }
.who .ghost:hover { border-color: #6b8396; color: #fff; }
@media (max-width: 820px) {
  .team-top { flex-wrap: wrap; height: auto; padding: 12px 18px; gap: 10px; }
  .tabs { order: 3; width: 100%; overflow-x: auto; }
  .tabs a { padding: 8px 10px; }
  .who span { display: none; }
}
.team-main { max-width: 1320px; margin: 0 auto; padding: 28px 24px 64px; }
.page-head { margin-bottom: 18px; }
.page-head h1 { font-size: 28px; }
.page-head h1::after, .portal-head h1::after { content: ""; display: block; width: 48px; height: 3px; background: var(--orange); margin-top: 10px; }
.page-head p { margin: 4px 0 0; color: var(--muted); }

/* Status */
.st-new { --c: var(--blue); --bg: var(--accent-soft); }
.st-logged { --c: #9a5a06; --bg: #fdeed9; }
.st-sent { --c: var(--ok); --bg: var(--ok-bg); }
.st-problem { --c: #b42318; --bg: #fdecea; }
.badge { display: inline-block; padding: 2px 10px; border-radius: 20px; font-size: 12.5px; font-weight: 600; color: var(--c, var(--ink-2)); background: var(--bg, var(--line-2)); }
.status-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.seg { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 8px; background: var(--panel); border: 1px solid var(--line); color: var(--ink); text-decoration: none; font-size: 14px; font-weight: 500; }
.seg b { font-weight: 600; color: var(--c, var(--muted)); }
.seg:hover { border-color: #b9c3be; color: var(--ink); }
.seg.on { border-color: var(--c, var(--ink)); box-shadow: inset 0 0 0 1px var(--c, var(--ink)); background: var(--bg, #fff); }
.status-select { font-weight: 600; color: var(--c); background: var(--bg); border-color: transparent; min-width: 170px; }

/* Filters */
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); margin-bottom: 18px; }
.filters input, .filters select { width: auto; margin: 0; padding: 8px 10px; font-size: 14px; }
.filters .grow { flex: 1 1 240px; }
.filters .clear { font-size: 14px; padding: 0 6px; }

/* Tables */
.table-wrap { overflow-x: auto; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--blue); padding: 11px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; background: #fafbfa; }
td { padding: 12px 14px; border-top: 1px solid var(--line-2); vertical-align: top; }
tbody tr:first-child td { border-top: 0; }
tbody tr:hover td { background: #fafcfb; }
.sub { color: var(--muted); font-size: 12.5px; margin-top: 3px; }
.sub a { color: inherit; }
.note { margin-top: 6px; padding: 6px 9px; background: var(--paper); border-radius: 6px; font-size: 13px; color: var(--ink-2); max-width: 320px; }
.cell-input { margin: 0; padding: 7px 9px; font-size: 14px; min-width: 150px; }
.file { font-weight: 500; word-break: break-all; }
.group { font-size: 17px; margin: 26px 0 10px; display: flex; align-items: center; gap: 10px; }
.group span { font-size: 13px; font-weight: 600; color: var(--muted); background: var(--line-2); padding: 1px 9px; border-radius: 20px; }
.empty { text-align: center; padding: 56px 20px; background: var(--panel); border: 1px dashed var(--line); border-radius: var(--r); }
.empty h3 { font-size: 17px; }
.empty p { color: var(--muted); margin: 6px 0 0; }

/* Two column management pages */
.two-col { display: grid; grid-template-columns: 340px 1fr; gap: 20px; align-items: start; }
@media (max-width: 900px) { .two-col { grid-template-columns: 1fr; } }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 22px; }
.panel h2 { font-size: 17px; }
.panel label:first-of-type { margin-top: 12px; }
.inline-form { display: flex; gap: 8px; align-items: center; }
.code-banner { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin: 0 0 18px; }
.code-banner .code { font-size: 20px; font-weight: 500; background: #fff; padding: 4px 12px; border-radius: 6px; color: var(--ink); }
.code-banner small { flex-basis: 100%; color: var(--ok); }

/* Seen marker */
.st-unseen { --c: var(--orange-ink); --bg: #fff1e0; }
tr.unseen td:first-child { box-shadow: inset 3px 0 0 var(--orange); }
tr.unseen td { background: #fffaf3; }
.seen-btn { gap: 8px; padding: 6px 11px; font-size: 13px; }
.seen-btn .box { width: 15px; height: 15px; border: 1.5px solid #9aa7ae; border-radius: 4px; background: #fff; display: inline-grid; place-items: center; }
.seen-btn.is-seen { color: var(--ok); border-color: #b9dcc8; background: var(--ok-bg); }
.seen-btn.is-seen .box { border-color: var(--ok); background: var(--ok); }
.seen-btn.is-seen .box::after { content: ""; width: 7px; height: 4px; border: 2px solid #fff; border-top: 0; border-right: 0; transform: translateY(-1px) rotate(-45deg); }
.notes-input { min-width: 200px; font-size: 13px; padding: 6px 8px; }

/* Row actions */
.actions { white-space: nowrap; }
.actions form { display: inline-block; margin-left: 6px; }
.danger { color: var(--err); border-color: #f1c4bf; background: #fff; }
.danger:hover { color: #fff; background: var(--err); border-color: var(--err); }
.name-input { min-width: 180px; font-weight: 600; }

/* Logo */
.logo { display: block; height: auto; }
.logo.on-light { width: 132px; filter: brightness(0); opacity: .86; }
.team-top .logo { width: 92px; }
.team-top .wordmark { align-items: center; gap: 14px; }
.team-top .wordmark span { font-size: 14px; font-weight: 600; color: #dfe7ea; padding-left: 14px; border-left: 1px solid #3a5063; }
.brand-name .logo { width: 170px; }
body.public .split { margin-top: 8vh; }
@media (max-width: 760px) { .brand-name .logo { width: 140px; } .brand-panel h1 { margin-top: 28px; } }

/* Access code show/copy */
.code-field { display: flex; gap: 6px; align-items: center; }
.code-value { min-width: 170px; max-width: 220px; background: var(--paper); }
.change-code { margin-top: 8px; font-size: 13px; }
.change-code summary { cursor: pointer; color: var(--accent); width: max-content; }
.change-code summary:hover { color: var(--accent-ink); }
.change-code form { margin-top: 8px; }

/* File icons */
.files { display: flex; gap: 6px; flex-wrap: wrap; align-items: flex-start; }
.file-icon { position: relative; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; width: 44px; padding: 5px 0 4px;
  border: 1px solid var(--line); border-radius: 8px; color: var(--ink-2); background: #fff; text-decoration: none; line-height: 1; }
.file-icon:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.file-icon .ext { font-size: 9.5px; font-weight: 700; letter-spacing: .03em; margin-top: 2px; }
.file-icon .file-label { font-size: 10px; color: var(--muted); margin-top: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.po-input { min-width: 110px; width: 120px; }
.new-mfr { margin-top: 6px; }
.mfr-state { color: var(--orange-ink); }
.mfr-state.ok { color: var(--ok); }
.note-from { font-weight: 600; color: var(--ink-2); }
.mfr-note { background: #fdf3e6; }
.note + .notes-input, .note + .note { margin-top: 6px; }
.notes-input { margin-top: 6px; }

/* Manufacturer portal */
.portal { max-width: 960px; margin: 2vh auto 0; }
.portal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.portal-head h1 { font-size: 26px; }
.po-card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 14px; overflow: hidden; }
.po-card.unseen { border-left: 4px solid var(--orange); }
.po-card-head { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; padding: 16px 20px; border-bottom: 1px solid var(--line-2); }
.po-card-head h2 { font-size: 17px; }
.po-num { font-weight: 500; color: var(--muted); font-size: 15px; margin-left: 6px; }
.po-card-actions { display: flex; align-items: center; gap: 10px; }
.po-card-body { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
.po-card-body section { padding: 16px 20px; }
.po-card-body section + section { border-left: 1px solid var(--line-2); }
.po-card-body h3 { font-size: 14px; margin-bottom: 10px; }
@media (max-width: 720px) { .po-card-body { grid-template-columns: 1fr; } .po-card-body section + section { border-left: 0; border-top: 1px solid var(--line-2); } }
.mfr-upload { margin-top: 12px; display: grid; gap: 8px; }
.mfr-upload select { margin: 0; }
.mfr-upload button { justify-self: start; }
.drop-sm { padding: 14px 12px; }
.mfr-note-form { margin-top: 10px; display: grid; gap: 8px; }
.mfr-note-form textarea { margin: 0; }
.mfr-note-form button { justify-self: start; }

/* Customer portal, order detail, file management */
.submit-card { margin-bottom: 26px; }
.submit-card h2 { font-size: 19px; }
.section-title { font-size: 19px; margin: 8px 0 12px; display: flex; align-items: center; gap: 10px; }
.section-title span { font-size: 13px; font-weight: 600; color: var(--muted); background: var(--line-2); padding: 1px 9px; border-radius: 20px; }
.cust-status { display: inline-block; padding: 5px 12px; border-radius: 20px; font-size: 13px; font-weight: 600; color: var(--navy); background: #fdeed9; border: 1px solid #f6cf9d; max-width: 340px; }
.btn-row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 24px; }
.center .btn-row .button { margin-top: 0; }
.file-row { display: flex; align-items: flex-start; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line-2); flex-wrap: wrap; }
.file-row:first-of-type { border-top: 0; }
.file-meta { flex: 1 1 160px; min-width: 0; }
.file-name { display: block; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink); text-decoration: none; }
.file-name:hover { color: var(--accent); text-decoration: underline; }
.remove { font-size: 13px; }
.remove summary { cursor: pointer; color: var(--err); list-style: none; padding: 4px 0; }
.remove summary::-webkit-details-marker { display: none; }
.remove[open] { flex-basis: 100%; }
.remove-form { display: grid; gap: 8px; margin-top: 6px; padding: 10px; background: var(--err-bg); border-radius: 8px; }
.remove-form textarea { margin: 0; font-size: 13px; }
.remove-form button { justify-self: start; }
.delete-order { margin-top: 18px; padding-top: 12px; border-top: 1px solid var(--line-2); }
.chips { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 6px; }
.chip { font-size: 11.5px; font-weight: 600; padding: 1px 8px; border-radius: 20px; background: var(--line-2); color: var(--ink-2); }
.chip.warm { background: #fdeed9; color: #9a5a06; }
.cust-link { font-weight: 600; color: var(--ink); text-decoration: none; }
.cust-link:hover { color: var(--accent); text-decoration: underline; }
.cust-status-input { min-width: 170px; }
.seg-deleted { --c: var(--err); --bg: var(--err-bg); }
.back { display: inline-block; margin-bottom: 10px; font-size: 14px; text-decoration: none; }
.order-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.order-grid { display: grid; grid-template-columns: minmax(280px, 380px) 1fr; gap: 20px; align-items: start; }
@media (max-width: 900px) { .order-grid { grid-template-columns: 1fr; } }
.order-form .mfr-select, .order-form .status-select { margin-top: 6px; width: 100%; }
.stack-col { display: grid; gap: 20px; }
.panel h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 18px 0 6px; }
.team-upload { border-top: 1px solid var(--line-2); margin-top: 16px; padding-top: 4px; }
.history { margin-top: 16px; font-size: 14px; }
.history summary { cursor: pointer; color: var(--muted); font-weight: 600; }
.removed { padding: 8px 0; border-top: 1px solid var(--line-2); }
.danger-zone { border-color: #f1c4bf; }
.danger-zone .delete-order { margin: 0; padding: 0; border: 0; }

/* Customer dashboard header */
.head-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.empty .button { margin-top: 16px; }
.card .back { margin-bottom: 14px; }

/* Account */
.panel-sep { margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line-2); }

/* Unified sign-in */
.login-block h3 { font-size: 15px; color: var(--blue); }
.login-block .fine { margin-top: 4px; }
.login-block .block { margin-top: 16px; }
.or { display: flex; align-items: center; gap: 12px; margin: 22px 0 18px; color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: .06em; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* Profile popup */
.who-name { background: transparent; border: 1px solid transparent; color: #fff; font-weight: 600; padding: 6px 10px; }
.who-name:hover { color: #fff; border-color: #3a5063; background: rgba(255,255,255,.06); }
.who-name::after { content: ""; display: inline-block; margin-left: 8px; border: 4px solid transparent; border-top-color: currentColor; transform: translateY(2px); }
.modal { width: min(440px, calc(100vw - 32px)); border: 1px solid var(--line); border-radius: 14px; padding: 24px; color: var(--ink); box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.modal::backdrop { background: rgba(0, 20, 40, .45); }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.modal-head h2 { font-size: 20px; }
.profile-info { display: grid; grid-template-columns: 70px 1fr; gap: 6px 12px; margin: 0 0 6px; padding: 14px; background: var(--paper); border-radius: 10px; font-size: 14px; }
.profile-info dt { color: var(--muted); }
.profile-info dd { margin: 0; font-weight: 500; word-break: break-all; }
.modal h3 { font-size: 15px; margin-top: 20px; }
