:root{
  --bg:#0b0f17;
  --panel:#111827;
  --text:#e5e7eb;
  --muted:#9ca3af;
  --ok:#16a34a;
  --mid:#f59e0b;
  --bad:#ef4444;
  --border:rgba(255,255,255,.08);
}

*{box-sizing:border-box}
body{
  margin:0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: radial-gradient(1200px 800px at 20% 0%, #111827 0%, var(--bg) 60%);
  color:var(--text);
}

.wrap{
  max-width:1100px;
  margin:24px auto;
  padding:0 16px 32px;
}

header{
  display:flex;
  gap:12px;
  align-items:baseline;
  justify-content:space-between;
  flex-wrap:wrap;
  margin-bottom:16px;
}

h1{font-size:20px;margin:0}
.sub{color:var(--muted);font-size:13px}

.panel{
  background: rgba(17,24,39,.8);
  border:1px solid var(--border);
  border-radius:14px;
  padding:14px;
  box-shadow: 0 10px 30px rgba(0,0,0,.35);
}

.controls{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  align-items:flex-end;
}

.field{
  display:flex;
  flex-direction:column;
  gap:6px;
  min-width:260px;
  flex:1;
}

label{font-size:12px;color:var(--muted)}

input{
  width:100%;
  padding:10px 12px;
  border-radius:10px;
  border:1px solid var(--border);
  background: rgba(15,23,42,.8);
  color:var(--text);
  outline:none;
}

input:focus{border-color:rgba(255,255,255,.18)}

.btn{
  padding:10px 12px;
  border-radius:10px;
  border:1px solid var(--border);
  background: rgba(31,41,55,.8);
  color:var(--text);
  cursor:pointer;
  font-weight:600;
}

.btn:hover{filter:brightness(1.1)}
.btn:disabled{opacity:.5;cursor:not-allowed}

.hint{
  margin-top:10px;
  color:var(--muted);
  font-size:13px;
}

.board{
  margin-top:14px;
  overflow:auto;
  border-radius:14px;
  border:1px solid var(--border);
  background: rgba(15,23,42,.45);
}

table{
  width:100%;
  border-collapse:separate;
  border-spacing:0;
  min-width:980px;
}

thead th{
  position:sticky;
  top:0;
  background: rgba(17,24,39,.95);
  border-bottom:1px solid var(--border);
  text-align:left;
  font-size:12px;
  letter-spacing:.02em;
  color:var(--muted);
  padding:10px;
  z-index:1;
  white-space:nowrap;
}

tbody td{
  padding:10px;
  border-bottom:1px solid rgba(255,255,255,.05);
  vertical-align:middle;
}

.cardcell{
  display:flex;
  gap:10px;
  align-items:center;
  min-width:320px;
}

.thumb{
  width:52px;
  height:52px;
  border-radius:10px;
  object-fit:cover;
  border:1px solid var(--border);
  background: rgba(0,0,0,.25);
  flex:0 0 auto;
}

.cardmeta{
  display:flex;
  flex-direction:column;
  gap:2px;
  min-width:0;
}

.name{
  font-weight:700;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  max-width:260px;
}

.small{
  font-size:12px;
  color:var(--muted);
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  max-width:260px;
}

.pill{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  padding:10px 10px;
  border-radius:12px;
  font-weight:800;
  letter-spacing:.01em;
  border:1px solid rgba(255,255,255,.10);
  min-width:120px;
  background: rgba(0,0,0,.12);
  white-space:nowrap;
}

.pill.ok{background: rgba(22,163,74,.20); border-color: rgba(22,163,74,.35)}
.pill.mid{background: rgba(245,158,11,.18); border-color: rgba(245,158,11,.35)}
.pill.bad{background: rgba(239,68,68,.18); border-color: rgba(239,68,68,.35)}

.arrow{opacity:.9; font-size:14px}

.pill .meta2{
  font-size:11px;
  font-weight:700;
  opacity:.85;
  color: rgba(255,255,255,.85);
}

.statusbar{
  margin-top:12px;
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  align-items:center;
  justify-content:space-between;
}

.badge{
  font-size:12px;
  color:var(--muted);
  padding:8px 10px;
  border:1px solid var(--border);
  border-radius:999px;
  background: rgba(15,23,42,.55);
}

.win{
  margin-top:14px;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid rgba(22,163,74,.35);
  background: rgba(22,163,74,.18);
  font-weight:800;
}

.autocomplete{position:relative}

.ac{
  position:absolute;
  top:100%;
  left:0;
  right:0;
  margin-top:8px;
  background: rgba(17,24,39,.98);
  border:1px solid rgba(255,255,255,.10);
  border-radius:12px;
  overflow:hidden;
  box-shadow: 0 18px 40px rgba(0,0,0,.45);
  z-index:50;
}

.ac-item{
  display:flex;
  gap:10px;
  align-items:center;
  padding:10px;
  cursor:pointer;
  border-bottom:1px solid rgba(255,255,255,.06);
}

.ac-item:last-child{border-bottom:none}

.ac-item:hover,
.ac-item.active{
  background: rgba(255,255,255,.06);
}

.ac-img{
  width:38px;
  height:38px;
  border-radius:10px;
  object-fit:cover;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(0,0,0,.25);
  flex:0 0 auto;
}

.ac-meta{
  display:flex;
  flex-direction:column;
  min-width:0;
  gap:2px;
}

.ac-name{
  font-weight:800;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.ac-sub{
  font-size:12px;
  color: rgba(229,231,235,.75);
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

