* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  box-shadow: none !important;
  text-shadow: none !important;
  border-radius: 0 !important;
}

html, body {
  width: 100%;
  height: 100%;
  background: #000000;
  color: #ffffff;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
}

.hidden {
  display: none !important;
}

/* LOGIN */
.overlay {
  position: fixed;
  inset: 0;
  background: #000000;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
}

.login-card {
  background: #000000;
  border: 1px solid #ffffff;
  padding: 24px;
  width: 100%;
  max-width: 340px;
}

.login-card h1 {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 1px;
  margin-bottom: 18px;
  border-bottom: 1px solid #ffffff;
  padding-bottom: 8px;
}

.field {
  margin-bottom: 14px;
}

.field label {
  display: block;
  font-size: 11px;
  margin-bottom: 6px;
}

input[type="text"],
input[type="password"],
select {
  background: #000000;
  border: 1px solid #ffffff;
  color: #ffffff;
  padding: 6px 8px;
  font-family: inherit;
  font-size: 12px;
  outline: none;
  border-radius: 0;
}

.field input {
  width: 100%;
}

.btn-primary {
  background: #ffffff;
  color: #000000;
  border: 1px solid #ffffff;
  padding: 6px 12px;
  font-family: inherit;
  font-weight: 700;
  font-size: 11px;
  cursor: pointer;
}

.btn-primary:hover {
  background: #000000;
  color: #ffffff;
}

.full-width {
  width: 100%;
}

.error-banner {
  border: 1px solid #ffffff;
  padding: 6px 8px;
  font-size: 11px;
  margin-bottom: 12px;
}

/* APP LAYOUT */
#app-container {
  display: flex;
  flex-direction: column;
  width: 100vw;
  height: 100vh;
}

.hud-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
  background: #000000;
  border-bottom: 1px solid #ffffff;
  padding: 4px 8px;
  z-index: 20;
}

.hud-left, .hud-center, .hud-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.status-pill {
  border: 1px solid #ffffff;
  background: #ffffff;
  color: #000000;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
}

.status-pill.offline {
  background: #000000;
  color: #ffffff;
}

.metrics-text {
  font-size: 11px;
  color: #ffffff;
}

.hud-bar select {
  padding: 3px 6px;
  font-size: 11px;
}

.hud-btn, .k-btn, .btn-action {
  background: #000000;
  color: #ffffff;
  border: 1px solid #ffffff;
  padding: 4px 8px;
  font-family: inherit;
  font-size: 11px;
  cursor: pointer;
  white-space: nowrap;
}

.hud-btn:hover, .k-btn:hover, .btn-action:hover,
.hud-btn.active, .k-btn:active, .k-btn.latched {
  background: #ffffff;
  color: #000000;
}

/* VIEWPORT */
.viewport {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000000;
  overflow: hidden;
  touch-action: none;
}

#screen-canvas {
  display: block;
  cursor: default;
  outline: none;
  border: 1px solid #ffffff;
}

#screen-canvas.hide-local-cursor {
  cursor: none !important;
}

/* KEY DRAWER */
.key-drawer {
  background: #000000;
  border-top: 1px solid #ffffff;
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 25;
}

.key-row {
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
}

.divider {
  width: 1px;
  height: 16px;
  background: #ffffff;
  margin: 0 2px;
}

.text-send-row {
  display: flex;
  gap: 6px;
}

.text-send-row input {
  flex: 1;
}

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

.modal-box {
  background: #000000;
  border: 1px solid #ffffff;
  width: 100%;
  max-width: 580px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid #ffffff;
}

.modal-header h2 {
  font-size: 12px;
  font-weight: 700;
}

.close-btn {
  background: #000000;
  border: 1px solid #ffffff;
  color: #ffffff;
  padding: 2px 6px;
  font-family: inherit;
  font-size: 10px;
  cursor: pointer;
}

.close-btn:hover {
  background: #ffffff;
  color: #000000;
}

.modal-body {
  padding: 14px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
}

.stat-card, .settings-section {
  border: 1px solid #ffffff;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.stat-title, .settings-section h3 {
  font-size: 11px;
  font-weight: 700;
}

.stat-value {
  font-size: 12px;
  font-weight: 700;
}

.stat-sub {
  font-size: 11px;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  cursor: pointer;
}

.inline-field, .form-row, .action-buttons {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.endpoints-box {
  border: 1px solid #ffffff;
  padding: 8px;
  font-size: 11px;
  line-height: 1.6;
  user-select: text;
  -webkit-user-select: text;
}

.endpoints-box a {
  color: #ffffff;
  text-decoration: underline;
}

.twofa-box {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.qr-img {
  width: 120px;
  height: 120px;
  background: #ffffff;
  padding: 4px;
  border: 1px solid #ffffff;
}

.twofa-controls {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 11px;
}

.toast-msg {
  border: 1px solid #ffffff;
  padding: 6px 8px;
  font-size: 11px;
}
