/* SI360 Remote — panel de gestión */
:root {
  --bg: #f4f6f9;
  --surface: #ffffff;
  --text: #1c2430;
  --muted: #5d6b7c;
  --border: #d9e0e8;
  --accent: #007e95; /* corporate #0097b2, darkened for text contrast */
  --accent-text: #ffffff;
  --danger: #b42318;
  --ok: #157f3b;
  --warn: #9a6700;
  --radius: 8px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12161c;
    --surface: #1b2129;
    --text: #e6ebf1;
    --muted: #9aa8b8;
    --border: #2d3743;
    --accent: #0cc0df;
    --accent-text: #0b1520;
    --danger: #f97066;
    --ok: #47cd89;
    --warn: #f5b947;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
}
a { color: var(--accent); }
header.top {
  display: flex; align-items: center; gap: 24px; flex-wrap: wrap;
  padding: 10px 24px; background: var(--surface); border-bottom: 1px solid var(--border);
}
header.top .brand { font-weight: 700; color: var(--text); text-decoration: none; display: flex; align-items: center; gap: 12px; }
header.top .brand img { height: 40px; width: auto; display: block; }
.public-logo { text-align: center; margin-bottom: 16px; }
.public-logo img { width: 100%; max-width: 360px; height: auto; }
header.top nav { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
header.top nav a {
  padding: 6px 12px; border-radius: var(--radius); color: var(--muted); text-decoration: none;
}
header.top nav a.active, header.top nav a:hover { background: var(--bg); color: var(--text); }
header.top .user { display: flex; align-items: center; gap: 12px; color: var(--muted); }
main { max-width: 1180px; margin: 0 auto; padding: 24px; }
main.narrow { max-width: 440px; padding-top: 10vh; }
h1 { font-size: 1.5rem; margin: 0 0 16px; }
h2 { font-size: 1.15rem; margin: 0 0 12px; }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; margin-bottom: 20px;
}
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 20px; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 0.85rem; }
.table-wrap { overflow-x: auto; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
.muted { color: var(--muted); }
.badge {
  display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 0.8rem;
  border: 1px solid currentColor;
}
.badge.ok { color: var(--ok); }
.badge.off { color: var(--muted); }
.badge.warn { color: var(--warn); }
.badge.danger { color: var(--danger); }
form.stack { display: grid; gap: 12px; }
form.inline { display: inline; }
label { display: grid; gap: 4px; font-weight: 600; font-size: 0.9rem; }
label.check { display: flex; align-items: center; gap: 8px; font-weight: 400; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=search],
select, textarea {
  font: inherit; color: var(--text); background: var(--surface);
  padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius); width: 100%;
}
textarea { min-height: 80px; }
.filters { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.filters input[type=search] { flex: 1; min-width: 220px; }
.filters select { width: auto; }
button, .button {
  font: inherit; cursor: pointer; padding: 8px 16px; border-radius: var(--radius);
  border: 1px solid var(--accent); background: var(--accent); color: var(--accent-text);
  text-decoration: none; display: inline-block;
}
button.secondary { background: transparent; color: var(--accent); }
button.danger { background: transparent; color: var(--danger); border-color: var(--danger); }
button.link { background: none; border: none; color: var(--muted); padding: 0; }
.alert { padding: 10px 14px; border-radius: var(--radius); margin-bottom: 16px; border: 1px solid; }
.alert.error { color: var(--danger); }
.alert.ok { color: var(--ok); }
.token {
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
  padding: 12px; border: 2px dashed var(--accent); border-radius: var(--radius); margin: 12px 0;
}
.token code { font-size: 1rem; word-break: break-all; flex: 1; }
.qr { background: #fff; padding: 8px; border-radius: var(--radius); width: 220px; height: 220px; }
dl.props { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; }
dl.props dt { color: var(--muted); }
dl.props dd { margin: 0; }
.checklist { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 4px 12px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.device-id { font-size: 1.6rem; font-weight: 700; letter-spacing: 0.04em; }

/* Visor de sesiones remotas */
body.viewer { display: flex; flex-direction: column; height: 100vh; overflow: hidden; }
.viewer-bar {
  display: flex; align-items: center; gap: 16px; padding: 8px 16px;
  background: var(--surface); border-bottom: 1px solid var(--border);
}
.viewer-bar .brand img { height: 32px; width: auto; display: block; }
.viewer-title { flex: 1; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; min-width: 0; }
.viewer-stage {
  flex: 1; display: flex; align-items: center; justify-content: center;
  background: #0d1117; min-height: 0; padding: 0; max-width: none; position: relative;
}
.viewer-stage canvas { width: 100%; height: 100%; object-fit: contain; display: block; outline: none; }
.viewer-message {
  position: absolute; max-width: 520px; padding: 20px 24px; border-radius: var(--radius);
  background: var(--surface); color: var(--text); text-align: center; box-shadow: 0 8px 30px rgba(0,0,0,.35);
}
.viewer-message[hidden] { display: none; }
.viewer-notice {
  flex: 0 1 520px; font-size: .85rem; line-height: 1.3; padding: 6px 10px; border-radius: var(--radius);
  border: 1px solid var(--warn); color: var(--warn);
}
.viewer-notice[hidden] { display: none; }
.viewer-stage:fullscreen { background: #000; }
.viewer-toast {
  position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%);
  padding: 8px 14px; border-radius: var(--radius); background: rgba(0,0,0,.75); color: #fff; font-size: .9rem;
}
.viewer-toast[hidden] { display: none; }
