:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --page: #f7f8fa;
  --surface: #fff;
  --hover: #f1f3f5;
  --text: #111827;
  --muted: #6b7280;
  --border: #e5e7eb;
  --danger: #dc2626;
  --success: #16a34a;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font: 14px/1.5 -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
}

.page {
  max-width: 1120px;
  margin: 0 auto;
  padding: 24px;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
}

.auth-panel,
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
}

.auth-panel {
  width: 360px;
}

.brand-line {
  width: 36px;
  height: 3px;
  background: var(--primary);
  border-radius: 2px;
  margin-bottom: 16px;
}

h1, h2, p { margin: 0; }
h1 { font-size: 22px; line-height: 1.25; }
h2 { font-size: 16px; }
.muted { color: var(--muted); }

.form,
.upload-form {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

label span {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  color: #374151;
}

input[type="text"],
input[type="password"],
input:not([type]) {
  width: 100%;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0 10px;
  font: inherit;
}

input[type="file"] {
  display: block;
  width: 100%;
  height: 36px;
}

button {
  height: 36px;
  border: 0;
  border-radius: 6px;
  padding: 0 14px;
  background: var(--primary);
  color: white;
  font-weight: 600;
  cursor: pointer;
}

button:hover { background: var(--primary-hover); }
button.secondary {
  background: #fff;
  color: #374151;
  border: 1px solid var(--border);
}

.actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0 14px;
  background: #fff;
  color: #374151;
  font-weight: 600;
  text-decoration: none;
}

.button-link:hover {
  background: var(--hover);
  text-decoration: none;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0;
}

.metrics div {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
}

.metrics span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.metrics strong {
  display: block;
  margin-top: 4px;
  font-size: 24px;
  font-variant-numeric: tabular-nums;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  white-space: nowrap;
}

th, td {
  height: 40px;
  border-bottom: 1px solid var(--border);
  padding: 0 10px;
  text-align: left;
}

th {
  background: var(--page);
  font-size: 13px;
  font-weight: 700;
  position: sticky;
  top: 0;
}

tr:hover td { background: var(--hover); }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.timestamp { font-variant-numeric: tabular-nums; }
.empty { text-align: center; color: var(--muted); }
.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
}

.dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
}

.status.success { color: #166534; }
.status.success .dot { background: var(--success); }
.status.rejected { color: var(--danger); }
.status.rejected .dot { background: var(--danger); }
.status.neutral { color: var(--muted); }
.status.neutral .dot { background: var(--muted); }

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

.toast-stack {
  position: fixed;
  right: 20px;
  top: 20px;
  display: grid;
  gap: 8px;
  z-index: 10;
}

.toast {
  min-width: 220px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: white;
  box-shadow: 0 8px 20px rgba(15, 23, 42, .08);
}

.toast.error { border-color: #fecaca; color: var(--danger); }
.toast.success { border-color: #bbf7d0; color: var(--success); }

@media (max-width: 720px) {
  .page { padding: 14px; }
  .topbar { align-items: flex-start; gap: 12px; }
  .metrics { grid-template-columns: repeat(1, minmax(0, 1fr)); }
}
