/* VSLConnect — Modern UI */
:root{
  --bg0:#070a14;
  --bg1:#0a1020;
  --bg2:#0b1428;
  --card: rgba(255,255,255,.06);
  --card2: rgba(255,255,255,.04);
  --stroke: rgba(255,255,255,.12);
  --muted: rgba(215,228,255,.72);
  --text:  rgba(237,245,255,.96);

  --primary1:#7c3aed;
  --primary2:#22d3ee;
  --good1:#10b981;
  --warn1:#f59e0b;
  --bad1:#ef4444;

  --shadow: 0 18px 50px rgba(0,0,0,.45);
  --ring: 0 0 0 3px rgba(34,211,238,.25);
  --radius: 18px;
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  color:var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
  background:
    radial-gradient(1100px 600px at 10% -20%, rgba(124,58,237,.35) 0%, transparent 60%),
    radial-gradient(1000px 700px at 100% -10%, rgba(34,211,238,.20) 0%, transparent 55%),
    linear-gradient(180deg, var(--bg0), var(--bg1));
  overflow:hidden;
}

.bg-noise{
  position:fixed; inset:0;
  pointer-events:none;
  opacity:.08;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='.45'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

code{ font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace; }

.muted{ color:var(--muted); }
.dot{
  width:10px; height:10px; border-radius:50%;
  background:#64748b;
  box-shadow:0 0 0 4px rgba(100,116,139,.15);
}

.topbar{
  display:flex; align-items:center; justify-content:space-between;
  padding:14px 16px;
  border-bottom:1px solid rgba(255,255,255,.10);
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.02));
  backdrop-filter: blur(10px);
}

.brand{ display:flex; align-items:center; gap:12px; }
.brand-mark{
  width:44px; height:44px; border-radius:14px;
  display:grid; place-items:center;
  background: linear-gradient(135deg, rgba(124,58,237,.9), rgba(34,211,238,.75));
  box-shadow: var(--shadow);
  font-size:20px;
}
.brand-title{ font-weight:900; letter-spacing:.2px; font-size:16px; }
.brand-sub{ font-size:12px; color:rgba(215,228,255,.70); margin-top:2px; }

.topbar-stats{
  display:flex; align-items:center; gap:10px; flex-wrap:wrap;
}
.stat-pill{
  display:inline-flex; align-items:center; gap:8px;
  padding:8px 10px;
  border:1px solid rgba(255,255,255,.10);
  border-radius:999px;
  background: rgba(255,255,255,.04);
}

.icon-btn{
  appearance:none; border:0;
  width:40px; height:40px;
  border-radius:14px;
  background: rgba(255,255,255,.06);
  color:var(--text);
  cursor:pointer;
  border:1px solid rgba(255,255,255,.10);
  box-shadow: 0 12px 24px rgba(0,0,0,.28);
}
.icon-btn:hover{ filter:brightness(1.1); }
.icon-btn:active{ transform: translateY(1px); }

.shell{
  height: calc(100% - 73px);
  display:grid;
  grid-template-columns: 270px 1fr;
}

.side{
  border-right:1px solid rgba(255,255,255,.10);
  background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.02));
  backdrop-filter: blur(10px);
  padding:12px;
  display:flex; flex-direction:column;
  gap:12px;
  overflow:hidden;
}

.nav{ display:flex; flex-direction:column; gap:8px; }
.nav-btn{
  border:1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.03);
  color:var(--text);
  padding:10px 12px;
  border-radius: 14px;
  cursor:pointer;
  display:flex; align-items:center; gap:10px;
  font-weight:700;
}
.nav-btn:hover{ filter:brightness(1.12); }
.nav-btn.active{
  background: linear-gradient(135deg, rgba(124,58,237,.70), rgba(34,211,238,.40));
  border-color: rgba(255,255,255,.16);
  box-shadow: 0 18px 45px rgba(0,0,0,.35);
}
.nav-ico{ width:22px; display:inline-grid; place-items:center; }

.side-mini{
  border:1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.03);
  border-radius: var(--radius);
  padding:12px;
  display:flex; flex-direction:column; gap:10px;
  overflow:auto;
}
.mini-row{ display:flex; align-items:center; justify-content:space-between; gap:12px; }
.mini-label{ color:rgba(215,228,255,.65); font-size:12px; }
.mini-value b{ font-weight:900; }

.toggle-line{
  display:flex; align-items:center; gap:10px;
  margin-top:4px;
}
.toggle-line input{ display:none; }
.toggle-ui{
  width:46px; height:26px; border-radius:999px;
  border:1px solid rgba(255,255,255,.14);
  background: rgba(239,68,68,.22);
  position:relative;
  flex:0 0 auto;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.10);
}
.toggle-ui::after{
  content:"";
  width:20px; height:20px;
  border-radius:50%;
  position:absolute;
  top:2.5px; left:3px;
  background: rgba(255,255,255,.92);
  box-shadow: 0 8px 18px rgba(0,0,0,.35);
  transition: transform .2s ease;
}
.toggle-line input:checked + .toggle-ui{
  background: rgba(16,185,129,.25);
}
.toggle-line input:checked + .toggle-ui::after{
  transform: translateX(19px);
}
.toggle-text{ font-weight:700; font-size:13px; }
.side-footer{ margin-top:auto; }
.hint{
  border:1px dashed rgba(255,255,255,.18);
  background: rgba(255,255,255,.03);
  color: rgba(215,228,255,.72);
  border-radius: var(--radius);
  padding:10px 12px;
  font-size:12px;
}

.content{
  padding:14px;
  overflow:auto;
}

.tab{ display:none; }
.tab.active{ display:block; }

.card{
  border:1px solid rgba(255,255,255,.10);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.02));
  box-shadow: var(--shadow);
  padding:14px;
}

.hero{ padding:14px; }
.hero h2{ margin:0; font-size:20px; letter-spacing:.2px; }
.hero p{ margin:6px 0 0; }

.hero-head{
  display:flex; align-items:flex-start; justify-content:space-between;
  gap:12px; flex-wrap:wrap;
  margin-bottom:12px;
}
.hero-actions{ display:flex; gap:8px; flex-wrap:wrap; }

.head h2{ margin:0; font-size:20px; }
.head p{ margin:6px 0 0; }

.subcard{
  margin-top:12px;
  background: rgba(0,0,0,.18);
  border-color: rgba(255,255,255,.08);
}

.map-wrap{
  height: clamp(340px, 55vh, 72vh);
  min-height: 340px;
  border-radius: calc(var(--radius) + 2px);
  overflow:hidden;
  border:1px solid rgba(255,255,255,.10);
  background: #071022;
  position:relative;
}
#map{ height:100%; width:100%; }
.map-overlay{
  position:absolute; left:12px; bottom:12px;
  display:flex; gap:8px; flex-wrap:wrap;
}
.overlay-pill{
  background: rgba(3,8,20,.62);
  border:1px solid rgba(255,255,255,.12);
  border-radius:999px;
  padding:8px 10px;
  backdrop-filter: blur(8px);
  display:flex; gap:8px; align-items:center;
  box-shadow: 0 12px 28px rgba(0,0,0,.35);
}

.bars{
  display:grid;
  gap:10px;
  margin-top:12px;
}
.bar{
  position:relative;
  height:14px;
  border-radius:999px;
  background: rgba(255,255,255,.05);
  border:1px solid rgba(255,255,255,.12);
  overflow:hidden;
}
.bar.thin{ height:10px; }
.bar i{
  position:absolute; inset:0;
  width:0%;
  background: linear-gradient(90deg, var(--primary2), #60a5fa, var(--good1));
  box-shadow: 0 0 18px rgba(34,211,238,.25);
  transition: width .3s ease;
}
.bar-label{
  position:absolute; right:10px; top:50%;
  transform: translateY(-50%);
  font-size:11px;
  color:rgba(215,228,255,.68);
  pointer-events:none;
}

.grid{
  display:grid;
  gap:12px;
  margin-top:12px;
}
.grid-2{ grid-template-columns: repeat(2, minmax(0,1fr)); }
.grid-3{ grid-template-columns: repeat(3, minmax(0,1fr)); }
.grid-4{ grid-template-columns: repeat(4, minmax(0,1fr)); }

@media (max-width: 1060px){
  .grid-4{ grid-template-columns: repeat(2, minmax(0,1fr)); }
  .shell{ grid-template-columns: 250px 1fr; }
}
@media (max-width: 860px){
  body{ overflow:auto; }
  .shell{ grid-template-columns: 1fr; height:auto; }
  .side{
    position:sticky; top:0;
    z-index:10;
    border-right:none;
    border-bottom:1px solid rgba(255,255,255,.10);
  }
  .nav{ flex-direction:row; flex-wrap:wrap; }
  .nav-btn{ flex: 1 1 160px; justify-content:center; }
  .side-footer{ display:none; }
}
@media (max-width: 720px){
  .grid-3{ grid-template-columns: 1fr; }
  .grid-2{ grid-template-columns: 1fr; }
  .map-wrap{ height: 420px; }
}

.field label{
  display:block;
  font-size:12px;
  color:rgba(215,228,255,.70);
  margin:0 0 6px;
}
.field input, .field select{
  width:100%;
  padding:10px 12px;
  border-radius: 14px;
  border:1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.04);
  color: var(--text);
  outline:none;
  transition: box-shadow .2s, border-color .2s;
}
.field input:focus, .field select:focus{
  border-color: rgba(34,211,238,.55);
  box-shadow: var(--ring);
}
.help{
  margin-top:6px;
  font-size:11px;
  color:rgba(215,228,255,.58);
}

.span-2{ grid-column: span 2; }
.span-4{ grid-column: span 4; }
@media (max-width: 1060px){
  .span-2,.span-4{ grid-column: span 2; }
}
@media (max-width: 720px){
  .span-2,.span-4{ grid-column: span 1; }
}

.row{ display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.split{ justify-content:space-between; }

.pill{
  display:inline-flex; align-items:center; gap:10px;
  padding:10px 12px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.03);
  font-weight:700;
}
.pill input[type=checkbox]{ transform: scale(1.1); }

.btn{
  appearance:none;
  border:1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.05);
  color: var(--text);
  padding:10px 14px;
  border-radius: 14px;
  cursor:pointer;
  font-weight:800;
  letter-spacing:.2px;
  transition: filter .15s, transform .06s, box-shadow .2s;
}
.btn:hover{ filter:brightness(1.1); }
.btn:active{ transform: translateY(1px); }
.btn:disabled{ opacity:.55; cursor:not-allowed; filter:saturate(.6); }

.btn.primary{
  border:0;
  background: linear-gradient(135deg, rgba(124,58,237,.95), rgba(34,211,238,.90));
  box-shadow: 0 18px 45px rgba(0,0,0,.35);
}
.btn.warn{ border:0; background: linear-gradient(135deg, rgba(245,158,11,.95), rgba(251,113,133,.40)); }
.btn.danger{ border:0; background: linear-gradient(135deg, rgba(239,68,68,.95), rgba(251,113,133,.55)); }
.btn.ghost{ background: rgba(255,255,255,.03); }
.btn.ghost.danger{ background: rgba(239,68,68,.18); border-color: rgba(239,68,68,.35); }

.table-wrap{
  overflow:auto;
  border-radius: var(--radius);
  border:1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.02);
}
.tbl{
  width:100%;
  border-collapse: collapse;
  min-width: 820px;
}
.tbl thead th{
  font-size:12px;
  text-align:left;
  padding:12px 10px;
  color: rgba(215,228,255,.78);
  border-bottom:1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.03);
}
.tbl td{
  padding:10px;
  border-bottom:1px dashed rgba(255,255,255,.10);
}
.tbl input, .tbl select{
  width:100%;
  padding:8px 10px;
  border-radius: 12px;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.03);
  color: var(--text);
}
.tbl .oncell{
  display:flex; align-items:center; gap:10px;
}
.tbl .mini-btn{
  padding:8px 10px;
  border-radius:12px;
  background: rgba(255,255,255,.05);
  border:1px solid rgba(255,255,255,.10);
  color: var(--text);
  cursor:pointer;
  font-weight:800;
}
.tbl .mini-btn:hover{ filter:brightness(1.12); }

.note{
  margin-top:12px;
  padding:10px 12px;
  border-radius: var(--radius);
  border:1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.03);
  color: rgba(215,228,255,.76);
}

.chips{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  min-height: 40px;
}
.chip{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:8px 10px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.03);
  font-size:12px;
}
.chip.ok{ border-color: rgba(16,185,129,.45); background: rgba(16,185,129,.12); }
.chip.err{ border-color: rgba(239,68,68,.45); background: rgba(239,68,68,.12); }

.checklist{
  margin:0;
  padding-left: 18px;
  color: rgba(215,228,255,.85);
}
.checklist li{
  margin:6px 0;
}

.log{
  height: clamp(280px, 45vh, 560px);
  overflow:auto;
  border-radius: var(--radius);
  border:1px solid rgba(255,255,255,.10);
  background: rgba(2,6,23,.55);
  padding:12px;
  box-shadow: inset 0 14px 34px rgba(0,0,0,.40);
  white-space: pre-wrap;
}
.log-footer{ margin-top:10px; }

.modal-backdrop{
  position:fixed; inset:0;
  display:none;
  background: rgba(0,0,0,.55);
  z-index: 9999;
  padding: 18px;
}
.modal-backdrop.show{ display:grid; place-items:center; }
.modal{
  width: min(820px, 100%);
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.03));
  border:1px solid rgba(255,255,255,.12);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}
.modal-head{
  display:flex; align-items:center; justify-content:space-between;
  padding:14px 16px;
  border-bottom:1px solid rgba(255,255,255,.10);
}
.modal-head h3{ margin:0; }
.modal-body{ padding:16px; }
.modal-actions{
  display:flex; align-items:center; justify-content:flex-end;
  gap:10px;
  padding:14px 16px;
  border-top:1px solid rgba(255,255,255,.10);
}

.noscript{
  position: fixed;
  left: 12px;
  bottom: 12px;
  background: rgba(239,68,68,.2);
  color: rgba(255,255,255,.92);
  border:1px solid rgba(239,68,68,.45);
  border-radius: 14px;
  padding: 10px 12px;
}
