* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: #0f1115;
  color: #e8e8e8;
}

.view { min-height: 100vh; }
/* !important a propósito: .hidden es una clase de utilidad que debe ganarle
   SIEMPRE a cualquier otra regla de display (como #viewLogin { display:
   flex }), sin importar especificidad de selector. Sin esto, un ID con su
   propio display puede quedar visible aunque se le agregue "hidden". */
.hidden { display: none !important; }

/* Login */
#viewLogin {
  display: flex;
  align-items: center;
  justify-content: center;
}
.card {
  background: #1a1d24;
  padding: 40px;
  border-radius: 12px;
  width: 320px;
  text-align: center;
}
.card h1 { margin: 0 0 4px; font-size: 22px; }
.subtitle { color: #999; margin: 0 0 24px; font-size: 14px; }
.card input {
  width: 100%;
  padding: 12px;
  margin-bottom: 12px;
  border-radius: 8px;
  border: 1px solid #333;
  background: #0f1115;
  color: #e8e8e8;
  font-size: 16px;
}
.card button, .toolbar button, .controlsBar button {
  padding: 12px 20px;
  border: none;
  border-radius: 8px;
  background: #3b82f6;
  color: white;
  font-size: 15px;
  cursor: pointer;
}
.card button:hover, .toolbar button:hover { background: #2563eb; }
.error { color: #f87171; font-size: 13px; min-height: 18px; margin-top: 8px; }
.downloadLink {
  display: block;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid #2a2e38;
  color: #93c5fd;
  text-decoration: none;
  font-size: 13px;
}
.downloadLink:hover { color: #bfdbfe; text-decoration: underline; }

/* Topbar común */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: #1a1d24;
}
.topbar h1 { margin: 0; font-size: 18px; }
button.secondary {
  background: #2a2e38;
  color: #e8e8e8;
}

/* Lista de equipos */
.toolbar {
  display: flex;
  gap: 8px;
  padding: 16px 24px;
}
.toolbar input {
  flex: 1;
  max-width: 220px;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #333;
  background: #0f1115;
  color: #e8e8e8;
  font-size: 16px;
}
table {
  width: 100%;
  border-collapse: collapse;
  padding: 0 24px;
}
#devicesTable { margin: 0 24px; width: calc(100% - 48px); }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid #2a2e38; }
th { color: #999; font-size: 13px; text-transform: uppercase; }
.badge { padding: 3px 10px; border-radius: 12px; font-size: 12px; }
.badge.online { background: #14532d; color: #4ade80; }
.badge.offline { background: #3f1d1d; color: #f87171; }
.hint { color: #777; font-size: 13px; padding: 0 24px; }
input.nameInput {
  background: transparent;
  border: none;
  color: #e8e8e8;
  border-bottom: 1px dashed #444;
  font-size: 14px;
  width: 140px;
}

/* Sesión */
.status { font-size: 13px; color: #999; }
.videoWrap {
  display: flex;
  justify-content: center;
  align-items: center;
  background: #000;
  height: calc(100vh - 128px);
}
#remoteVideo { max-width: 100%; max-height: 100%; }
.controlsBar {
  display: flex;
  gap: 8px;
  padding: 12px 24px;
  background: #1a1d24;
}
.controlsBar button { flex: 1; background: #2a2e38; }
.controlsBar button:hover { background: #343945; }
