:root {
  color-scheme: light;
  --bg: #f4f1e8;
  --bg-accent: #e8dcc5;
  --panel: rgba(255, 252, 245, 0.94);
  --border: rgba(72, 58, 43, 0.14);
  --text: #2f261d;
  --muted: #746559;
  --primary: #235347;
  --primary-strong: #17382f;
  --danger: #8d2f2f;
  --success: #24633c;
  --shadow: 0 18px 50px rgba(53, 41, 31, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.72), transparent 30%),
    linear-gradient(160deg, var(--bg) 0%, var(--bg-accent) 100%);
}

a {
  color: inherit;
  text-decoration: none;
}

code {
  padding: 0.1rem 0.35rem;
  border-radius: 999px;
  background: rgba(35, 83, 71, 0.08);
}

.shell {
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1rem 0 2rem;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 0;
}

.brand {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.container {
  display: grid;
  gap: 1rem;
}

.panel {
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.hero {
  padding: 2rem;
}

.eyebrow {
  margin: 0 0 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.76rem;
  color: var(--muted);
}

h1,
h2 {
  margin: 0 0 0.75rem;
}

.lead,
.muted,
.help {
  color: var(--muted);
}

.grid {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 1rem;
}

.zone-list,
.stack,
.form-actions,
.user-card,
.actions,
.section-header {
  display: flex;
  gap: 0.75rem;
}

.zone-list,
.stack {
  flex-direction: column;
}

.zone-link {
  padding: 0.8rem 0.95rem;
  border-radius: 16px;
  border: 1px solid transparent;
  background: rgba(35, 83, 71, 0.06);
  transition: transform 120ms ease, background 120ms ease, border-color 120ms ease;
}

.zone-link:hover,
.zone-link.active {
  transform: translateY(-1px);
  border-color: rgba(35, 83, 71, 0.18);
  background: rgba(35, 83, 71, 0.12);
}

label {
  display: grid;
  gap: 0.35rem;
  font-weight: 600;
}

input,
select,
button {
  font: inherit;
}

input,
select {
  width: 100%;
  padding: 0.8rem 0.9rem;
  border: 1px solid rgba(72, 58, 43, 0.18);
  border-radius: 14px;
  background: white;
  color: var(--text);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 700;
}

.button.primary {
  color: white;
  background: var(--primary);
}

.button.primary:hover {
  background: var(--primary-strong);
}

.button.ghost {
  background: rgba(35, 83, 71, 0.08);
  color: var(--text);
}

.button.danger {
  color: white;
  background: var(--danger);
}

.button.small {
  padding: 0.55rem 0.8rem;
  font-size: 0.92rem;
}

.flash {
  padding: 0.9rem 1rem;
  border-radius: 16px;
  border: 1px solid transparent;
  font-weight: 600;
}

.flash.info {
  background: rgba(35, 83, 71, 0.08);
}

.flash.success {
  color: var(--success);
  border-color: rgba(36, 99, 60, 0.18);
  background: rgba(36, 99, 60, 0.08);
}

.flash.error {
  color: var(--danger);
  border-color: rgba(141, 47, 47, 0.18);
  background: rgba(141, 47, 47, 0.08);
}

.user-card {
  align-items: center;
  padding: 0.45rem 0.55rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.64);
  border: 1px solid var(--border);
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}

.avatar-fallback {
  display: grid;
  place-items: center;
  font-weight: 800;
  background: rgba(35, 83, 71, 0.16);
}

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

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 0.9rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid rgba(72, 58, 43, 0.12);
  vertical-align: top;
}

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

.target {
  min-width: 240px;
  word-break: break-word;
}

.actions {
  align-items: center;
  flex-wrap: wrap;
}

.actions form {
  margin: 0;
}

.empty,
.empty-block {
  color: var(--muted);
  padding: 1rem 0;
}

@media (max-width: 920px) {
  .grid {
    grid-template-columns: 1fr;
  }

  .topbar,
  .user-card,
  .section-header {
    flex-direction: column;
    align-items: flex-start;
  }
}
