/* ============================================================
   SOPHEL-K · APEXCYBER ARMY — Tema compartilhado
   Cybersecurity command center · dark absoluto
   ============================================================ */
:root {
  --bg: #030609;
  --bg-panel: #050a10;
  --bg-panel-2: #071019;
  --bg-hover: #0a1620;
  --border: rgba(0, 212, 255, 0.14);
  --border-strong: rgba(0, 212, 255, 0.30);
  --cyan: #00d4ff;
  --cyan-dim: #0e7490;
  --text: #c9e7f2;
  --text-dim: #5b8291;
  --red: #ff2a4d;
  --red-dim: rgba(255, 42, 77, 0.15);
  --green: #00ff9c;
  --green-dim: rgba(0, 255, 156, 0.12);
  --purple: #a855f7;
  --amber: #ffb020;
  --mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', Consolas, monospace;
  --sans: 'Inter', 'Segoe UI', system-ui, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 13px;
  overflow: hidden;
}

/* ── scrollbars discretas ─────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(0, 212, 255, 0.18); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0, 212, 255, 0.35); }

/* ── painéis ──────────────────────────────────────────── */
.panel {
  background: linear-gradient(180deg, var(--bg-panel) 0%, #040810 100%);
  border: 1px solid var(--border);
  border-radius: 6px;
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.panel::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-strong) 30%, transparent 70%, transparent);
  pointer-events: none;
}
.panel-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid rgba(0, 212, 255, 0.08);
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
  flex-shrink: 0;
}
.panel-header .dot { width: 5px; height: 5px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 6px var(--cyan); }
.panel-header .spacer { flex: 1; }
.panel-body { padding: 10px 12px; overflow-y: auto; flex: 1; min-height: 0; }

/* ── badges / status ──────────────────────────────────── */
.badge {
  display: inline-block;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 3px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border: 1px solid transparent;
  white-space: nowrap;
}
.badge.critical { color: var(--red); background: var(--red-dim); border-color: rgba(255, 42, 77, 0.4); }
.badge.high { color: #ff6b81; background: rgba(255, 107, 129, 0.1); border-color: rgba(255, 107, 129, 0.3); }
.badge.medium { color: var(--amber); background: rgba(255, 176, 32, 0.1); border-color: rgba(255, 176, 32, 0.3); }
.badge.low { color: var(--cyan); background: rgba(0, 212, 255, 0.08); border-color: rgba(0, 212, 255, 0.25); }
.badge.info { color: var(--text-dim); background: rgba(91, 130, 145, 0.1); border-color: rgba(91, 130, 145, 0.3); }
.badge.success { color: var(--green); background: var(--green-dim); border-color: rgba(0, 255, 156, 0.35); }
.badge.purple { color: var(--purple); background: rgba(168, 85, 247, 0.1); border-color: rgba(168, 85, 247, 0.35); }

/* ── botões ───────────────────────────────────────────── */
.btn {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 7px 14px;
  background: rgba(0, 212, 255, 0.06);
  color: var(--cyan);
  border: 1px solid rgba(0, 212, 255, 0.35);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.btn:hover { background: rgba(0, 212, 255, 0.14); box-shadow: 0 0 12px rgba(0, 212, 255, 0.25); }
.btn:active { transform: translateY(1px); }
.btn.danger { color: var(--red); border-color: rgba(255, 42, 77, 0.4); background: rgba(255, 42, 77, 0.06); }
.btn.danger:hover { background: rgba(255, 42, 77, 0.15); box-shadow: 0 0 12px rgba(255, 42, 77, 0.3); }
.btn.success { color: var(--green); border-color: rgba(0, 255, 156, 0.35); background: rgba(0, 255, 156, 0.05); }
.btn.success:hover { background: rgba(0, 255, 156, 0.12); }
.btn.ghost { border-color: rgba(0, 212, 255, 0.18); color: var(--text-dim); }
.btn.ghost:hover { color: var(--cyan); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ── inputs ───────────────────────────────────────────── */
.input {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text);
  background: rgba(3, 6, 9, 0.85);
  border: 1px solid rgba(0, 212, 255, 0.22);
  border-radius: 4px;
  padding: 8px 12px;
  outline: none;
  width: 100%;
  transition: border 0.15s, box-shadow 0.15s;
}
.input:focus { border-color: rgba(0, 212, 255, 0.55); box-shadow: 0 0 10px rgba(0, 212, 255, 0.15); }
.input::placeholder { color: rgba(91, 130, 145, 0.6); }

/* ── tabela ───────────────────────────────────────────── */
table.data {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--mono);
  font-size: 11px;
}
table.data th {
  text-align: left;
  color: var(--text-dim);
  font-weight: 600;
  font-size: 9.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 6px 8px;
  border-bottom: 1px solid rgba(0, 212, 255, 0.15);
  white-space: nowrap;
}
table.data td {
  padding: 6px 8px;
  border-bottom: 1px solid rgba(0, 212, 255, 0.05);
  color: var(--text);
  white-space: nowrap;
}
table.data tr:hover td { background: rgba(0, 212, 255, 0.04); }

/* ── helpers ──────────────────────────────────────────── */
.mono { font-family: var(--mono); }
.dim { color: var(--text-dim); }
.red { color: var(--red); }
.green { color: var(--green); }
.cyan { color: var(--cyan); }
.purple { color: var(--purple); }
.hidden { display: none !important; }

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}
.live-dot {
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
  animation: pulse-dot 2s ease-in-out infinite;
}
.live-dot.red { background: var(--red); box-shadow: 0 0 8px var(--red); }
.live-dot.cyan { background: var(--cyan); box-shadow: 0 0 8px var(--cyan); }

@keyframes scan-line {
  0% { transform: translateY(-100%); }
  100% { transform: translateY(1000%); }
}

/* ── log níveis ───────────────────────────────────────── */
.log-line { display: flex; gap: 8px; padding: 3px 0; font-family: var(--mono); font-size: 11px; line-height: 1.5; }
.log-line .t { color: var(--text-dim); flex-shrink: 0; }
.log-line .lvl { flex-shrink: 0; font-weight: 700; }
.log-line.info .lvl { color: var(--cyan); }
.log-line.warn .lvl { color: var(--amber); }
.log-line.error .lvl { color: var(--red); }
.log-line.critical .lvl { color: var(--red); text-shadow: 0 0 6px rgba(255, 42, 77, 0.5); }

/* ── login screens (SOPHEL-K full-bleed) ───────────────── */
.login-wrap {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  overflow: hidden;
}
.login-bg {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  user-select: none;
}
.login-bg img {
  width: 100vw;
  height: 100vh;
  object-fit: cover;                /* preenche TUDO — sem bordas, sem espaço vazio */
  filter: contrast(1.22) saturate(1.15) brightness(.92);
  transform: scale(1.06);
  animation: bg-drift 26s ease-in-out infinite alternate;
}
@keyframes bg-drift {
  from { transform: scale(1.06) translateY(-6px); }
  to   { transform: scale(1.12) translateY(8px); }
}
.login-veil {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 90% 70% at 50% 45%, transparent 40%, rgba(1, 4, 8, 0.9) 100%),
    linear-gradient(180deg, rgba(1,4,9, .55), rgba(1,4,9,.78));
  pointer-events: none;
}
/* linhas de scan sobre o fundo */
.login-veil::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(0, 212, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 212, 255, 0.05) 1px, transparent 1px);
  background-size: 52px 52px;
  mix-blend-mode: overlay;
}
.login-box {
  position: relative;
  z-index: 3;
  width: 430px;
  padding: 22px 30px 20px;
  background: rgba(3, 7, 12, 0.86);
  border: 1px solid rgba(0, 212, 255, 0.28);
  border-radius: 8px;
  box-shadow:
    0 0 0 1px rgba(0,0,0,.55),
    0 24px 80px rgba(0, 0, 0, 0.75),
    0 0 70px rgba(0, 212, 255, 0.14),
    inset 0 1px 0 rgba(0, 212, 255, 0.22);
  backdrop-filter: blur(10px) saturate(1.2);
  animation: pop-in .7s cubic-bezier(.2,.8,.2,1) both;
}
@keyframes pop-in {
  from { opacity: 0; transform: translateY(20px) scale(.96); }
  to   { opacity: 1; transform: none; }
}
.login-scan {
  position: absolute;
  inset: 0;
  border-radius: 8px;
  pointer-events: none;
  overflow: hidden;
}
.login-scan::before {
  content: '';
  position: absolute;
  left: 0; right: 0;
  height: 60px;
  background: linear-gradient(180deg, transparent, rgba(0, 212, 255, 0.07), transparent);
  animation: scan-y 4.2s linear infinite;
}
@keyframes scan-y {
  from { top: -60px; }
  to   { top: 100%; }
}
.login-head {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 8.5px;
  letter-spacing: 0.2em;
  color: #7ba7bd;
  justify-content: space-between;
  margin-bottom: 14px;
}
.login-head .corner { color: var(--cyan); font-size: 10px; }
.login-head .sys-tag { color: #8fb4c9; }
.login-head .sys-online { color: #3ef2a5; display: inline-flex; align-items: center; gap: 5px; }
.live-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 8px var(--cyan); animation: blink 1.4s infinite; }
@keyframes blink { 0%,100% { opacity: 1; } 50% { opacity: .25; } }
.login-box h1 { display: none; }
.login-box label { display: block; font-family: var(--mono); font-size: 10px; letter-spacing: 0.2em; color: #a8c9dd; text-transform: uppercase; margin: 2px 0 8px; }
.login-input-row {
  display: flex;
  align-items: center;
  border: 1px solid rgba(0, 212, 255, 0.32);
  background: rgba(0, 30, 45, 0.55);
  border-radius: 5px;
  transition: border-color .2s, box-shadow .2s;
}
.login-input-row:focus-within {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.14), 0 0 26px rgba(0, 212, 255, 0.22) inset;
}
.login-input-row .key-ico {
  padding: 0 5px 0 13px;
  color: var(--cyan);
  font-size: 13px;
  text-shadow: 0 0 9px rgba(0, 212, 255, .8);
}
.login-input-row .input {
  flex: 1;
  border: none;
  background: transparent;
  height: 46px;
  padding: 0 14px 0 8px;
  font-size: 14px;
  letter-spacing: 0.14em;
  color: #e7f6ff;
  text-shadow: 0 0 10px rgba(0, 212, 255, .5);
}
.login-input-row .input::placeholder { color: rgba(140, 190, 220, .45); letter-spacing: .12em; }
.login-input-row .input:focus { outline: none; box-shadow: none; }
.login-box .err { color: #ff5c72; font-family: var(--mono); font-size: 11px; margin-top: 9px; text-align: center; min-height: 17px; text-shadow: 0 0 8px rgba(255,42,77,.55); }
.login-box .btn {
  width: 100%;
  margin-top: 8px;
  padding: 13px;
  font-size: 13px;
  letter-spacing: 0.22em;
  font-weight: 700;
  border-radius: 5px;
  background: linear-gradient(180deg, rgba(0, 212, 255, 0.28), rgba(0, 212, 255, 0.12));
  border: 1px solid rgba(0, 212, 255, 0.55);
  color: #eaffff;
  text-shadow: 0 0 12px rgba(0, 212, 255, .9);
  cursor: pointer;
  transition: transform .15s, box-shadow .2s;
}
.login-box .btn:hover { transform: translateY(-1px); box-shadow: 0 6px 26px rgba(0, 212, 255, 0.35); }
.login-box .btn:active { transform: translateY(0); }
.login-foot {
  margin-top: 15px;
  text-align: center;
  font-size: 9px;
  letter-spacing: 0.34em;
  color: #79a3bd;
}
@media (max-width: 520px) {
  .login-box { width: min(430px, 92vw); padding: 18px 20px 16px; }
}
.login-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(0, 212, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 212, 255, 0.025) 1px, transparent 1px);
  background-size: 44px 44px;
  pointer-events: none;
}
.login-hero {
  position: relative;
  z-index: 1;
  width: min(560px, 92vw);
  pointer-events: none;
  user-select: none;
  animation: hero-rise 1.1s cubic-bezier(.2,.7,.2,1) both;
}
.login-hero img {
  width: 100%;
  display: block;
  filter: drop-shadow(0 0 40px rgba(0, 212, 255, 0.07));
  animation: hero-pulse 5s ease-in-out infinite;
}
@keyframes hero-rise {
  from { opacity: 0; transform: translateY(24px) scale(.97); }
  to   { opacity: 1; transform: none; }
}
@keyframes hero-pulse {
  0%, 100% { filter: drop-shadow(0 0 30px rgba(0,212,255,0.05)) brightness(1); }
  50%      { filter: drop-shadow(0 0 55px rgba(255,42,77,0.10)) brightness(1.06); }
}
.login-box {
  position: relative;
  z-index: 2;
  width: 420px;
  margin-top: -22px;
  padding: 20px 28px 18px;
  background: rgba(4, 9, 15, 0.9);
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: 0 0 40px rgba(0, 212, 255, 0.08), inset 0 1px 0 rgba(0, 212, 255, 0.12);
  backdrop-filter: blur(3px);
  animation: hero-rise 1.2s .15s cubic-bezier(.2,.7,.2,1) both;
}
.login-scan {
  position: absolute;
  inset: 0;
  border-radius: 6px;
  pointer-events: none;
  overflow: hidden;
}
.login-scan::before {
  content: '';
  position: absolute;
  left: 0; right: 0;
  height: 44px;
  background: linear-gradient(180deg, transparent, rgba(0, 212, 255, 0.05), transparent);
  animation: scan-y 3.5s linear infinite;
}
@keyframes scan-y {
  from { top: -44px; }
  to   { top: 100%; }
}
.login-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 8.5px;
  letter-spacing: 0.2em;
  color: var(--text-dim);
  margin-bottom: 14px;
}
.login-head .corner { color: var(--cyan); font-size: 9px; }
.login-head .sys-tag { color: var(--text-dim); }
.login-head .sys-online { color: #37e08d; display: inline-flex; align-items: center; gap: 5px; }
.login-box h1 { font-family: var(--mono); font-size: 18px; letter-spacing: 0.3em; color: var(--cyan); text-align: center; margin-bottom: 4px; }
.login-box .sub { font-family: var(--mono); font-size: 9px; letter-spacing: 0.35em; color: var(--text-dim); text-align: center; margin-bottom: 22px; }
.login-box label { display: block; font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.18em; color: var(--text-dim); text-transform: uppercase; margin: 2px 0 6px; }
.login-input-row {
  display: flex;
  align-items: center;
  border: 1px solid var(--border);
  background: rgba(0, 212, 255, 0.03);
  border-radius: 4px;
  transition: border-color .2s, box-shadow .2s;
}
.login-input-row:focus-within {
  border-color: var(--cyan);
  box-shadow: 0 0 14px rgba(0, 212, 255, 0.18);
}
.login-input-row .key-ico {
  padding: 0 4px 0 12px;
  color: var(--cyan);
  font-size: 12px;
  opacity: .8;
}
.login-input-row .input {
  flex: 1;
  border: none;
  background: transparent;
  height: 40px;
  padding: 0 12px 0 6px;
  font-size: 13px;
  letter-spacing: 0.12em;
}
.login-input-row .input:focus { outline: none; box-shadow: none; }
.login-box .err { color: var(--red); font-family: var(--mono); font-size: 11px; margin-top: 8px; text-align: center; min-height: 16px; }
.login-box .btn { width: 100%; margin-top: 10px; padding: 11px; font-size: 12px; letter-spacing: 0.15em; }
.login-foot {
  margin-top: 14px;
  text-align: center;
  font-size: 9px;
  letter-spacing: 0.28em;
  color: var(--text-dim);
}
@media (max-width: 640px) {
  .login-hero { width: min(430px, 96vw); }
  .login-box { width: min(420px, 92vw); }
}
