:root {
  --bg: linear-gradient(180deg, #f3f8ff 0%, #edf3ff 100%);
  --text: #0f172a;
  --muted: #5b6c8a;
  --line: rgba(148, 163, 184, 0.35);
  --panel: rgba(255, 255, 255, 0.92);
  --primary: #1d4ed8;
  --primary-strong: #1e40af;
  --danger-bg: #fee2e2;
  --danger-text: #991b1b;
  --ok-bg: #dcfce7;
  --ok-text: #166534;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: var(--bg);
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

button, input { font: inherit; }
select { font: inherit; }
button { cursor: pointer; }

.shell,
.login-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 36px 0 48px;
}

.login-page {
  display: grid;
  place-items: center;
}

.login-shell {
  width: min(520px, calc(100% - 32px));
}

.login-card,
.token-card,
.panel,
.toolbar,
.table-card {
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.08);
  border-radius: 24px;
}

.login-card {
  padding: 28px;
}

.login-form {
  display: grid;
  gap: 12px;
  margin-top: 20px;
}

.hero {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 24px;
  align-items: stretch;
  margin-bottom: 20px;
}

.hero-links {
  display: flex;
  gap: 12px;
  margin-top: 18px;
  flex-wrap: wrap;
}

.menu-wrap {
  position: relative;
}

.menu-toggle {
  min-width: 48px;
  padding: 12px 14px;
  font-size: 22px;
  line-height: 1;
  background: #334155;
}

.bulk-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 240px;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.16);
  padding: 8px;
  z-index: 30;
}

.bulk-menu-item {
  width: 100%;
  justify-content: flex-start;
  background: transparent;
  color: var(--text);
  border-radius: 12px;
  padding: 10px 12px;
}

.bulk-menu-item:hover {
  background: #e2e8f0;
  color: var(--text);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: 12px;
  font-weight: 800;
}

h1 {
  margin: 0;
  font-size: clamp(36px, 7vw, 74px);
  line-height: .95;
  letter-spacing: -.06em;
}

.muted {
  color: var(--muted);
  font-size: 18px;
}

.token-card {
  padding: 18px;
  display: grid;
  gap: 10px;
  align-content: start;
}

label {
  font-weight: 700;
  font-size: 14px;
}

input {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 14px;
  padding: 12px 14px;
  background: white;
}

select {
  border: 1px solid #cbd5e1;
  border-radius: 14px;
  padding: 12px 14px;
  background: white;
}

button,
.link-button {
  border: 0;
  border-radius: 14px;
  padding: 12px 16px;
  color: white;
  background: var(--primary);
  font-weight: 800;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

button:hover,
.link-button:hover {
  background: var(--primary-strong);
}

.link-button.secondary {
  background: #0f172a;
}

.panel {
  padding: 18px;
  margin-bottom: 16px;
}

.manual-check {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
}

.manual-result {
  margin-top: 12px;
  color: #334155;
}

.toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 16px;
  margin-bottom: 16px;
}

.checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.checkbox input {
  width: auto;
}

.table-card {
  overflow: hidden;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  text-align: left;
  padding: 14px 16px;
  border-bottom: 1px solid #e2e8f0;
  vertical-align: top;
}

th {
  font-size: 12px;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: .08em;
}

td {
  font-size: 14px;
}

a {
  color: var(--primary);
  font-weight: 700;
  text-decoration: none;
}

.badge {
  display: inline-flex;
  padding: 4px 8px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 12px;
}

.yes {
  background: var(--ok-bg);
  color: var(--ok-text);
}

.no {
  background: var(--danger-bg);
  color: var(--danger-text);
}

.status {
  padding: 14px 16px;
  color: var(--muted);
}

.row-action {
  padding: 7px 10px;
  border-radius: 10px;
  font-size: 12px;
  margin-right: 6px;
  margin-bottom: 6px;
}

.row-action.secondary {
  background: #334155;
}

.row-action.danger {
  background: #b91c1c;
}

.status-active {
  background: #dbeafe;
  color: #1d4ed8;
}

.status-archived {
  background: #e2e8f0;
  color: #334155;
}

.status-ignored {
  background: #fee2e2;
  color: #991b1b;
}

.error-box,
.status-note {
  padding: 12px 14px;
  border-radius: 14px;
  margin-top: 12px;
}

.error-box,
.status-error {
  background: var(--danger-bg);
  color: var(--danger-text);
}

.status-ok {
  background: var(--ok-bg);
  color: var(--ok-text);
}

@media (max-width: 780px) {
  .hero {
    grid-template-columns: 1fr;
  }

  .toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .manual-check {
    grid-template-columns: 1fr;
  }

  .hero-links {
    flex-direction: column;
  }
}
