:root {
  --bg: #f8f9fa;
  --surface: #ffffff;
  --border: #dadce0;
  --text: #202124;
  --muted: #5f6368;
  --accent: #1a73e8;
  --accent-text: #ffffff;
  --warn: #d93025;
  --ok: #1e8e3e;
}

[data-theme="dark"] {
  --bg: #111318;
  --surface: #1a1d24;
  --border: #2e3340;
  --text: #e8eaed;
  --muted: #9aa0a6;
  --accent: #8ab4f8;
  --accent-text: #111318;
  --warn: #f28b82;
  --ok: #81c995;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: "Inter", "Noto Sans SC", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.hidden { display: none !important; }

/* Login Card */
.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-card {
  width: min(92vw, 420px);
  padding: 32px 28px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.14);
}

.login-badge {
  display: inline-block;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--accent);
  margin-bottom: 10px;
}

.login-card h1 {
  margin: 0 0 8px;
  font-size: 24px;
  font-weight: 600;
}

.login-sub {
  margin: 0 0 22px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--muted);
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.login-form input,
textarea {
  width: 100%;
  padding: 11px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  outline: none;
}

.login-form input:focus,
textarea:focus {
  border-color: var(--accent);
}

.btn-primary {
  padding: 10px 16px;
  border: none;
  border-radius: 10px;
  background: var(--accent);
  color: var(--accent-text);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.msg-text {
  min-height: 18px;
  margin: 0;
  font-size: 12px;
  color: var(--warn);
}

/* Workspace */
.app-body {
  background: #000000;
}

.vnc-screen {
  width: 100vw;
  height: 100dvh;
  background: #000000;
}

.floating-dock {
  position: fixed;
  top: 10px;
  right: 12px;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.25);
}

.conn-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
}
.conn-dot.is-ok { background: var(--ok); }
.conn-dot.is-connecting { background: #fbbc04; }
.conn-dot.is-offline { background: var(--warn); }

.conn-label {
  font-size: 12px;
  font-weight: 600;
  margin-right: 4px;
  color: var(--text);
}

.dock-btn {
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}

.dock-btn:hover { background: color-mix(in srgb, var(--text) 8%, transparent); }
.dock-btn.warn { color: var(--warn); }
.dock-btn.subtle { padding: 5px 7px; }

.dock-expand {
  position: fixed;
  top: 10px;
  right: 12px;
  z-index: 40;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-card {
  width: min(92vw, 460px);
  padding: 20px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-head h3 { margin: 0; font-size: 16px; }

.icon-close {
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 22px;
  cursor: pointer;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
}
