:root {
  --bg: #121510;
  --panel: #f6f0df;
  --panel-strong: #fff9e8;
  --ink: #151711;
  --muted: #6f6a5c;
  --accent: #c65f26;
  --accent-dark: #7c3519;
  --line: rgba(21, 23, 17, 0.14);
  --good: #28844d;
  --bad: #b33c2f;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.22);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  background:
    radial-gradient(circle at top left, rgba(198, 95, 38, 0.12), transparent 22rem),
    linear-gradient(145deg, #171a14 0%, #2a2e24 68%, #3d3326 100%);
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
  border-radius: 999px;
  padding: 0.72rem 1.1rem;
  color: #fff9e8;
  background: var(--accent-dark);
  cursor: pointer;
}

button:hover {
  background: var(--accent);
}

.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 20px 0 26px;
}

.topbar {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: center;
  color: var(--panel-strong);
  margin-bottom: 14px;
}

.eyebrow {
  margin: 0 0 8px;
  color: #e8ad82;
  font-size: 0.76rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0;
  font-size: clamp(1.45rem, 3vw, 2.2rem);
  line-height: 1;
  letter-spacing: -0.035em;
}

h2 {
  margin-bottom: 6px;
  font-size: 1.35rem;
}

h3 {
  margin-bottom: 8px;
  font-size: 1.05rem;
}

.status-card,
.metrics article,
.panel,
.toolbar {
  border: 1px solid rgba(255, 249, 232, 0.26);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.status-card {
  display: flex;
  gap: 14px;
  align-items: center;
  min-width: 190px;
  padding: 13px 15px;
  color: var(--panel-strong);
  background: rgba(255, 249, 232, 0.12);
  backdrop-filter: blur(16px);
}

.status-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #b4a994;
}

.status-dot.ok {
  background: var(--good);
}

.status-dot.fail {
  background: var(--bad);
}

.label {
  margin: 0;
  color: rgba(255, 249, 232, 0.68);
  font-size: 0.85rem;
}

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

.metrics article {
  padding: 14px 16px;
  background: var(--panel);
}

.metrics span {
  display: block;
  color: var(--muted);
  font-size: 0.85rem;
}

.metrics strong {
  display: block;
  margin-top: 8px;
  font-size: 1.12rem;
}

.toolbar {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  margin-bottom: 14px;
  padding: 12px;
  background: rgba(246, 240, 223, 0.94);
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tab {
  color: var(--ink);
  background: var(--panel-strong);
  border: 1px solid var(--line);
}

.tab.active {
  color: #fff9e8;
  background: var(--accent-dark);
}

.auto-update {
  display: flex;
  gap: 12px;
  align-items: center;
}

.auto-update label:not(.check) {
  min-width: 130px;
}

.auto-update input[type="number"] {
  width: 95px;
}

.panel {
  margin-bottom: 18px;
  padding: 18px;
  background: var(--panel);
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

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

.panel-header p {
  margin-bottom: 0;
  color: var(--muted);
}

.compact {
  align-items: start;
}

.filters {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 10px;
}

.filters .wide {
  grid-column: span 2;
}

label {
  color: var(--muted);
  font-size: 0.82rem;
}

input,
select {
  width: 100%;
  margin-top: 7px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.78rem 0.9rem;
  color: var(--ink);
  background: var(--panel-strong);
}

select[multiple] {
  min-height: 132px;
  padding: 0.5rem;
}

select[multiple] option {
  padding: 0.34rem 0.45rem;
}

.field-note {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.76rem;
}

.hint {
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 0.9rem;
}

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

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

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

th {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.copy-name {
  display: inline;
  border: 0;
  border-radius: 0;
  padding: 0;
  color: var(--ink);
  background: transparent;
  text-align: left;
  text-decoration: underline;
  text-decoration-color: rgba(124, 53, 25, 0.35);
  text-underline-offset: 3px;
}

.copy-name:hover {
  color: var(--accent-dark);
  background: transparent;
}

.result-title {
  display: block;
  margin-bottom: 5px;
  font-weight: 700;
}

.profit {
  color: var(--good);
  font-weight: 700;
}

.roi {
  color: var(--accent-dark);
  font-weight: 700;
}

.search-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  margin-bottom: 10px;
}

.result-list {
  display: grid;
  gap: 10px;
  max-height: 440px;
  overflow: auto;
}

.result-item {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px;
  background: var(--panel-strong);
}

.result-item strong {
  display: block;
  margin-bottom: 5px;
}

.result-item span,
.muted {
  color: var(--muted);
}

.check {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
}

.check input {
  width: auto;
  margin: 0;
}

.docs-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.docs-grid article {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  background: var(--panel-strong);
}

.docs-grid p,
.docs-grid li {
  color: var(--muted);
  line-height: 1.5;
}

code {
  border-radius: 8px;
  padding: 0.12rem 0.32rem;
  color: var(--accent-dark);
  background: rgba(198, 95, 38, 0.12);
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  transform: translateY(16px);
  opacity: 0;
  pointer-events: none;
  border-radius: 16px;
  padding: 12px 14px;
  color: var(--panel-strong);
  background: rgba(21, 23, 17, 0.92);
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.visible {
  transform: translateY(0);
  opacity: 1;
}

.footer {
  margin-top: 18px;
  color: rgba(255, 249, 232, 0.58);
  font-size: 0.86rem;
  line-height: 1.45;
  text-align: center;
}

@media (max-width: 900px) {
  .topbar,
  .metrics,
  .filters,
  .docs-grid {
    grid-template-columns: 1fr;
  }

  .filters .wide {
    grid-column: span 1;
  }

  .toolbar,
  .panel-header,
  .auto-update {
    align-items: start;
    flex-direction: column;
  }

  .search-row {
    grid-template-columns: 1fr;
  }
}
