:root {
  color-scheme: light;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f6f7f8;
  color: #1c232b;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
}

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

button {
  border: 1px solid #1d4b73;
  border-radius: 6px;
  background: #245d8f;
  color: #fff;
  cursor: pointer;
  padding: 0.55rem 0.8rem;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

button.secondary {
  border-color: #c8d2dc;
  background: #fff;
  color: #1c232b;
}

button.danger {
  border-color: #a33b3b;
  background: #b84444;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #c8d2dc;
  border-radius: 6px;
  background: #fff;
  color: #1c232b;
  padding: 0.5rem 0.6rem;
}

label span {
  display: block;
  margin-bottom: 0.3rem;
  color: #5e6d7a;
  font-size: 0.82rem;
  font-weight: 700;
}

.hidden {
  display: none !important;
}

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

.login-panel {
  width: min(100%, 420px);
  border: 1px solid #d8e0e8;
  border-radius: 8px;
  background: #fff;
  padding: 1.5rem;
  box-shadow: 0 16px 40px rgb(28 35 43 / 8%);
}

.login-panel h1,
.topbar h1 {
  margin: 0;
  font-size: 1.6rem;
}

.eyebrow {
  margin: 0 0 0.2rem;
  color: #637587;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.stack {
  display: grid;
  gap: 0.9rem;
  margin-top: 1rem;
}

.muted {
  color: #637587;
}

.turnstile-container {
  min-height: 65px;
}

.workbench-shell {
  min-height: 100vh;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid #d8e0e8;
  background: #fff;
  padding: 1rem 1.25rem;
}

.operator {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  color: #516273;
  font-size: 0.9rem;
}

.tabs {
  display: flex;
  gap: 0.2rem;
  overflow-x: auto;
  border-bottom: 1px solid #d8e0e8;
  background: #eef2f5;
  padding: 0.45rem 1rem;
}

.tabs a {
  border-radius: 6px;
  color: #354656;
  font-size: 0.9rem;
  font-weight: 700;
  padding: 0.5rem 0.7rem;
  text-decoration: none;
  white-space: nowrap;
}

.tabs a.active {
  background: #fff;
  box-shadow: 0 1px 3px rgb(28 35 43 / 10%);
}

.content {
  display: grid;
  gap: 1rem;
  padding: 1rem;
}

.section-header {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
}

.section-header h2 {
  margin: 0;
  font-size: 1.25rem;
}

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

.panel {
  border: 1px solid #d8e0e8;
  border-radius: 8px;
  background: #fff;
  padding: 1rem;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.75rem;
}

.metric {
  border: 1px solid #d8e0e8;
  border-radius: 8px;
  background: #fff;
  padding: 0.9rem;
}

.metric span {
  display: block;
  color: #637587;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.metric strong {
  display: block;
  margin-top: 0.35rem;
  font-size: 1.5rem;
}

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

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

th,
td {
  border-bottom: 1px solid #e3e9ef;
  padding: 0.55rem 0.6rem;
  text-align: left;
  vertical-align: top;
}

th {
  color: #5d6e7f;
  font-size: 0.76rem;
  text-transform: uppercase;
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: #eef2f5;
  color: #33485c;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
}

.badge.good {
  background: #e2f2e6;
  color: #1f6632;
}

.badge.warn {
  background: #fff3cf;
  color: #795600;
}

.badge.bad {
  background: #f8dedc;
  color: #8a2c28;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.error {
  border-color: #e4b0ac;
  background: #fff4f3;
  color: #8a2c28;
}

@media (width <= 720px) {
  .topbar,
  .operator {
    align-items: flex-start;
    flex-direction: column;
  }

  .content {
    padding: 0.75rem;
  }
}
