:root {
  --ink: #0f172a;
  --muted: #475569;
  --line: #e8eaed;
  --field: #f1f3f5;
  --blue: #2f5bea;
  --blue-hover: #2749c9;
  --green: #2fbf62;
  --radius: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: #fff;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 48px 40px 64px;
}

h1 {
  font-size: 40px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
  display: inline;
}

h2 { font-size: 22px; font-weight: 650; letter-spacing: -0.01em; }

.title-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }

.badge {
  background: #e9edfb;
  color: #4056c8;
  border-radius: 8px;
  padding: 5px 12px;
  font-size: 16px;
  font-weight: 600;
  white-space: nowrap;
}

.lede {
  font-size: 18px;
  line-height: 1.45;
  color: var(--muted);
  max-width: 1080px;
  margin: 18px 0 0;
}

.head-row {
  display: flex;
  gap: 32px;
  align-items: flex-start;
  margin-top: 30px;
}

.envvar { flex: 1; min-width: 0; }

.envvar-label { font-size: 15px; color: #334155; margin-bottom: 8px; }

.envvar-box {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--field);
  border-radius: var(--radius);
  padding: 18px 20px;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 17px;
  color: #64748b;
}

.envvar-box code {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.primary {
  background: var(--blue);
  color: #fff;
  border: 0;
  border-radius: var(--radius);
  padding: 16px 26px;
  font-size: 17px;
  font-weight: 600;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s ease;
}

.primary:hover { background: var(--blue-hover); }
.primary:disabled { opacity: .6; cursor: default; }

.ghost {
  background: #fff;
  border: 1px solid #d7dbe0;
  border-radius: var(--radius);
  padding: 13px 20px;
  font: inherit;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
}

.icon-btn {
  background: none;
  border: 0;
  padding: 4px;
  color: #94a3b8;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
}

.icon-btn:hover { color: #1f2937; background: #f1f5f9; }

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 52px;
}

th {
  text-align: left;
  font-size: 18px;
  font-weight: 600;
  color: #1e293b;
  padding: 14px 12px;
  white-space: nowrap;
}

.th-actions { width: 48px; }

td {
  padding: 26px 12px;
  border-top: 1px solid var(--line);
  font-size: 17px;
  vertical-align: middle;
}

tbody tr:last-child td { border-bottom: 1px solid var(--line); }

.pill {
  background: #eef1f5;
  color: #475569;
  font-size: 13px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 8px;
  margin-left: 8px;
}

.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

.secret-cell { display: flex; align-items: center; gap: 6px; }
.secret { letter-spacing: 1px; color: #334155; }
.secret.revealed { letter-spacing: 0; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 15px; }

.status { display: flex; align-items: center; gap: 10px; }

.switch { position: relative; display: inline-block; width: 46px; height: 26px; flex: none; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.track {
  position: absolute; inset: 0;
  background: #cbd5e1;
  border-radius: 999px;
  transition: background .18s ease;
}
.knob {
  position: absolute; top: 3px; left: 3px;
  width: 20px; height: 20px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 2px rgba(0,0,0,.2);
  transition: transform .18s ease;
}
.switch input:checked + .track { background: var(--green); }
.switch input:checked + .track .knob { transform: translateX(20px); }

.status-text { color: #334155; }

.actions { text-align: right; position: relative; }

.kebab-wrap { display: inline-block; position: relative; }

.menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, .14);
  padding: 6px;
  min-width: 170px;
  display: none;
  z-index: 30;
  text-align: left;
}

.kebab-wrap.open .menu { display: block; }

.menu button {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: 0;
  padding: 9px 12px;
  font: inherit;
  font-size: 15px;
  color: #334155;
  border-radius: 7px;
  cursor: pointer;
}

.menu button:hover { background: #f1f5f9; }
.menu button.danger { color: #b91c1c; }

.empty { margin-top: 40px; color: #64748b; font-size: 17px; }

.pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 22px 4px;
  color: var(--muted);
  font-size: 17px;
}

.page-btn {
  width: 34px; height: 34px;
  border: 0;
  background: none;
  color: #94a3b8;
  font-size: 20px;
  cursor: pointer;
  border-radius: 8px;
}
.page-btn:disabled { opacity: .5; cursor: default; }

.clients { margin-top: 56px; border-top: 1px solid var(--line); padding-top: 36px; }

.client-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.client {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
}

.client-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.client-name { font-weight: 600; font-size: 16px; }

.chip {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  padding: 3px 8px;
  border-radius: 6px;
}
.chip.supported { background: #e7f7ed; color: #147a3d; }
.chip.experimental { background: #fef3e2; color: #9a5b00; }
.chip.unsupported { background: #f1f3f5; color: #64748b; }

.client-meta { color: #64748b; font-size: 14px; margin-top: 8px; line-height: 1.5; }

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .35);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 50;
}

.modal {
  background: #fff;
  border-radius: 14px;
  padding: 28px;
  width: 100%;
  max-width: 460px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, .25);
}

.modal h2 { margin: 0 0 20px; }

.modal label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #334155;
  margin-bottom: 14px;
}

.modal input {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 12px 14px;
  border: 1px solid #d7dbe0;
  border-radius: 9px;
  font: inherit;
  font-size: 16px;
}

.modal input:focus { outline: 2px solid #c7d2fe; border-color: #93a5f5; }

.secret-input { position: relative; display: block; }
.secret-input .icon-btn { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); }

.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }

.form-error { color: #b91c1c; font-size: 14px; margin: 12px 0 0; }

.login-wrap { max-width: 420px; margin: 18vh auto; padding: 0 24px; }
.login-wrap h1 { font-size: 32px; display: block; }
.login-wrap p { color: var(--muted); }
.login-wrap input {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid #d7dbe0;
  border-radius: 10px;
  font: inherit;
  font-size: 16px;
  margin: 18px 0 14px;
}
.login-wrap .primary { width: 100%; justify-content: center; }

@media (max-width: 760px) {
  .wrap { padding: 28px 18px 48px; }
  h1 { font-size: 30px; }
  .lede { font-size: 16px; }
  .head-row { flex-direction: column; }
  table { display: block; overflow-x: auto; white-space: nowrap; }
}
