:root{
  --bg:#0b1220; --panel:#0f172a; --panel2:#111c33;
  --text:#e5e7eb; --muted:#94a3b8; --accent:#38bdf8;
  --danger:#ef4444; --ok:#22c55e;
}
*{box-sizing:border-box}
body{margin:0;font-family:system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,"Helvetica Neue",Arial;background:linear-gradient(180deg,var(--bg),#060a14);color:var(--text)}
a{color:var(--accent);text-decoration:none}
header{padding:14px 16px;display:flex;gap:10px;align-items:center;justify-content:space-between;border-bottom:1px solid rgba(148,163,184,.18);position:sticky;top:0;background:rgba(11,18,32,.92);backdrop-filter:blur(6px);z-index:10}
.left,.right{display:flex;gap:10px;align-items:center;flex-wrap:wrap}
.btn{border:1px solid rgba(148,163,184,.25);background:rgba(15,23,42,.7);color:var(--text);padding:10px 12px;border-radius:10px;cursor:pointer;font-weight:600;letter-spacing:.2px}
.btn:hover{border-color:rgba(56,189,248,.55)}
.btn.primary{border-color:rgba(56,189,248,.65)}
.btn.danger{border-color:rgba(239,68,68,.6)}
.btn.ghost{background:transparent}
.pill{padding:8px 10px;border-radius:999px;border:1px solid rgba(148,163,184,.25);color:var(--muted);font-size:13px}
main{display:grid;grid-template-columns:1fr 360px;gap:14px;padding:14px}
@media(max-width:980px){main{grid-template-columns:1fr}}
.card{border:1px solid rgba(148,163,184,.18);border-radius:16px;background:rgba(15,23,42,.55)}
.card .hd{padding:12px 14px;border-bottom:1px solid rgba(148,163,184,.12);display:flex;gap:10px;align-items:center;justify-content:space-between}
.card .bd{padding:14px}
.field{display:flex;flex-direction:column;gap:6px;margin-bottom:10px}
input,select,textarea{width:100%;padding:10px 12px;border-radius:10px;border:1px solid rgba(148,163,184,.25);background:rgba(2,6,23,.4);color:var(--text)}
textarea{min-height:90px;resize:vertical}
.small{font-size:12px;color:var(--muted)}
.viewport{position:relative;height:calc(70vh - 52px);min-height:520px;overflow:hidden;padding:0;touch-action:none;user-select:none;cursor:grab}
.viewport.is-panning{cursor:grabbing}
.stage{transform-origin:0 0;will-change:transform}
.tools{padding:10px 12px;display:flex;gap:10px;align-items:center;flex-wrap:wrap;border-bottom:1px solid rgba(148,163,184,.12)}
.legend{display:flex;gap:10px;flex-wrap:wrap}
.dot{width:10px;height:10px;border-radius:999px;display:inline-block;margin-right:6px}
.dot.ok{background:var(--ok)} .dot.bad{background:var(--danger)} .dot.purple{background:#a855f7} .dot.muted{background:#64748b}

g.seat.is-selected rect{stroke:#e5e7eb;stroke-width:3}
g.seat.is-disabled{opacity:.45}
g.seat:hover rect{stroke:#e5e7eb;stroke-width:2}

@media(max-width:520px){
  .btn{padding:12px 14px;border-radius:12px}
  #zoomRange{width:150px}
  main{padding:10px}
  aside.card{order:2}
}

/* toolbar v7 */
.tools{
  flex-wrap:nowrap;
  overflow:auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  gap:8px;
}
.tools::-webkit-scrollbar{height:8px}
.tools::-webkit-scrollbar-thumb{background:rgba(148,163,184,.25);border-radius:99px}

.btn.icon{
  width:40px;
  height:40px;
  padding:0;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border-radius:12px;
}
.btn.icon svg{
  width:18px;
  height:18px;
  display:block;
}

#zoomRange{
  width:120px;
  min-width:120px;
}
.pill.compact{
  padding:8px 10px;
  font-size:12px;
  white-space:nowrap;
}

input.invalid{
  outline: 2px solid rgba(239,68,68,.75);
  border-color: rgba(239,68,68,.75);
}

.statusbar{
  display:flex;
  gap:8px;
  flex-wrap:nowrap;
  align-items:center;
}
.btn.status{
  border:1px solid rgba(148,163,184,.35);
  background:rgba(15,23,42,.15);
}
.btn.status.ok{ color:#22c55e; }
.btn.status.bad{ color:#ef4444; }
.btn.status.purple{ color:#a855f7; }
.btn.status.muted{ color:#94a3b8; }
.btn.status:hover{ filter:brightness(1.05); }
