:root {
  --bg: #071016;
  --panel: #0c1820;
  --panel-2: #10232d;
  --line: #1f3540;
  --text: #edf7f7;
  --muted: #86a2aa;
  --accent: #16e0a1;
  --accent-dark: #063b30;
  --danger: #ff6b7a;
  --warning: #ffcb66;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: radial-gradient(circle at 80% -10%, #10372f 0, transparent 34rem), var(--bg); }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button { cursor: pointer; }
.topbar { position: sticky; top: 0; z-index: 20; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 2rem; padding: 1rem max(1.25rem, calc((100vw - 1240px) / 2)); border-bottom: 1px solid var(--line); background: rgb(7 16 22 / 88%); backdrop-filter: blur(16px); }
.brand { font-size: 1.05rem; font-weight: 900; letter-spacing: -.02em; }
.brand span { color: var(--accent); }
.topbar nav { display: flex; align-items: center; gap: 1.1rem; color: var(--muted); font-size: .9rem; }
.topbar nav a:hover, .link-button:hover { color: var(--text); }
.identity { justify-self: end; display: flex; flex-direction: column; text-align: right; font-size: .8rem; }
.identity span { color: var(--muted); }
.inline-form { display: inline; margin: 0; }
.link-button { border: 0; padding: 0; color: var(--muted); background: transparent; }
.shell { width: min(1240px, calc(100% - 2.5rem)); margin: 0 auto; padding: 3rem 0 5rem; }
.auth-shell { width: min(430px, calc(100% - 2rem)); min-height: 100vh; display: grid; place-items: center; padding: 2rem 0; }
.auth-card { width: 100%; padding: 2.25rem; border: 1px solid var(--line); border-radius: 22px; background: rgb(12 24 32 / 88%); box-shadow: 0 30px 80px rgb(0 0 0 / 28%); }
h1, h2 { margin: 0; letter-spacing: -.035em; }
h1 { font-size: clamp(2rem, 4vw, 3.4rem); line-height: 1; }
h2 { font-size: 1.35rem; }
.muted { color: var(--muted); }
.eyebrow { margin-bottom: .55rem; color: var(--accent); font-size: .73rem; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.page-heading { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 2rem; }
.page-heading p { margin-bottom: 0; }
.split { gap: 2rem; }
.run-status { padding: .7rem 1rem; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: .8rem; }
.scanner-actions { display: flex; align-items: center; gap: .65rem; flex-wrap: wrap; justify-content: flex-end; }
.status-dot { display: inline-block; width: .6rem; height: .6rem; margin-right: .45rem; border-radius: 50%; background: var(--warning); }
.status-dot.success { background: var(--accent); }
.status-dot.failed { background: var(--danger); }
.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 1rem; }
.metric-card { display: flex; flex-direction: column; gap: .45rem; padding: 1.25rem; border: 1px solid var(--line); border-radius: 15px; background: var(--panel); }
.metric-card.accent { background: linear-gradient(135deg, #0d3b32, #0c2225); border-color: #1b6c58; }
.metric-card span { color: var(--muted); font-size: .8rem; }
.metric-card strong { font-size: 1.45rem; }
.panel { margin-top: 1rem; padding: 1.35rem; border: 1px solid var(--line); border-radius: 18px; background: rgb(12 24 32 / 90%); }
.panel.narrow { max-width: 580px; }
.panel-title { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.15rem; }
.pill { padding: .35rem .65rem; border-radius: 999px; color: var(--accent); background: var(--accent-dark); font-size: .75rem; font-weight: 700; }
.plan-grid { display: grid; gap: .65rem; }
.plan-item { display: grid; grid-template-columns: minmax(260px, 1.5fr) 1fr auto; gap: 1.2rem; align-items: center; padding: .85rem; border: 1px solid transparent; border-radius: 12px; background: var(--panel-2); transition: border-color .16s, transform .16s; }
.plan-item:hover { border-color: #2d5960; transform: translateY(-1px); }
.listing-link { display: flex; gap: .8rem; align-items: center; min-width: 0; }
.listing-link > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.listing-link strong, .table-product strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.listing-link small, .table-product small { margin-top: .25rem; color: var(--muted); }
.plan-rank { flex: 0 0 2rem; display: grid; place-items: center; aspect-ratio: 1; border-radius: 9px; color: var(--accent); background: var(--accent-dark); font-weight: 900; }
.plan-numbers { display: grid; grid-template-columns: repeat(3, 1fr); gap: .9rem; font-size: .85rem; }
.plan-numbers span { display: flex; flex-direction: column; white-space: nowrap; }
.plan-numbers small { color: var(--muted); font-size: .67rem; }
.bid-button, .status-button, .secondary, .primary { border: 0; border-radius: 9px; font-weight: 750; }
.bid-button { padding: .7rem .9rem; white-space: nowrap; color: #00160f; background: var(--accent); }
.bid-button.done { color: var(--accent); background: var(--accent-dark); }
.bid-button:disabled, .status-button:disabled { cursor: not-allowed; opacity: .68; }
.filters-wrap { align-items: flex-end; }
.filters { display: flex; gap: .45rem; align-items: center; flex-wrap: wrap; }
.chip { padding: .5rem .75rem; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: .78rem; }
.chip.active { color: var(--text); border-color: #2d7563; background: var(--accent-dark); }
select, input { width: 100%; padding: .75rem .8rem; border: 1px solid var(--line); border-radius: 9px; outline: none; color: var(--text); background: #081319; }
select:focus, input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgb(22 224 161 / 12%); }
.filters select { width: auto; padding: .48rem 2rem .48rem .7rem; color: var(--muted); font-size: .78rem; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .86rem; }
th, td { padding: .9rem .75rem; border-top: 1px solid var(--line); text-align: left; white-space: nowrap; }
th { color: var(--muted); font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.table-product { display: flex; flex-direction: column; min-width: 220px; max-width: 420px; }
.positive { color: var(--accent); font-weight: 800; }
.status-button { padding: .42rem .65rem; color: var(--accent); background: var(--accent-dark); }
.status-button.bid_given { color: #101417; background: var(--warning); }
.empty-state { padding: 2rem; color: var(--muted); text-align: center; }
.stack { display: grid; gap: 1rem; margin-top: 1.4rem; }
.stack label { display: grid; gap: .45rem; color: var(--muted); font-size: .82rem; font-weight: 650; }
.primary { padding: .85rem 1rem; color: #00160f; background: var(--accent); }
.secondary { padding: .6rem .8rem; color: var(--text); background: var(--panel-2); border: 1px solid var(--line); }
.secondary:disabled { opacity: .35; cursor: not-allowed; }
.alert { margin: 1rem 0; padding: .85rem 1rem; border: 1px solid #806d2c; border-radius: 10px; color: #ffe6a8; background: #29240f; }
.alert.error { border-color: #713441; color: #ffc2c9; background: #281117; }
.alert.success { border-color: #1c725a; color: #b7ffe7; background: #0b2a22; }
.alert code { display: inline-block; margin: 0 .35rem; padding: .2rem .35rem; border-radius: 4px; background: #05100d; }
.admin-grid { display: grid; grid-template-columns: 1.45fr 1fr; gap: 1rem; align-items: start; }
.admin-grid .panel { margin: 0; }
.user-list { display: grid; gap: .65rem; }
.user-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .9rem; border-radius: 10px; background: var(--panel-2); }
.user-row > div { display: flex; flex-direction: column; }
.user-row span, .user-row small { margin-top: .18rem; color: var(--muted); }
@media (max-width: 900px) {
  .topbar { grid-template-columns: 1fr auto; }
  .topbar nav { grid-row: 2; grid-column: 1 / -1; justify-content: space-between; overflow-x: auto; }
  .identity { display: none; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .plan-item { grid-template-columns: 1fr; }
  .plan-numbers { order: 2; }
  .plan-item form { order: 3; }
  .bid-button { width: 100%; }
  .admin-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .shell { width: min(100% - 1rem, 1240px); padding-top: 1.5rem; }
  .topbar { padding: .85rem; }
  .page-heading { align-items: flex-start; flex-direction: column; }
  .run-status { margin-top: 1rem; }
  .scanner-actions { justify-content: flex-start; }
  .metric-grid { gap: .5rem; }
  .metric-card { padding: .9rem; }
  .metric-card strong { font-size: 1.05rem; }
  .panel { padding: .85rem; border-radius: 12px; }
  .panel-title { align-items: flex-start; }
  .filters-wrap { flex-direction: column; }
  .filters { width: 100%; }
  .plan-numbers { grid-template-columns: repeat(3, 1fr); gap: .35rem; }
}
