/* =====================================================================
 * app.css — Live Auction Platform shared stylesheet
 * REDESIGN: translated from the Figma Make "AuctionHQ" design.
 * Light, editorial theme — warm off-white canvas, white cards, dark-navy
 * primary, gold accent. System-font stacks (no CDN) approximating the Figma
 * pairing (Outfit display / Inter body) via weight + letter-spacing.
 *
 * Every class name used by the existing admin.js / screen.js / bid.js /
 * results.js / *.php is preserved here, only restyled — no behaviour or
 * markup contract changes. New Figma components added alongside.
 * ===================================================================== */

:root {
  --bg:            #f6f5f2;
  --bg-raised:     #ffffff;
  --bg-inset:      #f0ede8;
  --bg-muted:      #eeede9;
  --line:          rgba(18, 21, 30, 0.10);
  --line-bright:   rgba(18, 21, 30, 0.18);

  --ink:           #12151e;
  --ink-dim:       #6b6b78;
  --ink-faint:     #9a9aa4;

  --primary:       #1a2540;
  --primary-2:     #243055;
  --primary-ink:   #ffffff;

  --accent:        #c8841a;
  --accent-soft:   #faf3e6;
  --accent-line:   #e6d4ad;

  --live:          #1a7a45;
  --live-soft:     #e7f4ec;
  --warn:          #c8841a;
  --warn-soft:     #faf3e6;
  --danger:        #c82929;
  --danger-soft:   #fbeaea;
  --info:          #2e4a9a;
  --sold:          #8b2fc9;

  --sidebar:       #1a2540;
  --sidebar-ink:   #e8e6e0;
  --sidebar-active:#243055;
  --sidebar-line:  rgba(255,255,255,0.08);

  --font-display: "Outfit", ui-sans-serif, system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-body:    "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono:    ui-monospace, "SF Mono", "Cascadia Code", "Consolas", monospace;

  --r-sm: 6px;
  --r-md: 8px;
  --r-lg: 12px;
  --r-xl: 16px;

  --shadow:    0 1px 2px rgba(18,21,30,.04), 0 4px 16px rgba(18,21,30,.06);
  --shadow-lg: 0 12px 40px rgba(18,21,30,.16);
  --gap: 16px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

code, .mono { font-family: var(--font-mono); }

.wrap { max-width: 1180px; margin: 0 auto; padding: 24px; }

.topbar {
  display: flex; align-items: center; gap: var(--gap);
  flex-wrap: wrap;
  padding: 14px 0 18px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 24px;
}
.brand {
  font-family: var(--font-display);
  font-size: 19px; font-weight: 800;
  letter-spacing: -0.01em; color: var(--primary);
  display: inline-flex; align-items: center; gap: 8px;
}
.brand .dot { color: var(--accent); }
.brand::before {
  content: "\2696"; display: inline-grid; place-items: center;
  width: 30px; height: 30px; border-radius: 9px;
  background: var(--accent); color: #fff; font-size: 15px;
}

.code-chip {
  font-family: var(--font-mono); font-size: 14px; font-weight: 600;
  background: var(--bg-inset); border: 1px solid var(--line-bright);
  padding: 6px 12px; border-radius: 999px;
  letter-spacing: 0.16em; color: var(--ink);
}
.spacer { flex: 1; }

.status {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em;
  padding: 6px 12px; border-radius: 999px;
  border: 1px solid var(--line-bright); color: var(--ink-dim);
  background: var(--bg-raised);
}
.status::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%;
  background: var(--ink-faint);
}
.status[data-s="live"]       { color: var(--danger); border-color: #f0c9c9; background: var(--danger-soft); }
.status[data-s="live"]::before   { background: var(--danger); animation: pulse 1.4s infinite; }
.status[data-s="paused"]     { color: var(--warn);  border-color: var(--accent-line); background: var(--warn-soft); }
.status[data-s="paused"]::before { background: var(--warn); }
.status[data-s="draft"]      { color: var(--ink-dim); }
.status[data-s="ended"]      { color: var(--live);  border-color: #bfe2cd; background: var(--live-soft); }
.status[data-s="ended"]::before  { background: var(--live); }
.status[data-s="terminated"] { color: var(--danger); border-color: #f0c9c9; background: var(--danger-soft); }
.status[data-s="terminated"]::before { background: var(--danger); }

@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.35} }

.grid { display: grid; grid-template-columns: 1fr 360px; gap: 24px; align-items: start; }
@media (max-width: 900px) { .grid { grid-template-columns: 1fr; } }

.panel {
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 20px;
  box-shadow: var(--shadow);
}
.panel + .panel { margin-top: 24px; }
.panel h2 {
  font-family: var(--font-body);
  font-size: 13px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--ink-dim); margin-bottom: 16px;
}

.live-card { border-color: var(--accent-line); }
.live-title { font-size: 24px; line-height: 1.12; margin-bottom: 4px; color: var(--ink); }
.live-meta { color: var(--ink-dim); font-size: 14px; margin-bottom: 18px; }

.bid-readout {
  display: flex; align-items: baseline; gap: 14px;
  padding: 18px; background: var(--bg);
  border: 1px solid var(--line); border-radius: var(--r-md);
  margin-bottom: 8px;
}
.bid-amount { font-family: var(--font-display); font-size: 38px; font-weight: 800; color: var(--accent); }
.bid-amount.none { color: var(--ink-faint); font-weight: 700; }
.bid-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-dim); font-weight: 600; }
.bidder-line { font-size: 15px; color: var(--ink-dim); margin: 10px 2px 0; }
.bidder-line b { color: var(--ink); }
.bidder-num { font-family: var(--font-mono); color: var(--accent); font-weight: 600; }

.countdown {
  font-family: var(--font-display); font-size: 22px; font-weight: 700;
  margin: 14px 0 4px; color: var(--ink);
}
.countdown.snipe { color: var(--danger); }

.btn {
  font-family: var(--font-body); font-weight: 600; font-size: 14px;
  border: 1px solid var(--line-bright); background: var(--bg-raised);
  color: var(--ink); padding: 10px 16px; border-radius: var(--r-md);
  cursor: pointer; transition: transform .05s, background .15s, border-color .15s, box-shadow .15s;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.btn:hover { background: var(--bg-muted); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn-lg { padding: 14px 20px; font-size: 16px; }
.btn-go     { background: var(--live);    border-color: var(--live);    color: #fff; }
.btn-go:hover     { background: #166a3b; }
.btn-warn   { background: var(--warn);    border-color: var(--warn);    color: #fff; }
.btn-warn:hover   { background: #b0740f; }
.btn-danger { background: var(--danger);  border-color: var(--danger);  color: #fff; }
.btn-danger:hover { background: #ad2020; }
.btn-info   { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-info:hover   { background: #141d33; }
.btn-accent { background: var(--accent);  border-color: var(--accent);  color: #fff; }
.btn-accent:hover { background: #b0740f; }
.btn-block  { width: 100%; }

.btn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.btn-row .full { grid-column: 1 / -1; }

.item {
  display: grid; grid-template-columns: 48px 1fr auto; gap: 14px; align-items: center;
  padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--bg-raised); margin-bottom: 10px;
}
.item[data-s="live"] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent-line); }
.item[data-s="sold"] { background: var(--bg); }
.item-thumb {
  width: 48px; height: 48px; border-radius: var(--r-md);
  object-fit: cover; background: var(--bg-inset); border: 1px solid var(--line);
}
.item-thumb.ph { display: grid; place-items: center; color: var(--ink-faint); font-size: 18px; }
.item-name { font-weight: 600; color: var(--ink); }
.item-sub { font-size: 13px; color: var(--ink-dim); font-family: var(--font-mono); }
.item-tag {
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em;
  padding: 4px 10px; border-radius: 999px;
  border: 1px solid var(--line-bright); color: var(--ink-dim); background: var(--bg);
}
.item-tag[data-s="live"]    { color: var(--danger); border-color: #f0c9c9; background: var(--danger-soft); }
.item-tag[data-s="sold"]    { color: var(--live);   border-color: #bfe2cd; background: var(--live-soft); }
.item-tag[data-s="pending"] { color: var(--ink-dim); }
.item-tag[data-s="closed"]  { color: var(--ink-faint); }
.item-start { padding: 8px 14px; font-size: 13px; }

.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 16px; }
@media (max-width: 560px) { .stat-row { grid-template-columns: 1fr; } }
.stat {
  background: var(--bg-raised); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 16px; text-align: center;
}
.stat .l { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-dim); font-weight: 600; margin-bottom: 4px; }
.stat .v { font-family: var(--font-display); font-weight: 800; font-size: 22px; color: var(--ink); }
.stat .v.accent { color: var(--accent); }

.timer-bar { height: 4px; border-radius: 999px; background: var(--bg-muted); overflow: hidden; margin-top: 8px; }
.timer-bar > span { display: block; height: 100%; border-radius: 999px; background: var(--live); transition: width .9s linear, background .3s; }

.feed { display: flex; flex-direction: column; }
.feed-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 4px; border-bottom: 1px solid var(--line);
}
.feed-row:last-child { border-bottom: 0; }
.feed-row.newest { background: var(--live-soft); border-radius: var(--r-sm); }
.avatar {
  width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
  display: grid; place-items: center; font-size: 12px; font-weight: 700;
  background: var(--bg-muted); color: var(--ink-dim);
}
.feed-row.newest .avatar { background: var(--live); color: #fff; }
.feed-name { flex: 1; min-width: 0; font-size: 14px; color: var(--ink); }
.feed-amt { font-size: 14px; font-weight: 600; color: var(--ink); }
.feed-row.newest .feed-amt { color: var(--live); }

label { display: block; font-size: 13px; color: var(--ink); font-weight: 500; margin: 0 0 6px; }
input, select, textarea {
  width: 100%; font-family: var(--font-body); font-size: 15px;
  background: var(--bg-raised); color: var(--ink);
  border: 1px solid var(--line-bright); border-radius: var(--r-md);
  padding: 11px 12px; margin-bottom: 14px;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(200,132,26,.18);
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.reveal {
  background: var(--accent-soft); border: 1px dashed var(--accent);
  border-radius: var(--r-md); padding: 18px; margin: 14px 0;
}
.reveal .rc {
  font-family: var(--font-display); font-size: 26px; font-weight: 800; letter-spacing: 0.2em;
  color: var(--accent); text-align: center; padding: 8px 0;
}
.warn-text { color: var(--danger); font-size: 14px; }

.alert {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 14px; border-radius: var(--r-md); font-size: 14px;
  border: 1px solid var(--line-bright); margin-top: 14px;
}
.alert.success { background: var(--live-soft); border-color: #bfe2cd; color: #166a3b; }
.alert.warn    { background: var(--warn-soft); border-color: var(--accent-line); color: #8a5a10; }
.alert.danger  { background: var(--danger-soft); border-color: #f0c9c9; color: #9e2020; }

.muted { color: var(--ink-dim); }
.center { text-align: center; }
.hidden { display: none !important; }
.empty { color: var(--ink-faint); text-align: center; padding: 28px 0; font-size: 14px; }
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--primary); color: #fff; border: 1px solid var(--primary-2);
  padding: 12px 18px; border-radius: var(--r-md); box-shadow: var(--shadow-lg);
  font-size: 14px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 50;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(-4px); }
.toast.err { background: var(--danger); border-color: var(--danger); color: #fff; }
.links { display: flex; gap: 14px; flex-wrap: wrap; font-size: 14px; align-items: center; }
.modal-bg {
  position: fixed; inset: 0; background: rgba(18,21,30,.55); display: grid; place-items: center;
  z-index: 40; padding: 20px;
}
.modal {
  background: var(--bg-raised); border: 1px solid var(--line-bright);
  border-radius: var(--r-xl); padding: 26px; max-width: 440px; width: 100%;
  box-shadow: var(--shadow-lg);
}
.modal h2 { color: var(--ink); }
