:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --panel: #ffffff;
  --panel-soft: #eef7f5;
  --text: #17202a;
  --muted: #667085;
  --line: #d9e2ec;
  --primary: #0f766e;
  --primary-dark: #0b5f59;
  --danger-bg: #fff1f0;
  --danger: #b42318;
  --warn-bg: #fff7e6;
  --warn: #9a5b00;
  --good-bg: #e8f7ee;
  --good: #157347;
  --shadow: 0 18px 42px rgba(31, 44, 71, 0.08);
}

* {
  box-sizing: border-box;
}

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

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

button,
input,
textarea {
  font: inherit;
}

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

.topbar {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 22px 0;
}

.brand {
  color: var(--text);
  font-size: 21px;
  font-weight: 800;
}

.nav {
  display: flex;
  gap: 6px;
  margin-left: auto;
}

.nav a,
.ghost-button,
.secondary-button,
.primary-button {
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
  white-space: nowrap;
}

.nav a {
  color: var(--muted);
}

.nav a.active,
.nav a:hover {
  background: #e7f1ef;
  color: var(--primary-dark);
}

.logout-form {
  margin: 0;
}

.primary-button {
  background: var(--primary);
  color: white;
  font-weight: 700;
}

.primary-button:hover {
  background: var(--primary-dark);
}

.primary-button:disabled {
  background: #97b8b4;
  cursor: not-allowed;
}

.secondary-button {
  background: #e7f1ef;
  color: var(--primary-dark);
  font-weight: 700;
}

.ghost-button {
  background: transparent;
  color: var(--muted);
}

.content {
  padding: 18px 0 48px;
}

.page-head {
  align-items: center;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.page-head h1,
.login-card h1 {
  margin: 2px 0 0;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.1;
}

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

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

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.alert {
  border-radius: 8px;
  margin: 0 0 16px;
  padding: 12px 14px;
}

.alert.error {
  background: var(--danger-bg);
  color: var(--danger);
}

.login-panel {
  display: grid;
  min-height: calc(100vh - 130px);
  place-items: center;
}

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

.form-stack,
.import-form {
  display: grid;
  gap: 16px;
}

.form-stack label,
.input-block {
  display: grid;
  gap: 8px;
}

.form-stack span,
.input-block span,
.file-box span {
  color: #344054;
  font-weight: 700;
}

input[type="text"],
input[type="password"],
input[type="search"],
textarea {
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  outline: none;
  padding: 12px;
  width: 100%;
}

textarea {
  line-height: 1.5;
  min-height: 180px;
  resize: vertical;
}

input:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

.full {
  width: 100%;
}

.import-form,
.copy-panel,
.commit-bar,
.table-wrap,
.info-grid > div {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.import-form {
  padding: 18px;
}

.form-row {
  align-items: end;
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(0, 1fr) auto;
}

.file-box {
  background: var(--panel-soft);
  border: 1px dashed #9ccbc4;
  border-radius: 8px;
  display: grid;
  gap: 8px;
  padding: 14px;
}

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

.info-grid > div {
  padding: 18px;
}

.info-grid p {
  color: var(--muted);
  margin: 8px 0 0;
}

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

.stats div {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

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

.stats strong {
  display: block;
  font-size: 28px;
  margin-top: 4px;
}

.commit-bar,
.copy-panel {
  align-items: center;
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1fr) auto;
  margin-bottom: 18px;
  padding: 16px;
}

.copy-panel textarea {
  grid-column: 1 / -1;
  min-height: 120px;
}

.copy-panel h2,
.section-title h2 {
  margin: 0;
}

.split {
  display: grid;
  gap: 18px;
  grid-template-columns: 1fr 1fr;
}

.section-title {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin: 10px 0;
}

.section-title span {
  background: #dbeafe;
  border-radius: 999px;
  color: #1d4ed8;
  font-weight: 800;
  min-width: 32px;
  padding: 4px 10px;
  text-align: center;
}

.table-wrap {
  overflow: auto;
}

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

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

th {
  background: #f8fafc;
  color: #475467;
  font-size: 13px;
  font-weight: 800;
}

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

.text-cell {
  max-width: 520px;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

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

.pill.good {
  background: var(--good-bg);
  color: var(--good);
}

.pill.warn {
  background: var(--warn-bg);
  color: var(--warn);
}

.empty {
  color: var(--muted);
  text-align: center;
}

.search-bar {
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) auto auto;
  margin-bottom: 14px;
}

.toast {
  background: #111827;
  border-radius: 8px;
  bottom: 20px;
  color: white;
  opacity: 0;
  padding: 10px 14px;
  pointer-events: none;
  position: fixed;
  right: 20px;
  transform: translateY(8px);
  transition: 160ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.visually-hidden {
  height: 1px;
  left: -10000px;
  overflow: hidden;
  position: absolute;
  top: auto;
  width: 1px;
}

@media (max-width: 860px) {
  .topbar,
  .page-head,
  .commit-bar,
  .copy-panel {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar {
    display: grid;
  }

  .nav {
    margin-left: 0;
    overflow-x: auto;
  }

  .form-row,
  .info-grid,
  .stats,
  .split,
  .search-bar {
    grid-template-columns: 1fr;
  }

  .actions {
    justify-content: flex-start;
  }
}

