:root {
  --ink: #0f2a1f; --muted: #5b6b63; --line: #dce6e0; --bg: #f3f7f4; --card: #fff;
  --green: #12935a; --green-dark: #0a5c38; --green-soft: #e6f4ec;
  --gold: #f2b33d; --amber-soft: #fff4dc; --amber: #7a5200;
  --red: #b42318; --red-soft: #fdecea; --blue-soft: #e9f0fe; --blue: #1d4ed8; --gray-soft: #eef1f0;
  font-family: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); }
a { color: var(--green-dark); }
button, input, select, textarea { font: inherit; color: inherit; }
.hidden { display: none !important; }
.mark { width: 40px; height: 40px; border-radius: 12px; background: var(--ink); display: grid; place-items: center; flex-shrink: 0; }
.mark svg { width: 70%; height: 70%; }

/* login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: radial-gradient(circle at 20% 10%, #1a4a36 0, var(--ink) 55%); }
.login-card { width: min(400px, 100%); background: #fff; border-radius: 20px; padding: 32px 28px; box-shadow: 0 30px 60px rgba(0,0,0,.25); }
.login-card .mark { width: 56px; height: 56px; border-radius: 16px; margin-bottom: 16px; }
.login-card h1 { margin: 0 0 4px; font-size: 24px; }
.login-card p { margin: 0 0 20px; color: var(--muted); font-size: 14px; }

/* form */
label.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 700; color: #334a3f; margin-bottom: 14px; }
.input { width: 100%; padding: 11px 12px; border: 1px solid #cfdbd4; border-radius: 10px; background: #fff; font-size: 15px; }
.input:focus { outline: 2px solid var(--green); outline-offset: 1px; border-color: transparent; }
textarea.input { min-height: 72px; resize: vertical; }
.hint { font-weight: 500; color: var(--muted); font-size: 12px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; }
@media (max-width: 560px) { .grid2 { grid-template-columns: 1fr; } }
.error { color: var(--red); font-size: 14px; font-weight: 600; min-height: 1em; margin: 4px 0 10px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid transparent; border-radius: 10px; padding: 10px 16px; font-weight: 700; cursor: pointer; background: var(--green); color: #fff; min-height: 42px; text-decoration: none; font-size: 14px; }
.btn:hover { background: var(--green-dark); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.secondary { background: #fff; color: var(--ink); border-color: var(--line); }
.btn.secondary:hover { background: var(--gray-soft); }
.btn.ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.3); }
.btn.ghost:hover { background: rgba(255,255,255,.1); }
.btn.small { min-height: 34px; padding: 6px 12px; font-size: 13px; border-radius: 8px; }
.btn.block { width: 100%; }

/* shell */
.top { background: var(--ink); color: #fff; }
.top-inner { max-width: 1240px; margin: 0 auto; padding: 14px 20px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.top .brand { display: flex; align-items: center; gap: 12px; margin-right: auto; }
.top .brand strong { font-size: 17px; display: block; }
.top .brand small { color: #a9c7b8; font-size: 12px; }
.tabs { display: flex; gap: 4px; }
.tab { background: transparent; border: 0; color: #cfe3d8; padding: 8px 12px; border-radius: 8px; cursor: pointer; font-weight: 700; font-size: 14px; }
.tab[aria-current="page"] { background: rgba(255,255,255,.12); color: #fff; }
main { max-width: 1240px; margin: 0 auto; padding: 24px 20px 64px; }
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.head h1 { margin: 0; font-size: 26px; letter-spacing: -.01em; }
.head p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }

.cards { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
@media (max-width: 900px) { .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; text-align: left; cursor: pointer; }
.card[aria-pressed="true"] { border-color: var(--green); box-shadow: 0 0 0 2px var(--green-soft); }
.card span { display: block; color: var(--muted); font-size: 13px; font-weight: 600; }
.card strong { display: block; font-size: 28px; margin-top: 4px; }
.card.warn strong { color: var(--amber); }
.card.bad strong { color: var(--red); }

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.toolbar .input { max-width: 320px; }
.table-wrap { background: #fff; border: 1px solid var(--line); border-radius: 14px; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 12px 14px; border-bottom: 1px solid var(--line); background: #fafcfb; white-space: nowrap; }
td { padding: 12px 14px; border-bottom: 1px solid #edf2ef; vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
td .sub { color: var(--muted); font-size: 12px; display: block; margin-top: 2px; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.empty { padding: 40px 16px; text-align: center; color: var(--muted); }

.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.pill.active, .pill.unlimited { background: var(--green-soft); color: var(--green-dark); }
.pill.warning, .pill.grace { background: var(--amber-soft); color: var(--amber); }
.pill.expired { background: var(--red-soft); color: var(--red); }
.pill.demo { background: var(--blue-soft); color: var(--blue); }
.pill.plan { background: var(--gray-soft); color: #33443c; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; background: #9aa8a1; }
.dot.running { background: var(--green); }
.dot.exited, .dot.dead { background: var(--red); }

/* dialog */
dialog { border: 0; border-radius: 18px; padding: 0; width: min(640px, calc(100vw - 24px)); max-height: calc(100vh - 32px); box-shadow: 0 30px 80px rgba(0,0,0,.3); }
dialog::backdrop { background: rgba(10, 25, 18, .5); }
.dlg-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 20px 22px 8px; }
.dlg-head h2 { margin: 0; font-size: 20px; }
.dlg-head p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.dlg-body { padding: 8px 22px 22px; overflow-y: auto; }
.close { background: var(--gray-soft); border: 0; width: 36px; height: 36px; border-radius: 10px; cursor: pointer; font-size: 18px; flex-shrink: 0; }
.section { border-top: 1px solid var(--line); padding-top: 16px; margin-top: 16px; }
.section h3 { margin: 0 0 10px; font-size: 15px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 6px 12px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; }
pre.log { background: #0f1f18; color: #cfe8d9; border-radius: 12px; padding: 14px; font-size: 12px; line-height: 1.5; max-height: 320px; overflow: auto; white-space: pre-wrap; margin: 0; }
.secret { background: var(--amber-soft); border: 1px solid #f0d28e; border-radius: 12px; padding: 14px; }
.secret code { font-size: 18px; font-weight: 800; letter-spacing: .04em; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px; font-weight: 600; z-index: 50; box-shadow: 0 10px 30px rgba(0,0,0,.25); max-width: calc(100vw - 32px); }
