:root {
  color-scheme: light;
  --bg: #f4f7fb;
  --surface: #ffffff;
  --surface-strong: #0f172a;
  --text: #0f172a;
  --muted: #5b6475;
  --line: #d7deea;
  --brand: #1d4ed8;
  --brand-strong: #1e40af;
  --danger: #b91c1c;
  --danger-soft: #fef2f2;
  --success: #047857;
  --warning: #b45309;
  --shadow: 0 20px 45px rgba(15, 23, 42, 0.08);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

.hero {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 32px clamp(16px, 4vw, 40px);
  background: linear-gradient(135deg, #eff6ff, #f8fafc 60%, #e0f2fe);
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  margin: 0 0 8px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand);
}

.hero h1 {
  margin: 0;
  font-size: clamp(28px, 4vw, 40px);
}

.hero-copy {
  max-width: 68ch;
  color: var(--muted);
}

.hero-status {
  align-self: flex-start;
  padding: 12px 14px;
  border-radius: 999px;
  background: var(--surface);
  box-shadow: var(--shadow);
  font-size: 14px;
}

.layout {
  display: grid;
  gap: 20px;
  padding: 24px clamp(16px, 4vw, 40px) 40px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow);
  padding: 20px;
}

.card h2,
.card h3 {
  margin-top: 0;
}

.section-block + .section-block {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.muted {
  color: var(--muted);
}

.grid {
  display: grid;
  gap: 16px;
}

.grid.two {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.grid.three {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.grid.four {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

label,
.inline-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
}

input,
select,
textarea,
button {
  font: inherit;
}

input,
select,
textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--text);
}

textarea {
  resize: vertical;
  min-height: 120px;
}

.checkbox-row {
  flex-direction: row;
  align-items: center;
  gap: 10px;
  padding-top: 32px;
}

.checkbox-row input {
  width: auto;
}

.actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.actions.wrap {
  flex-wrap: wrap;
}

button {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 10px 14px;
  cursor: pointer;
  transition: 0.18s ease;
}

button:hover:enabled {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

button.primary {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

button.primary:hover:enabled {
  background: var(--brand-strong);
}

button.ghost {
  background: transparent;
}

.table-wrap {
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 14px;
}

.table th {
  color: var(--muted);
  font-weight: 700;
}

.table tr:hover td {
  background: #f8fbff;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: #eff6ff;
  color: var(--brand-strong);
}

.tag.success {
  background: #ecfdf5;
  color: var(--success);
}

.tag.warning {
  background: #fff7ed;
  color: var(--warning);
}

.tag.danger {
  background: var(--danger-soft);
  color: var(--danger);
}

.console {
  margin: 0;
  padding: 14px;
  background: #0f172a;
  color: #e2e8f0;
  border-radius: 14px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.console.small {
  font-size: 12px;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.form-actions.full-width {
  grid-column: 1 / -1;
}

.form-actions.align-end {
  justify-content: flex-end;
  align-self: end;
}

.hidden {
  display: none !important;
}

.toast {
  position: fixed;
  right: 16px;
  bottom: 16px;
  max-width: 420px;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--surface-strong);
  color: #fff;
  box-shadow: var(--shadow);
  z-index: 1000;
}

.toast.error {
  background: var(--danger);
}

.toast.success {
  background: var(--success);
}

@media (max-width: 900px) {
  .hero,
  .section-head {
    flex-direction: column;
  }

  .hero-status {
    align-self: stretch;
  }
}

