:root {
  color-scheme: light;
  --bg: #f5f7fa;
  --panel: #ffffff;
  --text: #16202a;
  --muted: #657384;
  --line: #dfe7ef;
  --blue: #246bfe;
  --green: #12805c;
  --red: #b42318;
  --amber: #a15c00;
  --shadow: 0 10px 24px rgba(18, 33, 54, 0.08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
  background: var(--bg);
  color: var(--text);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
  border-radius: 6px;
  background: var(--blue);
  color: #fff;
  min-height: 38px;
  padding: 0 14px;
  font-size: 14px;
  font-weight: 750;
  cursor: pointer;
}

button.secondary {
  background: #eef4ff;
  color: #1d54c7;
}

button.danger {
  background: var(--red);
}

.sidebar {
  min-height: 100vh;
  background: #ffffff;
  border-right: 1px solid var(--line);
  padding: 18px;
  position: sticky;
  top: 0;
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-bottom: 22px;
}

.brand strong {
  font-size: 22px;
}

.brand span,
.muted,
.panel-heading p,
.metric p,
.topbar p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
  margin: 0;
}

nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

nav a {
  color: #2c3a47;
  text-decoration: none;
  padding: 10px 11px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 700;
}

nav a.active,
nav a:hover {
  background: #eef4ff;
  color: #1d54c7;
}

.shell {
  min-width: 0;
}

.topbar {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 24px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.topbar h1 {
  margin: 0 0 4px;
  font-size: 24px;
  line-height: 1.1;
  letter-spacing: 0;
}

.topbar-actions,
.actions-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border-radius: 999px;
  background: #fff5e6;
  color: var(--amber);
  border: 1px solid #f2cf98;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 800;
}

.content {
  padding: 20px;
}

.grid {
  display: grid;
  gap: 18px;
  align-items: start;
}

.grid.two {
  grid-template-columns: minmax(360px, 0.95fr) minmax(420px, 1.05fr);
}

.grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: var(--shadow);
  padding: 18px;
  min-width: 0;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.panel-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

h2,
h3 {
  margin: 0;
  letter-spacing: 0;
}

h2 {
  font-size: 18px;
}

h3 {
  font-size: 14px;
}

.metric span,
.summary-grid span,
.settings-grid span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 5px;
}

.metric strong {
  display: block;
  font-size: 22px;
  margin-bottom: 4px;
  overflow-wrap: anywhere;
}

.summary-grid,
.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.summary-grid div,
.settings-grid div {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfe;
  padding: 10px;
  min-width: 0;
}

.summary-grid strong,
.settings-grid strong {
  display: block;
  font-size: 14px;
  overflow-wrap: anywhere;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: #2d3a46;
  font-size: 13px;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  padding: 10px 11px;
  outline: none;
  font-size: 14px;
  line-height: 1.35;
}

textarea {
  resize: vertical;
  min-height: 148px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(36, 107, 254, 0.12);
}

.check-row {
  flex-direction: row;
  align-items: center;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 10px;
}

.check-row input {
  width: auto;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th,
td {
  padding: 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: #4b5b68;
  background: #f3f6f9;
  font-size: 12px;
  text-transform: uppercase;
}

tr:last-child td {
  border-bottom: 0;
}

.ok {
  color: var(--green);
}

.warn {
  color: var(--amber);
}

.bad {
  color: var(--red);
}

.note,
.empty {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfe;
  padding: 12px;
  color: #314252;
  font-size: 14px;
}

pre {
  min-height: 180px;
  max-height: 360px;
  overflow: auto;
  margin: 0;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: #101820;
  color: #d6e4ef;
  padding: 14px;
  font-size: 12px;
  line-height: 1.5;
}

.result-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.result-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto auto auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfe;
  padding: 10px;
  font-size: 13px;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  background: #122133;
  color: #fff;
  border-radius: 6px;
  padding: 12px 14px;
  box-shadow: var(--shadow);
  z-index: 10;
}

@media (max-width: 1180px) {
  body {
    grid-template-columns: 1fr;
  }

  .sidebar {
    min-height: auto;
    position: static;
  }

  nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .grid.two,
  .grid.three {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .content {
    padding: 12px;
  }

  nav,
  .form-grid,
  .summary-grid,
  .settings-grid {
    grid-template-columns: 1fr;
  }

  .result-row {
    grid-template-columns: 1fr;
  }
}
