:root {
  --ink: #1a1a1a;
  --paper: #ffffff;
  --line: #cfcfcf;
  --muted: #5f5f5f;
  --accent: #8a1c1c;
  --late-bg: #fdecec;
  --late-ink: #8a1c1c;
  --ok-bg: #eef6ee;
  --ok-ink: #2b5f2b;
  --header-bg: #f4f4f2;
  font-size: 16px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background: #eeeeec;
}

.page {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 20px 64px;
}

header.topbar {
  background: var(--ink);
  color: #fff;
  padding: 14px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
header.topbar a { color: #fff; text-decoration: none; font-weight: 600; }
header.topbar .brand { font-size: 1.05rem; letter-spacing: 0.02em; }

h1, h2, h3 { font-weight: 700; margin: 0 0 8px; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.2rem; }
p.muted, .muted { color: var(--muted); }

.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 20px;
  margin-bottom: 20px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}
th, td {
  border: 1px solid var(--line);
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
}
th { background: var(--header-bg); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.03em; }

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}
.badge.late { background: var(--late-bg); color: var(--late-ink); border: 1px solid var(--late-ink); }
.badge.ontime { background: var(--ok-bg); color: var(--ok-ink); border: 1px solid var(--ok-ink); }
.badge.noshow { background: #f2f2f2; color: var(--muted); border: 1px solid var(--line); }
.badge.unlisted { background: #fff6e0; color: #7a5b00; border: 1px solid #7a5b00; }

tr.late-row td { background: var(--late-bg); }

.btn {
  display: inline-block;
  background: var(--ink);
  color: #fff;
  padding: 10px 18px;
  border: none;
  border-radius: 4px;
  font-size: 1rem;
  cursor: pointer;
  text-decoration: none;
}
.btn:hover { opacity: 0.9; }
.btn.secondary { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.btn.big {
  font-size: 1.3rem;
  padding: 18px 24px;
  width: 100%;
  border-radius: 8px;
}
.btn.danger { background: var(--accent); }

.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 600; margin-bottom: 6px; }
.field input[type=text], .field input[type=datetime-local], .field select, .field textarea {
  width: 100%;
  padding: 12px;
  font-size: 1.05rem;
  border: 1px solid var(--line);
  border-radius: 4px;
}

.bidder-row { display: flex; gap: 8px; margin-bottom: 8px; align-items: center; }
.bidder-row input { flex: 1; padding: 10px; border: 1px solid var(--line); border-radius: 4px; }
.bidder-row .remove-row { background: none; border: none; color: var(--accent); font-size: 1.2rem; cursor: pointer; }

.qr-block { text-align: center; }
.qr-block img { border: 1px solid var(--line); padding: 8px; background: #fff; }
.qr-url { font-family: Consolas, monospace; font-size: 0.9rem; word-break: break-all; background: #f4f4f2; padding: 8px; border-radius: 4px; }

.error-box {
  background: var(--late-bg);
  border: 1px solid var(--late-ink);
  color: var(--late-ink);
  padding: 12px 16px;
  border-radius: 4px;
  margin-bottom: 16px;
  font-weight: 600;
}

.deadline-banner {
  padding: 14px 18px;
  border-radius: 6px;
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 16px;
}
.deadline-banner.open { background: var(--ok-bg); color: var(--ok-ink); border: 1px solid var(--ok-ink); }
.deadline-banner.closed { background: var(--late-bg); color: var(--late-ink); border: 1px solid var(--late-ink); }

.success-check {
  text-align: center;
  padding: 40px 20px;
}
.success-check .mark {
  font-size: 4rem;
  color: var(--ok-ink);
}
.success-check .time {
  font-size: 2rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.contract-list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.contract-list-item:last-child { border-bottom: none; }
.contract-list-item .title { font-weight: 600; }
.contract-list-item .meta { font-size: 0.85rem; color: var(--muted); }

.no-print { }

@media print {
  body { background: #fff; }
  header.topbar, .no-print { display: none !important; }
  .page { max-width: 100%; padding: 0; margin: 0; }
  .card { border: none; padding: 0; margin-bottom: 12px; }
  table { font-size: 12px; }
  th { background: #eee !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  tr.late-row td { background: #fbe4e4 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  a[href]:after { content: ""; }
}
