:root {
  --bg: #f4efe6;
  --panel: rgba(255, 252, 247, 0.88);
  --ink: #1d2b23;
  --muted: #607267;
  --line: rgba(29, 43, 35, 0.12);
  --accent: #1f7a5b;
  --accent-strong: #0f5d44;
  --danger: #a64040;
  --shadow: 0 24px 80px rgba(27, 39, 31, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(236, 190, 116, 0.3), transparent 28%),
    radial-gradient(circle at bottom right, rgba(31, 122, 91, 0.16), transparent 25%),
    var(--bg);
  font-family: "Avenir Next", "Segoe UI", sans-serif;
}

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

code,
pre {
  font-family: "SFMono-Regular", "Menlo", monospace;
}

button,
input,
select,
textarea {
  font: inherit;
}

.layout {
  display: grid;
  grid-template-columns: 290px 1fr;
  min-height: 100vh;
}

.sidebar {
  padding: 28px;
  border-right: 1px solid var(--line);
  background: rgba(255, 248, 237, 0.8);
  backdrop-filter: blur(20px);
}

.brand {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 28px;
}

.brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #1f7a5b, #ecbe74);
  color: white;
  font-weight: 700;
}

.brand p,
.muted {
  color: var(--muted);
}

.nav {
  display: grid;
  gap: 8px;
  margin-bottom: 24px;
}

.nav a,
button,
.ghost {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  background: white;
  cursor: pointer;
}

.primary {
  background: var(--accent);
  color: white;
  border-color: transparent;
}

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

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

.wide {
  width: 100%;
}

.token-box {
  padding: 14px;
  border: 1px dashed var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.55);
  margin-bottom: 16px;
}

.token-box code {
  display: block;
  margin-top: 8px;
  word-break: break-all;
}

.token-action {
  margin-top: 12px;
}

.content {
  padding: 32px;
}

.login-shell {
  min-height: calc(100vh - 64px);
  display: grid;
  place-items: center;
}

.login-panel {
  width: min(520px, 100%);
}

.login-grid {
  grid-template-columns: 1fr;
}

.login-banner {
  display: grid;
  gap: 6px;
  margin: 18px 0 20px;
  padding: 16px 18px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(15, 93, 68, 0.12), rgba(236, 190, 116, 0.14));
  border: 1px solid rgba(15, 93, 68, 0.12);
}

.login-banner span {
  color: var(--muted);
  font-size: 14px;
}

.hero h1,
.panel h1,
.panel h2 {
  margin: 0 0 8px;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 12px;
  color: var(--accent);
}

.subtitle {
  max-width: 760px;
  color: var(--muted);
}

.stats,
.grid.two {
  display: grid;
  gap: 18px;
}

.stats {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 20px 0;
}

.grid.two {
  grid-template-columns: 1.2fr 0.8fr;
}

.panel,
.stat-card,
.node-card,
.job-item {
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: var(--shadow);
  border-radius: 24px;
}

.panel,
.stat-card,
.node-card {
  padding: 22px;
}

.panel-head,
.job-line,
.node-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

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

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

.actions {
  display: flex;
  gap: 10px;
}

.inline-form {
  display: inline-flex;
}

.job-list,
.node-stack {
  display: grid;
  gap: 14px;
}

.job-item {
  padding: 16px 18px;
}

.badge {
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(31, 122, 91, 0.12);
  color: var(--accent-strong);
}

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

label {
  display: grid;
  gap: 8px;
}

.wide-field,
.form-actions {
  grid-column: 1 / -1;
}

input,
textarea,
select {
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
}

.checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
}

.checkbox input {
  width: 18px;
  height: 18px;
}

.form-actions {
  display: flex;
  gap: 12px;
}

.credential-box {
  margin-top: 22px;
  padding: 16px;
  border-radius: 18px;
  background: rgba(31, 122, 91, 0.08);
}

.link-card {
  margin-top: 14px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
}

.plain-list {
  margin: 0;
  padding-left: 18px;
}

.info-strip {
  margin-bottom: 14px;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(31, 122, 91, 0.08);
  color: var(--accent-strong);
}

.route-audit {
  margin-bottom: 18px;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.7);
}

.route-audit.ok {
  background: rgba(31, 122, 91, 0.08);
}

.route-audit.warn {
  background: rgba(166, 64, 64, 0.08);
}

.route-audit p {
  margin: 8px 0 0;
}

.service-list-stack {
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
}

.service-chip {
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.78);
}

.service-chip > div:first-child {
  padding: 16px 18px;
}

.chip-remove {
  min-width: 72px;
  border-radius: 0;
  font-size: 28px;
  line-height: 1;
}

.service-list-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.service-list-note {
  margin-top: 14px;
}

.service-list-note a {
  color: var(--accent-strong);
}

.audit-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.audit-item {
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
}

.badge-ok {
  background: rgba(31, 122, 91, 0.12);
  color: var(--accent-strong);
}

.badge-warn {
  background: rgba(166, 64, 64, 0.12);
  color: var(--danger);
}

.flash-stack {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

.flash {
  padding: 12px 14px;
  border-radius: 14px;
}

.flash.success {
  background: rgba(31, 122, 91, 0.12);
}

.flash.error {
  background: rgba(166, 64, 64, 0.12);
}

.danger-text {
  color: var(--danger);
  margin-top: 6px;
}

pre {
  overflow: auto;
  white-space: pre-wrap;
}

@media (max-width: 980px) {
  .layout,
  .grid.two,
  .stats,
  .form-grid {
    grid-template-columns: 1fr;
  }

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