/* ============================================================
   BF2142 COMMAND TERMINAL  –  Stylesheet
   Tactical HUD · EU-Cyan / PAC-Amber · dark
   ============================================================ */

:root {
  --bg:        #080b11;
  --bg-grid:   rgba(56, 225, 255, 0.035);
  --panel:     #0f1521;
  --panel-2:   #0b1019;
  --raised:    #141c2b;
  --line:      #1d2a3c;
  --line-soft: #15202f;
  --text:      #cdd8e4;
  --muted:     #61748b;
  --dim:       #3d4d61;
  --accent:    #38e1ff;   /* EU */
  --accent-2:  #ff9d2e;   /* PAC */
  --danger:    #ff4d5e;
  --ok:        #41dd8b;
  --warn:      #ffd23f;
  --mono: 'Share Tech Mono', ui-monospace, monospace;
  --disp: 'Rajdhani', system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  font-family: var(--disp);
  background:
    linear-gradient(var(--bg-grid) 1px, transparent 1px) 0 0 / 100% 32px,
    linear-gradient(90deg, var(--bg-grid) 1px, transparent 1px) 0 0 / 32px 100%,
    radial-gradient(1200px 600px at 80% -10%, rgba(56,225,255,.06), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(255,157,46,.05), transparent 60%),
    var(--bg);
  color: var(--text);
  font-size: 15px;
  letter-spacing: .3px;
  overflow: hidden;
}

/* faint scanline overlay */
body::after {
  content: "";
  position: fixed; inset: 0;
  background: repeating-linear-gradient(
    to bottom, rgba(0,0,0,0) 0 2px, rgba(0,0,0,.10) 2px 3px);
  pointer-events: none;
  z-index: 9999;
  opacity: .35;
}

/* ----------------------------------------------------- LAYOUT */
.app { display: grid; grid-template-columns: 248px 1fr; height: 100vh; }

/* ----------------------------------------------------- SIDEBAR */
.side {
  background: linear-gradient(180deg, var(--panel) 0%, var(--panel-2) 100%);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
  position: relative;
}
.side::before {
  content: ""; position: absolute; top: 0; right: -1px; width: 2px; height: 100%;
  background: linear-gradient(180deg, var(--accent), transparent 40%);
  opacity: .4;
}
.brand { padding: 22px 22px 18px; border-bottom: 1px solid var(--line); }
.brand .tag {
  font-family: var(--mono); font-size: 10px; letter-spacing: 3px;
  color: var(--accent); text-transform: uppercase;
}
.brand h1 {
  font-size: 24px; font-weight: 700; line-height: 1; margin-top: 6px;
  text-transform: uppercase; letter-spacing: 1px;
}
.brand h1 b { color: var(--accent-2); }
.brand .sub { font-family: var(--mono); font-size: 10px; color: var(--dim); margin-top: 7px; }

.nav { padding: 14px 12px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.nav button {
  all: unset; cursor: pointer;
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px; border-radius: 3px;
  font-family: var(--disp); font-weight: 600; font-size: 15px;
  letter-spacing: .8px; text-transform: uppercase; color: var(--muted);
  border-left: 2px solid transparent;
  transition: .15s;
}
.nav button .ico { width: 18px; text-align: center; font-size: 14px; opacity: .8; }
.nav button:hover { background: var(--raised); color: var(--text); }
.nav button.active {
  background: linear-gradient(90deg, rgba(56,225,255,.12), transparent);
  color: var(--accent); border-left-color: var(--accent);
}
.side-foot { padding: 14px; border-top: 1px solid var(--line); font-family: var(--mono); font-size: 10px; color: var(--dim); }

/* ----------------------------------------------------- MAIN */
.main { display: flex; flex-direction: column; min-width: 0; }

.topbar {
  display: flex; align-items: center; gap: 16px;
  padding: 14px 26px; border-bottom: 1px solid var(--line);
  background: rgba(11,16,25,.6); backdrop-filter: blur(4px);
}
.topbar .view-title {
  font-size: 20px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.5px;
}
.topbar .spacer { flex: 1; }

.srv-select { position: relative; }
.srv-select label { display:block; font-family: var(--mono); font-size: 9px; color: var(--dim); letter-spacing: 2px; margin-bottom: 3px; }
select.server {
  font-family: var(--mono); font-size: 13px; color: var(--text);
  background: var(--raised); border: 1px solid var(--line);
  padding: 8px 30px 8px 12px; border-radius: 3px; cursor: pointer;
  appearance: none; min-width: 230px;
  background-image: linear-gradient(45deg, transparent 50%, var(--accent) 50%),
                    linear-gradient(135deg, var(--accent) 50%, transparent 50%);
  background-position: calc(100% - 16px) center, calc(100% - 11px) center;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat;
}
select.server:focus { outline: none; border-color: var(--accent); }

.status-dot { display: flex; align-items: center; gap: 7px; font-family: var(--mono); font-size: 11px; color: var(--muted); }
.status-dot i { width: 9px; height: 9px; border-radius: 50%; background: var(--dim); box-shadow: 0 0 0 0 transparent; }
.status-dot.on i { background: var(--ok); box-shadow: 0 0 10px var(--ok); animation: pulse 2s infinite; }
.status-dot.err i { background: var(--danger); box-shadow: 0 0 10px var(--danger); }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.4} }

.content { flex: 1; overflow-y: auto; padding: 26px; }
.content::-webkit-scrollbar { width: 10px; }
.content::-webkit-scrollbar-thumb { background: var(--line); border-radius: 0; }
.content::-webkit-scrollbar-track { background: transparent; }

.view { display: none; animation: fade .25s ease; max-width: 1280px; margin: 0 auto; }
.view.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ----------------------------------------------------- PANELS */
.panel {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 4px; position: relative; margin-bottom: 22px;
}
/* HUD corner brackets */
.panel::before, .panel::after {
  content: ""; position: absolute; width: 12px; height: 12px; pointer-events: none;
}
.panel::before { top: -1px; left: -1px; border-top: 2px solid var(--accent); border-left: 2px solid var(--accent); }
.panel::after  { bottom: -1px; right: -1px; border-bottom: 2px solid var(--accent); border-right: 2px solid var(--accent); }

.panel-head {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 18px; border-bottom: 1px solid var(--line-soft);
}
.panel-head h2 {
  font-size: 15px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.5px;
}
.panel-head .hint { font-family: var(--mono); font-size: 10px; color: var(--dim); }
.panel-head .spacer { flex: 1; }
.panel-body { padding: 16px; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.grid3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; }
@media (max-width: 820px) { .grid2, .grid3 { grid-template-columns: 1fr; } }

/* Formular-/Button-Spalten nicht endlos breit ziehen.
   (Konsole + Spielerliste bleiben absichtlich voll breit.) */
#view-maps .panel-body.stack,
#view-chat .panel-body.stack,
#view-bans .panel-body.stack { max-width: 600px; }

/* ----------------------------------------------------- BUTTONS */
.btn {
  all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--disp); font-weight: 600; font-size: 13px;
  text-transform: uppercase; letter-spacing: 1px;
  padding: 8px 15px; border-radius: 3px;
  background: var(--raised); color: var(--text);
  border: 1px solid var(--line); transition: .14s; text-align: center; justify-content: center;
}
.btn:hover { border-color: var(--accent); color: var(--accent); box-shadow: 0 0 14px rgba(56,225,255,.15); }
.btn:active { transform: translateY(1px); }
.btn.full { width: 100%; }
.btn.primary { background: linear-gradient(135deg, rgba(56,225,255,.18), rgba(56,225,255,.04)); border-color: var(--accent); color: var(--accent); }
.btn.amber { border-color: var(--accent-2); color: var(--accent-2); }
.btn.amber:hover { box-shadow: 0 0 14px rgba(255,157,46,.18); }
.btn.danger { border-color: rgba(255,77,94,.5); color: var(--danger); }
.btn.danger:hover { background: rgba(255,77,94,.12); box-shadow: 0 0 14px rgba(255,77,94,.2); }
.btn.sm { padding: 6px 11px; font-size: 12px; }
.btn:disabled { opacity: .4; cursor: not-allowed; }

/* ----------------------------------------------------- INPUTS */
.field label { display: block; font-family: var(--mono); font-size: 10px; color: var(--muted); letter-spacing: 2px; margin-bottom: 6px; text-transform: uppercase; }
input[type=text], input[type=password], input[type=number], textarea, select.in {
  width: 100%; font-family: var(--mono); font-size: 13px; color: var(--text);
  background: var(--panel-2); border: 1px solid var(--line);
  padding: 11px 13px; border-radius: 3px; transition: .14s;
}
input:focus, textarea:focus, select.in:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 1px rgba(56,225,255,.25); }
textarea { resize: vertical; min-height: 70px; line-height: 1.5; }
.row { display: flex; gap: 10px; align-items: flex-end; }
.row .field { flex: 1; }
.stack > * + * { margin-top: 14px; }

/* ----------------------------------------------------- TABLE / PLAYERS */
.players { display: flex; flex-direction: column; gap: 8px; }
.prow {
  display: grid; grid-template-columns: 46px 1fr 150px auto; align-items: center; gap: 14px;
  padding: 12px 16px; background: var(--panel-2); border: 1px solid var(--line-soft);
  border-radius: 3px; transition: .14s;
}
.prow:hover { border-color: var(--line); background: var(--raised); }
.prow .pid { font-family: var(--mono); color: var(--accent); font-size: 16px; }
.prow .pname { font-weight: 600; font-size: 16px; letter-spacing: .5px; }
.prow .pip { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.prow .pacts { display: flex; gap: 8px; }
.empty { text-align: center; padding: 38px; color: var(--dim); font-family: var(--mono); font-size: 13px; }

/* ----------------------------------------------------- CONSOLE */
.console {
  font-family: var(--mono); font-size: 13px; line-height: 1.6;
  background: #05070b; border: 1px solid var(--line);
  border-radius: 3px; padding: 16px; height: 360px; overflow-y: auto;
  white-space: pre-wrap; word-break: break-word; color: #9fb4c8;
}
.console::-webkit-scrollbar { width: 8px; }
.console::-webkit-scrollbar-thumb { background: var(--line); }
.console .cin  { color: var(--accent); }
.console .cerr { color: var(--danger); }
.console .cok  { color: var(--ok); }
.console .cts  { color: var(--dim); }

/* quick command chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  all: unset; cursor: pointer; font-family: var(--mono); font-size: 12px;
  padding: 6px 12px; border: 1px solid var(--line); border-radius: 20px; color: var(--muted);
  transition: .14s;
}
.chip:hover { border-color: var(--accent); color: var(--accent); }

/* badges */
.badge { font-family: var(--mono); font-size: 10px; padding: 3px 8px; border-radius: 2px; letter-spacing: 1px; text-transform: uppercase; }
.badge.remote { background: rgba(56,225,255,.12); color: var(--accent); }
.badge.local  { background: rgba(255,157,46,.12); color: var(--accent-2); }
.badge.role-admin { background: rgba(255,157,46,.14); color: var(--accent-2); }
.badge.role-user  { background: rgba(56,225,255,.12); color: var(--accent); }

/* user-Verwaltung */
.urow { display: grid; grid-template-columns: 1fr 96px 1.3fr auto; align-items: center; gap: 14px;
  padding: 12px 16px; background: var(--panel-2); border: 1px solid var(--line-soft); border-radius: 3px; }
.urow + .urow { margin-top: 8px; }
.urow .uname { font-weight: 600; font-size: 15px; }
.urow .ulogin { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.urow .usrv { font-family: var(--mono); font-size: 11px; color: var(--muted); line-height: 1.4; }
.urow .pacts { display: flex; gap: 8px; }
label.cbx { display: inline-flex; align-items: center; gap: 7px; cursor: pointer;
  font-family: var(--mono); font-size: 12px; padding: 6px 12px; border: 1px solid var(--line);
  border-radius: 20px; color: var(--muted); transition: .14s; }
label.cbx:hover { border-color: var(--accent); color: var(--text); }
label.cbx input { accent-color: var(--accent); }

/* raw pre block */
pre.raw {
  font-family: var(--mono); font-size: 12px; line-height: 1.55; color: var(--muted);
  background: #05070b; border: 1px solid var(--line-soft); border-radius: 3px;
  padding: 14px; white-space: pre-wrap; max-height: 280px; overflow: auto;
}

/* ----------------------------------------------------- MODAL */
.modal-bg {
  position: fixed; inset: 0; background: rgba(3,5,9,.78); backdrop-filter: blur(3px);
  display: none; align-items: center; justify-content: center; z-index: 100;
}
.modal-bg.show { display: flex; }
.modal {
  width: 420px; max-width: 92vw; background: var(--panel); border: 1px solid var(--line);
  border-radius: 5px; position: relative; animation: fade .2s;
}
.modal::before { content:""; position:absolute; top:-1px; left:-1px; width:14px; height:14px; border-top:2px solid var(--accent-2); border-left:2px solid var(--accent-2); }
.modal-head { padding: 16px 20px; border-bottom: 1px solid var(--line-soft); display:flex; align-items:center; }
.modal-head h3 { font-size: 17px; text-transform: uppercase; letter-spacing: 1px; }
.modal-head .x { all:unset; cursor:pointer; margin-left:auto; color: var(--muted); font-size: 20px; line-height:1; }
.modal-head .x:hover { color: var(--danger); }
.modal-body { padding: 20px; }
.modal-foot { padding: 16px 20px; border-top: 1px solid var(--line-soft); display: flex; gap: 10px; }
.modal-foot .btn { flex: 1; }
.seg { display: flex; gap: 0; border: 1px solid var(--line); border-radius: 3px; overflow: hidden; }
.seg button { all: unset; cursor: pointer; flex: 1; text-align: center; padding: 9px; font-family: var(--mono); font-size: 12px; color: var(--muted); transition: .14s; }
.seg button.on { background: var(--accent); color: #05070b; font-weight: bold; }
.seg button:not(.on):hover { background: var(--raised); color: var(--text); }

/* ----------------------------------------------------- LOGIN */
.login-bg {
  position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(900px 500px at 50% 30%, rgba(56,225,255,.08), transparent 60%),
    var(--bg);
}
.login-card { width: 380px; max-width: 90vw; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; position: relative; padding: 34px 30px; }
.login-card::before { content:""; position:absolute; top:-1px; left:-1px; width:16px; height:16px; border-top:2px solid var(--accent); border-left:2px solid var(--accent); }
.login-card::after  { content:""; position:absolute; bottom:-1px; right:-1px; width:16px; height:16px; border-bottom:2px solid var(--accent-2); border-right:2px solid var(--accent-2); }
.login-card .tag { font-family: var(--mono); font-size: 10px; letter-spacing: 4px; color: var(--accent); }
.login-card h1 { font-size: 30px; text-transform: uppercase; letter-spacing: 1px; margin: 8px 0 4px; }
.login-card h1 b { color: var(--accent-2); }
.login-card p { font-family: var(--mono); font-size: 11px; color: var(--dim); margin-bottom: 24px; }
.login-err { color: var(--danger); font-family: var(--mono); font-size: 12px; margin-top: 12px; min-height: 16px; }

/* toast */
.toast-wrap { position: fixed; top: 20px; right: 20px; z-index: 300; display: flex; flex-direction: column; gap: 10px; }
.toast {
  font-family: var(--mono); font-size: 13px; padding: 13px 18px; border-radius: 3px;
  background: var(--raised); border-left: 3px solid var(--accent); color: var(--text);
  box-shadow: 0 8px 30px rgba(0,0,0,.5); animation: slidein .25s; max-width: 360px;
}
.toast.ok { border-left-color: var(--ok); }
.toast.err { border-left-color: var(--danger); }
@keyframes slidein { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }

.spin { display:inline-block; width:13px; height:13px; border:2px solid var(--line); border-top-color: var(--accent); border-radius:50%; animation: rot .7s linear infinite; }
@keyframes rot { to { transform: rotate(360deg); } }
