/* ============================================================
   SHEARN BIDDESK — internal sealed-bid trading platform
   Shearn Group Ltd
   ============================================================ */
:root {
  --navy: #0e2233;
  --navy-2: #14314a;
  --navy-3: #1b3f5e;
  --blue: #0966c1;
  --blue-bright: #2e8ae6;
  --blue-dark: #07508f;
  --blue-wash: #e9f2fb;
  --gold: #e8a13a;
  --gold-deep: #b57617;
  --ink: #16232e;
  --body: #33434f;
  --muted: #64768a;
  --line: #d7dee6;
  --line-soft: #e6ebf0;
  --bg: #eef1f4;
  --card: #ffffff;
  --green: #157347;
  --green-wash: #e2f3ea;
  --red: #b02a20;
  --red-wash: #fbe9e7;
  --amber: #9a6206;
  --amber-wash: #fcf2df;
  --mono: "IBM Plex Mono", "Cascadia Code", Consolas, monospace;
  --sans: "Inter", "Segoe UI", system-ui, Arial, sans-serif;
  --shadow: 0 1px 2px rgba(14, 34, 51, .06), 0 8px 24px rgba(14, 34, 51, .07);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--body);
  font-size: 14.5px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--blue); }
h1, h2, h3 { color: var(--ink); line-height: 1.25; letter-spacing: -.01em; }

::selection { background: #ffd88a; }

/* ---------- application chrome ---------- */
.topbar {
  background: linear-gradient(180deg, var(--navy) 0%, #0b1c2b 100%);
  border-bottom: 3px solid var(--blue);
  position: sticky; top: 0; z-index: 50;
}
.topbar-inner {
  max-width: 1320px; margin: 0 auto; padding: 11px 28px;
  display: flex; align-items: center; gap: 18px;
}
.topbar img.logo { height: 30px; display: block; filter: brightness(0) invert(1); opacity: .96; }
.topbar .portal-name {
  font-size: 11px; font-weight: 700; color: #9fb6c9;
  text-transform: uppercase; letter-spacing: .22em;
  border-left: 1px solid rgba(255,255,255,.18); padding: 3px 0 3px 18px;
}
.topbar .portal-name b { color: var(--gold); font-weight: 700; }
.topbar .spacer { flex: 1; }
.topbar .who { text-align: right; font-size: 11.5px; color: #8ba3b8; line-height: 1.35; }
.topbar .who b { display: block; color: #fff; font-size: 13px; font-weight: 600; }
.topbar .btn.ghost {
  color: #b9cbdb; border-color: rgba(255,255,255,.25); background: rgba(255,255,255,.04);
}
.topbar .btn.ghost:hover { color: #fff; border-color: rgba(255,255,255,.55); }

/* thin trading-terms strip */
.terms-ribbon {
  background: #f7e9cd;
  border-bottom: 1px solid #e5cf9c;
  color: #5d4308;
  font-size: 12px; text-align: center; padding: 6px 16px;
  letter-spacing: .01em;
}
.terms-ribbon b { color: #8a5a00; }

/* ---------- layout ---------- */
.wrap { max-width: 1320px; margin: 0 auto; padding: 26px 28px; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-top: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: var(--shadow);
  padding: 20px 24px;
  margin-bottom: 18px;
}
.card h2 { margin: 0 0 4px; font-size: 17px; font-weight: 700; }
.card h3 { margin: 0 0 8px; font-size: 14px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--navy-2); }
.card .sub { color: var(--muted); font-size: 12.5px; margin: 0 0 14px; }

.grid { display: grid; gap: 14px; }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 900px) {
  .grid.cols-4, .grid.cols-3 { grid-template-columns: repeat(2, 1fr); }
  .grid.cols-2 { grid-template-columns: 1fr; }
}

.stat {
  background: var(--card);
  border: 1px solid var(--line);
  border-top: 3px solid var(--blue);
  border-radius: 4px;
  padding: 14px 18px 12px;
  box-shadow: var(--shadow);
}
.stat .n { font-size: 26px; font-weight: 800; color: var(--navy); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat .l { font-size: 10.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .12em; margin-top: 2px; }

/* ---------- buttons / forms ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--blue); color: #fff; border: 1px solid var(--blue-dark); cursor: pointer;
  padding: 8px 18px; font-size: 13px; font-weight: 600; font-family: inherit;
  border-radius: 4px; text-decoration: none; letter-spacing: .015em;
  transition: background .12s, border-color .12s;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.15);
}
.btn:hover { background: var(--blue-dark); }
.btn.secondary { background: #fff; color: var(--blue-dark); border: 1px solid #a9c4dd; box-shadow: none; }
.btn.secondary:hover { background: var(--blue-wash); border-color: var(--blue); }
.btn.ghost { background: transparent; color: var(--muted); border: 1px solid var(--line); box-shadow: none; }
.btn.ghost:hover { color: var(--ink); border-color: var(--muted); }
.btn.danger { background: var(--red); border-color: #8c1f17; }
.btn.danger:hover { background: #8c1f17; }
.btn.small { padding: 4px 11px; font-size: 12px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

label.f { display: block; font-size: 12px; font-weight: 600; color: var(--navy-2); margin-bottom: 12px; }
label.f span { display: block; margin-bottom: 4px; text-transform: uppercase; letter-spacing: .07em; font-size: 10.5px; color: var(--muted); }
input[type=text], input[type=email], input[type=password], input[type=number],
input[type=datetime-local], input[type=file], textarea, select {
  width: 100%; padding: 8px 11px; font-size: 13.5px; font-family: inherit;
  border: 1px solid #c3cdd7; border-radius: 4px; background: #fdfefe; color: var(--ink);
}
input:focus, textarea:focus, select:focus { outline: 2px solid rgba(9,102,193,.3); border-color: var(--blue); }
textarea { resize: vertical; min-height: 70px; }

/* ---------- data tables ---------- */
.table-scroll { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th {
  text-align: left; padding: 8px 10px; white-space: nowrap;
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em;
  color: #5b6b7c;
  border-bottom: 2px solid var(--navy-2);
  background: #f2f5f8; position: sticky; top: 0;
}
table.data td {
  padding: 8px 10px; border-bottom: 1px solid var(--line-soft);
  vertical-align: middle; color: var(--body);
}
table.data tbody tr:nth-child(even) td { background: #f8fafb; }
table.data tr:hover td { background: var(--blue-wash); }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.data td b { color: var(--ink); }

/* product codes & EANs read like a terminal */
.code-cell, td[data-code] { font-family: var(--mono); font-size: 12px; color: var(--navy-2); letter-spacing: 0; }

/* ---------- status chips ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 2px 9px; border-radius: 3px;
  font-size: 10.5px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase;
  white-space: nowrap; border: 1px solid transparent;
}
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip.open { background: var(--green-wash); color: var(--green); border-color: #b9e0cb; }
.chip.upcoming { background: var(--amber-wash); color: var(--amber); border-color: #ecd3a2; }
.chip.closed { background: #edf0f3; color: #5f7183; border-color: #d4dbe2; }
.chip.won { background: var(--green-wash); color: var(--green); border-color: #b9e0cb; }
.chip.won::before { content: "★"; width: auto; height: auto; border-radius: 0; background: none; font-size: 10px; }
.chip.blue { background: var(--blue-wash); color: var(--blue-dark); border-color: #b7d3ec; }
.chip.red { background: var(--red-wash); color: var(--red); border-color: #eec4bf; }

/* ---------- misc ---------- */
.countdown { font-family: var(--mono); font-variant-numeric: tabular-nums; font-weight: 600; color: var(--blue-dark); }
.countdown.urgent { color: var(--red); }
.muted { color: var(--muted); font-size: 12.5px; }
.right { text-align: right; }
.flex { display: flex; align-items: center; gap: 12px; }
.flex .grow { flex: 1; }
.mt0 { margin-top: 0; } .mb0 { margin-bottom: 0; }

.notice {
  border: 1px solid #c8dcf0; border-left: 4px solid var(--blue);
  background: var(--blue-wash);
  padding: 12px 16px; border-radius: 0 4px 4px 0; margin-bottom: 18px; font-size: 13px;
  color: #274a68;
}
.notice b { color: var(--blue-dark); }
.error-box { background: var(--red-wash); border: 1px solid #eec4bf; color: var(--red); padding: 9px 13px; border-radius: 4px; font-size: 13px; margin-bottom: 12px; }
.ok-box { background: var(--green-wash); border: 1px solid #b9e0cb; color: var(--green); padding: 9px 13px; border-radius: 4px; font-size: 13px; margin-bottom: 12px; }

/* bid input — the money cell */
input.bid-input {
  width: 112px; text-align: right; font-weight: 600; font-size: 13.5px;
  font-family: var(--mono);
  padding: 6px 9px; border: 1px solid #b6c5d3; background: #fffdf6;
}
input.bid-input:focus { background: #fff; }
input.bid-input.changed { border-color: var(--gold-deep); background: var(--amber-wash); box-shadow: inset 0 0 0 1px var(--gold-deep); }

/* ---------- modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(9, 22, 34, .62);
  display: flex; align-items: center; justify-content: center; z-index: 100; padding: 20px;
  backdrop-filter: blur(2px);
}
.modal {
  background: #fff; border-radius: 6px; border-top: 4px solid var(--blue);
  box-shadow: 0 24px 70px rgba(0,0,0,.4);
  width: 100%; max-width: 640px; max-height: 88vh; overflow-y: auto; padding: 22px 26px;
}
.modal h3 { margin-top: 0; font-size: 16px; }
.hidden { display: none !important; }

/* terms confirm box */
.terms-confirm {
  background: var(--amber-wash); border: 1px solid #e2c68c; border-left: 4px solid var(--gold-deep);
  border-radius: 0 4px 4px 0;
  padding: 14px 16px; margin: 16px 0; font-size: 13px; color: #5d4308;
}
.terms-confirm ul { margin: 8px 0 0; padding-left: 20px; }
.terms-confirm li { margin-bottom: 4px; }
.terms-confirm label { display: flex; gap: 10px; align-items: flex-start; font-weight: 700; margin-top: 12px; cursor: pointer; color: #4a3403; }
.terms-confirm input { width: 17px; height: 17px; margin-top: 1px; accent-color: var(--gold-deep); }

/* sticky bid bar */
.bid-bar {
  position: sticky; bottom: 0; z-index: 40;
  background: linear-gradient(180deg, var(--navy-2), var(--navy));
  color: #fff; border: 1px solid var(--navy-3); border-bottom: none;
  border-radius: 6px 6px 0 0;
  padding: 12px 22px; display: flex; align-items: center; gap: 26px;
  box-shadow: 0 -6px 24px rgba(9, 22, 34, .25);
}
.bid-bar .n { font-size: 19px; font-weight: 700; font-variant-numeric: tabular-nums; font-family: var(--mono); }
.bid-bar .l { font-size: 9.5px; font-weight: 600; color: #93aabf; text-transform: uppercase; letter-spacing: .14em; }
.bid-bar .btn { background: var(--gold); color: #2c1e04; border-color: var(--gold-deep); font-weight: 700; }
.bid-bar .btn:hover { background: #f0b35a; }

/* footer */
footer.site {
  max-width: 1320px; margin: 34px auto 0; padding: 16px 28px 34px;
  border-top: 1px solid var(--line); color: var(--muted); font-size: 11.5px; line-height: 1.7;
}
footer.site .sys {
  font-family: var(--mono); font-size: 10.5px; color: #90a2b3; margin-top: 6px;
  text-transform: uppercase; letter-spacing: .08em;
}

/* admin nav (attached to the chrome, not floaty tabs) */
.tabs {
  display: flex; gap: 0; margin: -26px -28px 24px;
  background: #fff; border-bottom: 1px solid var(--line);
  padding: 0 28px;
  box-shadow: 0 1px 3px rgba(14,34,51,.05);
}
.tabs button {
  background: none; border: none; cursor: pointer; font: inherit;
  padding: 13px 20px; font-size: 12.5px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase;
  color: var(--muted); border-bottom: 3px solid transparent;
}
.tabs button.active { color: var(--navy); border-bottom-color: var(--gold); }
.tabs button:hover { color: var(--navy); background: #f6f8fa; }

/* ---------- sign-in (split screen) ---------- */
.auth-split { min-height: 100vh; display: flex; }
.auth-brand {
  flex: 1.15; background:
    radial-gradient(1000px 600px at 85% -10%, rgba(46,138,230,.28), transparent 60%),
    linear-gradient(160deg, var(--navy-2) 0%, var(--navy) 55%, #0a1826 100%);
  color: #fff; display: flex; flex-direction: column; justify-content: space-between;
  padding: 48px 56px;
  position: relative; overflow: hidden;
}
.auth-brand::after {
  content: ""; position: absolute; inset: 0;
  background-image: repeating-linear-gradient(115deg, rgba(255,255,255,.025) 0 1px, transparent 1px 90px);
  pointer-events: none;
}
.auth-brand img { width: 210px; filter: brightness(0) invert(1); }
.auth-brand .product {
  margin-top: 14px; font-size: 12px; font-weight: 700; letter-spacing: .3em;
  text-transform: uppercase; color: var(--gold);
}
.auth-brand h1 { font-size: 30px; font-weight: 800; letter-spacing: -.02em; color: #fff; margin: 0 0 10px; max-width: 420px; }
.auth-brand p.lead { color: #a8bccd; font-size: 14.5px; max-width: 400px; margin: 0; }
.auth-brand ul.points { list-style: none; padding: 0; margin: 26px 0 0; color: #c3d3e0; font-size: 13px; }
.auth-brand ul.points li { padding: 7px 0 7px 26px; position: relative; border-top: 1px solid rgba(255,255,255,.07); }
.auth-brand ul.points li::before { content: "▸"; position: absolute; left: 4px; color: var(--gold); }
.auth-brand .smallprint { color: #728da3; font-size: 11px; line-height: 1.7; }
.auth-brand .smallprint b { color: #9fb6c9; }

.auth-form {
  flex: 1; display: flex; align-items: center; justify-content: center;
  background: var(--bg); padding: 40px;
}
.auth-card { width: 100%; max-width: 380px; }
.auth-card .panel {
  background: #fff; border: 1px solid var(--line); border-top: 4px solid var(--blue);
  border-radius: 6px; box-shadow: var(--shadow); padding: 30px 32px;
}
.auth-card h2 { font-size: 18px; margin: 0 0 2px; }
.auth-card .sub { color: var(--muted); font-size: 12.5px; margin: 0 0 22px; }
.auth-card .aux { text-align: center; color: var(--muted); font-size: 12px; margin-top: 18px; line-height: 1.7; }

@media (max-width: 860px) {
  .auth-split { flex-direction: column; }
  .auth-brand { padding: 30px 28px; }
  .auth-brand h1 { font-size: 22px; }
  .auth-brand ul.points, .auth-brand .smallprint { display: none; }
}

/* "How it works" panel shown after sign-in */
details.howit {
  background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--gold);
  border-radius: 4px; box-shadow: var(--shadow);
  padding: 0; margin-bottom: 18px;
}
details.howit summary {
  cursor: pointer; padding: 12px 18px;
  font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em;
  color: var(--navy-2); user-select: none;
}
details.howit summary::marker { color: var(--gold-deep); }
details.howit ul.points { list-style: none; margin: 0; padding: 2px 20px 14px; }
details.howit ul.points li {
  padding: 7px 0 7px 24px; position: relative;
  border-top: 1px solid var(--line-soft); font-size: 13px; color: var(--body);
}
details.howit ul.points li::before { content: "▸"; position: absolute; left: 2px; color: var(--gold-deep); }
details.howit ul.points b { color: var(--ink); }

/* terms gate list (first-login acceptance) */
#termsGate ul.points li {
  padding: 7px 0 7px 24px; position: relative;
  border-top: 1px solid var(--line-soft); font-size: 13px; color: var(--body);
}
#termsGate ul.points li:first-child { border-top: none; }
#termsGate ul.points li::before { content: "▸"; position: absolute; left: 2px; color: var(--gold-deep); }
#termsGate ul.points b { color: var(--ink); }

/* signature capture */
.sig-block { margin-top: 16px; }
.sig-pad-wrap { position: relative; }
.sig-pad-wrap canvas {
  display: block; width: 100%; height: 150px;
  background: #fff;
  border: 1px dashed #9fb0c0; border-radius: 4px;
  cursor: crosshair; touch-action: none;
  background-image: linear-gradient(transparent 74%, #d7dee6 74%, #d7dee6 75%, transparent 75%);
  background-size: 100% 200px; background-position: 0 -30px; background-repeat: no-repeat;
}
.sig-pad-wrap .btn { position: absolute; top: 8px; right: 8px; }
.sig-view {
  background: #fff; border: 1px solid var(--line); border-radius: 4px;
  padding: 8px; text-align: center;
}
.sig-view img { max-width: 100%; height: auto; }

details.lot-bids { margin: 0; }
details.lot-bids summary { cursor: pointer; color: var(--blue); font-weight: 600; font-size: 13px; }
