:root {
  --bg: #f5f7fa;
  --surface: #ffffff;
  --surface-muted: #eef2f6;
  --border: #d6dde6;
  --text: #17202a;
  --muted: #657385;
  --accent: #0f766e;
  --accent-soft: #d8f3ee;
  --error: #b42318;
  --error-soft: #fee4df;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 15px;
  line-height: 1.5;
}

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

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

.sidebar {
  background: #17202a;
  color: #f8fafc;
  padding: 24px 18px;
}

.brand {
  display: grid;
  gap: 2px;
  margin-bottom: 28px;
}

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

.brand__scope {
  color: #aeb8c5;
  font-size: 12px;
  text-transform: uppercase;
}

.nav {
  display: grid;
  gap: 4px;
}

.nav__item {
  border-radius: 6px;
  color: #d9e2ec;
  display: block;
  padding: 9px 10px;
}

.nav__item:hover,
.nav__item.is-active {
  background: #263445;
  color: #ffffff;
}

.content {
  padding: 32px;
}

.page-header {
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
  padding-bottom: 18px;
}

.page-header--split {
  align-items: center;
  display: flex;
  gap: 16px;
  justify-content: space-between;
}

.eyebrow {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  margin: 0 0 4px;
  text-transform: uppercase;
}

h1 {
  font-size: 28px;
  line-height: 1.2;
  margin: 0;
}

.status-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.metric-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-bottom: 18px;
}

.metric {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  display: grid;
  gap: 8px;
  min-height: 96px;
  padding: 14px;
}

.metric span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.metric strong {
  font-size: 30px;
  line-height: 1;
}

.detail-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 18px;
}

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

.data-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  display: grid;
  gap: 8px;
  min-height: 126px;
  padding: 16px;
}

.data-card:hover {
  border-color: var(--accent);
}

.data-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.data-card strong {
  font-size: 20px;
}

.data-card small {
  color: var(--muted);
}

.data-card--disabled {
  background: var(--surface-muted);
  color: var(--muted);
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 18px;
}

.panel--wide {
  grid-column: 1 / -1;
}

.detail-panel {
  margin-bottom: 18px;
}

.form-panel,
.table-panel {
  margin-bottom: 18px;
}

.panel__label {
  color: var(--muted);
  display: block;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 10px;
  text-transform: uppercase;
}

.status-pill {
  background: var(--surface-muted);
  border-radius: 999px;
  display: inline-block;
  margin-bottom: 10px;
  padding: 4px 10px;
}

.status-pill--ok {
  background: var(--accent-soft);
  color: var(--accent);
}

.status-pill--error {
  background: var(--error-soft);
  color: var(--error);
}

.notice {
  border-radius: 8px;
  margin-bottom: 16px;
  padding: 12px 14px;
}

.notice p {
  margin: 0;
}

.notice p + p {
  margin-top: 6px;
}

.notice--ok {
  background: var(--accent-soft);
  color: var(--accent);
}

.notice--error {
  background: var(--error-soft);
  color: var(--error);
}

.theme-form {
  display: grid;
  gap: 14px;
}

.theme-form label {
  display: grid;
  gap: 6px;
}

.theme-form label span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

input,
select,
textarea {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font: inherit;
  min-height: 40px;
  padding: 9px 10px;
  width: 100%;
}

textarea {
  resize: vertical;
}

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

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

.button {
  background: var(--accent);
  border: 0;
  border-radius: 6px;
  color: #ffffff;
  cursor: pointer;
  display: inline-block;
  font: inherit;
  font-weight: 700;
  min-height: 38px;
  padding: 8px 12px;
}

.button--secondary {
  background: var(--surface-muted);
  color: var(--text);
}

.button--danger {
  background: var(--error);
}

.button--small {
  font-size: 13px;
  min-height: 32px;
  padding: 6px 9px;
}

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

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

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

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

.text-link {
  color: var(--accent);
  overflow-wrap: anywhere;
}

.definition-list {
  display: grid;
  gap: 10px 16px;
  grid-template-columns: 180px minmax(0, 1fr);
  margin: 0;
}

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

.definition-list dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.image-preview {
  margin: 0;
}

.image-preview img {
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: 8px;
  display: block;
  max-height: 520px;
  max-width: 100%;
  object-fit: contain;
}

.image-preview figcaption {
  color: var(--muted);
  font-size: 13px;
  margin-top: 8px;
  overflow-wrap: anywhere;
}

code,
pre {
  background: var(--surface-muted);
  border-radius: 6px;
  display: block;
  margin: 0;
  overflow-wrap: anywhere;
  padding: 10px;
  white-space: pre-wrap;
}

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

  .sidebar,
  .content {
    padding: 18px;
  }

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

  .metric-grid,
  .detail-grid,
  .data-card-grid,
  .definition-list {
    grid-template-columns: 1fr;
  }

  .page-header--split,
  .form-actions,
  .actions {
    align-items: stretch;
    flex-direction: column;
  }

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