:root{
  --bg:#f6f7fb;
  --card:#ffffff;
  --card2:#f3f5fb;
  --stroke:rgba(15,23,42,.12);
  --text:#0f172a;
  --muted:rgba(15,23,42,.68);
  --primary:#6d5efc;
  --primary2:#5a4df0;
  --danger:#ef4444;
  --ok:#22c55e;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial;
  background: radial-gradient(1200px 600px at 10% 10%, rgba(109,94,252,.10), transparent 55%),
              radial-gradient(1000px 500px at 90% 20%, rgba(34,197,94,.08), transparent 60%),
              var(--bg);
  color:var(--text);
}

.page{max-width:1200px;margin:0 auto;padding:20px}
.topbar{
  display:flex;align-items:center;justify-content:space-between;
  padding:14px 16px;border:1px solid var(--stroke);border-radius:18px;
  background: linear-gradient(180deg, rgba(15,23,42,.04), rgba(15,23,42,.015));
  backdrop-filter: blur(10px);
}
.brand{display:flex;gap:12px;align-items:center}
.logo{
  width:44px;height:44px;border-radius:14px;
  display:grid;place-items:center;font-weight:800;
  background:rgba(109,94,252,.14);
  border:1px solid rgba(109,94,252,.22);
}
.brand-title{font-weight:800;letter-spacing:.2px}
.brand-sub{font-size:12px;color:var(--muted);margin-top:2px}

.grid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:16px;
  margin-top:16px;
}
.card{
  border:1px solid var(--stroke);
  border-radius:18px;
  background: linear-gradient(180deg, rgba(15,23,42,.035), rgba(15,23,42,.015));
  padding:16px;
}
.card.full{grid-column:1 / -1}

.card-head h2{margin:0;font-size:18px}
.card-head p{margin:6px 0 0;color:var(--muted);font-size:13px}
.row-between{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}
.tools{display:flex;align-items:center;gap:10px}

.form{margin-top:14px;display:grid;gap:12px}
.field{display:grid;gap:6px}
.field span{font-size:12px;color:var(--muted)}
input, select{
  width:100%;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid var(--stroke);
  background: rgba(255,255,255,.9);
  color:var(--text);
  outline:none;
}
input::placeholder{color:rgba(15,23,42,.45)}
.row2{display:grid;grid-template-columns: 1fr 1fr;gap:12px}

.btn{
  padding:10px 12px;border-radius:12px;
  border:1px solid var(--stroke);
  background: rgba(15,23,42,.03);
  color:var(--text);
  cursor:pointer;
}
.btn:hover{background: rgba(15,23,42,.05)}
.btn.primary{
  border-color: rgba(109,94,252,.25);
  background: rgba(109,94,252,.12);
}
.btn.primary:hover{background: rgba(109,94,252,.16)}
.hint{font-size:12px;color:var(--muted);min-height:16px}
.hint.ok{color:rgba(34,197,94,.9)}
.hint.bad{color:rgba(239,68,68,.9)}

.mini-list{margin-top:14px;border-top:1px solid var(--stroke);padding-top:12px}
.mini-title{font-size:12px;color:var(--muted);margin-bottom:8px}
.mini-items{display:flex;flex-wrap:wrap;gap:8px}
.pill{
  padding:6px 10px;border-radius:999px;
  border:1px solid var(--stroke);
  background: rgba(15,23,42,.03);
  font-size:12px;color:rgba(15,23,42,.88);
}

.table-wrap{margin-top:12px;overflow:auto;border-radius:14px;border:1px solid var(--stroke)}
.table{width:100%;border-collapse:collapse;min-width:860px;background:rgba(255,255,255,.75)}
.table th,.table td{padding:12px;border-bottom:1px solid var(--stroke);text-align:left;font-size:13px}
.table th{font-size:12px;color:var(--muted);background:rgba(15,23,42,.03)}
.table td.muted{color:var(--muted)}
.right{text-align:right}
.actions{display:flex;justify-content:flex-end;gap:8px}
.btn.danger{
  border-color: rgba(239,68,68,.28);
  background: rgba(239,68,68,.10);
}
.btn.danger:hover{background: rgba(239,68,68,.14)}

.search{min-width:320px}

.modal{
  position:fixed;inset:0;
  background: rgba(15,23,42,.45);
  display:none;
  align-items:center;
  justify-content:center;
  padding:18px;
}
.modal.show{display:flex}
.modal-card{
  width:min(520px, 100%);
  border-radius:18px;
  border:1px solid var(--stroke);
  background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(255,255,255,.92));
  padding:14px;
}
.modal-head{display:flex;justify-content:space-between;align-items:flex-start;gap:12px}
.modal-title{font-weight:800}
.modal-sub{font-size:12px;color:var(--muted);margin-top:2px}
.icon-btn{
  border:1px solid var(--stroke);
  background: rgba(15,23,42,.03);
  color:var(--text);
  border-radius:10px;
  width:36px;height:36px;
  cursor:pointer;
}

.loc-pill{
  display:flex;
  align-items:center;
  gap:8px;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid var(--stroke);
  font-size:12px;
  background: rgba(15,23,42,.03);
}

.loc-pill .name{
  max-width:200px;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.loc-pill .status{
  font-size:11px;
  opacity:.75;
}

.loc-pill .dot{
  width:8px;
  height:8px;
  border-radius:50%;
}

.loc-pill.active{
  border-color: rgba(34,197,94,.28);
}
.loc-pill.active .dot{
  background:#22c55e;
}

.loc-pill.inactive{
  border-color: rgba(239,68,68,.28);
}
.loc-pill.inactive .dot{
  background:#ef4444;
}
