:root {
  color-scheme: light;
  --bg: #f4f7fb;
  --card: #ffffff;
  --text: #142033;
  --muted: #667085;
  --border: #dbe3ee;
  --primary: #155eef;
  --primary-hover: #004eeb;
  --danger: #c4320a;
  --danger-hover: #a82a08;
  --success: #067647;
  --success-bg: #ecfdf3;
  --warning-bg: #fff7ed;
  --shadow: 0 18px 50px rgba(20, 32, 51, 0.10);
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

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

button, input { font: inherit; }

.page-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 18px;
}

.support-card {
  width: min(100%, 620px);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow);
  padding: 36px;
  text-align: center;
}

.brand-mark {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  margin: 0 auto 18px;
  border-radius: 16px;
  background: var(--primary);
  color: white;
  font-weight: 800;
  font-size: 24px;
  letter-spacing: -1px;
}

h1, h2 { margin-top: 0; }
h1 { margin-bottom: 12px; font-size: clamp(28px, 5vw, 38px); }
h2 { margin-bottom: 10px; font-size: 22px; }
.lead { color: var(--muted); line-height: 1.6; margin: 0 auto 28px; max-width: 500px; }
.panel { margin-top: 22px; }
.hidden { display: none !important; }

.button {
  border: 0;
  border-radius: 10px;
  padding: 12px 18px;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s ease, transform .05s ease;
}
.button:active { transform: translateY(1px); }
.button:disabled { opacity: .55; cursor: not-allowed; }
.button-large { padding: 15px 24px; font-size: 17px; }
.button-primary { background: var(--primary); color: white; }
.button-primary:hover:not(:disabled) { background: var(--primary-hover); }
.button-secondary { background: #eef2f6; color: var(--text); }
.button-secondary:hover:not(:disabled) { background: #e4e9f0; }
.button-danger { background: var(--danger); color: white; }
.button-danger:hover:not(:disabled) { background: var(--danger-hover); }

.helper { color: var(--muted); font-size: 14px; line-height: 1.5; margin: 14px 0 0; }
.eyebrow { margin: 0 0 8px; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; font-size: 12px; font-weight: 800; }
.session-code { font-size: clamp(42px, 10vw, 64px); letter-spacing: .13em; font-weight: 800; margin: 10px 0 18px; font-variant-numeric: tabular-nums; }
.status-line { display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--muted); line-height: 1.4; }
.status-dot { width: 10px; height: 10px; border-radius: 999px; background: var(--success); box-shadow: 0 0 0 5px rgba(6,118,71,.10); flex: 0 0 auto; }

.request-box {
  background: var(--warning-bg);
  border: 1px solid #fed7aa;
  border-radius: 14px;
  padding: 22px;
  text-align: left;
}
.request-box p { line-height: 1.55; }
.important { color: #7c2d12; }
.button-row { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; margin-top: 18px; }
.button-row.compact { margin-top: 0; }
.active-badge { display: inline-flex; align-items: center; border-radius: 999px; padding: 7px 11px; background: var(--success-bg); color: var(--success); font-weight: 800; font-size: 13px; }

.client-name-field {
  display: grid;
  gap: 7px;
  max-width: 420px;
  margin: 0 auto 16px;
  text-align: left;
}
.client-name-field label { font-size: 13px; font-weight: 700; }
.client-name-field input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 13px 14px;
  outline: none;
  background: white;
  color: var(--text);
}
.client-name-field input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(21,94,239,.12); }
.active-technician { margin: 14px 0 4px; font-weight: 800; }

.error-box { margin-top: 20px; background: #fff1f0; color: #b42318; border: 1px solid #fecdca; border-radius: 10px; padding: 12px 14px; text-align: left; line-height: 1.45; }

.admin-body { min-height: 100vh; }
.admin-shell { width: min(100%, 1500px); margin: 0 auto; padding: 24px; }
.admin-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.admin-header h1 { margin: 0; font-size: 30px; }
.server-status { font-size: 13px; color: var(--muted); }
.admin-connect { display: grid; grid-template-columns: minmax(190px, 1fr) minmax(190px, 1fr) auto; gap: 14px; align-items: end; background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 18px; }
.admin-connect .helper { grid-column: 1 / -1; margin-top: 0; }
.field-group { display: grid; gap: 7px; }
.field-group label { font-size: 13px; font-weight: 700; }
.field-group input { width: 100%; border: 1px solid var(--border); border-radius: 9px; padding: 11px 12px; outline: none; background: white; color: var(--text); }
.field-group input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(21,94,239,.12); }
.code-input { letter-spacing: .12em; font-weight: 800; font-variant-numeric: tabular-nums; }
.viewer-panel { margin-top: 18px; }
.viewer-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 12px; }
.viewer-code { margin-left: 10px; font-weight: 800; letter-spacing: .08em; }
.video-stage { position: relative; background: #111827; border-radius: 12px; overflow: hidden; min-height: 420px; display: grid; place-items: center; }
.video-stage video { width: 100%; height: auto; max-height: calc(100vh - 230px); display: block; object-fit: contain; background: #111827; }
.video-placeholder { position: absolute; inset: 0; display: grid; place-items: center; padding: 24px; text-align: center; color: #cbd5e1; }

@media (max-width: 760px) {
  .support-card { padding: 26px 20px; }
  .admin-shell { padding: 16px; }
  .admin-header, .viewer-toolbar { align-items: stretch; flex-direction: column; }
  .admin-connect { grid-template-columns: 1fr; }
  .button-row.compact { width: 100%; }
  .button-row.compact .button { flex: 1; }
  .video-stage { min-height: 260px; }
}

/* ===== Consola técnica V1.1 ===== */
.panel-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
}
.no-top { margin-top: 0; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.admin-header-status { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.identity-badge, .count-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 6px 10px;
  background: #eef4ff;
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
}
.admin-login {
  width: min(100%, 760px);
  margin: 64px auto 0;
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr auto;
  gap: 14px;
  align-items: end;
}
.admin-login h2 { margin-bottom: 6px; }
.admin-dashboard-grid {
  display: grid;
  grid-template-columns: minmax(420px, 1.5fr) minmax(250px, .75fr) minmax(320px, 1fr);
  gap: 16px;
  align-items: start;
}
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.section-heading h2 { margin: 0; font-size: 20px; }
.manual-connect {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: end;
  padding-bottom: 16px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.queue-list { display: grid; gap: 9px; margin-top: 12px; }
.queue-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: #fbfcfe;
}
.queue-item-main { min-width: 0; }
.queue-code { font-weight: 850; font-size: 20px; letter-spacing: .04em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.queue-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 4px; }
.queue-status, .queue-wait { font-size: 12px; color: var(--muted); }
.queue-status { font-weight: 750; }
.status-waiting { color: var(--success); }
.status-requested, .status-accepted { color: #b54708; }
.status-sharing { color: var(--primary); }
.queue-action { flex: 0 0 auto; }
.empty-state { padding: 24px 14px; text-align: center; color: var(--muted); border: 1px dashed var(--border); border-radius: 11px; }
.compact-empty { padding: 14px 10px; }
.technician-list { display: grid; gap: 8px; }
.technician-row { display: grid; gap: 4px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.technician-row:last-child { border-bottom: 0; }
.technician-identity { display: flex; align-items: center; gap: 8px; min-width: 0; }
.presence-dot { width: 8px; height: 8px; border-radius: 999px; background: var(--success); box-shadow: 0 0 0 4px rgba(6,118,71,.10); }
.technician-name { font-weight: 750; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.technician-state { font-size: 12px; color: var(--success); padding-left: 16px; }
.technician-state.busy { color: #b54708; }
.chat-card { min-width: 0; }
.chat-messages {
  height: 330px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: #fbfcfe;
  padding: 10px;
}
.chat-message { padding: 9px 8px; border-bottom: 1px solid #edf1f6; }
.chat-message:last-child { border-bottom: 0; }
.chat-message-header { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 3px; }
.chat-message-header strong { font-size: 13px; }
.chat-message-header span { color: var(--muted); font-size: 11px; }
.chat-message-text { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.45; font-size: 14px; }
.chat-compose { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-top: 10px; }
.chat-compose input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 11px 12px;
  outline: none;
}
.chat-compose input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(21,94,239,.12); }
.viewer-toolbar.panel-card { margin-bottom: 12px; }

@media (max-width: 1180px) {
  .admin-dashboard-grid { grid-template-columns: minmax(420px, 1.5fr) minmax(280px, 1fr); }
  .chat-card { grid-column: 1 / -1; }
  .chat-messages { height: 240px; }
}

@media (max-width: 820px) {
  .admin-login { grid-template-columns: 1fr; margin-top: 24px; }
  .admin-dashboard-grid { grid-template-columns: 1fr; }
  .chat-card { grid-column: auto; }
  .manual-connect { grid-template-columns: 1fr; }
  .admin-header-status { justify-content: flex-start; }
}


/* ===== Control remoto V2.0 ===== */
.control-badge {
  display: inline-flex;
  align-items: center;
  margin-left: 10px;
  border-radius: 999px;
  padding: 6px 10px;
  background: #f2f4f7;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}
.control-badge.waiting { background: #fff6e5; color: #9a6700; }
.control-badge.ready { background: #ecfdf3; color: #067647; }
.control-badge.active { background: #eaf2ff; color: var(--primary); }
.queue-control { font-size: 12px; font-weight: 700; color: #9a6700; }
.queue-control.ready { color: #067647; }
.video-stage video.remote-control-active { cursor: crosshair; outline: none; }
.video-stage video.remote-control-active:focus { box-shadow: inset 0 0 0 3px rgba(21,94,239,.6); }
.remote-control-bar {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  gap: 10px;
  align-items: end;
  margin-top: 12px;
}
.remote-text-field input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 11px 12px;
  outline: none;
}
.control-helper { margin-top: 6px; }
@media (max-width: 760px) {
  .remote-control-bar { grid-template-columns: 1fr; }
  .control-badge { margin-left: 0; margin-top: 8px; }
}
.client-control-status { font-weight: 750; color: #9a6700; }
.client-control-status.enabled { color: #067647; }


/* ===== Integración de agente V2.1 ===== */
.control-launcher {
  margin: 18px auto 20px;
  max-width: 500px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #f8fafc;
  text-align: left;
}
.control-launcher-title {
  margin: 0 0 7px;
  font-weight: 800;
  text-align: center;
}
.os-control-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 16px;
}
.os-control-button {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 12px;
  background: white;
  color: var(--text);
  cursor: pointer;
  display: grid;
  gap: 4px;
  text-align: left;
  transition: border-color .15s ease, background .15s ease, transform .05s ease;
}
.os-control-button:hover:not(:disabled) {
  border-color: var(--primary);
  background: #f7f9ff;
}
.os-control-button:active:not(:disabled) { transform: translateY(1px); }
.os-control-button:disabled { opacity: .55; cursor: not-allowed; }
.windows-control { border-color: #b9ccf9; }
.os-control-name { font-weight: 850; font-size: 16px; }
.os-control-action { color: var(--muted); font-size: 13px; }
.control-launch-help { text-align: center; }
.download-link {
  display: block;
  margin-top: 9px;
  color: var(--primary);
  text-align: center;
  font-size: 14px;
  font-weight: 750;
  text-decoration: none;
}
.download-link:hover { text-decoration: underline; }

@media (max-width: 520px) {
  .os-control-grid { grid-template-columns: 1fr; }
}

.os-control-button {
  text-decoration: none;
}
.os-control-button.is-disabled {
  opacity: .55;
  cursor: not-allowed;
  pointer-events: auto;
}


/* ===== V2.2 · chat de cliente, multimedia y portapapeles ===== */
.viewer-content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 14px;
  align-items: start;
}
.compact-panel { padding: 16px; }
.compact-heading { margin-bottom: 10px; }
.compact-heading h3, .compact-heading h2 { margin: 0; }
.session-chat-card { position: sticky; top: 12px; }
.session-chat-messages { min-height: 280px; max-height: 430px; }
.client-session-chat-messages { min-height: 180px; max-height: 300px; }
.session-chat-compose { margin-top: 10px; }
.client-chat-panel { margin-top: 16px; text-align: left; }

.media-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 10px;
}
.media-button {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  border-radius: 10px;
  padding: 9px 10px;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.media-button:hover:not(:disabled) { border-color: var(--primary); }
.media-button.active { border-color: #16a34a; background: #f0fdf4; color: #166534; }
.media-button.subtle { font-weight: 650; color: var(--muted); }
.media-button:disabled { opacity: .5; cursor: not-allowed; }
.media-status { font-size: 12px; color: var(--muted); margin: 0 0 10px; }
.media-request {
  border: 1px solid #b9ccf9;
  background: #f7f9ff;
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 12px;
  display: grid;
  gap: 10px;
}
.client-media-layout { display: grid; gap: 10px; }
.client-media-controls { grid-template-columns: 1fr 1fr; }

.camera-tile {
  position: absolute;
  right: 12px;
  bottom: 12px;
  width: min(220px, 30%);
  aspect-ratio: 4 / 3;
  border-radius: 12px;
  overflow: hidden;
  background: #111827;
  border: 2px solid rgba(255,255,255,.85);
  box-shadow: 0 8px 24px rgba(0,0,0,.25);
  z-index: 4;
}
.camera-tile video { width: 100%; height: 100%; object-fit: cover; display: block; }
.camera-tile span {
  position: absolute;
  left: 7px;
  bottom: 6px;
  padding: 3px 6px;
  border-radius: 6px;
  background: rgba(0,0,0,.6);
  color: white;
  font-size: 11px;
}
.chat-camera-tile {
  position: relative;
  right: auto;
  bottom: auto;
  width: min(260px, 100%);
  margin: 0 auto 8px;
  box-shadow: none;
}

.clipboard-panel { margin-top: 12px; }
.clipboard-panel textarea {
  width: 100%;
  min-height: 88px;
  resize: vertical;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  font: inherit;
  box-sizing: border-box;
}
.clipboard-actions { margin-top: 9px; flex-wrap: wrap; }
.no-bottom { margin-bottom: 0; }

@media (max-width: 980px) {
  .viewer-content-grid { grid-template-columns: 1fr; }
  .session-chat-card { position: static; }
}
@media (max-width: 560px) {
  .media-controls, .client-media-controls { grid-template-columns: 1fr; }
  .camera-tile { width: 42%; }
}


/* ===== Transferencia de archivos V2.2.1 ===== */
.file-transfer-panel { margin-top: 14px; }
.file-transfer-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.file-transfer-row input[type="file"] { flex: 1 1 260px; min-width: 0; }
.transfer-limit { color: var(--muted); font-size: 12px; }
.transfer-progress-wrap { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.transfer-progress-track { flex: 1; height: 9px; background: #e5e7eb; border-radius: 999px; overflow: hidden; }
.transfer-progress-bar { width: 0; height: 100%; background: #2563eb; transition: width .12s linear; }
#fileTransferPercent { min-width: 42px; text-align: right; font-variant-numeric: tabular-nums; font-size: 13px; }
.incoming-file-box { margin-top: 12px; padding: 12px; border: 1px solid var(--border); border-radius: 10px; background: #f8fafc; display: grid; gap: 7px; }
.incoming-file-box .button { width: fit-content; }


/* ===== V2.2.2 · chat previo y cierre de solicitudes ===== */
.queue-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex: 0 0 auto;
  flex-wrap: wrap;
}
.queue-chat-owner {
  font-size: 12px;
  font-weight: 750;
  color: var(--primary);
}
.button-compact {
  padding-left: 13px;
  padding-right: 13px;
}
.prechat-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(15, 23, 42, .46);
  backdrop-filter: blur(2px);
}
.prechat-modal.hidden {
  display: none;
}
.prechat-dialog {
  width: min(680px, 100%);
  max-height: min(760px, calc(100vh - 40px));
  overflow: auto;
  box-shadow: 0 24px 70px rgba(15, 23, 42, .22);
}
.prechat-messages {
  height: min(380px, 45vh);
}
.prechat-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
}
.icon-close-button {
  width: 38px;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  color: var(--muted);
  font-size: 25px;
  line-height: 1;
  cursor: pointer;
}
.icon-close-button:hover {
  color: var(--text);
  border-color: #aab5c4;
}
body.modal-open {
  overflow: hidden;
}

@media (max-width: 760px) {
  .queue-item {
    align-items: flex-start;
    flex-direction: column;
  }
  .queue-actions {
    width: 100%;
    justify-content: stretch;
  }
  .queue-actions .button {
    flex: 1 1 auto;
  }
}


/* ===== V2.2.3 · identidad y avisos del cliente ===== */

.brand-logo {
  display: block;
  width: 118px;
  max-width: 34vw;
  height: auto;
  margin: 0 auto 14px;
  object-fit: contain;
}

.unread-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  min-height: 24px;
  padding: 3px 9px;
  margin-left: 7px;
  border-radius: 999px;
  background: #dc2626;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.client-toast {
  position: fixed;
  z-index: 10000;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  width: min(calc(100vw - 28px), 560px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 15px 16px;
  border: 1px solid #b9ccf9;
  border-radius: 14px;
  background: rgba(255, 255, 255, .98);
  box-shadow: 0 16px 50px rgba(20, 32, 51, .22);
  text-align: left;
  animation: clientToastIn .22s ease-out;
}

.client-toast-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.client-toast-copy strong {
  color: var(--text);
  font-size: 15px;
}

.client-toast-copy span {
  color: var(--muted);
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.client-toast-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
}

.client-toast-action,
.client-toast-close {
  border: 0;
  border-radius: 9px;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
}

.client-toast-action {
  padding: 9px 12px;
  background: var(--primary);
  color: #fff;
}

.client-toast-action:hover {
  background: var(--primary-hover);
}

.client-toast-close {
  width: 36px;
  height: 36px;
  padding: 0;
  background: #eef2f6;
  color: var(--text);
  font-size: 22px;
  line-height: 1;
}

.client-chat-panel.client-attention-pulse,
.media-request.client-attention-pulse {
  animation: clientAttentionPulse 2.4s ease-out;
}

.media-request:not(.hidden) {
  border-width: 2px;
  border-color: #2563eb;
  background: #eff6ff;
  box-shadow: 0 8px 28px rgba(37, 99, 235, .14);
}

@keyframes clientToastIn {
  from { opacity: 0; transform: translate(-50%, -12px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

@keyframes clientAttentionPulse {
  0%   { box-shadow: 0 0 0 0 rgba(21, 94, 239, .38); }
  30%  { box-shadow: 0 0 0 10px rgba(21, 94, 239, .10); }
  65%  { box-shadow: 0 0 0 5px rgba(21, 94, 239, .06); }
  100% { box-shadow: 0 0 0 0 rgba(21, 94, 239, 0); }
}

@media (max-width: 600px) {
  .brand-logo {
    width: 98px;
  }

  .client-toast {
    top: 10px;
    align-items: flex-start;
    gap: 10px;
  }

  .client-toast-actions {
    flex-direction: column-reverse;
  }
}

/* ===== V2.2.4 · soporte no disponible ===== */
.service-unavailable-panel {
  max-width: 510px;
  margin-left: auto;
  margin-right: auto;
  padding: 24px;
  border: 1px solid #fed7aa;
  border-radius: 16px;
  background: #fffaf5;
  text-align: center;
}
.service-unavailable-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 13px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #fff1e8;
  color: #c4320a;
  font-size: 26px;
  font-weight: 900;
}
.service-unavailable-panel h2 { margin-bottom: 14px; color: var(--text); }
.service-unavailable-text { margin: 9px 0; color: var(--muted); line-height: 1.6; }
.service-unavailable-text strong { color: var(--text); }
.service-email-link { color: var(--primary); font-weight: 800; text-decoration: none; white-space: nowrap; }
.service-email-link:hover { text-decoration: underline; }
.service-apology { margin: 15px 0 18px; color: #7c2d12; font-weight: 700; }


/* ===== V2.4.0 · inventario multimonitor, fase 1 ===== */
.monitor-panel {
  margin-top: 12px;
}

.monitor-count-badge {
  display: inline-flex;
  min-width: 27px;
  height: 27px;
  align-items: center;
  justify-content: center;
  margin-left: 6px;
  border-radius: 999px;
  background: #edf2ff;
  color: #2c3ead;
  font-size: 13px;
  font-weight: 850;
  vertical-align: middle;
}

.monitor-desktop-map {
  position: relative;
  min-height: 190px;
  margin: 10px 0 14px;
  padding: 12px;
  border: 1px dashed #c8d2e5;
  border-radius: 14px;
  background:
    linear-gradient(#f7f9fc 1px, transparent 1px),
    linear-gradient(90deg, #f7f9fc 1px, transparent 1px),
    #fbfcfe;
  background-size: 24px 24px;
  overflow: hidden;
}

.monitor-map-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  color: var(--muted);
  text-align: center;
}

.monitor-map-screen {
  position: absolute;
  min-width: 70px;
  min-height: 48px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 2px;
  border: 2px solid #8190b7;
  border-radius: 8px;
  background: rgba(239, 243, 255, .92);
  box-shadow: 0 5px 16px rgba(31, 48, 90, .12);
  color: #243354;
  overflow: hidden;
}

.monitor-map-screen.primary {
  border-color: #2c3ead;
  background: rgba(226, 233, 255, .96);
}

.monitor-map-screen strong {
  font-size: 12px;
}

.monitor-map-screen span,
.monitor-map-screen em {
  font-size: 10px;
  font-style: normal;
}

.monitor-map-screen em {
  padding: 1px 5px;
  border-radius: 999px;
  background: #2c3ead;
  color: white;
}

.monitor-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 9px;
  margin-bottom: 10px;
}

.monitor-info-card {
  padding: 11px 12px;
  border: 1px solid #dbe2ee;
  border-radius: 11px;
  background: #fff;
}

.monitor-info-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
}

.monitor-info-heading strong {
  color: var(--text);
  font-size: 14px;
}

.monitor-info-badges {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.monitor-primary-badge,
.monitor-resolution-badge,
.queue-monitor-count {
  display: inline-flex;
  align-items: center;
  min-height: 21px;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
}

.monitor-primary-badge {
  background: #e8ecff;
  color: #2c3ead;
}

.monitor-resolution-badge {
  background: #eef2f6;
  color: #526175;
}

.monitor-info-details {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.queue-monitor-count {
  background: #edf2ff;
  color: #2c3ead;
}

@media (max-width: 650px) {
  .monitor-desktop-map {
    min-height: 150px;
  }

  .monitor-list {
    grid-template-columns: 1fr;
  }
}


/* ===== V2.4.2 · Multimonitor fase 2 ===== */
.monitor-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 10px 0 12px;
}

.monitor-tab {
  border: 1px solid #ccd5e6;
  border-radius: 999px;
  padding: 8px 13px;
  background: #fff;
  color: #43516a;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.monitor-tab:hover {
  border-color: #7f90ba;
  background: #f7f9ff;
}

.monitor-tab.active {
  border-color: #2c3ead;
  background: #2c3ead;
  color: #fff;
}

.monitor-stream-grid {
  display: grid;
  gap: 11px;
  width: 100%;
  min-height: 230px;
}

.monitor-stream-grid.mode-all {
  grid-template-columns: repeat(auto-fit, minmax(330px, 1fr));
}

.monitor-stream-grid.mode-single {
  grid-template-columns: 1fr;
}

.monitor-stream-empty {
  min-height: 230px;
  display: grid;
  place-items: center;
  padding: 28px;
  border: 1px dashed #cbd4e5;
  border-radius: 14px;
  background: #f8fafc;
  color: var(--muted);
  text-align: center;
}

.monitor-stream-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid #d8dfeb;
  border-radius: 14px;
  background: #111827;
  box-shadow: 0 7px 22px rgba(26, 39, 67, .10);
}

.monitor-stream-card-header {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 11px;
  background: #fff;
  border-bottom: 1px solid #d8dfeb;
}

.monitor-stream-card-header > div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.monitor-stream-card-header strong {
  color: var(--text);
  font-size: 13px;
}

.monitor-stream-card-header span {
  max-width: 100%;
  color: var(--muted);
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.monitor-popout-button {
  flex: 0 0 auto;
  border: 0;
  border-radius: 8px;
  padding: 7px 9px;
  background: #edf2ff;
  color: #2c3ead;
  font: inherit;
  font-size: 11px;
  font-weight: 850;
  cursor: pointer;
}

.monitor-frame-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #111827;
}

.monitor-frame-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #111827;
}

.monitor-frame-image:not([src]) {
  display: none;
}

.monitor-frame-waiting {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  color: #c7d0df;
  text-align: center;
}

.mode-single .monitor-stream-card {
  max-height: min(72vh, 820px);
}

.mode-single .monitor-frame-wrap {
  aspect-ratio: auto;
  min-height: 480px;
  height: min(70vh, 760px);
}

.monitor-view-status {
  margin-top: 10px;
}

.monitor-details {
  margin-top: 12px;
  border-top: 1px solid #e2e7ef;
  padding-top: 10px;
}

.monitor-details summary {
  cursor: pointer;
  color: #526175;
  font-size: 13px;
  font-weight: 750;
}

.monitor-popout-body {
  margin: 0;
  min-height: 100vh;
  background: #0b1020;
  color: white;
  overflow: hidden;
}

.monitor-popout-shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr;
}

.monitor-popout-header {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 9px 14px;
  background: #fff;
  color: #172233;
  border-bottom: 1px solid #d8dfeb;
}

.monitor-popout-header > div {
  display: grid;
  gap: 2px;
}

.monitor-popout-header strong {
  font-size: 15px;
}

.monitor-popout-header span:not(.active-badge) {
  color: #68778c;
  font-size: 12px;
}

.monitor-popout-stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 0;
  background: #0b1020;
}

.monitor-popout-stage img {
  max-width: 100%;
  max-height: calc(100vh - 58px);
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.monitor-popout-stage img:not([src]) {
  display: none;
}

@media (max-width: 780px) {
  .monitor-stream-grid.mode-all {
    grid-template-columns: 1fr;
  }

  .mode-single .monitor-frame-wrap {
    min-height: 300px;
  }
}


/* ===== V2.4.3 · control directo multimonitor ===== */
.monitor-frame-wrap {
  outline: none;
}

.monitor-frame-wrap.native-control-active,
.monitor-popout-stage.native-control-active {
  cursor: crosshair;
  box-shadow: inset 0 0 0 3px rgba(44, 62, 173, .9);
}

.monitor-frame-wrap.native-control-active:focus,
.monitor-popout-stage.native-control-active:focus {
  box-shadow:
    inset 0 0 0 3px rgba(44, 62, 173, 1),
    0 0 0 3px rgba(44, 62, 173, .18);
}

.monitor-popout-badges {
  display: flex;
  align-items: center;
  gap: 8px;
}

.monitor-popout-stage {
  outline: none;
}
