:root {
  --bg: #f6f7f9;
  --panel: #ffffff;
  --text: #1f2933;
  --muted: #667085;
  --line: #d8dee6;
  --accent: #0f766e;
  --accent-dark: #115e59;
  --danger: #b42318;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 14px;
  line-height: 1.45;
}

a {
  color: var(--accent-dark);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 220px;
  background: #111827;
  color: #fff;
  padding: 18px 14px;
}

.brand {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 22px;
}

.sidebar nav {
  display: grid;
  gap: 4px;
}

.sidebar a,
.link-button {
  display: block;
  width: 100%;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #e5e7eb;
  cursor: pointer;
  font: inherit;
  padding: 9px 10px;
  text-align: left;
}

.sidebar a:hover,
.link-button:hover {
  background: #1f2937;
  text-decoration: none;
}

.sidebar form {
  position: absolute;
  right: 14px;
  bottom: 16px;
  left: 14px;
}

.content {
  margin-left: 220px;
  padding: 28px;
}

.login-content {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
}

.login-panel,
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
}

.login-panel {
  width: min(380px, 100%);
}

.page-header {
  align-items: center;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

h1,
h2 {
  margin: 0;
}

h1 {
  font-size: 24px;
}

h2 {
  font-size: 16px;
  margin-bottom: 14px;
}

.metric-grid,
.detail-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-bottom: 14px;
}

.detail-grid {
  grid-template-columns: minmax(280px, 0.8fr) minmax(360px, 1.2fr);
}

.section-head {
  align-items: center;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.inline-actions,
.inline-form {
  align-items: center;
  display: flex;
  gap: 8px;
}

.inline-form {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.inline-form input,
.inline-form select {
  width: 180px;
}

.metric {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

.metric span,
.muted {
  color: var(--muted);
}

.metric strong {
  display: block;
  font-size: 30px;
  margin-top: 8px;
}

table {
  border-collapse: collapse;
  width: 100%;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 10px 8px;
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

tr:last-child td {
  border-bottom: 0;
}

.status {
  background: #e6f4f1;
  border: 1px solid #b7ded7;
  border-radius: 999px;
  color: #0f5f58;
  display: inline-block;
  font-size: 12px;
  padding: 2px 8px;
}

.button,
button {
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 6px;
  color: #fff;
  cursor: pointer;
  display: inline-block;
  font: inherit;
  font-weight: 700;
  padding: 8px 12px;
}

.button:hover,
button:hover {
  background: var(--accent-dark);
  text-decoration: none;
}

.secondary {
  background: #fff;
  border-color: var(--line);
  color: var(--text);
}

.secondary:hover {
  background: #eef2f6;
}

.filters {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}

.form-stack,
.wizard {
  display: grid;
  gap: 14px;
}

.form-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

label {
  color: var(--muted);
  display: grid;
  gap: 6px;
  font-weight: 700;
}

input,
select,
textarea {
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  font: inherit;
  padding: 9px 10px;
  width: 100%;
}

textarea {
  resize: vertical;
}

.form-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.error {
  background: #fef3f2;
  border: 1px solid #fecdca;
  border-radius: 6px;
  color: var(--danger);
  padding: 10px 12px;
}

.truncate {
  display: inline-block;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: bottom;
  white-space: nowrap;
}

.metadata {
  color: var(--muted);
  display: block;
  max-width: 420px;
  overflow-wrap: anywhere;
  white-space: normal;
}

.small {
  font-size: 12px;
}

dl {
  display: grid;
  gap: 8px 14px;
  grid-template-columns: 120px 1fr;
  margin: 0;
}

dt {
  color: var(--muted);
  font-weight: 700;
}

dd {
  margin: 0;
}

@media (max-width: 860px) {
  .sidebar {
    position: static;
    width: auto;
  }

  .sidebar form {
    position: static;
    margin-top: 14px;
  }

  .content {
    margin-left: 0;
    padding: 18px;
  }

  .metric-grid,
  .detail-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .page-header,
  .filters,
  .section-head,
  .inline-form {
    align-items: stretch;
    flex-direction: column;
  }

  .inline-form input,
  .inline-form select {
    width: 100%;
  }
}
