:root {
  color-scheme: light;
  --bg: #f4f6f3;
  --panel: #ffffff;
  --ink: #17201d;
  --muted: #68736e;
  --line: #d9e0dc;
  --cyan: #00a8c8;
  --lime: #8ac926;
  --coral: #e85d4f;
  --graphite: #26312d;
  --shadow: 0 18px 45px rgba(28, 38, 34, .10);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 22px;
  background: var(--graphite);
  color: #f9fbf9;
}

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

.brand.compact {
  margin-bottom: 8px;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--cyan), var(--lime));
  color: #08110f;
  font-weight: 900;
}

.brand strong {
  display: block;
  font-size: 15px;
}

.brand small {
  display: block;
  color: rgba(249, 251, 249, .72);
  margin-top: 2px;
}

.sidebar nav {
  display: grid;
  gap: 8px;
}

.nav,
.ghost {
  min-height: 42px;
  border-radius: 8px;
  padding: 0 12px;
  text-align: left;
  color: rgba(249, 251, 249, .82);
  background: transparent;
}

.nav.active,
.nav:hover,
.ghost:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, .10);
}

.ghost {
  margin-top: auto;
}

.content {
  position: relative;
  padding: 28px;
  overflow: hidden;
}

.topbar {
  min-height: 72px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 18px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 28px;
}

h2 {
  font-size: 16px;
}

.topbar p {
  margin-top: 4px;
  color: var(--muted);
}

.icon-btn,
button[type="submit"],
.secret-box button {
  min-height: 42px;
  border-radius: 8px;
  padding: 0 16px;
  background: var(--ink);
  color: #ffffff;
  font-weight: 700;
}

.icon-btn {
  background: #ffffff;
  color: var(--ink);
  border: 1px solid var(--line);
}

.hidden {
  display: none !important;
}

.login-panel {
  min-height: calc(100vh - 140px);
  display: grid;
  place-items: center;
}

.login-box,
.panel,
.secret-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.login-box {
  width: min(420px, 100%);
  display: grid;
  gap: 18px;
  padding: 24px;
}

.login-box .brand small {
  color: var(--muted);
}

.views {
  display: grid;
  gap: 18px;
}

.view {
  display: grid;
  gap: 18px;
}

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

.metrics article {
  min-height: 96px;
  padding: 18px;
  border-radius: 8px;
  background: #ffffff;
  border: 1px solid var(--line);
}

.metrics span,
label,
legend,
.secret-box span {
  color: var(--muted);
  font-size: 13px;
}

.metrics strong {
  display: block;
  margin-top: 10px;
  font-size: 28px;
}

.panel {
  padding: 18px;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  align-items: end;
}

label {
  display: grid;
  gap: 7px;
}

input,
select {
  width: 100%;
  min-height: 42px;
  border-radius: 8px;
  border: 1px solid var(--line);
  padding: 0 12px;
  background: #fbfcfb;
  color: var(--ink);
}

fieldset {
  min-width: 0;
  min-height: 42px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 12px;
}

legend {
  padding: 0 6px;
}

.check {
  display: flex;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 7px;
  color: var(--ink);
}

.check input {
  width: 16px;
  min-height: 16px;
}

.table-wrap {
  overflow: auto;
}

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

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

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: #eef8ea;
  color: #315800;
  font-size: 12px;
  font-weight: 700;
  margin-right: 5px;
}

.service-list,
.key-list,
.instance-list {
  display: grid;
  gap: 10px;
}

.service,
.key-item,
.instance {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.actions {
  display: flex;
  gap: 6px;
  min-width: 210px;
}

.actions button {
  min-height: 32px;
  border-radius: 8px;
  padding: 0 9px;
  background: #eef4f1;
  color: var(--ink);
  font-weight: 700;
}

.status-ok {
  color: #276500;
  font-weight: 800;
}

.status-bad {
  color: var(--coral);
  font-weight: 800;
}

.secret-box {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
}

code {
  display: block;
  overflow: auto;
  padding: 10px;
  border-radius: 8px;
  background: #111916;
  color: #d7ff78;
  white-space: nowrap;
}

.endpoints {
  display: grid;
  gap: 12px;
}

.endpoints article {
  display: grid;
  gap: 8px;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  max-width: min(420px, calc(100vw - 44px));
  padding: 13px 15px;
  border-radius: 8px;
  color: #ffffff;
  background: var(--graphite);
  box-shadow: var(--shadow);
}

@media (max-width: 980px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 2;
    flex-direction: row;
    align-items: center;
    overflow-x: auto;
  }

  .sidebar nav {
    display: flex;
  }

  .ghost {
    margin-top: 0;
  }

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

@media (max-width: 640px) {
  .content {
    padding: 18px;
  }

  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .metrics,
  .form-grid,
  .secret-box {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 24px;
  }
}
