﻿:root {
  color-scheme: dark;
  font-family: system-ui, sans-serif;
  background: #111715;
  color: #e8eeeb;
  font-size: 16px;
}
* { box-sizing: border-box; }
body { margin: 0; display: flex; min-height: 100vh; }
aside {
  width: 240px;
  background: #19211e;
  border-right: 1px solid #344139;
  padding: 36px 24px;
  position: fixed;
  inset: 0 auto 0 0;
  overflow-y: auto;
}
strong { font-size: 32px; color: #c5f20d; }
strong span { font-size: 16px; margin-left: 14px; color: #fff; letter-spacing: 2px; }
aside p, small { color: #9caf9f; }
nav { margin: 20px 0; display: grid; gap: 4px; }
button, input, textarea, select {
  font: inherit;
  border-radius: 8px;
  border: 1px solid #45564b;
  padding: 11px 14px;
  background: #202d26;
  color: inherit;
}
button { cursor: pointer; }
button:hover, nav button.active { border-color: #c5f20d; color: #c5f20d; }
button:disabled { opacity: 0.5; cursor: wait; }
nav button { text-align: left; padding: 8px 12px; }
main { margin-left: 240px; padding: 44px; min-width: 0; width: calc(100% - 240px); }
header { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
h1 { font-size: 32px; margin: 10px 0 24px; }
#status { min-height: 24px; color: #c5f20d; }
#login { max-width: 420px; background: #19211e; padding: 28px; border-radius: 12px; }
label { display: grid; gap: 8px; margin: 0 0 18px; }
.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(160px, 100%), 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.metric { background: #202d26; border: 1px solid #344139; border-radius: 12px; padding: 20px; min-width: 0; }
.metric b { display: block; font-size: 32px; color: #c5f20d; margin-top: 12px; overflow-wrap: anywhere; }
.tools { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; margin-bottom: 20px; }
.tools label { margin: 0; }
#search { flex: 1; min-width: 120px; }
#tableWrap { display: block; }
.table { overflow: auto; border: 1px solid #344139; border-radius: 10px; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
td, th {
  padding: 10px;
  text-align: left;
  border-bottom: 1px solid #344139;
  max-width: 420px;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}
th { color: #9caf9f; background: #19211e; }
td button { padding: 7px; margin: 3px; }
dialog {
  background: #19211e;
  color: inherit;
  border: 1px solid #45564b;
  border-radius: 16px;
  width: min(560px, 95vw);
  max-height: 90vh;
  overflow-x: hidden;
}
dialog::backdrop { background: #000a; }
pre { white-space: pre-wrap; overflow-wrap: anywhere; }
textarea { min-height: 80px; }
[hidden] { display: none !important; }
body.collapsed aside { display: none; }
body.collapsed main { margin: 0; width: 100%; }
.light { color-scheme: light; background: #edf3ef; color: #182d20; }
.light :is(aside, dialog, th, #login, .metric) { background: #f7fbf8; color: #173722; }
.light :is(button, input, textarea, select) { background: white; border-color: #8ca995; color: #163e27; }
.light :is(strong, strong span, small, nav button.active, .metric b, #status) { color: #156d40; }
@media (max-width: 850px) {
  aside { width: 100%; position: static; padding: 20px; }
  nav { margin: 12px 0; display: flex; flex-wrap: nowrap; overflow-x: auto; padding-bottom: 6px; }
  nav button { flex: 0 0 auto; white-space: nowrap; }
  body { display: block; }
  main { margin: 0; padding: 18px; width: 100%; }
  .tools { flex-wrap: wrap; }
  input, select, textarea { max-width: 100%; min-width: 0; }
  dialog { max-width: calc(100vw - 20px); padding: 16px; }
}
@media (max-width: 480px) {
  main, #workspace { min-width: 0; max-width: 100%; }
  header .toolbar { display: flex; flex-wrap: wrap; min-width: 0; max-width: 100%; }
  .metric { padding: 16px; }
  .metric b { font-size: clamp(22px, 6vw, 32px); }
}
