/* Dead Evo · painel de administração (2026-11-19). Tema escuro, vermelho do Dead Evo, funciona do celular ao PC. */
:root {
  --bg: #0b0d10; --bg-2: #101317; --panel: #14181d; --panel-2: #1a1f26; --line: #232a33; --line-2: #2e3742;
  --text: #e8ecf1; --muted: #8b95a3; --faint: #5d6774;
  --red: #d33a2c; --red-2: #a8281d; --red-soft: rgba(211, 58, 44, .14);
  --gold: #f0b84a; --gold-soft: rgba(240, 184, 74, .14);
  --green: #3fbf7f; --green-soft: rgba(63, 191, 127, .14);
  --blue: #4aa3df; --blue-soft: rgba(74, 163, 223, .14);
  --orange: #f08a3c; --violet: #9d7bf0;
  --radius: 14px; --radius-sm: 9px; --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  --sidebar: 248px; --top: 62px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--gold); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: 22px; } h2 { font-size: 16px; } h3 { font-size: 14px; }
.mono { font-family: var(--mono); font-size: 12.5px; }
.muted { color: var(--muted); } .faint { color: var(--faint); }
.hidden { display: none !important; }

/* Layout */
.app { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--bg-2); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 16px 12px; gap: 4px; z-index: 30; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 16px; }
.brand img { width: 34px; height: 34px; border-radius: 9px; }
.brand b { font-size: 16px; letter-spacing: .02em; } .brand span { display: block; color: var(--muted); font-size: 11.5px; }
.nav-group { margin: 12px 8px 4px; color: var(--faint); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; color: var(--muted); font-weight: 500; }
.nav a:hover { background: var(--panel); color: var(--text); }
.nav a.active { background: var(--red-soft); color: var(--text); box-shadow: inset 3px 0 0 var(--red); }
.nav a svg { width: 18px; height: 18px; flex: none; opacity: .9; }
.nav a .count { margin-left: auto; background: var(--red); color: #fff; border-radius: 99px; font-size: 11px; padding: 0 7px; }
.sidebar-foot { margin-top: auto; padding: 12px 8px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; height: var(--top); display: flex; align-items: center; gap: 12px; padding: 0 22px;
  background: rgba(11, 13, 16, .86); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.topbar .title { font-weight: 700; font-size: 16px; }
.topbar .spacer { flex: 1; }
.menu-btn { display: none; }
.content { padding: 22px; max-width: 1500px; width: 100%; margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

/* Grids and cards */
.grid { display: grid; gap: 16px; }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; } .span-all { grid-column: 1 / -1; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; min-width: 0; }
.card-head { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 14px; }
.card-head p { margin: 2px 0 0; color: var(--muted); font-size: 12.5px; }
.card-head .actions { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; position: relative; overflow: hidden; }
.stat .label { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.stat .value { font-size: 28px; font-weight: 750; margin-top: 4px; letter-spacing: -.02em; }
.stat .hint { color: var(--muted); font-size: 12px; margin-top: 2px; }
.stat::after { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--tone, var(--line-2)); }
.tone-red { --tone: var(--red); } .tone-gold { --tone: var(--gold); } .tone-green { --tone: var(--green); } .tone-blue { --tone: var(--blue); }

/* Buttons and fields */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid var(--line-2); background: var(--panel-2); color: var(--text);
  border-radius: 10px; padding: 8px 14px; font-weight: 600; cursor: pointer; white-space: nowrap; transition: .12s; }
.btn:hover { border-color: #3c4652; background: #20262e; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--red); border-color: var(--red); color: #fff; } .btn.primary:hover { background: var(--red-2); }
.btn.gold { background: var(--gold); border-color: var(--gold); color: #1d1404; }
.btn.danger { color: #ff8b80; border-color: rgba(211, 58, 44, .45); background: var(--red-soft); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); } .btn.ghost:hover { color: var(--text); background: var(--panel-2); }
.btn.sm { padding: 5px 10px; font-size: 12.5px; border-radius: 8px; }
.btn svg { width: 16px; height: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span { color: var(--muted); font-size: 12px; font-weight: 600; }
.field small { color: var(--faint); font-size: 11.5px; }
input[type=text], input[type=number], input[type=password], input[type=search], input:not([type]), select, textarea {
  background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 10px; padding: 9px 12px; width: 100%; outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--red); box-shadow: 0 0 0 3px var(--red-soft); }
textarea { min-height: 90px; resize: vertical; }
.form { display: grid; gap: 12px; } .form-row { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.inline { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; } .inline > .field { flex: 1 1 160px; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; color: var(--muted); }
.switch { appearance: none; width: 38px; height: 22px; border-radius: 99px; background: var(--line-2); position: relative; cursor: pointer; transition: .15s; flex: none; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: .15s; }
.switch:checked { background: var(--green); } .switch:checked::after { left: 19px; }

/* Badges, pills */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 99px; font-size: 11.5px; font-weight: 600;
  background: var(--panel-2); color: var(--muted); border: 1px solid var(--line-2); white-space: nowrap; }
.badge.green { background: var(--green-soft); color: var(--green); border-color: transparent; }
.badge.red { background: var(--red-soft); color: #ff8b80; border-color: transparent; }
.badge.gold { background: var(--gold-soft); color: var(--gold); border-color: transparent; }
.badge.blue { background: var(--blue-soft); color: var(--blue); border-color: transparent; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); display: inline-block; }
.dot.on { background: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.status-pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 99px; background: var(--panel); border: 1px solid var(--line); font-size: 12.5px; }

/* Tables */
.table-tools { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; } .table-tools input { max-width: 300px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; color: var(--muted); font-weight: 600; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em;
  padding: 10px 12px; background: var(--bg-2); border-bottom: 1px solid var(--line); white-space: nowrap; user-select: none; }
th.sortable { cursor: pointer; } th.sortable:hover { color: var(--text); } th .arrow { color: var(--red); }
td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tbody tr:hover { background: rgba(255, 255, 255, .025); }
tr.clickable { cursor: pointer; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.empty { padding: 28px; text-align: center; color: var(--faint); }
.pager { display: flex; align-items: center; gap: 8px; justify-content: flex-end; margin-top: 10px; color: var(--muted); font-size: 12.5px; }

/* Lists */
.list { display: flex; flex-direction: column; } .list > * { padding: 10px 0; border-bottom: 1px solid var(--line); } .list > *:last-child { border-bottom: none; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; font-size: 13px; } .kv dt { color: var(--muted); } .kv dd { margin: 0; text-align: right; }
.feed-item { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; }
.feed-item time { color: var(--faint); font-size: 11.5px; white-space: nowrap; min-width: 54px; }
.bar { height: 7px; background: var(--line); border-radius: 99px; overflow: hidden; } .bar > i { display: block; height: 100%; background: var(--green); border-radius: 99px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs button { background: none; border: none; padding: 10px 14px; color: var(--muted); font-weight: 600; cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs button.active { color: var(--text); border-color: var(--red); }

/* Player sheet */
.player-head { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.avatar { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; font-size: 22px; font-weight: 800; color: #fff;
  background: linear-gradient(135deg, var(--red), #6b1610); flex: none; }
.meters { display: grid; gap: 10px; } .meter label { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.slot { background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; padding: 9px 10px; font-size: 12.5px; display: flex; flex-direction: column; gap: 4px; }
.slot b { font-weight: 600; line-height: 1.25; } .slot .meta { color: var(--faint); font-size: 11.5px; display: flex; justify-content: space-between; gap: 6px; }

/* Map */
.map-wrap { position: relative; height: min(70vh, 720px); background: #0a0e0c; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; touch-action: none; }
.map-wrap canvas { width: 100%; height: 100%; display: block; cursor: grab; }
.map-tools { position: absolute; top: 10px; right: 10px; display: flex; gap: 6px; }
.map-legend { position: absolute; left: 10px; bottom: 10px; background: rgba(10, 12, 14, .8); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; font-size: 12px; color: var(--muted); }

/* Charts */
.chart { width: 100%; height: 220px; } .chart rect.col { fill: var(--red); } .chart rect.col.alt { fill: var(--gold); }
.chart text { fill: var(--faint); font-size: 10px; } .chart line { stroke: var(--line); }

/* Log */
.log { background: #07090b; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px; height: 62vh; overflow: auto; font-family: var(--mono);
  font-size: 12px; white-space: pre-wrap; word-break: break-word; }
.log .err { color: #ff8b80; } .log .warn { color: var(--gold); }

/* Modals and toasts */
.overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, .6); backdrop-filter: blur(3px); display: grid; place-items: center; z-index: 100; padding: 16px; animation: fade .12s; }
.modal { background: var(--panel); border: 1px solid var(--line-2); border-radius: 18px; box-shadow: var(--shadow); width: min(520px, 100%); max-height: 90vh; overflow: auto; }
.modal.wide { width: min(880px, 100%); }
.modal header { padding: 18px 20px 6px; } .modal header p { margin: 6px 0 0; color: var(--muted); }
.modal .body { padding: 12px 20px; } .modal footer { padding: 12px 20px 18px; display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.toasts { position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 120; max-width: min(420px, calc(100vw - 36px)); }
.toast { background: var(--panel-2); border: 1px solid var(--line-2); border-left: 4px solid var(--blue); border-radius: 12px; padding: 11px 14px; box-shadow: var(--shadow); animation: slide .18s; font-size: 13px; }
.toast.ok { border-left-color: var(--green); } .toast.error { border-left-color: var(--red); }
@keyframes fade { from { opacity: 0; } } @keyframes slide { from { transform: translateY(10px); opacity: 0; } }
.spinner { width: 18px; height: 18px; border: 2px solid var(--line-2); border-top-color: var(--red); border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading { display: flex; gap: 10px; align-items: center; color: var(--muted); padding: 30px; justify-content: center; }
.alert { display: flex; gap: 10px; padding: 11px 14px; border-radius: 12px; background: var(--gold-soft); color: var(--gold); font-size: 13px; }
.alert.red { background: var(--red-soft); color: #ff9c92; } .alert.green { background: var(--green-soft); color: var(--green); }

/* Login */
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 20px;
  background: radial-gradient(ellipse at top, rgba(211, 58, 44, .18), transparent 60%), var(--bg); }
.login-card { width: min(400px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 22px; padding: 30px; box-shadow: var(--shadow); }
.login-card .brand { justify-content: center; padding: 0 0 20px; } .login-card .brand img { width: 56px; height: 56px; border-radius: 14px; }

/* Responsive */
@media (max-width: 1100px) { .cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 280px; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow); }
  .app.menu-open .sidebar { transform: none; }
  .app.menu-open::after { content: ""; position: fixed; inset: 0; background: rgba(0, 0, 0, .5); z-index: 25; }
  .menu-btn { display: inline-flex; }
  .content { padding: 14px; }
  .topbar { padding: 0 12px; }
  .cols-2, .cols-3 { grid-template-columns: 1fr; } .span-2 { grid-column: auto; }
  .topbar .hide-mobile { display: none; }
}
@media (max-width: 520px) { .cols-4 { grid-template-columns: 1fr 1fr; } .stat .value { font-size: 22px; } .card { padding: 14px; } }
