/* Minecraft Tenant Server — panel styles. No external assets; works under a strict CSP. */
:root {
  --bg: #f6f7f9;
  --bg-elev: #ffffff;
  --bg-sunk: #eef0f3;
  --line: #e2e5ea;
  --line-strong: #cfd4dc;
  --text: #111827;
  --text-2: #4b5563;
  --text-3: #6b7280;
  --brand: #16a34a;
  --brand-ink: #ffffff;
  --brand-soft: #e8f7ee;
  --accent: #2563eb;
  --ok: #15803d;   --ok-soft: #e7f6ec;
  --warn: #b45309; --warn-soft: #fdf3e2;
  --bad: #b91c1c;  --bad-soft: #fdeceb;
  --muted: #6b7280; --muted-soft: #eef0f3;
  --radius: 10px;
  --radius-sm: 7px;
  --shadow: 0 1px 2px rgba(16,24,40,.06), 0 1px 3px rgba(16,24,40,.08);
  --shadow-lg: 0 12px 32px rgba(16,24,40,.12);
  --mono: ui-monospace, SFMono-Regular, "JetBrains Mono", Menlo, Consolas, monospace;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --console-bg: #0b1020;
  --console-text: #d6deeb;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d1117; --bg-elev: #151b23; --bg-sunk: #0a0e14; --line: #232b36; --line-strong: #2f3a48;
    --text: #e6edf3; --text-2: #b1bac4; --text-3: #8b949e;
    --brand: #22c55e; --brand-ink: #04170b; --brand-soft: #0f2a1a; --accent: #60a5fa;
    --ok: #4ade80; --ok-soft: #10281a; --warn: #fbbf24; --warn-soft: #2b2110;
    --bad: #f87171; --bad-soft: #2d1414; --muted: #8b949e; --muted-soft: #1c232d;
    --shadow: 0 1px 2px rgba(0,0,0,.4); --shadow-lg: 0 12px 32px rgba(0,0,0,.5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0d1117; --bg-elev: #151b23; --bg-sunk: #0a0e14; --line: #232b36; --line-strong: #2f3a48;
  --text: #e6edf3; --text-2: #b1bac4; --text-3: #8b949e;
  --brand: #22c55e; --brand-ink: #04170b; --brand-soft: #0f2a1a; --accent: #60a5fa;
  --ok: #4ade80; --ok-soft: #10281a; --warn: #fbbf24; --warn-soft: #2b2110;
  --bad: #f87171; --bad-soft: #2d1414; --muted: #8b949e; --muted-soft: #1c232d;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 var(--sans); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0 0 .5rem; line-height: 1.25; letter-spacing: -.01em; }
h1 { font-size: 1.6rem; font-weight: 650; }
h2 { font-size: 1.15rem; font-weight: 620; }
h3 { font-size: 1rem; font-weight: 600; }
p { margin: 0 0 .8rem; }
code, kbd, pre { font-family: var(--mono); font-size: .88em; }
code { background: var(--bg-sunk); padding: .1em .35em; border-radius: 5px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 1.25rem 0; }
small, .small { font-size: .85rem; }
.muted { color: var(--text-3); }
.mono { font-family: var(--mono); }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.hidden { display: none !important; }

/* ---------- App shell ---------- */
.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.sidebar { background: var(--bg-elev); border-right: 1px solid var(--line); padding: 18px 14px; display: flex;
  flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--text); padding: 4px 8px 16px;
  font-size: 1rem; letter-spacing: -.01em; }
.brand:hover { text-decoration: none; }
.brand svg { flex: none; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--text-2);
  font-weight: 520; }
.nav a:hover { background: var(--bg-sunk); text-decoration: none; color: var(--text); }
.nav a.active { background: var(--brand-soft); color: var(--text); }
.nav a.active svg { color: var(--brand); }
.nav .section { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3);
  margin: 14px 10px 4px; }
.sidebar .spacer { flex: 1; }
.userbox { border-top: 1px solid var(--line); padding: 12px 8px 0; font-size: .88rem; }
.userbox .who { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.userbox form { display: inline; }
.main { min-width: 0; }
.topbar { display: none; }
.content { padding: 28px 36px 64px; max-width: 1180px; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px;
  flex-wrap: wrap; }
.page-head .sub { color: var(--text-3); margin-top: 2px; }
.banner { background: var(--warn-soft); color: var(--text); border-bottom: 1px solid var(--line); padding: 10px 36px;
  font-size: .92rem; }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 50; inset: 0 auto 0 0; width: 260px; transform: translateX(-100%);
    transition: transform .2s; box-shadow: var(--shadow-lg); }
  .shell.nav-open .sidebar { transform: none; visibility: visible; }
  .shell:not(.nav-open) .sidebar { box-shadow: none; visibility: hidden; transition: transform .2s, visibility 0s .2s; }
  .topbar { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: var(--bg-elev);
    border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 40; }
  .content { padding: 20px 16px 48px; }
  .banner { padding: 10px 16px; }
}

/* ---------- Cards, grids ---------- */
.card { background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px;
  border-bottom: 1px solid var(--line); }
.card-head h2, .card-head h3 { margin: 0; }
.card-body { padding: 20px; }
.card + .card, .stack > * + * { margin-top: 16px; }
.grid > .card + .card, .grid > .stack + .card, .grid > .card + .stack { margin-top: 0; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1000px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stat { padding: 16px 18px; }
.stat .label { color: var(--text-3); font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; }
.stat .value { font-size: 1.45rem; font-weight: 650; margin-top: 4px; font-variant-numeric: tabular-nums; }
.stat .hint { color: var(--text-3); font-size: .85rem; }
.empty { text-align: center; padding: 48px 20px; color: var(--text-2); }
.empty h2 { margin-bottom: 6px; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 14px;
  border-radius: 8px; border: 1px solid var(--line-strong); background: var(--bg-elev); color: var(--text);
  font: 560 .92rem var(--sans); cursor: pointer; white-space: nowrap; transition: background .12s, border-color .12s; }
.btn:hover { background: var(--bg-sunk); text-decoration: none; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn-primary:hover { background: var(--brand); filter: brightness(1.06); }
.btn-danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, var(--line-strong)); }
.btn-danger:hover { background: var(--bad-soft); }
.btn-danger.solid { background: var(--bad); color: #fff; border-color: var(--bad); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-sm { height: 30px; padding: 0 10px; font-size: .85rem; }
.btn-block { width: 100%; }
.btn svg { width: 16px; height: 16px; }
.btn-group { display: inline-flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 999px; font-size: .78rem;
  font-weight: 600; text-transform: capitalize; background: var(--muted-soft); color: var(--muted); white-space: nowrap; }
.badge .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-warn .dot { animation: pulse 1.4s infinite; }
.badge-bad { background: var(--bad-soft); color: var(--bad); }
.badge-muted { background: var(--muted-soft); color: var(--muted); }
.tag { display: inline-block; padding: 1px 8px; border-radius: 6px; background: var(--bg-sunk); font-size: .78rem;
  color: var(--text-2); font-weight: 560; }
.tag-bedrock { background: #e0f2fe; color: #0369a1; }
.tag-java { background: #fef3c7; color: #92400e; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .tag-bedrock { background: #0c2a3d; color: #7dd3fc; }
  :root:not([data-theme="light"]) .tag-java { background: #33240a; color: #fcd34d; }
}
@keyframes pulse { 50% { opacity: .35; } }

/* ---------- Forms ---------- */
label { display: block; font-weight: 560; font-size: .9rem; margin-bottom: 6px; }
.field { margin-bottom: 16px; }
.field .help { color: var(--text-3); font-size: .84rem; margin-top: 5px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=search], input[type=url],
select, textarea {
  width: 100%; height: 40px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 8px;
  background: var(--bg-elev); color: var(--text); font: inherit; transition: border-color .12s, box-shadow .12s;
}
textarea { height: auto; padding: 10px 12px; min-height: 120px; resize: vertical; }
textarea.code { font-family: var(--mono); font-size: .85rem; min-height: 460px; line-height: 1.45; tab-size: 2;
  white-space: pre; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
input[type=checkbox], input[type=radio] { width: 17px; height: 17px; accent-color: var(--brand); vertical-align: -3px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; }
.check input { margin-top: 2px; flex: none; }
.input-group { display: flex; align-items: stretch; }
.input-group input { border-radius: 8px 0 0 8px; }
.input-group .suffix { display: flex; align-items: center; padding: 0 12px; border: 1px solid var(--line-strong);
  border-left: 0; border-radius: 0 8px 8px 0; background: var(--bg-sunk); color: var(--text-2); font-size: .9rem;
  white-space: nowrap; }
.form-actions { display: flex; gap: 10px; align-items: center; margin-top: 8px; flex-wrap: wrap; }
.hp { position: absolute; left: -9999px; }
.choice-cards { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
.choice { position: relative; border: 1.5px solid var(--line-strong); border-radius: var(--radius); padding: 16px;
  cursor: pointer; display: block; font-weight: 400; margin: 0; }
.choice input { position: absolute; opacity: 0; }
.choice:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.choice:has(input:disabled) { opacity: .5; cursor: not-allowed; }
.choice strong { display: block; font-size: 1rem; margin-bottom: 2px; }
.choice span { color: var(--text-2); font-size: .88rem; }

/* ---------- Alerts / flashes ---------- */
.alert { padding: 12px 14px; border-radius: 8px; margin-bottom: 14px; border: 1px solid transparent; font-size: .93rem; }
.alert-ok { background: var(--ok-soft); color: var(--text); border-color: color-mix(in srgb, var(--ok) 30%, transparent); }
.alert-warn { background: var(--warn-soft); color: var(--text); border-color: color-mix(in srgb, var(--warn) 30%, transparent); }
.alert-bad { background: var(--bad-soft); color: var(--text); border-color: color-mix(in srgb, var(--bad) 30%, transparent); }
.alert ul { margin: 0; padding-left: 18px; }
.flashes { position: fixed; top: 16px; right: 16px; z-index: 100; width: min(420px, calc(100vw - 32px)); }
.flashes .alert { box-shadow: var(--shadow-lg); animation: slidein .25s ease-out; }
@keyframes slidein { from { transform: translateY(-8px); opacity: 0; } }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th { text-align: left; font-weight: 600; color: var(--text-3); font-size: .78rem; text-transform: uppercase;
  letter-spacing: .05em; padding: 10px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: color-mix(in srgb, var(--bg-sunk) 55%, transparent); }
td.actions { text-align: right; white-space: nowrap; }
td.actions form { display: inline; }

/* ---------- Server cards ---------- */
.server-card { display: block; color: inherit; padding: 18px 20px; }
.server-card:hover { text-decoration: none; border-color: var(--line-strong); }
.server-card .name { font-weight: 650; font-size: 1.05rem; }
.server-card .meta { display: flex; gap: 14px; flex-wrap: wrap; color: var(--text-3); font-size: .86rem; margin-top: 10px; }
.addr { display: inline-flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: .92rem;
  background: var(--bg-sunk); border: 1px solid var(--line); padding: 6px 10px; border-radius: 8px; max-width: 100%; }
.addr span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.copy { border: 0; background: transparent; color: var(--text-3); cursor: pointer; padding: 2px; display: inline-flex; }
.copy:hover { color: var(--text); }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; }
.tabs a { padding: 10px 14px; color: var(--text-2); font-weight: 560; border-bottom: 2px solid transparent;
  margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.active { color: var(--text); border-bottom-color: var(--brand); }

.kv { display: grid; grid-template-columns: 160px 1fr; gap: 10px 16px; font-size: .93rem; }
.kv dt { color: var(--text-3); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

.progress { height: 6px; background: var(--bg-sunk); border-radius: 99px; overflow: hidden; }
.progress > div { height: 100%; background: var(--brand); border-radius: 99px; transition: width .4s; }
.progress.warn > div { background: var(--warn); }
.progress.bad > div { background: var(--bad); }

.job-banner { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: var(--radius);
  background: var(--warn-soft); margin-bottom: 16px; }
.spinner { width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%;
  animation: spin .8s linear infinite; flex: none; color: var(--warn); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Console ---------- */
.console { background: var(--console-bg); color: var(--console-text); border-radius: var(--radius); overflow: hidden;
  border: 1px solid #1b2236; }
.console-out { height: 520px; overflow-y: auto; padding: 14px 16px; font: 12.5px/1.55 var(--mono); white-space: pre-wrap;
  overflow-wrap: anywhere; }
.console-out .l-warn { color: #fbbf24; } .console-out .l-err { color: #f87171; } .console-out .l-sys { color: #7dd3fc; }
.console-out .l-ok { color: #86efac; }
.console-in { display: flex; border-top: 1px solid #1b2236; background: #0e1428; }
.console-in span { padding: 0 6px 0 14px; display: flex; align-items: center; color: #4ade80; font-family: var(--mono); }
.console-in input { border: 0; border-radius: 0; background: transparent; color: var(--console-text); height: 46px;
  font-family: var(--mono); font-size: .9rem; }
.console-in input:focus { box-shadow: none; }
.console-in button { border-radius: 0; height: 46px; border: 0; }
.console-status { font-size: .82rem; color: var(--text-3); }

/* ---------- Charts ---------- */
.spark { width: 100%; height: 64px; display: block; }
.spark path.area { fill: color-mix(in srgb, var(--brand) 16%, transparent); }
.spark path.line { fill: none; stroke: var(--brand); stroke-width: 1.6; }
.spark.mem path.area { fill: color-mix(in srgb, var(--accent) 16%, transparent); }
.spark.mem path.line { stroke: var(--accent); }

/* ---------- Auth / public ---------- */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 32px 16px; }
.auth-card { width: 100%; max-width: 420px; }
.auth-card.wide { max-width: 560px; }
.auth-card .brand { justify-content: center; padding-bottom: 20px; font-size: 1.1rem; }
.auth-foot { text-align: center; margin-top: 16px; color: var(--text-3); font-size: .9rem; }
.public-nav { display: flex; align-items: center; justify-content: space-between; max-width: 1140px; margin: 0 auto;
  padding: 18px 24px; }
.public-nav nav { display: flex; gap: 8px; align-items: center; }
.hero { max-width: 1140px; margin: 0 auto; padding: 64px 24px 40px; display: grid; grid-template-columns: 1.1fr .9fr;
  gap: 48px; align-items: center; }
.hero h1 { font-size: clamp(2rem, 4vw, 3rem); font-weight: 750; letter-spacing: -.025em; margin-bottom: 16px; }
.hero p.lead { font-size: 1.15rem; color: var(--text-2); max-width: 560px; }
.hero-visual { background: var(--console-bg); border-radius: 14px; padding: 22px; color: var(--console-text);
  font: 13px/1.7 var(--mono); box-shadow: var(--shadow-lg); }
.hero-visual .k { color: #86efac; } .hero-visual .d { color: #7dd3fc; } .hero-visual .m { color: #94a3b8; }
@media (max-width: 860px) { .hero { grid-template-columns: 1fr; padding-top: 32px; } }
.section-wrap { max-width: 1140px; margin: 0 auto; padding: 32px 24px; }
.features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 860px) { .features { grid-template-columns: 1fr; } }
.feature { padding: 22px; }
.feature .icon { width: 38px; height: 38px; border-radius: 9px; background: var(--brand-soft); color: var(--brand);
  display: grid; place-items: center; margin-bottom: 12px; }
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.plan { padding: 22px; display: flex; flex-direction: column; }
.plan.current { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.plan .price { font-size: 2rem; font-weight: 750; letter-spacing: -.02em; margin: 6px 0 2px; }
.plan .price small { font-size: .95rem; color: var(--text-3); font-weight: 500; }
.plan ul { list-style: none; padding: 0; margin: 14px 0 18px; flex: 1; }
.plan li { padding: 5px 0 5px 24px; position: relative; color: var(--text-2); font-size: .93rem; }
.plan li::before { content: ""; position: absolute; left: 2px; top: 11px; width: 12px; height: 7px;
  border-left: 2px solid var(--brand); border-bottom: 2px solid var(--brand); transform: rotate(-45deg); }
.footer { border-top: 1px solid var(--line); margin-top: 48px; padding: 24px; color: var(--text-3); font-size: .88rem; }
.footer .inner { max-width: 1140px; margin: 0 auto; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.prose { max-width: 760px; }
.prose h2 { margin-top: 1.6rem; }

/* ---------- Files ---------- */
.crumbs { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; font-size: .92rem; }
.crumbs span { color: var(--text-3); }
.file-icon { width: 18px; height: 18px; vertical-align: -4px; margin-right: 8px; color: var(--text-3); }
.file-icon.dir { color: #d97706; }

.qr svg { width: 200px; height: 200px; border-radius: 8px; background: #fff; }
.codes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px 24px; font-family: var(--mono); font-size: 1rem;
  background: var(--bg-sunk); padding: 16px; border-radius: 8px; }
details summary { cursor: pointer; font-weight: 560; }
.pill-filter { display: flex; gap: 6px; flex-wrap: wrap; }
.pill-filter a { padding: 4px 12px; border-radius: 999px; border: 1px solid var(--line); color: var(--text-2);
  font-size: .85rem; }
.pill-filter a.active { background: var(--text); color: var(--bg); border-color: var(--text); text-decoration: none; }
.pagination { display: flex; gap: 8px; justify-content: flex-end; padding: 12px 16px; }

/* Test-mode and "view as user" bars (every layout) */
.envbar { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; padding: 6px 16px;
  font-size: .84rem; font-weight: 600; letter-spacing: .02em; text-align: center; }
.envbar.test { color: #3b2a00; background: repeating-linear-gradient(-45deg, #fcd34d, #fcd34d 14px, #fde68a 14px, #fde68a 28px); }
.envbar.viewas { color: #fff; background: #7c3aed; }
.envbar.viewas form { display: inline; margin: 0; }
.envbar.viewas .btn { background: #fff; color: #4c1d95; border-color: #fff; padding: 3px 10px; }
