/* =========================================================================
   QR Rastreável — sistema visual
   Console de telemetria: fundo tinta-marinha, leitura de instrumento.
   Números sempre em monoespaçada tabular; rótulos em condensada versalete.
   ========================================================================= */
@import url('/fonts/plex-local.css');

:root {
  /* superfícies */
  --abyss:      #070E1A;
  --hull:       #0D1626;
  --hull-2:     #111D33;
  --hull-3:     #16223A;
  --rule:       #1D2B45;
  --rule-soft:  #16223A;

  /* tinta */
  --paper:      #E9F0FA;
  --mist:       #8DA1C0;
  --fog:        #62789B;

  /* acentos da interface */
  --signal:     #2DD4BF;
  --signal-dim: #12A899;
  --flare:      #F5A524;
  --alarm:      #F0556E;

  /* séries categóricas — validadas para esta superfície (ΔE CVD ≥ 8) */
  --s1: #12A899;  --s2: #D9762A;  --s3: #7C6BE8;  --s4: #E05070;
  --s5: #2E8FD9;  --s6: #4F9B2C;  --s7: #C55BA6;  --s8: #A8891B;

  /* rampa sequencial (intensidade de leituras) — matiz única, L monotônica */
  --q0: #16223A;  /* sem leituras */
  --q1: #115B5B;  --q2: #14746D;  --q3: #178E7C;
  --q4: #1CA98D;  --q5: #3FC4A6;  --q6: #7BE0C7;

  /* estado */
  --ok:    #2FA36B;
  --warn:  #C89211;
  --crit:  #DC4A5C;

  --sans: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --cond: 'IBM Plex Sans Condensed', 'IBM Plex Sans', -apple-system, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  --r:    12px;
  --r-sm: 8px;
  --shadow: 0 18px 42px rgba(0, 0, 0, .45);
  --rail: 236px;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--abyss);
  color: var(--paper);
  font: 400 14px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* números sempre alinhados em coluna */
.num, td.num, .metric-value, .mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }

h1, h2, h3, h4 { margin: 0; font-family: var(--cond); font-weight: 600; letter-spacing: -.01em; }
a { color: var(--signal); text-decoration: none; }
a:hover { text-decoration: underline; }

:focus-visible { outline: 2px solid var(--signal); outline-offset: 2px; border-radius: 4px; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--rule); border-radius: 6px; border: 2px solid var(--abyss); }
::-webkit-scrollbar-thumb:hover { background: #27395a; }

/* ====================================================== estrutura ======= */
#app { min-height: 100dvh; }

.shell { display: grid; grid-template-columns: var(--rail) minmax(0, 1fr); min-height: 100dvh; }

.rail {
  position: sticky; top: 0; height: 100dvh; overflow-y: auto;
  background: linear-gradient(180deg, #091223 0%, var(--abyss) 100%);
  border-right: 1px solid var(--rule); padding: 18px 12px 22px;
  display: flex; flex-direction: column; gap: 4px;
}

.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 8px; flex: none; position: relative;
  background: linear-gradient(140deg, var(--signal), var(--signal-dim));
  display: grid; place-items: center;
}
/* marca: módulos de QR reduzidos ao essencial */
.brand-mark::before {
  content: ''; width: 16px; height: 16px;
  background:
    linear-gradient(#071019, #071019) 0 0 / 6px 6px no-repeat,
    linear-gradient(#071019, #071019) 10px 0 / 6px 6px no-repeat,
    linear-gradient(#071019, #071019) 0 10px / 6px 6px no-repeat,
    linear-gradient(#071019, #071019) 11px 11px / 5px 5px no-repeat;
}
.brand-name { font-family: var(--cond); font-weight: 700; font-size: 16px; letter-spacing: .01em; line-height: 1.1; }
.brand-sub { font-size: 10px; color: var(--fog); text-transform: uppercase; letter-spacing: .14em; font-family: var(--cond); }

.nav-group { margin-top: 14px; padding: 0 10px 6px; font-size: 10px; letter-spacing: .16em;
             text-transform: uppercase; color: var(--fog); font-family: var(--cond); font-weight: 600; }

.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 11px; border-radius: var(--r-sm);
  color: var(--mist); font-weight: 500; font-size: 13.5px; position: relative; cursor: pointer;
  transition: background .14s, color .14s;
}
.nav-item:hover { background: var(--hull); color: var(--paper); text-decoration: none; }
.nav-item.active { background: var(--hull-2); color: var(--paper); }
/* barra de sinal marca a tela ativa */
.nav-item.active::before {
  content: ''; position: absolute; left: -12px; top: 50%; translate: 0 -50%;
  width: 3px; height: 20px; border-radius: 0 3px 3px 0; background: var(--signal);
}
.nav-item .ico { width: 17px; text-align: center; font-size: 14px; flex: none; opacity: .95; }
.nav-item .badge {
  margin-left: auto; background: var(--alarm); color: #fff; font-family: var(--mono);
  font-size: 10px; padding: 1px 6px; border-radius: 10px; font-weight: 600;
}

.rail-foot { margin-top: auto; padding: 14px 10px 0; border-top: 1px solid var(--rule); font-size: 11px; color: var(--fog); }
.rail-foot code { font-family: var(--mono); color: var(--mist); font-size: 10.5px; word-break: break-all; }

.main { min-width: 0; display: flex; flex-direction: column; }

.topbar {
  position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 14px;
  padding: 13px 26px; background: rgba(7, 14, 26, .88); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--rule);
}
.topbar h1 { font-size: 19px; }
.topbar .sub { font-size: 12px; color: var(--fog); margin-top: 1px; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 9px; }

.page { padding: 22px 26px 60px; display: flex; flex-direction: column; gap: 16px; }

/* ========================================================= painéis ====== */
.panel {
  background: var(--hull); border: 1px solid var(--rule); border-radius: var(--r);
  display: flex; flex-direction: column; min-width: 0;
}
.panel-head {
  display: flex; align-items: center; gap: 10px; padding: 14px 16px;
  border-bottom: 1px solid var(--rule-soft);
}
.panel-head h2 { font-size: 14px; letter-spacing: .01em; }
.panel-head .hint { font-size: 11.5px; color: var(--fog); }
.panel-head .right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
/* empilha o conteúdo com respiro: painéis de formulário dependem disso */
.panel-body { padding: 16px; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.panel-body.flush { padding: 0; gap: 0; }

.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-map { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); }
/* a coluna lateral pode ser bem mais alta que a principal; sem isso a
   principal esticaria e ficaria com um vazio enorme embaixo do gráfico */
.g-side { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }

/* ============================ faixa de instrumentos (indicadores) ======= */
/* Um painel único dividido por fios, não cartões soltos: lê-se como leitura
   de instrumento, e mantém os números alinhados na mesma linha de base. */
.instruments {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  background: var(--hull); border: 1px solid var(--rule); border-radius: var(--r); overflow: hidden;
}
.metric { padding: 15px 17px; border-right: 1px solid var(--rule-soft); border-bottom: 1px solid var(--rule-soft); min-width: 0; }
.metric:last-child { border-right: 0; }
.metric-label {
  font-family: var(--cond); font-size: 10.5px; text-transform: uppercase; letter-spacing: .13em;
  color: var(--fog); font-weight: 600; display: flex; align-items: center; gap: 6px;
}
.metric-value { font-size: 26px; font-weight: 600; line-height: 1.15; margin-top: 7px; letter-spacing: -.02em; }
.metric-value.sm { font-size: 19px; }
.metric-foot { font-size: 11.5px; color: var(--mist); margin-top: 5px; display: flex; align-items: center; gap: 5px; }

.delta { font-family: var(--mono); font-size: 11.5px; font-weight: 600; display: inline-flex; align-items: center; gap: 3px; }
.delta.up { color: var(--ok); }
.delta.down { color: var(--alarm); }
.delta.flat { color: var(--fog); }

/* ======================================================== controles ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 8px 14px; border-radius: var(--r-sm); border: 1px solid var(--rule);
  background: var(--hull-2); color: var(--paper); font: 500 13px var(--sans);
  cursor: pointer; transition: background .14s, border-color .14s, transform .1s;
  white-space: nowrap;
}
.btn:hover { background: #172542; border-color: #27395a; text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--signal); border-color: transparent; color: #04211D; font-weight: 600; }
.btn.primary:hover { background: #4FE0CD; }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--alarm); border-color: #45283a; }
.btn.danger:hover { background: #2C1622; }
.btn.sm { padding: 5px 10px; font-size: 12px; }
.btn.icon { padding: 7px 9px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }

.seg { display: inline-flex; background: var(--hull-2); border: 1px solid var(--rule); border-radius: var(--r-sm); padding: 2px; }
.seg button {
  border: 0; background: transparent; color: var(--mist); font: 500 12px var(--sans);
  padding: 5px 11px; border-radius: 6px; cursor: pointer; white-space: nowrap;
}
.seg button:hover { color: var(--paper); }
.seg button.on { background: var(--signal); color: #04211D; font-weight: 600; }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label {
  font-family: var(--cond); font-size: 11px; text-transform: uppercase; letter-spacing: .1em;
  color: var(--mist); font-weight: 600;
}
.field .help { font-size: 11.5px; color: var(--fog); }
input, select, textarea {
  width: 100%; padding: 9px 11px; border-radius: var(--r-sm); border: 1px solid var(--rule);
  background: var(--abyss); color: var(--paper); font: 400 13.5px var(--sans);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--signal); box-shadow: 0 0 0 3px rgba(45, 212, 191, .13); }
input::placeholder, textarea::placeholder { color: #4C6183; }
textarea { resize: vertical; min-height: 78px; line-height: 1.5; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--mist) 50%), linear-gradient(135deg, var(--mist) 50%, transparent 50%);
         background-position: right 15px center, right 10px center; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 30px; }
input[type=color] { padding: 3px; height: 36px; cursor: pointer; }
input[type=checkbox] { width: auto; accent-color: var(--signal); }
.check { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--mist); cursor: pointer; }

/* ========================================================== tabelas ===== */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th {
  text-align: left; font-family: var(--cond); font-size: 10.5px; text-transform: uppercase;
  letter-spacing: .12em; color: var(--fog); font-weight: 600; padding: 10px 14px;
  border-bottom: 1px solid var(--rule); white-space: nowrap; position: sticky; top: 0; background: var(--hull);
}
td { padding: 10px 14px; border-bottom: 1px solid var(--rule-soft); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr.clickable { cursor: pointer; }
tbody tr.clickable:hover { background: var(--hull-2); }
td.num, th.num { text-align: right; }
.rank { font-family: var(--mono); color: var(--fog); font-size: 12px; width: 34px; }

/* ============================================================ selos ===== */
.tag {
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 20px;
  font-size: 11px; font-weight: 600; border: 1px solid var(--rule); color: var(--mist); background: var(--hull-2);
  white-space: nowrap;
}
.tag.ativo   { color: #6EE7C7; border-color: #17493F; background: #0C2A26; }
.tag.pausado { color: #F5C563; border-color: #4A3A16; background: #2A2110; }
.tag.inativo { color: #93A3BF; border-color: #26344F; background: #141E33; }
.tag.dot::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.pill-live {
  display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px; border-radius: 20px;
  background: #0C2A26; border: 1px solid #17493F; color: #6EE7C7;
  font-family: var(--cond); font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase;
}
.pill-live.off { background: var(--hull-2); border-color: var(--rule); color: var(--fog); }
.pulse { width: 7px; height: 7px; border-radius: 50%; background: currentColor; position: relative; }
.pill-live:not(.off) .pulse::after {
  content: ''; position: absolute; inset: -4px; border-radius: 50%;
  border: 1.5px solid currentColor; animation: ping 1.8s ease-out infinite;
}
@keyframes ping { 0% { transform: scale(.5); opacity: .9; } 100% { transform: scale(1.7); opacity: 0; } }

/* ======================================================== gráficos ====== */
.chart { width: 100%; display: block; overflow: visible; }
.chart text { font-family: var(--mono); font-size: 10px; fill: var(--fog); font-variant-numeric: tabular-nums; }
.chart .axis-line { stroke: var(--rule-soft); stroke-width: 1; }
.chart .grid-line { stroke: var(--rule-soft); stroke-width: 1; stroke-dasharray: 2 4; }
.chart .series-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .mark:hover { filter: brightness(1.25); }
.chart .crosshair { stroke: var(--signal); stroke-width: 1; stroke-dasharray: 3 3; pointer-events: none; }

.legend { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 12px; font-size: 12px; color: var(--mist); }
.legend-item { display: inline-flex; align-items: center; gap: 6px; }
.legend-swatch { width: 10px; height: 10px; border-radius: 3px; flex: none; }

.tip {
  position: fixed; z-index: 200; pointer-events: none; background: #0A1424; border: 1px solid var(--rule);
  border-radius: var(--r-sm); padding: 9px 11px; font-size: 12px; box-shadow: var(--shadow);
  max-width: 260px; opacity: 0; transition: opacity .1s;
}
.tip.on { opacity: 1; }
.tip-title { font-family: var(--cond); font-weight: 600; font-size: 12.5px; margin-bottom: 5px; }
.tip-row { display: flex; align-items: center; gap: 8px; justify-content: space-between; color: var(--mist); }
.tip-row b { font-family: var(--mono); color: var(--paper); font-weight: 600; }

/* barra horizontal de ranking */
.bar-row { display: grid; grid-template-columns: 26px minmax(74px, 1fr) 2.2fr auto; gap: 10px; align-items: center; padding: 6px 0; }
.bar-track { background: var(--hull-3); border-radius: 4px; height: 9px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 4px; background: var(--s1); transition: width .5s cubic-bezier(.2,.8,.2,1); }
.bar-label { font-size: 12.5px; color: var(--paper); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-value { font-family: var(--mono); font-size: 12px; color: var(--mist); font-variant-numeric: tabular-nums; }

/* ============================================================ mapa ====== */
.map-wrap { position: relative; width: 100%; }
.br-map { width: 100%; height: auto; display: block; }
.br-map .uf { stroke: #0A1424; stroke-width: 1.1; cursor: pointer; transition: fill .5s ease, stroke .12s; }
.br-map .uf:hover { stroke: var(--signal); stroke-width: 2; }
.br-map .uf.sel { stroke: var(--signal); stroke-width: 2.2; }
/* o tamanho está em unidades do viewBox (1000 de largura), não em pixels */
.br-map .uf-label { font-family: var(--cond); font-size: 27px; font-weight: 700; fill: #DCE8F8; pointer-events: none; paint-order: stroke; stroke: #0A1424; stroke-width: 5px; }
.br-map .city-dot { fill: var(--flare); fill-opacity: .82; stroke: #2A1704; stroke-width: .8; }
.br-map .ping { fill: none; stroke: var(--signal); stroke-width: 2.5; }

.map-legend { display: flex; align-items: center; gap: 10px; margin-top: 10px; font-size: 11.5px; color: var(--fog); flex-wrap: wrap; }
.ramp { display: flex; gap: 2px; }
.ramp i { width: 22px; height: 9px; border-radius: 2px; display: block; }

/* ==================================================== radar ao vivo ===== */
.radar-feed { max-height: 420px; overflow-y: auto; }
.radar-item {
  display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 10px; align-items: center;
  padding: 10px 14px; border-bottom: 1px solid var(--rule-soft);
}
.radar-item.new { animation: slide-in .45s cubic-bezier(.2,.9,.3,1); }
@keyframes slide-in {
  from { opacity: 0; transform: translateY(-8px); background: rgba(45, 212, 191, .1); }
  to { opacity: 1; transform: none; background: transparent; }
}
.radar-uf {
  width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center;
  background: var(--hull-2); border: 1px solid var(--rule);
  font-family: var(--cond); font-size: 11.5px; font-weight: 700; color: var(--signal);
}
.radar-city { font-size: 13px; font-weight: 500; }
.radar-meta { font-size: 11.5px; color: var(--fog); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.radar-time { font-family: var(--mono); font-size: 11px; color: var(--mist); }

/* ==================================================== construtor QR ==== */
.builder { display: grid; grid-template-columns: minmax(0, 1fr) 396px; gap: 16px; align-items: start; }
.qr-stage {
  position: sticky; top: 78px; background: var(--hull); border: 1px solid var(--rule);
  border-radius: var(--r); overflow: hidden;
}
.qr-canvas {
  padding: 24px; display: grid; place-items: center; min-height: 300px;
  background:
    linear-gradient(var(--rule-soft) 1px, transparent 1px) 0 0 / 100% 22px,
    linear-gradient(90deg, var(--rule-soft) 1px, transparent 1px) 0 0 / 22px 100%,
    var(--hull-2);
}
.qr-canvas svg, .qr-canvas img { max-width: 260px; width: 100%; height: auto; border-radius: 6px; }

.type-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 8px; }
.type-card {
  display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 13px 8px;
  border: 1px solid var(--rule); border-radius: var(--r-sm); background: var(--hull-2);
  cursor: pointer; text-align: center; transition: border-color .14s, background .14s;
}
.type-card:hover { border-color: #2C4166; background: #16233C; }
.type-card.on { border-color: var(--signal); background: #0C2A26; }
.type-card .emoji { font-size: 21px; line-height: 1; }
.type-card span { font-size: 11.5px; color: var(--mist); font-weight: 500; line-height: 1.25; }
.type-card.on span { color: var(--paper); }

.swatches { display: flex; flex-wrap: wrap; gap: 6px; }
.swatch { width: 26px; height: 26px; border-radius: 6px; border: 1px solid var(--rule); cursor: pointer; }
.swatch.on { outline: 2px solid var(--signal); outline-offset: 1px; }

.style-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 7px; }
.style-opt {
  padding: 8px 6px; border: 1px solid var(--rule); border-radius: var(--r-sm); background: var(--hull-2);
  font-size: 11.5px; color: var(--mist); cursor: pointer; text-align: center; line-height: 1.3;
}
.style-opt:hover { border-color: #2C4166; }
.style-opt.on { border-color: var(--signal); background: #0C2A26; color: var(--paper); }

.accordion { border: 1px solid var(--rule); border-radius: var(--r); overflow: hidden; background: var(--hull); }
.accordion + .accordion { margin-top: 10px; }
.acc-head {
  display: flex; align-items: center; gap: 9px; padding: 12px 15px; cursor: pointer; user-select: none;
  font-family: var(--cond); font-weight: 600; font-size: 13.5px;
}
.acc-head:hover { background: var(--hull-2); }
.acc-head .chev { margin-left: auto; color: var(--fog); transition: transform .18s; font-size: 11px; }
.accordion.open .acc-head .chev { transform: rotate(90deg); }
.acc-body { padding: 0 15px 16px; display: none; flex-direction: column; gap: 13px; }
.accordion.open .acc-body { display: flex; }

.notice {
  display: flex; gap: 9px; padding: 10px 12px; border-radius: var(--r-sm); font-size: 12.5px; line-height: 1.45;
  border: 1px solid var(--rule); background: var(--hull-2); color: var(--mist);
}
.notice.aviso { border-color: #4A3A16; background: #241C0C; color: #F5D48A; }
.notice.erro  { border-color: #4A2029; background: #26121A; color: #FCA5B5; }
.notice.ok    { border-color: #17493F; background: #0C2A26; color: #93E7D2; }
.notice b { color: inherit; }

/* ===================================================== diálogo/aviso ==== */
.overlay {
  position: fixed; inset: 0; background: rgba(4, 8, 16, .74); backdrop-filter: blur(3px);
  z-index: 100; display: grid; place-items: center; padding: 24px;
}
.dialog {
  background: var(--hull); border: 1px solid var(--rule); border-radius: 14px; box-shadow: var(--shadow);
  width: 100%; max-width: 520px; max-height: 88dvh; display: flex; flex-direction: column;
}
.dialog.wide { max-width: 860px; }
.dialog-head { padding: 16px 18px; border-bottom: 1px solid var(--rule-soft); display: flex; align-items: center; gap: 10px; }
.dialog-body { padding: 18px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.dialog-foot { padding: 14px 18px; border-top: 1px solid var(--rule-soft); display: flex; gap: 9px; justify-content: flex-end; }

.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 300; display: flex; flex-direction: column; gap: 9px; }
.toast {
  background: var(--hull-2); border: 1px solid var(--rule); border-left: 3px solid var(--signal);
  border-radius: var(--r-sm); padding: 11px 15px; font-size: 13px; box-shadow: var(--shadow);
  animation: slide-in .3s ease; max-width: 340px;
}
.toast.erro { border-left-color: var(--alarm); }
.toast.ok { border-left-color: var(--ok); }

/* =========================================================== login ===== */
.login-wrap { min-height: 100dvh; display: grid; grid-template-columns: 1fr 1fr; }
.login-art {
  background: radial-gradient(1100px 620px at 22% 18%, #0F2A3E 0%, var(--abyss) 62%);
  padding: 52px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden;
}
.login-art .br-map { max-width: 460px; margin: auto; opacity: .95; }
.login-form { display: grid; place-items: center; padding: 40px; border-left: 1px solid var(--rule); }
.login-card { width: 100%; max-width: 348px; display: flex; flex-direction: column; gap: 15px; }
.login-card h1 { font-size: 25px; }
.demo-users { display: flex; flex-direction: column; gap: 5px; margin-top: 4px; }
.demo-user {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 11px;
  border: 1px solid var(--rule); border-radius: var(--r-sm); background: var(--hull); cursor: pointer; font-size: 12px;
}
.demo-user:hover { border-color: var(--signal); }
.demo-user code { font-family: var(--mono); font-size: 11px; color: var(--mist); }

/* ============================================================ vazios ==== */
.empty { text-align: center; padding: 46px 20px; color: var(--fog); }
.empty .big { font-size: 30px; margin-bottom: 10px; opacity: .55; }
.empty h3 { font-size: 15px; color: var(--mist); margin-bottom: 6px; }
.empty p { margin: 0 auto; max-width: 380px; font-size: 13px; line-height: 1.6; }

.skeleton { background: linear-gradient(90deg, var(--hull-2) 25%, var(--hull-3) 50%, var(--hull-2) 75%);
            background-size: 200% 100%; animation: shimmer 1.3s infinite; border-radius: 6px; }
@keyframes shimmer { to { background-position: -200% 0; } }

.spinner { width: 15px; height: 15px; border: 2px solid var(--rule); border-top-color: var(--signal);
           border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ======================================================= utilidades ===== */
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row.tight { gap: 6px; }
.col { display: flex; flex-direction: column; gap: 10px; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--fog); }
.dim { color: var(--mist); }
.small { font-size: 12px; }
.tiny { font-size: 11px; }
.strong { font-weight: 600; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.center { text-align: center; }
.hide { display: none !important; }
.cap { font-family: var(--cond); text-transform: uppercase; letter-spacing: .12em; font-size: 10.5px; color: var(--fog); font-weight: 600; }
.mt0 { margin-top: 0; } .mt8 { margin-top: 8px; } .mt16 { margin-top: 16px; }

/* ======================================================= responsivo ===== */
@media (max-width: 1240px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-map, .g-side, .builder { grid-template-columns: minmax(0, 1fr); }
  .qr-stage { position: static; }
}
@media (max-width: 900px) {
  :root { --rail: 0px; }
  .shell { grid-template-columns: minmax(0, 1fr); }
  .rail {
    position: fixed; inset: 0 auto 0 0; width: 260px; z-index: 90; transform: translateX(-100%);
    transition: transform .22s ease; box-shadow: var(--shadow);
  }
  .rail.open { transform: none; }
  .rail-scrim { position: fixed; inset: 0; background: rgba(4, 8, 16, .6); z-index: 80; }
  .g2, .g3 { grid-template-columns: minmax(0, 1fr); }
  .page, .topbar { padding-left: 16px; padding-right: 16px; }
  .login-wrap { grid-template-columns: 1fr; }
  .login-art { display: none; }
  .login-form { border-left: 0; }
}
@media (min-width: 901px) { .menu-toggle { display: none; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

@media print {
  .rail, .topbar-actions, .btn { display: none !important; }
  body { background: #fff; color: #000; }
  .panel { border-color: #ccc; background: #fff; }
}
