:root {
  --bg: #f4f6f8;
  --panel: #ffffff;
  --line: #d9dee5;
  --text: #1f2933;
  --muted: #667085;
  --green: #087f5b;
  --green-dark: #06684a;
  --red: #c92a2a;
  --yellow: #f5c542;
}

* {
  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: 15px;
}

a {
  color: inherit;
  text-decoration: none;
}

.topbar {
  align-items: center;
  background: #17212b;
  color: #fff;
  display: flex;
  gap: 24px;
  min-height: 64px;
  padding: 0 28px;
}

.brand {
  font-size: 18px;
  font-weight: 700;
}

.nav {
  display: flex;
  gap: 8px;
  flex: 1;
}

.nav a {
  border-radius: 6px;
  color: #d9e1ea;
  padding: 9px 12px;
}

.nav a:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.logout-form {
  align-items: center;
  display: flex;
  gap: 12px;
}

.page-shell {
  margin: 0 auto;
  max-width: 1220px;
  padding: 28px;
}

.auth-shell {
  align-items: center;
  display: flex;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
}

.auth-card,
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(18, 38, 63, 0.08);
}

.auth-card {
  max-width: 420px;
  padding: 32px;
  width: 100%;
}

.auth-heading {
  margin-bottom: 24px;
}

.auth-heading p,
.eyebrow {
  color: var(--green);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  margin: 0 0 6px;
  text-transform: uppercase;
}

h1 {
  font-size: 30px;
  line-height: 1.15;
  margin: 0;
}

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

.toolbar {
  align-items: center;
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
}

.toolbar input {
  max-width: 460px;
}

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

.form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 24px;
}

.form-grid.compact {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 22px;
}

.narrow-form {
  max-width: 520px;
  padding: 24px;
}

label {
  color: #344054;
  display: grid;
  font-size: 13px;
  font-weight: 700;
  gap: 7px;
}

input {
  background: #fff;
  border: 1px solid #cfd6dd;
  border-radius: 6px;
  color: var(--text);
  font: inherit;
  min-height: 42px;
  padding: 9px 11px;
  width: 100%;
}

input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(8, 127, 91, 0.14);
  outline: none;
}

.check-row {
  align-items: center;
  display: flex;
  gap: 10px;
  margin-top: 22px;
}

.check-row input {
  min-height: auto;
  width: auto;
}

.form-actions {
  align-items: end;
  display: flex;
  gap: 10px;
  grid-column: 1 / -1;
}

.button {
  align-items: center;
  background: #fff;
  border: 1px solid #cfd6dd;
  border-radius: 6px;
  color: #1f2933;
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-weight: 700;
  justify-content: center;
  min-height: 40px;
  padding: 9px 14px;
  white-space: nowrap;
}

.button:hover {
  background: #f8fafb;
}

.button.primary {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}

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

.button.ghost {
  background: transparent;
}

.button.danger {
  border-color: #f0b8b8;
  color: var(--red);
}

.button.small {
  min-height: 32px;
  padding: 6px 10px;
}

.button.full {
  width: 100%;
}

.alerts {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.alert {
  border-radius: 6px;
  padding: 12px 14px;
}

.alert.error {
  background: #fff1f1;
  border: 1px solid #ffc9c9;
  color: #9b1c1c;
}

.alert.success {
  background: #e6fcf5;
  border: 1px solid #96f2d7;
  color: #065f46;
}

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

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

th,
td {
  border-bottom: 1px solid #edf0f3;
  padding: 13px 14px;
  text-align: left;
  vertical-align: middle;
}

th {
  background: #f8fafb;
  color: #475467;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

td {
  color: #26323f;
}

.mono {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 13px;
}

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

.badge.ok {
  background: #d3f9d8;
  color: #0b7285;
}

.badge.off {
  background: #fff3bf;
  color: #9c6b00;
}

.actions {
  align-items: center;
  display: flex;
  gap: 8px;
}

.actions form {
  margin: 0;
}

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

@media (max-width: 760px) {
  .topbar,
  .page-head,
  .toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar {
    padding: 16px;
  }

  .nav,
  .logout-form {
    width: 100%;
  }

  .logout-form {
    justify-content: space-between;
  }

  .page-shell {
    padding: 18px;
  }

  .form-grid,
  .form-grid.compact {
    grid-template-columns: 1fr;
  }
}
