:root {
  --bg: #f4f7fb;
  --panel: #ffffff;
  --line: #d9e3f0;
  --text: #162130;
  --muted: #68778d;
  --primary: #165dff;
  --primary-soft: #e8f0ff;
  --danger: #d13c3c;
  --warning: #a36400;
  --success: #0d8c51;
}

* { box-sizing: border-box; }
body { margin: 0; font-family: "Segoe UI", "PingFang SC", sans-serif; color: var(--text); background: linear-gradient(180deg, #eaf1ff 0%, #f7f9fd 160px, var(--bg) 320px); }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
.auth-page { min-height: 100vh; display: grid; place-items: center; }
.auth-shell { width: min(420px, calc(100vw - 32px)); }
.auth-card, .card { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 18px 40px rgba(22, 33, 48, 0.08); }
.auth-card { padding: 28px; }
.site-shell { min-height: 100vh; }
.site-header { position: sticky; top: 0; z-index: 20; background: linear-gradient(90deg, #165dff 0%, #0f4acb 100%); box-shadow: 0 12px 28px rgba(22, 93, 255, 0.18); }
.header-inner { max-width: 1320px; margin: 0 auto; padding: 14px 20px; display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.brand { font-size: 24px; font-weight: 700; color: #fff; letter-spacing: 0.2px; }
.top-nav { display: flex; gap: 8px; flex: 1 1 640px; flex-wrap: wrap; }
.nav-link { padding: 10px 14px; border-radius: 12px; color: rgba(255, 255, 255, 0.82); }
.nav-link.active, .nav-link:hover { background: rgba(255, 255, 255, 0.14); color: #fff; }
.content { max-width: 1320px; margin: 0 auto; padding: 24px 20px 80px; }
.page-hero {
  margin-bottom: 18px;
  padding: 22px 26px;
  background:
    radial-gradient(circle at top right, rgba(22, 93, 255, 0.12), transparent 32%),
    linear-gradient(135deg, rgba(22, 93, 255, 0.12), rgba(22, 93, 255, 0.03));
  border-color: #cfe0ff;
}
.page-hero-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
}
.page-hero-copy h1 {
  margin: 6px 0 10px;
  font-size: 42px;
  line-height: 1.08;
}
.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
}
.hero-description {
  max-width: 720px;
  margin: 0;
  font-size: 16px;
  line-height: 1.7;
}
.page-hero-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  flex: 0 0 auto;
}
.hero-tag {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(22, 93, 255, 0.14);
  color: #1147bc;
  font-size: 13px;
  font-weight: 700;
}
.hero-tag-soft {
  background: rgba(255, 255, 255, 0.65);
  color: #5d7190;
}
.page-hero-accent {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
}
.hero-accent-line {
  width: min(340px, 100%);
  height: 1px;
  background: linear-gradient(90deg, rgba(22, 93, 255, 0.02), rgba(22, 93, 255, 0.35), rgba(22, 93, 255, 0.02));
}
.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 22px; gap: 12px; flex-wrap: wrap; }
.stack { display: grid; }
.gap-md { gap: 16px; }
.muted { color: var(--muted); }
.btn { border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; background: #fff; cursor: pointer; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-danger { background: #fff2f2; border-color: #f2caca; color: var(--danger); }
.btn-ghost { background: transparent; color: #fff; border-color: rgba(255, 255, 255, 0.26); }
.btn-row, .actions, .toolbar { display: flex; gap: 8px; flex-wrap: wrap; }
.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat-card, .card { padding: 18px; }
.stat-card { background: linear-gradient(180deg, #fff 0%, #fafcff 100%); }
.stat-value { font-size: 28px; font-weight: 700; }
.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; gap: 12px; flex-wrap: wrap; }
table { width: 100%; border-collapse: separate; border-spacing: 0; }
th, td { padding: 14px 12px; text-align: left; border-bottom: 1px solid #e7eef8; vertical-align: top; }
thead th {
  color: #587197;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: linear-gradient(180deg, #f8fbff 0%, #eef5ff 100%);
  position: sticky;
  top: 0;
  z-index: 1;
  white-space: nowrap;
}
tbody tr:nth-child(even) { background: rgba(239, 246, 255, 0.45); }
tbody tr:hover { background: #eef5ff; }
tbody tr:last-child td { border-bottom: none; }
.table-wrap {
  overflow: auto;
  border: 1px solid #dbe7f5;
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}
.table-title {
  margin: 0 0 12px;
  font-size: 18px;
  font-weight: 700;
}
.cell-main { font-weight: 600; color: #10233f; }
.cell-sub { margin-top: 4px; font-size: 13px; color: var(--muted); }
.align-right { text-align: right; }
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  border: 1px solid transparent;
}
.status-pill.success {
  color: var(--success);
  background: #edf9f2;
  border-color: #caedd8;
}
.status-pill.failed {
  color: var(--danger);
  background: #fff1f1;
  border-color: #f7d5d5;
}
.status-pill.pending {
  color: #6d7f99;
  background: #f2f6fb;
  border-color: #d8e3f0;
}
input, textarea, select { width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: #fff; }
.pill { display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 999px; background: var(--primary-soft); color: var(--primary); font-size: 13px; }
.notice { min-height: 22px; color: var(--danger); }
.status-success { color: var(--success); }
.status-danger { color: var(--danger); }
.status-warning { color: var(--warning); }
.inline-form { display: grid; gap: 10px; }
.detail { white-space: pre-wrap; color: var(--muted); }
.footer-nav { border-top: 1px solid var(--line); background: rgba(255, 255, 255, 0.84); backdrop-filter: blur(10px); }
.footer-inner { max-width: 1320px; margin: 0 auto; padding: 14px 20px; display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }
.footer-nav .nav-link { color: var(--muted); }
.footer-nav .nav-link.active, .footer-nav .nav-link:hover { background: var(--primary-soft); color: var(--primary); }
@media (max-width: 920px) {
  .grid.cols-2, .grid.cols-4 { grid-template-columns: 1fr; }
  .header-inner { align-items: stretch; }
  .top-nav { flex-basis: 100%; }
  .page-hero { padding: 18px; }
  .page-hero-inner { flex-direction: column; align-items: flex-start; }
  .page-hero-copy h1 { font-size: 34px; }
  .page-hero-meta { flex-direction: row; align-items: center; flex-wrap: wrap; }
  .page-hero-accent { margin-top: 12px; }
  .hero-accent-line { width: 100%; }
  th, td { padding: 12px 10px; }
}
