:root{
  --bg:#0b0f14;
  --panel:#0f1620;
  --panel2:#0c121b;
  --text:#e7eef7;
  --muted:#a9b6c7;
  --line:#1d2a3a;
  --accent:#6aa9ff;
  --accent2:#8b5cf6;
  --good:#22c55e;
  --warn:#f59e0b;
  --bad:#ef4444;
  --pill:#111a26;
  --shadow: 0 10px 30px rgba(0,0,0,.35);
  --radius: 14px;
  --radius2: 10px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --sans: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  background: radial-gradient(1200px 800px at 30% -10%, rgba(106,169,255,.18), transparent 55%),
              radial-gradient(900px 600px at 95% 5%, rgba(139,92,246,.14), transparent 60%),
              var(--bg);
  color:var(--text);
  font-family:var(--sans);
}

.app{min-height:100%; display:flex; flex-direction:column}

.topbar{
  display:flex; align-items:center; justify-content:space-between;
  padding:18px 18px;
  border-bottom:1px solid var(--line);
  background: linear-gradient(180deg, rgba(15,22,32,.95), rgba(15,22,32,.72));
  backdrop-filter: blur(10px);
  position:sticky; top:0; z-index:5;
}

.brand{display:flex; gap:14px; align-items:center}
.logo{
  width:42px; height:42px; display:grid; place-items:center;
  border-radius:12px;
  background: linear-gradient(135deg, rgba(106,169,255,.30), rgba(139,92,246,.30));
  border:1px solid rgba(106,169,255,.35);
  font-weight:700;
}
.title .h1{font-size:16px; font-weight:700; letter-spacing:.2px}
.title .sub{font-size:12px; color:var(--muted); margin-top:3px}

.right{display:flex; gap:10px; align-items:center}
.stat{
  padding:10px 12px;
  border-radius:12px;
  border:1px solid var(--line);
  background: rgba(12,18,27,.75);
}
.statLabel{font-size:11px; color:var(--muted)}
.statValue{font-size:14px; font-weight:700}

.toolbar{
  padding:14px 18px 6px;
  border-bottom:1px solid var(--line);
  background: rgba(12,18,27,.55);
  backdrop-filter: blur(10px);
}

.row{display:flex; gap:12px; align-items:flex-end}
.row + .row{margin-top:10px}
.field{display:flex; flex-direction:column; gap:6px; min-width:170px}
.field.grow{flex:1; min-width:260px}
label{font-size:12px; color:var(--muted)}

input,select{
  width:100%;
  padding:10px 11px;
  border-radius:12px;
  border:1px solid var(--line);
  background: rgba(15,22,32,.72);
  color:var(--text);
  outline:none;
}
input:focus,select:focus{border-color:rgba(106,169,255,.55); box-shadow:0 0 0 3px rgba(106,169,255,.12)}

.btn{
  padding:10px 12px;
  border-radius:12px;
  border:1px solid rgba(106,169,255,.35);
  background: rgba(106,169,255,.18);
  color: var(--text);
  cursor:pointer;
  user-select:none;
  transition: transform .06s ease, background .2s ease, border-color .2s ease;
}
.btn:hover{background: rgba(106,169,255,.24)}
.btn:active{transform: translateY(1px)}
.btn-ghost{
  background: rgba(15,22,32,.4);
  border-color: var(--line);
}
.btn-ghost:hover{background: rgba(15,22,32,.62)}

.advanced{
  display:none;
  padding-top:6px;
}
.advanced.show{display:flex; flex-wrap:wrap}
.spacer{flex:1}

.bulk{
  margin-top:10px;
  display:flex; align-items:center; justify-content:space-between;
  padding:10px 12px;
  border-radius:var(--radius);
  border:1px solid var(--line);
  background: rgba(15,22,32,.45);
}
.bulkLeft{display:flex; align-items:center; gap:12px}
.bulkRight{display:flex; align-items:center; gap:10px}
.check{display:flex; align-items:center; gap:10px; cursor:pointer; user-select:none}
.check input{width:16px; height:16px}
.hint{font-size:12px; color:var(--muted)}

.content{padding:12px 18px 24px; flex:1; display:flex; flex-direction:column; gap:10px}
.tableWrap{
  border:1px solid var(--line);
  border-radius:var(--radius);
  overflow:hidden;
  background: rgba(15,22,32,.55);
  box-shadow: var(--shadow);
}
.table{
  width:100%;
  border-collapse:collapse;
  font-size:13px;
}
thead{
  background: rgba(12,18,27,.8);
}
th,td{
  padding:10px 10px;
  border-bottom:1px solid rgba(29,42,58,.8);
  vertical-align:top;
}
th{font-size:12px; color:var(--muted); text-align:left; white-space:nowrap}
tr:hover td{background: rgba(12,18,27,.45)}

td.mono{font-family:var(--mono); font-size:12px; color:#dbe7f5}
td.small{font-size:12px; color:var(--muted)}
td.tight{white-space:nowrap}
td.actions{min-width:180px}

.badge{
  display:inline-flex; align-items:center; gap:8px;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid var(--line);
  background: rgba(17,26,38,.7);
  font-size:12px;
}
.dot{width:8px; height:8px; border-radius:50%}
.dot.none{background: #64748b}
.dot.c1{background: var(--good)}
.dot.c2{background: #38bdf8}
.dot.c3{background: #94a3b8}
.dot.c4{background: var(--warn)}
.dot.c5{background: var(--bad)}

.actionRow{display:flex; gap:8px; align-items:center}
.actionRow select{padding:8px 9px; border-radius:10px}
.iconBtn{
  padding:8px 10px;
  border-radius:10px;
  border:1px solid var(--line);
  background: rgba(15,22,32,.45);
  cursor:pointer;
}
.iconBtn:hover{background: rgba(15,22,32,.65)}
.iconBtn.danger{border-color: rgba(239,68,68,.35)}
.iconBtn.danger:hover{background: rgba(239,68,68,.12)}

.pager{
  display:flex; align-items:center; gap:10px;
  padding:10px 12px;
  border:1px solid var(--line);
  border-radius:var(--radius);
  background: rgba(15,22,32,.45);
}
.pageInfo{display:flex; align-items:center; gap:8px}
.pageInfo input{width:86px}
.muted{color:var(--muted); font-size:12px}

.footer{
  padding:14px 18px;
  border-top:1px solid var(--line);
  background: rgba(12,18,27,.55);
}

.modal{
  position:fixed; inset:0;
  display:none;
  place-items:center;
  background: rgba(0,0,0,.55);
  z-index:100;
}
.modal.show{display:grid}
.modalCard{
  width:min(520px, calc(100% - 24px));
  border-radius:16px;
  border:1px solid rgba(106,169,255,.25);
  background: rgba(15,22,32,.92);
  box-shadow: var(--shadow);
  padding:16px;
}
.modalTitle{font-size:16px; font-weight:800}
.modalText{font-size:12px; color:var(--muted); margin-top:6px; line-height:1.45}
.modalActions{display:flex; justify-content:flex-end; gap:10px; margin-top:14px}
.modalHint{margin-top:10px}

.toast{
  position:fixed; left:50%; bottom:18px; transform:translateX(-50%);
  padding:10px 12px;
  border-radius:999px;
  border:1px solid rgba(106,169,255,.25);
  background: rgba(15,22,32,.92);
  box-shadow: var(--shadow);
  display:none;
  font-size:12px;
}
.toast.show{display:block}


th.sortable{cursor:pointer; user-select:none}
th.sortable:hover{color:var(--text)}
.sortInd{margin-left:8px; font-size:11px; color:var(--muted)}
.sortInd strong{color:var(--text)}

/* Sort indicator without Unicode (CSS triangles) */
.sortInd{
  display:inline-flex;
  align-items:center;
  gap:6px;
  margin-left:8px;
  font-size:11px;
  color:var(--muted);
}
.sortInd .tri{
  width:0; height:0;
  border-left:5px solid transparent;
  border-right:5px solid transparent;
}
.sortInd.asc .tri{
  border-bottom:8px solid var(--text);
}
.sortInd.desc .tri{
  border-top:8px solid var(--text);
}
.sortInd .ord{
  display:inline-grid;
  place-items:center;
  min-width:16px;
  height:16px;
  padding:0 5px;
  border-radius:999px;
  border:1px solid var(--line);
  background: rgba(15,22,32,.55);
  color: var(--text);
  line-height:16px;
}
