:root {
  --ink: #202225;
  --muted: #73777d;
  --paper: #f1f2f3;
  --panel: #fbfbfc;
  --line: #d7d9dd;
  --brand: #4b5563;
  --bad: #c77b75;
  --good: #7f9b87;
  --warn: #b8a36a;
  --shadow: 0 20px 70px rgba(30, 34, 39, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 10%, rgba(107, 114, 128, 0.18), transparent 34rem),
    radial-gradient(circle at 90% 0%, rgba(75, 85, 99, 0.16), transparent 30rem),
    linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
  font-family: "Avenir Next", "Trebuchet MS", sans-serif;
}

button,
select,
input {
  font: inherit;
}

.boot {
  min-height: 100vh;
  display: grid;
  place-items: center;
  color: var(--muted);
}

.shell {
  min-height: 100vh;
  padding: 28px;
}

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

.login-panel {
  width: min(980px, 100%);
  align-items: center;
}

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

.hero,
.panel,
.metric {
  background: rgba(251, 251, 252, 0.88);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--shadow);
}

.hero {
  padding: 28px;
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 18px;
  align-items: end;
  margin-bottom: 18px;
}

.eyebrow {
  color: var(--brand);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1 {
  margin: 10px 0 8px;
  font-size: clamp(34px, 6vw, 66px);
  line-height: 0.92;
  letter-spacing: -0.06em;
}

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

.login-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.login-links a,
.login-links button,
.download-button,
.tab,
.field {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--ink);
  text-decoration: none;
  padding: 10px 14px;
}

.download-button {
  display: inline-flex;
  background: var(--ink);
  color: white;
  font-weight: 900;
}

.controls {
  display: grid;
  grid-template-columns: 230px minmax(220px, 1fr) 180px;
  gap: 12px;
  margin-bottom: 14px;
}

.field {
  width: 100%;
  min-height: 46px;
  outline: none;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.tab {
  cursor: pointer;
}

.tab.active {
  background: var(--brand);
  color: white;
  border-color: var(--brand);
}

.metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.metric {
  padding: 16px;
}

.metric small {
  display: block;
  color: var(--muted);
  margin-bottom: 8px;
}

.metric strong {
  font-size: 28px;
  letter-spacing: -0.04em;
}

.panel {
  overflow: hidden;
}

.panel-head {
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.panel-head h2 {
  margin: 0;
}

.content {
  padding: 18px 20px;
}

.table-wrap {
  overflow: auto;
  max-height: 70vh;
  border: 1px solid var(--line);
  border-radius: 20px;
}

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

th,
td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

th {
  position: sticky;
  top: 0;
  background: #e5e7eb;
  z-index: 1;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.chip {
  display: inline-flex;
  border-radius: 999px;
  padding: 5px 9px;
  background: #e5e7eb;
  font-size: 12px;
  font-weight: 900;
}

.chip.bad {
  background: rgba(199, 123, 117, 0.16);
}

.chip.good {
  background: rgba(127, 155, 135, 0.18);
}

.article-grid {
  display: grid;
  grid-template-columns: 380px minmax(0, 1fr);
  gap: 14px;
}

.article-list {
  max-height: 70vh;
  overflow: auto;
}

.article-card {
  width: 100%;
  display: block;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  text-align: left;
  padding: 14px 16px;
  cursor: pointer;
}

.article-card.active {
  background: #e5e7eb;
}

.article-title {
  font-weight: 900;
  margin-bottom: 4px;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.card {
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 14px;
  background: #f9fafb;
}

.error {
  color: #9e3f35;
  background: rgba(199, 123, 117, 0.16);
  border: 1px solid rgba(199, 123, 117, 0.35);
  border-radius: 18px;
  padding: 16px;
}

@media (max-width: 980px) {
  .shell {
    padding: 16px;
  }

  .hero,
  .controls,
  .metrics,
  .article-grid {
    grid-template-columns: 1fr;
  }

  .login-links {
    justify-content: flex-start;
  }
}
