:root {
  color-scheme: light;
  --bg: #f6f5f1;
  --panel: #ffffff;
  --ink: #20231f;
  --muted: #626960;
  --line: #d9ded5;
  --accent: #2e6f4f;
  --accent-strong: #21543b;
  --warn: #9b4d12;
  --danger: #a53328;
  --ok: #2f7047;
  --soft: #edf3ec;
  --shadow: 0 10px 28px rgba(32, 35, 31, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.45 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  border: 1px solid var(--accent);
  border-radius: 7px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  font-weight: 650;
  padding: 9px 14px;
}

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

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

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

button.secondary:hover:not(:disabled) {
  background: var(--soft);
}

input,
select {
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink);
  min-height: 38px;
  padding: 8px 10px;
  width: 100%;
}

input[type="checkbox"] {
  min-height: auto;
  width: auto;
}

.app-header {
  align-items: center;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 18px;
  justify-content: space-between;
  padding: 22px clamp(18px, 4vw, 42px);
  position: sticky;
  top: 0;
  z-index: 5;
}

.eyebrow {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  margin: 0 0 2px;
  text-transform: uppercase;
}

h1 {
  font-size: clamp(24px, 3vw, 34px);
  letter-spacing: 0;
  line-height: 1.1;
  margin: 0;
}

.header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.layout {
  display: grid;
  gap: 16px;
  margin: 0 auto;
  max-width: 1500px;
  padding: 18px clamp(14px, 3vw, 34px) 34px;
}

.panel,
.summary-grid,
.toolbar,
.action-row,
.table-wrap {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.setup-panel {
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  padding: 16px;
}

.panel-block {
  display: grid;
  gap: 8px;
}

.field-label,
.toolbar label {
  color: var(--muted);
  display: grid;
  font-size: 12px;
  font-weight: 700;
  gap: 6px;
  text-transform: uppercase;
}

.status-text,
.guard-text {
  color: var(--muted);
  margin: 0;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.summary-item {
  border-right: 1px solid var(--line);
  padding: 14px 16px;
}

.summary-item:last-child {
  border-right: 0;
}

.summary-label {
  color: var(--muted);
  display: block;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.summary-item strong {
  display: block;
  font-size: 25px;
  line-height: 1.2;
  margin-top: 4px;
}

.toolbar {
  align-items: end;
  display: grid;
  gap: 12px;
  grid-template-columns: 180px 220px minmax(220px, 1fr) auto auto;
  padding: 14px;
}

.check-label {
  align-items: center;
  display: flex !important;
  flex-direction: row;
  gap: 8px !important;
  height: 38px;
  justify-content: center;
  text-transform: none !important;
  white-space: nowrap;
}

.action-row {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 14px;
}

.table-wrap {
  overflow: auto;
}

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

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

th {
  background: #fafbf8;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  position: sticky;
  text-transform: uppercase;
  top: 81px;
  z-index: 2;
}

tbody tr:hover {
  background: #fbfcfa;
}

.select-col {
  text-align: center;
  width: 42px;
}

.number {
  text-align: right;
}

.pill {
  border-radius: 999px;
  display: inline-flex;
  font-size: 12px;
  font-weight: 750;
  padding: 3px 8px;
  white-space: nowrap;
}

.pill.ok {
  background: #e8f3eb;
  color: var(--ok);
}

.pill.warn {
  background: #fff1df;
  color: var(--warn);
}

.pill.danger {
  background: #fbe7e3;
  color: var(--danger);
}

.muted {
  color: var(--muted);
}

.empty-state {
  color: var(--muted);
  padding: 28px;
  text-align: center;
}

.bad-account {
  color: var(--danger);
  font-weight: 650;
}

@media (max-width: 900px) {
  .app-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .header-actions {
    justify-content: flex-start;
  }

  .setup-panel,
  .summary-grid,
  .toolbar {
    grid-template-columns: 1fr;
  }

  .summary-item {
    border-bottom: 1px solid var(--line);
    border-right: 0;
  }

  .summary-item:last-child {
    border-bottom: 0;
  }

  th {
    top: 142px;
  }
}
