:root {
  --bg: #f4f5f2;
  --surface: #ffffff;
  --line: #d9ded6;
  --text: #1f2722;
  --muted: #667166;
  --accent: #246b5a;
  --accent-2: #315f9a;
  --warn: #8a650d;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, sans-serif;
  font-size: 14px;
}

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

aside {
  background: #202823;
  color: #f7faf7;
  padding: 20px 16px;
}

.brand {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 22px;
}

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

.nav button {
  width: 100%;
  border: 0;
  background: transparent;
  color: #dce5df;
  text-align: left;
  padding: 10px 12px;
  border-radius: 6px;
  cursor: pointer;
}

.nav button.active {
  background: #334039;
  color: #fff;
}

main {
  padding: 24px;
  min-width: 0;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

h1, h2, p {
  margin-top: 0;
}

h1 {
  font-size: 24px;
  margin-bottom: 4px;
}

h2 {
  font-size: 18px;
  margin-bottom: 14px;
}

.muted, header p, .panel-title span {
  color: var(--muted);
}

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

.metric, .panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.metric {
  padding: 16px;
}

.metric strong {
  display: block;
  font-size: 26px;
  margin-bottom: 4px;
}

.panel {
  padding: 16px;
  margin-bottom: 18px;
  overflow: hidden;
}

.panel-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: end;
}

label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
}

input, select {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  background: #fff;
  color: var(--text);
  min-width: 150px;
}

button {
  min-height: 36px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  padding: 8px 12px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  white-space: nowrap;
}

button.secondary {
  background: #fff;
  color: var(--accent);
}

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

table {
  width: 100%;
  border-collapse: collapse;
}

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

th {
  color: var(--muted);
  font-weight: 600;
  font-size: 12px;
}

.badge {
  display: inline-block;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 12px;
  background: #e8f0ed;
  color: var(--accent);
}

.badge.warn {
  background: #fff4cc;
  color: var(--warn);
}

.tab { display: none; }
.tab.active { display: block; }

pre {
  margin: 0;
  min-height: 220px;
  max-height: 520px;
  overflow: auto;
  background: #17201b;
  color: #eef5ef;
  border-radius: 6px;
  padding: 14px;
  white-space: pre-wrap;
}

.notice {
  padding: 10px 12px;
  border-left: 3px solid var(--accent-2);
  background: #eef3fa;
  margin-bottom: 14px;
}

@media (max-width: 820px) {
  .app { grid-template-columns: 1fr; }
  .grid { grid-template-columns: 1fr 1fr; }
  header { align-items: flex-start; flex-direction: column; }
}

