:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --sidebar: #111827;
  --sidebar-2: #172033;
  --line: #e5e7eb;
  --line-strong: #d1d5db;
  --text: #111827;
  --muted: #6b7280;
  --brand: #2563eb;
  --brand-2: #0f766e;
  --green: #16a34a;
  --red: #dc2626;
  --orange: #f59e0b;
  --shadow: 0 16px 35px rgba(15, 23, 42, 0.08);
  --radius: 8px;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  font-size: 14px;
}
a { color: var(--brand); text-decoration: none; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-size: 18px;
  font-weight: 700;
  padding: 0 20px;
}
.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  font-size: 13px;
}
.topbar-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-right: 16px;
  color: var(--muted);
  font-size: 13px;
}
.topbar-meta span, .topbar-meta form {
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
}
.link-button {
  color: var(--brand);
  border: 0;
  background: transparent;
  cursor: pointer;
  font: inherit;
  padding: 0;
}
.shell {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: calc(100vh - 60px);
}
.sidebar {
  background: linear-gradient(180deg, var(--sidebar), var(--sidebar-2));
  padding: 18px 12px;
  border-right: 1px solid #0b1220;
}
.sidebar a, .sidebar summary {
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 10px 12px;
  color: #cbd5e1;
  border-radius: 8px;
  cursor: pointer;
  margin-bottom: 4px;
  font-weight: 600;
}
.sidebar a:hover, .sidebar summary:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}
.sidebar details { margin-top: 4px; }
.sidebar details a {
  min-height: 34px;
  padding-left: 28px;
  font-size: 13px;
  color: #dbeafe;
}
.content {
  padding: 24px;
  overflow: auto;
}
.page-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
h1 {
  color: var(--text);
  font-weight: 750;
  margin: 0;
  font-size: 28px;
  letter-spacing: 0;
}
h2 {
  margin: 0;
  font-size: 16px;
  color: var(--text);
  font-weight: 700;
}
.panel {
  border: 1px solid var(--line);
  margin-bottom: 18px;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.panel-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.panel-body { padding: 16px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.stack { display: grid; gap: 14px; }
label {
  display: grid;
  gap: 7px;
  color: #374151;
  font-size: 13px;
  font-weight: 650;
}
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 9px 11px;
  min-height: 38px;
  font: inherit;
  color: var(--text);
  background: #fff;
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid rgba(37, 99, 235, 0.16);
  border-color: var(--brand);
}
textarea { min-height: 100px; }
.actions {
  background: transparent;
  padding: 14px 0 0;
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.btn {
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 9px 14px;
  min-height: 38px;
  cursor: pointer;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font: inherit;
  font-weight: 700;
}
.btn.primary { background: var(--brand); }
.btn.secondary { background: #fff; color: #374151; border-color: var(--line-strong); }
.btn.danger { background: var(--red); }
.btn.small { padding: 6px 9px; min-height: 30px; font-size: 12px; }
.toolbar {
  display: grid;
  grid-template-columns: repeat(6, minmax(150px, 1fr)) auto auto;
  align-items: end;
  gap: 12px;
  margin-bottom: 16px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.toolbar label { min-width: 0; }
.table-wrap {
  width: 100%;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}
table { width: 100%; border-collapse: separate; border-spacing: 0; }
th, td {
  border-bottom: 1px solid var(--line);
  padding: 10px 11px;
  text-align: left;
  white-space: nowrap;
}
th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f9fafb;
  color: #4b5563;
  font-weight: 800;
  font-size: 12px;
  text-transform: uppercase;
}
td { background: #fff; }
tr:hover td { background: #f8fbff; }
tr:last-child td { border-bottom: 0; }
.status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  padding: 5px 10px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 12px;
  min-width: 82px;
}
.status.accepted { background: var(--green); }
.status.duplicate { background: var(--orange); }
.status.rejected { background: var(--red); }
.status-toggle {
  border: 0;
  border-radius: 999px;
  min-width: 62px;
  height: 30px;
  color: #fff;
  cursor: pointer;
  font-weight: 800;
  font-size: 12px;
  padding: 0 10px;
}
.status-toggle.on { background: var(--green); }
.status-toggle.off { background: #64748b; }
.status-toggle:hover { filter: brightness(0.95); }
.cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}
.metric {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 18px;
  box-shadow: var(--shadow);
}
.metric span { color: var(--muted); font-weight: 700; }
.metric strong { display: block; font-size: 30px; color: var(--text); margin-top: 8px; }
.alert {
  padding: 12px 14px;
  margin-bottom: 16px;
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: #1e3a8a;
  border-radius: var(--radius);
}
.alert.error { border-color: #fecaca; background: #fef2f2; color: #991b1b; }
.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: var(--bg);
}
.login-card {
  width: min(420px, calc(100vw - 32px));
  background: #fff;
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.pagination {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 14px 2px 0;
  flex-wrap: wrap;
  color: var(--muted);
  font-weight: 650;
}
.pagination a {
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 7px 11px;
  background: #fff;
}
code, pre {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 2px 5px;
}
pre { padding: 12px; overflow: auto; }
@media (max-width: 1200px) {
  .toolbar { grid-template-columns: repeat(3, minmax(150px, 1fr)); }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { display: flex; overflow-x: auto; padding: 10px; }
  .grid-2, .grid-3, .cards, .toolbar { grid-template-columns: 1fr; }
  .topbar { height: auto; align-items: stretch; flex-direction: column; }
  .topbar-meta { flex-wrap: wrap; padding: 0 12px 12px; }
  .content { padding: 16px; }
}
