:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --ink: #20242b;
  --muted: #68717d;
  --line: #dce1e7;
  --sidebar: #24313a;
  --sidebar-2: #31434d;
  --teal: #15796f;
  --teal-dark: #0f5d55;
  --blue: #2f6fba;
  --amber: #b77720;
  --red: #b94b4b;
  --green: #2f7d4b;
  --violet: #6a5fb6;
  --shadow: 0 18px 45px rgba(28, 39, 49, 0.08);
}

* {
  box-sizing: border-box;
}

[hidden],
.is-hidden {
  display: none !important;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
a.button {
  cursor: pointer;
}

a {
  color: var(--teal);
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-panel {
  width: min(420px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 32px;
}

.login-panel h1,
.topbar h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.1;
  letter-spacing: 0;
}

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

.login-form,
.form-grid {
  display: grid;
  gap: 14px;
}

.login-form {
  margin-top: 28px;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  outline: none;
}

input,
select {
  height: 40px;
  padding: 0 12px;
}

textarea {
  min-height: 260px;
  padding: 14px;
  resize: vertical;
  line-height: 1.45;
}

.small-textarea {
  min-height: 96px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(21, 121, 111, 0.16);
}

.login-form button,
.button {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 6px;
  padding: 0 16px;
  background: var(--teal);
  color: #fff;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.button:hover,
.login-form button:hover {
  background: var(--teal-dark);
}

.button.secondary {
  background: #e8edf1;
  color: var(--ink);
}

.button.secondary:hover {
  background: #dce4ea;
}

.button.compact {
  min-height: 34px;
  padding: 0 12px;
  font-size: 13px;
}

button:disabled,
.button:disabled {
  cursor: wait;
  opacity: 0.68;
}

.form-error,
.form-message {
  margin: 0;
  color: var(--red);
  font-size: 13px;
  font-weight: 800;
}

.form-message {
  color: var(--muted);
}

.form-divider {
  height: 1px;
  background: var(--line);
  margin: 4px 0;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 240px 1fr;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 20px;
  background: var(--sidebar);
  color: #fff;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 900;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--teal);
  font-size: 12px;
}

.nav {
  display: grid;
  gap: 6px;
}

.nav-item,
.sidebar-action {
  min-height: 38px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #d8dde7;
  text-align: left;
  padding: 0 12px;
  font-weight: 800;
}

.nav-item:hover,
.nav-item.active {
  background: var(--sidebar-2);
  color: #fff;
}

.sidebar-action {
  margin-top: auto;
  color: #ffddd8;
}

.workspace {
  min-width: 0;
  padding: 28px;
}

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

.topbar-actions,
.filters,
.file-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.project-picker {
  width: 260px;
  gap: 4px;
  text-transform: none;
}

.project-picker span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.metric,
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.metric {
  display: grid;
  gap: 8px;
  padding: 18px;
}

.metric span,
.queue-row span,
.settings-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.metric strong {
  font-size: 32px;
  line-height: 1;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(340px, 0.75fr);
  gap: 18px;
  align-items: start;
}

.split.wide-left {
  grid-template-columns: minmax(0, 1.6fr) minmax(340px, 0.65fr);
}

.panel {
  padding: 18px;
}

.panel-head,
.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.panel h2 {
  margin: 0;
  font-size: 18px;
  letter-spacing: 0;
}

.panel-note {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.empty-row,
.queue-row,
.job-row {
  border-top: 1px solid var(--line);
  padding: 14px 0 0;
}

.queue-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
}

.project-list {
  display: grid;
  gap: 10px;
}

.project-card {
  width: 100%;
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
  color: var(--ink);
  text-align: left;
}

.project-card:hover,
.project-card.active {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(21, 121, 111, 0.11);
}

.project-card strong {
  font-size: 15px;
}

.project-card span,
.project-card small {
  color: var(--muted);
}

.inline-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.test-result {
  max-height: 220px;
  overflow: auto;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #101820;
  color: #e9f4f2;
  padding: 12px;
  font-size: 12px;
  line-height: 1.45;
  white-space: pre-wrap;
}

.import-form {
  display: grid;
  gap: 12px;
}

.file-row {
  justify-content: space-between;
}

.file-row input {
  padding: 8px 0;
  border: 0;
  height: auto;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1280px;
}

th,
td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 13px;
}

th {
  background: #edf1f4;
  color: #4f5966;
  font-size: 12px;
  text-transform: uppercase;
}

td small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

tr:last-child td {
  border-bottom: 0;
}

.domain-cell {
  display: grid;
  gap: 4px;
}

.domain-cell strong {
  font-size: 14px;
}

.domain-cell span {
  color: var(--muted);
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 0 9px;
  background: #e8edf1;
  color: #4e5962;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.status.with_email,
.status.link_found {
  background: rgba(47, 125, 75, 0.14);
  color: var(--green);
}

.status.with_form,
.status.published {
  background: rgba(183, 119, 32, 0.16);
  color: #835315;
}

.status.used {
  background: rgba(47, 111, 186, 0.15);
  color: var(--blue);
}

.status.questionable,
.status.link_missing {
  background: rgba(106, 95, 182, 0.15);
  color: var(--violet);
}

.status.failed,
.status.page_unavailable {
  background: rgba(185, 75, 75, 0.14);
  color: var(--red);
}

.status.no_contact {
  background: #ece7dd;
  color: #7a6041;
}

.rel-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.rel-list.vertical {
  display: grid;
  gap: 5px;
}

.rel-pill {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  border-radius: 999px;
  padding: 0 8px;
  background: #eef4f3;
  color: var(--teal);
  font-size: 11px;
  font-weight: 900;
}

.rel-pill.ok {
  background: rgba(47, 125, 75, 0.12);
  color: var(--green);
}

.rel-pill.bad {
  background: rgba(185, 75, 75, 0.12);
  color: var(--red);
}

.jobs-list {
  display: grid;
  gap: 12px;
}

.job-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.job-progress {
  color: var(--muted);
  font-size: 13px;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.settings-grid div {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.check-row {
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 10px;
  color: var(--ink);
}

.check-row input {
  width: 18px;
  height: 18px;
}

@media (max-width: 1120px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .workspace {
    padding: 20px;
  }

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

  .topbar-actions {
    flex-wrap: wrap;
  }
}

@media (max-width: 820px) {
  .metric-grid,
  .split,
  .split.wide-left,
  .settings-grid {
    grid-template-columns: 1fr;
  }

  .topbar-actions,
  .filters,
  .file-row,
  .panel-head,
  .table-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .project-picker {
    width: 100%;
  }

  .inline-grid {
    grid-template-columns: 1fr;
  }
}
