:root {
  --root-bg: #111113;
  --hdr-bg: #0c0c0e;
  --accent: #e8821a;
  --accent-2: #f59e0b;
  --card: #1a1a1d;
  --inner: #202023;
  --border: #303036;
  --text: #f2efe8;
  --muted: #929298;
  --dark: #0c0c0e;
  --green: #16a34a;
  --orange: #b45309;
  --cyan: #164e63;
  --purple: #4c1d95;
  --danger: #7f1d1d;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: "Segoe UI", Arial, sans-serif;
  background: var(--root-bg);
  color: var(--text);
  overflow: hidden;
}
.topbar {
  height: 138px;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 18px 28px;
  background: var(--hdr-bg);
  border-bottom: 3px solid var(--accent);
}
.logo { width: 80px; height: 80px; object-fit: contain; flex: 0 0 auto; }
.brand { min-width: 0; flex: 1; text-align: left; }
.brand h1 { margin: 0 0 8px; color: var(--accent-2); font-size: clamp(28px, 3vw, 40px); line-height: 1.05; }
.brand p { margin: 0; color: #aaa7ba; letter-spacing: .02em; }
.version { background: #202023; color: var(--accent-2); padding: 14px 18px; text-align: right; min-width: 140px; }
.version span { display: block; color: #aaa7ba; font-size: 12px; margin-top: 6px; }
.shell {
  height: calc(100vh - 198px);
  display: grid;
  grid-template-columns: minmax(320px, 380px) 1fr;
  gap: 12px;
  padding: 14px;
  overflow: hidden;
}
.rail { overflow-y: auto; padding-right: 6px; }
.workspace { background: var(--card); border: 1px solid var(--border); min-width: 0; display: flex; flex-direction: column; }
.card { background: var(--card); border: 1px solid var(--border); margin-bottom: 12px; padding: 16px; box-shadow: 0 10px 24px rgba(0,0,0,.15); }
h2 { margin: 0 0 14px; font-size: 16px; }
label { display: block; color: var(--muted); font-size: 12px; margin: 12px 0 6px; }
input[type="text"], input[type="password"], input[type="file"], textarea {
  width: 100%; background: var(--dark); border: 1px solid var(--border); color: var(--text);
  padding: 10px 11px; border-radius: 8px; outline: none;
}
input:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(232,130,26,.25); }
textarea { resize: vertical; min-height: 115px; }
.hint { color: var(--muted); font-size: 12px; line-height: 1.35; }
.api-row { display: grid; grid-template-columns: 1fr 74px; gap: 8px; }
.server-status {
  margin: 6px 0 10px; padding: 10px 12px; border-radius: 8px; font-weight: 700;
  border: 1px solid var(--border); background: #0c0c0e;
}
.server-status.ready { color: #bbf7d0; border-color: #166534; background: #052e16; }
.server-status.missing { color: #fed7aa; border-color: #9a3412; background: #431407; }
.server-status.waiting { color: #d4d4d8; }
.two-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 8px 0; }
.btn {
  border: 0; border-radius: 8px; padding: 10px 12px; margin-top: 8px; color: #fff;
  cursor: pointer; font-weight: 700; transition: transform .08s ease, filter .15s ease;
}
.btn:hover:not(:disabled) { filter: brightness(1.13); transform: translateY(-1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.full { width: 100%; }
.green { background: var(--green); }
.orange { background: var(--orange); }
.amber { background: #92400e; }
.cyan { background: var(--cyan); }
.purple { background: var(--purple); }
.danger { background: var(--danger); }
.ghost { background: #28282e; color: #d4d4d8; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 20px; border-bottom: 1px solid var(--border); }
.panel-head h2 { margin: 0; }
.summary { color: var(--accent-2); font-weight: 700; background: #171717; border: 1px solid #262626; padding: 8px 12px; border-radius: 8px; white-space: nowrap; }
.table-wrap { flex: 1; overflow: auto; }
table { border-collapse: collapse; min-width: 1900px; width: 100%; font-size: 13px; }
th { position: sticky; top: 0; background: #0c0c0e; color: var(--accent-2); z-index: 1; text-align: left; padding: 10px 8px; border-bottom: 1px solid #37373e; white-space: nowrap; }
td { padding: 8px; border-bottom: 1px solid #2c2c32; vertical-align: top; color: #f2efe8; }
tr:nth-child(even) td { background: #141416; }
tr:nth-child(odd) td { background: #1a1a1d; }
tr.found td { background-color: #1c1a10; }
tr.missing td { background-color: #1a1020; }
td.notes { min-width: 220px; }
td.notes textarea { min-height: 42px; padding: 6px; font-size: 12px; }
.pin-cell { text-align: center; font-size: 18px; cursor: pointer; color: var(--accent-2); }
.remove-row { background: #3f1d1d; color: #fee2e2; border: 0; border-radius: 6px; padding: 6px 8px; cursor: pointer; }
.statusbar {
  height: 60px; display: grid; grid-template-columns: 1fr 360px; gap: 16px; align-items: center;
  padding: 10px 16px; background: #0c0c0e; border-top: 1px solid var(--border);
}
.status-text { color: #d4d4d8; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
progress { width: 100%; height: 18px; accent-color: var(--accent); }
@media (max-width: 960px) {
  body { overflow: auto; }
  .topbar { height: auto; align-items: flex-start; padding: 14px; }
  .logo { width: 58px; height: 58px; }
  .version { display: none; }
  .shell { height: auto; min-height: calc(100vh - 140px); grid-template-columns: 1fr; overflow: visible; }
  .rail { overflow: visible; }
  .statusbar { grid-template-columns: 1fr; height: auto; }
}
