:root {
  --bg: #0f1412;
  --bg-2: #171e1b;
  --card: #1c2622;
  --line: #2b3a34;
  --text: #e8f0ec;
  --muted: #9bb0a7;
  --accent: #3dba8a;
  --accent-2: #2a8f68;
  --warn: #3a2f16;
  --danger: #f0a8a0;
  --radius: 16px;
  font-family: "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
[hidden] { display: none !important; }
a { color: var(--accent); }
code, pre {
  font-family: ui-monospace, Consolas, monospace;
  background: #0c100e;
  border-radius: 8px;
}
pre { padding: 12px 14px; overflow: auto; }
.page { max-width: 980px; margin: 0 auto; padding: 48px 20px 80px; }
.hero { margin-bottom: 36px; }
.brand {
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 12px;
  color: var(--accent);
  font-weight: 700;
}
h1 { font-size: 36px; line-height: 1.15; margin: 10px 0; }
h2 { font-size: 18px; margin: 0 0 10px; }
.lead { color: var(--muted); max-width: 640px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  padding: 12px 20px;
  font-weight: 650;
  text-decoration: none;
  cursor: pointer;
  color: var(--text);
}
.btn.small { padding: 8px 14px; font-size: 13px; }
.btn.primary { background: var(--accent); color: #06281c; }
.btn.ghost { background: transparent; border: 1px solid var(--line); }
.btn.disabled { opacity: 0.45; pointer-events: none; }
.hint { color: var(--muted); font-size: 14px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
}
.card.warn { background: var(--warn); border-color: #6a5420; margin-top: 20px; }
.card.warn ul { margin: 0; padding-left: 18px; color: #f3e6c4; }
footer { margin-top: 28px; color: var(--muted); font-size: 14px; }

.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.login-card { width: min(420px, 100%); }
.login-card input, .sidebar input {
  width: 100%;
  margin: 8px 0 16px;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #101714;
  color: var(--text);
}
label { font-size: 13px; color: var(--muted); }
.error { color: var(--danger); font-size: 14px; }
.painel-body { min-height: 100vh; }
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-2);
}
.topbar-actions { display: flex; gap: 8px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.workspace { display: grid; grid-template-columns: 280px 1fr; min-height: calc(100vh - 73px); }
.sidebar { border-right: 1px solid var(--line); padding: 20px; background: var(--bg-2); }
.device-list { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.device {
  text-align: left;
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 12px;
  padding: 12px;
  cursor: pointer;
}
.device.active { border-color: var(--accent); }
.device .name { font-weight: 650; display: block; }
.viewer { padding: 20px; display: grid; place-items: center; }
.empty { color: var(--muted); }
#remote { width: 100%; height: 100%; display: flex; flex-direction: column; gap: 12px; }
.remote-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.keys button {
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
}
.screen-wrap {
  flex: 1;
  display: grid;
  place-items: center;
  background: #050807;
  border-radius: 20px;
  overflow: hidden;
  min-height: 480px;
  user-select: none;
  touch-action: none;
}
#screen {
  max-width: 100%;
  max-height: calc(100vh - 180px);
  background: #000;
  cursor: crosshair;
}

@media (max-width: 800px) {
  .workspace { grid-template-columns: 1fr; }
  .sidebar { border-right: 0; border-bottom: 1px solid var(--line); }
}
