/* BidTide — one global stylesheet. Mobile first; wide-screen container rules at the bottom of :root section. */
:root {
  --bg: #f4f6fa;
  --surface: #ffffff;
  --surface-2: #eef2f8;
  --ink: #0f1d33;
  --ink-2: #4a5872;
  --line: #dbe2ee;
  --brand: #0b5cad;
  --brand-ink: #ffffff;
  --brand-2: #0a3d73;
  --tide: #12a4a0;
  --ok: #138a52;
  --ok-bg: #e5f6ee;
  --warn: #a35c00;
  --warn-bg: #fff3e0;
  --bad: #c0322b;
  --bad-bg: #fdecea;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(15, 29, 51, .06), 0 4px 16px rgba(15, 29, 51, .06);
  --font: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --gutter: 16px;
  --container: 100%;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0c1422; --surface: #131e31; --surface-2: #1a2840; --ink: #e8eef8; --ink-2: #9fb0c9; --line: #263652;
    --brand: #4c9cf0; --brand-2: #8cc0ff; --brand-ink: #06121f; --ok-bg: #0f3324; --warn-bg: #3a2708; --bad-bg: #3d1513;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 20px rgba(0,0,0,.25);
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); background: var(--bg); color: var(--ink); line-height: 1.5; font-size: 15px; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: 1.7rem; } h2 { font-size: 1.3rem; } h3 { font-size: 1.05rem; }
p { margin: 0 0 1em; }
small, .muted { color: var(--ink-2); }
code { background: var(--surface-2); padding: 1px 6px; border-radius: 6px; font-size: .9em; }

/* Layout container: fills large screens instead of a narrow centred column. */
.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter); }
@media (min-width: 1280px) {
  :root { --container: min(100%, 1680px); --gutter: clamp(1.5rem, 2.5vw, 3rem); }
}
@media (min-width: 1920px) {
  :root { --container: 1840px; }
}
.narrow { max-width: 560px; margin-left: auto; margin-right: auto; }
.reading { max-width: 820px; }

/* Header */
.topbar { background: var(--brand-2); color: #fff; }
.topbar .container { display: flex; align-items: center; gap: 12px; min-height: 60px; flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; }
.logo { display: flex; align-items: center; gap: 8px; color: #fff; font-weight: 800; font-size: 1.25rem; letter-spacing: -.01em; }
.logo:hover { text-decoration: none; }
.logo svg { width: 30px; height: 30px; }
.nav { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; margin-left: auto; }
.nav a, .nav button { color: #dce9f8; padding: 8px 10px; border-radius: 8px; font-weight: 500; background: none; border: 0; font: inherit; cursor: pointer; }
.nav a:hover, .nav button:hover { background: rgba(255,255,255,.1); text-decoration: none; color: #fff; }
.nav .pill { background: var(--tide); color: #fff; }
.bell { position: relative; }
.bell .count { position: absolute; top: 2px; right: 0; background: #ff5a4e; color: #fff; border-radius: 10px; font-size: 11px; padding: 0 5px; line-height: 16px; }
.search { flex: 1 1 260px; display: flex; min-width: 200px; max-width: 560px; order: 3; }
.search input { flex: 1; border: 0; border-radius: 8px 0 0 8px; padding: 10px 12px; font: inherit; }
.search button { border: 0; border-radius: 0 8px 8px 0; background: var(--tide); color: #fff; padding: 0 16px; font-weight: 600; cursor: pointer; }
@media (min-width: 900px) { .search { order: 0; } }
.subnav { background: var(--surface); border-bottom: 1px solid var(--line); }
.subnav .container { display: flex; gap: 4px; overflow-x: auto; }
.subnav a { padding: 12px 12px; color: var(--ink-2); font-weight: 500; white-space: nowrap; border-bottom: 2px solid transparent; }
.subnav a.on { color: var(--brand); border-color: var(--brand); }

main { padding: 24px 0 48px; min-height: 60vh; }
footer.site { background: var(--surface); border-top: 1px solid var(--line); padding: 28px 0; color: var(--ink-2); font-size: .9rem; }
footer.site .cols { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
footer.site a { color: var(--ink-2); display: block; padding: 2px 0; }

/* Components */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.card + .card { margin-top: 16px; }
.card h2:first-child, .card h3:first-child { margin-top: 0; }
.grid { display: grid; gap: 16px; }
.grid.lots { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.grid.two { grid-template-columns: 1fr; }
.grid.kpis { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
@media (min-width: 960px) { .grid.two { grid-template-columns: minmax(0, 3fr) minmax(320px, 2fr); } .grid.half { grid-template-columns: 1fr 1fr; } }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack > * + * { margin-top: 12px; }
.sidebar-layout { display: grid; gap: 20px; }
@media (min-width: 960px) { .sidebar-layout { grid-template-columns: 260px minmax(0, 1fr); } }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 16px; border-radius: 10px; border: 1px solid var(--brand);
  background: var(--brand); color: var(--brand-ink); font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; line-height: 1.2; }
.btn:hover { filter: brightness(1.07); text-decoration: none; }
.btn.secondary { background: transparent; color: var(--brand); }
.btn.ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.small { padding: 6px 10px; font-size: .88rem; border-radius: 8px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
form.inline { display: inline; }

label { display: block; font-weight: 600; margin: 0 0 4px; font-size: .92rem; }
.field { margin-bottom: 14px; }
.field .hint { font-weight: 400; color: var(--ink-2); font-size: .85rem; margin-top: 4px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=tel], input[type=url], input[type=search],
input[type=datetime-local], input[type=date], input[type=file], select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; font: inherit; background: var(--surface); color: var(--ink);
}
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--brand) 40%, transparent); border-color: var(--brand); }
.check { display: flex; gap: 8px; align-items: flex-start; font-weight: 500; }
.check input { margin-top: 4px; }
.form-grid { display: grid; gap: 0 16px; grid-template-columns: 1fr; }
@media (min-width: 720px) { .form-grid { grid-template-columns: 1fr 1fr; } .form-grid .full { grid-column: 1 / -1; } }

.alert { padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; border: 1px solid transparent; word-break: break-word; }
.alert.success { background: var(--ok-bg); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 30%, transparent); }
.alert.error { background: var(--bad-bg); color: var(--bad); border-color: color-mix(in srgb, var(--bad) 30%, transparent); }
.alert.info { background: var(--surface-2); color: var(--ink); }
.alert.warning { background: var(--warn-bg); color: var(--warn); }
.banner { padding: 8px 0; font-weight: 500; text-align: center; font-size: .92rem; }
.banner.info { background: #dbeafe; color: #0b3a75; } .banner.warning { background: #fff1d6; color: #7a4600; } .banner.success { background: #d9f5e7; color: #0d5c37; }

.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: .78rem; font-weight: 700; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.badge.live { background: #ffe3e0; color: #b42318; } .badge.live::before { content: "● "; }
.badge.ok, .badge.paid, .badge.approved, .badge.closed, .badge.sent { background: var(--ok-bg); color: var(--ok); }
.badge.warn, .badge.unpaid, .badge.pending, .badge.pending_review, .badge.scheduled, .badge.draft { background: var(--warn-bg); color: var(--warn); }
.badge.bad, .badge.overdue, .badge.rejected, .badge.suspended, .badge.unsold, .badge.void, .badge.withdrawn, .badge.cancelled { background: var(--bad-bg); color: var(--bad); }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-2); font-weight: 700; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table-wrap { overflow-x: auto; }
tr.total td { font-weight: 800; border-top: 2px solid var(--ink); }

/* Lot cards */
.lot-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; color: inherit; }
.lot-card:hover { text-decoration: none; border-color: var(--brand); }
.lot-card .ph { aspect-ratio: 4 / 3; background: var(--surface-2) center / cover no-repeat; position: relative; }
.lot-card .ph .badge { position: absolute; top: 10px; left: 10px; }
.lot-card .body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.lot-card .title { font-weight: 700; color: var(--ink); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.9em; }
.lot-card .price { font-size: 1.2rem; font-weight: 800; color: var(--ink); }
.lot-card .meta { font-size: .84rem; color: var(--ink-2); }
.countdown { font-variant-numeric: tabular-nums; font-weight: 700; }
.countdown.soon { color: var(--bad); }

/* Hero */
.hero { background: linear-gradient(120deg, var(--brand-2), var(--brand) 60%, var(--tide)); color: #fff; border-radius: 18px; padding: 32px 24px; margin-bottom: 28px; display: grid; gap: 20px; }
.hero h1 { font-size: clamp(1.7rem, 3.2vw, 2.6rem); margin-bottom: 8px; }
.hero p { color: #dbe9fb; font-size: 1.05rem; max-width: 640px; }
.hero .btn { background: #fff; color: var(--brand-2); border-color: #fff; }
.hero .btn.secondary { background: transparent; color: #fff; }
@media (min-width: 960px) { .hero { grid-template-columns: 2fr 1fr; padding: 44px; align-items: center; } }
.hero .steps { background: rgba(255,255,255,.1); border-radius: 14px; padding: 16px 18px; }
.hero .steps li { margin: 6px 0; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; margin: 28px 0 12px; gap: 12px; flex-wrap: wrap; }
.section-head h2 { margin: 0; }
.cat-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 8px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--ink); font-weight: 500; }
.chip:hover { border-color: var(--brand); text-decoration: none; }

/* Lot page */
.gallery .main { aspect-ratio: 4 / 3; background: var(--surface-2) center / contain no-repeat; border-radius: var(--radius); border: 1px solid var(--line); }
.gallery .thumbs { display: flex; gap: 8px; margin-top: 8px; overflow-x: auto; }
.gallery .thumbs button { width: 74px; height: 56px; flex: 0 0 auto; border: 2px solid transparent; border-radius: 8px; background: center / cover no-repeat var(--surface-2); cursor: pointer; padding: 0; }
.gallery .thumbs button.on { border-color: var(--brand); }
.bidbox { position: sticky; top: 12px; }
.bidbox .now { font-size: 2rem; font-weight: 800; line-height: 1.1; }
.bidbox .status-line { padding: 10px 12px; border-radius: 10px; font-weight: 600; margin: 10px 0; }
.status-line.winning { background: var(--ok-bg); color: var(--ok); }
.status-line.losing { background: var(--bad-bg); color: var(--bad); }
.bid-input { display: flex; gap: 8px; }
.bid-input .dollar { position: relative; flex: 1; }
.bid-input .dollar::before { content: "$"; position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--ink-2); font-weight: 700; }
.bid-input input { padding-left: 26px; font-size: 1.1rem; font-weight: 700; }
.quick { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.feed { list-style: none; padding: 0; margin: 0; max-height: 300px; overflow: auto; }
.feed li { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px dashed var(--line); font-size: .92rem; }
.feed li.flash { animation: flash 1.2s ease-out; }
@keyframes flash { from { background: color-mix(in srgb, var(--tide) 30%, transparent); } to { background: transparent; } }
.specs { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; }
.specs dt { color: var(--ink-2); } .specs dd { margin: 0; font-weight: 600; }
.video { aspect-ratio: 16 / 9; width: 100%; border: 0; border-radius: var(--radius); }
.manifest-table th { cursor: pointer; user-select: none; }
.prose table { width: auto; } .prose h2 { margin-top: 1.2em; }

.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.kpi .v { font-size: 1.6rem; font-weight: 800; } .kpi .l { color: var(--ink-2); font-size: .85rem; }
.meter { height: 10px; background: var(--surface-2); border-radius: 6px; overflow: hidden; margin-top: 8px; }
.meter > span { display: block; height: 100%; background: var(--tide); }
.queue-link { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--line); color: var(--ink); }
.queue-link .n { font-weight: 800; }
.side-nav a { display: block; padding: 9px 12px; border-radius: 8px; color: var(--ink); font-weight: 500; }
.side-nav a.on, .side-nav a:hover { background: var(--surface-2); text-decoration: none; }
.side-nav h4 { margin: 14px 12px 6px; font-size: .75rem; text-transform: uppercase; color: var(--ink-2); letter-spacing: .06em; }
.thumb { width: 64px; height: 48px; object-fit: cover; border-radius: 6px; background: var(--surface-2); }
.photos-edit { display: flex; gap: 10px; flex-wrap: wrap; }
.photos-edit figure { margin: 0; width: 120px; } .photos-edit img { width: 120px; height: 90px; object-fit: cover; border-radius: 8px; }
.qr-box { text-align: center; } .qr-box img { margin: 0 auto; width: 220px; image-rendering: pixelated; }
.slots { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.slots .day h4 { margin: 0 0 6px; }
.slots label.slot { display: inline-block; margin: 0 6px 6px 0; font-weight: 500; }
.slots label.slot input { margin-right: 4px; }
.scan video { width: 100%; max-width: 480px; border-radius: 12px; background: #000; }
.empty { text-align: center; color: var(--ink-2); padding: 36px 12px; }
.pager { display: flex; gap: 6px; justify-content: center; margin-top: 20px; }
.hide { display: none !important; }
@media print { .topbar, .subnav, footer.site, .no-print, .banner { display: none !important; } body { background: #fff; } .card { box-shadow: none; } }
