/* style.css — SM64 Germany Moderations-Panel. Dunkles Theme, responsiv. */

:root {
  --bg:        #15171c;
  --bg-2:      #1d2027;
  --bg-3:      #262a33;
  --bg-hover:  #2e333d;
  --border:    #353b46;
  --text:      #e7e9ee;
  --text-dim:  #9aa1ad;
  --accent:    #4f8cff;
  --accent-d:  #3a6fd6;
  --green:     #3ecf6a;
  --red:       #ef4f4f;
  --amber:     #f0b429;
  --danger:    #e23b3b;
  --danger-d:  #b92e2e;
  --radius:    8px;
  --shadow:    0 6px 24px rgba(0,0,0,.45);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.4;
}

.hidden { display: none !important; }
.muted  { color: var(--text-dim); font-size: 12px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: 1px solid var(--border);
  background: var(--bg-3);
  color: var(--text);
  padding: 7px 12px;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 13px;
  font-family: inherit;
  transition: background .12s, border-color .12s;
  white-space: nowrap;
}
.btn:hover  { background: var(--bg-hover); }
.btn:active { transform: translateY(1px); }
.btn-small  { padding: 5px 9px; font-size: 12px; }
.btn-block  { width: 100%; margin-top: 14px; padding: 10px; }
.btn-primary { background: var(--accent); border-color: var(--accent-d); }
.btn-primary:hover { background: var(--accent-d); }
.btn-danger { background: var(--danger); border-color: var(--danger-d); }
.btn-danger:hover { background: var(--danger-d); }
.btn-ghost  { background: transparent; }
.btn-ghost:hover { background: var(--bg-3); }

.btn-kick   { border-color: #6b7280; }
.btn-ban    { border-color: var(--amber); color: var(--amber); }
.btn-ban:hover { background: rgba(240,180,41,.12); }
.btn-permban{ border-color: var(--red); color: var(--red); }
.btn-permban:hover { background: rgba(239,79,79,.12); }
.btn-unban  { border-color: var(--green); color: var(--green); }
.btn-unban:hover { background: rgba(62,207,106,.12); }

/* ---------- Login ---------- */
.login-screen {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(1200px 600px at 50% -10%, #20242e, var(--bg));
  padding: 20px;
}
.login-box {
  width: 100%; max-width: 360px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px 26px;
  box-shadow: var(--shadow);
}
.login-box h1 { margin: 0; font-size: 22px; letter-spacing: .5px; }
.login-sub { margin: 4px 0 22px; color: var(--text-dim); font-size: 13px; }
.login-box label {
  display: block; margin: 14px 0 5px;
  font-size: 12px; color: var(--text-dim); text-transform: uppercase; letter-spacing: .4px;
}
.login-box input {
  width: 100%; padding: 10px 11px;
  background: var(--bg); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius);
  font-size: 14px; font-family: inherit;
}
.login-box input:focus { outline: none; border-color: var(--accent); }
.login-error { color: var(--red); font-size: 13px; min-height: 18px; margin: 12px 0 0; }

/* ---------- Topbar ---------- */
.app { display: flex; flex-direction: column; min-height: 100vh; }
.topbar {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 10px 16px;
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 40;
}
.topbar-left, .topbar-mid, .topbar-right { display: flex; align-items: center; gap: 10px; }
.topbar-right { margin-left: auto; }
.brand { font-weight: 700; letter-spacing: .4px; }
.srv-label { color: var(--text-dim); font-size: 12px; }
.server-select {
  background: var(--bg-3); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 6px 10px; font-size: 13px; font-family: inherit; max-width: 280px;
}
.srv-info { color: var(--text-dim); font-size: 12px; }

.conn-pill {
  font-size: 11px; padding: 3px 9px; border-radius: 999px;
  border: 1px solid var(--border); white-space: nowrap;
}
.conn-ok      { background: rgba(62,207,106,.15); color: var(--green);  border-color: rgba(62,207,106,.4); }
.conn-error   { background: rgba(239,79,79,.15);  color: var(--red);    border-color: rgba(239,79,79,.4); }
.conn-offline { background: rgba(240,180,41,.15); color: var(--amber);  border-color: rgba(240,180,41,.4); }
.conn-unknown { background: var(--bg-3); color: var(--text-dim); }

/* ---------- Tabs ---------- */
.tabs {
  display: flex; gap: 2px;
  padding: 0 12px; background: var(--bg-2);
  border-bottom: 1px solid var(--border);
}
.tab {
  background: transparent; border: none; color: var(--text-dim);
  padding: 11px 16px; cursor: pointer; font-size: 14px; font-family: inherit;
  border-bottom: 2px solid transparent;
}
.tab:hover { color: var(--text); }
.tab-active { color: var(--text); border-bottom-color: var(--accent); }

.tab-panel { padding: 14px 16px; flex: 1; }

/* ---------- Toolbar ---------- */
.toolbar {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  margin-bottom: 12px;
}
.filter-input {
  flex: 1; min-width: 180px; max-width: 360px;
  background: var(--bg-3); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 8px 11px; font-size: 13px; font-family: inherit;
}
.filter-input:focus { outline: none; border-color: var(--accent); }
.pause-toggle { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-dim); cursor: pointer; }
.refresh-ind { font-variant-numeric: tabular-nums; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
.data-table {
  width: 100%; border-collapse: collapse; font-size: 13px;
  min-width: 900px;
}
.data-table thead th {
  position: sticky; top: 0; z-index: 1;
  background: var(--bg-3); text-align: left;
  padding: 9px 10px; border-bottom: 1px solid var(--border);
  white-space: nowrap; font-weight: 600; color: var(--text);
}
.data-table thead th[data-sort] { cursor: pointer; user-select: none; }
.data-table thead th[data-sort]:hover { background: var(--bg-hover); }
.data-table thead th .arrow { color: var(--accent); margin-left: 4px; }
.data-table tbody td {
  padding: 8px 10px; border-bottom: 1px solid var(--bg-3);
  white-space: nowrap; vertical-align: middle;
}
.data-table tbody tr:hover { background: var(--bg-2); }
.data-table tbody tr:last-child td { border-bottom: none; }
.col-actions { text-align: right; }
.cell-name { font-weight: 600; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.cell-ip   { font-family: ui-monospace, "Cascadia Code", Menlo, monospace; color: var(--text-dim); }
.cell-pos  { font-family: ui-monospace, monospace; color: var(--text-dim); font-size: 12px; }
.cell-num  { font-variant-numeric: tabular-nums; }

.row-actions { display: inline-flex; gap: 6px; justify-content: flex-end; }

.empty-note { padding: 18px; text-align: center; color: var(--text-dim); }

/* ---------- Color swatch & chips ---------- */
.swatch {
  display: inline-block; width: 22px; height: 22px;
  border-radius: 5px; border: 1px solid rgba(255,255,255,.25);
  vertical-align: middle; cursor: help;
}
.badge-mod {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  font-size: 11px; font-weight: 700;
  background: rgba(79,140,255,.18); color: var(--accent); border: 1px solid rgba(79,140,255,.4);
}
.badge-perm {
  display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 700;
}
.badge-perm.yes { background: rgba(239,79,79,.18); color: var(--red); border: 1px solid rgba(239,79,79,.4); }
.badge-perm.no  { background: var(--bg-3); color: var(--text-dim); border: 1px solid var(--border); }

/* Palette tooltip */
.palette-tip {
  position: fixed; z-index: 100;
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: 8px; padding: 10px; box-shadow: var(--shadow);
  pointer-events: none; max-width: 240px;
}
.palette-tip .pt-title { font-size: 12px; color: var(--text-dim); margin-bottom: 8px; }
.palette-tip .pt-row { display: flex; align-items: center; gap: 8px; margin: 4px 0; font-size: 12px; }
.palette-tip .pt-chip {
  width: 16px; height: 16px; border-radius: 4px; border: 1px solid rgba(255,255,255,.25); flex: none;
}
.palette-tip .pt-label { color: var(--text); min-width: 78px; }
.palette-tip .pt-hex { color: var(--text-dim); font-family: ui-monospace, monospace; }

/* ---------- Events feed ---------- */
.events-feed { list-style: none; margin: 0; padding: 0; }
.events-feed li {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius);
  margin-bottom: 8px; background: var(--bg-2);
}
.ev-icon { font-size: 18px; line-height: 1.2; flex: none; width: 24px; text-align: center; }
.ev-body { flex: 1; }
.ev-text { font-size: 14px; }
.ev-time { font-size: 11px; color: var(--text-dim); margin-top: 2px; }
.ev-star  { border-left: 3px solid var(--amber); }
.ev-join  { border-left: 3px solid var(--green); }
.ev-leave { border-left: 3px solid var(--red); }
.ev-level { border-left: 3px solid var(--accent); }
.ev-star .ev-text  b { color: var(--amber); }
.ev-join .ev-text  b { color: var(--green); }
.ev-leave .ev-text b { color: var(--red); }

/* ---------- Confirm dialog / overlay ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 80;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.55); padding: 20px;
}
.dialog {
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: 12px; padding: 22px; max-width: 420px; width: 100%;
  box-shadow: var(--shadow);
}
.dialog h2 { margin: 0 0 10px; font-size: 18px; }
.dialog p  { margin: 0 0 18px; color: var(--text); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; }

/* ---------- Toasts ---------- */
.toasts {
  position: fixed; right: 16px; bottom: 16px; z-index: 120;
  display: flex; flex-direction: column; gap: 8px; max-width: 360px;
}
.toast {
  background: var(--bg-2); border: 1px solid var(--border); border-left-width: 4px;
  border-radius: var(--radius); padding: 11px 14px; box-shadow: var(--shadow);
  font-size: 13px; animation: toast-in .15s ease-out;
}
.toast-ok    { border-left-color: var(--green); }
.toast-error { border-left-color: var(--red); }
.toast-info  { border-left-color: var(--accent); }
.toast b { display: block; margin-bottom: 2px; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
  .topbar { gap: 8px; padding: 8px 10px; }
  .topbar-mid, .topbar-right { margin-left: 0; }
  .srv-info { display: none; }
  .server-select { max-width: 150px; }
  .tab-panel { padding: 10px; }
  .filter-input { max-width: none; }
}
