:root {
  color-scheme: dark;
  --bg: #0d0f13;
  --panel: #161920;
  --panel-2: #1d212a;
  --panel-3: #232834;
  --border: #2a2f3a;
  --text: #e6e8eb;
  --muted: #8a90a0;
  --accent: #4f8cff;
  --accent-soft: rgba(79, 140, 255, .12);
  --green: #35c56a;
  --red: #ef5350;
  --amber: #f2a93b;
  --radius: 12px;
  --sidebar: 232px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 -apple-system, "Segoe UI", Roboto, sans-serif;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1 { font-size: 22px; margin: 0; font-weight: 600; }
h2 { font-size: 16px; margin: 0 0 10px; font-weight: 600; }

/* ---------- Buttons & inputs ---------- */

button {
  font: inherit;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
  border-radius: 8px;
  padding: 8px 14px;
  transition: border-color .15s, background .15s;
}
button:hover { border-color: var(--accent); }
button:disabled { opacity: .5; cursor: not-allowed; }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.danger { background: #3a1a1a; border-color: var(--red); color: #ffb4b0; }
button.ghost { background: transparent; }
button.small { padding: 4px 10px; font-size: 13px; }

input, select, textarea {
  width: 100%;
  padding: 9px 10px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font: inherit;
}
input:focus, select:focus { outline: none; border-color: var(--accent); }
input[type="checkbox"] { width: auto; accent-color: var(--accent); }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
fieldset:disabled { opacity: .7; }

/* ---------- App shell ---------- */

.app { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar);
  flex-shrink: 0;
  background: var(--panel);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand { display: flex; align-items: center; gap: 10px; padding: 20px 18px 16px; color: inherit; text-decoration: none; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 10px;
  display: grid; place-items: center;
  background: var(--accent); color: #fff; font-weight: 700; font-size: 14px;
}
.brand-name { font-weight: 600; }
.brand-sub { color: var(--muted); font-size: 12px; }

.nav { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; flex: 1; }
.nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 8px;
  color: var(--muted); text-decoration: none;
}
.nav a:hover { background: var(--panel-2); color: var(--text); }
.nav a.active { background: var(--accent-soft); color: var(--accent); }
.nav .ico { width: 18px; text-align: center; opacity: .9; }

.sidebar-foot { border-top: 1px solid var(--border); padding: 14px 16px; font-size: 13px; }
.mini-status { display: flex; align-items: center; gap: 8px; color: var(--muted); margin-bottom: 12px; }
.mini-status .dot { width: 9px; height: 9px; }
.me-actions { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }

.main { flex: 1; min-width: 0; padding: 24px 28px 60px; }
.page-head { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.menu-btn { display: none; font-size: 18px; padding: 4px 10px; }
.backdrop { display: none; }

.view { max-width: 1180px; }

/* ---------- Cards ---------- */

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 16px;
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.card-head h2 { margin: 0; }
.card-label { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 10px; }
.card-link { display: inline-block; margin-top: 12px; font-size: 13px; }

.grid-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.grid-cards .card { margin-bottom: 16px; }

.big-number { font-size: 34px; font-weight: 600; line-height: 1.1; }
.big-number.small-text { font-size: 28px; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chip {
  font-size: 12px; padding: 2px 9px; border-radius: 999px;
  background: var(--panel-2); border: 1px solid var(--border); color: var(--text);
}
.chip:hover { border-color: var(--accent); text-decoration: none; }

/* ---------- Status ---------- */

.status-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.status-row.compact { gap: 8px; font-size: 14px; }
.status-text { font-size: 16px; font-weight: 600; }
.status-sub { color: var(--muted); font-size: 13px; }

.dot {
  width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0;
  background: var(--muted);
  box-shadow: 0 0 0 4px rgba(255,255,255,0.04);
}
.dot.on { background: var(--green); box-shadow: 0 0 0 4px rgba(53,197,106,.15); }
.dot.off { background: var(--red); box-shadow: 0 0 0 4px rgba(239,83,80,.15); }
.dot.busy { background: var(--amber); box-shadow: 0 0 0 4px rgba(242,169,59,.15); animation: pulse 1.2s infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.4} }

.actions { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }

/* ---------- Forms ---------- */

.field { margin-bottom: 12px; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.field-row { display: flex; gap: 12px; flex-wrap: wrap; }
.field-row .field { flex: 1 1 260px; }
.field-row .field.narrow { flex: 0 1 120px; }
.top-gap { margin-top: 14px; }

label.check { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; cursor: pointer; }
.inline-form { display: flex; gap: 8px; margin: 10px 0; flex-wrap: wrap; }
.inline-form.no-margin { margin: 0; }
.inline-form input, .inline-form select { flex: 1 1 220px; width: auto; }

.perm-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 2px 14px; }
.perm-list label.check { margin-bottom: 4px; font-size: 14px; }

.error { color: var(--red); font-size: 13px; margin-top: 8px; min-height: 1em; }
.hint { color: var(--muted); font-size: 12px; margin-top: 8px; }
code { background: var(--panel-2); padding: 1px 5px; border-radius: 4px; font-size: 12px; }

/* ---------- Tabs ---------- */

.tabs { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.tabs button.active { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.count { color: var(--muted); font-weight: 400; }

/* ---------- Tables ---------- */

.table-wrap { overflow-x: auto; }
.table-wrap.tall { max-height: 560px; overflow-y: auto; }
table.grid { width: 100%; border-collapse: collapse; font-size: 13px; }
table.grid th, table.grid td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.grid thead th { position: sticky; top: 0; background: var(--panel); color: var(--muted); font-weight: 500; z-index: 1; }
table.grid tbody tr:hover { background: rgba(255,255,255,.02); }
table.grid td.muted { color: var(--muted); }
table.grid td.wrap { white-space: normal; max-width: 420px; }
table.grid td.bad, .bad { color: var(--red); }
table.grid td.good, .good { color: var(--green); }
table.grid tr.warn td { color: var(--amber); }
td.row-actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }

td.avatar-cell { width: 36px; padding-right: 0; }
img.avatar { width: 28px; height: 28px; border-radius: 6px; display: block; }
img.avatar-lg { width: 72px; height: 72px; border-radius: 10px; }

.badge { display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 6px; font-size: 11px; border: 1px solid var(--border); }
.badge.bad { color: var(--red); border-color: var(--red); }

pre.log {
  background: #0a0c10;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  max-height: 420px;
  overflow: auto;
  margin: 0;
  font: 12px/1.5 ui-monospace, Consolas, monospace;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ---------- Profile / sections ---------- */

.profile-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.profile-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; }
.roles-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.profile-section { background: var(--panel-2); border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; min-width: 0; }
.profile-section h3 { font-size: 12px; color: var(--muted); font-weight: 500; margin: 0 0 8px; text-transform: uppercase; letter-spacing: .05em; }
.profile-section pre.log { max-height: 220px; margin-top: 8px; }
.kv { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; padding: 4px 0; border-bottom: 1px solid var(--border); }
.kv:last-child { border-bottom: 0; }
.kv > span:first-child { color: var(--muted); flex-shrink: 0; }
.kv > :last-child { text-align: right; overflow-wrap: anywhere; }
ul.plain { margin: 0; padding-left: 18px; font-size: 13px; }

/* ---------- Modals ---------- */

.modal {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(0,0,0,.6);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 5vh 16px; overflow-y: auto;
}
.modal-box {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  width: 100%;
  max-width: 560px;
}
.modal-box.wide { max-width: 1040px; }

/* ---------- Toast ---------- */

.toast {
  position: fixed; bottom: 20px; right: 20px; z-index: 60;
  background: var(--panel-3); border: 1px solid var(--border);
  padding: 10px 16px; border-radius: 8px; font-size: 13px;
  max-width: 340px;
}

/* ---------- Login page ---------- */

.wrap { max-width: 880px; margin: 0 auto; padding: 24px 16px 60px; }
.login-box { max-width: 360px; margin: 10vh auto; }
.login-box h1 { text-align: center; font-size: 22px; margin-bottom: 16px; }

/* ---------- Mobile ---------- */

@media (max-width: 860px) {
  .sidebar {
    position: fixed; left: 0; top: 0; z-index: 40;
    transform: translateX(-100%);
    transition: transform .2s;
  }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .backdrop { display: block; position: fixed; inset: 0; z-index: 30; background: rgba(0,0,0,.5); }
  .menu-btn { display: inline-block; }
  .main { padding: 16px 16px 60px; }
}

/* ---------- Risk ---------- */

.badge.risk-high { color: var(--red); border-color: var(--red); }
.badge.risk-medium { color: var(--amber); border-color: var(--amber); }
.badge.risk-low { color: var(--muted); }
.risk-level { font-weight: 600; margin-bottom: 8px; }
.risk-level.risk-none { color: var(--green); }
.risk-level.risk-low { color: var(--muted); }
.risk-level.risk-medium { color: var(--amber); }
.risk-level.risk-high { color: var(--red); }
.risk-flag { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; padding: 3px 0; }
.risk-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; flex-shrink: 0; background: var(--muted); }
.risk-dot.risk-medium { background: var(--amber); }
.risk-dot.risk-high { background: var(--red); }

/* ---------- Map ---------- */

.view.view-wide { max-width: none; }
.map-layout { display: grid; grid-template-columns: 1fr 300px; gap: 16px; align-items: start; }
.map-wrap { position: relative; }
#map {
  height: calc(100vh - 120px);
  min-height: 420px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: #0d1b2a;
}
.map-coords {
  position: absolute; left: 10px; bottom: 10px; z-index: 500;
  background: rgba(13,15,19,.8); border: 1px solid var(--border);
  padding: 2px 8px; border-radius: 6px; font: 12px ui-monospace, Consolas, monospace;
}
.map-side .card { margin-bottom: 12px; }
.map-list { display: flex; flex-direction: column; max-height: 260px; overflow-y: auto; }
.map-list-item { padding: 4px 2px; border-bottom: 1px solid var(--border); font-size: 13px; color: var(--text); }
.map-list-item.muted { color: var(--muted); }
.hint.no-top { margin-top: 0; }

.map-player {
  width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid #fff; box-shadow: 0 0 0 2px rgba(0,0,0,.5);
}
.map-player.on { background: var(--green); }
.map-player.off { background: var(--muted); }
.map-player.down { background: var(--amber); }
.leaflet-tooltip.map-label {
  background: rgba(13,15,19,.85); color: var(--text); border: 0;
  box-shadow: none; font-size: 12px; padding: 1px 6px;
}
.leaflet-tooltip.map-label::before { display: none; }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--panel); color: var(--text); }
.leaflet-container a.leaflet-popup-close-button { color: var(--muted); }
.map-popup { display: flex; flex-direction: column; gap: 3px; min-width: 160px; }
.leaflet-container { font: inherit; }

@media (max-width: 1100px) {
  .map-layout { grid-template-columns: 1fr; }
  #map { height: 60vh; }
}

/* ---------- Event feed (map) ---------- */

.map-layout { grid-template-columns: 1fr 380px; }
.map-side { display: flex; flex-direction: column; height: calc(100vh - 120px); min-height: 420px; }
.map-side .card { flex-shrink: 0; }
.map-side .ev-card { flex: 1 1 auto; min-height: 260px; display: flex; flex-direction: column; overflow: hidden; }
.ev-head { margin-bottom: 8px; }
.card-label.no-margin, label.check.no-margin { margin: 0; }
.small-text { font-size: 12px; color: var(--muted); }
.ev-filters { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
.ev-chip {
  font-size: 11px; padding: 2px 8px; border-radius: 999px;
  border: 1px solid var(--c); color: var(--muted); background: transparent;
}
.ev-chip.on { background: color-mix(in srgb, var(--c) 22%, transparent); color: var(--text); }
.ev-player { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; margin-bottom: 6px; color: var(--muted); }
.ev-list { flex: 1; overflow-y: auto; font-size: 12px; border-top: 1px solid var(--border); }
.ev-row { display: flex; gap: 6px; align-items: flex-start; padding: 4px 2px; border-bottom: 1px solid var(--border); }
.ev-row.has-pos { cursor: pointer; }
.ev-row.has-pos:hover { background: rgba(255,255,255,.03); }
.ev-time { color: var(--muted); font-family: ui-monospace, Consolas, monospace; flex-shrink: 0; }
.ev-dot { width: 7px; height: 7px; border-radius: 50%; margin-top: 5px; flex-shrink: 0; }
.ev-text { overflow-wrap: anywhere; }
.ev-name { font-weight: 600; }
.ev-pulse { animation: evpulse 1s ease-out infinite; }
@keyframes evpulse { 0% { stroke-opacity: 1; } 100% { stroke-opacity: .2; } }

@media (max-width: 1100px) {
  .map-side { height: auto; }
  .map-side .ev-card { height: 60vh; }
}

/* ---------- Map side panel: tabs + search ---------- */

.map-layout { grid-template-columns: 1fr 420px; }
.map-side .compact-card { padding: 12px 14px; margin-bottom: 10px; }
.side-tabs { margin-bottom: 10px; }
.side-tabs button { flex: 1; }
.map-side .side-pane { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; overflow: hidden; margin-bottom: 0; }
.map-side .side-pane[hidden] { display: none !important; }
.map-list.tall-list { max-height: none; flex: 1; }
.ev-head-actions { display: flex; align-items: center; gap: 8px; }
#evSearchToggle.active { border-color: var(--accent); color: var(--accent); }
.ev-search {
  border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; margin-bottom: 10px;
  background: var(--panel-2); max-height: 50%; overflow-y: auto; flex-shrink: 0;
}
.ev-search .field { margin-bottom: 8px; }
.ev-search input { padding: 6px 8px; font-size: 13px; }
.ev-search .actions { margin-top: 6px; }
.ev-quick { display: flex; flex-wrap: wrap; gap: 4px; margin: -2px 0 8px; }
.ev-quick button { font-size: 12px; padding: 2px 8px; }
#map.picking, #map.picking .leaflet-interactive { cursor: crosshair; }
.ev-list { min-height: 120px; }

/* Keep Leaflet's internal z-indexes (up to 1000) inside the map so modals and toasts sit on top. */
.map-wrap { isolation: isolate; z-index: 0; }
.modal { z-index: 3000; }
.toast { z-index: 3100; }

/* ---------- Steam login ---------- */

.steam-login {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 11px 14px; border-radius: 8px; font-weight: 600; color: #fff;
  background: linear-gradient(180deg, #2a475e, #1b2838); border: 1px solid #66c0f4;
}
.steam-login:hover { text-decoration: none; filter: brightness(1.15); }
.steam-logo {
  width: 20px; height: 20px; border-radius: 50%;
  background: radial-gradient(circle at 65% 35%, #fff 0 18%, #66c0f4 19% 32%, transparent 33%), #171a21;
  border: 2px solid #66c0f4;
}
.login-divider { display: flex; align-items: center; gap: 10px; margin: 18px 0 14px; color: var(--muted); font-size: 12px; }
.login-divider::before, .login-divider::after { content: ''; flex: 1; border-top: 1px solid var(--border); }

/* ---------- Autocomplete ---------- */

.ac-wrap { position: relative; }
.ac-list {
  position: absolute; left: 0; right: 0; top: calc(100% + 2px); z-index: 20;
  background: var(--panel-3); border: 1px solid var(--border); border-radius: 8px;
  max-height: 260px; overflow-y: auto; box-shadow: 0 8px 24px rgba(0,0,0,.4);
}
.ac-item { display: flex; justify-content: space-between; gap: 10px; padding: 6px 10px; cursor: pointer; font-size: 13px; }
.ac-item.active, .ac-item:hover { background: var(--accent-soft); }
.ac-name { overflow-wrap: anywhere; }
.ac-meta { color: var(--muted); font-size: 11px; flex-shrink: 0; }
.map-side .side-pane[data-pane="side:loot"] { overflow: visible; }

/* ---------- Loot search (chips + legend) ---------- */

.loot-pane { overflow-y: auto !important; }
.chip-input {
  display: flex; flex-wrap: wrap; gap: 4px; align-items: center;
  background: var(--panel-2); border: 1px solid var(--border); border-radius: 8px; padding: 4px; cursor: text;
}
.chip-input:focus-within { border-color: var(--accent); }
.chip-input .ac-wrap { flex: 1 1 120px; }
.chip-input input { border: 0; background: transparent; padding: 4px 6px; }
.chip-input input:focus { border: 0; }
.loot-chips { display: contents; }
.loot-chip {
  display: inline-flex; align-items: center; gap: 4px; font-size: 12px;
  background: var(--accent-soft); color: var(--text); border: 1px solid var(--accent);
  border-radius: 999px; padding: 1px 4px 1px 9px;
}
.loot-chip-x { border: 0; background: transparent; color: var(--muted); padding: 0 4px; font-size: 14px; line-height: 1; }
.loot-chip-x:hover { color: var(--red); }
.loot-area { border-left: 2px solid var(--amber); padding-left: 10px; margin-bottom: 6px; }
.loot-legend { display: flex; flex-direction: column; margin-top: 8px; }
.loot-legend-row { display: flex; align-items: center; gap: 8px; padding: 3px 2px; font-size: 13px; color: var(--text); border-bottom: 1px solid var(--border); }
.loot-legend-row:hover { background: rgba(255,255,255,.03); text-decoration: none; }
.loot-legend-name { flex: 1; overflow-wrap: anywhere; }
.loot-legend-row .ev-dot { margin-top: 0; }

/* ---------- Min statistik ---------- */

.me-head { display: flex; align-items: center; gap: 16px; }
.me-name { font-size: 22px; font-weight: 600; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.stat-tile { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.stat-label { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }
.stat-value { font-size: 28px; font-weight: 600; margin-top: 4px; }
.stat-sub { color: var(--muted); font-size: 12px; margin-top: 2px; }
.stat-rank { color: var(--accent); font-size: 12px; margin-top: 6px; }
.me-events { max-height: 420px; }

/* ---------- Leaderboards ---------- */

.lb-title { margin: 22px 0 12px; }
.lb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.lb-card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.lb-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 8px; }
.lb-head h3 { margin: 0; font-size: 15px; }
.lb-head .count { font-size: 12px; }
.lb-row { display: grid; grid-template-columns: 34px 1fr auto; gap: 8px; align-items: center; padding: 5px 6px; border-radius: 6px; font-size: 14px; }
.lb-row:nth-child(odd) { background: rgba(255,255,255,.02); }
.lb-row.me { background: var(--accent-soft); outline: 1px solid var(--accent); }
.lb-rank { color: var(--muted); font-variant-numeric: tabular-nums; }
.lb-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-value { font-weight: 600; font-variant-numeric: tabular-nums; }
.lb-gap { text-align: center; color: var(--muted); line-height: 1; }

/* ---------- Player track panel ---------- */

.track-panel {
  position: absolute; left: 10px; right: 10px; bottom: 34px; z-index: 600;
  background: rgba(22,25,32,.94); border: 1px solid var(--border); border-radius: 10px;
  padding: 10px 12px; max-width: 760px;
}
.track-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.track-ranges { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 8px; }
.track-ranges input { width: auto; padding: 3px 6px; font-size: 12px; }
.track-play { display: flex; align-items: center; gap: 8px; }
.track-play input[type="range"] { flex: 1; padding: 0; accent-color: var(--accent); }
.track-time { font: 12px ui-monospace, Consolas, monospace; color: var(--muted); min-width: 120px; text-align: right; }

/* ---------- Storage card ---------- */

table.grid td.num { text-align: right; font-variant-numeric: tabular-nums; }

table.grid td.mono, .mono { font-family: ui-monospace, Consolas, monospace; font-size: 12px; }
table.grid td.warn-text { color: var(--amber); }
.ip-cell .small-text { color: var(--muted); font-size: 11px; }
.ip-cell .warn-text, .small-text.warn-text { color: var(--amber); }

/* ---------- Multi-player tracks ---------- */

.track-panel { max-width: 900px; }
.track-head { gap: 8px; flex-wrap: wrap; }
.track-players { display: flex; flex-wrap: wrap; gap: 4px; flex: 1; }
.track-chip { gap: 6px; }
.track-add { width: 180px; }
.track-add input { padding: 3px 8px; font-size: 12px; }
.track-ranges select { width: auto; padding: 3px 6px; font-size: 12px; }
.track-feed { margin-top: 6px; font-size: 12px; max-height: 76px; overflow-y: auto; }
.track-feed-row { display: flex; gap: 6px; align-items: center; }
.track-feed-row .ev-dot { margin-top: 0; }
.ev-fight { margin-left: auto; padding: 1px 6px; font-size: 11px; flex-shrink: 0; }

/* ---------- Body bags on the map ---------- */

.bag-icon { width: 14px; height: 14px; border-radius: 3px; background: #a1724e; border: 2px solid #fff; box-shadow: 0 0 0 2px rgba(0,0,0,.5); }
.bag-items { max-height: 180px; overflow-y: auto; font-size: 12px; margin: 4px 0; border-top: 1px solid var(--border); padding-top: 4px; }

/* Language switch (login page and admin sidebar) */
.login-box { position: relative; }
.login-lang, .side-lang { display: flex; gap: 2px; padding: 3px; border-radius: 8px; border: 1px solid var(--border, rgba(255,255,255,.12)); width: max-content; }
.login-lang { position: absolute; top: 14px; right: 14px; }
.login-lang button, .side-lang button {
  border: 0; background: none; color: var(--muted); cursor: pointer; padding: 4px 8px; border-radius: 6px;
  font-weight: 700; font-size: 11px; line-height: 1; letter-spacing: .08em;
}
.login-lang button.active, .side-lang button.active { background: rgba(255,255,255,.1); color: var(--text, #fff); }
.login-box h1 { margin-top: 26px; }

/* Role cards: title and edit button on one row */
.role-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.role-head h3 { margin: 0; }
