:root {
  --bg: #0f1420;
  --card: #171d2b;
  --border: #2a3244;
  --text: #e6e9ef;
  --muted: #8b95a7;
  --accent: #4f8cff;
  --accent-hover: #3d78e8;
  --danger: #e5484d;
  --online: #3ecf8e;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.hidden { display: none !important; }

#login-view {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 40px;
  width: 320px;
  text-align: center;
}

.login-card h1 { margin: 0 0 4px; font-size: 22px; }
.subtitle { color: var(--muted); margin: 0 0 24px; font-size: 13px; }

input, select, textarea {
  width: 100%;
  padding: 10px 12px;
  margin-bottom: 12px;
  background: #0f1420;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 14px;
}

button {
  cursor: pointer;
  border: none;
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 14px;
  background: var(--accent);
  color: white;
  font-weight: 600;
}

button:hover { background: var(--accent-hover); }

.secondary-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}

.link-btn {
  background: none;
  color: var(--muted);
  font-weight: 400;
  padding: 6px 10px;
}
.link-btn:hover { background: var(--card); color: var(--text); }

.error { color: var(--danger); font-size: 13px; margin-top: 8px; min-height: 16px; }

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 32px;
  border-bottom: 1px solid var(--border);
}
header h1 { font-size: 18px; margin: 0; }
.header-actions { display: flex; gap: 4px; }

#dashboard-view { max-width: 960px; margin: 0 auto; padding: 24px 32px; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 24px;
  margin-bottom: 20px;
}
.card h2 { margin: 0 0 12px; font-size: 15px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.card-header h2 { margin: 0; }

#server-info { font-family: ui-monospace, monospace; font-size: 13px; line-height: 1.8; color: var(--text); }
#server-info span.label { color: var(--muted); display: inline-block; width: 110px; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 8px; font-size: 13px; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 500; }
td.actions { text-align: right; white-space: nowrap; }
td.actions button { margin-left: 6px; padding: 6px 10px; font-size: 12px; }

.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); margin-right: 6px; }
.status-dot.online { background: var(--online); box-shadow: 0 0 6px var(--online); }

.modal {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex; align-items: center; justify-content: center;
  z-index: 10;
}
.modal-content {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px;
  width: 380px;
  max-width: 90vw;
}
.modal-content h2 { margin-top: 0; font-size: 16px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.modal-actions button { flex: none; }

label { font-size: 12px; color: var(--muted); display: block; margin-bottom: 4px; }

#device-result-qr { display: block; margin: 0 auto 16px; width: 220px; height: 220px; background: white; border-radius: 8px; padding: 8px; }
#device-result-config { font-family: ui-monospace, monospace; font-size: 11px; margin-bottom: 12px; }

.btn-danger { background: var(--danger); }
.btn-danger:hover { background: #c9393e; }

.hint { color: var(--muted); font-size: 12px; line-height: 1.5; margin: -4px 0 12px; }
.hint code { background: #0f1420; padding: 2px 6px; border-radius: 4px; font-size: 11px; word-break: break-all; }

#twofa-qr { display: block; margin: 0 auto 16px; width: 200px; height: 200px; background: white; border-radius: 8px; padding: 8px; }
