:root {
  --bg: #f5f7f6; --panel: #ffffff; --ink: #17201c; --muted: #5d6b64; --line: #dfe6e2;
  --accent: #1f7a55; --accent-ink: #ffffff; --accent-soft: #e3f2ea; --warn: #b45309; --warn-soft: #fdf1e2;
  --bad: #b42318; --bad-soft: #fde8e6; --info: #1d4ed8; --info-soft: #e6edfd; --shadow: 0 1px 2px rgba(0,0,0,.05);
  --radius: 12px; --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0f1412; --panel: #161d1a; --ink: #e5ece8; --muted: #93a39b; --line: #26302c;
    --accent: #3bb27f; --accent-ink: #06120c; --accent-soft: #143024; --warn: #f0a24b; --warn-soft: #33240f;
    --bad: #f07067; --bad-soft: #3a1714; --info: #7aa2ff; --info-soft: #172446; --shadow: none; }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 28px; margin: 0 0 6px; letter-spacing: -.01em; }
h2 { font-size: 19px; margin: 0 0 12px; }
h3 { font-size: 15px; margin: 0 0 8px; }
p { margin: 0 0 12px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
code, .mono { font-family: var(--mono); font-size: 12.5px; }
code.block { display: block; padding: 10px 12px; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; white-space: pre-wrap; word-break: break-all; }

.shell { display: grid; grid-template-columns: 230px 1fr; min-height: 100vh; }
.side { background: var(--panel); border-right: 1px solid var(--line); padding: 18px 12px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; padding: 4px 8px 18px; color: var(--ink); }
.brand .logo { width: 28px; height: 28px; border-radius: 8px; background: var(--accent); display: grid; place-items: center; color: var(--accent-ink); font-size: 14px; }
.nav a { display: block; padding: 8px 10px; border-radius: 8px; color: var(--ink); margin: 1px 0; }
.nav a:hover { background: var(--bg); text-decoration: none; }
.nav a.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.nav .sec { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 14px 10px 4px; }
.main { padding: 28px 32px 60px; max-width: 1180px; width: 100%; }
.top { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); margin-bottom: 16px; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.stat .k { font-size: 12.5px; color: var(--muted); }
.stat .v { font-size: 24px; font-weight: 650; margin-top: 2px; font-variant-numeric: tabular-nums; }
.stat .s { font-size: 12px; color: var(--muted); }

table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th { text-align: left; font-weight: 600; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; padding: 8px 10px; border-bottom: 1px solid var(--line); }
td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; font-variant-numeric: tabular-nums; }
tr:last-child td { border-bottom: 0; }
.tablewrap { overflow-x: auto; }

label { display: block; font-size: 13px; font-weight: 600; margin: 0 0 4px; }
.field { margin-bottom: 14px; }
.hint { font-size: 12px; color: var(--muted); margin-top: 3px; font-weight: 400; }
input, select, textarea { width: 100%; font: inherit; padding: 9px 11px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); }
textarea { font-family: var(--mono); font-size: 13px; min-height: 90px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
input[type=checkbox], input[type=radio] { width: auto; margin-right: 6px; }
.check { display: flex; align-items: center; font-weight: 500; margin: 6px 0; }

.btn { display: inline-flex; align-items: center; gap: 6px; font: inherit; font-weight: 600; padding: 9px 15px; border-radius: 8px; border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink); cursor: pointer; }
.btn:hover { filter: brightness(1.06); text-decoration: none; }
.btn.ghost { background: transparent; color: var(--accent); }
.btn.danger { background: transparent; border-color: var(--bad); color: var(--bad); }
.btn.sm { padding: 5px 10px; font-size: 13px; }
.btn:disabled { opacity: .55; cursor: default; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

.pill { display: inline-block; padding: 1px 9px; border-radius: 99px; font-size: 12px; font-weight: 600; background: var(--bg); color: var(--muted); border: 1px solid var(--line); }
.pill.online, .pill.completed, .pill.verified, .pill.paid { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.pill.running, .pill.leased, .pill.approved, .pill.done { background: var(--info-soft); color: var(--info); border-color: transparent; }
.pill.queued, .pill.requested, .pill.paused { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.pill.failed, .pill.rejected, .pill.suspended, .pill.cancelled, .pill.offline { background: var(--bad-soft); color: var(--bad); border-color: transparent; }

.bar { height: 8px; background: var(--bg); border-radius: 99px; overflow: hidden; border: 1px solid var(--line); }
.bar > span { display: block; height: 100%; background: var(--accent); }

.toast { position: fixed; bottom: 20px; right: 20px; background: var(--ink); color: var(--bg); padding: 11px 16px; border-radius: 10px; font-weight: 500; z-index: 50; max-width: 420px; }
.toast.err { background: var(--bad); color: #fff; }
.notice { padding: 11px 14px; border-radius: 10px; background: var(--info-soft); color: var(--ink); margin-bottom: 14px; font-size: 14px; }
.notice.warn { background: var(--warn-soft); }

.auth { max-width: 440px; margin: 7vh auto; padding: 0 16px; }
.hero { padding: 64px 24px 30px; max-width: 1080px; margin: 0 auto; }
.hero h1 { font-size: 42px; line-height: 1.1; max-width: 760px; }
.hero p.lead { font-size: 18px; color: var(--muted); max-width: 680px; margin: 14px 0 24px; }
.landing-nav { display: flex; justify-content: space-between; align-items: center; max-width: 1080px; margin: 0 auto; padding: 18px 24px; }
.feature h3 { margin-top: 2px; }
.steps { counter-reset: s; list-style: none; padding: 0; margin: 0; }
.steps li { counter-increment: s; padding: 6px 0 6px 34px; position: relative; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 6px; width: 22px; height: 22px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: 12px; font-weight: 700; display: grid; place-items: center; }
.chart { display: flex; align-items: flex-end; gap: 4px; height: 90px; padding-top: 6px; }
.chart span { flex: 1; background: var(--accent); border-radius: 3px 3px 0 0; min-height: 2px; opacity: .85; }
.mobile-top { display: none; }

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; display: none; }
  .side.open { display: block; }
  .mobile-top { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; background: var(--panel); border-bottom: 1px solid var(--line); }
  .main { padding: 18px 16px 50px; }
  .g2, .g3, .g4 { grid-template-columns: 1fr; }
  .hero h1 { font-size: 32px; }
}
