/* 08.09.2026 — НЕ УДАЛЯТЬ по требованию владельца системы.
   Shared tokens for viewer + Windows/web agent.
   CROSS-REF: /opt/medintegra_remote, platform-contracts/06-integrations/ops-tools/remote-desktop.md */
:root {
  --bg: #f4f7fb; --card: #fff; --text: #0f172a; --muted: #64748b;
  --brand: #0f766e; --brand-soft: #ccfbf1; --line: #e2e8f0;
  --ok: #065f46; --ok-soft: #ecfdf5;
  --wait: #9a3412; --wait-soft: #ffedd5;
  --err: #991b1b; --err-soft: #fee2e2;
  --info: #1e3a8a; --info-soft: #dbeafe;
}
* { box-sizing: border-box; }
html, body, #root { height: 100%; margin: 0; }
body {
  font-family: "Segoe UI", system-ui, sans-serif;
  background: var(--bg); color: var(--text); line-height: 1.45;
}
#root { display: flex; flex-direction: column; min-height: 0; }
.shell { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.top {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 20px; border-bottom: 1px solid var(--line); background: #fff;
}
h1 { font-size: 1.15rem; font-weight: 800; margin: 0; }
h2 { font-size: 1rem; margin: 0; }
.sub { color: var(--muted); font-size: 0.9rem; margin: 0; }
.eyebrow {
  display: inline-block; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--brand); background: var(--brand-soft);
  padding: 3px 8px; border-radius: 999px;
}
.work { flex: 1; min-height: 0; display: flex; gap: 0; overflow: hidden; }
.side {
  width: 320px; min-width: 280px; border-right: 1px solid var(--line);
  display: flex; flex-direction: column; min-height: 0; background: #fff;
}
.side-scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.stage {
  flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden;
  background: #0b1220;
}
.stage-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 10px 14px; background: #111827; color: #e5e7eb; border-bottom: 1px solid #1f2937;
}
.stage-body { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; overflow: hidden; position: relative; }
video, canvas { max-width: 100%; max-height: 100%; background: #000; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
input, select {
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
  font: inherit; width: 100%;
}
input.mono { font-family: ui-monospace, Menlo, Consolas, monospace; letter-spacing: 0.12em; font-weight: 700; }
.cta {
  border: 0; cursor: pointer; font: inherit; font-weight: 700;
  background: var(--brand); color: #fff; padding: 10px 14px; border-radius: 12px;
}
.cta.secondary { background: #fff; color: var(--brand); border: 2px solid var(--brand); }
.cta.danger { background: #991b1b; }
.cta:disabled { opacity: 0.45; cursor: not-allowed; }
.ok { background: var(--ok-soft); color: var(--ok); border: 1px solid #a7f3d0; border-radius: 12px; padding: 8px 10px; }
.warn { background: var(--wait-soft); color: var(--wait); border: 1px solid #fdba74; border-radius: 12px; padding: 8px 10px; }
.danger { background: var(--err-soft); color: var(--err); border: 1px solid #fecaca; border-radius: 12px; padding: 8px 10px; }
.info { background: var(--info-soft); color: var(--info); border: 1px solid #bfdbfe; border-radius: 12px; padding: 8px 10px; }
.muted { color: var(--muted); font-size: 0.88rem; }
.device { padding: 10px; border: 1px solid var(--line); border-radius: 12px; display: flex; flex-direction: column; gap: 6px; cursor: pointer; }
.device:hover { background: #f8fafc; }
.device.selected { box-shadow: inset 3px 0 0 var(--brand); }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: #10b981; box-shadow: 0 0 0 0 rgba(16,185,129,.6); animation: pulse 1.4s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgba(16,185,129,0); } }
.login { max-width: 420px; margin: 8vh auto; padding: 0 16px; display: flex; flex-direction: column; gap: 12px; }
a { color: var(--brand); font-weight: 700; }
.empty { color: #94a3b8; text-align: center; padding: 24px; }
.badge { font-size: 0.72rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--brand-soft); color: var(--brand); }
.partner-id { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 1.6rem; font-weight: 800; letter-spacing: 0.12em; }
.agent-body { flex: 1; min-height: 0; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 12px; max-width: 720px; }
label { font-size: 0.88rem; font-weight: 600; }
