:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --surface: #ffffff;
  --line: #d8dde5;
  --text: #17202a;
  --muted: #667085;
  --blue: #2563eb;
  --green: #17803d;
  --amber: #b45309;
  --red: #b42318;
  --ink: #111827;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.45;
}

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

a:hover {
  text-decoration: underline;
}

input,
select,
textarea,
button,
.button {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font: inherit;
}

input,
select,
textarea {
  width: 100%;
  padding: 7px 9px;
  background: #fff;
  color: var(--text);
}

textarea {
  resize: vertical;
}

button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 12px;
  background: var(--ink);
  color: #fff;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}

button:hover,
.button:hover {
  background: #2d3748;
  text-decoration: none;
}

.button.ghost {
  background: #fff;
  color: var(--ink);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 56px;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
}

.usage-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
  color: #475467;
  font-size: 12px;
}

.usage-strip span {
  min-height: 24px;
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  white-space: nowrap;
}

.brand {
  color: var(--ink);
  font-weight: 700;
}

.topbar nav {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.topbar nav a {
  color: #344054;
}

.shell {
  max-width: 1440px;
  margin: 0 auto;
  padding: 24px;
}

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

h1,
h2 {
  margin: 0;
  color: var(--ink);
  letter-spacing: 0;
}

h1 {
  font-size: 26px;
}

h2 {
  margin-bottom: 12px;
  font-size: 16px;
}

p {
  margin: 6px 0 0;
}

.meta {
  display: block;
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.strong {
  display: inline-block;
  max-width: 520px;
  color: var(--ink);
  font-weight: 650;
  overflow-wrap: anywhere;
}

.inline-search {
  display: grid;
  grid-template-columns: minmax(220px, 420px) auto;
  gap: 8px;
  min-width: min(100%, 520px);
}

.filters {
  display: grid;
  grid-template-columns: repeat(6, minmax(140px, 1fr));
  gap: 10px;
  align-items: end;
  padding: 14px;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

label {
  display: grid;
  gap: 5px;
  color: #344054;
  font-size: 12px;
  font-weight: 600;
}

.toggles {
  grid-column: span 3;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
}

.toggles label,
.checkline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.toggles input,
.checkline input {
  width: auto;
  min-height: auto;
}

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

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

.panel {
  padding: 16px;
}

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

th,
td {
  padding: 11px 12px;
  border-bottom: 1px solid #edf0f5;
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
}

th {
  color: #475467;
  font-size: 12px;
  font-weight: 700;
  background: #fafbfc;
}

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

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #eef2f7;
  color: #344054;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.pill.success {
  background: #dcfce7;
  color: var(--green);
}

.pill.warn {
  background: #ffedd5;
  color: var(--amber);
}

.pill.info {
  background: #dbeafe;
  color: var(--blue);
}

.pill.muted {
  background: #f2f4f7;
  color: #667085;
}

.pill.live {
  background: #fee4e2;
  color: var(--red);
}

.status-row,
.button-row,
.actions,
.form-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 16px;
}

.grid {
  display: grid;
  gap: 16px;
  margin-bottom: 16px;
}

.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.full-span {
  grid-column: 1 / -1;
}

.stack {
  display: grid;
  gap: 10px;
}

dl {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 9px 12px;
  margin: 0;
}

dt {
  color: var(--muted);
  font-weight: 700;
}

dd {
  margin: 0;
  overflow-wrap: anywhere;
}

code {
  color: #344054;
  white-space: pre-wrap;
}

.list {
  display: grid;
  gap: 9px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

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

.error {
  padding: 10px;
  border: 1px solid #fda29b;
  border-radius: 6px;
  background: #fff1f0;
  color: var(--red);
}

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

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

@media (max-width: 980px) {
  .filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .toggles {
    grid-column: span 2;
  }

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

@media (max-width: 640px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
    padding: 12px 16px;
  }

  .shell {
    padding: 16px;
  }

  .page-head,
  .inline-search {
    grid-template-columns: 1fr;
    display: grid;
    width: 100%;
  }

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

  .toggles {
    grid-column: span 1;
  }

  dl {
    grid-template-columns: 1fr;
  }
}
