/* Silk Logistics quoting tool. Brand taken from silklogistics.com.au:
   black header/footer, orange #F5A714, Montserrat headings (uppercase), Open Sans body, 7px buttons. */
:root {
  --black: #000;
  --ink: #231f20;
  --text: #534741;
  --muted: #8a817c;
  --line: #e2e4e6;
  --line-strong: #cdd1d4;
  --bg: #f3f4f5;
  --card: #fff;
  --panel: #4d4d4d;
  --orange: #f5a714;
  --orange-dark: #d98e00;
  --orange-soft: #fff4dd;
  --green: #2e7d4f;
  --green-soft: #e3f3e9;
  --red: #b3261e;
  --red-soft: #fbe7e5;
  --blue: #2f5f8a;
  --blue-soft: #e5eef7;
  --radius: 7px;
  --head: 'Montserrat', 'Segoe UI', Arial, sans-serif;
  --body: 'Open Sans', 'Segoe UI', Arial, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.55 var(--body); }
a { color: var(--ink); }
a:hover { color: var(--orange-dark); }
h1, h2, h3 { font-family: var(--head); font-weight: 600; text-transform: uppercase; color: var(--ink); letter-spacing: .02em; margin: 0; }
h1 { font-size: 22px; }
h2 { font-size: 15px; }
h3 { font-size: 13px; color: var(--orange-dark); }
p { margin: 0 0 10px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.hidden { display: none !important; }
.show-sm { display: none; }

/* ---------- Header ---------- */
.top { background: var(--black); color: #fff; }
.top-in { max-width: 1240px; margin: 0 auto; padding: 0 20px; display: flex; align-items: center; gap: 22px; min-height: 76px; }
.brand { display: flex; align-items: center; gap: 14px; text-decoration: none; color: #fff; }
.brand img { width: 56px; height: 56px; display: block; }
.brand span { font-family: var(--head); font-weight: 600; text-transform: uppercase; letter-spacing: .12em; font-size: 13px; color: var(--line-strong); border-left: 1px solid #333; padding-left: 14px; }
.nav { display: flex; gap: 4px; flex: 1; }
.nav a { color: #fff; text-decoration: none; font-family: var(--head); font-size: 12.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; padding: 8px 12px; border-radius: 5px; position: relative; }
.nav a:hover { background: #1c1c1c; color: #fff; }
.nav a.on { color: var(--orange); }
.nav a.on::after { content: ''; position: absolute; left: 12px; right: 12px; bottom: 0; height: 2px; background: var(--orange); }
.who { margin-left: auto; display: flex; align-items: center; gap: 12px; font-size: 12.5px; color: var(--line-strong); }
.who a { color: #fff; }
.who form { margin: 0; }
.linkbtn { background: none; border: 0; padding: 0; color: #fff; font: inherit; text-decoration: underline; cursor: pointer; }

/* ---------- Page ---------- */
main { max-width: 1240px; margin: 0 auto; padding: 26px 20px 60px; }
.pagehead { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.pagehead h1 { border-left: 4px solid var(--orange); padding-left: 12px; line-height: 1.15; }
.pagehead .sub { margin: 4px 0 0 16px; color: var(--muted); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 20px; margin-bottom: 18px; }
.card > h2 { margin-bottom: 14px; }
.grid { display: grid; gap: 18px; }
.cols-2 { grid-template-columns: 1fr 1fr; }
.side { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
@media (max-width: 960px) { .side, .cols-2 { grid-template-columns: 1fr; } }
.footer { text-align: center; color: var(--muted); font-size: 12px; padding: 0 20px 30px; }

/* ---------- Flash ---------- */
.flash { border-radius: 7px; padding: 12px 16px; margin-bottom: 18px; border: 1px solid; }
.flash.ok { background: var(--green-soft); border-color: #b9dfc7; color: #1d5a37; }
.flash.err { background: var(--red-soft); border-color: #f1c2bd; color: #8a1c15; }
.flash.info { background: var(--orange-soft); border-color: #f6d690; color: #6b4a00; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--orange); background: var(--orange); color: #fff; font: 700 13px/1 var(--body); text-transform: uppercase; letter-spacing: .03em; padding: 12px 26px; border-radius: var(--radius); cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { background: var(--orange-dark); border-color: var(--orange-dark); color: #fff; }
.btn.dark { background: var(--panel); border-color: var(--panel); }
.btn.dark:hover { background: #333; border-color: #333; }
.btn.ghost { background: #fff; color: var(--ink); border-color: var(--line-strong); }
.btn.ghost:hover { border-color: var(--ink); color: var(--ink); }
.btn.danger { background: #fff; color: var(--red); border-color: #e6b3ae; }
.btn.danger:hover { background: var(--red-soft); }
.btn.small { padding: 8px 14px; font-size: 12px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* ---------- Forms ---------- */
label { display: block; font-weight: 600; color: var(--ink); font-size: 12.5px; margin-bottom: 5px; }
label .opt { font-weight: 400; color: var(--muted); }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=search], input[type=number], select, textarea {
  width: 100%; font: 14px/1.4 var(--body); color: var(--ink); background: #fff; border: 1px solid var(--line-strong); border-radius: 6px; padding: 9px 11px;
}
textarea { resize: vertical; min-height: 70px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--orange); box-shadow: 0 0 0 3px rgba(245, 167, 20, .2); }
.field { margin-bottom: 14px; }
.row { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.check { display: flex; gap: 8px; align-items: flex-start; font-weight: 400; color: var(--text); font-size: 13.5px; }
.check input { margin-top: 3px; }
.choice { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.choice label { display: block; border: 1px solid var(--line-strong); border-radius: 7px; padding: 12px 14px; cursor: pointer; font-weight: 400; color: var(--text); margin: 0; }
.choice label b { color: var(--ink); font-size: 13.5px; }
.choice label span { display: block; margin: 2px 0 0 22px; font-size: 13px; }
.choice input { margin-right: 6px; accent-color: var(--orange); }
.choice label:has(input:checked) { border-color: var(--orange); background: var(--orange-soft); }
@media (max-width: 560px) { .choice { grid-template-columns: 1fr; } }

/* ---------- Tables ---------- */
.tablewrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { font-family: var(--head); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); text-align: left; padding: 10px 10px; border-bottom: 2px solid var(--line); white-space: nowrap; }
td { padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr.link { cursor: pointer; }
tr.link:hover td { background: #fafafa; }
tr.new td:first-child { box-shadow: inset 3px 0 0 var(--orange); }
.items td { vertical-align: middle; }
.totals { margin-left: auto; width: 320px; max-width: 100%; margin-top: 10px; }
.totals td { border: 0; padding: 5px 10px; }
.totals tr.grand td { border-top: 2px solid var(--ink); font-weight: 700; color: var(--ink); font-size: 15px; padding-top: 9px; }
.empty { text-align: center; padding: 40px 10px; color: var(--muted); }

/* Item editor */
.item-row td { padding: 6px 4px; border-bottom: 0; vertical-align: middle; }
.item-row input { padding: 8px 9px; }
.item-row .del { background: none; border: 0; color: var(--muted); font-size: 20px; cursor: pointer; line-height: 1; padding: 4px 8px; }
.item-row .del:hover { color: var(--red); }
.col-qty { width: 80px; } .col-unit { width: 120px; } .col-price { width: 130px; } .col-total { width: 120px; } .col-del { width: 36px; }

/* ---------- Badges ---------- */
.badge { display: inline-block; font: 600 10.5px/1 var(--head); text-transform: uppercase; letter-spacing: .06em; padding: 5px 8px; border-radius: 4px; border: 1px solid transparent; white-space: nowrap; }
.b-draft { background: #eef0f1; color: #5d6266; }
.b-sent { background: var(--blue-soft); color: var(--blue); }
.b-accepted { background: var(--orange-soft); color: #8a5a00; border-color: #f6d690; }
.b-closed { background: var(--green-soft); color: var(--green); }
.b-withdrawn { background: #eef0f1; color: #8a8f93; text-decoration: line-through; }
.b-expired { background: var(--red-soft); color: var(--red); }
.b-variance { background: var(--red-soft); color: var(--red); }
.b-match { background: var(--green-soft); color: var(--green); }

/* ---------- Filters / tabs ---------- */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar form { display: flex; gap: 8px; flex: 1; min-width: 240px; max-width: 460px; }
.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--line); margin-bottom: 16px; flex-wrap: wrap; }
.tabs a { text-decoration: none; font: 600 12px var(--head); text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 10px 14px; margin-bottom: -2px; border-bottom: 2px solid transparent; }
.tabs a.on { color: var(--ink); border-bottom-color: var(--orange); }
.tabs a .n { color: var(--muted); font-weight: 500; margin-left: 4px; }

/* ---------- Detail ---------- */
dl.kv { display: grid; grid-template-columns: 140px 1fr; gap: 6px 14px; margin: 0; }
dl.kv dt { color: var(--muted); font-size: 12.5px; }
dl.kv dd { margin: 0; color: var(--ink); word-break: break-word; }
.preview-frame { width: 100%; height: 760px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.callout { background: var(--orange-soft); border: 1px solid #f6d690; border-radius: 7px; padding: 12px 14px; }
.variance-neg { color: var(--red); font-weight: 600; }
.variance-pos { color: var(--blue); font-weight: 600; }
.variance-ok { color: var(--green); font-weight: 600; }
code, .mono { font-family: Consolas, 'Courier New', monospace; font-size: 12.5px; }
.copy-field { display: flex; gap: 6px; }
.copy-field input { font-family: Consolas, monospace; font-size: 12px; }

/* Compose window: attachments */
.files { border: 1px solid var(--line-strong); border-radius: 7px; background: #fff; }
.file-row { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-top: 1px solid var(--line); }
.files > .file-row:first-child { border-top: 0; }
.file-row input[type=checkbox] { width: 16px; height: 16px; margin: 0; flex: none; accent-color: var(--orange); }
.file-row label { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; margin: 0; font-weight: 400; cursor: pointer; }
.file-row:has(input:not(:checked)) label { color: var(--muted); text-decoration: line-through; }
.file-name { flex: 1; min-width: 0; color: inherit; overflow-wrap: anywhere; }
.file-row label .file-name { color: var(--ink); }
.file-row:has(input:not(:checked)) .file-name { color: var(--muted); }
.file-tag { flex: none; font: 700 9.5px/1 var(--head); letter-spacing: .05em; color: #fff; background: var(--red); border-radius: 3px; padding: 4px 5px; text-decoration: none; }
.file-row .del { flex: none; background: none; border: 0; color: var(--muted); font-size: 20px; line-height: 1; cursor: pointer; padding: 0 4px; }
.file-row .del:hover { color: var(--red); }
.attach-add { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 12px; }
.attach-add .hint { margin: 0; flex: 1; min-width: 200px; }
label.btn { margin: 0; }
.file-input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.attach-add:has(.file-input:focus-visible) label.btn { box-shadow: 0 0 0 3px rgba(245, 167, 20, .35); }
.field-error { color: var(--red); font-size: 12.5px; margin-top: 8px; }

/* ---------- Sign-in / public pages ---------- */
.solo { max-width: 440px; margin: 60px auto; padding: 0 16px; }
.solo .card { padding: 28px; }
.solo .logo { display: block; margin: 0 auto 18px; width: 90px; }
.public-top { background: var(--black); }
.public-top .top-in { min-height: 90px; justify-content: space-between; }
.public-top .contact { color: var(--line-strong); font-size: 13px; text-align: right; }
.public-top .contact a { color: #fff; text-decoration: none; }
.public main { max-width: 860px; }
.accept-box { border: 2px solid var(--orange); border-radius: 10px; padding: 22px; background: #fffdf8; }
.big-total { font: 700 30px/1.1 var(--head); color: var(--ink); }
.public-footer { background: var(--black); color: var(--line-strong); text-align: center; padding: 22px 16px; font-size: 12.5px; }
.public-footer a { color: #fff; }

/* Temp password list */
.pw-list td { font-family: Consolas, monospace; }

@media (max-width: 760px) {
  .top-in { flex-wrap: wrap; padding: 10px 16px; gap: 10px; }
  .brand img { width: 44px; height: 44px; }
  .nav { order: 3; width: 100%; flex: none; flex-wrap: wrap; margin-left: -12px; }
  main { padding: 18px 16px 50px; }
  dl.kv { grid-template-columns: 1fr; gap: 2px; }
  dl.kv dd { margin-bottom: 8px; }
  .hide-sm { display: none; }
  .show-sm { display: block; }
}
@media print {
  .top, .nav, .actions, .toolbar, .tabs, .footer, .no-print { display: none !important; }
  body { background: #fff; }
  .card { border: 0; padding: 0; }
}

/* Customer pages: footer sits at the bottom even on short pages. */
body.public { min-height: 100vh; display: flex; flex-direction: column; }
body.public main { flex: 1; width: 100%; }
.public-top .brand img { width: 72px; height: 72px; }

/* Quotes sent from Outlook, the Inbox, Email setup (1 Nov 2026) */
.b-outlook { background: var(--blue-soft); color: var(--blue); }
.b-check { background: var(--red-soft); color: var(--red); }
.b-done { background: var(--green-soft); color: var(--green); }
.b-review { background: var(--orange-soft); color: #8a5a00; border-color: #f6d690; }
.b-failed { background: var(--red-soft); color: var(--red); }
.b-reading { background: var(--blue-soft); color: var(--blue); }
.b-dismissed { background: #eef0f1; color: #8a8f93; }
.callout.info { background: var(--blue-soft); border-color: #c9d9ea; }
.callout.ok { background: var(--green-soft); border-color: #b9dfc7; color: #1d5a37; margin-bottom: 18px; }
.callout.warn { background: var(--orange-soft); border-color: #f6d690; }
.callout + .grid, .callout.warn { margin-bottom: 18px; }
.callout .actions form { display: inline; }
ul.flags { margin: 6px 0 0 18px; padding: 0; }
ul.flags li { margin: 2px 0; }
pre.email-body { white-space: pre-wrap; word-break: break-word; font: 12.5px/1.5 Consolas, 'Courier New', monospace; background: #f7f7f8; border: 1px solid var(--line); border-radius: 6px; padding: 12px; margin: 14px 0 0; max-height: 520px; overflow: auto; color: var(--text); }
.sig-preview { border: 1px dashed var(--line-strong); border-radius: 7px; padding: 6px 16px 14px; background: #fff; margin-top: 10px; }
ol.steps, ul.steps { margin: 6px 0 12px 18px; padding: 0; }
ol.steps li, ul.steps li { margin: 4px 0; }
form.stack { display: grid; gap: 8px; margin-top: 10px; }

/* Pop-ups: passkey boxes and "are you sure?" (1 Nov 2026) */
dialog.pop { border: 0; border-radius: 10px; padding: 24px; width: min(400px, calc(100vw - 32px)); box-shadow: 0 24px 70px rgba(0,0,0,.35); color: inherit; }
dialog.pop::backdrop { background: rgba(0,0,0,.55); }
dialog.pop h2 { margin: 0 0 4px; }
dialog.pop .pop-msg { margin: 0; font-size: 15px; }
dialog.pop input[type=password] { margin-top: 12px; }
dialog.pop .flash { margin: 12px 0 0; }
dialog.pop .actions { margin-top: 18px; }
