:root {
  --bg: #f5f7fb;
  --panel: #ffffff;
  --line: #d8e0ea;
  --text: #142033;
  --muted: #697386;
  --brand: #17324d;
  --brand-2: #205b7a;
  --ok: #087f5b;
  --warn: #b7791f;
  --danger: #b42318;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
}

a { color: var(--brand-2); text-decoration: none; }

button, input, select, textarea {
  font: inherit;
}

.app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 240px 1fr;
}

.sidebar {
  background: var(--brand);
  color: #fff;
  padding: 24px 18px;
}

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

.brand span {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: #fff;
  color: var(--brand);
  font-weight: 800;
}

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

.sidebar a,
.sidebar button {
  width: 100%;
  display: block;
  padding: 11px 12px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #eef6ff;
  text-align: left;
}

.sidebar a:hover,
.sidebar button:hover {
  background: rgba(255,255,255,.12);
}

.main {
  padding: 28px;
}

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

h1 {
  margin: 0 0 6px;
  font-size: 26px;
}

h2 {
  margin-top: 0;
  font-size: 18px;
}

p {
  color: var(--muted);
  margin: 0;
}

.button,
button,
.primary {
  border: 0;
  border-radius: 6px;
  padding: 10px 14px;
  background: var(--brand);
  color: #fff;
  cursor: pointer;
}

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

.metrics div,
.panel,
.table {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(20, 32, 51, .06);
}

.metrics div {
  padding: 16px;
}

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

.metrics span,
small {
  display: block;
  color: var(--muted);
  margin-top: 4px;
}

.filters {
  display: grid;
  grid-template-columns: 1fr 180px auto;
  gap: 10px;
  margin-bottom: 16px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 11px;
  background: #fff;
}

textarea {
  min-height: 110px;
  resize: vertical;
}

.table {
  overflow: hidden;
}

.row {
  display: grid;
  grid-template-columns: 1.4fr 1.2fr 1fr 150px 70px;
  gap: 12px;
  align-items: center;
  padding: 13px 16px;
  border-top: 1px solid var(--line);
}

.row:first-child {
  border-top: 0;
}

.head {
  background: #edf2f7;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

mark {
  display: inline-block;
  background: #e7f6ef;
  color: var(--ok);
  border-radius: 999px;
  padding: 5px 9px;
}

.grid2 {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  gap: 18px;
}

.panel {
  padding: 18px;
}

.form {
  display: grid;
  gap: 13px;
}

.form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-weight: 700;
}

.inline {
  grid-template-columns: 1fr 1fr 1fr 150px auto;
  align-items: end;
  margin-bottom: 16px;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: linear-gradient(135deg, #17324d, #205b7a);
}

.login-card {
  width: min(430px, 100%);
  background: #fff;
  border-radius: 8px;
  padding: 28px;
  box-shadow: 0 24px 60px rgba(0,0,0,.22);
}

pre {
  max-height: 360px;
  overflow: auto;
  white-space: pre-wrap;
  background: #f7fafc;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px;
  color: #26364d;
}

.config {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 12px 18px;
}

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

@media (max-width: 900px) {
  .app {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: static;
  }
  .metrics,
  .filters,
  .grid2,
  .inline,
  .row {
    grid-template-columns: 1fr;
  }
}
